 b8fc619550
			
		
	
	
		b8fc619550
		
	
	
	
	
		
			
			Avoid the interrupt controller directly access the 'first_cpu' global. Pass 'cpu' from the board code. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Thomas Huth <huth@tuxfamily.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20231024083010.12453-2-philmd@linaro.org> Signed-off-by: Thomas Huth <huth@tuxfamily.org>
		
			
				
	
	
		
			43 lines
		
	
	
		
			850 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			850 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /*
 | |
|  * SPDX-License-Identifier: GPL-2.0-or-later
 | |
|  *
 | |
|  * QEMU Motorola 680x0 IRQ Controller
 | |
|  *
 | |
|  * (c) 2020 Laurent Vivier <laurent@vivier.eu>
 | |
|  *
 | |
|  */
 | |
| 
 | |
| #ifndef M68K_IRQC_H
 | |
| #define M68K_IRQC_H
 | |
| 
 | |
| #include "hw/sysbus.h"
 | |
| 
 | |
| #define TYPE_M68K_IRQC "m68k-irq-controller"
 | |
| #define M68K_IRQC(obj) OBJECT_CHECK(M68KIRQCState, (obj), \
 | |
|                                     TYPE_M68K_IRQC)
 | |
| 
 | |
| #define M68K_IRQC_AUTOVECTOR_BASE 25
 | |
| 
 | |
| enum {
 | |
|     M68K_IRQC_LEVEL_1 = 0,
 | |
|     M68K_IRQC_LEVEL_2,
 | |
|     M68K_IRQC_LEVEL_3,
 | |
|     M68K_IRQC_LEVEL_4,
 | |
|     M68K_IRQC_LEVEL_5,
 | |
|     M68K_IRQC_LEVEL_6,
 | |
|     M68K_IRQC_LEVEL_7,
 | |
| };
 | |
| #define M68K_IRQC_LEVEL_NUM (M68K_IRQC_LEVEL_7 - M68K_IRQC_LEVEL_1 + 1)
 | |
| 
 | |
| typedef struct M68KIRQCState {
 | |
|     SysBusDevice parent_obj;
 | |
| 
 | |
|     uint8_t ipr;
 | |
|     ArchCPU *cpu;
 | |
| 
 | |
|     /* statistics */
 | |
|     uint64_t stats_irq_count[M68K_IRQC_LEVEL_NUM];
 | |
| } M68KIRQCState;
 | |
| 
 | |
| #endif
 |