Expand description
Generic support for 32-bit Intel/AMD CPUs.
§Interrupt Handling
Once initialized, this crate assumes ownership of the CPU’s interrupt handling facilities.
Interrupts from external devices are handled by calling an extern function named
_handle_external_interrupt
, which must be defined by the chip or board crate. This function
must have a cdecl
ABI and must accept a single u32
argument which is the number of the
external interrupt.
The _handle_external_interrupt
function should typically perform the following tasks:
- Call
InterruptPoller::set_pending
to mark the given interrupt as pending - Send an EOI signal to any relevant interrupt controllers
Any other logic needed to service the interrupt (for instance, reading from buffers or re-arming
hardware) should typically be performed within the current chip’s service_pending_interrupts
method.
Apart from external interrupts, all other interrupt categories such as CPU exceptions or system calls are handled internally by this crate.
§Safety
Some of the unsafe
code in this crate relies on the blanket assumption that this code is being
compiled into a Tock kernel for an x86 system. When calling code from this crate, the following
statements must always be true:
- The CPU is executing at ring 0
- The CPU has I/O privileges
Modules§
Structs§
- Boundary
- Defines the usermode-kernelmode ABI for x86 platforms.
- Interrupt
Poller - A mechanism for synchronously managing and polling x86 interrupts.
Constants§
- IDT_
RESERVED_ EXCEPTIONS - Number of exceptions reserved in the IDT by Intel. Reference: https://en.wikipedia.org/wiki/Interrupt_descriptor_table#Common_IDT_layouts
Functions§
- init⚠
- Performs low-level CPU initialization.