forked from Imagelibrary/rtems
typos fixed
This commit is contained in:
@@ -109,7 +109,7 @@ Message_queue_Control *_Message_queue_Allocate (
|
||||
*
|
||||
* Output parameters:
|
||||
* id - queue id
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
|
||||
@@ -314,6 +314,8 @@ rtems_status_code rtems_region_get_segment(
|
||||
Thread_Control *executing;
|
||||
void *the_segment;
|
||||
|
||||
*segment = NULL;
|
||||
|
||||
if ( size == 0 )
|
||||
return RTEMS_INVALID_SIZE;
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ extern "C" {
|
||||
#define RTEMS_MESSAGE_QUEUE_DELETE 38
|
||||
#define RTEMS_MESSAGE_QUEUE_SEND 39
|
||||
#define RTEMS_MESSAGE_QUEUE_URGENT 40
|
||||
#define RTEMS_MESSAGE_QUEUE_BROADCAst 41
|
||||
#define RTEMS_MESSAGE_QUEUE_BROADCAST 41
|
||||
#define RTEMS_MESSAGE_QUEUE_RECEIVE 42
|
||||
#define RTEMS_MESSAGE_QUEUE_FLUSH 43
|
||||
#define RTEMS_EVENT_SEND 44
|
||||
|
||||
@@ -115,9 +115,9 @@ STATIC INLINE void _IO_Manager_initialization(
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_io_register_name(
|
||||
char *device_name,
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor
|
||||
char *device_name,
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor
|
||||
);
|
||||
|
||||
|
||||
@@ -130,8 +130,8 @@ rtems_status_code rtems_io_register_name(
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_io_lookup_name(
|
||||
const char *pathname,
|
||||
rtems_driver_name_t **rnp
|
||||
const char *name,
|
||||
rtems_driver_name_t **device_info
|
||||
);
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ rtems_status_code rtems_io_lookup_name(
|
||||
rtems_status_code rtems_io_initialize(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -162,7 +162,7 @@ rtems_status_code rtems_io_initialize(
|
||||
rtems_status_code rtems_io_open(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -177,7 +177,7 @@ rtems_status_code rtems_io_open(
|
||||
rtems_status_code rtems_io_close(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -192,7 +192,7 @@ rtems_status_code rtems_io_close(
|
||||
rtems_status_code rtems_io_read(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -207,7 +207,7 @@ rtems_status_code rtems_io_read(
|
||||
rtems_status_code rtems_io_write(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -222,7 +222,7 @@ rtems_status_code rtems_io_write(
|
||||
rtems_status_code rtems_io_control(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
);
|
||||
|
||||
/*
|
||||
|
||||
@@ -62,7 +62,7 @@ extern "C" {
|
||||
#define RTEMS_MESSAGE_QUEUE_DELETE 38
|
||||
#define RTEMS_MESSAGE_QUEUE_SEND 39
|
||||
#define RTEMS_MESSAGE_QUEUE_URGENT 40
|
||||
#define RTEMS_MESSAGE_QUEUE_BROADCAst 41
|
||||
#define RTEMS_MESSAGE_QUEUE_BROADCAST 41
|
||||
#define RTEMS_MESSAGE_QUEUE_RECEIVE 42
|
||||
#define RTEMS_MESSAGE_QUEUE_FLUSH 43
|
||||
#define RTEMS_EVENT_SEND 44
|
||||
|
||||
@@ -115,9 +115,9 @@ STATIC INLINE void _IO_Manager_initialization(
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_io_register_name(
|
||||
char *device_name,
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor
|
||||
char *device_name,
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor
|
||||
);
|
||||
|
||||
|
||||
@@ -130,8 +130,8 @@ rtems_status_code rtems_io_register_name(
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_io_lookup_name(
|
||||
const char *pathname,
|
||||
rtems_driver_name_t **rnp
|
||||
const char *name,
|
||||
rtems_driver_name_t **device_info
|
||||
);
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ rtems_status_code rtems_io_lookup_name(
|
||||
rtems_status_code rtems_io_initialize(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -162,7 +162,7 @@ rtems_status_code rtems_io_initialize(
|
||||
rtems_status_code rtems_io_open(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -177,7 +177,7 @@ rtems_status_code rtems_io_open(
|
||||
rtems_status_code rtems_io_close(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -192,7 +192,7 @@ rtems_status_code rtems_io_close(
|
||||
rtems_status_code rtems_io_read(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -207,7 +207,7 @@ rtems_status_code rtems_io_read(
|
||||
rtems_status_code rtems_io_write(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -222,7 +222,7 @@ rtems_status_code rtems_io_write(
|
||||
rtems_status_code rtems_io_control(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
);
|
||||
|
||||
/*
|
||||
|
||||
@@ -46,8 +46,13 @@ void _IO_Initialize_all_drivers( void )
|
||||
* Associate a name with a driver
|
||||
*
|
||||
* Input Paramters:
|
||||
* device_name - pointer to name string to associate with device
|
||||
* major - device major number to receive name
|
||||
* minor - device minor number to receive name
|
||||
*
|
||||
* Output Parameters:
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_io_register_name(
|
||||
@@ -90,13 +95,17 @@ rtems_status_code rtems_io_register_name(
|
||||
* Find what driver "owns" this name
|
||||
*
|
||||
* Input Paramters:
|
||||
* name - name to lookup the associated device
|
||||
*
|
||||
* Output Parameters:
|
||||
* device_info - device associate with name
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_io_lookup_name(
|
||||
const char *pathname,
|
||||
rtems_driver_name_t **rnp
|
||||
const char *name,
|
||||
rtems_driver_name_t **device_info
|
||||
)
|
||||
{
|
||||
rtems_driver_name_t *np;
|
||||
@@ -106,13 +115,13 @@ rtems_status_code rtems_io_lookup_name(
|
||||
index < _IO_Number_of_devices ;
|
||||
index++, np++ )
|
||||
if (np->device_name)
|
||||
if (strncmp(np->device_name, pathname, np->device_name_length) == 0)
|
||||
if (strncmp(np->device_name, name, np->device_name_length) == 0)
|
||||
{
|
||||
*rnp = np;
|
||||
*device_info = np;
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
*rnp = 0;
|
||||
*device_info = 0;
|
||||
return RTEMS_UNSATISFIED;
|
||||
}
|
||||
|
||||
@@ -165,7 +174,7 @@ rtems_status_code rtems_io_initialize(
|
||||
rtems_status_code rtems_io_open(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
rtems_device_driver_entry callout;
|
||||
@@ -195,7 +204,7 @@ rtems_status_code rtems_io_open(
|
||||
rtems_status_code rtems_io_close(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
rtems_device_driver_entry callout;
|
||||
@@ -225,7 +234,7 @@ rtems_status_code rtems_io_close(
|
||||
rtems_status_code rtems_io_read(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
rtems_device_driver_entry callout;
|
||||
@@ -255,7 +264,7 @@ rtems_status_code rtems_io_read(
|
||||
rtems_status_code rtems_io_write(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
rtems_device_driver_entry callout;
|
||||
@@ -285,7 +294,7 @@ rtems_status_code rtems_io_write(
|
||||
rtems_status_code rtems_io_control(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
rtems_device_driver_entry callout;
|
||||
|
||||
@@ -108,11 +108,3 @@ thus would be unable to restore the FP context of the incoming task.
|
||||
2. On a deferred FP context switch. In this case, the system might switch
|
||||
from FP Task A to non-FP Task B and then to FP Task C. In this scenario,
|
||||
the floating point state must technically be saved by a non-FP task.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,21 @@
|
||||
/*
|
||||
* SPARC Dependent Source
|
||||
*
|
||||
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* All rights assigned to U.S. Government, 1994.
|
||||
*
|
||||
* This material may be reproduced by or for the U.S. Government pursuant
|
||||
* to the copyright license under the clause at DFARS 252.227-7013. This
|
||||
* notice must appear in all copies of this file and its derivatives.
|
||||
*
|
||||
* Ported to ERC32 implementation of the SPARC by On-Line Applications
|
||||
* Research Corporation (OAR) under contract to the European Space
|
||||
* Agency (ESA).
|
||||
*
|
||||
* ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
|
||||
* European Space Agency.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
@@ -3,6 +3,21 @@
|
||||
* This include file contains information pertaining to the port of
|
||||
* the executive to the SPARC processor.
|
||||
*
|
||||
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* All rights assigned to U.S. Government, 1994.
|
||||
*
|
||||
* This material may be reproduced by or for the U.S. Government pursuant
|
||||
* to the copyright license under the clause at DFARS 252.227-7013. This
|
||||
* notice must appear in all copies of this file and its derivatives.
|
||||
*
|
||||
* Ported to ERC32 implementation of the SPARC by On-Line Applications
|
||||
* Research Corporation (OAR) under contract to the European Space
|
||||
* Agency (ESA).
|
||||
*
|
||||
* ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
|
||||
* European Space Agency.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
@@ -4,6 +4,21 @@
|
||||
* in an specific CPU port of RTEMS. These algorithms must be implemented
|
||||
* in assembly language.
|
||||
*
|
||||
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* All rights assigned to U.S. Government, 1994.
|
||||
*
|
||||
* This material may be reproduced by or for the U.S. Government pursuant
|
||||
* to the copyright license under the clause at DFARS 252.227-7013. This
|
||||
* notice must appear in all copies of this file and its derivatives.
|
||||
*
|
||||
* Ported to ERC32 implementation of the SPARC by On-Line Applications
|
||||
* Research Corporation (OAR) under contract to the European Space
|
||||
* Agency (ESA).
|
||||
*
|
||||
* ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
|
||||
* European Space Agency.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
@@ -18,6 +18,21 @@
|
||||
* + Memory Control Register
|
||||
* + Interrupt Control
|
||||
*
|
||||
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* All rights assigned to U.S. Government, 1994.
|
||||
*
|
||||
* This material may be reproduced by or for the U.S. Government pursuant
|
||||
* to the copyright license under the clause at DFARS 252.227-7013. This
|
||||
* notice must appear in all copies of this file and its derivatives.
|
||||
*
|
||||
* Ported to ERC32 implementation of the SPARC by On-Line Applications
|
||||
* Research Corporation (OAR) under contract to the European Space
|
||||
* Agency (ESA).
|
||||
*
|
||||
* ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
|
||||
* European Space Agency.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
@@ -3,6 +3,21 @@
|
||||
* This file contains the single entry point code for
|
||||
* the SPARC port of RTEMS.
|
||||
*
|
||||
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* All rights assigned to U.S. Government, 1994.
|
||||
*
|
||||
* This material may be reproduced by or for the U.S. Government pursuant
|
||||
* to the copyright license under the clause at DFARS 252.227-7013. This
|
||||
* notice must appear in all copies of this file and its derivatives.
|
||||
*
|
||||
* Ported to ERC32 implementation of the SPARC by On-Line Applications
|
||||
* Research Corporation (OAR) under contract to the European Space
|
||||
* Agency (ESA).
|
||||
*
|
||||
* ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
|
||||
* European Space Agency.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
@@ -3,6 +3,21 @@
|
||||
* This include file contains information pertaining to the SPARC
|
||||
* processor family.
|
||||
*
|
||||
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* All rights assigned to U.S. Government, 1994.
|
||||
*
|
||||
* This material may be reproduced by or for the U.S. Government pursuant
|
||||
* to the copyright license under the clause at DFARS 252.227-7013. This
|
||||
* notice must appear in all copies of this file and its derivatives.
|
||||
*
|
||||
* Ported to ERC32 implementation of the SPARC by On-Line Applications
|
||||
* Research Corporation (OAR) under contract to the European Space
|
||||
* Agency (ESA).
|
||||
*
|
||||
* ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
|
||||
* European Space Agency.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
@@ -3,6 +3,21 @@
|
||||
* This include file contains type definitions pertaining to the
|
||||
* SPARC processor family.
|
||||
*
|
||||
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* All rights assigned to U.S. Government, 1994.
|
||||
*
|
||||
* This material may be reproduced by or for the U.S. Government pursuant
|
||||
* to the copyright license under the clause at DFARS 252.227-7013. This
|
||||
* notice must appear in all copies of this file and its derivatives.
|
||||
*
|
||||
* Ported to ERC32 implementation of the SPARC by On-Line Applications
|
||||
* Research Corporation (OAR) under contract to the European Space
|
||||
* Agency (ESA).
|
||||
*
|
||||
* ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
|
||||
* European Space Agency.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
@@ -18,6 +18,21 @@
|
||||
* + Memory Control Register
|
||||
* + Interrupt Control
|
||||
*
|
||||
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* All rights assigned to U.S. Government, 1994.
|
||||
*
|
||||
* This material may be reproduced by or for the U.S. Government pursuant
|
||||
* to the copyright license under the clause at DFARS 252.227-7013. This
|
||||
* notice must appear in all copies of this file and its derivatives.
|
||||
*
|
||||
* Ported to ERC32 implementation of the SPARC by On-Line Applications
|
||||
* Research Corporation (OAR) under contract to the European Space
|
||||
* Agency (ESA).
|
||||
*
|
||||
* ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
|
||||
* European Space Agency.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
257
c/src/lib/libcpu/sparc/reg_win/window.s
Normal file
257
c/src/lib/libcpu/sparc/reg_win/window.s
Normal file
@@ -0,0 +1,257 @@
|
||||
/*
|
||||
* window.s
|
||||
*
|
||||
* This file contains the register window management routines for the
|
||||
* SPARC architecture. Trap handlers for the following capabilities
|
||||
* are included in this file:
|
||||
*
|
||||
* + Window Overflow
|
||||
* + Window Underflow
|
||||
* + Flushing All Windows
|
||||
*
|
||||
* COPYRIGHT:
|
||||
*
|
||||
* This file includes the window overflow and underflow handlers from
|
||||
* the file srt0.s provided with the binary distribution of the SPARC
|
||||
* Instruction Simulator (SIS) found at
|
||||
* ftp://ftp.estec.esa.nl/pub/ws/wsd/erc32.
|
||||
*
|
||||
* COPYRIGHT (c) 1995. European Space Agency.
|
||||
*
|
||||
* This terms of the RTEMS license apply to this file.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <asm.h>
|
||||
|
||||
.seg "text"
|
||||
/*
|
||||
* Window overflow trap handler.
|
||||
*
|
||||
* On entry:
|
||||
*
|
||||
* l0 = psr (from trap table)
|
||||
* l1 = pc
|
||||
* l2 = npc
|
||||
*/
|
||||
|
||||
PUBLIC(window_overflow_trap_handler)
|
||||
|
||||
SYM(window_overflow_trap_handler):
|
||||
|
||||
/*
|
||||
* Calculate new WIM by "rotating" the valid bits in the WIM right
|
||||
* by one position. The following shows how the bits move for a SPARC
|
||||
* cpu implementation where SPARC_NUMBER_OF_REGISTER_WINDOWS is 8.
|
||||
*
|
||||
* OLD WIM = 76543210
|
||||
* NEW WIM = 07654321
|
||||
*
|
||||
* NOTE: New WIM must be stored in a global register since the
|
||||
* "save" instruction just prior to the load of the wim
|
||||
* register will result in the local register set changing.
|
||||
*/
|
||||
|
||||
mov %wim, %l3 ! l3 = WIM
|
||||
mov %g1, %l7 ! save g1
|
||||
srl %l3, 1, %g1 ! g1 = WIM >> 1
|
||||
sll %l3, SPARC_NUMBER_OF_REGISTER_WINDOWS-1 , %l4
|
||||
! l4 = WIM << (Number Windows - 1)
|
||||
or %l4, %g1, %g1 ! g1 = (WIM >> 1) |
|
||||
! (WIM << (Number Windows - 1))
|
||||
|
||||
save ! Get into window to be saved.
|
||||
mov %g1, %wim ! load new WIM
|
||||
nop; nop; nop ! 3 slot delay
|
||||
std %l0, [%sp + 0x00] ! save local register set
|
||||
std %l2, [%sp + 0x08]
|
||||
std %l4, [%sp + 0x10]
|
||||
std %l6, [%sp + 0x18]
|
||||
std %i0, [%sp + 0x20] ! save input register set
|
||||
std %i2, [%sp + 0x28]
|
||||
std %i4, [%sp + 0x30]
|
||||
std %i6, [%sp + 0x38]
|
||||
restore ! Go back to trap window.
|
||||
mov %l7, %g1 ! restore g1
|
||||
jmp %l1 ! Re-execute save.
|
||||
rett %l2
|
||||
|
||||
/*
|
||||
* Window underflow trap handler.
|
||||
*
|
||||
* On entry:
|
||||
*
|
||||
* l0 = psr (from trap table)
|
||||
* l1 = pc
|
||||
* l2 = npc
|
||||
*/
|
||||
|
||||
PUBLIC(window_underflow_trap_handler)
|
||||
|
||||
SYM(window_underflow_trap_handler):
|
||||
|
||||
/*
|
||||
* Calculate new WIM by "rotating" the valid bits in the WIM left
|
||||
* by one position. The following shows how the bits move for a SPARC
|
||||
* cpu implementation where SPARC_NUMBER_OF_REGISTER_WINDOWS is 8.
|
||||
*
|
||||
* OLD WIM = 76543210
|
||||
* NEW WIM = 07654321
|
||||
*
|
||||
* NOTE: New WIM must be stored in a global register since the
|
||||
* "save" instruction just prior to the load of the wim
|
||||
* register will result in the local register set changing.
|
||||
*/
|
||||
|
||||
mov %wim, %l3 ! Calculate new WIM
|
||||
sll %l3, 1, %l4 ! l4 = WIM << 1
|
||||
srl %l3, SPARC_NUMBER_OF_REGISTER_WINDOWS-1, %l5
|
||||
! l5 = WIM >> (Number Windows-1)
|
||||
or %l5, %l4, %l5 ! l5 = (WIM << 1) |
|
||||
! (WIM >> (Number Windows-1))
|
||||
mov %l5, %wim ! load the new WIM
|
||||
nop; nop; nop
|
||||
restore ! Two restores to get into the
|
||||
restore ! window to restore
|
||||
ldd [%sp + 0x00], %l0 ! First the local register set
|
||||
ldd [%sp + 0x08], %l2
|
||||
ldd [%sp + 0x10], %l4
|
||||
ldd [%sp + 0x18], %l6
|
||||
ldd [%sp + 0x20], %i0 ! Then the input registers
|
||||
ldd [%sp + 0x28], %i2
|
||||
ldd [%sp + 0x30], %i4
|
||||
ldd [%sp + 0x38], %i6
|
||||
save ! Get back to the trap window.
|
||||
save
|
||||
jmp %l1 ! Re-execute restore.
|
||||
rett %l2
|
||||
|
||||
/*
|
||||
* Flush All Windows trap handler.
|
||||
*
|
||||
* Flush all windows with valid contents except the current one
|
||||
* and the one we will be returning to.
|
||||
*
|
||||
* In examining the set register windows, one may logically divide
|
||||
* the windows into sets (some of which may be empty) based on their
|
||||
* current status:
|
||||
*
|
||||
* + current (i.e. in use),
|
||||
* + used (i.e. a restore would not trap)
|
||||
* + invalid (i.e. 1 in corresponding bit in WIM)
|
||||
* + unused
|
||||
*
|
||||
* Either the used or unused set of windows may be empty.
|
||||
*
|
||||
* NOTE: We assume only one bit is set in the WIM at a time.
|
||||
*
|
||||
* Given a CWP of 5 and a WIM of 0x1, the registers are divided
|
||||
* into sets as follows:
|
||||
*
|
||||
* + 0 - invalid
|
||||
* + 1-4 - unused
|
||||
* + 5 - current
|
||||
* + 6-7 - used
|
||||
*
|
||||
* In this case, we only would save the used windows which we
|
||||
* will not be returning to -- 6.
|
||||
*
|
||||
* Register Usage while saving the windows:
|
||||
* g1 = current PSR
|
||||
* g2 = current wim
|
||||
* g3 = CWP
|
||||
* g4 = wim scratch
|
||||
* g5 = scratch
|
||||
*
|
||||
* On entry:
|
||||
*
|
||||
* l0 = psr (from trap table)
|
||||
* l1 = pc
|
||||
* l2 = npc
|
||||
*/
|
||||
|
||||
PUBLIC(window_flush_trap_handler)
|
||||
|
||||
SYM(window_flush_trap_handler):
|
||||
/*
|
||||
* Save the global registers we will be using
|
||||
*/
|
||||
|
||||
mov %g1, %l3
|
||||
mov %g2, %l4
|
||||
mov %g3, %l5
|
||||
mov %g4, %l6
|
||||
mov %g5, %l7
|
||||
|
||||
mov %l0, %g1 ! g1 = psr
|
||||
mov %wim, %g2 ! g2 = wim
|
||||
and %l0, SPARC_PSR_CWP_MASK, %g3 ! g3 = CWP
|
||||
|
||||
add %g3, 1, %g5 ! g5 = CWP + 1
|
||||
and %g5, SPARC_NUMBER_OF_REGISTER_WINDOWS - 1, %g5
|
||||
|
||||
mov 1, %g4
|
||||
sll %g4, %g5, %g4 ! g4 = WIM mask for CWP+1 invalid
|
||||
|
||||
restore ! go back one register window
|
||||
|
||||
save_frame_loop:
|
||||
sll %g4, 1, %g5 ! rotate the "wim" left 1
|
||||
srl %g4, SPARC_NUMBER_OF_REGISTER_WINDOWS - 1, %g4
|
||||
or %g4, %g5, %g4 ! g4 = wim if we do one restore
|
||||
|
||||
/*
|
||||
* If a restore would not underflow, then continue.
|
||||
*/
|
||||
|
||||
andcc %g4, %g2, %g0 ! Any windows to flush?
|
||||
bnz done_flushing ! No, then continue
|
||||
nop
|
||||
|
||||
restore ! back one window
|
||||
|
||||
/*
|
||||
* Now save the window just as if we overflowed to it.
|
||||
*/
|
||||
|
||||
std %l0, [%sp + CPU_STACK_FRAME_L0_OFFSET]
|
||||
std %l2, [%sp + CPU_STACK_FRAME_L2_OFFSET]
|
||||
std %l4, [%sp + CPU_STACK_FRAME_L4_OFFSET]
|
||||
std %l6, [%sp + CPU_STACK_FRAME_L6_OFFSET]
|
||||
|
||||
std %i0, [%sp + CPU_STACK_FRAME_I0_OFFSET]
|
||||
std %i2, [%sp + CPU_STACK_FRAME_I2_OFFSET]
|
||||
std %i4, [%sp + CPU_STACK_FRAME_I4_OFFSET]
|
||||
std %i6, [%sp + CPU_STACK_FRAME_I6_FP_OFFSET]
|
||||
|
||||
ba save_frame_loop
|
||||
nop
|
||||
|
||||
done_flushing:
|
||||
|
||||
add %g3, 2, %g3 ! calculate desired WIM
|
||||
and %g3, SPARC_NUMBER_OF_REGISTER_WINDOWS - 1, %g3
|
||||
mov 1, %g4
|
||||
sll %g4, %g3, %g4 ! g4 = new WIM
|
||||
mov %g4, %wim
|
||||
|
||||
mov %g1, %psr ! restore PSR
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
/*
|
||||
* Restore the global registers we used
|
||||
*/
|
||||
|
||||
mov %l3, %g1
|
||||
mov %l4, %g2
|
||||
mov %l5, %g3
|
||||
mov %l6, %g4
|
||||
mov %l7, %g5
|
||||
|
||||
jmpl %l2, %g0
|
||||
rett %l2 + 4
|
||||
|
||||
/* end of file */
|
||||
@@ -354,6 +354,8 @@ uninitialized =
|
||||
|
||||
uninitialized = 0;
|
||||
|
||||
#ifndef unix /* make sure this is not a native compile */
|
||||
|
||||
#ifdef i386
|
||||
|
||||
/* cpu.h */
|
||||
@@ -424,6 +426,7 @@ uninitialized += (sizeof _CPU_Interrupt_stack_low) +
|
||||
(sizeof _CPU_IRQ_info);
|
||||
|
||||
#endif
|
||||
#endif /* !unix */
|
||||
|
||||
initialized +=
|
||||
/*copyrt.h*/ (strlen(_Copyright_Notice)+1) +
|
||||
@@ -437,11 +440,13 @@ initialized +=
|
||||
(sizeof _TOD_Days_to_date) +
|
||||
(sizeof _TOD_Days_since_last_leap_year);
|
||||
|
||||
#ifndef unix /* make sure this is not native */
|
||||
#ifdef sparc
|
||||
|
||||
initialized += (sizeof _CPU_Trap_slot_template);
|
||||
|
||||
#endif
|
||||
#endif /* !unix */
|
||||
|
||||
puts( "" );
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ Message_queue_Control *_Message_queue_Allocate (
|
||||
*
|
||||
* Output parameters:
|
||||
* id - queue id
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
|
||||
@@ -314,6 +314,8 @@ rtems_status_code rtems_region_get_segment(
|
||||
Thread_Control *executing;
|
||||
void *the_segment;
|
||||
|
||||
*segment = NULL;
|
||||
|
||||
if ( size == 0 )
|
||||
return RTEMS_INVALID_SIZE;
|
||||
|
||||
|
||||
@@ -115,9 +115,9 @@ STATIC INLINE void _IO_Manager_initialization(
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_io_register_name(
|
||||
char *device_name,
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor
|
||||
char *device_name,
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor
|
||||
);
|
||||
|
||||
|
||||
@@ -130,8 +130,8 @@ rtems_status_code rtems_io_register_name(
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_io_lookup_name(
|
||||
const char *pathname,
|
||||
rtems_driver_name_t **rnp
|
||||
const char *name,
|
||||
rtems_driver_name_t **device_info
|
||||
);
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ rtems_status_code rtems_io_lookup_name(
|
||||
rtems_status_code rtems_io_initialize(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -162,7 +162,7 @@ rtems_status_code rtems_io_initialize(
|
||||
rtems_status_code rtems_io_open(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -177,7 +177,7 @@ rtems_status_code rtems_io_open(
|
||||
rtems_status_code rtems_io_close(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -192,7 +192,7 @@ rtems_status_code rtems_io_close(
|
||||
rtems_status_code rtems_io_read(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -207,7 +207,7 @@ rtems_status_code rtems_io_read(
|
||||
rtems_status_code rtems_io_write(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -222,7 +222,7 @@ rtems_status_code rtems_io_write(
|
||||
rtems_status_code rtems_io_control(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
);
|
||||
|
||||
/*
|
||||
|
||||
@@ -46,8 +46,13 @@ void _IO_Initialize_all_drivers( void )
|
||||
* Associate a name with a driver
|
||||
*
|
||||
* Input Paramters:
|
||||
* device_name - pointer to name string to associate with device
|
||||
* major - device major number to receive name
|
||||
* minor - device minor number to receive name
|
||||
*
|
||||
* Output Parameters:
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_io_register_name(
|
||||
@@ -90,13 +95,17 @@ rtems_status_code rtems_io_register_name(
|
||||
* Find what driver "owns" this name
|
||||
*
|
||||
* Input Paramters:
|
||||
* name - name to lookup the associated device
|
||||
*
|
||||
* Output Parameters:
|
||||
* device_info - device associate with name
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_io_lookup_name(
|
||||
const char *pathname,
|
||||
rtems_driver_name_t **rnp
|
||||
const char *name,
|
||||
rtems_driver_name_t **device_info
|
||||
)
|
||||
{
|
||||
rtems_driver_name_t *np;
|
||||
@@ -106,13 +115,13 @@ rtems_status_code rtems_io_lookup_name(
|
||||
index < _IO_Number_of_devices ;
|
||||
index++, np++ )
|
||||
if (np->device_name)
|
||||
if (strncmp(np->device_name, pathname, np->device_name_length) == 0)
|
||||
if (strncmp(np->device_name, name, np->device_name_length) == 0)
|
||||
{
|
||||
*rnp = np;
|
||||
*device_info = np;
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
*rnp = 0;
|
||||
*device_info = 0;
|
||||
return RTEMS_UNSATISFIED;
|
||||
}
|
||||
|
||||
@@ -165,7 +174,7 @@ rtems_status_code rtems_io_initialize(
|
||||
rtems_status_code rtems_io_open(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
rtems_device_driver_entry callout;
|
||||
@@ -195,7 +204,7 @@ rtems_status_code rtems_io_open(
|
||||
rtems_status_code rtems_io_close(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
rtems_device_driver_entry callout;
|
||||
@@ -225,7 +234,7 @@ rtems_status_code rtems_io_close(
|
||||
rtems_status_code rtems_io_read(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
rtems_device_driver_entry callout;
|
||||
@@ -255,7 +264,7 @@ rtems_status_code rtems_io_read(
|
||||
rtems_status_code rtems_io_write(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
rtems_device_driver_entry callout;
|
||||
@@ -285,7 +294,7 @@ rtems_status_code rtems_io_write(
|
||||
rtems_status_code rtems_io_control(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *argument
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
rtems_device_driver_entry callout;
|
||||
|
||||
@@ -108,11 +108,3 @@ thus would be unable to restore the FP context of the incoming task.
|
||||
2. On a deferred FP context switch. In this case, the system might switch
|
||||
from FP Task A to non-FP Task B and then to FP Task C. In this scenario,
|
||||
the floating point state must technically be saved by a non-FP task.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,21 @@
|
||||
/*
|
||||
* SPARC Dependent Source
|
||||
*
|
||||
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* All rights assigned to U.S. Government, 1994.
|
||||
*
|
||||
* This material may be reproduced by or for the U.S. Government pursuant
|
||||
* to the copyright license under the clause at DFARS 252.227-7013. This
|
||||
* notice must appear in all copies of this file and its derivatives.
|
||||
*
|
||||
* Ported to ERC32 implementation of the SPARC by On-Line Applications
|
||||
* Research Corporation (OAR) under contract to the European Space
|
||||
* Agency (ESA).
|
||||
*
|
||||
* ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
|
||||
* European Space Agency.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
@@ -354,6 +354,8 @@ uninitialized =
|
||||
|
||||
uninitialized = 0;
|
||||
|
||||
#ifndef unix /* make sure this is not a native compile */
|
||||
|
||||
#ifdef i386
|
||||
|
||||
/* cpu.h */
|
||||
@@ -424,6 +426,7 @@ uninitialized += (sizeof _CPU_Interrupt_stack_low) +
|
||||
(sizeof _CPU_IRQ_info);
|
||||
|
||||
#endif
|
||||
#endif /* !unix */
|
||||
|
||||
initialized +=
|
||||
/*copyrt.h*/ (strlen(_Copyright_Notice)+1) +
|
||||
@@ -437,11 +440,13 @@ initialized +=
|
||||
(sizeof _TOD_Days_to_date) +
|
||||
(sizeof _TOD_Days_since_last_leap_year);
|
||||
|
||||
#ifndef unix /* make sure this is not native */
|
||||
#ifdef sparc
|
||||
|
||||
initialized += (sizeof _CPU_Trap_slot_template);
|
||||
|
||||
#endif
|
||||
#endif /* !unix */
|
||||
|
||||
puts( "" );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user