Skip to contentSkip to conversation

sh4: system emulator - interrupt controller

Qemu-devel Magnus Damm 1 participant 1 message Oct 3, 2007 Kbuild

lore
Share & tools
lore
#0 lore raw

Hi everyone,

Attached is a patch that implements a table driver interrupt controller for the sh architecture. The tables that describes the registers and interrupt sources are very similar to the linux kernel code that I rewrote recently. Included are tables for sh775x but it should be fairly easy to add tables for other cpu models in the future if needed.

Only registers are hooked up to the cpu for now. No interrupts are delivered to the processor yet, but the association between register bit fields and interrupt sources works well.

People that want to play with this can uncomment DEBUG_INTC in sh_intc.c to get printouts when the kernel enables various interrupt sources during boot. I'm going to continue working on this to hook up the processor, timers and serial ports as well. This is at least a good first step to share with the community. Please apply.

/ magnus

Makefile.target +1 -1
@@ -484,7 +484,7 @@ CPPFLAGS += -DHAS_AUDIO
 endif
 ifeq ($(TARGET_BASE_ARCH), sh4)
 VL_OBJS+= shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
-VL_OBJS+= sh_timer.o ptimer.o sh_serial.o
+VL_OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o
 endif
 ifeq ($(TARGET_BASE_ARCH), m68k)
 VL_OBJS+= an5206.o mcf5206.o ptimer.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
hw/sh7750.c +178 -45

289 lines not on this page · raw message

hw/sh7750_regnames.c +0 -3
@@ -76,9 +76,6 @@ static regname_t regnames[] = {
 	REGNAME(SH7750_PDTRB_A7)
 	REGNAME(SH7750_GPIOIC_A7)
 	REGNAME(SH7750_ICR_A7)
-	REGNAME(SH7750_IPRA_A7)
-	REGNAME(SH7750_IPRB_A7)
-	REGNAME(SH7750_IPRC_A7)
 	REGNAME(SH7750_BCR3_A7)
 	REGNAME(SH7750_BCR4_A7)
 	REGNAME(SH7750_PRECHARGE0_A7)
hw/sh7750_regs.h +0 -42

48 lines not on this page · raw message

hw/sh_intc.c new file +383 -0

383 lines not on this page · raw message

hw/sh_intc.h new file +69 -0

69 lines not on this page · raw message