aarch64: add freestanding port

arm_linker_fix
Ariadne Conill 2020-12-06 13:50:50 +00:00
parent f3f52fc17c
commit a04dc12d72
3 changed files with 36 additions and 2 deletions

View File

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

View File

@ -0,0 +1,34 @@
#ifndef LIBUCONTEXT_BITS_H
#define LIBUCONTEXT_BITS_H
typedef unsigned long libucontext_greg_t;
typedef unsigned long libucontext_gregset_t[34];
typedef struct {
__uint128_t vregs[32];
unsigned int fpsr;
unsigned int fpcr;
} libucontext_fpregset_t;
typedef struct sigcontext {
unsigned long fault_address;
unsigned long regs[31];
unsigned long sp, pc, pstate;
long double __reserved[256];
} 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;
unsigned char __pad[128];
libucontext_mcontext_t uc_mcontext;
} libucontext_ucontext_t;
#endif

View File

@ -23,7 +23,7 @@ extern void libucontext_trampoline(void);
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 *sp;
unsigned long *regp; unsigned long *regp;