* src/vm/jit/mips/Makefile.am (libarch_la_SOURCES): Added md-trap.h.
[cacao.git] / src / vm / jit / mips / linux / md-os.c
index bcaef12e3ebe3cab31233b9e8db740a7f3aca103..31dc479e5c9018071a62c6b5e5abfbc6c1d448ae 100644 (file)
@@ -1,9 +1,7 @@
 /* src/vm/jit/mips/linux/md-os.c - machine dependent MIPS Linux functions
 
-   Copyright (C) 1996-2005, 2006, 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) 1996-2005, 2006, 2007, 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
@@ -47,6 +45,7 @@
 
 #include "vm/jit/asmpart.h"
 #include "vm/jit/stacktrace.h"
+#include "vm/jit/trap.h"
 
 
 /* md_init *********************************************************************
@@ -164,7 +163,7 @@ void md_signal_handler_sigsegv(int sig, siginfo_t *siginfo, void *_p)
                type = disp;
                val  = _gregs[d];
 
-               if (type == EXCEPTION_HARDWARE_COMPILER) {
+               if (type == TRAP_COMPILER) {
                        /* The XPC is the RA minus 4, because the RA points to the
                           instruction after the call. */
 
@@ -176,18 +175,18 @@ void md_signal_handler_sigsegv(int sig, siginfo_t *siginfo, void *_p)
                   define is 0. */
 
                addr = _gregs[s1];
-               type = (s4) addr;
+               type = (int) addr;
                val  = 0;
        }
 
-       /* Handle the type. */
+       /* Handle the trap. */
 
-       p = signal_handle(type, val, pv, sp, ra, xpc, _p);
+       p = trap_handle(type, val, pv, sp, ra, xpc, _p);
 
        /* Set registers. */
 
        switch (type) {
-       case EXCEPTION_HARDWARE_COMPILER:
+       case TRAP_COMPILER:
                if (p != NULL) {
                        _gregs[REG_PV]  = (uintptr_t) p;
 #if defined(__UCLIBC__)
@@ -212,7 +211,7 @@ void md_signal_handler_sigsegv(int sig, siginfo_t *siginfo, void *_p)
 
                /* fall-through */
 
-       case EXCEPTION_HARDWARE_PATCHER:
+       case TRAP_PATCHER:
                if (p == NULL) {
                        /* We set the PC again because the cause may have changed
                           the XPC. */