forked from Imagelibrary/rtems
bsps/powerpc: ppc_exc_initialize_interrupt_stack()
This commit is contained in:
@@ -156,8 +156,6 @@ void ppc_exc_initialize_with_vector_base(
|
|||||||
{
|
{
|
||||||
rtems_status_code sc = RTEMS_SUCCESSFUL;
|
rtems_status_code sc = RTEMS_SUCCESSFUL;
|
||||||
const ppc_exc_categories *const categories = ppc_exc_current_categories();
|
const ppc_exc_categories *const categories = ppc_exc_current_categories();
|
||||||
uintptr_t const interrupt_stack_end = interrupt_stack_begin + interrupt_stack_size;
|
|
||||||
uintptr_t interrupt_stack_pointer = interrupt_stack_end - PPC_MINIMUM_STACK_FRAME_SIZE;
|
|
||||||
unsigned vector = 0;
|
unsigned vector = 0;
|
||||||
uint32_t sda_base = 0;
|
uint32_t sda_base = 0;
|
||||||
uint32_t r13 = 0;
|
uint32_t r13 = 0;
|
||||||
@@ -180,15 +178,7 @@ void ppc_exc_initialize_with_vector_base(
|
|||||||
ppc_exc_fatal_error();
|
ppc_exc_fatal_error();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ensure proper interrupt stack alignment */
|
ppc_exc_initialize_interrupt_stack(interrupt_stack_begin, interrupt_stack_size);
|
||||||
interrupt_stack_pointer &= ~((uintptr_t) CPU_STACK_ALIGNMENT - 1);
|
|
||||||
|
|
||||||
/* Tag interrupt stack bottom */
|
|
||||||
*(uint32_t *) interrupt_stack_pointer = 0;
|
|
||||||
|
|
||||||
/* Move interrupt stack values to special purpose registers */
|
|
||||||
PPC_SET_SPECIAL_PURPOSE_REGISTER(SPRG1, interrupt_stack_pointer);
|
|
||||||
PPC_SET_SPECIAL_PURPOSE_REGISTER(SPRG2, interrupt_stack_begin);
|
|
||||||
|
|
||||||
#ifndef PPC_EXC_CONFIG_BOOKE_ONLY
|
#ifndef PPC_EXC_CONFIG_BOOKE_ONLY
|
||||||
|
|
||||||
|
|||||||
@@ -355,6 +355,25 @@ rtems_status_code ppc_exc_make_prologue(
|
|||||||
size_t *prologue_size
|
size_t *prologue_size
|
||||||
);
|
);
|
||||||
|
|
||||||
|
static inline void ppc_exc_initialize_interrupt_stack(
|
||||||
|
uintptr_t stack_begin,
|
||||||
|
uintptr_t stack_size
|
||||||
|
)
|
||||||
|
{
|
||||||
|
uintptr_t stack_end = stack_begin + stack_size;
|
||||||
|
uintptr_t stack_pointer = stack_end - PPC_MINIMUM_STACK_FRAME_SIZE;
|
||||||
|
|
||||||
|
/* Ensure proper interrupt stack alignment */
|
||||||
|
stack_pointer &= ~((uintptr_t) CPU_STACK_ALIGNMENT - 1);
|
||||||
|
|
||||||
|
/* Tag interrupt stack bottom */
|
||||||
|
*(uint32_t *) stack_pointer = 0;
|
||||||
|
|
||||||
|
/* Move interrupt stack values to special purpose registers */
|
||||||
|
PPC_SET_SPECIAL_PURPOSE_REGISTER(SPRG1, stack_pointer);
|
||||||
|
PPC_SET_SPECIAL_PURPOSE_REGISTER(SPRG2, stack_begin);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initializes the exception handling.
|
* @brief Initializes the exception handling.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user