RTEMS CPU Kit with SuperCore  4.11.2
Data Structures | Macros | Typedefs | Functions
cpu.h File Reference

PowerPC CPU Department Source. More...

#include <rtems/score/types.h>
#include <rtems/score/powerpc.h>
#include <rtems/powerpc/registers.h>
#include <string.h>
Include dependency graph for cpu.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ppc_context
 
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...
 
struct  CPU_Exception_frame
 The set of registers that specifies the complete processor state. More...
 

Macros

#define CPU_INLINE_ENABLE_DISPATCH   FALSE
 
#define CPU_PROVIDES_IDLE_THREAD_BODY   FALSE
 
#define CPU_STACK_GROWS_UP   FALSE
 
#define CPU_STRUCTURE_ALIGNMENT   __attribute__ ((aligned (PPC_STRUCTURE_ALIGNMENT)))
 
#define CPU_TIMESTAMP_USE_STRUCT_TIMESPEC   TRUE
 
#define CPU_BIG_ENDIAN   FALSE
 
#define CPU_LITTLE_ENDIAN   TRUE
 
#define CPU_HARDWARE_FP   FALSE
 
#define CPU_SOFTWARE_FP   FALSE
 
#define CPU_ALL_TASKS_ARE_FP   CPU_HARDWARE_FP
 
#define CPU_IDLE_TASK_IS_FP   FALSE
 
#define CPU_PER_CPU_CONTROL_SIZE   0
 
#define PPC_GPR_TYPE   uint32_t
 
#define PPC_GPR_SIZE   4
 
#define PPC_GPR_LOAD   lwz
 
#define PPC_GPR_STORE   stw
 
#define _CPU_Context_Get_SP(_context)   ppc_get_context(_context)->gpr1
 
#define PPC_CONTEXT_OFFSET_GPR1   (PPC_DEFAULT_CACHE_LINE_SIZE + 0)
 
#define PPC_CONTEXT_OFFSET_MSR   (PPC_DEFAULT_CACHE_LINE_SIZE + 4)
 
#define PPC_CONTEXT_OFFSET_LR   (PPC_DEFAULT_CACHE_LINE_SIZE + 8)
 
#define PPC_CONTEXT_OFFSET_CR   (PPC_DEFAULT_CACHE_LINE_SIZE + 12)
 
#define PPC_CONTEXT_GPR_OFFSET(gpr)   (((gpr) - 14) * PPC_GPR_SIZE + PPC_DEFAULT_CACHE_LINE_SIZE + 16)
 
#define PPC_CONTEXT_OFFSET_GPR14   PPC_CONTEXT_GPR_OFFSET( 14 )
 
#define PPC_CONTEXT_OFFSET_GPR15   PPC_CONTEXT_GPR_OFFSET( 15 )
 
#define PPC_CONTEXT_OFFSET_GPR16   PPC_CONTEXT_GPR_OFFSET( 16 )
 
#define PPC_CONTEXT_OFFSET_GPR17   PPC_CONTEXT_GPR_OFFSET( 17 )
 
#define PPC_CONTEXT_OFFSET_GPR18   PPC_CONTEXT_GPR_OFFSET( 18 )
 
#define PPC_CONTEXT_OFFSET_GPR19   PPC_CONTEXT_GPR_OFFSET( 19 )
 
#define PPC_CONTEXT_OFFSET_GPR20   PPC_CONTEXT_GPR_OFFSET( 20 )
 
#define PPC_CONTEXT_OFFSET_GPR21   PPC_CONTEXT_GPR_OFFSET( 21 )
 
#define PPC_CONTEXT_OFFSET_GPR22   PPC_CONTEXT_GPR_OFFSET( 22 )
 
#define PPC_CONTEXT_OFFSET_GPR23   PPC_CONTEXT_GPR_OFFSET( 23 )
 
#define PPC_CONTEXT_OFFSET_GPR24   PPC_CONTEXT_GPR_OFFSET( 24 )
 
#define PPC_CONTEXT_OFFSET_GPR25   PPC_CONTEXT_GPR_OFFSET( 25 )
 
#define PPC_CONTEXT_OFFSET_GPR26   PPC_CONTEXT_GPR_OFFSET( 26 )
 
#define PPC_CONTEXT_OFFSET_GPR27   PPC_CONTEXT_GPR_OFFSET( 27 )
 
#define PPC_CONTEXT_OFFSET_GPR28   PPC_CONTEXT_GPR_OFFSET( 28 )
 
#define PPC_CONTEXT_OFFSET_GPR29   PPC_CONTEXT_GPR_OFFSET( 29 )
 
#define PPC_CONTEXT_OFFSET_GPR30   PPC_CONTEXT_GPR_OFFSET( 30 )
 
#define PPC_CONTEXT_OFFSET_GPR31   PPC_CONTEXT_GPR_OFFSET( 31 )
 
#define PPC_CONTEXT_OFFSET_GPR2   PPC_CONTEXT_GPR_OFFSET( 32 )
 
#define PPC_CONTEXT_OFFSET_F(f)   ( ( ( f ) - 14 ) * 8 + PPC_DEFAULT_CACHE_LINE_SIZE + 96 )
 
#define PPC_CONTEXT_VOLATILE_SIZE   (PPC_CONTEXT_GPR_OFFSET( 32 ) + 4)
 
#define CPU_SIMPLE_VECTORED_INTERRUPTS   FALSE
 
#define CPU_HAS_SOFTWARE_INTERRUPT_STACK   TRUE
 
#define CPU_HAS_HARDWARE_INTERRUPT_STACK   FALSE
 
#define CPU_ALLOCATE_INTERRUPT_STACK   TRUE
 
#define CPU_ISR_PASSES_FRAME_POINTER   0
 
#define CPU_USE_DEFERRED_FP_SWITCH   FALSE
 
#define CPU_MODES_INTERRUPT_LEVEL   0x00000001 /* interrupt level in mode */
 
#define CPU_MODES_INTERRUPT_MASK   0x00000001 /* interrupt level in mode */
 
#define CPU_CONTEXT_FP_SIZE   sizeof( Context_Control_fp )
 
#define CPU_STACK_CHECK_SIZE   (128)
 
#define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK   0
 
#define CPU_PROVIDES_ISR_IS_IN_PROGRESS   FALSE
 
#define _CPU_Fatal_halt(_source, _error)   _BSP_Fatal_error(_error)
 
#define CPU_STACK_MINIMUM_SIZE   (1024*8)
 
#define CPU_SIZEOF_POINTER   4
 
#define CPU_ALIGNMENT   (PPC_ALIGNMENT)
 
#define CPU_HEAP_ALIGNMENT   (PPC_ALIGNMENT)
 
#define CPU_PARTITION_ALIGNMENT   (PPC_ALIGNMENT)
 
#define CPU_STACK_ALIGNMENT   (PPC_STACK_ALIGNMENT)
 
#define CPU_swap_u16(value)   (((value&0xff) << 8) | ((value >> 8)&0xff))
 
#define _CPU_Context_Restart_self(_the_context)   _CPU_Context_restore( (_the_context) );
 
#define _CPU_Context_Fp_start(_base, _offset)   ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
 
#define _CPU_Context_Initialize_fp(_destination)   memset( *(_destination), 0, sizeof( **(_destination) ) )
 
#define _CPU_Bitfield_Find_first_bit(_value, _output)
 
#define _CPU_Priority_Mask(_bit_number)   ( 0x80000000 >> (_bit_number) )
 
#define _CPU_Priority_bits_index(_priority)   (_priority)
 

Typedefs

typedef struct CPU_Interrupt_frame CPU_Interrupt_frame
 
typedef uint32_t CPU_Counter_ticks
 

Functions

void BSP_panic (char *)
 
void _BSP_Fatal_error (unsigned int)
 
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_Initialize (void)
 CPU initialization. More...
 
void _CPU_ISR_install_vector (uint32_t vector, proc_ptr new_handler, proc_ptr *old_handler)
 This routine installs an interrupt vector. More...
 
void _CPU_Context_switch (Context_Control *run, Context_Control *heir)
 CPU switch 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_volatile_clobber (uintptr_t pattern)
 Clobbers all volatile registers with values derived from the pattern parameter. More...
 
void _CPU_Context_validate (uintptr_t pattern)
 Initializes and validates the CPU context with values derived from the pattern parameter. More...
 
void _CPU_Exception_frame_print (const CPU_Exception_frame *frame)
 Prints the exception frame via printk(). More...
 
void _CPU_Initialize_altivec (void)
 
void _CPU_Context_switch_altivec (ppc_context *from, ppc_context *to)
 
void _CPU_Context_restore_altivec (ppc_context *ctxt)
 
void _CPU_Context_initialize_altivec (ppc_context *ctxt)
 
void _CPU_Fatal_error (uint32_t _error)
 

Detailed Description

PowerPC CPU Department Source.

Macro Definition Documentation

◆ _CPU_Bitfield_Find_first_bit

#define _CPU_Bitfield_Find_first_bit (   _value,
  _output 
)
Value:
{ \
__asm__ volatile ("cntlzw %0, %1" : "=r" ((_output)), "=r" ((_value)) : \
"1" ((_value))); \
}