Forráskód Böngészése

bits/signal.h: add register names for x86(_64)

glibc exposes them from ucontext.h.
since that header includes signal.h, it is safe to put them
into bits/signal.h, if _GNU_SOURCE is defined.
rofl0r 12 éve
szülő
commit
a631c5df53
2 módosított fájl, 46 hozzáadás és 0 törlés
  1. 21 0
      arch/i386/bits/signal.h
  2. 25 0
      arch/x86_64/bits/signal.h

+ 21 - 0
arch/i386/bits/signal.h

@@ -49,6 +49,26 @@ typedef struct __ucontext {
 #define SA_RESETHAND  0x80000000
 #define SA_RESTORER   0x04000000
 
+#define REG_GS		0
+#define REG_FS		1
+#define REG_ES		2
+#define REG_DS		3
+#define REG_EDI		4
+#define REG_ESI		5
+#define REG_EBP		6
+#define REG_ESP		7
+#define REG_EBX		8
+#define REG_EDX		9
+#define REG_ECX		10
+#define REG_EAX		11
+#define REG_TRAPNO	12
+#define REG_ERR		13
+#define REG_EIP		14
+#define REG_CS		15
+#define REG_EFL		16
+#define REG_UESP	17
+#define REG_SS		18
+
 #endif
 
 #define SIGHUP    1
@@ -86,3 +106,4 @@ typedef struct __ucontext {
 #define SIGUNUSED SIGSYS
 
 #define _NSIG 65
+

+ 25 - 0
arch/x86_64/bits/signal.h

@@ -52,6 +52,30 @@ typedef struct __ucontext {
 #define SA_RESETHAND  0x80000000
 #define SA_RESTORER   0x04000000
 
+#define REG_R8		0
+#define REG_R9		1
+#define REG_R10		2
+#define REG_R11		3
+#define REG_R12		4
+#define REG_R13		5
+#define REG_R14		6
+#define REG_R15		7
+#define REG_RDI		8
+#define REG_RSI		9
+#define REG_RBP		10
+#define REG_RBX		11
+#define REG_RDX		12
+#define REG_RAX		13
+#define REG_RCX		14
+#define REG_RSP		15
+#define REG_RIP		16
+#define REG_EFL		17
+#define REG_CSGFS	18
+#define REG_ERR		19
+#define REG_TRAPNO	20
+#define REG_OLDMASK	21
+#define REG_CR2		22
+
 #endif
 
 #define SIGHUP    1
@@ -89,3 +113,4 @@ typedef struct __ucontext {
 #define SIGUNUSED SIGSYS
 
 #define _NSIG 65
+