[x86/Linux] Fix compilation in pal
authorSaeHie Park <saehie.park@samsung.com>
Tue, 22 Nov 2016 02:22:16 +0000 (11:22 +0900)
committerSaeHie Park <saehie.park@samsung.com>
Tue, 22 Nov 2016 11:24:03 +0000 (20:24 +0900)
WIP, fix compile error for x86/Linux
- add KNONVOLATILE_CONTEXT_POINTERS
- add _X86_ codes in pal/context.h

src/pal/inc/pal.h
src/pal/src/include/pal/context.h

index 25aa9be60da2feedc1e1d07829ccd440af37c2ee..93323ebccb9f768289ae5f1d88f960ce95a2f022 100644 (file)
@@ -1889,6 +1889,16 @@ typedef struct _CONTEXT {
 // support any other values in the ExtendedRegisters) but we might as well be as accurate as we can.
 #define CONTEXT_EXREG_XMM_OFFSET 160
 
+typedef struct _KNONVOLATILE_CONTEXT_POINTERS {
+
+    // TODO WIP x86/Linux, need to fix this.
+    PDWORD Ebx;
+    PDWORD Esi;
+    PDWORD Edi;
+    PDWORD Ebp;
+
+} KNONVOLATILE_CONTEXT_POINTERS, *PKNONVOLATILE_CONTEXT_POINTERS;
+
 #elif defined(_PPC_)
 
 //
@@ -3282,6 +3292,8 @@ PALIMPORT BOOL PALAPI PAL_VirtualUnwindOutOfProc(CONTEXT *context,
 #define PAL_CS_NATIVE_DATA_SIZE 80
 #elif defined(__linux__) && defined(_ARM64_)
 #define PAL_CS_NATIVE_DATA_SIZE 116
+#elif defined(__linux__) && defined(__i386__)
+#define PAL_CS_NATIVE_DATA_SIZE 76
 #elif defined(__linux__) && defined(__x86_64__)
 #define PAL_CS_NATIVE_DATA_SIZE 96
 #elif defined(__NetBSD__) && defined(__amd64__)
index 3da300598b72897bd3dae413f2f933b80904a28d..794fe32310e052fa5ae523be48e4a0eadcce13ec 100644 (file)
@@ -454,6 +454,8 @@ inline static DWORD64 CONTEXTGetPC(LPCONTEXT pContext)
 {
 #if defined(_AMD64_)
     return pContext->Rip;
+#elif defined(_X86_)
+    return pContext->Eip;
 #elif defined(_ARM64_) || defined(_ARM_)
     return pContext->Pc;
 #else
@@ -465,6 +467,8 @@ inline static void CONTEXTSetPC(LPCONTEXT pContext, DWORD64 pc)
 {
 #if defined(_AMD64_)
     pContext->Rip = pc;
+#elif defined(_X86_)
+    pContext->Eip = pc;
 #elif defined(_ARM64_) || defined(_ARM_)
     pContext->Pc = pc;
 #else
@@ -476,6 +480,8 @@ inline static DWORD64 CONTEXTGetFP(LPCONTEXT pContext)
 {
 #if defined(_AMD64_)
     return pContext->Rbp;
+#elif defined(_X86_)
+    return pContext->Ebp;
 #elif defined(_ARM_)
     return pContext->R7;
 #elif defined(_ARM64_)