Commit b4f0a316b5585b6aeca13bf9022e2ad3de8bafd3
1 parent
8508b89e
Report unassigned memory access to CPU (not enabled yet)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2776 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
12 additions
and
1 deletions
exec.c
@@ -1959,6 +1959,10 @@ static uint32_t unassigned_mem_readb(void *opaque, target_phys_addr_t addr) | @@ -1959,6 +1959,10 @@ static uint32_t unassigned_mem_readb(void *opaque, target_phys_addr_t addr) | ||
1959 | #ifdef DEBUG_UNASSIGNED | 1959 | #ifdef DEBUG_UNASSIGNED |
1960 | printf("Unassigned mem read 0x%08x\n", (int)addr); | 1960 | printf("Unassigned mem read 0x%08x\n", (int)addr); |
1961 | #endif | 1961 | #endif |
1962 | +#ifdef TARGET_SPARC | ||
1963 | + // Not enabled yet because of bugs in gdbstub etc. | ||
1964 | + //raise_exception(TT_DATA_ACCESS); | ||
1965 | +#endif | ||
1962 | return 0; | 1966 | return 0; |
1963 | } | 1967 | } |
1964 | 1968 | ||
@@ -1967,6 +1971,10 @@ static void unassigned_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_ | @@ -1967,6 +1971,10 @@ static void unassigned_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_ | ||
1967 | #ifdef DEBUG_UNASSIGNED | 1971 | #ifdef DEBUG_UNASSIGNED |
1968 | printf("Unassigned mem write 0x%08x = 0x%x\n", (int)addr, val); | 1972 | printf("Unassigned mem write 0x%08x = 0x%x\n", (int)addr, val); |
1969 | #endif | 1973 | #endif |
1974 | +#ifdef TARGET_SPARC | ||
1975 | + // Not enabled yet because of bugs in gdbstub etc. | ||
1976 | + //raise_exception(TT_DATA_ACCESS); | ||
1977 | +#endif | ||
1970 | } | 1978 | } |
1971 | 1979 | ||
1972 | static CPUReadMemoryFunc *unassigned_mem_read[3] = { | 1980 | static CPUReadMemoryFunc *unassigned_mem_read[3] = { |
target-sparc/cpu.h
@@ -40,6 +40,7 @@ | @@ -40,6 +40,7 @@ | ||
40 | #define TT_DFAULT 0x09 | 40 | #define TT_DFAULT 0x09 |
41 | #define TT_TOVF 0x0a | 41 | #define TT_TOVF 0x0a |
42 | #define TT_EXTINT 0x10 | 42 | #define TT_EXTINT 0x10 |
43 | +#define TT_DATA_ACCESS 0x29 | ||
43 | #define TT_DIV_ZERO 0x2a | 44 | #define TT_DIV_ZERO 0x2a |
44 | #define TT_NCP_INSN 0x24 | 45 | #define TT_NCP_INSN 0x24 |
45 | #define TT_TRAP 0x80 | 46 | #define TT_TRAP 0x80 |
@@ -55,7 +56,8 @@ | @@ -55,7 +56,8 @@ | ||
55 | #define TT_DIV_ZERO 0x28 | 56 | #define TT_DIV_ZERO 0x28 |
56 | #define TT_DFAULT 0x30 | 57 | #define TT_DFAULT 0x30 |
57 | #define TT_DMISS 0x31 | 58 | #define TT_DMISS 0x31 |
58 | -#define TT_DPROT 0x32 | 59 | +#define TT_DATA_ACCESS 0x32 |
60 | +#define TT_DPROT 0x33 | ||
59 | #define TT_UNALIGNED 0x34 | 61 | #define TT_UNALIGNED 0x34 |
60 | #define TT_PRIV_ACT 0x37 | 62 | #define TT_PRIV_ACT 0x37 |
61 | #define TT_EXTINT 0x40 | 63 | #define TT_EXTINT 0x40 |
@@ -287,6 +289,7 @@ void cpu_set_cwp(CPUSPARCState *env1, int new_cwp); | @@ -287,6 +289,7 @@ void cpu_set_cwp(CPUSPARCState *env1, int new_cwp); | ||
287 | #endif | 289 | #endif |
288 | 290 | ||
289 | int cpu_sparc_signal_handler(int host_signum, void *pinfo, void *puc); | 291 | int cpu_sparc_signal_handler(int host_signum, void *pinfo, void *puc); |
292 | +void raise_exception(int tt); | ||
290 | 293 | ||
291 | #include "cpu-all.h" | 294 | #include "cpu-all.h" |
292 | 295 |