11.12Spgoyette/* $NetBSD: bootinfo.h,v 1.12 2018/01/27 22:25:23 pgoyette 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 * 161.1Sdrochner * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 171.1Sdrochner * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 181.1Sdrochner * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 191.1Sdrochner * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 201.1Sdrochner * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 211.1Sdrochner * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 221.1Sdrochner * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 231.1Sdrochner * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 241.1Sdrochner * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 251.1Sdrochner * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 261.1Sdrochner * 271.1Sdrochner */ 281.1Sdrochner 291.1Sdrochner#include <machine/bootinfo.h> 301.1Sdrochner 311.1Sdrochnerstruct bootinfo { 321.10Sjakllsch uint32_t nentries; 331.10Sjakllsch uint32_t entry[1]; 341.1Sdrochner}; 351.1Sdrochner 361.1Sdrochnerextern struct bootinfo *bootinfo; 371.1Sdrochner 381.12Spgoyette#define BTINFO_MAX 64 391.11Smaxv 401.1Sdrochner#define BI_ALLOC(max) (bootinfo = alloc(sizeof(struct bootinfo) \ 411.10Sjakllsch + ((max) - 1) * sizeof(uint32_t))) \ 421.1Sdrochner ->nentries = 0 431.1Sdrochner 441.9Schristos#define BI_FREE() dealloc(bootinfo, 0) 451.1Sdrochner 461.7Sjunyoung#define BI_ADD(x, type, size) bi_add((struct btinfo_common *)(x), type, size) 471.1Sdrochner 481.7Sjunyoungvoid bi_add(struct btinfo_common *, int, int); 491.7Sjunyoungvoid bi_getbiosgeom(void); 501.7Sjunyoungvoid bi_getmemmap(void); 51