aboutsummaryrefslogtreecommitdiffstats
path: root/main/open-vm-tools/musl-regs.patch
blob: 9d0236da7c133fcdf37c67e46c6594558e14d54c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
--- open-vm-tools-9.4.6-1770165.orig/lib/include/sigPosixRegs.h
+++ open-vm-tools-9.4.6-1770165/lib/include/sigPosixRegs.h
@@ -37,7 +37,7 @@
 #  define _GNU_SOURCE // _GNU_SOURCE maps to __USE_GNU
 
 /* And, the REG_foo definitions conflict with our own in x86.h */
-#  if defined(__x86_64__)
+#  if defined(__x86_64__) && defined(__GLIBC__)
 #    define REG_RAX GNU_REG_RAX
 #    define REG_RBX GNU_REG_RBX
 #    define REG_RCX GNU_REG_RCX
@@ -55,7 +55,7 @@
 #    define REG_R13 GNU_REG_R13
 #    define REG_R14 GNU_REG_R14
 #    define REG_R15 GNU_REG_R15
-#  elif defined(__i386__)
+#  elif defined(__i386__) && defined(__GLIBC__)
 #    define REG_EAX GNU_REG_EAX
 #    define REG_EBX GNU_REG_EBX
 #    define REG_ECX GNU_REG_ECX
@@ -73,7 +73,7 @@
 #include <sys/ucontext.h>
 #endif
 
-#if __linux__
+#if __GLIBC__
 #  if defined(__x86_64__)
 #    undef REG_RAX
 #    undef REG_RBX
@@ -219,23 +219,23 @@
 #define SC_EIP(uc) ((unsigned long) (uc)->uc_mcontext.eip)
 #else
 #ifdef __x86_64__
-#define SC_EAX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_RAX])
-#define SC_EBX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_RBX])
-#define SC_ECX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_RCX])
-#define SC_EDX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_RDX])
-#define SC_EDI(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_RDI])
-#define SC_ESI(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_RSI])
-#define SC_EBP(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_RBP])
-#define SC_ESP(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_RSP])
-#define SC_EIP(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_RIP])
-#define SC_R8(uc)  ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_R8])
-#define SC_R9(uc)  ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_R9])
-#define SC_R10(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_R10])
-#define SC_R11(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_R11])
-#define SC_R12(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_R12])
-#define SC_R13(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_R13])
-#define SC_R14(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_R14])
-#define SC_R15(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_R15])
+#define SC_EAX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_RAX])
+#define SC_EBX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_RBX])
+#define SC_ECX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_RCX])
+#define SC_EDX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_RDX])
+#define SC_EDI(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_RDI])
+#define SC_ESI(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_RSI])
+#define SC_EBP(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_RBP])
+#define SC_ESP(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_RSP])
+#define SC_EIP(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_RIP])
+#define SC_R8(uc)  ((unsigned long) (uc)->uc_mcontext.gregs[REG_R8])
+#define SC_R9(uc)  ((unsigned long) (uc)->uc_mcontext.gregs[REG_R9])
+#define SC_R10(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_R10])
+#define SC_R11(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_R11])
+#define SC_R12(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_R12])
+#define SC_R13(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_R13])
+#define SC_R14(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_R14])
+#define SC_R15(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_R15])
 #elif defined(__arm__)
 #define SC_R0(uc)  ((unsigned long) (uc)->uc_mcontext.arm_r0)
 #define SC_R1(uc)  ((unsigned long) (uc)->uc_mcontext.arm_r1)
@@ -254,15 +254,15 @@
 #define SC_LR(uc)  ((unsigned long) (uc)->uc_mcontext.arm_lr)
 #define SC_PC(uc)  ((unsigned long) (uc)->uc_mcontext.arm_pc)
 #else
-#define SC_EAX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_EAX])
-#define SC_EBX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_EBX])
-#define SC_ECX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_ECX])
-#define SC_EDX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_EDX])
-#define SC_EDI(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_EDI])
-#define SC_ESI(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_ESI])
-#define SC_EBP(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_EBP])
-#define SC_ESP(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_ESP])
-#define SC_EIP(uc) ((unsigned long) (uc)->uc_mcontext.gregs[GNU_REG_EIP])
+#define SC_EAX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_EAX])
+#define SC_EBX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_EBX])
+#define SC_ECX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_ECX])
+#define SC_EDX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_EDX])
+#define SC_EDI(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_EDI])
+#define SC_ESI(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_ESI])
+#define SC_EBP(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_EBP])
+#define SC_ESP(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_ESP])
+#define SC_EIP(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_EIP])
 #endif
 #endif