Move trap handlers to functions
[jamvm-avr32-jem.git] / src / arch / avr32_jem.h
blob18aed35a598f448cd086b6fb28f6f0b4bce9d9fa
1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007
3 * Robert Lougher <rob@lougher.org.uk>.
5 * This file is part of JamVM.
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2,
10 * or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #ifndef AVR32_JEM_H_
23 #define AVR32_JEM_H_
24 #ifdef JEM
26 #define JEM_TRAP_ENTRIES 25 //our own trap table entries,the first entry is a jump to the proper offset
27 //extern static const void* jem_trap_handlers_0_ENTRY[JEM_TRAP_ENTRIES];
29 //extern char *trap_h;
31 #define __NR_java_settrap 282
33 /**
34 * Called when exit jam vm
35 * TODO:
37 #define DESTORY_JEM_TRAPS
39 enum {
40 JEM_TRAP_HANDLER_FINISH = 1,
41 JEM_TRAP_HANDLER_SYSEX,
42 JEM_TRAP_HANDLER_UNIMPL,
45 struct frame;
46 struct jem_state {
47 uint32_t jecr;
48 uint32_t trap_pc;
49 uint32_t josp;
50 uint32_t jpc;
53 typedef int handler_fn(struct jem_state *jem);
55 extern handler_fn *trap_handler_f[256];
56 //extern handler_fn *exception_handler_f[5];
57 extern unsigned long jos[8];
59 #endif /*JEM*/
60 #endif /*AVR32_JEM_H_*/