projects
/
cacao.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* Removed all Id tags.
[cacao.git]
/
src
/
vm
/
jit
/
sparc64
/
linux
/
md-os.c
diff --git
a/src/vm/jit/sparc64/linux/md-os.c
b/src/vm/jit/sparc64/linux/md-os.c
index 7cb275a512c48f5d4f2983245c0075a45ec63ced..aa6fa8a401dfc8f010716ad0fb36692897587eec 100644
(file)
--- a/
src/vm/jit/sparc64/linux/md-os.c
+++ b/
src/vm/jit/sparc64/linux/md-os.c
@@
-22,14
+22,13
@@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: md-os.c 7363 2007-02-15 14:57:04Z twisti $
-
*/
#include "config.h"
#include <assert.h>
*/
#include "config.h"
#include <assert.h>
+#include <stdint.h>
#include <signal.h>
#include "vm/types.h"
#include <signal.h>
#include "vm/types.h"
@@
-37,7
+36,6
@@
#include "vm/jit/sparc64/codegen.h"
#include "vm/jit/sparc64/md-abi.h"
#include "vm/jit/sparc64/codegen.h"
#include "vm/jit/sparc64/md-abi.h"
-#include "vm/exceptions.h"
#include "vm/signallocal.h"
#include "vm/stringlocal.h"
#include "vm/jit/asmpart.h"
#include "vm/signallocal.h"
#include "vm/stringlocal.h"
#include "vm/jit/asmpart.h"
@@
-87,6
+85,7
@@
ptrint md_get_reg_from_context(sigcontext *ctx, u4 rindex)
void md_signal_handler_sigsegv(int sig, siginfo_t *info , void *_p)
{
void md_signal_handler_sigsegv(int sig, siginfo_t *info , void *_p)
{
+ stackframeinfo sfi;
/*
ucontext_t *_uc;
mcontext_t *_mc;
/*
ucontext_t *_uc;
mcontext_t *_mc;
@@
-97,13
+96,13
@@
void md_signal_handler_sigsegv(int sig, siginfo_t *info , void *_p)
u1 *ra;
u1 *xpc;
u4 mcode;
u1 *ra;
u1 *xpc;
u4 mcode;
-
s4
d;
-
s4
s1;
-
s4
disp;
-
ptrint
val;
-
ptrint
addr;
-
s4
type;
-
java_objectheader *e
;
+
int
d;
+
int
s1;
+
int16_t
disp;
+
intptr_t
val;
+
intptr_t
addr;
+
int
type;
+
void *p
;
ctx = (sigcontext *) info;
ctx = (sigcontext *) info;
@@
-136,23
+135,31
@@
void md_signal_handler_sigsegv(int sig, siginfo_t *info , void *_p)
/* This is a normal NPE: addr must be NULL and the NPE-type
define is 0. */
/* This is a normal NPE: addr must be NULL and the NPE-type
define is 0. */
- addr
= md_get_reg_from_context(ctx, s1);
- type = (
s4
) addr;
+ addr = md_get_reg_from_context(ctx, s1);
+ type = (
int
) addr;
}
}
+ /* create stackframeinfo */
+
+ stacktrace_create_extern_stackframeinfo(&sfi, pv, sp, ra, xpc);
+
+ /* Handle the type. */
+
+ p = signal_handle(xpc, type, val);
+
+ /* remove stackframeinfo */
-
e = exceptions_new_hardware_exception(pv, sp, ra, xpc, type, val
);
+
stacktrace_remove_stackframeinfo(&sfi
);
/* set registers */
/* set registers */
- ctx->sigc_regs.u_regs[REG_ITMP2_XPTR] = (
ptrint) e
;
- ctx->sigc_regs.u_regs[REG_ITMP3_XPC] = (
ptrin
t) xpc;
- ctx->sigc_regs.tpc = (
ptrin
t) asm_handle_exception;
- ctx->sigc_regs.tnpc = (
ptrin
t) asm_handle_exception + 4;
+ ctx->sigc_regs.u_regs[REG_ITMP2_XPTR] = (
intptr_t) p
;
+ ctx->sigc_regs.u_regs[REG_ITMP3_XPC] = (
intptr_
t) xpc;
+ ctx->sigc_regs.tpc = (
intptr_
t) asm_handle_exception;
+ ctx->sigc_regs.tnpc = (
intptr_
t) asm_handle_exception + 4;
}
}
-
/* md_icacheflush **************************************************************
Calls the system's function to flush the instruction cache.
/* md_icacheflush **************************************************************
Calls the system's function to flush the instruction cache.
@@
-179,28
+186,37
@@
void md_icacheflush(u1 *addr, s4 nbytes)
}
#if defined(ENABLE_THREADS)
}
#if defined(ENABLE_THREADS)
-/*
thread_restartcriticalsection
**********************************************
+/*
md_critical_section_restart **
**********************************************
- Reads PC and modifies NPC
+ Search the critical sections tree for a matching section and set
+ the NPC to the restart point, if necessary.
+
+ Reads PC and modifies NPC.
******************************************************************************/
******************************************************************************/
-void
thread_restartcriticalsection
(ucontext_t *_uc)
+void
md_critical_section_restart
(ucontext_t *_uc)
{
{
- mcontext_t *_mc;
+ /* mcontext_t *_mc; */
+ sigcontext *ctx;
u1 *pc;
u1 *npc;
u1 *pc;
u1 *npc;
- _mc = &_uc->uc_mcontext;
+ printf("ignoring md_critical_section_restart\n");
+ return;
- pc = (u1 *) _mc->mc_gregs[MC_PC];
+ /* again, we are getting sigcontext instead of ucontext */
+ ctx = (sigcontext *) _uc;
+
+ pc = (u1 *) ctx->sigc_regs.tpc;
npc = critical_find_restart_point(pc);
npc = critical_find_restart_point(pc);
- assert(npc);
- _mc->mc_gregs[MC_NPC] = (ptrint) npc;
+ if (npc != NULL) {
+ log_println("md_critical_section_restart: pc=%p, npc=%p", pc, npc);
+ ctx->sigc_regs.tnpc = (ptrint) npc;
+ }
- assert(false);
}
#endif
}
#endif