mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
timekeeper sources: add an option to disable each one of them
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
#include <kernel/vmm.h>
|
#include <kernel/vmm.h>
|
||||||
#include <kernel/interrupt.h>
|
#include <kernel/interrupt.h>
|
||||||
#include <arch/tsc.h>
|
#include <arch/tsc.h>
|
||||||
|
#include <kernel/cmdline.h>
|
||||||
|
|
||||||
#include <uacpi/acpi.h>
|
#include <uacpi/acpi.h>
|
||||||
#include <uacpi/tables.h>
|
#include <uacpi/tables.h>
|
||||||
@@ -62,6 +63,9 @@ static void counterirq(isr_t *isr, context_t *context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool hpet_probe(void) {
|
static bool hpet_probe(void) {
|
||||||
|
if (cmdline_get("nohpet"))
|
||||||
|
return false;
|
||||||
|
|
||||||
bool usable = false;
|
bool usable = false;
|
||||||
struct acpi_hpet *table;
|
struct acpi_hpet *table;
|
||||||
uacpi_table tbl;
|
uacpi_table tbl;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include <arch/cpuid.h>
|
#include <arch/cpuid.h>
|
||||||
#include <kernel/pmm.h>
|
#include <kernel/pmm.h>
|
||||||
#include <arch/tsc.h>
|
#include <arch/tsc.h>
|
||||||
|
#include <kernel/cmdline.h>
|
||||||
|
|
||||||
#define KVM_TIMER_SYSTEM_TIME_ALIGNMENT 4
|
#define KVM_TIMER_SYSTEM_TIME_ALIGNMENT 4
|
||||||
#define KVM_TIMER_SYSTEM_TIME_ENABLE 1
|
#define KVM_TIMER_SYSTEM_TIME_ENABLE 1
|
||||||
@@ -23,6 +24,9 @@ typedef struct {
|
|||||||
} __attribute__((packed)) kvm_timer_info_t;
|
} __attribute__((packed)) kvm_timer_info_t;
|
||||||
|
|
||||||
static bool kvm_timer_probe(void) {
|
static bool kvm_timer_probe(void) {
|
||||||
|
if (cmdline_get("nokvmclock"))
|
||||||
|
return false;
|
||||||
|
|
||||||
// figure out if we are running in kvm
|
// figure out if we are running in kvm
|
||||||
uint32_t base = cpuid_find_hypervisor_base_kvm();
|
uint32_t base = cpuid_find_hypervisor_base_kvm();
|
||||||
if (base == 0)
|
if (base == 0)
|
||||||
|
|||||||
@@ -3,8 +3,13 @@
|
|||||||
#include <arch/cpuid.h>
|
#include <arch/cpuid.h>
|
||||||
#include <logging.h>
|
#include <logging.h>
|
||||||
#include <kernel/alloc.h>
|
#include <kernel/alloc.h>
|
||||||
|
#include <arch/hpet.h>
|
||||||
|
#include <kernel/cmdline.h>
|
||||||
|
|
||||||
static bool tsc_probe(void) {
|
static bool tsc_probe(void) {
|
||||||
|
if (cmdline_get("notsc"))
|
||||||
|
return false;
|
||||||
|
|
||||||
cpuid_results_t cpuid_results;
|
cpuid_results_t cpuid_results;
|
||||||
|
|
||||||
uint32_t max_extended_leaf = cpuid_extended_max_leaf();
|
uint32_t max_extended_leaf = cpuid_extended_max_leaf();
|
||||||
|
|||||||
Reference in New Issue
Block a user