X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FAdjustor.c;h=841c6603be05e35d426a175dbf8489414f16ab30;hb=98c68a1c5b63aadf9c7917274519d95bbe9394d4;hp=841f75c5d02e24522745e3ce2d57271ab46f84bb;hpb=b321da7d6a94582b5d59399a639af1b36e2e7a3b;p=ghc-hetmet.git diff --git a/rts/Adjustor.c b/rts/Adjustor.c index 841f75c..841c660 100644 --- a/rts/Adjustor.c +++ b/rts/Adjustor.c @@ -84,10 +84,6 @@ static void GNUC3_ATTRIBUTE(used) obscure_ccall_wrapper(void) } extern void obscure_ccall_ret_code(void); -#if defined(openbsd_HOST_OS) -static unsigned char *obscure_ccall_ret_code_dyn; -#endif - #endif #if defined(x86_64_HOST_ARCH) @@ -322,11 +318,7 @@ createAdjustor(int cconv, StgStablePtr hptr, adj_code[0x0a] = (unsigned char)0x68; /* pushl obscure_ccall_ret_code */ *((StgFunPtr*)(adj_code + 0x0b)) = -#if !defined(openbsd_HOST_OS) (StgFunPtr)obscure_ccall_ret_code; -#else - (StgFunPtr)obscure_ccall_ret_code_dyn; -#endif adj_code[0x0f] = (unsigned char)0xff; /* jmp *%eax */ adj_code[0x10] = (unsigned char)0xe0; @@ -425,11 +417,6 @@ createAdjustor(int cconv, StgStablePtr hptr, 38: .quad 0 # aligned on 8-byte boundary */ - /* we assume the small code model (gcc -mcmmodel=small) where - * all symbols are <2^32, so hence wptr should fit into 32 bits. - */ - ASSERT(((long)wptr >> 32) == 0); - { int i = 0; char *c; @@ -1037,7 +1024,7 @@ freeHaskellFunctionPtr(void* ptr) } else { freeStablePtr(*((StgStablePtr*)((unsigned char*)ptr + 0x02))); } -#elif defined(x86_HOST_ARCH) && defined(darwin_HOST_OS) +#elif defined(i386_HOST_ARCH) && defined(darwin_HOST_OS) if ( *(unsigned char*)ptr != 0xe8 ) { errorBelch("freeHaskellFunctionPtr: not for me, guv! %p\n", ptr); return; @@ -1099,21 +1086,3 @@ if ( *(unsigned char*)ptr != 0xe8 ) { freeExec(ptr); } - - -/* - * Function: initAdjustor() - * - * Perform initialisation of adjustor thunk layer (if needed.) - */ -void -initAdjustor(void) -{ -#if defined(i386_HOST_ARCH) && defined(openbsd_HOST_OS) - obscure_ccall_ret_code_dyn = allocateExec(4); - obscure_ccall_ret_code_dyn[0] = ((unsigned char *)obscure_ccall_ret_code)[0]; - obscure_ccall_ret_code_dyn[1] = ((unsigned char *)obscure_ccall_ret_code)[1]; - obscure_ccall_ret_code_dyn[2] = ((unsigned char *)obscure_ccall_ret_code)[2]; - obscure_ccall_ret_code_dyn[3] = ((unsigned char *)obscure_ccall_ret_code)[3]; -#endif -}