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