]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - board/MAI/bios_emulator/scitech/include/biosemu.h
* Patch by Thomas Frieden, 13 Nov 2002:
[karo-tx-uboot.git] / board / MAI / bios_emulator / scitech / include / biosemu.h
1 /****************************************************************************
2 *
3 *                        BIOS emulator and interface
4 *                      to Realmode X86 Emulator Library
5 *
6 *               Copyright (C) 1996-1999 SciTech Software, Inc.
7 *
8 *  ========================================================================
9 *
10 *  Permission to use, copy, modify, distribute, and sell this software and
11 *  its documentation for any purpose is hereby granted without fee,
12 *  provided that the above copyright notice appear in all copies and that
13 *  both that copyright notice and this permission notice appear in
14 *  supporting documentation, and that the name of the authors not be used
15 *  in advertising or publicity pertaining to distribution of the software
16 *  without specific, written prior permission.  The authors makes no
17 *  representations about the suitability of this software for any purpose.
18 *  It is provided "as is" without express or implied warranty.
19 *
20 *  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
21 *  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
22 *  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
23 *  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
24 *  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
25 *  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
26 *  PERFORMANCE OF THIS SOFTWARE.
27 *
28 *  ========================================================================
29 *
30 * Language:     ANSI C
31 * Environment:  Any
32 * Developer:    Kendall Bennett
33 *
34 * Description:  Header file for the real mode x86 BIOS emulator, which is
35 *               used to warmboot any number of VGA compatible PCI/AGP
36 *               controllers under any OS, on any processor family that
37 *               supports PCI. We also allow the user application to call
38 *               real mode BIOS functions and Int 10h functions (including
39 *               the VESA BIOS).
40 *
41 ****************************************************************************/
42
43 #ifndef __BIOSEMU_H
44 #define __BIOSEMU_H
45
46 #include "x86emu.h"
47 #include "pmapi.h"
48 #include "pcilib.h"
49
50 /*---------------------- Macros and type definitions ----------------------*/
51
52 #pragma pack(1)
53
54 /****************************************************************************
55 REMARKS:
56 Data structure used to describe the details specific to a particular VGA
57 controller. This information is used to allow the VGA controller to be
58 swapped on the fly within the BIOS emulator.
59
60 HEADER:
61 biosemu.h
62
63 MEMBERS:
64 pciInfo         - PCI device information block for the controller
65 BIOSImage       - Pointer to a read/write copy of the BIOS image
66 BIOSImageLen    - Length of the BIOS image
67 LowMem          - Copy of key low memory areas
68 ****************************************************************************/
69 typedef struct {
70     PCIDeviceInfo   *pciInfo;
71     void            *BIOSImage;
72     ulong           BIOSImageLen;
73     uchar           LowMem[1536];
74     } BE_VGAInfo;
75
76 /****************************************************************************
77 REMARKS:
78 Data structure used to describe the details for the BIOS emulator system
79 environment as used by the X86 emulator library.
80
81 HEADER:
82 biosemu.h
83
84 MEMBERS:
85 vgaInfo         - VGA BIOS information structure
86 biosmem_base    - Base of the BIOS image
87 biosmem_limit   - Limit of the BIOS image
88 busmem_base     - Base of the VGA bus memory
89 ****************************************************************************/
90 typedef struct {
91     BE_VGAInfo      vgaInfo;
92     ulong           biosmem_base;
93     ulong           biosmem_limit;
94     ulong           busmem_base;
95     } BE_sysEnv;
96
97 /****************************************************************************
98 REMARKS:
99 Structure defining all the BIOS Emulator API functions as exported from
100 the Binary Portable DLL.
101 {secret}
102 ****************************************************************************/
103 typedef struct {
104     ulong   dwSize;
105     ibool   (PMAPIP BE_init)(u32 debugFlags,int memSize,BE_VGAInfo *info);
106     void    (PMAPIP BE_setVGA)(BE_VGAInfo *info);
107     void    (PMAPIP BE_getVGA)(BE_VGAInfo *info);
108     void *  (PMAPIP BE_mapRealPointer)(uint r_seg,uint r_off);
109     void *  (PMAPIP BE_getVESABuf)(uint *len,uint *rseg,uint *roff);
110     void    (PMAPIP BE_callRealMode)(uint seg,uint off,RMREGS *regs,RMSREGS *sregs);
111     int     (PMAPIP BE_int86)(int intno,RMREGS *in,RMREGS *out);
112     int     (PMAPIP BE_int86x)(int intno,RMREGS *in,RMREGS *out,RMSREGS *sregs);
113     void *  reserved1;
114     void    (PMAPIP BE_exit)(void);
115     } BE_exports;
116
117 /****************************************************************************
118 REMARKS:
119 Function pointer type for the Binary Portable DLL initialisation entry point.
120 {secret}
121 ****************************************************************************/
122 typedef BE_exports * (PMAPIP BE_initLibrary_t)(PM_imports *PMImp);
123
124 #pragma pack()
125
126 /*---------------------------- Global variables ---------------------------*/
127
128 #ifdef  __cplusplus
129 extern "C" {                        /* Use "C" linkage when in C++ mode */
130 #endif
131
132 /* {secret} Global BIOS emulator system environment */
133 extern BE_sysEnv _BE_env;
134
135 /*-------------------------- Function Prototypes --------------------------*/
136
137 /* BIOS emulator library entry points */
138
139 ibool   PMAPI BE_init(u32 debugFlags,int memSize,BE_VGAInfo *info);
140 void    PMAPI BE_setVGA(BE_VGAInfo *info);
141 void    PMAPI BE_getVGA(BE_VGAInfo *info);
142 void    PMAPI BE_setDebugFlags(u32 debugFlags);
143 void *  PMAPI BE_mapRealPointer(uint r_seg,uint r_off);
144 void *  PMAPI BE_getVESABuf(uint *len,uint *rseg,uint *roff);
145 void    PMAPI BE_callRealMode(uint seg,uint off,RMREGS *regs,RMSREGS *sregs);
146 int     PMAPI BE_int86(int intno,RMREGS *in,RMREGS *out);
147 int     PMAPI BE_int86x(int intno,RMREGS *in,RMREGS *out,RMSREGS *sregs);
148 void    PMAPI BE_exit(void);
149
150 #ifdef  __cplusplus
151 }                                   /* End of "C" linkage for C++       */
152 #endif
153
154 #endif /* __BIOSEMU_H */
155