Statistics
| Branch: | Revision:

root / target-arm / cpu.h @ 2c0262af

History | View | Annotate | Download (2 kB)

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