pbsdboot.h revision 1.4.2.1 1 1.4.2.1 bouyer /* $NetBSD: pbsdboot.h,v 1.4.2.1 2000/11/20 20:39:23 bouyer Exp $ */
2 1.4.2.1 bouyer
3 1.4.2.1 bouyer /*-
4 1.4.2.1 bouyer * Copyright (c) 1999 Shin Takemura.
5 1.4.2.1 bouyer * All rights reserved.
6 1.4.2.1 bouyer *
7 1.4.2.1 bouyer * This software is part of the PocketBSD.
8 1.4.2.1 bouyer *
9 1.4.2.1 bouyer * Redistribution and use in source and binary forms, with or without
10 1.4.2.1 bouyer * modification, are permitted provided that the following conditions
11 1.4.2.1 bouyer * are met:
12 1.4.2.1 bouyer * 1. Redistributions of source code must retain the above copyright
13 1.4.2.1 bouyer * notice, this list of conditions and the following disclaimer.
14 1.4.2.1 bouyer * 2. Redistributions in binary form must reproduce the above copyright
15 1.4.2.1 bouyer * notice, this list of conditions and the following disclaimer in the
16 1.4.2.1 bouyer * documentation and/or other materials provided with the distribution.
17 1.4.2.1 bouyer * 3. All advertising materials mentioning features or use of this software
18 1.4.2.1 bouyer * must display the following acknowledgement:
19 1.4.2.1 bouyer * This product includes software developed by the PocketBSD project
20 1.4.2.1 bouyer * and its contributors.
21 1.4.2.1 bouyer * 4. Neither the name of the project nor the names of its contributors
22 1.4.2.1 bouyer * may be used to endorse or promote products derived from this software
23 1.4.2.1 bouyer * without specific prior written permission.
24 1.4.2.1 bouyer *
25 1.4.2.1 bouyer * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 1.4.2.1 bouyer * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 1.4.2.1 bouyer * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 1.4.2.1 bouyer * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 1.4.2.1 bouyer * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 1.4.2.1 bouyer * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 1.4.2.1 bouyer * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 1.4.2.1 bouyer * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 1.4.2.1 bouyer * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 1.4.2.1 bouyer * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 1.4.2.1 bouyer * SUCH DAMAGE.
36 1.4.2.1 bouyer *
37 1.4.2.1 bouyer */
38 1.4.2.1 bouyer #define STANDALONE_WINDOWS_SIDE
39 1.4.2.1 bouyer #include <stand.h>
40 1.4.2.1 bouyer #include <machine/bootinfo.h>
41 1.4.2.1 bouyer #include <machine/platid.h>
42 1.4.2.1 bouyer
43 1.4.2.1 bouyer extern TCHAR szAppName[ ];
44 1.4.2.1 bouyer #define whoami szAppName
45 1.4.2.1 bouyer #define PREFNAME TEXT("pbsdboot.ini")
46 1.4.2.1 bouyer #define LOGNAME TEXT("pbsdboot.log")
47 1.4.2.1 bouyer #define PATHBUFLEN 200
48 1.4.2.1 bouyer
49 1.4.2.1 bouyer
50 1.4.2.1 bouyer /*
51 1.4.2.1 bouyer * For some reason, we can't include Windows' header files.
52 1.4.2.1 bouyer * So we must declare here.
53 1.4.2.1 bouyer */
54 1.4.2.1 bouyer double wcstod(const wchar_t *, wchar_t **);
55 1.4.2.1 bouyer long wcstol(const wchar_t *, wchar_t **, int);
56 1.4.2.1 bouyer unsigned long wcstoul(const wchar_t *, wchar_t **, int);
57 1.4.2.1 bouyer BOOL VirtualCopy(LPVOID, LPVOID, DWORD, DWORD);
58 1.4.2.1 bouyer
59 1.4.2.1 bouyer /*
60 1.4.2.1 bouyer * structure declarations
61 1.4.2.1 bouyer */
62 1.4.2.1 bouyer struct map_s {
63 1.4.2.1 bouyer caddr_t entry;
64 1.4.2.1 bouyer caddr_t base;
65 1.4.2.1 bouyer int pagesize;
66 1.4.2.1 bouyer int leafsize;
67 1.4.2.1 bouyer int nleaves;
68 1.4.2.1 bouyer caddr_t arg0;
69 1.4.2.1 bouyer caddr_t arg1;
70 1.4.2.1 bouyer caddr_t arg2;
71 1.4.2.1 bouyer caddr_t arg3;
72 1.4.2.1 bouyer caddr_t *leaf[32];
73 1.4.2.1 bouyer };
74 1.4.2.1 bouyer
75 1.4.2.1 bouyer struct preference_s {
76 1.4.2.1 bouyer int setting_idx;
77 1.4.2.1 bouyer int fb_type;
78 1.4.2.1 bouyer int fb_width, fb_height, fb_linebytes;
79 1.4.2.1 bouyer int boot_time;
80 1.4.2.1 bouyer long fb_addr;
81 1.4.2.1 bouyer unsigned long platid_cpu, platid_machine;
82 1.4.2.1 bouyer TCHAR setting_name[PATHBUFLEN];
83 1.4.2.1 bouyer TCHAR kernel_name[PATHBUFLEN];
84 1.4.2.1 bouyer TCHAR options[PATHBUFLEN];
85 1.4.2.1 bouyer BOOL check_last_chance;
86 1.4.2.1 bouyer BOOL load_debug_info;
87 1.4.2.1 bouyer BOOL serial_port;
88 1.4.2.1 bouyer BOOL reverse_video;
89 1.4.2.1 bouyer BOOL autoboot;
90 1.4.2.1 bouyer };
91 1.4.2.1 bouyer
92 1.4.2.1 bouyer struct path_s {
93 1.4.2.1 bouyer TCHAR* name;
94 1.4.2.1 bouyer LANGID langid;
95 1.4.2.1 bouyer unsigned long flags;
96 1.4.2.1 bouyer #define PATH_SAVE 1
97 1.4.2.1 bouyer };
98 1.4.2.1 bouyer
99 1.4.2.1 bouyer /*
100 1.4.2.1 bouyer * Machine dependent information
101 1.4.2.1 bouyer */
102 1.4.2.1 bouyer struct system_info {
103 1.4.2.1 bouyer unsigned int si_dramstart;
104 1.4.2.1 bouyer unsigned int si_drammaxsize;
105 1.4.2.1 bouyer DWORD si_pagesize;
106 1.4.2.1 bouyer unsigned char *si_asmcode;
107 1.4.2.1 bouyer int si_asmcodelen;
108 1.4.2.1 bouyer int (*si_boot) __P((caddr_t));
109 1.4.2.1 bouyer int si_intrvec;
110 1.4.2.1 bouyer };
111 1.4.2.1 bouyer extern struct system_info system_info;
112 1.4.2.1 bouyer
113 1.4.2.1 bouyer extern struct preference_s pref;
114 1.4.2.1 bouyer extern TCHAR* where_pref_load_from;
115 1.4.2.1 bouyer
116 1.4.2.1 bouyer /*
117 1.4.2.1 bouyer * main.c
118 1.4.2.1 bouyer */
119 1.4.2.1 bouyer BOOL CheckCancel(int progress);
120 1.4.2.1 bouyer extern HWND hDlgMain;
121 1.4.2.1 bouyer
122 1.4.2.1 bouyer /*
123 1.4.2.1 bouyer * layout.c
124 1.4.2.1 bouyer */
125 1.4.2.1 bouyer int CreateMainWindow(HINSTANCE hInstance, HWND hWnd, LPCTSTR name, int cmdbar_height);
126 1.4.2.1 bouyer
127 1.4.2.1 bouyer /*
128 1.4.2.1 bouyer * vmem.c
129 1.4.2.1 bouyer */
130 1.4.2.1 bouyer int vmem_exec(caddr_t entry, int argc, char *argv[], struct bootinfo *bi);
131 1.4.2.1 bouyer caddr_t vmem_get(caddr_t phys_addr, int *length);
132 1.4.2.1 bouyer int vmem_init(caddr_t start, caddr_t end);
133 1.4.2.1 bouyer void vmem_dump_map(void);
134 1.4.2.1 bouyer caddr_t vtophysaddr(caddr_t page);
135 1.4.2.1 bouyer void vmem_free(void);
136 1.4.2.1 bouyer caddr_t vmem_alloc(void);
137 1.4.2.1 bouyer
138 1.4.2.1 bouyer /*
139 1.4.2.1 bouyer * elf.c
140 1.4.2.1 bouyer */
141 1.4.2.1 bouyer int getinfo(int fd, caddr_t *start, caddr_t *end);
142 1.4.2.1 bouyer int loadfile(int fd, caddr_t *entry);
143 1.4.2.1 bouyer
144 1.4.2.1 bouyer /*
145 1.4.2.1 bouyer * mips.c
146 1.4.2.1 bouyer */
147 1.4.2.1 bouyer int mips_boot(caddr_t map);
148 1.4.2.1 bouyer
149 1.4.2.1 bouyer /*
150 1.4.2.1 bouyer * pbsdboot.c
151 1.4.2.1 bouyer */
152 1.4.2.1 bouyer int pbsdboot(TCHAR*, int argc, char *argv[], struct bootinfo *bi);
153 1.4.2.1 bouyer
154 1.4.2.1 bouyer /*
155 1.4.2.1 bouyer * print.c
156 1.4.2.1 bouyer */
157 1.4.2.1 bouyer int debug_printf(LPWSTR lpszFmt, ...);
158 1.4.2.1 bouyer int msg_printf(UINT type, LPWSTR caption, LPWSTR lpszFmt, ...);
159 1.4.2.1 bouyer int stat_printf(LPWSTR lpszFmt, ...);
160 1.4.2.1 bouyer int set_debug_log(TCHAR* path);
161 1.4.2.1 bouyer void close_debug_log(void);
162 1.4.2.1 bouyer
163 1.4.2.1 bouyer
164 1.4.2.1 bouyer #define MSG_ERROR (MB_OK | MB_ICONERROR)
165 1.4.2.1 bouyer #define MSG_INFO (MB_OK | MB_ICONINFORMATION)
166 1.4.2.1 bouyer
167 1.4.2.1 bouyer /*
168 1.4.2.1 bouyer * disptest.c
169 1.4.2.1 bouyer */
170 1.4.2.1 bouyer void hardware_test(void);
171 1.4.2.1 bouyer
172 1.4.2.1 bouyer
173 1.4.2.1 bouyer /*
174 1.4.2.1 bouyer * preference.c
175 1.4.2.1 bouyer */
176 1.4.2.1 bouyer void pref_init(struct preference_s* pref);
177 1.4.2.1 bouyer void pref_dump(struct preference_s* pref);
178 1.4.2.1 bouyer int pref_read(TCHAR* filename, struct preference_s* pref);
179 1.4.2.1 bouyer int pref_load(struct path_s load_path[], int pathlen);
180 1.4.2.1 bouyer int pref_save(struct path_s load_path[], int pathlen);
181 1.4.2.1 bouyer int pref_write(TCHAR* filename, struct preference_s* buf);
182 1.4.2.1 bouyer
183 1.4.2.1 bouyer
184 1.4.2.1 bouyer /*
185 1.4.2.1 bouyer * systeminfo.c
186 1.4.2.1 bouyer */
187 1.4.2.1 bouyer int set_system_info(platid_t* platid);
188 1.4.2.1 bouyer
189 1.4.2.1 bouyer
190 1.4.2.1 bouyer /*
191 1.4.2.1 bouyer * palette.c
192 1.4.2.1 bouyer */
193 1.4.2.1 bouyer enum palette_status { PAL_ERROR, PAL_NOERROR, PAL_SUCCEEDED };
194 1.4.2.1 bouyer extern enum palette_status palette_succeeded;
195 1.4.2.1 bouyer void palette_init(HWND hWnd);
196 1.4.2.1 bouyer void palette_set(HWND hWnd);
197 1.4.2.1 bouyer void palette_check(HWND hWnd);
198 1.4.2.1 bouyer
199 1.4.2.1 bouyer /*
200 1.4.2.1 bouyer * vr41xx.c
201 1.4.2.1 bouyer */
202 1.4.2.1 bouyer void vr41xx_init(SYSTEM_INFO *info);
203 1.4.2.1 bouyer
204 1.4.2.1 bouyer
205 1.4.2.1 bouyer /*
206 1.4.2.1 bouyer * tx39xx.c
207 1.4.2.1 bouyer */
208 1.4.2.1 bouyer void tx39xx_init(SYSTEM_INFO *info);
209