revision 566:59be465e5f01
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 566:59be465e5f01 |
parent | 565:a44f0465bbbe |
child | 567:b14dad34c441 |
author | nkeynes |
date | Tue Jan 01 08:57:33 2008 +0000 (15 years ago) |
branch | lxdream-mmu |
Add breakpoint_type_t enum (general cleanup)
![]() | src/aica/armcore.c | view | annotate | diff | log | |
![]() | src/aica/armcore.h | view | annotate | diff | log | |
![]() | src/cpu.h | view | annotate | diff | log | |
![]() | src/mem.h | view | annotate | diff | log | |
![]() | src/sh4/sh4.c | view | annotate | diff | log | |
![]() | src/sh4/sh4.h | view | annotate | diff | log |
1.1 --- a/src/aica/armcore.c Tue Jan 01 08:57:03 2008 +00001.2 +++ b/src/aica/armcore.c Tue Jan 01 08:57:33 2008 +00001.3 @@ -53,14 +53,14 @@1.4 static struct breakpoint_struct arm_breakpoints[MAX_BREAKPOINTS];1.5 static int arm_breakpoint_count = 0;1.7 -void arm_set_breakpoint( uint32_t pc, int type )1.8 +void arm_set_breakpoint( uint32_t pc, breakpoint_type_t type )1.9 {1.10 arm_breakpoints[arm_breakpoint_count].address = pc;1.11 arm_breakpoints[arm_breakpoint_count].type = type;1.12 arm_breakpoint_count++;1.13 }1.15 -gboolean arm_clear_breakpoint( uint32_t pc, int type )1.16 +gboolean arm_clear_breakpoint( uint32_t pc, breakpoint_type_t type )1.17 {1.18 int i;
2.1 --- a/src/aica/armcore.h Tue Jan 01 08:57:03 2008 +00002.2 +++ b/src/aica/armcore.h Tue Jan 01 08:57:33 2008 +00002.3 @@ -19,7 +19,8 @@2.4 #ifndef dream_armcore_H2.5 #define dream_armcore_H 12.7 -#include "dream.h"2.8 +#include "lxdream.h"2.9 +#include "mem.h"2.10 #include <stdint.h>2.11 #include <stdio.h>2.13 @@ -88,8 +89,8 @@2.14 void arm_save_state( FILE *f );2.15 int arm_load_state( FILE *f );2.16 gboolean arm_execute_instruction( void );2.17 -void arm_set_breakpoint( uint32_t pc, int type );2.18 -gboolean arm_clear_breakpoint( uint32_t pc, int type );2.19 +void arm_set_breakpoint( uint32_t pc, breakpoint_type_t type );2.20 +gboolean arm_clear_breakpoint( uint32_t pc, breakpoint_type_t type );2.21 int arm_get_breakpoint( uint32_t pc );2.23 /* ARM Memory */
3.1 --- a/src/cpu.h Tue Jan 01 08:57:03 2008 +00003.2 +++ b/src/cpu.h Tue Jan 01 08:57:33 2008 +00003.3 @@ -19,9 +19,8 @@3.4 #ifndef dream_cpu_H3.5 #define dream_cpu_H 13.7 -#include <stdint.h>3.8 -#include <stdlib.h>3.9 -#include <glib/gtypes.h>3.10 +#include "lxdream.h"3.11 +#include "mem.h"3.13 #ifdef __cplusplus3.14 extern "C" {3.15 @@ -58,8 +57,8 @@3.16 disasm_func_t disasm_func; /* Disassembly function */3.17 gboolean (*step_func)(); /* Single step function */3.18 int (*is_valid_page_func)(uint32_t); /* Test for valid memory page */3.19 - void (*set_breakpoint)(uint32_t, int);3.20 - gboolean (*clear_breakpoint)(uint32_t, int);3.21 + void (*set_breakpoint)(uint32_t, breakpoint_type_t);3.22 + gboolean (*clear_breakpoint)(uint32_t, breakpoint_type_t);3.23 int (*get_breakpoint)(uint32_t);3.24 size_t instr_size; /* Size of instruction */3.25 char *regs; /* Pointer to start of registers */
4.1 --- a/src/mem.h Tue Jan 01 08:57:03 2008 +00004.2 +++ b/src/mem.h Tue Jan 01 08:57:33 2008 +00004.3 @@ -71,25 +71,23 @@4.5 #define ENABLE_DEBUG_MODE 14.7 +typedef enum { BREAK_NONE=0, BREAK_ONESHOT=1, BREAK_KEEP=2 } breakpoint_type_t;4.8 +4.9 struct breakpoint_struct {4.10 uint32_t address;4.11 - int type;4.12 + breakpoint_type_t type;4.13 };4.15 #define MAX_BREAKPOINTS 324.16 -#define BREAK_NONE 04.17 -#define BREAK_ONESHOT 14.18 -#define BREAK_KEEP 24.20 -#undef ENABLE_WATCH4.21 +4.22 +#define MEM_FLAG_ROM 4 /* Mem region is ROM-based */4.23 +#define MEM_FLAG_RAM 64.25 #define WATCH_WRITE 14.26 #define WATCH_READ 24.27 #define WATCH_EXEC 3 /* AKA Breakpoint :) */4.29 -#define MEM_FLAG_ROM 4 /* Mem region is ROM-based */4.30 -#define MEM_FLAG_RAM 64.31 -4.32 typedef struct watch_point *watch_point_t;4.34 watch_point_t mem_new_watch( uint32_t start, uint32_t end, int flags );
5.1 --- a/src/sh4/sh4.c Tue Jan 01 08:57:03 2008 +00005.2 +++ b/src/sh4/sh4.c Tue Jan 01 08:57:33 2008 +00005.3 @@ -51,6 +51,16 @@5.4 extern sh4ptr_t sh4_main_ram;5.5 static gboolean sh4_use_translator = FALSE;5.7 +struct sh4_icache_info {5.8 + char *page;5.9 + uint32_t page_start;5.10 + uint32_t page_size;5.11 +};5.12 +5.13 +extern struct sh4_icache_info sh4_icache;5.14 +5.15 +// struct sh4_icache_info sh4_icache = { NULL, -1, -1 };5.16 +5.17 void sh4_set_use_xlat( gboolean use )5.18 {5.19 // No-op if the translator was not built5.20 @@ -144,14 +154,14 @@5.21 }5.24 -void sh4_set_breakpoint( uint32_t pc, int type )5.25 +void sh4_set_breakpoint( uint32_t pc, breakpoint_type_t type )5.26 {5.27 sh4_breakpoints[sh4_breakpoint_count].address = pc;5.28 sh4_breakpoints[sh4_breakpoint_count].type = type;5.29 sh4_breakpoint_count++;5.30 }5.32 -gboolean sh4_clear_breakpoint( uint32_t pc, int type )5.33 +gboolean sh4_clear_breakpoint( uint32_t pc, breakpoint_type_t type )5.34 {5.35 int i;
6.1 --- a/src/sh4/sh4.h Tue Jan 01 08:57:03 2008 +00006.2 +++ b/src/sh4/sh4.h Tue Jan 01 08:57:33 2008 +00006.3 @@ -21,6 +21,7 @@6.4 #define lxdream_sh4_H 16.6 #include "lxdream.h"6.7 +#include "mem.h"6.9 #ifdef __cplusplus6.10 extern "C" {6.11 @@ -108,17 +109,10 @@6.12 gboolean sh4_execute_instruction( void );6.14 /* SH4 breakpoints */6.15 -6.16 -#define BREAK_ONESHOT 16.17 -#define BREAK_PERM 26.18 -6.19 -void sh4_set_breakpoint( uint32_t pc, int type );6.20 -gboolean sh4_clear_breakpoint( uint32_t pc, int type );6.21 +void sh4_set_breakpoint( uint32_t pc, breakpoint_type_t type );6.22 +gboolean sh4_clear_breakpoint( uint32_t pc, breakpoint_type_t type );6.23 int sh4_get_breakpoint( uint32_t pc );6.25 -6.26 -6.27 -6.28 #ifdef __cplusplus6.29 }6.30 #endif
.