armv7m: Use cpu_arm_init() to obtain ARMCPU
Needed for armv7m_reset(). Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
		
							parent
							
								
									5f4ef08b20
								
							
						
					
					
						commit
						0f37c99b27
					
				| @ -160,6 +160,7 @@ qemu_irq *armv7m_init(MemoryRegion *address_space_mem, | |||||||
|                       int flash_size, int sram_size, |                       int flash_size, int sram_size, | ||||||
|                       const char *kernel_filename, const char *cpu_model) |                       const char *kernel_filename, const char *cpu_model) | ||||||
| { | { | ||||||
|  |     ARMCPU *cpu; | ||||||
|     CPUARMState *env; |     CPUARMState *env; | ||||||
|     DeviceState *nvic; |     DeviceState *nvic; | ||||||
|     /* FIXME: make this local state.  */ |     /* FIXME: make this local state.  */ | ||||||
| @ -177,13 +178,15 @@ qemu_irq *armv7m_init(MemoryRegion *address_space_mem, | |||||||
|     flash_size *= 1024; |     flash_size *= 1024; | ||||||
|     sram_size *= 1024; |     sram_size *= 1024; | ||||||
| 
 | 
 | ||||||
|     if (!cpu_model) |     if (cpu_model == NULL) { | ||||||
| 	cpu_model = "cortex-m3"; | 	cpu_model = "cortex-m3"; | ||||||
|     env = cpu_init(cpu_model); |     } | ||||||
|     if (!env) { |     cpu = cpu_arm_init(cpu_model); | ||||||
|  |     if (cpu == NULL) { | ||||||
|         fprintf(stderr, "Unable to find CPU definition\n"); |         fprintf(stderr, "Unable to find CPU definition\n"); | ||||||
|         exit(1); |         exit(1); | ||||||
|     } |     } | ||||||
|  |     env = &cpu->env; | ||||||
| 
 | 
 | ||||||
| #if 0 | #if 0 | ||||||
|     /* > 32Mb SRAM gets complicated because it overlaps the bitband area.
 |     /* > 32Mb SRAM gets complicated because it overlaps the bitband area.
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Andreas Färber
						Andreas Färber