mirror of
git://git.musl-libc.org/musl
synced 2024-12-14 18:55:23 +00:00
support the ugly and deprecated ucontext and sigcontext header stuff...
only the structures, not the functions from ucontext.h, are supported at this point. the main goal of this commit is to make modern gcc with dwarf2 unwinding build without errors. honestly, it probably doesn't matter how we define these as long as they have members with the right names to prevent errors while compiling libgcc. the only time they will be used is for propagating exceptions across signal-handler boundaries, which invokes undefined behavior anyway. but as-is, they're probably correct and may be useful to various low-level applications dealing with virtualization, jit code generation, and so on...
This commit is contained in:
parent
e9417fffb3
commit
ad2fe25041
@ -1,6 +1,40 @@
|
||||
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|
||||
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
|
||||
|
||||
struct __fpstate {
|
||||
unsigned long __x[7];
|
||||
unsigned char __y[80];
|
||||
unsigned long __z;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
unsigned long __gregs[19];
|
||||
void *__fpregs;
|
||||
unsigned long __oldmask, __cr2;
|
||||
} mcontext_t;
|
||||
|
||||
typedef struct __ucontext {
|
||||
unsigned long uc_flags;
|
||||
struct __ucontext *uc_link;
|
||||
stack_t uc_stack;
|
||||
mcontext_t uc_mcontext;
|
||||
sigset_t uc_sigmask;
|
||||
struct __fpstate __fpregs_mem;
|
||||
} ucontext_t;
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
struct sigcontext {
|
||||
unsigned short gs, __gsh, fs, __fsh, es, __esh, ds, __dsh;
|
||||
unsigned long edi, esi, ebp, esp, ebx, edx, ecx, eax;
|
||||
unsigned long trapno, err, eip;
|
||||
unsigned short cs, __csh;
|
||||
unsigned long eflags, esp_at_signal;
|
||||
unsigned short ss, __ssh;
|
||||
struct __fpstate *fpstate;
|
||||
unsigned long oldmask, cr2;
|
||||
};
|
||||
#endif
|
||||
|
||||
struct __siginfo
|
||||
{
|
||||
int si_signo;
|
||||
|
@ -1,6 +1,38 @@
|
||||
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|
||||
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
|
||||
|
||||
struct __fpstate {
|
||||
unsigned long __x[4];
|
||||
unsigned char __y[384];
|
||||
unsigned long __z[12];
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
unsigned long __gregs[23];
|
||||
void *__fpregs;
|
||||
unsigned long __reserved1[8];
|
||||
} mcontext_t;
|
||||
|
||||
typedef struct __ucontext {
|
||||
unsigned long uc_flags;
|
||||
struct __ucontext *uc_link;
|
||||
stack_t uc_stack;
|
||||
mcontext_t uc_mcontext;
|
||||
sigset_t uc_sigmask;
|
||||
struct __fpstate __fpregs_mem;
|
||||
} ucontext_t;
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
struct sigcontext {
|
||||
unsigned long r8, r9, r10, r11, r12, r13, r14, r15;
|
||||
unsigned long rdi, rsi, rbp, rbx, rdx, rax, rcx, rsp, rip, eflags;
|
||||
unsigned short cs, gs, fs, __pad0;
|
||||
unsigned long err, trapno, oldmask, cr2;
|
||||
struct __fpstate *fpstate;
|
||||
unsigned long __reserved1[8];
|
||||
};
|
||||
#endif
|
||||
|
||||
struct __siginfo
|
||||
{
|
||||
int si_signo;
|
||||
|
@ -6,26 +6,9 @@ extern "C" {
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
struct __fpstate {
|
||||
unsigned long __x[7];
|
||||
unsigned char __y[80];
|
||||
unsigned long __z;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
unsigned long __gregs[19];
|
||||
void *__fpregs;
|
||||
unsigned long __oldmask, __cr2;
|
||||
} mcontext_t;
|
||||
|
||||
typedef struct ucontext {
|
||||
unsigned long uc_flags;
|
||||
struct ucontext *uc_link;
|
||||
stack_t uc_stack;
|
||||
mcontext_t uc_mcontext;
|
||||
sigset_t uc_sigmask;
|
||||
struct __fpstate __fpregs_mem;
|
||||
} ucontext_t;
|
||||
#ifdef _GNU_SOURCE
|
||||
#define ucontext __ucontext
|
||||
#endif
|
||||
|
||||
int getcontext(ucontext_t *);
|
||||
void makecontext(ucontext_t *, void (*)(void), int, ...);
|
||||
|
Loading…
Reference in New Issue
Block a user