Changeset 2a103b5 in mainline for kernel/arch/amd64/src/amd64.c


Ignore:
Timestamp:
2019-06-09T11:31:38Z (5 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c48de91
Parents:
b401b33
Message:

Introduce PIC operations indirection mechanism

Some architectures switch from one interrupt controller implementation
to another during runtime. By providing a cleaner indirection mechanism,
it is possible e.g. for the ia32 IRQ 7 handler to distinguish i8259
spurious interrupts from actual IRQ 7 device interrupts, even when the
i8259 interrupt controller is no longer active.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/amd64.c

    rb401b33 r2a103b5  
    6060#include <arch/vreg.h>
    6161#include <arch/kseg.h>
     62#include <genarch/pic/pic_ops.h>
    6263
    6364#ifdef CONFIG_SMP
     
    123124                    (i8259_t *) I8259_PIC1_BASE, IVT_IRQBASE);
    124125
    125                 /*
    126                  * Set the enable/disable IRQs handlers.
    127                  * Set the End-of-Interrupt handler.
    128                  */
    129                 enable_irqs_function = pic_enable_irqs;
    130                 disable_irqs_function = pic_disable_irqs;
    131                 eoi_function = pic_eoi;
    132                 irqs_info = "i8259";
     126                /* Set PIC operations. */
     127                pic_ops = &i8259_pic_ops;
    133128        }
    134129}
     
    209204                        indev_t *kbrd = kbrd_wire(kbrd_instance, sink);
    210205                        i8042_wire(i8042_instance, kbrd);
    211                         trap_virtual_enable_irqs(1 << IRQ_KBD);
    212                         trap_virtual_enable_irqs(1 << IRQ_MOUSE);
     206                        pic_ops->enable_irqs(1 << IRQ_KBD);
     207                        pic_ops->enable_irqs(1 << IRQ_MOUSE);
    213208                }
    214209        }
     
    235230                        indev_t *srln = srln_wire(srln_instance, sink);
    236231                        ns16550_wire(ns16550_instance, srln);
    237                         trap_virtual_enable_irqs(1 << IRQ_NS16550);
     232                        pic_ops->enable_irqs(1 << IRQ_NS16550);
    238233                }
    239234#endif
     
    246241#endif
    247242
    248         if (irqs_info != NULL)
    249                 sysinfo_set_item_val(irqs_info, NULL, true);
     243        sysinfo_set_item_val(pic_ops->get_name(), NULL, true);
    250244}
    251245
Note: See TracChangeset for help on using the changeset viewer.