]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: correct signal structs/offsets for openbsd/arm
authorJoel Sing <joel@sing.id.au>
Thu, 13 Dec 2018 18:03:37 +0000 (05:03 +1100)
committerJoel Sing <joel@sing.id.au>
Thu, 13 Dec 2018 18:13:30 +0000 (18:13 +0000)
Update sigcontext and siginfo structs to match those currently in use by OpenBSD armv7.

Also correct the offset of the fault address field in the siginfo struct, which moved
due to the switch to EABI.

Change-Id: Icdd95222346239fcc04b95ae0fcefae09b7aa044
Reviewed-on: https://go-review.googlesource.com/c/154077
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/runtime/defs_openbsd_arm.go
src/runtime/signal_openbsd_arm.go

index bfccf5772e327f8a55b4cc2fafa3f6a102db0792..59f9410e1d63fe6c1a9563f148610449be04d207 100644 (file)
@@ -114,13 +114,17 @@ type sigcontext struct {
        sc_usr_lr uint32
        sc_svc_lr uint32
        sc_pc     uint32
+       sc_fpused uint32
+       sc_fpscr  uint32
+       sc_fpreg  [32]uint64
 }
 
 type siginfo struct {
-       si_signo int32
-       si_code  int32
-       si_errno int32
-       _data    [116]byte
+       si_signo  int32
+       si_code   int32
+       si_errno  int32
+       pad_cgo_0 [4]byte
+       _data     [120]byte
 }
 
 type stackt struct {
index 97bb13b4f3e1ffc95440759adc832edd132995cb..f796550e60c0da003b329da4b7f96b22d35177d6 100644 (file)
@@ -45,7 +45,7 @@ func (c *sigctxt) oldmask() uint32 { return 0 }
 
 func (c *sigctxt) sigcode() uint32 { return uint32(c.info.si_code) }
 func (c *sigctxt) sigaddr() uint32 {
-       return *(*uint32)(add(unsafe.Pointer(c.info), 12))
+       return *(*uint32)(add(unsafe.Pointer(c.info), 16))
 }
 
 func (c *sigctxt) set_pc(x uint32)  { c.regs().sc_pc = x }
@@ -55,5 +55,5 @@ func (c *sigctxt) set_r10(x uint32) { c.regs().sc_r10 = x }
 
 func (c *sigctxt) set_sigcode(x uint32) { c.info.si_code = int32(x) }
 func (c *sigctxt) set_sigaddr(x uint32) {
-       *(*uint32)(add(unsafe.Pointer(c.info), 12)) = x
+       *(*uint32)(add(unsafe.Pointer(c.info), 16)) = x
 }