summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/include
diff options
context:
space:
mode:
authorScott Soule Cheloha <cheloha@cvs.openbsd.org>2022-11-08 17:34:14 +0000
committerScott Soule Cheloha <cheloha@cvs.openbsd.org>2022-11-08 17:34:14 +0000
commit137df2b0d49b9cfe312525f6a0a337d265868f4b (patch)
tree4f67f890ebb167281c8df4772010d93f864652b7 /sys/arch/amd64/include
parent4a68e2fc2248d9337ffe48a68841b30880a201d6 (diff)
amd64: switch to clockintr(9)
Switch amd64 to the clockintr(9) subsystem. There are lots of little changes, but the bigs ones are listed here. When using the local apic timer: - Run the timer in one-shot mode. - lapic_delay() is gone. We can't use it to delay(9) when running the timer in one-shot mode. - Add a randomized statclock(); stathz = hz. - Add support for switching to profhz when profiling is enabled; profhz = stathz * 10. When using the i8254/mc146818: - i8254's clockintr() no longer has a monopoly on hardclock(). - mc146818's rtcintr() no longer has a monopoly on statclock(). - In profiling mode, the statclock() will drift very slightly because (profhz = 1024) does not divide evenly into one billion. We could avoid this by setting (profhz = 512) instead and programming the RTC to run at that rate. Early revisions reviewed by mlarkin@. Extensively tested by mlarkin@ on a variety of physical and virtual hardware. Additional testing from dv@ and jmc@. Link: https://marc.info/?l=openbsd-tech&m=166776339203279&w=2 ok kettenis@ mlarkin@
Diffstat (limited to 'sys/arch/amd64/include')
-rw-r--r--sys/arch/amd64/include/_types.h4
-rw-r--r--sys/arch/amd64/include/cpu.h5
2 files changed, 7 insertions, 2 deletions
diff --git a/sys/arch/amd64/include/_types.h b/sys/arch/amd64/include/_types.h
index 67c67a1472f..a9445bb4d93 100644
--- a/sys/arch/amd64/include/_types.h
+++ b/sys/arch/amd64/include/_types.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: _types.h,v 1.17 2018/03/05 01:15:25 deraadt Exp $ */
+/* $OpenBSD: _types.h,v 1.18 2022/11/08 17:34:13 cheloha Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -35,6 +35,8 @@
#ifndef _MACHINE__TYPES_H_
#define _MACHINE__TYPES_H_
+#define __HAVE_CLOCKINTR
+
/*
* _ALIGN(p) rounds p (pointer or byte index) up to a correctly-aligned
* value for all data types (int, long, ...). The result is an
diff --git a/sys/arch/amd64/include/cpu.h b/sys/arch/amd64/include/cpu.h
index d5ce2f5d717..7dcbc82be11 100644
--- a/sys/arch/amd64/include/cpu.h
+++ b/sys/arch/amd64/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.152 2022/11/08 14:46:51 cheloha Exp $ */
+/* $OpenBSD: cpu.h,v 1.153 2022/11/08 17:34:13 cheloha Exp $ */
/* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */
/*-
@@ -47,6 +47,7 @@
#include <machine/intrdefs.h>
#endif /* _KERNEL */
+#include <sys/clockintr.h>
#include <sys/device.h>
#include <sys/rwlock.h>
#include <sys/sched.h>
@@ -221,6 +222,8 @@ struct cpu_info {
paddr_t ci_vmcs_pa;
struct rwlock ci_vmcs_lock;
+
+ struct clockintr_queue ci_queue;
};
#define CPUF_BSP 0x0001 /* CPU is the original BSP */