Commit graph

3 commits

Author SHA1 Message Date
Jesus Sanchez-Palencia afd9b5b0b7 x86: Add APIs to 8259 PIC driver
This commit implements pic_eoi(int irq) and a helper macro PIC_INT(irq).
This first checks which PICs should be 'acked' given an IRQ number, while
the macro returns the actual system interrupt number for the IRQ according
to the offset used on the PIC initialization.
2015-12-21 08:06:14 -02:00
Andre Guedes 826ff7cb29 x86: Add pic_unmask_irq() helper
This patch implements the pic_unmask_irq() helper and uses it where
applicable. This function zeros the corresponding bit from the IRQ
number in IMR register.

This patch doesn't implement the pic_mask_irq() helper since it is not
useful at this moment.
2015-12-21 08:06:14 -02:00
Andre Guedes 5f47bafc6a x86: Add Real-Time Clock Driver
This patch adds a driver for Real-Time Clock (RTC). The RTC timer is
suitable to implement some operating system features such as the
system clock. Actually, the RTC will be used to implement the system
clock in galileo platform.

The driver introduced by this patch programs the RTC to generate
interrupt periodically. The interrupt frequency can be configured by the
user. On each RTC interrupt, a callback configured by the user is called.
As expected, that callback is executed in interrupt context so the user
should be aware of what it is not supposed to do (e.g. to call blocking
functions).

This patch also adds the inb() helper function to helpers.h. The helpers
is a wrapper for assembly 'in' instruction.
2015-12-21 08:06:14 -02:00