roms: allow roms to be loaded at address 0
It was possible to load roms at address 0, but commit 632cf034b401cdd01dae253a8b577fe518e37654 started to forbid that, which broke at least ARM versatile. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
		
							parent
							
								
									66393fb9dd
								
							
						
					
					
						commit
						f9e69bd9cf
					
				@ -636,8 +636,6 @@ static void rom_reset(void *unused)
 | 
				
			|||||||
    Rom *rom;
 | 
					    Rom *rom;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    QTAILQ_FOREACH(rom, &roms, next) {
 | 
					    QTAILQ_FOREACH(rom, &roms, next) {
 | 
				
			||||||
        if (rom->addr == 0)
 | 
					 | 
				
			||||||
            continue;
 | 
					 | 
				
			||||||
        if (rom->data == NULL)
 | 
					        if (rom->data == NULL)
 | 
				
			||||||
            continue;
 | 
					            continue;
 | 
				
			||||||
        cpu_physical_memory_write_rom(rom->addr, rom->data, rom->romsize);
 | 
					        cpu_physical_memory_write_rom(rom->addr, rom->data, rom->romsize);
 | 
				
			||||||
@ -656,8 +654,6 @@ int rom_load_all(void)
 | 
				
			|||||||
    Rom *rom;
 | 
					    Rom *rom;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    QTAILQ_FOREACH(rom, &roms, next) {
 | 
					    QTAILQ_FOREACH(rom, &roms, next) {
 | 
				
			||||||
        if (rom->addr == 0)
 | 
					 | 
				
			||||||
            continue;
 | 
					 | 
				
			||||||
        if (addr > rom->addr) {
 | 
					        if (addr > rom->addr) {
 | 
				
			||||||
            fprintf(stderr, "rom: requested regions overlap "
 | 
					            fprintf(stderr, "rom: requested regions overlap "
 | 
				
			||||||
                    "(rom %s. free=0x" TARGET_FMT_plx
 | 
					                    "(rom %s. free=0x" TARGET_FMT_plx
 | 
				
			||||||
@ -693,8 +689,6 @@ static Rom *find_rom(target_phys_addr_t addr)
 | 
				
			|||||||
    Rom *rom;
 | 
					    Rom *rom;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    QTAILQ_FOREACH(rom, &roms, next) {
 | 
					    QTAILQ_FOREACH(rom, &roms, next) {
 | 
				
			||||||
        if (rom->addr == 0)
 | 
					 | 
				
			||||||
            continue;
 | 
					 | 
				
			||||||
        if (rom->addr > addr)
 | 
					        if (rom->addr > addr)
 | 
				
			||||||
            continue;
 | 
					            continue;
 | 
				
			||||||
        if (rom->addr + rom->romsize < addr)
 | 
					        if (rom->addr + rom->romsize < addr)
 | 
				
			||||||
@ -712,8 +706,6 @@ int rom_copy(uint8_t *dest, target_phys_addr_t addr, size_t size)
 | 
				
			|||||||
    Rom *rom;
 | 
					    Rom *rom;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    QTAILQ_FOREACH(rom, &roms, next) {
 | 
					    QTAILQ_FOREACH(rom, &roms, next) {
 | 
				
			||||||
        if (rom->addr == 0)
 | 
					 | 
				
			||||||
            continue;
 | 
					 | 
				
			||||||
        if (rom->addr > addr)
 | 
					        if (rom->addr > addr)
 | 
				
			||||||
            continue;
 | 
					            continue;
 | 
				
			||||||
        if (rom->addr + rom->romsize < addr)
 | 
					        if (rom->addr + rom->romsize < addr)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user