Subversion Repositories HelenOS

Rev

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

Rev 2089 Rev 2101
Line 122... Line 122...
122
 
122
 
123
/** Initialize APIC on BSP. */
123
/** Initialize APIC on BSP. */
124
void apic_init(void)
124
void apic_init(void)
125
{
125
{
126
    io_apic_id_t idreg;
126
    io_apic_id_t idreg;
127
    int i;
127
    unsigned int i;
128
 
128
 
129
    exc_register(VECTOR_APIC_SPUR, "apic_spurious", (iroutine) apic_spurious);
129
    exc_register(VECTOR_APIC_SPUR, "apic_spurious", (iroutine) apic_spurious);
130
 
130
 
131
    enable_irqs_function = io_apic_enable_irqs;
131
    enable_irqs_function = io_apic_enable_irqs;
132
    disable_irqs_function = io_apic_disable_irqs;
132
    disable_irqs_function = io_apic_disable_irqs;
Line 526... Line 526...
526
 * @param irqmask Bitmask of IRQs to be masked (0 = do not mask, 1 = mask).
526
 * @param irqmask Bitmask of IRQs to be masked (0 = do not mask, 1 = mask).
527
 */
527
 */
528
void io_apic_disable_irqs(uint16_t irqmask)
528
void io_apic_disable_irqs(uint16_t irqmask)
529
{
529
{
530
    io_redirection_reg_t reg;
530
    io_redirection_reg_t reg;
-
 
531
    unsigned int i;
531
    int i, pin;
532
    int pin;
532
   
533
   
533
    for (i=0;i<16;i++) {
534
    for (i = 0; i < 16; i++) {
534
        if (irqmask & (1<<i)) {
535
        if (irqmask & (1 << i)) {
535
            /*
536
            /*
536
             * Mask the signal input in IO APIC if there is a
537
             * Mask the signal input in IO APIC if there is a
537
             * mapping for the respective IRQ number.
538
             * mapping for the respective IRQ number.
538
             */
539
             */
539
            pin = smp_irq_to_pin(i);
540
            pin = smp_irq_to_pin(i);
Line 551... Line 552...
551
 *
552
 *
552
 * @param irqmask Bitmask of IRQs to be unmasked (0 = do not unmask, 1 = unmask).
553
 * @param irqmask Bitmask of IRQs to be unmasked (0 = do not unmask, 1 = unmask).
553
 */
554
 */
554
void io_apic_enable_irqs(uint16_t irqmask)
555
void io_apic_enable_irqs(uint16_t irqmask)
555
{
556
{
-
 
557
    unsigned int i;
556
    int i, pin;
558
    int pin;
557
    io_redirection_reg_t reg;  
559
    io_redirection_reg_t reg;  
558
   
560
   
559
    for (i=0;i<16;i++) {
561
    for (i = 0; i < 16; i++) {
560
        if (irqmask & (1<<i)) {
562
        if (irqmask & (1 << i)) {
561
            /*
563
            /*
562
             * Unmask the signal input in IO APIC if there is a
564
             * Unmask the signal input in IO APIC if there is a
563
             * mapping for the respective IRQ number.
565
             * mapping for the respective IRQ number.
564
             */
566
             */
565
            pin = smp_irq_to_pin(i);
567
            pin = smp_irq_to_pin(i);