@@ -346,6 +346,7 @@ pub const UC_SIGCONTEXT_SS: u64 = 2;
346
346
pub const UC_STRICT_RESTORE_SS : u64 = 4 ;
347
347
348
348
// https://elixir.bootlin.com/linux/latest/source/include/uapi/asm-generic/ucontext.h#L5
349
+ #[ cfg( target_arch = "x86_64" ) ]
349
350
#[ repr( C ) ]
350
351
#[ derive( Debug , Copy , Clone , Default ) ]
351
352
pub struct UContext {
@@ -356,6 +357,7 @@ pub struct UContext {
356
357
pub Sigset : u64 ,
357
358
}
358
359
360
+ #[ cfg( target_arch = "x86_64" ) ]
359
361
impl UContext {
360
362
pub fn New ( ptRegs : & PtRegs , oldMask : u64 , cr2 : u64 , fpstate : u64 , alt : & SignalStack ) -> Self {
361
363
return Self {
@@ -368,6 +370,47 @@ impl UContext {
368
370
}
369
371
}
370
372
373
+ #[ cfg( target_arch = "aarch64" ) ]
374
+ #[ repr( C ) ]
375
+ #[ derive( Debug , Copy , Clone ) ]
376
+ pub struct UContext {
377
+ pub Flags : u64 ,
378
+ pub Link : u64 ,
379
+ pub Stack : SignalStack ,
380
+ pub Sigset : u64 ,
381
+ __pad : [ u8 ; ( 1024 / 8 ) - core:: mem:: size_of :: < u64 > ( ) ] ,
382
+ pub MContext : SigContext ,
383
+ }
384
+
385
+ #[ cfg( target_arch = "aarch64" ) ]
386
+ impl Default for UContext {
387
+ fn default ( ) -> Self {
388
+ Self {
389
+ Flags : 0 ,
390
+ Link : 0 ,
391
+ Stack : SignalStack :: default ( ) ,
392
+ Sigset : 0 ,
393
+ __pad : [ 0 ; ( 1024 / 8 ) - core:: mem:: size_of :: < u64 > ( ) ] ,
394
+ MContext : SigContext :: default ( ) ,
395
+ }
396
+ }
397
+ }
398
+
399
+ #[ cfg( target_arch = "aarch64" ) ]
400
+ impl UContext {
401
+ pub fn New ( ptRegs : & PtRegs , oldMask : u64 , cr2 : u64 , fpstate : u64 , alt : & SignalStack ) -> Self {
402
+ return Self {
403
+ Flags : 0 ,
404
+ Link : 0 ,
405
+ Stack : alt. clone ( ) ,
406
+ Sigset : 0 ,
407
+ __pad : [ 0u8 ; ( 1024 / 8 ) - core:: mem:: size_of :: < u64 > ( ) ] ,
408
+ MContext : SigContext :: New ( ptRegs, oldMask, cr2, fpstate) ,
409
+ } ;
410
+ }
411
+ }
412
+
413
+
371
414
// https://elixir.bootlin.com/linux/latest/source/arch/x86/include/uapi/asm/sigcontext.h#L284
372
415
#[ cfg( target_arch = "x86_64" ) ]
373
416
#[ repr( C ) ]
0 commit comments