Blob
- Date:
- Message:
- arm: build fixes Get p9p to build cleanly for ARM - based on suggestions from rsc and eekee, plus a final tweak from me. Tested (a bit) on sheevaplug (ubuntu jaunty), Nokia N800 (maemo 4) and Nokia N900 (maemo 5). R=rsc CC=plan9port.codebot http://codereview.appspot.com/4524056
- Actions:
- History | Blame | Raw File
1 #include "threadimpl.h"3 void4 makecontext(ucontext_t *uc, void (*fn)(void), int argc, ...)5 {6 int i, *sp;7 va_list arg;9 sp = (int*)uc->uc_stack.ss_sp+uc->uc_stack.ss_size/4;10 va_start(arg, argc);11 for(i=0; i<4 && i<argc; i++)12 (&uc->uc_mcontext.arm_r0)[i] = va_arg(arg, uint);13 va_end(arg);14 uc->uc_mcontext.arm_sp = (uint)sp;15 uc->uc_mcontext.arm_lr = (uint)fn;16 }18 int19 swapcontext(ucontext_t *oucp, const ucontext_t *ucp)20 {21 if(getcontext(oucp) == 0)22 setcontext(ucp);23 return 0;24 }