bootinfo.h revision 1.1
11.1Sdrochner/*	$NetBSD: bootinfo.h,v 1.1 1997/09/17 17:39:30 drochner Exp $	*/
21.1Sdrochner
31.1Sdrochner/*
41.1Sdrochner * Copyright (c) 1997
51.1Sdrochner *	Matthias Drochner.  All rights reserved.
61.1Sdrochner *
71.1Sdrochner * Redistribution and use in source and binary forms, with or without
81.1Sdrochner * modification, are permitted provided that the following conditions
91.1Sdrochner * are met:
101.1Sdrochner * 1. Redistributions of source code must retain the above copyright
111.1Sdrochner *    notice, this list of conditions and the following disclaimer.
121.1Sdrochner * 2. Redistributions in binary form must reproduce the above copyright
131.1Sdrochner *    notice, this list of conditions and the following disclaimer in the
141.1Sdrochner *    documentation and/or other materials provided with the distribution.
151.1Sdrochner * 3. All advertising materials mentioning features or use of this software
161.1Sdrochner *    must display the following acknowledgement:
171.1Sdrochner *	This product includes software developed for the NetBSD Project
181.1Sdrochner *	by Matthias Drochner.
191.1Sdrochner * 4. The name of the author may not be used to endorse or promote products
201.1Sdrochner *    derived from this software without specific prior written permission.
211.1Sdrochner *
221.1Sdrochner * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
231.1Sdrochner * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
241.1Sdrochner * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
251.1Sdrochner * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
261.1Sdrochner * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
271.1Sdrochner * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
281.1Sdrochner * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
291.1Sdrochner * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
301.1Sdrochner * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
311.1Sdrochner * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
321.1Sdrochner *
331.1Sdrochner */
341.1Sdrochner
351.1Sdrochner#ifdef notyet
361.1Sdrochner#include <machine/bootinfo.h>
371.1Sdrochner#else
381.1Sdrochnerstruct btinfo_common {
391.1Sdrochner	int len;
401.1Sdrochner	int type;
411.1Sdrochner};
421.1Sdrochner
431.1Sdrochner#define BTINFO_BOOTPATH 0
441.1Sdrochner#define BTINFO_BOOTDISK 3
451.1Sdrochner#define BTINFO_NETIF 4
461.1Sdrochner#define BTINFO_CONSOLE 6
471.1Sdrochner#define BTINFO_BIOSGEOM 7
481.1Sdrochner
491.1Sdrochnerstruct btinfo_bootpath {
501.1Sdrochner	struct btinfo_common common;
511.1Sdrochner	char bootpath[80];
521.1Sdrochner};
531.1Sdrochner
541.1Sdrochnerstruct btinfo_bootdisk {
551.1Sdrochner	struct btinfo_common common;
561.1Sdrochner	int labelsector; /* label valid if != -1 */
571.1Sdrochner	struct {
581.1Sdrochner		u_int16_t type, checksum;
591.1Sdrochner		char packname[16];
601.1Sdrochner	} label;
611.1Sdrochner	int biosdev;
621.1Sdrochner	int partition;
631.1Sdrochner};
641.1Sdrochner
651.1Sdrochnerstruct btinfo_netif {
661.1Sdrochner	struct btinfo_common common;
671.1Sdrochner	char ifname[16];
681.1Sdrochner	int bus, addr;
691.1Sdrochner#define BI_BUS_ISA 0
701.1Sdrochner#define BI_BUS_PCI 1
711.1Sdrochner	char hw_addr[6];
721.1Sdrochner	char dummy[2]; /* align */
731.1Sdrochner};
741.1Sdrochner
751.1Sdrochnerstruct btinfo_console {
761.1Sdrochner	struct btinfo_common common;
771.1Sdrochner	char devname[16];
781.1Sdrochner	int addr;
791.1Sdrochner	int speed;
801.1Sdrochner};
811.1Sdrochner
821.1Sdrochner#include <machine/disklabel.h>
831.1Sdrochner
841.1Sdrochnerstruct bi_biosgeom_entry {
851.1Sdrochner	int spc, spt;
861.1Sdrochner	struct dos_partition dosparts[NDOSPART];
871.1Sdrochner};
881.1Sdrochner
891.1Sdrochnerstruct btinfo_biosgeom {
901.1Sdrochner	struct btinfo_common common;
911.1Sdrochner	int num;
921.1Sdrochner	struct bi_biosgeom_entry disk[1]; /* var len */
931.1Sdrochner};
941.1Sdrochner#endif /* notyet */
951.1Sdrochner
961.1Sdrochnerstruct bootinfo {
971.1Sdrochner	int nentries;
981.1Sdrochner	physaddr_t entry[1];
991.1Sdrochner};
1001.1Sdrochner
1011.1Sdrochnerextern struct bootinfo *bootinfo;
1021.1Sdrochner
1031.1Sdrochner#define BI_ALLOC(max) (bootinfo = alloc(sizeof(struct bootinfo) \
1041.1Sdrochner                                        + ((max) - 1) * sizeof(physaddr_t))) \
1051.1Sdrochner                      ->nentries = 0
1061.1Sdrochner
1071.1Sdrochner#define BI_FREE() free(bootinfo, 0)
1081.1Sdrochner
1091.1Sdrochner#define BI_ADD(x, type, size) bi_add((struct btinfo_common*)(x), type, size)
1101.1Sdrochner
1111.1Sdrochnervoid bi_add __P((struct btinfo_common*, int, int));
1121.1Sdrochnervoid bi_getbiosgeom __P((void));
113