1*84d9c625SLionel Sambuc /* $NetBSD: bootinfo.h,v 1.10 2013/11/18 03:52:45 jakllsch Exp $ */ 258a2b000SEvgeniy Ivanov 358a2b000SEvgeniy Ivanov /* 458a2b000SEvgeniy Ivanov * Copyright (c) 1997 558a2b000SEvgeniy Ivanov * Matthias Drochner. All rights reserved. 658a2b000SEvgeniy Ivanov * 758a2b000SEvgeniy Ivanov * Redistribution and use in source and binary forms, with or without 858a2b000SEvgeniy Ivanov * modification, are permitted provided that the following conditions 958a2b000SEvgeniy Ivanov * are met: 1058a2b000SEvgeniy Ivanov * 1. Redistributions of source code must retain the above copyright 1158a2b000SEvgeniy Ivanov * notice, this list of conditions and the following disclaimer. 1258a2b000SEvgeniy Ivanov * 2. Redistributions in binary form must reproduce the above copyright 1358a2b000SEvgeniy Ivanov * notice, this list of conditions and the following disclaimer in the 1458a2b000SEvgeniy Ivanov * documentation and/or other materials provided with the distribution. 1558a2b000SEvgeniy Ivanov * 1658a2b000SEvgeniy Ivanov * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1758a2b000SEvgeniy Ivanov * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1858a2b000SEvgeniy Ivanov * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1958a2b000SEvgeniy Ivanov * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 2058a2b000SEvgeniy Ivanov * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2158a2b000SEvgeniy Ivanov * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2258a2b000SEvgeniy Ivanov * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2358a2b000SEvgeniy Ivanov * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2458a2b000SEvgeniy Ivanov * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 2558a2b000SEvgeniy Ivanov * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2658a2b000SEvgeniy Ivanov * 2758a2b000SEvgeniy Ivanov */ 2858a2b000SEvgeniy Ivanov 2958a2b000SEvgeniy Ivanov #include <machine/bootinfo.h> 3058a2b000SEvgeniy Ivanov 3158a2b000SEvgeniy Ivanov struct bootinfo { 32*84d9c625SLionel Sambuc uint32_t nentries; 33*84d9c625SLionel Sambuc uint32_t entry[1]; 3458a2b000SEvgeniy Ivanov }; 3558a2b000SEvgeniy Ivanov 3658a2b000SEvgeniy Ivanov extern struct bootinfo *bootinfo; 3758a2b000SEvgeniy Ivanov 3858a2b000SEvgeniy Ivanov #define BI_ALLOC(max) (bootinfo = alloc(sizeof(struct bootinfo) \ 39*84d9c625SLionel Sambuc + ((max) - 1) * sizeof(uint32_t))) \ 4058a2b000SEvgeniy Ivanov ->nentries = 0 4158a2b000SEvgeniy Ivanov 4258a2b000SEvgeniy Ivanov #define BI_FREE() dealloc(bootinfo, 0) 4358a2b000SEvgeniy Ivanov 4458a2b000SEvgeniy Ivanov #define BI_ADD(x, type, size) bi_add((struct btinfo_common *)(x), type, size) 4558a2b000SEvgeniy Ivanov 4658a2b000SEvgeniy Ivanov void bi_add(struct btinfo_common *, int, int); 4758a2b000SEvgeniy Ivanov void bi_getbiosgeom(void); 4858a2b000SEvgeniy Ivanov void bi_getmemmap(void); 49