Home | History | Annotate | Line # | Download | only in include
bootconfig.h revision 1.1.2.3
      1  1.1.2.3  skrll /*	$NetBSD: bootconfig.h,v 1.1.2.3 2005/11/10 13:57:09 skrll Exp $	*/
      2  1.1.2.2  skrll 
      3  1.1.2.2  skrll /*
      4  1.1.2.2  skrll  * Copyright (c) 2002 Reinoud Zandijk.
      5  1.1.2.2  skrll  * All rights reserved.
      6  1.1.2.2  skrll  *
      7  1.1.2.2  skrll  * Redistribution and use in source and binary forms, with or without
      8  1.1.2.2  skrll  * modification, are permitted provided that the following conditions
      9  1.1.2.2  skrll  * are met:
     10  1.1.2.2  skrll  * 1. Redistributions of source code must retain the above copyright
     11  1.1.2.2  skrll  *    notice, this list of conditions and the following disclaimer.
     12  1.1.2.2  skrll  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1.2.2  skrll  *    notice, this list of conditions and the following disclaimer in the
     14  1.1.2.2  skrll  *    documentation and/or other materials provided with the distribution.
     15  1.1.2.2  skrll  * 3. The name of the company nor the name of the author may be used to
     16  1.1.2.2  skrll  *    endorse or promote products derived from this software without specific
     17  1.1.2.2  skrll  *    prior written permission.
     18  1.1.2.2  skrll  *
     19  1.1.2.2  skrll  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
     20  1.1.2.2  skrll  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     21  1.1.2.2  skrll  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     22  1.1.2.2  skrll  * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
     23  1.1.2.2  skrll  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     24  1.1.2.2  skrll  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     25  1.1.2.2  skrll  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     26  1.1.2.2  skrll  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     27  1.1.2.2  skrll  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     28  1.1.2.2  skrll  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     29  1.1.2.2  skrll  * SUCH DAMAGE.
     30  1.1.2.2  skrll  *
     31  1.1.2.2  skrll  * boot configuration structures
     32  1.1.2.2  skrll  *
     33  1.1.2.2  skrll  */
     34  1.1.2.2  skrll 
     35  1.1.2.2  skrll 
     36  1.1.2.2  skrll /* get some spare blocks ;) */
     37  1.1.2.2  skrll #define DRAM_BLOCKS	32
     38  1.1.2.2  skrll #define VRAM_BLOCKS	16
     39  1.1.2.2  skrll 
     40  1.1.2.2  skrll #define PHYSMEM_TYPE_GENERIC		0
     41  1.1.2.2  skrll #define PHYSMEM_TYPE_PROCESSOR_ONLY	1
     42  1.1.2.2  skrll 
     43  1.1.2.2  skrll 
     44  1.1.2.2  skrll typedef struct {
     45  1.1.2.2  skrll 	u_int address;
     46  1.1.2.2  skrll 	u_int pages;
     47  1.1.2.2  skrll 	u_int flags;
     48  1.1.2.2  skrll } phys_mem;
     49  1.1.2.2  skrll 
     50  1.1.2.2  skrll 
     51  1.1.2.2  skrll struct bootconfig {
     52  1.1.2.2  skrll 	u_int magic;
     53  1.1.2.2  skrll 	u_int version;			/* version 2+ */
     54  1.1.2.2  skrll 
     55  1.1.2.2  skrll 	u_char machine_id[4];		/* unique machine Id */
     56  1.1.2.2  skrll 	char kernelname[80];
     57  1.1.2.2  skrll 	char args[512];			/* 512 bytes is better than 4096 */
     58  1.1.2.2  skrll 
     59  1.1.2.2  skrll 	u_int kernvirtualbase;		/* not used now */
     60  1.1.2.2  skrll 	u_int kernphysicalbase;		/* not used now */
     61  1.1.2.2  skrll 	u_int kernsize;
     62  1.1.2.2  skrll 	u_int scratchvirtualbase;	/* not used now */
     63  1.1.2.2  skrll 	u_int scratchphysicalbase;	/* not used now */
     64  1.1.2.2  skrll 	u_int scratchsize;		/* not used now */
     65  1.1.2.2  skrll 
     66  1.1.2.2  skrll 	u_int ksym_start;
     67  1.1.2.2  skrll 	u_int ksym_end;
     68  1.1.2.2  skrll 
     69  1.1.2.2  skrll 	u_int MDFvirtualbase;		/* not used yet */
     70  1.1.2.2  skrll 	u_int MDFphysicalbase;		/* not used yet */
     71  1.1.2.2  skrll 	u_int MDFsize;			/* not used yet */
     72  1.1.2.2  skrll 
     73  1.1.2.2  skrll 	u_int display_phys;
     74  1.1.2.2  skrll 	u_int display_start;
     75  1.1.2.2  skrll 	u_int display_size;
     76  1.1.2.2  skrll 	u_int width;
     77  1.1.2.2  skrll 	u_int height;
     78  1.1.2.2  skrll 	u_int log2_bpp;
     79  1.1.2.2  skrll 	u_int framerate;
     80  1.1.2.2  skrll 
     81  1.1.2.2  skrll 	char reserved[512];		/* future expansion */
     82  1.1.2.2  skrll 
     83  1.1.2.2  skrll 	u_int pagesize;
     84  1.1.2.2  skrll 	u_int drampages;
     85  1.1.2.2  skrll 	u_int vrampages;
     86  1.1.2.2  skrll 	u_int dramblocks;
     87  1.1.2.2  skrll 	u_int vramblocks;
     88  1.1.2.2  skrll 
     89  1.1.2.2  skrll 	phys_mem dram[DRAM_BLOCKS];
     90  1.1.2.2  skrll 	phys_mem vram[VRAM_BLOCKS];
     91  1.1.2.2  skrll 
     92  1.1.2.2  skrll };
     93  1.1.2.2  skrll 
     94  1.1.2.2  skrll 
     95  1.1.2.2  skrll #define BOOTCONFIG_MAGIC     0x43112233
     96  1.1.2.2  skrll #define BOOTCONFIG_VERSION   	    0x2
     97  1.1.2.2  skrll 
     98  1.1.2.2  skrll extern struct bootconfig bootconfig;
     99  1.1.2.2  skrll 
    100  1.1.2.2  skrll 
    101  1.1.2.2  skrll #ifdef _KERNEL
    102  1.1.2.2  skrll #define BOOTOPT_TYPE_BOOLEAN		0
    103  1.1.2.2  skrll #define BOOTOPT_TYPE_STRING		1
    104  1.1.2.2  skrll #define BOOTOPT_TYPE_INT		2
    105  1.1.2.2  skrll #define BOOTOPT_TYPE_BININT		3
    106  1.1.2.2  skrll #define BOOTOPT_TYPE_HEXINT		4
    107  1.1.2.2  skrll #define BOOTOPT_TYPE_MASK		7
    108  1.1.2.2  skrll 
    109  1.1.2.3  skrll int get_bootconf_option(char *string, const char *option, int type,
    110  1.1.2.3  skrll 	void *result);
    111  1.1.2.2  skrll 
    112  1.1.2.2  skrll extern char *boot_args;
    113  1.1.2.2  skrll extern char *boot_file;
    114  1.1.2.2  skrll #endif	/* _KERNEL */
    115  1.1.2.2  skrll 
    116  1.1.2.2  skrll 
    117  1.1.2.2  skrll /* End of bootconfig.h */
    118