xref: /openbsd/sys/arch/i386/stand/libsa/libsa.h (revision a4f11372)
1*a4f11372Smiod /*	$OpenBSD: libsa.h,v 1.47 2023/02/23 19:48:22 miod Exp $	*/
2df1f5d3aSweingart 
3df1f5d3aSweingart /*
4857b0937Smickey  * Copyright (c) 1996-1999 Michael Shalayeff
5df1f5d3aSweingart  * All rights reserved.
6df1f5d3aSweingart  *
7df1f5d3aSweingart  * Redistribution and use in source and binary forms, with or without
8df1f5d3aSweingart  * modification, are permitted provided that the following conditions
9df1f5d3aSweingart  * are met:
10df1f5d3aSweingart  * 1. Redistributions of source code must retain the above copyright
11df1f5d3aSweingart  *    notice, this list of conditions and the following disclaimer.
12df1f5d3aSweingart  * 2. Redistributions in binary form must reproduce the above copyright
13df1f5d3aSweingart  *    notice, this list of conditions and the following disclaimer in the
14df1f5d3aSweingart  *    documentation and/or other materials provided with the distribution.
15df1f5d3aSweingart  *
16df1f5d3aSweingart  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17857b0937Smickey  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18857b0937Smickey  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19857b0937Smickey  * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
20857b0937Smickey  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21857b0937Smickey  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22857b0937Smickey  * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23857b0937Smickey  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
24857b0937Smickey  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
25857b0937Smickey  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
26857b0937Smickey  * THE POSSIBILITY OF SUCH DAMAGE.
27df1f5d3aSweingart  */
28df1f5d3aSweingart 
291b039fc9Smickey #include <lib/libsa/stand.h>
3005cdd021Sweingart #include <machine/biosvar.h>
31df1f5d3aSweingart 
32d95e68c6Sdrahn #define	EXEC_ELF
3353fcb3f9Smickey 
34ef7aef7bStom struct i386_boot_probes {
35ef7aef7bStom 	char *name;
36ef7aef7bStom 	void (**probes)(void);
37ef7aef7bStom 	int count;
38ef7aef7bStom };
39ef7aef7bStom 
40ef7aef7bStom extern void (*sa_cleanup)(void);
41ef7aef7bStom 
42c4071fd1Smillert void gateA20(int);
43ef7aef7bStom void gateA20on(void);
4405cdd021Sweingart 
45e767ea5cStom void cpuprobe(void);
46c4071fd1Smillert void smpprobe(void);
47ef7aef7bStom void ps2probe(void);
48c4071fd1Smillert void pciprobe(void);
49c4071fd1Smillert void memprobe(void);
50c4071fd1Smillert void diskprobe(void);
51285601acStom void cdprobe(void);
52c4071fd1Smillert void apmprobe(void);
53055d6d0dSweingart void apmfixmem(void);
54c4071fd1Smillert void dump_biosmem(bios_memmap_t *);
554a9e4d17Smpf int mem_add(long long, long long);
564a9e4d17Smpf int mem_delete(long long, long long);
572ea094c9Sweingart int mem_limit(long long);
58c4071fd1Smillert void mem_pass(void);
5905cdd021Sweingart 
6055f8664cSderaadt int pslid(void);
6155f8664cSderaadt 
62c4071fd1Smillert void devboot(dev_t, char *);
63c4071fd1Smillert void machdep(void);
64df1f5d3aSweingart 
65055d6d0dSweingart void *getSYSCONFaddr(void);
66055d6d0dSweingart void *getEBDAaddr(void);
67055d6d0dSweingart 
6841a5b770Smickey extern const char bdevs[][4];
6941a5b770Smickey extern const int nbdevs;
7003b324a0Smickey extern u_int cnvmem, extmem; /* XXX global pass memprobe()->machdep_start() */
715adc64b9Smickey extern int ps2model;
72deaa2fceSmickey 
73ef7aef7bStom extern struct i386_boot_probes probe_list[];
74ef7aef7bStom extern int nibprobes;
75ef7aef7bStom extern void (*devboot_p)(dev_t, char *);
76ef7aef7bStom 
77b9a05c75Smickey /* diskprobe.c */
78b9a05c75Smickey extern bios_diskinfo_t bios_diskinfo[];
797f850a97Smickey extern u_int32_t bios_cksumlen;
80b9a05c75Smickey 
814da98914Stom #define MACHINE_CMD	cmd_machine /* we have i386-specific commands */
827f20cbb1Stom 
837f20cbb1Stom #define CHECK_SKIP_CONF	check_skip_conf	/* we can skip boot.conf with Ctrl */
84