]>
git.proxmox.com Git - rustc.git/blob - src/rt/arch/arm/context.cpp
4 #include "../../rust_globals.h"
6 extern "C" void CDECL
swap_registers(registers_t
*oregs
,
8 asm ("swap_registers");
12 assert((void*)®s
== (void*)this);
13 memset(®s
, 0, sizeof(regs
));
16 void context::swap(context
&out
)
18 swap_registers(&out
.regs
, ®s
);
21 void context::call(void *f
, void *arg
, void *stack
)
23 // Get the current context, which we will then modify to call the
28 uint32_t *sp
= ( uint32_t *)stack
;
30 // The final return address. 0 indicates the bottom of the stack
31 // sp of arm eabi is 8-byte aligned
35 regs
.data
[0] = ( uint32_t )arg
; // r0
36 regs
.data
[13] = ( uint32_t )sp
; //#52 sp, r13
37 regs
.data
[14] = ( uint32_t )f
; //#60 pc, r15 --> lr,
38 // Last base pointer on the stack should be 0