Statistics
| Branch: | Revision:

root / target-arm / cpu.h @ afc7df11

History | View | Annotate | Download (2.6 kB)

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

    
23
#define TARGET_LONG_BITS 32
24

    
25
#include "cpu-defs.h"
26

    
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
31

    
32
typedef struct CPUARMState {
33
    uint32_t regs[16];
34
    uint32_t cpsr;
35
    
36
    /* cpsr flag cache for faster execution */
37
    uint32_t CF; /* 0 or 1 */
38
    uint32_t VF; /* V is the bit 31. All other bits are undefined */
39
    uint32_t NZF; /* N is bit 31. Z is computed from NZF */
40
    uint32_t QF; /* 0 or 1 */
41

    
42
    int thumb; /* 0 = arm mode, 1 = thumb mode */
43

    
44
    /* coprocessor 15 (MMU) status */
45
    uint32_t cp15_6;
46
    
47
    /* exception/interrupt handling */
48
    jmp_buf jmp_env;
49
    int exception_index;
50
    int interrupt_request;
51
    struct TranslationBlock *current_tb;
52
    int user_mode_only;
53

    
54
    /* in order to avoid passing too many arguments to the memory
55
       write helpers, we store some rarely used information in the CPU
56
       context) */
57
    unsigned long mem_write_pc; /* host pc at which the memory was
58
                                   written */
59
    unsigned long mem_write_vaddr; /* target virtual addr at which the
60
                                      memory was written */
61
    /* user data */
62
    void *opaque;
63
} CPUARMState;
64

    
65
CPUARMState *cpu_arm_init(void);
66
int cpu_arm_exec(CPUARMState *s);
67
void cpu_arm_close(CPUARMState *s);
68
/* you can call this signal handler from your SIGBUS and SIGSEGV
69
   signal handlers to inform the virtual CPU of exceptions. non zero
70
   is returned if the signal was handled by the virtual CPU.  */
71
struct siginfo;
72
int cpu_arm_signal_handler(int host_signum, struct siginfo *info, 
73
                           void *puc);
74

    
75
#define TARGET_PAGE_BITS 12
76
#include "cpu-all.h"
77

    
78
#endif