Subversion Repositories HelenOS

Rev

Rev 2107 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2107 Rev 2439
Line 93... Line 93...
93
{
93
{
94
    uint8_t x;
94
    uint8_t x;
95
 
95
 
96
    if (irqmask & 0xff) {
96
    if (irqmask & 0xff) {
97
        x = inb(PIC_PIC0PORT2);
97
        x = inb(PIC_PIC0PORT2);
98
        outb(PIC_PIC0PORT2, x & (~(irqmask & 0xff)));
98
        outb(PIC_PIC0PORT2, (uint8_t) (x & (~(irqmask & 0xff))));
99
    }
99
    }
100
    if (irqmask >> 8) {
100
    if (irqmask >> 8) {
101
        x = inb(PIC_PIC1PORT2);
101
        x = inb(PIC_PIC1PORT2);
102
        outb(PIC_PIC1PORT2, x & (~(irqmask >> 8)));
102
        outb(PIC_PIC1PORT2, (uint8_t) (x & (~(irqmask >> 8))));
103
    }
103
    }
104
}
104
}
105
 
105
 
106
void pic_disable_irqs(uint16_t irqmask)
106
void pic_disable_irqs(uint16_t irqmask)
107
{
107
{
108
    uint8_t x;
108
    uint8_t x;
109
 
109
 
110
    if (irqmask & 0xff) {
110
    if (irqmask & 0xff) {
111
        x = inb(PIC_PIC0PORT2);
111
        x = inb(PIC_PIC0PORT2);
112
        outb(PIC_PIC0PORT2, x | (irqmask & 0xff));
112
        outb(PIC_PIC0PORT2, (uint8_t) (x | (irqmask & 0xff)));
113
    }
113
    }
114
    if (irqmask >> 8) {
114
    if (irqmask >> 8) {
115
        x = inb(PIC_PIC1PORT2);
115
        x = inb(PIC_PIC1PORT2);
116
        outb(PIC_PIC1PORT2, x | (irqmask >> 8));
116
        outb(PIC_PIC1PORT2, (uint8_t) (x | (irqmask >> 8)));
117
    }
117
    }
118
}
118
}
119
 
119
 
120
void pic_eoi(void)
120
void pic_eoi(void)
121
{
121
{
122
    outb(0x20, 0x20);
122
    outb(0x20, 0x20);
123
    outb(0xa0, 0x20);
123
    outb(0xa0, 0x20);
124
}
124
}
125
 
125
 
126
void pic_spurious(int n, istate_t *istate)
126
void pic_spurious(int n __attribute__((unused)), istate_t *istate __attribute__((unused)))
127
{
127
{
128
#ifdef CONFIG_DEBUG
128
#ifdef CONFIG_DEBUG
129
    printf("cpu%d: PIC spurious interrupt\n", CPU->id);
129
    printf("cpu%u: PIC spurious interrupt\n", CPU->id);
130
#endif
130
#endif
131
}
131
}
132
 
132
 
133
/** @}
133
/** @}
134
 */
134
 */