RTEMS CPU Kit with SuperCore  4.11.3
Data Structures | Macros | Functions | Variables
Processor Dependent Context Management

From the highest level viewpoint, there are 2 types of context to save. More...

Collaboration diagram for Processor Dependent Context Management:

Data Structures

struct  Context_Control
 This defines the minimal set of integer and processor state registers that must be saved during a voluntary context switch from one thread to another. More...
 
struct  Context_Control_fp
 This defines the complete set of floating point registers that must be saved during any context switch from one thread to another. More...
 
struct  CPU_Interrupt_frame
 This defines the set of integer and processor state registers that must be saved during an interrupt. More...
 

Macros

#define _CPU_Context_Get_SP(_context)   (_context)->register_sp
 
#define CPU_CONTEXT_FP_SIZE   sizeof( Context_Control_fp )
 The size of the floating point context area. More...
 
#define CPU_STACK_MINIMUM_SIZE   (1024*8)
 Should be large enough to run all RTEMS tests. More...
 
#define _CPU_Context_Fp_start(_base, _offset)   ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
 The purpose of this macro is to allow the initial pointer into a floating point context area (used to save the floating point context) to be at an arbitrary place in the floating point context area. More...
 
#define _CPU_Context_Get_SP(_context)   (_context)->sp
 This macro returns the stack pointer associated with _context. More...
 
#define CPU_CONTEXT_FP_SIZE   sizeof( Context_Control_fp )
 The size of the floating point context area. More...
 
#define CPU_STACK_MINIMUM_SIZE   (1024*4)
 Should be large enough to run all RTEMS tests. More...
 
#define _CPU_Context_Fp_start(_base, _offset)
 The purpose of this macro is to allow the initial pointer into a floating point context area (used to save the floating point context) to be at an arbitrary place in the floating point context area. More...
 
#define _CPU_Context_Get_SP(_context)   (_context)->sp
 This macro returns the stack pointer associated with _context. More...
 
#define CPU_STACK_MINIMUM_SIZE   (2048L)
 Should be large enough to run all RTEMS tests. More...
 
#define _CPU_Context_Fp_start(_base, _offset)   ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
 The purpose of this macro is to allow the initial pointer into a floating point context area (used to save the floating point context) to be at an arbitrary place in the floating point context area. More...
 
#define _CPU_Context_Get_SP(_context)   (_context)->r15_sp
 This macro returns the stack pointer associated with _context. More...
 
#define CPU_CONTEXT_FP_SIZE   sizeof( Context_Control_fp )
 The size of the floating point context area. More...
 
#define CPU_STACK_MINIMUM_SIZE   (1024)
 Should be large enough to run all RTEMS tests. More...
 
#define _CPU_Context_Fp_start(_base, _offset)   ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
 The purpose of this macro is to allow the initial pointer into a floating point context area (used to save the floating point context) to be at an arbitrary place in the floating point context area. More...
 
#define _CPU_Context_Get_SP(_context)   (_context)->stack_pointer
 This macro returns the stack pointer associated with _context. More...
 
#define CPU_CONTEXT_FP_SIZE   sizeof( Context_Control_fp )
 The size of the floating point context area. More...
 
#define CPU_STACK_MINIMUM_SIZE   (1024*4)
 Should be large enough to run all RTEMS tests. More...
 
#define _CPU_Context_Initialize(_the_context, _stack_base, _size, _isr, _entry_point, _is_fp, _tls_area)
 Initialize the context to a state suitable for starting a task after a context restore operation. More...
 
#define _CPU_Context_Fp_start(_base, _offset)   ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
 The purpose of this macro is to allow the initial pointer into a floating point context area (used to save the floating point context) to be at an arbitrary place in the floating point context area. More...
 
#define _CPU_Context_Get_SP(_context)   (_context)->r3_stack_pointer
 This macro returns the stack pointer associated with _context. More...
 
#define CPU_CONTEXT_FP_SIZE   0
 The size of the floating point context area. More...
 
#define CPU_STACK_MINIMUM_SIZE   (1024*4)
 Should be large enough to run all RTEMS tests. More...
 

Functions

void _CPU_Context_Initialize (Context_Control *the_context, uint32_t *stack_base, uint32_t size, uint32_t new_level, void *entry_point, bool is_fp, void *tls_area)
 Initialize the context to a state suitable for starting a task after a context restore operation. More...
 
void _CPU_Context_switch (Context_Control *run, Context_Control *heir)
 This routine switches from the run context to the heir context. More...
 
void _CPU_Context_restore (Context_Control *new_context)
 This routine is generally used only to restart self in an efficient manner. More...
 
void _CPU_Context_save_fp (Context_Control_fp **fp_context_ptr)
 This routine saves the floating point context passed to it. More...
 
void _CPU_Context_restore_fp (Context_Control_fp **fp_context_ptr)
 This routine restores the floating point context passed to it. More...
 
void _CPU_Context_Initialize (Context_Control *the_context, uint32_t *stack_base, size_t size, uint32_t new_level, void *entry_point, bool is_fp, void *tls_area)
 Initialize the context to a state suitable for starting a task after a context restore operation. More...
 

Variables

SCORE_EXTERN Context_Control_fp _CPU_Null_fp_context
 This variable is optional. More...
 
char _gp []
 Initialize the context to a state suitable for starting a task after a context restore operation. More...
 
SCORE_EXTERN Context_Control_fp _CPU_Null_fp_context
 This variable is optional. More...
 
SCORE_EXTERN Context_Control_fp _CPU_Null_fp_context
 This variable is optional. More...
 

Detailed Description

From the highest level viewpoint, there are 2 types of context to save.

  1. Interrupt registers to save
  2. Task level registers to save

Since RTEMS handles integer and floating point contexts separately, this means we have the following 3 context items:

  1. task level context stuff:: Context_Control
  2. floating point task stuff:: Context_Control_fp
  3. special interrupt level context :: CPU_Interrupt_frame

On some processors, it is cost-effective to save only the callee preserved registers during a task context switch. This means that the ISR code needs to save those registers which do not persist across function calls. It is not mandatory to make this distinctions between the caller/callee saves registers for the purpose of minimizing context saved during task switch and on interrupts. If the cost of saving extra registers is minimal, simplicity is the choice. Save the same context on interrupt entry as for tasks in this case.

Additionally, if gdb is to be made aware of RTEMS tasks for this CPU, then care should be used in designing the context area.

On some CPUs with hardware floating point support, the Context_Control_fp structure will not be used or it simply consist of an array of a fixed number of bytes. This is done when the floating point context is dumped by a "FP save context" type instruction and the format is not really defined by the CPU. In this case, there is no need to figure out the exact format – only the size. Of course, although this is enough information for RTEMS, it is probably not enough for a debugger such as gdb. But that is another problem.

Port Specific Information:

XXX document implementation including references if appropriate

  1. Interrupt registers to save
  2. Task level registers to save

Since RTEMS handles integer and floating point contexts separately, this means we have the following 3 context items:

  1. task level context stuff:: Context_Control
  2. floating point task stuff:: Context_Control_fp
  3. special interrupt level context :: CPU_Interrupt_frame

On some processors, it is cost-effective to save only the callee preserved registers during a task context switch. This means that the ISR code needs to save those registers which do not persist across function calls. It is not mandatory to make this distinctions between the caller/callee saves registers for the purpose of minimizing context saved during task switch and on interrupts. If the cost of saving extra registers is minimal, simplicity is the choice. Save the same context on interrupt entry as for tasks in this case.

Additionally, if gdb is to be made aware of RTEMS tasks for this CPU, then care should be used in designing the context area.

On some CPUs with hardware floating point support, the Context_Control_fp structure will not be used or it simply consist of an array of a fixed number of bytes. This is done when the floating point context is dumped by a "FP save context" type instruction and the format is not really defined by the CPU. In this case, there is no need to figure out the exact format – only the size. Of course, although this is enough information for RTEMS, it is probably not enough for a debugger such as gdb. But that is another problem.

Port Specific Information:

On the v850, this port saves special registers and those that are callee saved.

Macro Definition Documentation

◆ _CPU_Context_Fp_start [1/5]

#define _CPU_Context_Fp_start (   _base,
  _offset 
)    ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )

The purpose of this macro is to allow the initial pointer into a floating point context area (used to save the floating point context) to be at an arbitrary place in the floating point context area.

This is necessary because some FP units are designed to have their context saved as a stack which grows into lower addresses. Other FP units can be saved by simply moving registers into offsets from the base of the context area. Finally some FP units provide a "dump context" instruction which could fill in from high to low or low to high based on the whim of the CPU designers.

Parameters
[in]_baseis the lowest physical address of the floating point context area
[in]_offsetis the offset into the floating point area

Port Specific Information:

XXX document implementation including references if appropriate

◆ _CPU_Context_Fp_start [2/5]

#define _CPU_Context_Fp_start (   _base,
  _offset 
)    ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )

The purpose of this macro is to allow the initial pointer into a floating point context area (used to save the floating point context) to be at an arbitrary place in the floating point context area.

This is necessary because some FP units are designed to have their context saved as a stack which grows into lower addresses. Other FP units can be saved by simply moving registers into offsets from the base of the context area. Finally some FP units provide a "dump context" instruction which could fill in from high to low or low to high based on the whim of the CPU designers.

Parameters
[in]_baseis the lowest physical address of the floating point context area
[in]_offsetis the offset into the floating point area

Port Specific Information:

XXX document implementation including references if appropriate

◆ _CPU_Context_Fp_start [3/5]

#define _CPU_Context_Fp_start (   _base,
  _offset 
)

The purpose of this macro is to allow the initial pointer into a floating point context area (used to save the floating point context) to be at an arbitrary place in the floating point context area.

This is necessary because some FP units are designed to have their context saved as a stack which grows into lower addresses. Other FP units can be saved by simply moving registers into offsets from the base of the context area. Finally some FP units provide a "dump context" instruction which could fill in from high to low or low to high based on the whim of the CPU designers.

Parameters
[in]_baseis the lowest physical address of the floating point context area
[in]_offsetis the offset into the floating point area

Port Specific Information:

XXX document implementation including references if appropriate

◆ _CPU_Context_Fp_start [4/5]

#define _CPU_Context_Fp_start (   _base,
  _offset 
)    ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )

The purpose of this macro is to allow the initial pointer into a floating point context area (used to save the floating point context) to be at an arbitrary place in the floating point context area.

This is necessary because some FP units are designed to have their context saved as a stack which grows into lower addresses. Other FP units can be saved by simply moving registers into offsets from the base of the context area. Finally some FP units provide a "dump context" instruction which could fill in from high to low or low to high based on the whim of the CPU designers.

Parameters
[in]_baseis the lowest physical address of the floating point context area
[in]_offsetis the offset into the floating point area

Port Specific Information:

XXX document implementation including references if appropriate

◆ _CPU_Context_Fp_start [5/5]

#define _CPU_Context_Fp_start (   _base,
  _offset 
)    ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )

The purpose of this macro is to allow the initial pointer into a floating point context area (used to save the floating point context) to be at an arbitrary place in the floating point context area.

This is necessary because some FP units are designed to have their context saved as a stack which grows into lower addresses. Other FP units can be saved by simply moving registers into offsets from the base of the context area. Finally some FP units provide a "dump context" instruction which could fill in from high to low or low to high based on the whim of the CPU designers.

Parameters
[in]_baseis the lowest physical address of the floating point context area
[in]_offsetis the offset into the floating point area

Port Specific Information:

XXX document implementation including references if appropriate

◆ _CPU_Context_Get_SP [1/5]

#define _CPU_Context_Get_SP (   _context)    (_context)->r3_stack_pointer

This macro returns the stack pointer associated with _context.

Parameters
[in]_contextis the thread context area to access
Returns
This method returns the stack pointer.

◆ _CPU_Context_Get_SP [2/5]

#define _CPU_Context_Get_SP (   _context)    (_context)->sp

This macro returns the stack pointer associated with _context.

Parameters
[in]_contextis the thread context area to access
Returns
This method returns the stack pointer.

◆ _CPU_Context_Get_SP [3/5]

#define _CPU_Context_Get_SP (   _context)    (_context)->sp

This macro returns the stack pointer associated with _context.

Parameters
[in]_contextis the thread context area to access
Returns
This method returns the stack pointer.

◆ _CPU_Context_Get_SP [4/5]

#define _CPU_Context_Get_SP (   _context)    (_context)->r15_sp

This macro returns the stack pointer associated with _context.

Parameters
[in]_contextis the thread context area to access
Returns
This method returns the stack pointer.

◆ _CPU_Context_Get_SP [5/5]

#define _CPU_Context_Get_SP (   _context)    (_context)->stack_pointer

This macro returns the stack pointer associated with _context.

Parameters
[in]_contextis the thread context area to access
Returns
This method returns the stack pointer.

◆ _CPU_Context_Initialize

#define _CPU_Context_Initialize (   _the_context,
  _stack_base,
  _size,
  _isr,
  _entry_point,
  _is_fp,
  _tls_area 
)
Value:
{ \
}

Initialize the context to a state suitable for starting a task after a context restore operation.

Generally, this involves:

  • setting a starting address
  • preparing the stack
  • preparing the stack and frame pointers
  • setting the proper interrupt level in the context
  • initializing the floating point context

This routine generally does not set any unnecessary register in the context. The state of the "general data" registers is undefined at task start time.

Parameters
[in]_the_contextis the context structure to be initialized
[in]_stack_baseis the lowest physical address of this task's stack
[in]_sizeis the size of this task's stack
[in]_isris the interrupt disable level
[in]_entry_pointis the thread's entry point. This is always _Thread_Handler
[in]_is_fpis TRUE if the thread is to be a floating point thread. This is typically only used on CPUs where the FPU may be easily disabled by software such as on the SPARC where the PSR contains an enable FPU bit.
[in]_tls_areaThe thread-local storage (TLS) area.

Port Specific Information:

XXX document implementation including references if appropriate

◆ CPU_CONTEXT_FP_SIZE [1/5]

#define CPU_CONTEXT_FP_SIZE   0

The size of the floating point context area.

On some CPUs this will not be a "sizeof" because the format of the floating point area is not defined – only the size is. This is usually on CPUs with a "floating point save context" instruction.

Port Specific Information:

The v850 does not need a floating point context but this needs to be defined so confdefs.h.

◆ CPU_CONTEXT_FP_SIZE [2/5]

#define CPU_CONTEXT_FP_SIZE   sizeof( Context_Control_fp )

The size of the floating point context area.

On some CPUs this will not be a "sizeof" because the format of the floating point area is not defined – only the size is. This is usually on CPUs with a "floating point save context" instruction.

Port Specific Information:

XXX document implementation including references if appropriate

◆ CPU_CONTEXT_FP_SIZE [3/5]

#define CPU_CONTEXT_FP_SIZE   sizeof( Context_Control_fp )

The size of the floating point context area.

On some CPUs this will not be a "sizeof" because the format of the floating point area is not defined – only the size is. This is usually on CPUs with a "floating point save context" instruction.

Port Specific Information:

XXX document implementation including references if appropriate

◆ CPU_CONTEXT_FP_SIZE [4/5]

#define CPU_CONTEXT_FP_SIZE   sizeof( Context_Control_fp )

The size of the floating point context area.

On some CPUs this will not be a "sizeof" because the format of the floating point area is not defined – only the size is. This is usually on CPUs with a "floating point save context" instruction.

Port Specific Information:

XXX document implementation including references if appropriate

◆ CPU_CONTEXT_FP_SIZE [5/5]

#define CPU_CONTEXT_FP_SIZE   sizeof( Context_Control_fp )

The size of the floating point context area.

On some CPUs this will not be a "sizeof" because the format of the floating point area is not defined – only the size is. This is usually on CPUs with a "floating point save context" instruction.

Port Specific Information:

XXX document implementation including references if appropriate

◆ CPU_STACK_MINIMUM_SIZE [1/6]

#define CPU_STACK_MINIMUM_SIZE   (1024*4)

Should be large enough to run all RTEMS tests.

This ensures that a "reasonable" small application should not have any problems.

Port Specific Information:

This should be very conservative on the v850.

◆ CPU_STACK_MINIMUM_SIZE [2/6]

#define CPU_STACK_MINIMUM_SIZE   (2048L)

Should be large enough to run all RTEMS tests.

This ensures that a "reasonable" small application should not have any problems.

Port Specific Information:

XXX document implementation including references if appropriate

◆ CPU_STACK_MINIMUM_SIZE [3/6]

#define CPU_STACK_MINIMUM_SIZE   (1024*8)

Should be large enough to run all RTEMS tests.

This ensures that a "reasonable" small application should not have any problems.

Port Specific Information:

XXX document implementation including references if appropriate

◆ CPU_STACK_MINIMUM_SIZE [4/6]

#define CPU_STACK_MINIMUM_SIZE   (1024*4)

Should be large enough to run all RTEMS tests.

This ensures that a "reasonable" small application should not have any problems.

Port Specific Information:

XXX document implementation including references if appropriate

◆ CPU_STACK_MINIMUM_SIZE [5/6]

#define CPU_STACK_MINIMUM_SIZE   (1024)

Should be large enough to run all RTEMS tests.

This ensures that a "reasonable" small application should not have any problems.

Port Specific Information:

XXX document implementation including references if appropriate

◆ CPU_STACK_MINIMUM_SIZE [6/6]

#define CPU_STACK_MINIMUM_SIZE   (1024*4)

Should be large enough to run all RTEMS tests.

This ensures that a "reasonable" small application should not have any problems.

Port Specific Information:

XXX document implementation including references if appropriate

Function Documentation

◆ _CPU_Context_Initialize() [1/2]

void _CPU_Context_Initialize ( Context_Control the_context,
uint32_t *  stack_base,
size_t  size,
uint32_t  new_level,
void *  entry_point,
bool  is_fp,
void *  tls_area 
)

Initialize the context to a state suitable for starting a task after a context restore operation.

Initialize CPU context.

Generally, this involves:

  • setting a starting address
  • preparing the stack
  • preparing the stack and frame pointers
  • setting the proper interrupt level in the context
  • initializing the floating point context

This routine generally does not set any unnecessary register in the context. The state of the "general data" registers is undefined at task start time.

Parameters
[in]_the_contextis the context structure to be initialized
[in]_stack_baseis the lowest physical address of this task's stack
[in]_sizeis the size of this task's stack
[in]_isris the interrupt disable level
[in]_entry_pointis the thread's entry point. This is always _Thread_Handler
[in]_is_fpis TRUE if the thread is to be a floating point thread. This is typically only used on CPUs where the FPU may be easily disabled by software such as on the SPARC where the PSR contains an enable FPU bit.
[in]tls_areais the thread-local storage (TLS) area

Port Specific Information:

XXX document implementation including references if appropriate

Initialize the context to a state suitable for starting a task after a context restore operation. Generally, this involves:

  • setting a starting address
  • preparing the stack
  • preparing the stack and frame pointers
  • setting the proper interrupt level in the context
  • initializing the floating point context

This routine generally does not set any unnecessary register in the context. The state of the "general data" registers is undefined at task start time.

Parameters
[in]_the_contextis the context structure to be initialized
[in]_stack_baseis the lowest physical address of this task's stack
[in]_sizeis the size of this task's stack
[in]_isris the interrupt disable level
[in]_entry_pointis the thread's entry point. This is always _Thread_Handler
[in]_is_fpis TRUE if the thread is to be a floating point thread. This is typically only used on CPUs where the FPU may be easily disabled by software such as on the SPARC where the PSR contains an enable FPU bit.
[in]tls_areais the thread-local storage (TLS) area

Port Specific Information:

XXX document implementation including references if appropriate

Initialize the context to a state suitable for starting a task after a context restore operation.

Initialize the context to a state suitable for starting a task after a context restore operation. Generally, this involves:

  • setting a starting address
  • preparing the stack
  • preparing the stack and frame pointers
  • setting the proper interrupt level in the context
  • initializing the floating point context

This routine generally does not set any unnecessary register in the context. The state of the "general data" registers is undefined at task start time.

Parameters
[in]_the_contextis the context structure to be initialized
[in]_stack_baseis the lowest physical address of this task's stack
[in]_sizeis the size of this task's stack
[in]_isris the interrupt disable level
[in]_entry_pointis the thread's entry point. This is always _Thread_Handler
[in]_is_fpis TRUE if the thread is to be a floating point thread. This is typically only used on CPUs where the FPU may be easily disabled by software such as on the SPARC where the PSR contains an enable FPU bit.
[in]tls_areais the thread-local storage (TLS) area

Port Specific Information:

XXX document implementation including references if appropriate

◆ _CPU_Context_Initialize() [2/2]

void _CPU_Context_Initialize ( Context_Control the_context,
uint32_t *  stack_base,
uint32_t  size,
uint32_t  new_level,
void *  entry_point,
bool  is_fp,
void *  tls_area 
)

Initialize the context to a state suitable for starting a task after a context restore operation.

Generally, this involves:

  • setting a starting address
  • preparing the stack
  • preparing the stack and frame pointers
  • setting the proper interrupt level in the context
  • initializing the floating point context

This routine generally does not set any unnecessary register in the context. The state of the "general data" registers is undefined at task start time.

Parameters
[in]_the_contextis the context structure to be initialized
[in]_stack_baseis the lowest physical address of this task's stack
[in]_sizeis the size of this task's stack
[in]_isris the interrupt disable level
[in]_entry_pointis the thread's entry point. This is always _Thread_Handler
[in]_is_fpis TRUE if the thread is to be a floating point thread. This is typically only used on CPUs where the FPU may be easily disabled by software such as on the SPARC where the PSR contains an enable FPU bit.
[in]tls_areais the thread-local storage (TLS) area

Port Specific Information:

See implementation in cpu.c

Generally, this involves:

  • setting a starting address
  • preparing the stack
  • preparing the stack and frame pointers
  • setting the proper interrupt level in the context
  • initializing the floating point context

This routine generally does not set any unnecessary register in the context. The state of the "general data" registers is undefined at task start time.

Parameters
[in]_the_contextis the context structure to be initialized
[in]_stack_baseis the lowest physical address of this task's stack
[in]_sizeis the size of this task's stack
[in]_isris the interrupt disable level
[in]_entry_pointis the thread's entry point. This is always _Thread_Handler
[in]_is_fpis TRUE if the thread is to be a floating point thread. This is typically only used on CPUs where the FPU may be easily disabled by software such as on the SPARC where the PSR contains an enable FPU bit.
[in]tls_areais the thread-local storage (TLS) area

Port Specific Information:

This method is implemented in C on the v850.

◆ _CPU_Context_restore()

void _CPU_Context_restore ( Context_Control new_context)

This routine is generally used only to restart self in an efficient manner.

It may simply be a label in _CPU_Context_switch.

Parameters
[in]new_contextpoints to the context to be restored.
Note
May be unnecessary to reload some registers.

Port Specific Information:

XXX document implementation including references if appropriate

It may simply be a label in _CPU_Context_switch.

Parameters
[in]new_contextpoints to the context to be restored.

NOTE: May be unnecessary to reload some registers.

Port Specific Information:

XXX document implementation including references if appropriate

It may simply be a label in _CPU_Context_switch.

Parameters
[in]new_contextpoints to the context to be restored.
Note
May be unnecessary to reload some registers.

Port Specific Information:

This is implemented in assembly on the v850.

It may simply be a label in _CPU_Context_switch.

Parameters
[in]new_contextpoints to the context to be restored.

NOTE: May be unnecessary to reload some registers.

Port Specific Information:

XXX document implementation including references if appropriate

It may simply be a label in _CPU_Context_switch.

Parameters
[in]new_contextpoints to the context to be restored.
Note
May be unnecessary to reload some registers.

Port Specific Information:

This is implemented in assembly on the v850.

◆ _CPU_Context_restore_fp()

void _CPU_Context_restore_fp ( Context_Control_fp **  fp_context_ptr)

This routine restores the floating point context passed to it.

Parameters
[in]fp_context_ptris a pointer to a pointer to a floating point context area to restore
Returns
on output *fp_context_ptr will contain the address that should be used with _CPU_Context_save_fp to save this context.

Port Specific Information:

XXX document implementation including references if appropriate

◆ _CPU_Context_save_fp()

void _CPU_Context_save_fp ( Context_Control_fp **  fp_context_ptr)

This routine saves the floating point context passed to it.

Parameters
[in]fp_context_ptris a pointer to a pointer to a floating point context area
Returns
on output *fp_context_ptr will contain the address that should be used with _CPU_Context_restore_fp to restore this context.

Port Specific Information:

XXX document implementation including references if appropriate

◆ _CPU_Context_switch()

void _CPU_Context_switch ( Context_Control run,
Context_Control heir 
)

This routine switches from the run context to the heir context.

Parameters
[in]runpoints to the context of the currently executing task
[in]heirpoints to the context of the heir task

Port Specific Information:

XXX document implementation including references if appropriate

Parameters
[in]runpoints to the context of the currently executing task
[in]heirpoints to the context of the heir task

Port Specific Information:

This is implemented in assembly on the v850.

This routine switches from the run context to the heir context.

This routine switches from the run context to the heir context.

Parameters
[in]runpoints to the context of the currently executing task
[in]heirpoints to the context of the heir task

Port Specific Information:

XXX document implementation including references if appropriate

Parameters
[in]runpoints to the context of the currently executing task
[in]heirpoints to the context of the heir task

Port Specific Information:

This is implemented in assembly on the v850.

Variable Documentation

◆ _CPU_Null_fp_context [1/3]

SCORE_EXTERN Context_Control_fp _CPU_Null_fp_context

This variable is optional.

It is used on CPUs on which it is difficult to generate an "uninitialized" FP context. It is filled in by _CPU_Initialize and copied into the task's FP context area during _CPU_Context_Initialize.

Port Specific Information:

XXX document implementation including references if appropriate

◆ _CPU_Null_fp_context [2/3]

SCORE_EXTERN Context_Control_fp _CPU_Null_fp_context

This variable is optional.

It is used on CPUs on which it is difficult to generate an "uninitialized" FP context. It is filled in by _CPU_Initialize and copied into the task's FP context area during _CPU_Context_Initialize.

Port Specific Information:

XXX document implementation including references if appropriate

◆ _CPU_Null_fp_context [3/3]

SCORE_EXTERN Context_Control_fp _CPU_Null_fp_context

This variable is optional.

It is used on CPUs on which it is difficult to generate an "uninitialized" FP context. It is filled in by _CPU_Initialize and copied into the task's FP context area during _CPU_Context_Initialize.

Port Specific Information:

XXX document implementation including references if appropriate

◆ _gp

char _gp[]

Initialize the context to a state suitable for starting a task after a context restore operation.

Generally, this involves:

  • setting a starting address
  • preparing the stack
  • preparing the stack and frame pointers
  • setting the proper interrupt level in the context
  • initializing the floating point context

This routine generally does not set any unnecessary register in the context. The state of the "general data" registers is undefined at task start time.

Parameters
[in]_the_contextis the context structure to be initialized
[in]_stack_baseis the lowest physical address of this task's stack
[in]_sizeis the size of this task's stack
[in]_isris the interrupt disable level
[in]_entry_pointis the thread's entry point. This is always _Thread_Handler
[in]_is_fpis TRUE if the thread is to be a floating point thread. This is typically only used on CPUs where the FPU may be easily disabled by software such as on the SPARC where the PSR contains an enable FPU bit.

Port Specific Information:

XXX document implementation including references if appropriate