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