xref: /netbsd-src/sys/arch/arc/stand/boot/conf.c (revision 71a975f6f66a68ee22aa3e9569e07cdd908bb583)
1*71a975f6Stsutsui /*	$NetBSD: conf.c,v 1.4 2007/12/02 05:40:25 tsutsui Exp $	*/
2b28c4afbStsutsui 
3b28c4afbStsutsui /*
4b28c4afbStsutsui  * Copyright (c) 1992, 1993
5b28c4afbStsutsui  *	The Regents of the University of California.  All rights reserved.
6b28c4afbStsutsui  *
7b28c4afbStsutsui  * This code is derived from software contributed to Berkeley by
8b28c4afbStsutsui  * Ralph Campbell.
9b28c4afbStsutsui  *
10b28c4afbStsutsui  * Redistribution and use in source and binary forms, with or without
11b28c4afbStsutsui  * modification, are permitted provided that the following conditions
12b28c4afbStsutsui  * are met:
13b28c4afbStsutsui  * 1. Redistributions of source code must retain the above copyright
14b28c4afbStsutsui  *    notice, this list of conditions and the following disclaimer.
15b28c4afbStsutsui  * 2. Redistributions in binary form must reproduce the above copyright
16b28c4afbStsutsui  *    notice, this list of conditions and the following disclaimer in the
17b28c4afbStsutsui  *    documentation and/or other materials provided with the distribution.
18b28c4afbStsutsui  * 3. Neither the name of the University nor the names of its contributors
19b28c4afbStsutsui  *    may be used to endorse or promote products derived from this software
20b28c4afbStsutsui  *    without specific prior written permission.
21b28c4afbStsutsui  *
22b28c4afbStsutsui  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23b28c4afbStsutsui  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24b28c4afbStsutsui  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25b28c4afbStsutsui  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26b28c4afbStsutsui  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27b28c4afbStsutsui  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28b28c4afbStsutsui  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29b28c4afbStsutsui  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30b28c4afbStsutsui  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31b28c4afbStsutsui  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32b28c4afbStsutsui  * SUCH DAMAGE.
33b28c4afbStsutsui  *
34b28c4afbStsutsui  *	@(#)conf.c	8.1 (Berkeley) 6/10/93
35b28c4afbStsutsui  */
36b28c4afbStsutsui 
37b28c4afbStsutsui #include <sys/types.h>
38b28c4afbStsutsui #include <lib/libsa/stand.h>
39b28c4afbStsutsui #include <lib/libsa/dosfs.h>
40b28c4afbStsutsui #include <lib/libsa/ufs.h>
41b28c4afbStsutsui #include <lib/libsa/lfs.h>
42b28c4afbStsutsui #include <lib/libsa/cd9660.h>
43b28c4afbStsutsui #ifdef SUPPORT_USTARFS
44b28c4afbStsutsui #include <lib/libsa/ustarfs.h>
45b28c4afbStsutsui #endif
46b28c4afbStsutsui #ifdef BOOTNET
47b28c4afbStsutsui #include <netinet/in.h>
48b28c4afbStsutsui #include <lib/libsa/dev_net.h>
49b28c4afbStsutsui #include <lib/libsa/nfs.h>
50b28c4afbStsutsui #endif
51b28c4afbStsutsui #include "disk.h"
52b28c4afbStsutsui 
53b28c4afbStsutsui #ifndef LIBSA_SINGLE_DEVICE
54b28c4afbStsutsui 
55b28c4afbStsutsui #ifdef LIBSA_NO_DEV_CLOSE
56b28c4afbStsutsui #define diskclose /*(()(struct open_file*))*/0
57b28c4afbStsutsui #endif
58b28c4afbStsutsui 
59b28c4afbStsutsui #ifdef LIBSA_NO_DEV_IOCTL
60b28c4afbStsutsui #define diskioctl /*(()(struct open_file*, u_long, void*))*/0
61b28c4afbStsutsui #else
62b28c4afbStsutsui #define	diskioctl		noioctl
63b28c4afbStsutsui #endif
64b28c4afbStsutsui 
65b28c4afbStsutsui struct devsw devsw[] = {
66b28c4afbStsutsui 	{ "disk", diskstrategy, diskopen, diskclose, diskioctl },	/* 0 */
67b28c4afbStsutsui #ifdef BOOTNET
68b28c4afbStsutsui 	{ "tftp", net_strategy, net_open, net_close, net_ioctl },	/* 1 */
69b28c4afbStsutsui #endif
70b28c4afbStsutsui };
71b28c4afbStsutsui 
72*71a975f6Stsutsui int ndevs = __arraycount(devsw);
73b28c4afbStsutsui #endif
74b28c4afbStsutsui 
75b28c4afbStsutsui 
76b28c4afbStsutsui #ifndef LIBSA_SINGLE_FILESYSTEM
77b28c4afbStsutsui #ifdef LIBSA_NO_FS_CLOSE
78b28c4afbStsutsui #define ufs_close	0
79b28c4afbStsutsui #define lfsv1_close	0
80b28c4afbStsutsui #define lfsv2_close	0
81b28c4afbStsutsui #define cd9660_close	0
82b28c4afbStsutsui #define ustarfs_close	0
83b28c4afbStsutsui #define nfs_close	0
84b28c4afbStsutsui #endif
85b28c4afbStsutsui #ifdef LIBSA_NO_FS_WRITE
86b28c4afbStsutsui #define ufs_write	0
87b28c4afbStsutsui #define lfsv1_write	0
88b28c4afbStsutsui #define lfsv2_write	0
89b28c4afbStsutsui #define cd9660_write	0
90b28c4afbStsutsui #define ustarfs_write	0
91b28c4afbStsutsui #define nfs_write	0
92b28c4afbStsutsui #endif
93b28c4afbStsutsui 
94b28c4afbStsutsui struct fs_ops file_system[] = {
95*71a975f6Stsutsui 	FS_OPS(ffsv1),
96*71a975f6Stsutsui 	FS_OPS(ffsv2),
9717670568Sjunyoung 	FS_OPS(dosfs),
9817670568Sjunyoung 	FS_OPS(lfsv1),
9917670568Sjunyoung 	FS_OPS(lfsv2),
10017670568Sjunyoung 	FS_OPS(cd9660),
101b28c4afbStsutsui #ifdef SUPPORT_USTARFS
10217670568Sjunyoung 	FS_OPS(ustarfs),
103b28c4afbStsutsui #endif
104b28c4afbStsutsui #ifdef BOOTNET
10517670568Sjunyoung 	FS_OPS(nfs),
106b28c4afbStsutsui #endif
107b28c4afbStsutsui };
108b28c4afbStsutsui 
109*71a975f6Stsutsui int nfsys = __arraycount(file_system);
110b28c4afbStsutsui #endif
111b28c4afbStsutsui 
112b28c4afbStsutsui #ifdef BOOTNET
113b28c4afbStsutsui extern struct netif_driver arc_netif_driver;
114b28c4afbStsutsui 
115b28c4afbStsutsui struct netif_driver *netif_drivers[] = {
116b28c4afbStsutsui 	&arc_netif_driver,
117b28c4afbStsutsui };
118*71a975f6Stsutsui int n_netif_drivers = __arraycount(netif_drivers);
119b28c4afbStsutsui #endif
120