mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-29 13:48:21 +00:00
kernel: initial hpet support
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
#ifndef _TIME_H
|
||||
#define _TIME_H
|
||||
|
||||
typedef long time_t;
|
||||
|
||||
typedef struct {
|
||||
time_t s;
|
||||
time_t ns;
|
||||
} timespec_t;
|
||||
|
||||
#endif
|
||||
@@ -45,6 +45,24 @@ typedef struct {
|
||||
uint32_t flags;
|
||||
} __attribute__((packed)) madt_t;
|
||||
|
||||
typedef struct {
|
||||
sdtheader_t header;
|
||||
uint8_t hwrev;
|
||||
uint8_t comparatorcount:5;
|
||||
uint8_t countersize:1;
|
||||
uint8_t reserved:1;
|
||||
uint8_t legacy_replacement:1;
|
||||
uint16_t pcivendor;
|
||||
uint8_t addrid;
|
||||
uint8_t bitwidth;
|
||||
uint8_t bitoffset;
|
||||
uint8_t reserved2;
|
||||
uint64_t addr;
|
||||
uint8_t hpetnum;
|
||||
uint16_t mintick;
|
||||
uint8_t pageprot;
|
||||
} __attribute__((packed)) hpet_t;
|
||||
|
||||
#define ACPI_MADT_TYPE_LAPIC 0
|
||||
#define ACPI_MADT_TYPE_IOAPIC 1
|
||||
#define ACPI_MADT_TYPE_OVERRIDE 2
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef _HPET_H
|
||||
#define _HPET_h
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <time.h>
|
||||
|
||||
void arch_hpet_waitticks(time_t ticks);
|
||||
void arch_hpet_waitus(time_t us);
|
||||
bool arch_hpet_exists();
|
||||
void arch_hpet_init();
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user