xref: /netbsd/sys/arch/pmax/pmax/sysconf.c (revision bf9ec67e)
1 /*	$NetBSD: sysconf.c,v 1.7 2000/01/10 03:24:41 simonb Exp $	*/
2 
3 /*
4  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  * 3. All advertising materials mentioning features or use of this software
15  *    must display the following acknowledgement:
16  *      This product includes software developed by Christopher G. Demetriou
17  *	for the NetBSD Project.
18  * 4. The name of the author may not be used to endorse or promote products
19  *    derived from this software without specific prior written permission
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #include <sys/param.h>
34 #include <sys/systm.h>
35 #include <machine/sysconf.h>
36 #include <pmax/pmax/pmaxtype.h>
37 
38 
39 #include "opt_dec_3100.h"
40 #ifdef DEC_3100
41   void	dec_3100_init __P((void));
42 #else
43 # define dec_3100_init		platform_not_configured
44 #endif
45 
46 #include "opt_dec_3max.h"
47 #ifdef DEC_3MAX
48   void	dec_3max_init __P((void));
49 #else
50 # define dec_3max_init	platform_not_configured
51 #endif
52 
53 
54 #include "opt_dec_3min.h"
55 #ifdef DEC_3MIN
56   void	dec_3min_init __P((void));
57 #else
58 # define dec_3min_init	platform_not_configured
59 #endif
60 
61 
62 #include "opt_dec_maxine.h"
63 #ifdef DEC_MAXINE
64   void	dec_maxine_init __P((void));
65 #else
66 # define dec_maxine_init	platform_not_configured
67 #endif
68 
69 #include "opt_dec_3maxplus.h"
70 #ifdef DEC_3MAXPLUS
71   void	dec_3maxplus_init __P((void));
72 #else
73 # define dec_3maxplus_init	platform_not_configured
74 #endif
75 
76 #include "opt_dec_5100.h"
77 #ifdef DEC_5100
78   void	dec_5100_init __P((void));
79 #else
80 # define dec_5100_init	platform_not_configured
81 #endif
82 
83 #include "opt_dec_5400.h"
84 #ifdef DEC_5400
85   void	dec_5400_init __P((void));
86 #else
87 # define dec_5400_init	platform_not_configured
88 #endif
89 
90 #include "opt_dec_5500.h"
91 #ifdef DEC_5500
92   void	dec_5500_init __P((void));
93 #else
94 # define dec_5500_init	platform_not_configured
95 #endif
96 
97 
98 #include "opt_dec_5800.h"
99 #ifdef DEC_5800
100   void	dec_5800_init __P((void));
101 #else
102 # define dec_5800_init	platform_not_configured
103 #endif
104 
105 
106 struct sysinit sysinit[] = {
107 	sys_notsupp("???"),			     /*	 0: ??? */
108 	sys_init(dec_3100_init,"DEC_3100"),	     /*	 1: PMAX */
109 	sys_init(dec_3max_init,"DEC_3MAX"),	     /*	 2: 3MAX */
110 	sys_init(dec_3min_init,"DEC_3MIN"),	     /*	 3: 3MIN */
111 	sys_init(dec_3maxplus_init,"DEC_3MAXPLUS"),  /*	 4: 3MAXPLUS */
112 	sys_notsupp("DEC_5800"),		     /*	 5: 5800 */
113 	sys_notsupp("DEC_5400"),		     /*	 6: 5400 */
114 	sys_init(dec_maxine_init,"DEC_MAXINE"),	     /*	 7: MAXINE */
115 	sys_notsupp("???"),			     /*	 8: ??? */
116 	sys_notsupp("???"),			     /*	 9: ??? */
117 	sys_notsupp("???"),			     /*	 10: ??? */
118 	sys_notsupp("DEC_5500"),		     /*	 11: 5500 */
119 	sys_init(dec_5100_init,"DEC_5100"),	     /*	 12: 5100 */
120 };
121 int nsysinit = (sizeof(sysinit) / sizeof(sysinit[0]));
122 
123 
124 void
125 platform_not_configured()
126 {
127 	printf("\n");
128 	printf("Support for system type %d is not present in this kernel.\n",
129 	    systype);
130 	printf("Please build a kernel with \"options %s\" and reboot.\n",
131 	    sysinit[systype].option);
132 	printf("\n");
133 	panic("platform not configured\n");
134 }
135 
136 void
137 platform_not_supported()
138 {
139 	const char *typestr;
140 
141 	if (systype >= nsysinit)
142 		typestr = "???";
143 	else
144 		typestr = sysinit[systype].option;
145 
146 	printf("\n");
147 	printf("NetBSD does not yet support system type %d (%s).\n", systype,
148 	     typestr);
149 	printf("\n");
150 	panic("platform not supported");
151 }
152