Skip to content

Commit

Permalink
Auto merge of #3467 - devnexen:netbsd_context_update, r=JohnTitor
Browse files Browse the repository at this point in the history
netbsd arm* registers and reorder per architecture.
  • Loading branch information
bors committed Dec 9, 2023
2 parents 497ac42 + 70e2e5e commit 1e755f9
Show file tree
Hide file tree
Showing 6 changed files with 226 additions and 27 deletions.
57 changes: 57 additions & 0 deletions libc-test/semver/netbsd-aarch64.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,60 @@
_REG_CPSR
_REG_ELR
_REG_FP
_REG_LR
_REG_PC
_REG_R0
_REG_R1
_REG_R10
_REG_R11
_REG_R12
_REG_R13
_REG_R14
_REG_R15
_REG_R2
_REG_R3
_REG_R4
_REG_R5
_REG_R6
_REG_R7
_REG_R8
_REG_R9
_REG_RV
_REG_SP
_REG_SPSR
_REG_TIPDR
_REG_X0
_REG_X1
_REG_X2
_REG_X3
_REG_X4
_REG_X5
_REG_X6
_REG_X7
_REG_X8
_REG_X9
_REG_X10
_REG_X11
_REG_X12
_REG_X13
_REG_X14
_REG_X15
_REG_X16
_REG_X17
_REG_X18
_REG_X19
_REG_X20
_REG_X21
_REG_X22
_REG_X23
_REG_X24
_REG_X25
_REG_X26
_REG_X27
_REG_X28
_REG_X29
_REG_X30
_REG_X31
PT_GETFPREGS
PT_GETREGS
PT_SETFPREGS
Expand Down
24 changes: 24 additions & 0 deletions libc-test/semver/netbsd-x86_64.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
Aux64Info
_REG_DS
_REG_ERR
_REG_ES
_REG_FS
_REG_GS
_REG_R10
_REG_R11
_REG_R12
_REG_R13
_REG_R14
_REG_R15
_REG_R8
_REG_R9
_REG_RAX
_REG_RBP
_REG_RBX
_REG_RCX
_REG_RDI
_REG_RFLAGS
_REG_RIP
_REG_RSI
_REG_RSP
_REG_SS
_REG_TRAPNO
PT_GETFPREGS
PT_GETREGS
PT_SETFPREGS
Expand Down
59 changes: 59 additions & 0 deletions src/unix/bsd/netbsdlike/netbsd/aarch64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,62 @@ pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 0;
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 1;
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 2;
pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 3;

pub const _REG_R0: ::c_int = 0;
pub const _REG_R1: ::c_int = 1;
pub const _REG_R2: ::c_int = 2;
pub const _REG_R3: ::c_int = 3;
pub const _REG_R4: ::c_int = 4;
pub const _REG_R5: ::c_int = 5;
pub const _REG_R6: ::c_int = 6;
pub const _REG_R7: ::c_int = 7;
pub const _REG_R8: ::c_int = 8;
pub const _REG_R9: ::c_int = 9;
pub const _REG_R10: ::c_int = 10;
pub const _REG_R11: ::c_int = 11;
pub const _REG_R12: ::c_int = 12;
pub const _REG_R13: ::c_int = 13;
pub const _REG_R14: ::c_int = 14;
pub const _REG_R15: ::c_int = 15;
pub const _REG_CPSR: ::c_int = 16;
pub const _REG_X0: ::c_int = 0;
pub const _REG_X1: ::c_int = 1;
pub const _REG_X2: ::c_int = 2;
pub const _REG_X3: ::c_int = 3;
pub const _REG_X4: ::c_int = 4;
pub const _REG_X5: ::c_int = 5;
pub const _REG_X6: ::c_int = 6;
pub const _REG_X7: ::c_int = 7;
pub const _REG_X8: ::c_int = 8;
pub const _REG_X9: ::c_int = 9;
pub const _REG_X10: ::c_int = 10;
pub const _REG_X11: ::c_int = 11;
pub const _REG_X12: ::c_int = 12;
pub const _REG_X13: ::c_int = 13;
pub const _REG_X14: ::c_int = 14;
pub const _REG_X15: ::c_int = 15;
pub const _REG_X16: ::c_int = 16;
pub const _REG_X17: ::c_int = 17;
pub const _REG_X18: ::c_int = 18;
pub const _REG_X19: ::c_int = 19;
pub const _REG_X20: ::c_int = 20;
pub const _REG_X21: ::c_int = 21;
pub const _REG_X22: ::c_int = 22;
pub const _REG_X23: ::c_int = 23;
pub const _REG_X24: ::c_int = 24;
pub const _REG_X25: ::c_int = 25;
pub const _REG_X26: ::c_int = 26;
pub const _REG_X27: ::c_int = 27;
pub const _REG_X28: ::c_int = 28;
pub const _REG_X29: ::c_int = 29;
pub const _REG_X30: ::c_int = 30;
pub const _REG_X31: ::c_int = 31;
pub const _REG_ELR: ::c_int = 32;
pub const _REG_SPSR: ::c_int = 33;
pub const _REG_TIPDR: ::c_int = 34;

pub const _REG_RV: ::c_int = _REG_X0;
pub const _REG_FP: ::c_int = _REG_X29;
pub const _REG_LR: ::c_int = _REG_X30;
pub const _REG_SP: ::c_int = _REG_X31;
pub const _REG_PC: ::c_int = _REG_ELR;
59 changes: 59 additions & 0 deletions src/unix/bsd/netbsdlike/netbsd/arm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,62 @@ pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;

pub const _REG_R0: ::c_int = 0;
pub const _REG_R1: ::c_int = 1;
pub const _REG_R2: ::c_int = 2;
pub const _REG_R3: ::c_int = 3;
pub const _REG_R4: ::c_int = 4;
pub const _REG_R5: ::c_int = 5;
pub const _REG_R6: ::c_int = 6;
pub const _REG_R7: ::c_int = 7;
pub const _REG_R8: ::c_int = 8;
pub const _REG_R9: ::c_int = 9;
pub const _REG_R10: ::c_int = 10;
pub const _REG_R11: ::c_int = 11;
pub const _REG_R12: ::c_int = 12;
pub const _REG_R13: ::c_int = 13;
pub const _REG_R14: ::c_int = 14;
pub const _REG_R15: ::c_int = 15;
pub const _REG_CPSR: ::c_int = 16;
pub const _REG_X0: ::c_int = 0;
pub const _REG_X1: ::c_int = 1;
pub const _REG_X2: ::c_int = 2;
pub const _REG_X3: ::c_int = 3;
pub const _REG_X4: ::c_int = 4;
pub const _REG_X5: ::c_int = 5;
pub const _REG_X6: ::c_int = 6;
pub const _REG_X7: ::c_int = 7;
pub const _REG_X8: ::c_int = 8;
pub const _REG_X9: ::c_int = 9;
pub const _REG_X10: ::c_int = 10;
pub const _REG_X11: ::c_int = 11;
pub const _REG_X12: ::c_int = 12;
pub const _REG_X13: ::c_int = 13;
pub const _REG_X14: ::c_int = 14;
pub const _REG_X15: ::c_int = 15;
pub const _REG_X16: ::c_int = 16;
pub const _REG_X17: ::c_int = 17;
pub const _REG_X18: ::c_int = 18;
pub const _REG_X19: ::c_int = 19;
pub const _REG_X20: ::c_int = 20;
pub const _REG_X21: ::c_int = 21;
pub const _REG_X22: ::c_int = 22;
pub const _REG_X23: ::c_int = 23;
pub const _REG_X24: ::c_int = 24;
pub const _REG_X25: ::c_int = 25;
pub const _REG_X26: ::c_int = 26;
pub const _REG_X27: ::c_int = 27;
pub const _REG_X28: ::c_int = 28;
pub const _REG_X29: ::c_int = 29;
pub const _REG_X30: ::c_int = 30;
pub const _REG_X31: ::c_int = 31;
pub const _REG_ELR: ::c_int = 32;
pub const _REG_SPSR: ::c_int = 33;
pub const _REG_TIPDR: ::c_int = 34;

pub const _REG_RV: ::c_int = _REG_R0;
pub const _REG_FP: ::c_int = _REG_R11;
pub const _REG_LR: ::c_int = _REG_R13;
pub const _REG_SP: ::c_int = _REG_R14;
pub const _REG_PC: ::c_int = _REG_R15;
27 changes: 0 additions & 27 deletions src/unix/bsd/netbsdlike/netbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2396,33 +2396,6 @@ pub const LSZOMB: ::c_int = 5;
pub const LSONPROC: ::c_int = 7;
pub const LSSUSPENDED: ::c_int = 8;

pub const _REG_RDI: ::c_int = 0;
pub const _REG_RSI: ::c_int = 1;
pub const _REG_RDX: ::c_int = 2;
pub const _REG_RCX: ::c_int = 3;
pub const _REG_R8: ::c_int = 4;
pub const _REG_R9: ::c_int = 5;
pub const _REG_R10: ::c_int = 6;
pub const _REG_R11: ::c_int = 7;
pub const _REG_R12: ::c_int = 8;
pub const _REG_R13: ::c_int = 9;
pub const _REG_R14: ::c_int = 10;
pub const _REG_R15: ::c_int = 11;
pub const _REG_RBP: ::c_int = 12;
pub const _REG_RBX: ::c_int = 13;
pub const _REG_RAX: ::c_int = 14;
pub const _REG_GS: ::c_int = 15;
pub const _REG_FS: ::c_int = 16;
pub const _REG_ES: ::c_int = 17;
pub const _REG_DS: ::c_int = 18;
pub const _REG_TRAPNO: ::c_int = 19;
pub const _REG_ERR: ::c_int = 20;
pub const _REG_RIP: ::c_int = 21;
pub const _REG_CS: ::c_int = 22;
pub const _REG_RFLAGS: ::c_int = 23;
pub const _REG_RSP: ::c_int = 24;
pub const _REG_SS: ::c_int = 25;

// sys/xattr.h
pub const XATTR_CREATE: ::c_int = 0x01;
pub const XATTR_REPLACE: ::c_int = 0x02;
Expand Down
27 changes: 27 additions & 0 deletions src/unix/bsd/netbsdlike/netbsd/x86_64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,30 @@ pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;

pub const _REG_RDI: ::c_int = 0;
pub const _REG_RSI: ::c_int = 1;
pub const _REG_RDX: ::c_int = 2;
pub const _REG_RCX: ::c_int = 3;
pub const _REG_R8: ::c_int = 4;
pub const _REG_R9: ::c_int = 5;
pub const _REG_R10: ::c_int = 6;
pub const _REG_R11: ::c_int = 7;
pub const _REG_R12: ::c_int = 8;
pub const _REG_R13: ::c_int = 9;
pub const _REG_R14: ::c_int = 10;
pub const _REG_R15: ::c_int = 11;
pub const _REG_RBP: ::c_int = 12;
pub const _REG_RBX: ::c_int = 13;
pub const _REG_RAX: ::c_int = 14;
pub const _REG_GS: ::c_int = 15;
pub const _REG_FS: ::c_int = 16;
pub const _REG_ES: ::c_int = 17;
pub const _REG_DS: ::c_int = 18;
pub const _REG_TRAPNO: ::c_int = 19;
pub const _REG_ERR: ::c_int = 20;
pub const _REG_RIP: ::c_int = 21;
pub const _REG_CS: ::c_int = 22;
pub const _REG_RFLAGS: ::c_int = 23;
pub const _REG_RSP: ::c_int = 24;
pub const _REG_SS: ::c_int = 25;

0 comments on commit 1e755f9

Please sign in to comment.