xref: /netbsd/sys/arch/pmax/pmax/sysconf.c (revision 6550d01e)
1 /*	$NetBSD: sysconf.c,v 1.12 2009/03/18 10:22:34 cegger 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/cdefs.h>
34 __KERNEL_RCSID(0, "$NetBSD: sysconf.c,v 1.12 2009/03/18 10:22:34 cegger Exp $");
35 
36 #include <sys/param.h>
37 #include <sys/systm.h>
38 #include <machine/sysconf.h>
39 #include <pmax/pmax/pmaxtype.h>
40 
41 
42 #include "opt_dec_3100.h"
43 #ifdef DEC_3100
44   void	dec_3100_init(void);
45 #else
46 # define dec_3100_init		platform_not_configured
47 #endif
48 
49 #include "opt_dec_3max.h"
50 #ifdef DEC_3MAX
51   void	dec_3max_init(void);
52 #else
53 # define dec_3max_init	platform_not_configured
54 #endif
55 
56 
57 #include "opt_dec_3min.h"
58 #ifdef DEC_3MIN
59   void	dec_3min_init(void);
60 #else
61 # define dec_3min_init	platform_not_configured
62 #endif
63 
64 
65 #include "opt_dec_maxine.h"
66 #ifdef DEC_MAXINE
67   void	dec_maxine_init(void);
68 #else
69 # define dec_maxine_init	platform_not_configured
70 #endif
71 
72 #include "opt_dec_3maxplus.h"
73 #ifdef DEC_3MAXPLUS
74   void	dec_3maxplus_init(void);
75 #else
76 # define dec_3maxplus_init	platform_not_configured
77 #endif
78 
79 #include "opt_dec_5100.h"
80 #ifdef DEC_5100
81   void	dec_5100_init(void);
82 #else
83 # define dec_5100_init	platform_not_configured
84 #endif
85 
86 #include "opt_dec_5400.h"
87 #ifdef DEC_5400
88   void	dec_5400_init(void);
89 #else
90 # define dec_5400_init	platform_not_configured
91 #endif
92 
93 #include "opt_dec_5500.h"
94 #ifdef DEC_5500
95   void	dec_5500_init(void);
96 #else
97 # define dec_5500_init	platform_not_configured
98 #endif
99 
100 
101 #include "opt_dec_5800.h"
102 #ifdef DEC_5800
103   void	dec_5800_init(void);
104 #else
105 # define dec_5800_init	platform_not_configured
106 #endif
107 
108 
109 struct sysinit sysinit[] = {
110 	sys_notsupp("???"),			     /*	 0: ??? */
111 	sys_init(dec_3100_init,"DEC_3100"),	     /*	 1: PMAX */
112 	sys_init(dec_3max_init,"DEC_3MAX"),	     /*	 2: 3MAX */
113 	sys_init(dec_3min_init,"DEC_3MIN"),	     /*	 3: 3MIN */
114 	sys_init(dec_3maxplus_init,"DEC_3MAXPLUS"),  /*	 4: 3MAXPLUS */
115 	sys_notsupp("DEC_5800"),		     /*	 5: 5800 */
116 	sys_notsupp("DEC_5400"),		     /*	 6: 5400 */
117 	sys_init(dec_maxine_init,"DEC_MAXINE"),	     /*	 7: MAXINE */
118 	sys_notsupp("???"),			     /*	 8: ??? */
119 	sys_notsupp("???"),			     /*	 9: ??? */
120 	sys_notsupp("???"),			     /*	 10: ??? */
121 	sys_notsupp("DEC_5500"),		     /*	 11: 5500 */
122 	sys_init(dec_5100_init,"DEC_5100"),	     /*	 12: 5100 */
123 };
124 int nsysinit = (sizeof(sysinit) / sizeof(sysinit[0]));
125 
126 
127 void
128 platform_not_configured(void)
129 {
130 	printf("\n");
131 	printf("Support for system type %d is not present in this kernel.\n",
132 	    systype);
133 	printf("Please build a kernel with \"options %s\" and reboot.\n",
134 	    sysinit[systype].option);
135 	printf("\n");
136 	panic("platform not configured");
137 }
138 
139 void
140 platform_not_supported(void)
141 {
142 	const char *typestr;
143 
144 	if (systype >= nsysinit)
145 		typestr = "???";
146 	else
147 		typestr = sysinit[systype].option;
148 
149 	printf("\n");
150 	printf("NetBSD does not yet support system type %d (%s).\n", systype,
151 	     typestr);
152 	printf("\n");
153 	panic("platform not supported");
154 }
155