diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-08-10 13:09:22 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-08-22 14:19:00 +0200 |
commit | 7837728b13076fce67b67025ad7a02890748c94c (patch) | |
tree | da6e613a9b93d446de8cccb5742c5cdea040a42a /c/src/lib/libcpu/powerpc/new-exceptions/cpu.c | |
parent | powerpc: 64-bit support for CPU_SIZEOF_POINTER (diff) | |
download | rtems-7837728b13076fce67b67025ad7a02890748c94c.tar.bz2 |
powerpc: 64-bit _CPU_Context_Initialize() support
Update #3082.
Diffstat (limited to 'c/src/lib/libcpu/powerpc/new-exceptions/cpu.c')
-rw-r--r-- | c/src/lib/libcpu/powerpc/new-exceptions/cpu.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/c/src/lib/libcpu/powerpc/new-exceptions/cpu.c b/c/src/lib/libcpu/powerpc/new-exceptions/cpu.c index 71dce73eab..bee5eb2091 100644 --- a/c/src/lib/libcpu/powerpc/new-exceptions/cpu.c +++ b/c/src/lib/libcpu/powerpc/new-exceptions/cpu.c @@ -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) |