X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=src%2Fvm%2Fjit%2Fpowerpc%2Flinux%2Fmd-os.c;h=cdc937f5a8e329af60f7d9b1d1ff3aeb0bd52cec;hb=b76e356b0af200d2568e6fc55e82e233f1808eb9;hp=c0488347b971e66f990424a91e6a2d0cc0b7d6db;hpb=31fc14d3a4cf80754d7586e5d526326de499a1d7;p=cacao.git diff --git a/src/vm/jit/powerpc/linux/md-os.c b/src/vm/jit/powerpc/linux/md-os.c index c0488347b..cdc937f5a 100644 --- a/src/vm/jit/powerpc/linux/md-os.c +++ b/src/vm/jit/powerpc/linux/md-os.c @@ -35,13 +35,15 @@ #include "vm/jit/powerpc/md.h" #include "vm/jit/powerpc/linux/md-abi.h" -#include "threads/threads-common.h" +#include "threads/thread.h" #include "vm/builtin.h" #include "vm/exceptions.h" #include "vm/signallocal.h" #include "vm/stringlocal.h" + #include "vm/jit/asmpart.h" +#include "vm/jit/executionstate.h" #if defined(ENABLE_PROFILING) # include "vm/jit/optimizing/profile.h" @@ -49,6 +51,8 @@ #include "vm/jit/stacktrace.h" +#include "vmcore/system.h" + /* md_signal_handler_sigsegv *************************************************** @@ -296,14 +300,13 @@ void md_signal_handler_sigusr2(int sig, siginfo_t *siginfo, void *_p) #endif -/* md_replace_executionstate_read ********************************************** +/* md_executionstate_read ****************************************************** - Read the given context into an executionstate for Replacement. + Read the given context into an executionstate. *******************************************************************************/ -#if defined(ENABLE_REPLACEMENT) -void md_replace_executionstate_read(executionstate_t *es, void *context) +void md_executionstate_read(executionstate_t *es, void *context) { ucontext_t *_uc; mcontext_t *_mc; @@ -313,7 +316,7 @@ void md_replace_executionstate_read(executionstate_t *es, void *context) _uc = (ucontext_t *) context; #if defined(__UCLIBC__) -#error Please port md_replace_executionstate_read to __UCLIBC__ +#error Please port md_executionstate_read to __UCLIBC__ #else _mc = _uc->uc_mcontext.uc_regs; _gregs = _mc->gregs; @@ -334,19 +337,17 @@ void md_replace_executionstate_read(executionstate_t *es, void *context) * the _mc->fpregs[i] can cause invalid conversions. */ assert(sizeof(_mc->fpregs.fpregs) == sizeof(es->fltregs)); - memcpy(&es->fltregs, &_mc->fpregs.fpregs, sizeof(_mc->fpregs.fpregs)); + system_memcpy(&es->fltregs, &_mc->fpregs.fpregs, sizeof(_mc->fpregs.fpregs)); } -#endif -/* md_replace_executionstate_write ********************************************* +/* md_executionstate_write ***************************************************** - Write the given executionstate back to the context for Replacement. + Write the given executionstate back to the context. *******************************************************************************/ -#if defined(ENABLE_REPLACEMENT) -void md_replace_executionstate_write(executionstate_t *es, void *context) +void md_executionstate_write(executionstate_t *es, void *context) { ucontext_t *_uc; mcontext_t *_mc; @@ -356,7 +357,7 @@ void md_replace_executionstate_write(executionstate_t *es, void *context) _uc = (ucontext_t *) context; #if defined(__UCLIBC__) -#error Please port md_replace_executionstate_read to __UCLIBC__ +#error Please port md_executionstate_write to __UCLIBC__ #else _mc = _uc->uc_mcontext.uc_regs; _gregs = _mc->gregs; @@ -371,7 +372,7 @@ void md_replace_executionstate_write(executionstate_t *es, void *context) * the _mc->fpregs[i] can cause invalid conversions. */ assert(sizeof(_mc->fpregs.fpregs) == sizeof(es->fltregs)); - memcpy(&_mc->fpregs.fpregs, &es->fltregs, sizeof(_mc->fpregs.fpregs)); + system_memcpy(&_mc->fpregs.fpregs, &es->fltregs, sizeof(_mc->fpregs.fpregs)); /* write special registers */ _gregs[PT_NIP] = (ptrint) es->pc; @@ -379,7 +380,6 @@ void md_replace_executionstate_write(executionstate_t *es, void *context) _gregs[REG_PV] = (ptrint) es->pv; _gregs[PT_LNK] = (ptrint) es->ra; } -#endif /* md_critical_section_restart *************************************************