@@ -3,6 +3,7 @@ pub type wchar_t = i32;
3
3
pub type nlink_t = u64 ;
4
4
pub type blksize_t = :: c_long ;
5
5
pub type __u64 = :: c_ulonglong ;
6
+ pub type greg_t = i64 ;
6
7
7
8
s ! {
8
9
pub struct stat {
99
100
pub u_debugreg: [ :: c_ulong; 8 ] ,
100
101
}
101
102
103
+ // https://github.com/ifduyue/musl/blob/b4b1e10364c8737a632be61582e05a8d3acf5690/arch/x86_64/bits/signal.h#L80-L84
102
104
pub struct mcontext_t {
103
- __private: [ u64 ; 32 ] ,
105
+ pub gregs: [ greg_t; 23 ] ,
106
+ __private: [ u64 ; 9 ] ,
104
107
}
105
108
106
109
pub struct ipc_perm {
@@ -603,6 +606,32 @@ pub const ES: ::c_int = 24;
603
606
pub const FS : :: c_int = 25 ;
604
607
pub const GS : :: c_int = 26 ;
605
608
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
+
606
635
pub const MADV_SOFT_OFFLINE : :: c_int = 101 ;
607
636
pub const MAP_32BIT : :: c_int = 0x0040 ;
608
637
pub const O_APPEND : :: c_int = 1024 ;
0 commit comments