powerpc: 64-bit _CPU_Context_Initialize() support

Update #3082.
This commit is contained in:
Sebastian Huber
2017-08-10 13:09:22 +02:00
parent 5a9372ff7e
commit 7837728b13
3 changed files with 15 additions and 9 deletions

View File

@@ -55,8 +55,8 @@ void _CPU_Initialize(void)
*/
void _CPU_Context_Initialize(
Context_Control *the_context,
uint32_t *stack_base,
uint32_t size,
void *stack_base,
size_t size,
uint32_t new_level,
void *entry_point,
bool is_fp,
@@ -65,13 +65,15 @@ void _CPU_Context_Initialize(
{
ppc_context *the_ppc_context;
uint32_t msr_value;
uint32_t sp;
uintptr_t sp;
uintptr_t stack_alignment;
sp = (uint32_t)stack_base + size - PPC_MINIMUM_STACK_FRAME_SIZE;
sp = (uintptr_t) stack_base + size - PPC_MINIMUM_STACK_FRAME_SIZE;
sp &= ~(CPU_STACK_ALIGNMENT-1);
stack_alignment = CPU_STACK_ALIGNMENT;
sp &= ~(stack_alignment - 1);
*((uint32_t*)sp) = 0;
sp = (uintptr_t) memset((void *) sp, 0, PPC_MINIMUM_STACK_FRAME_SIZE);
_CPU_MSR_GET( msr_value );
@@ -117,7 +119,7 @@ void _CPU_Context_Initialize(
the_ppc_context->gpr1 = sp;
the_ppc_context->msr = msr_value;
the_ppc_context->lr = (uint32_t) entry_point;
the_ppc_context->lr = (uintptr_t) entry_point;
the_ppc_context->isr_dispatch_disable = 0;
#if defined(__ALTIVEC__) && !defined(PPC_MULTILIB_ALTIVEC)

View File

@@ -631,7 +631,11 @@ extern "C" {
#define PPC_MSR_DISABLE_MASK (PPC_MSR_ME|PPC_MSR_EE|PPC_MSR_CE)
#if defined(__powerpc64__)
#define PPC_MINIMUM_STACK_FRAME_SIZE 32
#else
#define PPC_MINIMUM_STACK_FRAME_SIZE PPC_STACK_ALIGNMENT
#endif
#ifdef __cplusplus
}

View File

@@ -818,8 +818,8 @@ static inline CPU_Counter_ticks _CPU_Counter_difference(
void _CPU_Context_Initialize(
Context_Control *the_context,
uint32_t *stack_base,
uint32_t size,
void *stack_base,
size_t size,
uint32_t new_level,
void *entry_point,
bool is_fp,