diff --git a/Targets/Bonito3aserver/conf/files.Bonito3aserver b/Targets/Bonito3aserver/conf/files.Bonito3aserver index 4a3baef7..0e3c41ef 100644 --- a/Targets/Bonito3aserver/conf/files.Bonito3aserver +++ b/Targets/Bonito3aserver/conf/files.Bonito3aserver @@ -14,6 +14,7 @@ file Targets/Bonito3aserver/pci/sb700_ide.c amd_780e file Targets/Bonito3aserver/pci/sb700_lpc.c amd_780e file Targets/Bonito3aserver/pci/sb700_sata.c amd_780e file Targets/Bonito3aserver/pci/sb700_usb.c amd_780e +file Targets/Bonito3aserver/dev/irq.c timer_irq needs-flag define localbus { [base = -1 ] } device localbus diff --git a/Targets/Bonito3aserver/dev/irq.c b/Targets/Bonito3aserver/dev/irq.c new file mode 100644 index 00000000..180a5e42 --- /dev/null +++ b/Targets/Bonito3aserver/dev/irq.c @@ -0,0 +1,36 @@ +#include +#include +#include +#define ST0_IM 0x0000ff00 +#define CAUSEF_IP7 ( 1 << 15) +#define CAUSEF_IP6 ( 1 << 14) +#define CAUSEF_IP5 ( 1 << 13) +#define CAUSEF_IP4 ( 1 << 12) +#define CAUSEF_IP3 ( 1 << 11) +#define CAUSEF_IP2 ( 1 << 10) +void plat_irq_dispatch(struct trapframe *frame) +{ + unsigned int cause = read_c0_cause() & ST0_IM; + unsigned int status = read_c0_status() & ST0_IM; + unsigned int pending = cause & status; + if(pending & CAUSEF_IP7) + { + static int cnt=0; + printf("cnt %d\n",cnt++); + write_c0_compare(read_c0_count()+100000000/100); + } + else + { + printf("spurious interrupt\n"); + } + +} + + +void init_IRQ() +{ + write_c0_compare(100000000/100); + write_c0_count(0); + set_c0_status(0x8001); +} +