Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | From 27442e2dd287d393d7b3f8bf164a887affef84df Mon Sep 17 00:00:00 2001 |
| 2 | From: Natanael Copa <ncopa@alpinelinux.org> |
| 3 | Date: Wed, 18 Nov 2015 10:27:51 +0000 |
| 4 | Subject: [PATCH 10/11] gnu-ucontext |
| 5 | |
| 6 | --- |
| 7 | open-vm-tools/lib/include/sigPosixRegs.h | 24 ++++++++++++------------ |
| 8 | 1 file changed, 12 insertions(+), 12 deletions(-) |
| 9 | |
| 10 | Index: open-vm-tools/lib/include/sigPosixRegs.h |
| 11 | =================================================================== |
| 12 | --- open-vm-tools.orig/lib/include/sigPosixRegs.h |
| 13 | +++ open-vm-tools/lib/include/sigPosixRegs.h |
| 14 | @@ -33,7 +33,7 @@ |
| 15 | #include "includeCheck.h" |
| 16 | |
| 17 | |
| 18 | -#if __linux__ // We need the REG_foo offsets in the gregset_t; |
| 19 | +#if defined(__GLIBC__) // We need the REG_foo offsets in the gregset_t; |
| 20 | # define _GNU_SOURCE // _GNU_SOURCE maps to __USE_GNU |
| 21 | |
| 22 | /* And, the REG_foo definitions conflict with our own in x86.h */ |
| 23 | @@ -73,7 +73,7 @@ |
| 24 | #include <sys/ucontext.h> |
| 25 | #endif |
| 26 | |
| 27 | -#if __linux__ |
| 28 | +#if defined(__GLIBC__) |
| 29 | # if defined(__x86_64__) |
| 30 | # undef REG_RAX |
| 31 | # undef REG_RBX |
| 32 | @@ -199,7 +199,7 @@ |
| 33 | #define SC_ESP(uc) ((unsigned long) (uc)->uc_mcontext.mc_esp) |
| 34 | #define SC_EIP(uc) ((unsigned long) (uc)->uc_mcontext.mc_eip) |
| 35 | #endif |
| 36 | -#elif defined (sun) |
| 37 | +#elif !defined (__GLIBC__) |
| 38 | #ifdef __x86_64__ |
| 39 | #define SC_EAX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_RAX]) |
| 40 | #define SC_EBX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_RBX]) |
| 41 | @@ -219,15 +219,15 @@ |
| 42 | #define SC_R14(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_R14]) |
| 43 | #define SC_R15(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_R15]) |
| 44 | #else |
| 45 | -#define SC_EAX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[EAX]) |
| 46 | -#define SC_EBX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[EBX]) |
| 47 | -#define SC_ECX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[ECX]) |
| 48 | -#define SC_EDX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[EDX]) |
| 49 | -#define SC_EDI(uc) ((unsigned long) (uc)->uc_mcontext.gregs[EDI]) |
| 50 | -#define SC_ESI(uc) ((unsigned long) (uc)->uc_mcontext.gregs[ESI]) |
| 51 | -#define SC_EBP(uc) ((unsigned long) (uc)->uc_mcontext.gregs[EBP]) |
| 52 | -#define SC_ESP(uc) ((unsigned long) (uc)->uc_mcontext.gregs[ESP]) |
| 53 | -#define SC_EIP(uc) ((unsigned long) (uc)->uc_mcontext.gregs[EIP]) |
| 54 | +#define SC_EAX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_EAX]) |
| 55 | +#define SC_EBX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_EBX]) |
| 56 | +#define SC_ECX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_ECX]) |
| 57 | +#define SC_EDX(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_EDX]) |
| 58 | +#define SC_EDI(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_EDI]) |
| 59 | +#define SC_ESI(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_ESI]) |
| 60 | +#define SC_EBP(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_EBP]) |
| 61 | +#define SC_ESP(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_ESP]) |
| 62 | +#define SC_EIP(uc) ((unsigned long) (uc)->uc_mcontext.gregs[REG_EIP]) |
| 63 | #endif |
| 64 | #elif defined(ANDROID_X86) |
| 65 | #define SC_EAX(uc) ((unsigned long) (uc)->uc_mcontext.eax) |