Commit 98699967b8f49bb0537aab882242b2045bdb05fc

Authored by bellard
1 parent daa57963

use TARGET_PAGE_SIZE (Paul Brook)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1659 c046a42c-6fe2-441c-8c8c-71466251a162
cpu-all.h
@@ -733,6 +733,8 @@ extern int code_copy_enabled; @@ -733,6 +733,8 @@ extern int code_copy_enabled;
733 #define CPU_INTERRUPT_HARD 0x02 /* hardware interrupt pending */ 733 #define CPU_INTERRUPT_HARD 0x02 /* hardware interrupt pending */
734 #define CPU_INTERRUPT_EXITTB 0x04 /* exit the current TB (use for x86 a20 case) */ 734 #define CPU_INTERRUPT_EXITTB 0x04 /* exit the current TB (use for x86 a20 case) */
735 #define CPU_INTERRUPT_TIMER 0x08 /* internal timer exception pending */ 735 #define CPU_INTERRUPT_TIMER 0x08 /* internal timer exception pending */
  736 +#define CPU_INTERRUPT_FIQ 0x10 /* Fast interrupt pending. */
  737 +
736 void cpu_interrupt(CPUState *s, int mask); 738 void cpu_interrupt(CPUState *s, int mask);
737 void cpu_reset_interrupt(CPUState *env, int mask); 739 void cpu_reset_interrupt(CPUState *env, int mask);
738 740
@@ -790,9 +792,9 @@ extern uint8_t *phys_ram_base; @@ -790,9 +792,9 @@ extern uint8_t *phys_ram_base;
790 extern uint8_t *phys_ram_dirty; 792 extern uint8_t *phys_ram_dirty;
791 793
792 /* physical memory access */ 794 /* physical memory access */
793 -#define IO_MEM_NB_ENTRIES 256  
794 #define TLB_INVALID_MASK (1 << 3) 795 #define TLB_INVALID_MASK (1 << 3)
795 #define IO_MEM_SHIFT 4 796 #define IO_MEM_SHIFT 4
  797 +#define IO_MEM_NB_ENTRIES (1 << (TARGET_PAGE_BITS - IO_MEM_SHIFT))
796 798
797 #define IO_MEM_RAM (0 << IO_MEM_SHIFT) /* hardcoded offset */ 799 #define IO_MEM_RAM (0 << IO_MEM_SHIFT) /* hardcoded offset */
798 #define IO_MEM_ROM (1 << IO_MEM_SHIFT) /* hardcoded offset */ 800 #define IO_MEM_ROM (1 << IO_MEM_SHIFT) /* hardcoded offset */
softmmu_template.h
@@ -91,7 +91,7 @@ DATA_TYPE REGPARM(1) glue(glue(__ld, SUFFIX), MMUSUFFIX)(target_ulong addr, @@ -91,7 +91,7 @@ DATA_TYPE REGPARM(1) glue(glue(__ld, SUFFIX), MMUSUFFIX)(target_ulong addr,
91 if ((addr & (DATA_SIZE - 1)) != 0) 91 if ((addr & (DATA_SIZE - 1)) != 0)
92 goto do_unaligned_access; 92 goto do_unaligned_access;
93 res = glue(io_read, SUFFIX)(physaddr, tlb_addr); 93 res = glue(io_read, SUFFIX)(physaddr, tlb_addr);
94 - } else if (((addr & 0xfff) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) { 94 + } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) {
95 /* slow unaligned access (it spans two pages or IO) */ 95 /* slow unaligned access (it spans two pages or IO) */
96 do_unaligned_access: 96 do_unaligned_access:
97 retaddr = GETPC(); 97 retaddr = GETPC();
@@ -130,7 +130,7 @@ static DATA_TYPE glue(glue(slow_ld, SUFFIX), MMUSUFFIX)(target_ulong addr, @@ -130,7 +130,7 @@ static DATA_TYPE glue(glue(slow_ld, SUFFIX), MMUSUFFIX)(target_ulong addr,
130 if ((addr & (DATA_SIZE - 1)) != 0) 130 if ((addr & (DATA_SIZE - 1)) != 0)
131 goto do_unaligned_access; 131 goto do_unaligned_access;
132 res = glue(io_read, SUFFIX)(physaddr, tlb_addr); 132 res = glue(io_read, SUFFIX)(physaddr, tlb_addr);
133 - } else if (((addr & 0xfff) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) { 133 + } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) {
134 do_unaligned_access: 134 do_unaligned_access:
135 /* slow unaligned access (it spans two pages) */ 135 /* slow unaligned access (it spans two pages) */
136 addr1 = addr & ~(DATA_SIZE - 1); 136 addr1 = addr & ~(DATA_SIZE - 1);
@@ -208,7 +208,7 @@ void REGPARM(2) glue(glue(__st, SUFFIX), MMUSUFFIX)(target_ulong addr, @@ -208,7 +208,7 @@ void REGPARM(2) glue(glue(__st, SUFFIX), MMUSUFFIX)(target_ulong addr,
208 goto do_unaligned_access; 208 goto do_unaligned_access;
209 retaddr = GETPC(); 209 retaddr = GETPC();
210 glue(io_write, SUFFIX)(physaddr, val, tlb_addr, retaddr); 210 glue(io_write, SUFFIX)(physaddr, val, tlb_addr, retaddr);
211 - } else if (((addr & 0xfff) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) { 211 + } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) {
212 do_unaligned_access: 212 do_unaligned_access:
213 retaddr = GETPC(); 213 retaddr = GETPC();
214 glue(glue(slow_st, SUFFIX), MMUSUFFIX)(addr, val, 214 glue(glue(slow_st, SUFFIX), MMUSUFFIX)(addr, val,
@@ -245,7 +245,7 @@ static void glue(glue(slow_st, SUFFIX), MMUSUFFIX)(target_ulong addr, @@ -245,7 +245,7 @@ static void glue(glue(slow_st, SUFFIX), MMUSUFFIX)(target_ulong addr,
245 if ((addr & (DATA_SIZE - 1)) != 0) 245 if ((addr & (DATA_SIZE - 1)) != 0)
246 goto do_unaligned_access; 246 goto do_unaligned_access;
247 glue(io_write, SUFFIX)(physaddr, val, tlb_addr, retaddr); 247 glue(io_write, SUFFIX)(physaddr, val, tlb_addr, retaddr);
248 - } else if (((addr & 0xfff) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) { 248 + } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) {
249 do_unaligned_access: 249 do_unaligned_access:
250 /* XXX: not efficient, but simple */ 250 /* XXX: not efficient, but simple */
251 for(i = 0;i < DATA_SIZE; i++) { 251 for(i = 0;i < DATA_SIZE; i++) {