mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-23 19:49:43 +00:00
Initialize physical memory space to IO_MEM_UNASSIGNED.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1801 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
706cd4b547
commit
e3f4e2a4b0
15
exec.c
15
exec.c
@ -204,6 +204,7 @@ static inline PageDesc *page_find(unsigned int index)
|
|||||||
static PhysPageDesc *phys_page_find_alloc(target_phys_addr_t index, int alloc)
|
static PhysPageDesc *phys_page_find_alloc(target_phys_addr_t index, int alloc)
|
||||||
{
|
{
|
||||||
void **lp, **p;
|
void **lp, **p;
|
||||||
|
PhysPageDesc *pd;
|
||||||
|
|
||||||
p = (void **)l1_phys_map;
|
p = (void **)l1_phys_map;
|
||||||
#if TARGET_PHYS_ADDR_SPACE_BITS > 32
|
#if TARGET_PHYS_ADDR_SPACE_BITS > 32
|
||||||
@ -223,16 +224,18 @@ static PhysPageDesc *phys_page_find_alloc(target_phys_addr_t index, int alloc)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
lp = p + ((index >> L2_BITS) & (L1_SIZE - 1));
|
lp = p + ((index >> L2_BITS) & (L1_SIZE - 1));
|
||||||
p = *lp;
|
pd = *lp;
|
||||||
if (!p) {
|
if (!pd) {
|
||||||
|
int i;
|
||||||
/* allocate if not found */
|
/* allocate if not found */
|
||||||
if (!alloc)
|
if (!alloc)
|
||||||
return NULL;
|
return NULL;
|
||||||
p = qemu_vmalloc(sizeof(PhysPageDesc) * L2_SIZE);
|
pd = qemu_vmalloc(sizeof(PhysPageDesc) * L2_SIZE);
|
||||||
memset(p, 0, sizeof(PhysPageDesc) * L2_SIZE);
|
*lp = pd;
|
||||||
*lp = p;
|
for (i = 0; i < L2_SIZE; i++)
|
||||||
|
pd[i].phys_offset = IO_MEM_UNASSIGNED;
|
||||||
}
|
}
|
||||||
return ((PhysPageDesc *)p) + (index & (L2_SIZE - 1));
|
return ((PhysPageDesc *)pd) + (index & (L2_SIZE - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline PhysPageDesc *phys_page_find(target_phys_addr_t index)
|
static inline PhysPageDesc *phys_page_find(target_phys_addr_t index)
|
||||||
|
Loading…
Reference in New Issue
Block a user