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