arm: add freestanding port

master
Ariadne Conill 2020-12-06 13:42:38 +00:00
parent 7d149e6358
commit f3f52fc17c
3 changed files with 30 additions and 2 deletions

View File

@ -18,7 +18,7 @@ Adding support for new architectures is easy, but you need to know assembly lang
| Architecture | Works on musl | Syscall | Supports FREESTANDING |
|--------------|---------------|---------|-----------------------|
| aarch64 | ✓ | | |
| arm | ✓ | | |
| arm | ✓ | | |
| m68k | ✓ | | ✓ |
| mips | ✓ | | ✓ |
| mips64 | ✓ | | ✓ |

View File

@ -0,0 +1,28 @@
#ifndef LIBUCONTEXT_BITS_H
#define LIBUCONTEXT_BITS_H
typedef int libucontext_greg_t, libucontext_gregset_t[18];
typedef struct {
unsigned long trap_no, error_code, oldmask;
unsigned long arm_r0, arm_r1, arm_r2, arm_r3;
unsigned long arm_r4, arm_r5, arm_r6, arm_r7;
unsigned long arm_r8, arm_r9, arm_r10, arm_fp;
unsigned long arm_ip, arm_sp, arm_lr, arm_pc;
unsigned long arm_cpsr, fault_address;
} libucontext_mcontext_t;
typedef struct {
void *ss_sp;
int ss_flags;
size_t ss_size;
} libucontext_stack_t;
typedef struct libucontext_ucontext {
unsigned long uc_flags;
struct libucontext_ucontext *uc_link;
libucontext_stack_t uc_stack;
libucontext_mcontext_t uc_mcontext;
} libucontext_ucontext_t;
#endif

View File

@ -25,7 +25,7 @@ extern void libucontext_trampoline(void);
void
libucontext_makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...)
libucontext_makecontext(libucontext_ucontext_t *ucp, void (*func)(void), int argc, ...)
{
unsigned long *sp;
unsigned long *regp;