Annotation of sys/arch/hp300/stand/cdboot/conf.c, Revision 1.1.1.1
1.1 nbrk 1: /* $OpenBSD: conf.c,v 1.5 2006/08/17 06:31:10 miod Exp $ */
2: /* $NetBSD: conf.c,v 1.12 1996/10/14 07:29:15 thorpej Exp $ */
3:
4: /*
5: * Copyright (c) 1982, 1986, 1990, 1993
6: * The Regents of the University of California. All rights reserved.
7: *
8: * Redistribution and use in source and binary forms, with or without
9: * modification, are permitted provided that the following conditions
10: * are met:
11: * 1. Redistributions of source code must retain the above copyright
12: * notice, this list of conditions and the following disclaimer.
13: * 2. Redistributions in binary form must reproduce the above copyright
14: * notice, this list of conditions and the following disclaimer in the
15: * documentation and/or other materials provided with the distribution.
16: * 3. Neither the name of the University nor the names of its contributors
17: * may be used to endorse or promote products derived from this software
18: * without specific prior written permission.
19: *
20: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30: * SUCH DAMAGE.
31: *
32: * @(#)conf.c 8.1 (Berkeley) 6/10/93
33: */
34:
35: #include <sys/param.h>
36:
37: #include <lib/libsa/stand.h>
38:
39: #include "samachdep.h"
40:
41: #include <lib/libsa/cd9660.h>
42:
43: int debug = 0; /* XXX */
44:
45: /*
46: * Device configuration
47: */
48: int sdstrategy(void *, int, daddr_t, size_t, void *, size_t *);
49: int sdopen(struct open_file *, ...);
50: int sdclose(struct open_file *);
51: #define sdioctl noioctl
52:
53: #define xxstrategy \
54: (int (*)(void *, int, daddr_t, size_t, void *, size_t *))nullsys
55: #define xxopen (int (*)(struct open_file *, ...))nodev
56: #define xxclose (int (*)(struct open_file *))nullsys
57:
58: struct devsw devsw[] = {
59: { "??", xxstrategy, xxopen, xxclose, noioctl }, /*0*/
60: { "??", xxstrategy, xxopen, xxclose, noioctl }, /*1*/
61: { "??", xxstrategy, xxopen, xxclose, noioctl }, /*2*/
62: { "??", xxstrategy, xxopen, xxclose, noioctl }, /*3*/
63: { "sd", sdstrategy, sdopen, sdclose, sdioctl }, /*4*/
64: };
65: int ndevs = (sizeof(devsw) / sizeof(devsw[0]));
66:
67: /*
68: * Physical unit/lun detection.
69: */
70: int punitzero(int, int, int *);
71:
72: int
73: punitzero(int ctlr, int slave, int *punit)
74: {
75:
76: *punit = 0;
77: return (0);
78: }
79:
80: #define xxpunit punitzero
81: #define sdpunit punitzero
82:
83: struct punitsw punitsw[] = {
84: { xxpunit },
85: { xxpunit },
86: { xxpunit },
87: { xxpunit },
88: { sdpunit },
89: };
90: int npunit = (sizeof(punitsw) / sizeof(punitsw[0]));
91:
92: /*
93: * Filesystem configuration
94: */
95: struct fs_ops file_system_cd9660[] = {
96: { cd9660_open, cd9660_close, cd9660_read, cd9660_write, cd9660_seek,
97: cd9660_stat },
98: };
99:
100: struct fs_ops file_system[2];
101: int nfsys = 1; /* default; changed per device type. */
CVSweb