summaryrefslogtreecommitdiff
path: root/usr/src/uts/i86pc/sys
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/i86pc/sys')
-rw-r--r--usr/src/uts/i86pc/sys/hpet_acpi.h10
-rw-r--r--usr/src/uts/i86pc/sys/prom_debug.h72
2 files changed, 77 insertions, 5 deletions
diff --git a/usr/src/uts/i86pc/sys/hpet_acpi.h b/usr/src/uts/i86pc/sys/hpet_acpi.h
index e60ebe4bba..81304674b5 100644
--- a/usr/src/uts/i86pc/sys/hpet_acpi.h
+++ b/usr/src/uts/i86pc/sys/hpet_acpi.h
@@ -36,7 +36,7 @@ extern "C" {
#endif
/*
- * Solaris uses an HPET Timer to generate interrupts for CPUs in Deep C-state
+ * illumos uses an HPET Timer to generate interrupts for CPUs in Deep C-state
* with stalled LAPIC Timers. All CPUs use one HPET timer. The timer's
* interrupt targets one CPU (via the I/O APIC). The one CPU that receives
* the HPET's interrupt wakes up other CPUs as needed during the HPET Interrupt
@@ -46,7 +46,7 @@ extern "C" {
* Please see the Intel Programmer's guides. Interrupts are disabled before
* a CPU Halts into Deep C-state. (This allows CPU-hardware-specific cleanup
* before servicing interrupts.) When a Deep C-state CPU wakes up (due to
- * an externally generated interrupt), it resume execution where it halted.
+ * an externally generated interrupt), it resumes execution where it halted.
* The CPU returning from Deep C-state must enable interrupts before it will
* handle the pending interrupt that woke it from Deep C-state.
*
@@ -72,7 +72,7 @@ extern "C" {
* } timers[32];
* }
*
- * There are 32 possible timers in an hpet. Only the first 3 timers are
+ * There are 32 possible timers in an HPET. Only the first 3 timers are
* required. The other 29 timers are optional.
*
* HPETs can have 64-bit or 32-bit timers. Timers/compare registers can
@@ -80,7 +80,7 @@ extern "C" {
* The first two timers are not used. The HPET spec intends the first two
* timers to be used as "legacy replacement" for the PIT and RTC timers.
*
- * Solaris uses the first available non-legacy replacement timer as a proxy
+ * illumos uses the first available non-legacy replacement timer as a proxy
* timer for processor Local APIC Timers that stop in deep idle C-states.
*/
@@ -97,7 +97,7 @@ extern "C" {
#define HPET_SIZE (1024)
/*
- * Offsets of hpet registers and macros to access them from HPET base address.
+ * Offsets of HPET registers and macros to access them from HPET base address.
*/
#define HPET_GEN_CAP_OFFSET (0)
#define HPET_GEN_CONFIG_OFFSET (0x10)
diff --git a/usr/src/uts/i86pc/sys/prom_debug.h b/usr/src/uts/i86pc/sys/prom_debug.h
new file mode 100644
index 0000000000..ae64d91711
--- /dev/null
+++ b/usr/src/uts/i86pc/sys/prom_debug.h
@@ -0,0 +1,72 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2020 Oxide Computer Company
+ */
+
+#ifndef _SYS_PROM_DEBUG_H
+#define _SYS_PROM_DEBUG_H
+
+#include <sys/promif.h>
+
+/*
+ * These macros are used to emit coarse-grained early boot debugging
+ * information when the user sets "prom_debug" in the boot environment. They
+ * should only be used for information that we cannot easily obtain through a
+ * richer mechanism because the machine hangs or crashes before other debugging
+ * tools are available.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int prom_debug;
+
+/*
+ * Print a string message, used to signal that we have at least reached a
+ * particular point in the code:
+ */
+#define PRM_POINT(q) do { \
+ if (prom_debug) { \
+ prom_printf("%s:%d: %s\n", \
+ __FILE__, __LINE__, (q)); \
+ } \
+ } while (0)
+
+/*
+ * Print the name and value of an integer variable:
+ */
+#define PRM_DEBUG(q) do { \
+ if (prom_debug) { \
+ prom_printf("%s:%d: '%s' is 0x%llx\n", \
+ __FILE__, __LINE__, #q, (long long)(q)); \
+ } \
+ } while (0)
+
+/*
+ * Print the name and value of a string (char *) variable (which may be NULL):
+ */
+#define PRM_DEBUGS(q) do { \
+ if (prom_debug) { \
+ const char *qq = q; \
+ prom_printf("%s:%d: '%s' is '%s'\n", \
+ __FILE__, __LINE__, #q, \
+ qq != NULL ? qq : "<NULL>"); \
+ } \
+ } while (0)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_PROM_DEBUG_H */