Changes in kernel/arch/ppc32/src/drivers/pic.c [ebbc03c7:c5429fe] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ppc32/src/drivers/pic.c
rebbc03c7 rc5429fe 37 37 #include <byteorder.h> 38 38 #include <bitops.h> 39 #include <typedefs.h>40 39 41 static ioport32_t *pic = NULL;40 static volatile uint32_t *pic = NULL; 42 41 43 42 void pic_init(uintptr_t base, size_t size, cir_t *cir, void **cir_arg) … … 51 50 void pic_enable_interrupt(inr_t intnum) 52 51 { 53 if (!pic) 54 return; 52 if (pic) { 53 if (intnum < 32) 54 pic[PIC_MASK_LOW] = pic[PIC_MASK_LOW] | (1 << intnum); 55 else 56 pic[PIC_MASK_HIGH] = pic[PIC_MASK_HIGH] | (1 << (intnum - 32)); 57 } 55 58 56 if (intnum < 32) {57 pio_write_32(&pic[PIC_MASK_LOW],58 pio_read_32(&pic[PIC_MASK_LOW]) | (1 << intnum));59 } else {60 pio_write_32(&pic[PIC_MASK_HIGH],61 pio_read_32(&pic[PIC_MASK_HIGH]) | (1 << (intnum - 32)));62 }63 59 } 64 60 65 61 void pic_disable_interrupt(inr_t intnum) 66 62 { 67 if (!pic) 68 return; 69 70 if (intnum < 32) { 71 pio_write_32(&pic[PIC_MASK_LOW], 72 pio_read_32(&pic[PIC_MASK_LOW]) & (~(1 << intnum))); 73 } else { 74 pio_write_32(&pic[PIC_MASK_HIGH], 75 pio_read_32(&pic[PIC_MASK_HIGH]) & (~(1 << (intnum - 32)))); 63 if (pic) { 64 if (intnum < 32) 65 pic[PIC_MASK_LOW] = pic[PIC_MASK_LOW] & (~(1 << intnum)); 66 else 67 pic[PIC_MASK_HIGH] = pic[PIC_MASK_HIGH] & (~(1 << (intnum - 32))); 76 68 } 77 69 } … … 79 71 void pic_ack_interrupt(void *arg, inr_t intnum) 80 72 { 81 if (!pic) 82 return; 83 84 if (intnum < 32) { 85 pio_write_32(&pic[PIC_ACK_LOW], 1 << intnum); 86 } else { 87 pio_write_32(&pic[PIC_ACK_HIGH], 1 << (intnum - 32)); 73 if (pic) { 74 if (intnum < 32) 75 pic[PIC_ACK_LOW] = 1 << intnum; 76 else 77 pic[PIC_ACK_HIGH] = 1 << (intnum - 32); 88 78 } 89 79 } … … 97 87 uint32_t pending; 98 88 99 pending = pi o_read_32(&pic[PIC_PENDING_LOW]);89 pending = pic[PIC_PENDING_LOW]; 100 90 if (pending != 0) 101 91 return fnzb32(pending); 102 92 103 pending = pi o_read_32(&pic[PIC_PENDING_HIGH]);93 pending = pic[PIC_PENDING_HIGH]; 104 94 if (pending != 0) 105 95 return fnzb32(pending) + 32;
Note:
See TracChangeset
for help on using the changeset viewer.