X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=src%2Fvm%2Fjit%2Fx86_64%2Flinux%2Fmd-os.c;h=aa81679c819f0efe948371c6c05d4665e8040fa3;hb=b76e356b0af200d2568e6fc55e82e233f1808eb9;hp=ced1cbee47c3965e4e7c78c5f8aaf40a28f5daff;hpb=442995cf7995968cef0869f3dfba20b609cbe5be;p=cacao.git diff --git a/src/vm/jit/x86_64/linux/md-os.c b/src/vm/jit/x86_64/linux/md-os.c index ced1cbee4..aa81679c8 100644 --- a/src/vm/jit/x86_64/linux/md-os.c +++ b/src/vm/jit/x86_64/linux/md-os.c @@ -1,9 +1,7 @@ /* src/vm/jit/x86_64/linux/md-os.c - machine dependent x86_64 Linux functions - Copyright (C) 2007 R. Grafl, A. Krall, C. Kruegel, - C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring, - E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, - J. Wenninger, Institut f. Computersprachen - TU Wien + Copyright (C) 2007, 2008 + CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO This file is part of CACAO. @@ -37,16 +35,16 @@ #include "vm/types.h" #include "vm/jit/x86_64/codegen.h" +#include "vm/jit/x86_64/md.h" -#if defined(ENABLE_THREADS) -# include "threads/native/threads.h" -#endif +#include "threads/thread.h" #include "vm/builtin.h" #include "vm/exceptions.h" #include "vm/signallocal.h" #include "vm/jit/asmpart.h" +#include "vm/jit/executionstate.h" #include "vm/jit/stacktrace.h" @@ -363,14 +361,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; @@ -381,7 +378,7 @@ void md_replace_executionstate_read(executionstate_t *es, void *context) _mc = &_uc->uc_mcontext; /* read special registers */ - es->pc = (u1 *) _mc->gregs[REG_RSP]; + es->pc = (u1 *) _mc->gregs[REG_RIP]; es->sp = (u1 *) _mc->gregs[REG_RSP]; es->pv = NULL; @@ -433,17 +430,15 @@ void md_replace_executionstate_read(executionstate_t *es, void *context) for (i = 0; i < FLT_REG_CNT; i++) es->fltregs[i] = 0xdeadbeefdeadbeefL; } -#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; @@ -501,7 +496,6 @@ void md_replace_executionstate_write(executionstate_t *es, void *context) _mc->gregs[REG_RIP] = (ptrint) es->pc; _mc->gregs[REG_RSP] = (ptrint) es->sp; } -#endif /* md_critical_section_restart *************************************************