summaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2007-05-30 17:25:06 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2007-05-30 17:25:06 +0000
commit49e9fba27138adb4ca52385f6ecc63b0ff0d3546 (patch)
tree9cd983e2e39309ca2c3f08709be0484821f2e90e /exec.c
parent78749ba859684748366b5de630ad41bd1b2d60a2 (diff)
downloadqemu-49e9fba27138adb4ca52385f6ecc63b0ff0d3546.zip
Fix the bug introduced by subpage code preventing PC boot
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2898 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/exec.c b/exec.c
index 321d8a566f..61d8f61ab5 100644
--- a/exec.c
+++ b/exec.c
@@ -1922,7 +1922,7 @@ static void *subpage_init (target_phys_addr_t base, uint32_t *phys,
need_subpage = 1; \
} \
\
- if (end_addr - addr > TARGET_PAGE_SIZE) \
+ if ((start_addr + orig_size) - addr >= TARGET_PAGE_SIZE) \
end_addr2 = TARGET_PAGE_SIZE - 1; \
else { \
end_addr2 = (start_addr + orig_size - 1) & ~TARGET_PAGE_MASK; \
@@ -1944,9 +1944,9 @@ void cpu_register_physical_memory(target_phys_addr_t start_addr,
unsigned long orig_size = size;
void *subpage;
- end_addr = start_addr + (target_phys_addr_t)size;
size = (size + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK;
- for(addr = start_addr; addr < end_addr; addr += TARGET_PAGE_SIZE) {
+ end_addr = start_addr + (target_phys_addr_t)size;
+ for(addr = start_addr; addr != end_addr; addr += TARGET_PAGE_SIZE) {
p = phys_page_find(addr >> TARGET_PAGE_BITS);
if (p && p->phys_offset != IO_MEM_UNASSIGNED) {
unsigned long orig_memory = p->phys_offset;