X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2F8259a.c;h=6fe165e131f8fa98f963c212daae0b4eccfcc8ce;hb=7192677f55dd5594438a8a8846aa2d70f76d2c76;hp=470d87888a2f7040e789b5152d153852ab7df889;hpb=4b93282ac2e60cd4d74b1e0be8ac758933140413;p=palacios.releases.git diff --git a/palacios/src/devices/8259a.c b/palacios/src/devices/8259a.c index 470d878..6fe165e 100644 --- a/palacios/src/devices/8259a.c +++ b/palacios/src/devices/8259a.c @@ -1,3 +1,6 @@ +/* (c) 2008, Jack Lange */ +/* (c) 2008, The V3VEE Project */ + #include #include #include @@ -8,12 +11,6 @@ #define PrintDebug(fmt, args...) #endif -#ifdef DEBUG_RAMDISK -#define Ramdisk_Print_Pic(_f, _a...) PrintTrace("\n8259a.c(%d) "_f, __LINE__, ## _a) -#else -#define Ramdisk_Print_Pic(_f, _a...) -#endif - typedef enum {RESET, ICW1, ICW2, ICW3, ICW4, READY} pic_state_t; @@ -195,18 +192,18 @@ static int pic_lower_intr(void *private_data, int irq_no) { struct pic_internal *state = (struct pic_internal*)private_data; - Ramdisk_Print_Pic("[pic_lower_intr] IRQ line %d now low\n", (unsigned) irq_no); + PrintDebug("[pic_lower_intr] IRQ line %d now low\n", (unsigned) irq_no); if (irq_no <= 7) { state->master_irr &= ~(1 << irq_no); if ((state->master_irr & ~(state->master_imr)) == 0) { - Ramdisk_Print_Pic("\t\tFIXME: Master maybe should do sth\n"); + PrintDebug("\t\tFIXME: Master maybe should do sth\n"); } } else if ((irq_no > 7) && (irq_no <= 15)) { state->slave_irr &= ~(1 << (irq_no - 8)); if ((state->slave_irr & (~(state->slave_imr))) == 0) { - Ramdisk_Print_Pic("\t\tFIXME: Slave maybe should do sth\n"); + PrintDebug("\t\tFIXME: Slave maybe should do sth\n"); } } return 0; @@ -226,9 +223,9 @@ static int pic_intr_pending(void * private_data) { } static int pic_get_intr_number(void * private_data) { - struct pic_internal * state = (struct pic_internal*)private_data; - int i=0; - int irq=-1; + struct pic_internal * state = (struct pic_internal *)private_data; + int i = 0; + int irq = -1; PrintDebug("8259 PIC: getnum: master_irr: 0x%x master_imr: 0x%x\n", i, state->master_irr, state->master_imr); PrintDebug("8259 PIC: getnum: slave_irr: 0x%x slave_imr: 0x%x\n", i, state->slave_irr, state->slave_imr); @@ -254,11 +251,11 @@ static int pic_get_intr_number(void * private_data) { } } - if (i==15 || i==6) { + if ((i == 15) || (i == 6)) { DumpPICState(state); } - if (i==16) { + if (i == 16) { return -1; } else { return irq;