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