xref: /netbsd-src/sys/arch/i386/stand/lib/bootinfo.h (revision 6ecfb3c540d1327719577bb4f6bdf4b4a1eb9b43)
1*6ecfb3c5Spgoyette /*	$NetBSD: bootinfo.h,v 1.12 2018/01/27 22:25:23 pgoyette Exp $	*/
2f7b795d3Sdrochner 
3f7b795d3Sdrochner /*
4f7b795d3Sdrochner  * Copyright (c) 1997
5f7b795d3Sdrochner  *	Matthias Drochner.  All rights reserved.
6f7b795d3Sdrochner  *
7f7b795d3Sdrochner  * Redistribution and use in source and binary forms, with or without
8f7b795d3Sdrochner  * modification, are permitted provided that the following conditions
9f7b795d3Sdrochner  * are met:
10f7b795d3Sdrochner  * 1. Redistributions of source code must retain the above copyright
11f7b795d3Sdrochner  *    notice, this list of conditions and the following disclaimer.
12f7b795d3Sdrochner  * 2. Redistributions in binary form must reproduce the above copyright
13f7b795d3Sdrochner  *    notice, this list of conditions and the following disclaimer in the
14f7b795d3Sdrochner  *    documentation and/or other materials provided with the distribution.
15f7b795d3Sdrochner  *
16f7b795d3Sdrochner  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17f7b795d3Sdrochner  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18f7b795d3Sdrochner  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19f7b795d3Sdrochner  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20f7b795d3Sdrochner  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21f7b795d3Sdrochner  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22f7b795d3Sdrochner  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23f7b795d3Sdrochner  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24f7b795d3Sdrochner  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25f7b795d3Sdrochner  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26f7b795d3Sdrochner  *
27f7b795d3Sdrochner  */
28f7b795d3Sdrochner 
29f7b795d3Sdrochner #include <machine/bootinfo.h>
30f7b795d3Sdrochner 
31f7b795d3Sdrochner struct bootinfo {
32aa37094dSjakllsch 	uint32_t nentries;
33aa37094dSjakllsch 	uint32_t entry[1];
34f7b795d3Sdrochner };
35f7b795d3Sdrochner 
36f7b795d3Sdrochner extern struct bootinfo *bootinfo;
37f7b795d3Sdrochner 
38*6ecfb3c5Spgoyette #define BTINFO_MAX	64
397759a958Smaxv 
40f7b795d3Sdrochner #define BI_ALLOC(max) (bootinfo = alloc(sizeof(struct bootinfo) \
41aa37094dSjakllsch                                         + ((max) - 1) * sizeof(uint32_t))) \
42f7b795d3Sdrochner                       ->nentries = 0
43f7b795d3Sdrochner 
44606bb2caSchristos #define BI_FREE() dealloc(bootinfo, 0)
45f7b795d3Sdrochner 
46f7b795d3Sdrochner #define BI_ADD(x, type, size) bi_add((struct btinfo_common *)(x), type, size)
47f7b795d3Sdrochner 
484a6d3256Sjunyoung void bi_add(struct btinfo_common *, int, int);
494a6d3256Sjunyoung void bi_getbiosgeom(void);
504a6d3256Sjunyoung void bi_getmemmap(void);
51