xref: /minix3/sys/arch/i386/include/bioscall.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc /*	$NetBSD: bioscall.h,v 1.11 2008/04/28 20:23:24 martin Exp $ */
2*0a6a1f1dSLionel Sambuc 
3*0a6a1f1dSLionel Sambuc /*-
4*0a6a1f1dSLionel Sambuc  * Copyright (c) 1997, 2000 The NetBSD Foundation, Inc.
5*0a6a1f1dSLionel Sambuc  * All rights reserved.
6*0a6a1f1dSLionel Sambuc  *
7*0a6a1f1dSLionel Sambuc  * This code is derived from software contributed to The NetBSD Foundation
8*0a6a1f1dSLionel Sambuc  * by John Kohl and Jason R. Thorpe.
9*0a6a1f1dSLionel Sambuc  *
10*0a6a1f1dSLionel Sambuc  * Redistribution and use in source and binary forms, with or without
11*0a6a1f1dSLionel Sambuc  * modification, are permitted provided that the following conditions
12*0a6a1f1dSLionel Sambuc  * are met:
13*0a6a1f1dSLionel Sambuc  * 1. Redistributions of source code must retain the above copyright
14*0a6a1f1dSLionel Sambuc  *    notice, this list of conditions and the following disclaimer.
15*0a6a1f1dSLionel Sambuc  * 2. Redistributions in binary form must reproduce the above copyright
16*0a6a1f1dSLionel Sambuc  *    notice, this list of conditions and the following disclaimer in the
17*0a6a1f1dSLionel Sambuc  *    documentation and/or other materials provided with the distribution.
18*0a6a1f1dSLionel Sambuc  *
19*0a6a1f1dSLionel Sambuc  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20*0a6a1f1dSLionel Sambuc  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21*0a6a1f1dSLionel Sambuc  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22*0a6a1f1dSLionel Sambuc  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23*0a6a1f1dSLionel Sambuc  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24*0a6a1f1dSLionel Sambuc  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25*0a6a1f1dSLionel Sambuc  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26*0a6a1f1dSLionel Sambuc  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27*0a6a1f1dSLionel Sambuc  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28*0a6a1f1dSLionel Sambuc  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29*0a6a1f1dSLionel Sambuc  * POSSIBILITY OF SUCH DAMAGE.
30*0a6a1f1dSLionel Sambuc  */
31*0a6a1f1dSLionel Sambuc 
32*0a6a1f1dSLionel Sambuc #ifndef __I386_BIOSCALL_H__
33*0a6a1f1dSLionel Sambuc #define __I386_BIOSCALL_H__
34*0a6a1f1dSLionel Sambuc 
35*0a6a1f1dSLionel Sambuc /*
36*0a6a1f1dSLionel Sambuc  * virtual & physical address of the trampoline
37*0a6a1f1dSLionel Sambuc  * that we use: page 1.
38*0a6a1f1dSLionel Sambuc  */
39*0a6a1f1dSLionel Sambuc #define BIOSTRAMP_BASE	PAGE_SIZE
40*0a6a1f1dSLionel Sambuc 
41*0a6a1f1dSLionel Sambuc #ifndef _LOCORE
42*0a6a1f1dSLionel Sambuc #define	BIOSREG_LO	0
43*0a6a1f1dSLionel Sambuc #define	BIOSREG_HI	1
44*0a6a1f1dSLionel Sambuc 
45*0a6a1f1dSLionel Sambuc typedef	union {
46*0a6a1f1dSLionel Sambuc 	u_char biosreg_quarter[4];
47*0a6a1f1dSLionel Sambuc 	u_short biosreg_half[2];
48*0a6a1f1dSLionel Sambuc 	u_int biosreg_long;
49*0a6a1f1dSLionel Sambuc } bios_reg;
50*0a6a1f1dSLionel Sambuc 
51*0a6a1f1dSLionel Sambuc struct bioscallregs {
52*0a6a1f1dSLionel Sambuc     bios_reg r_ax;
53*0a6a1f1dSLionel Sambuc     bios_reg r_bx;
54*0a6a1f1dSLionel Sambuc     bios_reg r_cx;
55*0a6a1f1dSLionel Sambuc     bios_reg r_dx;
56*0a6a1f1dSLionel Sambuc     bios_reg r_si;
57*0a6a1f1dSLionel Sambuc     bios_reg r_di;
58*0a6a1f1dSLionel Sambuc     bios_reg r_flags;
59*0a6a1f1dSLionel Sambuc     bios_reg r_es;
60*0a6a1f1dSLionel Sambuc };
61*0a6a1f1dSLionel Sambuc 
62*0a6a1f1dSLionel Sambuc #define	AL	r_ax.biosreg_quarter[BIOSREG_LO]
63*0a6a1f1dSLionel Sambuc #define	AH	r_ax.biosreg_quarter[BIOSREG_HI]
64*0a6a1f1dSLionel Sambuc #define	AX	r_ax.biosreg_half[BIOSREG_LO]
65*0a6a1f1dSLionel Sambuc #define	AX_HI	r_ax.biosreg_half[BIOSREG_HI]
66*0a6a1f1dSLionel Sambuc #define	EAX	r_ax.biosreg_long
67*0a6a1f1dSLionel Sambuc 
68*0a6a1f1dSLionel Sambuc #define	BL	r_bx.biosreg_quarter[BIOSREG_LO]
69*0a6a1f1dSLionel Sambuc #define	BH	r_bx.biosreg_quarter[BIOSREG_HI]
70*0a6a1f1dSLionel Sambuc #define	BX	r_bx.biosreg_half[BIOSREG_LO]
71*0a6a1f1dSLionel Sambuc #define	BX_HI	r_bx.biosreg_half[BIOSREG_HI]
72*0a6a1f1dSLionel Sambuc #define	EBX	r_bx.biosreg_long
73*0a6a1f1dSLionel Sambuc 
74*0a6a1f1dSLionel Sambuc #define	CL	r_cx.biosreg_quarter[BIOSREG_LO]
75*0a6a1f1dSLionel Sambuc #define	CH	r_cx.biosreg_quarter[BIOSREG_HI]
76*0a6a1f1dSLionel Sambuc #define	CX	r_cx.biosreg_half[BIOSREG_LO]
77*0a6a1f1dSLionel Sambuc #define	CX_HI	r_cx.biosreg_half[BIOSREG_HI]
78*0a6a1f1dSLionel Sambuc #define	ECX	r_cx.biosreg_long
79*0a6a1f1dSLionel Sambuc 
80*0a6a1f1dSLionel Sambuc #define	DL	r_dx.biosreg_quarter[BIOSREG_LO]
81*0a6a1f1dSLionel Sambuc #define	DH	r_dx.biosreg_quarter[BIOSREG_HI]
82*0a6a1f1dSLionel Sambuc #define	DX	r_dx.biosreg_half[BIOSREG_LO]
83*0a6a1f1dSLionel Sambuc #define	DX_HI	r_dx.biosreg_half[BIOSREG_HI]
84*0a6a1f1dSLionel Sambuc #define	EDX	r_dx.biosreg_long
85*0a6a1f1dSLionel Sambuc 
86*0a6a1f1dSLionel Sambuc #define	SI	r_si.biosreg_half[BIOSREG_LO]
87*0a6a1f1dSLionel Sambuc #define	SI_HI	r_si.biosreg_half[BIOSREG_HI]
88*0a6a1f1dSLionel Sambuc #define	ESI	r_si.biosreg_long
89*0a6a1f1dSLionel Sambuc 
90*0a6a1f1dSLionel Sambuc #define	DI	r_di.biosreg_half[BIOSREG_LO]
91*0a6a1f1dSLionel Sambuc #define	DI_HI	r_di.biosreg_half[BIOSREG_HI]
92*0a6a1f1dSLionel Sambuc #define	EDI	r_di.biosreg_long
93*0a6a1f1dSLionel Sambuc 
94*0a6a1f1dSLionel Sambuc #define	FLAGS	 r_flags.biosreg_half[BIOSREG_LO]
95*0a6a1f1dSLionel Sambuc #define	FLAGS_HI r_flags.biosreg_half[BIOSREG_HI]
96*0a6a1f1dSLionel Sambuc #define	EFLAGS	 r_flags.biosreg_long
97*0a6a1f1dSLionel Sambuc 
98*0a6a1f1dSLionel Sambuc #define ES	r_es.biosreg_half[BIOSREG_LO]
99*0a6a1f1dSLionel Sambuc 
100*0a6a1f1dSLionel Sambuc void bioscall(int /* function*/ , struct bioscallregs * /* regs */);
101*0a6a1f1dSLionel Sambuc #endif
102*0a6a1f1dSLionel Sambuc #endif /* __I386_BIOSCALL_H__ */
103