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