autoconf.h revision 1.23 1 1.23 matt /* $NetBSD: autoconf.h,v 1.23 2012/02/06 02:14:13 matt Exp $ */
2 1.1 cgd
3 1.1 cgd /*
4 1.4 cgd * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
5 1.1 cgd * All rights reserved.
6 1.1 cgd *
7 1.1 cgd * Author: Chris G. Demetriou
8 1.23 matt *
9 1.1 cgd * Permission to use, copy, modify and distribute this software and
10 1.1 cgd * its documentation is hereby granted, provided that both the copyright
11 1.1 cgd * notice and this permission notice appear in all copies of the
12 1.1 cgd * software, derivative works or modified versions, and any portions
13 1.1 cgd * thereof, and that both notices appear in supporting documentation.
14 1.23 matt *
15 1.23 matt * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16 1.23 matt * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17 1.1 cgd * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18 1.23 matt *
19 1.1 cgd * Carnegie Mellon requests users of this software to return to
20 1.1 cgd *
21 1.1 cgd * Software Distribution Coordinator or Software.Distribution (at) CS.CMU.EDU
22 1.1 cgd * School of Computer Science
23 1.1 cgd * Carnegie Mellon University
24 1.1 cgd * Pittsburgh PA 15213-3890
25 1.1 cgd *
26 1.1 cgd * any improvements or extensions that they make and grant Carnegie the
27 1.1 cgd * rights to redistribute these changes.
28 1.1 cgd */
29 1.1 cgd
30 1.1 cgd /*
31 1.20 simonb * Machine-dependent structures for autoconfiguration
32 1.1 cgd */
33 1.1 cgd
34 1.16 thorpej struct mainbus_attach_args {
35 1.16 thorpej const char *ma_name; /* device name */
36 1.16 thorpej int ma_slot; /* CPU "slot" number; only meaningful
37 1.16 thorpej when attaching CPUs */
38 1.1 cgd };
39 1.1 cgd
40 1.3 cgd struct bootdev_data {
41 1.3 cgd char *protocol;
42 1.3 cgd int bus;
43 1.3 cgd int slot;
44 1.3 cgd int channel;
45 1.3 cgd char *remote_address;
46 1.3 cgd int unit;
47 1.3 cgd int boot_dev_type;
48 1.3 cgd char *ctrl_dev_type;
49 1.3 cgd };
50 1.3 cgd
51 1.8 thorpej /*
52 1.11 cgd * The boot program passes a pointer (in the boot environment virtual
53 1.11 cgd * address address space; "BEVA") to a bootinfo to the kernel using
54 1.11 cgd * the following convention:
55 1.8 thorpej *
56 1.8 thorpej * a0 contains first free page frame number
57 1.8 thorpej * a1 contains page number of current level 1 page table
58 1.12 cgd * if a2 contains BOOTINFO_MAGIC and a4 is nonzero:
59 1.11 cgd * a3 contains pointer (BEVA) to bootinfo
60 1.12 cgd * a4 contains bootinfo version number
61 1.12 cgd * if a2 contains BOOTINFO_MAGIC and a4 contains 0 (backward compat):
62 1.12 cgd * a3 contains pointer (BEVA) to bootinfo version
63 1.12 cgd * (u_long), then the bootinfo
64 1.8 thorpej */
65 1.8 thorpej
66 1.12 cgd #define BOOTINFO_MAGIC 0xdeadbeeffeedface
67 1.8 thorpej
68 1.8 thorpej struct bootinfo_v1 {
69 1.9 cgd u_long ssym; /* 0: start of kernel sym table */
70 1.9 cgd u_long esym; /* 8: end of kernel sym table */
71 1.9 cgd char boot_flags[64]; /* 16: boot flags */
72 1.9 cgd char booted_kernel[64]; /* 80: name of booted kernel */
73 1.11 cgd void *hwrpb; /* 144: hwrpb pointer (BEVA) */
74 1.11 cgd u_long hwrpbsize; /* 152: size of hwrpb data */
75 1.19 thorpej int (*cngetc)(void); /* 160: console getc pointer */
76 1.19 thorpej void (*cnputc)(int); /* 168: console putc pointer */
77 1.19 thorpej void (*cnpollc)(int); /* 176: console pollc pointer */
78 1.12 cgd u_long pad[9]; /* 184: rsvd for future use */
79 1.12 cgd /* 256: total size */
80 1.8 thorpej };
81 1.8 thorpej
82 1.12 cgd /*
83 1.12 cgd * Kernel-internal structure used to hold important bits of boot
84 1.12 cgd * information. NOT to be used by boot blocks.
85 1.12 cgd *
86 1.12 cgd * Note that not all of the fields from the bootinfo struct(s)
87 1.12 cgd * passed by the boot blocks aren't here (because they're not currently
88 1.12 cgd * used by the kernel!). Fields here which aren't supplied by the
89 1.12 cgd * bootinfo structure passed by the boot blocks are supposed to be
90 1.12 cgd * filled in at startup with sane contents.
91 1.12 cgd */
92 1.12 cgd struct bootinfo_kernel {
93 1.12 cgd u_long ssym; /* start of syms */
94 1.12 cgd u_long esym; /* end of syms */
95 1.14 cgd u_long hwrpb_phys; /* hwrpb physical address */
96 1.14 cgd u_long hwrpb_size; /* size of hwrpb data */
97 1.12 cgd char boot_flags[64]; /* boot flags */
98 1.12 cgd char booted_kernel[64]; /* name of booted kernel */
99 1.12 cgd char booted_dev[64]; /* name of booted device */
100 1.8 thorpej };
101 1.13 thorpej
102 1.13 thorpej /*
103 1.13 thorpej * Lookup table entry for Alpha system variations.
104 1.13 thorpej */
105 1.13 thorpej struct alpha_variation_table {
106 1.23 matt uint64_t avt_variation; /* variation, from HWRPB */
107 1.13 thorpej const char *avt_model; /* model string */
108 1.13 thorpej };
109 1.13 thorpej
110 1.13 thorpej #ifdef _KERNEL
111 1.3 cgd extern struct bootdev_data *bootdev_data;
112 1.12 cgd extern struct bootinfo_kernel bootinfo;
113 1.13 thorpej
114 1.23 matt const char *alpha_variation_name(uint64_t,
115 1.19 thorpej const struct alpha_variation_table *);
116 1.19 thorpej const char *alpha_unknown_sysname(void);
117 1.13 thorpej #endif /* _KERNEL */
118