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 733 #define CPU_INTERRUPT_HARD 0x02 /* hardware interrupt pending */
734 734 #define CPU_INTERRUPT_EXITTB 0x04 /* exit the current TB (use for x86 a20 case) */
735 735 #define CPU_INTERRUPT_TIMER 0x08 /* internal timer exception pending */
  736 +#define CPU_INTERRUPT_FIQ 0x10 /* Fast interrupt pending. */
  737 +
736 738 void cpu_interrupt(CPUState *s, int mask);
737 739 void cpu_reset_interrupt(CPUState *env, int mask);
738 740  
... ... @@ -790,9 +792,9 @@ extern uint8_t *phys_ram_base;
790 792 extern uint8_t *phys_ram_dirty;
791 793  
792 794 /* physical memory access */
793   -#define IO_MEM_NB_ENTRIES 256
794 795 #define TLB_INVALID_MASK (1 << 3)
795 796 #define IO_MEM_SHIFT 4
  797 +#define IO_MEM_NB_ENTRIES (1 << (TARGET_PAGE_BITS - IO_MEM_SHIFT))
796 798  
797 799 #define IO_MEM_RAM (0 << IO_MEM_SHIFT) /* hardcoded offset */
798 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 91 if ((addr & (DATA_SIZE - 1)) != 0)
92 92 goto do_unaligned_access;
93 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 95 /* slow unaligned access (it spans two pages or IO) */
96 96 do_unaligned_access:
97 97 retaddr = GETPC();
... ... @@ -130,7 +130,7 @@ static DATA_TYPE glue(glue(slow_ld, SUFFIX), MMUSUFFIX)(target_ulong addr,
130 130 if ((addr & (DATA_SIZE - 1)) != 0)
131 131 goto do_unaligned_access;
132 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 134 do_unaligned_access:
135 135 /* slow unaligned access (it spans two pages) */
136 136 addr1 = addr & ~(DATA_SIZE - 1);
... ... @@ -208,7 +208,7 @@ void REGPARM(2) glue(glue(__st, SUFFIX), MMUSUFFIX)(target_ulong addr,
208 208 goto do_unaligned_access;
209 209 retaddr = GETPC();
210 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 212 do_unaligned_access:
213 213 retaddr = GETPC();
214 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 245 if ((addr & (DATA_SIZE - 1)) != 0)
246 246 goto do_unaligned_access;
247 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 249 do_unaligned_access:
250 250 /* XXX: not efficient, but simple */
251 251 for(i = 0;i < DATA_SIZE; i++) {
... ...