4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _SYS_BOOTREGS_H
28 #define _SYS_BOOTREGS_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
36 #if defined(_KERNEL) || defined(_BOOT)
39 * This structure is used by bootops to save/restore registers when
40 * transferring between protected and realmode code.
42 * NOTE: The following macros require an ANSI compiler!
45 #define i8080reg(r) union { /* 8080-like "general purpose" registers */\
46 uint32_t e ## r ## x; \
47 struct { uint16_t r ## x; } word; \
48 struct { uint8_t r ## l, r ## h; } byte; \
51 #define i8086reg(r) union { /* 16/32-bit "special purpose" registers */\
53 struct { uint16_t r; } word; \
58 * Machine state structure for realmode <-> protected mode callout
62 i8080reg(a
) eax
; /* The so-called "general purpose" registers */
67 i8086reg(bp
) ebp
; /* 16/32-bit "pointer" registers */
71 uint16_t ds
; /* Segment registers */
81 #endif /* _KERNEL || _BOOT */
87 #endif /* _SYS_BOOTREGS_H */