summaryrefslogtreecommitdiff
path: root/usr/src/uts/intel/sys/bootregs.h
diff options
context:
space:
mode:
authorstevel@tonic-gate <none@none>2005-06-14 00:00:00 -0700
committerstevel@tonic-gate <none@none>2005-06-14 00:00:00 -0700
commit7c478bd95313f5f23a4c958a745db2134aa03244 (patch)
treec871e58545497667cbb4b0a4f2daf204743e1fe7 /usr/src/uts/intel/sys/bootregs.h
downloadillumos-joyent-7c478bd95313f5f23a4c958a745db2134aa03244.tar.gz
OpenSolaris Launch
Diffstat (limited to 'usr/src/uts/intel/sys/bootregs.h')
-rw-r--r--usr/src/uts/intel/sys/bootregs.h87
1 files changed, 87 insertions, 0 deletions
diff --git a/usr/src/uts/intel/sys/bootregs.h b/usr/src/uts/intel/sys/bootregs.h
new file mode 100644
index 0000000000..47f268381c
--- /dev/null
+++ b/usr/src/uts/intel/sys/bootregs.h
@@ -0,0 +1,87 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License"). You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _SYS_BOOTREGS_H
+#define _SYS_BOOTREGS_H
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(_KERNEL) || defined(_BOOT)
+
+/*
+ * This structure is used by bootops to save/restore registers when
+ * transferring between protected and realmode code.
+ *
+ * NOTE: The following macros require an ANSI compiler!
+ */
+
+#define i8080reg(r) union { /* 8080-like "general purpose" registers */\
+ uint32_t e ## r ## x; \
+ struct { uint16_t r ## x; } word; \
+ struct { uint8_t r ## l, r ## h; } byte; \
+}
+
+#define i8086reg(r) union { /* 16/32-bit "special purpose" registers */\
+ uint32_t e ## r; \
+ struct { uint16_t r; } word; \
+}
+
+struct bop_regs {
+ /*
+ * Machine state structure for realmode <-> protected mode callout
+ * operations:
+ */
+
+ i8080reg(a) eax; /* The so-called "general purpose" registers */
+ i8080reg(d) edx;
+ i8080reg(c) ecx;
+ i8080reg(b) ebx;
+
+ i8086reg(bp) ebp; /* 16/32-bit "pointer" registers */
+ i8086reg(si) esi;
+ i8086reg(di) edi;
+
+ uint16_t ds; /* Segment registers */
+ uint16_t es;
+ uint16_t fs;
+ uint16_t gs;
+
+ uint32_t eflags;
+};
+
+#undef i8080reg
+#undef i8086reg
+#endif /* _KERNEL || _BOOT */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_BOOTREGS_H */