Search
lxdream.org :: lxdream/src/aica/armcore.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/aica/armcore.h
changeset 37:1d84f4c18816
prev35:21a4be098304
next43:0cf3e339cc59
author nkeynes
date Mon Dec 26 06:38:51 2005 +0000 (14 years ago)
permissions -rw-r--r--
last change More ARM work-in-progress - idle loop works now :)
file annotate diff log raw
1.1 --- a/src/aica/armcore.h Mon Dec 26 03:54:55 2005 +0000
1.2 +++ b/src/aica/armcore.h Mon Dec 26 06:38:51 2005 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: armcore.h,v 1.7 2005-12-26 03:54:55 nkeynes Exp $
1.6 + * $Id: armcore.h,v 1.8 2005-12-26 06:38:51 nkeynes Exp $
1.7 *
1.8 * Interface definitions for the ARM CPU emulation core proper.
1.9 *
1.10 @@ -61,6 +61,7 @@
1.11 #define CPSR_F 0x00000040 /* Fast interrupt disable bit */
1.12 #define CPSR_T 0x00000020 /* Thumb mode */
1.13 #define CPSR_MODE 0x0000001F /* Current execution mode */
1.14 +#define CPSR_COMPACT_MASK 0x0FFFFFDF /* Mask excluding all separated flags */
1.15
1.16 #define MODE_USER 0x10 /* User mode */
1.17 #define MODE_FIQ 0x11 /* Fast IRQ mode */
1.18 @@ -70,6 +71,9 @@
1.19 #define MODE_UND 0x1B /* Undefined mode */
1.20 #define MODE_SYS 0x1F /* System mode */
1.21
1.22 +#define IS_PRIVILEGED_MODE() ((armr.cpsr & CPSR_MODE) != MODE_USER)
1.23 +#define IS_EXCEPTION_MODE() (IS_PRIVILEGED_MODE() && (armr.cpsr & CPSR_MODE) != MODE_SYS)
1.24 +
1.25 extern struct arm_registers armr;
1.26
1.27 #define CARRY_FLAG (armr.cpsr&CPSR_C)
1.28 @@ -82,12 +86,16 @@
1.29 gboolean arm_execute_instruction( void );
1.30
1.31 /* ARM Memory */
1.32 -int32_t arm_read_long( uint32_t addr );
1.33 -int32_t arm_read_word( uint32_t addr );
1.34 -int32_t arm_read_byte( uint32_t addr );
1.35 +uint32_t arm_read_long( uint32_t addr );
1.36 +uint32_t arm_read_word( uint32_t addr );
1.37 +uint32_t arm_read_byte( uint32_t addr );
1.38 +uint32_t arm_read_long_user( uint32_t addr );
1.39 +uint32_t arm_read_byte_user( uint32_t addr );
1.40 void arm_write_long( uint32_t addr, uint32_t val );
1.41 void arm_write_word( uint32_t addr, uint32_t val );
1.42 void arm_write_byte( uint32_t addr, uint32_t val );
1.43 +void arm_write_long_user( uint32_t addr, uint32_t val );
1.44 +void arm_write_byte_user( uint32_t addr, uint32_t val );
1.45 int32_t arm_read_phys_word( uint32_t addr );
1.46 int arm_has_page( uint32_t addr );
1.47
.