]> git.proxmox.com Git - qemu.git/blame - target-arm/cpu.h
sparc update
[qemu.git] / target-arm / cpu.h
CommitLineData
2c0262af
FB
1/*
2 * ARM virtual CPU header
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef CPU_ARM_H
21#define CPU_ARM_H
22
3cf1e035
FB
23#define TARGET_LONG_BITS 32
24
2c0262af
FB
25#include "cpu-defs.h"
26
b8a9e8f1
FB
27#define EXCP_UDEF 1 /* undefined instruction */
28#define EXCP_SWI 2 /* software interrupt */
29#define EXCP_PREFETCH_ABORT 3
30#define EXCP_DATA_ABORT 4
2c0262af 31
b7bcbe95
FB
32/* We currently assume float and double are IEEE single and double
33 precision respectively.
34 Doing runtime conversions is tricky because VFP registers may contain
35 integer values (eg. as the result of a FTOSI instruction).
36 A double precision register load/store must also load/store the
37 corresponding single precision pair, although it is undefined how
38 these overlap. */
39
2c0262af
FB
40typedef struct CPUARMState {
41 uint32_t regs[16];
42 uint32_t cpsr;
43
44 /* cpsr flag cache for faster execution */
45 uint32_t CF; /* 0 or 1 */
46 uint32_t VF; /* V is the bit 31. All other bits are undefined */
47 uint32_t NZF; /* N is bit 31. Z is computed from NZF */
99c475ab
FB
48 uint32_t QF; /* 0 or 1 */
49
50 int thumb; /* 0 = arm mode, 1 = thumb mode */
2c0262af 51
b8a9e8f1
FB
52 /* coprocessor 15 (MMU) status */
53 uint32_t cp15_6;
54
2c0262af
FB
55 /* exception/interrupt handling */
56 jmp_buf jmp_env;
57 int exception_index;
58 int interrupt_request;
59 struct TranslationBlock *current_tb;
60 int user_mode_only;
b7bcbe95 61 uint32_t address;
2c0262af 62
d720b93d
FB
63 /* in order to avoid passing too many arguments to the memory
64 write helpers, we store some rarely used information in the CPU
65 context) */
66 unsigned long mem_write_pc; /* host pc at which the memory was
67 written */
68 unsigned long mem_write_vaddr; /* target virtual addr at which the
69 memory was written */
b7bcbe95
FB
70 /* VFP coprocessor state. */
71 struct {
72 union {
73 float s[32];
74 double d[16];
75 } regs;
76
77 /* We store these fpcsr fields separately for convenience. */
78 int vec_len;
79 int vec_stride;
80
81 uint32_t fpscr;
82
83 /* Temporary variables if we don't have spare fp regs. */
84 float tmp0s, tmp1s;
85 double tmp0d, tmp1d;
86
87 } vfp;
88
2c0262af
FB
89 /* user data */
90 void *opaque;
91} CPUARMState;
92
93CPUARMState *cpu_arm_init(void);
94int cpu_arm_exec(CPUARMState *s);
95void cpu_arm_close(CPUARMState *s);
96/* you can call this signal handler from your SIGBUS and SIGSEGV
97 signal handlers to inform the virtual CPU of exceptions. non zero
98 is returned if the signal was handled by the virtual CPU. */
99struct siginfo;
100int cpu_arm_signal_handler(int host_signum, struct siginfo *info,
101 void *puc);
102
2c0262af
FB
103#define TARGET_PAGE_BITS 12
104#include "cpu-all.h"
105
106#endif