Home | History | Annotate | Line # | Download | only in include
bootconfig.h revision 1.3
      1  1.3  reinoud /*	$NetBSD: bootconfig.h,v 1.3 2002/02/11 18:47:37 reinoud Exp $	*/
      2  1.1  reinoud 
      3  1.1  reinoud /*
      4  1.3  reinoud  * Copyright (c) 2002 Reinoud Zandijk.
      5  1.1  reinoud  * Copyright (c) 1994 Mark Brinicombe.
      6  1.1  reinoud  * Copyright (c) 1994 Brini.
      7  1.1  reinoud  * All rights reserved.
      8  1.1  reinoud  *
      9  1.1  reinoud  * This code is derived from software written for Brini by Mark Brinicombe
     10  1.1  reinoud  *
     11  1.1  reinoud  * Redistribution and use in source and binary forms, with or without
     12  1.1  reinoud  * modification, are permitted provided that the following conditions
     13  1.1  reinoud  * are met:
     14  1.1  reinoud  * 1. Redistributions of source code must retain the above copyright
     15  1.1  reinoud  *    notice, this list of conditions and the following disclaimer.
     16  1.1  reinoud  * 2. Redistributions in binary form must reproduce the above copyright
     17  1.1  reinoud  *    notice, this list of conditions and the following disclaimer in the
     18  1.1  reinoud  *    documentation and/or other materials provided with the distribution.
     19  1.1  reinoud  * 3. All advertising materials mentioning features or use of this software
     20  1.1  reinoud  *    must display the following acknowledgement:
     21  1.1  reinoud  *	This product includes software developed by Mark Brinicombe
     22  1.1  reinoud  *	for the NetBSD Project.
     23  1.1  reinoud  * 4. The name of the company nor the name of the author may be used to
     24  1.1  reinoud  *    endorse or promote products derived from this software without specific
     25  1.1  reinoud  *    prior written permission.
     26  1.1  reinoud  *
     27  1.1  reinoud  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
     28  1.1  reinoud  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     29  1.1  reinoud  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     30  1.1  reinoud  * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
     31  1.1  reinoud  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     32  1.1  reinoud  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     33  1.1  reinoud  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     34  1.1  reinoud  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     35  1.1  reinoud  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     36  1.1  reinoud  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     37  1.1  reinoud  * SUCH DAMAGE.
     38  1.1  reinoud  *
     39  1.1  reinoud  * boot configuration structures
     40  1.1  reinoud  *
     41  1.1  reinoud  */
     42  1.1  reinoud 
     43  1.3  reinoud #if defined(_KERNEL)
     44  1.3  reinoud 
     45  1.3  reinoud 
     46  1.3  reinoud /* get some spare blocks ;) */
     47  1.3  reinoud #define DRAM_BLOCKS	32
     48  1.3  reinoud #define VRAM_BLOCKS	16
     49  1.3  reinoud 
     50  1.3  reinoud 
     51  1.3  reinoud typedef struct {
     52  1.1  reinoud 	u_int address;
     53  1.1  reinoud 	u_int pages;
     54  1.3  reinoud 	u_int flags;
     55  1.3  reinoud } phys_mem;
     56  1.1  reinoud 
     57  1.1  reinoud 
     58  1.1  reinoud typedef struct _BootConfig {
     59  1.3  reinoud 	u_int magic;
     60  1.3  reinoud 	u_int version;			/* version 2+ */
     61  1.3  reinoud 
     62  1.3  reinoud 	u_char machine_id[4];
     63  1.3  reinoud 	char kernelname[80];
     64  1.3  reinoud 	char args[512];			/* 512 bytes is better than 4096 */
     65  1.3  reinoud 
     66  1.3  reinoud 	u_int kernvirtualbase;		/* not used now */
     67  1.3  reinoud 	u_int kernphysicalbase;		/* not used now */
     68  1.3  reinoud 	u_int kernsize;
     69  1.3  reinoud 	u_int scratchvirtualbase;
     70  1.3  reinoud 	u_int scratchphysicalbase;
     71  1.3  reinoud 	u_int scratchsize;
     72  1.3  reinoud 
     73  1.3  reinoud 	u_int ksym_start;
     74  1.3  reinoud 	u_int ksym_end;
     75  1.3  reinoud 
     76  1.3  reinoud 	u_int MDFvirtualbase;		/* not used yet */
     77  1.3  reinoud 	u_int MDFphysicalbase;		/* not used yet */
     78  1.3  reinoud 	u_int MDFsize;			/* not used yet */
     79  1.3  reinoud 
     80  1.3  reinoud 	u_int display_phys;
     81  1.3  reinoud 	u_int display_start;
     82  1.3  reinoud 	u_int display_size;
     83  1.3  reinoud 	u_int width;
     84  1.3  reinoud 	u_int height;
     85  1.3  reinoud 	u_int log2_bpp;
     86  1.3  reinoud 	u_int framerate;
     87  1.3  reinoud 
     88  1.3  reinoud 	char reserved[512];		/* future expansion */
     89  1.3  reinoud 
     90  1.3  reinoud 	u_int pagesize;
     91  1.3  reinoud 	u_int drampages;
     92  1.3  reinoud 	u_int vrampages;
     93  1.3  reinoud 	u_int dramblocks;
     94  1.3  reinoud 	u_int vramblocks;
     95  1.3  reinoud 
     96  1.3  reinoud 	phys_mem dram[DRAM_BLOCKS];
     97  1.3  reinoud 	phys_mem vram[VRAM_BLOCKS];
     98  1.3  reinoud 
     99  1.3  reinoud } BootConfig;
    100  1.3  reinoud 
    101  1.3  reinoud 
    102  1.3  reinoud /************ compat stuff ************/
    103  1.3  reinoud 
    104  1.3  reinoud typedef struct {
    105  1.3  reinoud 	u_int address;
    106  1.3  reinoud 	u_int pages;
    107  1.3  reinoud } phys_mem_v1;
    108  1.3  reinoud 
    109  1.3  reinoud 
    110  1.3  reinoud typedef struct {
    111  1.1  reinoud 	u_int kernvirtualbase;
    112  1.1  reinoud 	u_int kernphysicalbase;
    113  1.1  reinoud 	u_int kernsize;
    114  1.1  reinoud 	u_int argvirtualbase;
    115  1.1  reinoud 	u_int argphysicalbase;
    116  1.1  reinoud 	u_int argsize;
    117  1.1  reinoud 	u_int scratchvirtualbase;
    118  1.1  reinoud 	u_int scratchphysicalbase;
    119  1.1  reinoud 	u_int scratchsize;
    120  1.1  reinoud 
    121  1.1  reinoud 	u_int display_start;
    122  1.1  reinoud 	u_int display_size;
    123  1.1  reinoud 	u_int width;
    124  1.1  reinoud 	u_int height;
    125  1.1  reinoud 	u_int log2_bpp;
    126  1.1  reinoud 
    127  1.3  reinoud 	phys_mem_v1 dram[4];
    128  1.3  reinoud 	phys_mem_v1 vram[1];
    129  1.1  reinoud 
    130  1.1  reinoud 	u_int dramblocks;
    131  1.1  reinoud 	u_int vramblocks;
    132  1.1  reinoud 	u_int pagesize;
    133  1.1  reinoud 	u_int drampages;
    134  1.1  reinoud 	u_int vrampages;
    135  1.1  reinoud 
    136  1.1  reinoud 	char kernelname[80];
    137  1.1  reinoud 
    138  1.1  reinoud 	u_int framerate;
    139  1.1  reinoud 	u_char machine_id[4];
    140  1.1  reinoud 	u_int magic;
    141  1.1  reinoud 	u_int display_phys;
    142  1.3  reinoud } BootConfig_v1;
    143  1.3  reinoud 
    144  1.3  reinoud /************ end compat stuff ***********/
    145  1.1  reinoud 
    146  1.1  reinoud #define BOOTCONFIG_MAGIC     0x43112233
    147  1.3  reinoud #define BOOTCONFIG_VERSION   	    0x2
    148  1.1  reinoud 
    149  1.1  reinoud extern BootConfig bootconfig;
    150  1.1  reinoud #endif	/* _KERNEL */
    151  1.1  reinoud 
    152  1.1  reinoud 
    153  1.1  reinoud #ifdef _KERNEL
    154  1.1  reinoud #define BOOTOPT_TYPE_BOOLEAN		0
    155  1.1  reinoud #define BOOTOPT_TYPE_STRING		1
    156  1.1  reinoud #define BOOTOPT_TYPE_INT		2
    157  1.1  reinoud #define BOOTOPT_TYPE_BININT		3
    158  1.1  reinoud #define BOOTOPT_TYPE_HEXINT		4
    159  1.1  reinoud #define BOOTOPT_TYPE_MASK		7
    160  1.1  reinoud 
    161  1.1  reinoud int get_bootconf_option __P((char *string, char *option, int type, void *result));
    162  1.1  reinoud 
    163  1.1  reinoud extern char *boot_args;
    164  1.1  reinoud extern char *boot_file;
    165  1.1  reinoud #endif	/* _KERNEL */
    166  1.3  reinoud 
    167  1.1  reinoud 
    168  1.1  reinoud /* End of bootconfig.h */
    169