Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aarch64: mcontext_t struct is wrong in the mlibc ABI #571

Open
64 opened this issue Jun 26, 2022 · 3 comments
Open

aarch64: mcontext_t struct is wrong in the mlibc ABI #571

64 opened this issue Jun 26, 2022 · 3 comments

Comments

@64
Copy link
Member

64 commented Jun 26, 2022

No description provided.

@64 64 added the bug label Jun 26, 2022
@avdgrinten
Copy link
Member

Wrong in what way?

@qookei
Copy link
Member

qookei commented Jun 28, 2022

The struct is defined here:

mlibc/abis/mlibc/signal.h

Lines 160 to 168 in a53280a

typedef struct {
unsigned long oldmask;
unsigned long gregs[16];
unsigned long pc, pr, sr;
unsigned long gbr, mach, macl;
unsigned long fpregs[16];
unsigned long xfpregs[16];
unsigned int fpscr, fpul, ownedfp;
} mcontext_t;

AArch64 has 31 GPRs, PC (in this case stored in LR, aka X30), SP, 32 vector registers (which are 128 bits wide each), and 2 64-bit FP/SIMD control registers.

@64
Copy link
Member Author

64 commented Jun 28, 2022

As per the discussion on Discord, this can be changed without a formal ABI break (but it might be a good idea to grep managarm sources for uses of this struct).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants