root / cpu-arm.h @ b67d5959
History | View | Annotate | Download (2 kB)
1 | 5898e816 | bellard | /*
|
---|---|---|---|
2 | 5898e816 | bellard | * ARM virtual CPU header
|
3 | 5898e816 | bellard | *
|
4 | 5898e816 | bellard | * Copyright (c) 2003 Fabrice Bellard
|
5 | 5898e816 | bellard | *
|
6 | 5898e816 | bellard | * This library is free software; you can redistribute it and/or
|
7 | 5898e816 | bellard | * modify it under the terms of the GNU Lesser General Public
|
8 | 5898e816 | bellard | * License as published by the Free Software Foundation; either
|
9 | 5898e816 | bellard | * version 2 of the License, or (at your option) any later version.
|
10 | 5898e816 | bellard | *
|
11 | 5898e816 | bellard | * This library is distributed in the hope that it will be useful,
|
12 | 5898e816 | bellard | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 | 5898e816 | bellard | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14 | 5898e816 | bellard | * Lesser General Public License for more details.
|
15 | 5898e816 | bellard | *
|
16 | 5898e816 | bellard | * You should have received a copy of the GNU Lesser General Public
|
17 | 5898e816 | bellard | * License along with this library; if not, write to the Free Software
|
18 | 5898e816 | bellard | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19 | 5898e816 | bellard | */
|
20 | 5898e816 | bellard | #ifndef CPU_ARM_H
|
21 | 5898e816 | bellard | #define CPU_ARM_H
|
22 | 5898e816 | bellard | |
23 | 33417e70 | bellard | #include "cpu-defs.h" |
24 | 5898e816 | bellard | |
25 | 5898e816 | bellard | #define EXCP_UDEF 1 /* undefined instruction */ |
26 | 5898e816 | bellard | #define EXCP_SWI 2 /* software interrupt */ |
27 | 5898e816 | bellard | |
28 | 5898e816 | bellard | typedef struct CPUARMState { |
29 | 5898e816 | bellard | uint32_t regs[16];
|
30 | 5898e816 | bellard | uint32_t cpsr; |
31 | 5898e816 | bellard | |
32 | 5898e816 | bellard | /* cpsr flag cache for faster execution */
|
33 | 5898e816 | bellard | uint32_t CF; /* 0 or 1 */
|
34 | 5898e816 | bellard | uint32_t VF; /* V is the bit 31. All other bits are undefined */
|
35 | 5898e816 | bellard | uint32_t NZF; /* N is bit 31. Z is computed from NZF */
|
36 | 5898e816 | bellard | |
37 | 5898e816 | bellard | /* exception/interrupt handling */
|
38 | 5898e816 | bellard | jmp_buf jmp_env; |
39 | 5898e816 | bellard | int exception_index;
|
40 | 5898e816 | bellard | int interrupt_request;
|
41 | e2f22898 | bellard | struct TranslationBlock *current_tb;
|
42 | e2f22898 | bellard | int user_mode_only;
|
43 | 5898e816 | bellard | |
44 | 5898e816 | bellard | /* user data */
|
45 | 5898e816 | bellard | void *opaque;
|
46 | 5898e816 | bellard | } CPUARMState; |
47 | 5898e816 | bellard | |
48 | 5898e816 | bellard | CPUARMState *cpu_arm_init(void);
|
49 | 5898e816 | bellard | int cpu_arm_exec(CPUARMState *s);
|
50 | 5898e816 | bellard | void cpu_arm_close(CPUARMState *s);
|
51 | 5898e816 | bellard | /* you can call this signal handler from your SIGBUS and SIGSEGV
|
52 | 5898e816 | bellard | signal handlers to inform the virtual CPU of exceptions. non zero
|
53 | 5898e816 | bellard | is returned if the signal was handled by the virtual CPU. */
|
54 | 5898e816 | bellard | struct siginfo;
|
55 | 5898e816 | bellard | int cpu_arm_signal_handler(int host_signum, struct siginfo *info, |
56 | 5898e816 | bellard | void *puc);
|
57 | 5898e816 | bellard | |
58 | 5898e816 | bellard | void cpu_arm_dump_state(CPUARMState *env, FILE *f, int flags); |
59 | 5898e816 | bellard | |
60 | 5898e816 | bellard | #define TARGET_PAGE_BITS 12 |
61 | 5898e816 | bellard | #include "cpu-all.h" |
62 | 5898e816 | bellard | |
63 | 5898e816 | bellard | #endif |