Fix the issue of on x86_64, rhel4 can not get into runlevel 5.

Xserver will scan pci and the cirrus VGA driver will register
mmio each time, cause mmio array out of space.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
This commit is contained in:
kaf24@firebug.cl.cam.ac.uk committed 2005-11-25 09:17:34 +01:00
1 parent 9ad74f9849
commit 11d666ab5e
1 file changed
+17 -6
+17 -6
View File
@@ -262,13 +262,24 @@ void cpu_register_physical_memory(target_phys_addr_t start_addr,
unsigned long size,
unsigned long phys_offset)
{
if (mmio_cnt == MAX_MMIO) {
fprintf(logfile, "too many mmio regions\n");
exit(-1);
int i;
for (i = 0; i < mmio_cnt; i++) {
if(mmio[i].start == start_addr) {
mmio[i].io_index = phys_offset;
mmio[i].size = size;
return;
}
mmio[mmio_cnt].io_index = phys_offset;
mmio[mmio_cnt].start = start_addr;
mmio[mmio_cnt++].size = size;
}
if (mmio_cnt == MAX_MMIO) {
fprintf(logfile, "too many mmio regions\n");
exit(-1);
}
mmio[mmio_cnt].io_index = phys_offset;
mmio[mmio_cnt].start = start_addr;
mmio[mmio_cnt++].size = size;
}
/* mem_read and mem_write are arrays of functions containing the
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.