AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
platform.h File Reference
#include <dev/irq.h>

Go to the source code of this file.

Functions

int platform_init (void)
 Sets up the platform at boot: its interrupt controllers, timers, PCI host bridge and other devices, then the other CPUs.
uint32_t platform_timer_setup (size_t period_ns, irq_handler_t handler)
 Starts the scheduler's tick: the local APIC's timer if the APIC brings the interrupts, else the PIT.

Function Documentation

◆ platform_init()

int platform_init ( void )

Sets up the platform at boot: its interrupt controllers, timers, PCI host bridge and other devices, then the other CPUs.

Each platform implements it; the architecture calls it before kmain().

Returns
0

Definition at line 31 of file init.c.

◆ platform_timer_setup()

uint32_t platform_timer_setup ( size_t period_ns,
irq_handler_t handler )

Starts the scheduler's tick: the local APIC's timer if the APIC brings the interrupts, else the PIT.

Parameters
period_nsthe tick's period, in ns
handlerthe tick's handler
Returns
the period it really is, in ns

Definition at line 84 of file init.c.

References apic, irq_install(), NULL, PIT_IRQ, platform_timer_setup(), x86_lapic_timer_setup(), and x86_pit_period_set().

Referenced by arch_sched_init(), and platform_timer_setup().