1 /* $NetBSD: tosdefs.h,v 1.4 2008/04/28 20:23:15 martin Exp $ */ 2 3 /*- 4 * Copyright (c) 1998 The NetBSD Foundation, Inc. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to The NetBSD Foundation 8 * by Leo Weppelman. 9 * 10 * Redistribution and use in source and binary forms, with or without 11 * modification, are permitted provided that the following conditions 12 * are met: 13 * 1. Redistributions of source code must retain the above copyright 14 * notice, this list of conditions and the following disclaimer. 15 * 2. Redistributions in binary form must reproduce the above copyright 16 * notice, this list of conditions and the following disclaimer in the 17 * documentation and/or other materials provided with the distribution. 18 * 19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32 #ifndef _LIBTOS_TOSDEFS_H 33 #define _LIBTOS_TOSDEFS_H 34 35 #include <sys/types.h> 36 37 38 #include "kparamb.h" 39 40 /* 41 * TOS variables in low memory 42 */ 43 struct _gem_mupb; 44 struct _basepage; 45 struct _osheader { 46 u_int16_t os_entry; 47 u_int16_t os_version; 48 void *reseth; 49 struct _osheader *os_beg; 50 void *os_end; 51 u_int32_t os_rsv1; 52 struct _gem_mupb *os_magic; 53 u_int32_t os_date; 54 u_int16_t os_conf; 55 u_int16_t os_dosdate; 56 char **p_root; 57 u_int8_t **pkbshift; 58 struct _basepage **p_run; 59 char *p_rsv2; 60 }; 61 62 typedef struct _osheader OSH; 63 64 #define ADDR_P_COOKIE ((long**)0x5a0) /* Pointer to cookie jar */ 65 #define ADDR_OSHEAD ((OSH**)0x4f2) /* Pointer Os-header */ 66 #define ADDR_PHYSTOP ((long*)0x42e) /* End of ST-ram */ 67 #define ADDR_RAMTOP ((long*)0x5a4) /* End of TT-ram (unofficial) */ 68 #define ADDR_CHKRAMTOP ((long*)0x5a8) /* above is valid (unofficial) */ 69 70 #define RAMTOP_MAGIC (0x1357bd13) /* Magic no. for ADDR_CHKRAMTOP */ 71 72 #define TTRAM_BASE (0x1000000) /* Fastram always starts here */ 73 #define CTRAM_BASE (0x4000000) /* ... except on CT2 boards: */ 74 /* Logical : TTRAM_BASE */ 75 /* Physical: CTRAM_BASE */ 76 77 /* 78 * Kernel parameter block 79 */ 80 typedef struct osdsc { 81 const char * ostype; 82 const char * osname; 83 unsigned rootfs; 84 struct kparamb kp; 85 } osdsc_t; 86 87 #define ksize kp.ksize 88 #define kstart kp.kp 89 #define kentry kp.entry 90 #define k_esym kp.esym_loc 91 #define stmem_size kp.stmem_size 92 #define ttmem_size kp.ttmem_size 93 #define ttmem_start kp.ttmem_start 94 #define cputype kp.bootflags 95 #define boothowto kp.boothowto 96 97 #endif /* !_LIBTOS_TOSDEFS_H */ 98