From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <48737414.3000903@wmipf.in-berlin.de> Date: Tue, 8 Jul 2008 16:05:08 +0200 From: =?UTF-8?B?TWljaGFlbCBUZWljaGdyw6RiZXI=?= User-Agent: Icedove 1.5.0.14eol (X11/20080509) MIME-Version: 1.0 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> References: <6a3ae47e0807080601m30b6da97w782bde83f91055cf@mail.gmail.com> In-Reply-To: <6a3ae47e0807080601m30b6da97w782bde83f91055cf@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [9fans] P9P libthread on Debian ARM vs. makecontext et al. Topicbox-Message-UUID: de2a85ae-ead3-11e9-9d60-3106f5b1d025 > The code in Linux.c that implements makecontext() for ARM expects this > struct to contain a gregs array. I'm guessing that gregs is the same > as the enumerated arm_* ones above. So, would I be correct in assuming > that gregs[13] is arm_sp and gregs[14] is arm_lr? Hi, I would say yes, as SP is r13 and LR is r14 on arm. To run Russ' libtask on arm7 I used the Linux-arm-asm.s and the arm-specific makecontext implementation from Linux.c, as well as the following structures. M. -- enum { NREG = 16, }; typedef struct Mcontext { u32int gregs[NREG]; /* general registers */ } Mcontext; typedef struct ucontext { Mcontext uc_mcontext; sigset_t uc_sigmask; struct { void *ss_sp; u16int ss_size; } uc_stack; } ucontext_t;