@@ -3,6 +3,7 @@ pub type wchar_t = i32;
33pub type nlink_t = u64 ;
44pub type blksize_t = :: c_long ;
55pub type __u64 = :: c_ulonglong ;
6+ pub type greg_t = i64 ;
67
78s ! {
89 pub struct stat {
99100 pub u_debugreg: [ :: c_ulong; 8 ] ,
100101 }
101102
103+ // https://github.com/ifduyue/musl/blob/b4b1e10364c8737a632be61582e05a8d3acf5690/arch/x86_64/bits/signal.h#L80-L84
102104 pub struct mcontext_t {
103- __private: [ u64 ; 32 ] ,
105+ pub gregs: [ greg_t; 23 ] ,
106+ __private: [ u64 ; 9 ] ,
104107 }
105108
106109 pub struct ipc_perm {
@@ -603,6 +606,32 @@ pub const ES: ::c_int = 24;
603606pub const FS : :: c_int = 25 ;
604607pub const GS : :: c_int = 26 ;
605608
609+ // offsets in mcontext_t.gregs from bits/signal.h
610+ // https://github.com/ifduyue/musl/blob/b4b1e10364c8737a632be61582e05a8d3acf5690/arch/x86_64/bits/signal.h#L9-L56
611+ pub const REG_R8 : :: c_int = 0 ;
612+ pub const REG_R9 : :: c_int = 1 ;
613+ pub const REG_R10 : :: c_int = 2 ;
614+ pub const REG_R11 : :: c_int = 3 ;
615+ pub const REG_R12 : :: c_int = 4 ;
616+ pub const REG_R13 : :: c_int = 5 ;
617+ pub const REG_R14 : :: c_int = 6 ;
618+ pub const REG_R15 : :: c_int = 7 ;
619+ pub const REG_RDI : :: c_int = 8 ;
620+ pub const REG_RSI : :: c_int = 9 ;
621+ pub const REG_RBP : :: c_int = 10 ;
622+ pub const REG_RBX : :: c_int = 11 ;
623+ pub const REG_RDX : :: c_int = 12 ;
624+ pub const REG_RAX : :: c_int = 13 ;
625+ pub const REG_RCX : :: c_int = 14 ;
626+ pub const REG_RSP : :: c_int = 15 ;
627+ pub const REG_RIP : :: c_int = 16 ;
628+ pub const REG_EFL : :: c_int = 17 ;
629+ pub const REG_CSGSFS : :: c_int = 18 ;
630+ pub const REG_ERR : :: c_int = 19 ;
631+ pub const REG_TRAPNO : :: c_int = 20 ;
632+ pub const REG_OLDMASK : :: c_int = 21 ;
633+ pub const REG_CR2 : :: c_int = 22 ;
634+
606635pub const MADV_SOFT_OFFLINE : :: c_int = 101 ;
607636pub const MAP_32BIT : :: c_int = 0x0040 ;
608637pub const O_APPEND : :: c_int = 1024 ;
0 commit comments