Introduce LIBSA_NO_DEV_IOCTL, and don't declare ioctl() if it's defined. Also, don't declare the close() function if LIBSA_NO_DEV_CLOSE is defined.diff -r1.47 -r1.48 src/sys/arch/pmax/stand/Makefile.booters
(he)
--- src/sys/arch/pmax/stand/Makefile.booters 2009/01/12 07:29:23 1.47
+++ src/sys/arch/pmax/stand/Makefile.booters 2009/03/17 00:45:46 1.48
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: Makefile.booters,v 1.47 2009/01/12 07:29:23 tsutsui Exp $ | 1 | # $NetBSD: Makefile.booters,v 1.48 2009/03/17 00:45:46 he Exp $ | |
2 | 2 | |||
3 | .include <bsd.sys.mk> # for HOST_SH | 3 | .include <bsd.sys.mk> # for HOST_SH | |
4 | 4 | |||
5 | # $S must correspond to the top of the 'sys' tree | 5 | # $S must correspond to the top of the 'sys' tree | |
6 | S= ${.CURDIR}/../../../.. | 6 | S= ${.CURDIR}/../../../.. | |
7 | 7 | |||
8 | .if !make(obj) && !make(clean) && !make(cleandir) | 8 | .if !make(obj) && !make(clean) && !make(cleandir) | |
9 | .BEGIN: | 9 | .BEGIN: | |
10 | @[ -h machine ] || ln -s $S/arch/${MACHINE}/include machine | 10 | @[ -h machine ] || ln -s $S/arch/${MACHINE}/include machine | |
11 | @[ -h pmax ] || ln -s $S/arch/${MACHINE}/include pmax | 11 | @[ -h pmax ] || ln -s $S/arch/${MACHINE}/include pmax | |
12 | @[ -h mips ] || ln -s $S/arch/mips/include mips | 12 | @[ -h mips ] || ln -s $S/arch/mips/include mips | |
13 | .NOPATH: machine pmax mips | 13 | .NOPATH: machine pmax mips | |
14 | .endif | 14 | .endif | |
@@ -47,26 +47,27 @@ SRCS = start.S bootxx.c callvec.c | @@ -47,26 +47,27 @@ SRCS = start.S bootxx.c callvec.c | |||
47 | SRCS+= devopen.c conf.c rz.c | 47 | SRCS+= devopen.c conf.c rz.c | |
48 | SRCS+= bootinit.S bootread.S clear_cache.S printf.S | 48 | SRCS+= bootinit.S bootread.S clear_cache.S printf.S | |
49 | 49 | |||
50 | LOAD_ADDRESS= ${PRIMARY_LOAD_ADDRESS} | 50 | LOAD_ADDRESS= ${PRIMARY_LOAD_ADDRESS} | |
51 | # Pick a number, any number... | 51 | # Pick a number, any number... | |
52 | PRIMARY_MAX_TOTAL!= expr 16 \* 1024 | 52 | PRIMARY_MAX_TOTAL!= expr 16 \* 1024 | |
53 | 53 | |||
54 | CPPFLAGS+= -DPRIMARY_BOOTBLOCK \ | 54 | CPPFLAGS+= -DPRIMARY_BOOTBLOCK \ | |
55 | -DPRIMARY_LOAD_ADDRESS="${PRIMARY_LOAD_ADDRESS}" \ | 55 | -DPRIMARY_LOAD_ADDRESS="${PRIMARY_LOAD_ADDRESS}" \ | |
56 | -DNO_GETCHAR \ | 56 | -DNO_GETCHAR \ | |
57 | -DLIBSA_NO_FS_SYMLINK -DLIBSA_NO_FS_WRITE \ | 57 | -DLIBSA_NO_FS_SYMLINK -DLIBSA_NO_FS_WRITE \ | |
58 | -DLIBSA_NO_FS_CLOSE \ | 58 | -DLIBSA_NO_FS_CLOSE \ | |
59 | -DLIBSA_NO_DEV_CLOSE \ | 59 | -DLIBSA_NO_DEV_CLOSE \ | |
60 | -DLIBSA_NO_DEV_IOCTL \ | |||
60 | -DLIBSA_SINGLE_DEVICE=rz \ | 61 | -DLIBSA_SINGLE_DEVICE=rz \ | |
61 | -D"rzioctl(x,y,z)=EINVAL" -D"rzclose(f)=0" \ | 62 | -D"rzioctl(x,y,z)=EINVAL" -D"rzclose(f)=0" \ | |
62 | -DLIBSA_NO_TWIDDLE \ | 63 | -DLIBSA_NO_TWIDDLE \ | |
63 | -DLIBSA_NO_FD_CHECKING \ | 64 | -DLIBSA_NO_FD_CHECKING \ | |
64 | -DLIBSA_NO_RAW_ACCESS \ | 65 | -DLIBSA_NO_RAW_ACCESS \ | |
65 | -DLIBSA_NO_DISKLABEL_MSGS \ | 66 | -DLIBSA_NO_DISKLABEL_MSGS \ | |
66 | -DALLOC_FIRST_FIT \ | 67 | -DALLOC_FIRST_FIT \ | |
67 | -DLIBSA_USE_MEMCPY -DLIBSA_USE_MEMSET | 68 | -DLIBSA_USE_MEMCPY -DLIBSA_USE_MEMSET | |
68 | 69 | |||
69 | CHECKSIZE_CMD?= SIZE=${SIZE} ${HOST_SH} ${.CURDIR}/../common/checksize.sh | 70 | CHECKSIZE_CMD?= SIZE=${SIZE} ${HOST_SH} ${.CURDIR}/../common/checksize.sh | |
70 | 71 | |||
71 | .elif defined(SECONDARY_PROG) | 72 | .elif defined(SECONDARY_PROG) | |
72 | PROG= ${SECONDARY_PROG} | 73 | PROG= ${SECONDARY_PROG} |
--- src/sys/arch/pmax/stand/common/rz.h 2009/03/14 14:46:04 1.3
+++ src/sys/arch/pmax/stand/common/rz.h 2009/03/17 00:45:46 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: rz.h,v 1.3 2009/03/14 14:46:04 dsl Exp $ */ | 1 | /* $NetBSD: rz.h,v 1.4 2009/03/17 00:45:46 he Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1997 Jonathan Stone (hereinafter referred to as the author) | 4 | * Copyright (c) 1997 Jonathan Stone (hereinafter referred to as the author) | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -24,15 +24,19 @@ | @@ -24,15 +24,19 @@ | |||
24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE | 25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE | |
26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
32 | * SUCH DAMAGE. | 32 | * SUCH DAMAGE. | |
33 | */ | 33 | */ | |
34 | 34 | |||
35 | int rzstrategy(void*, int, daddr_t, size_t, void*, size_t*); | 35 | int rzstrategy(void*, int, daddr_t, size_t, void*, size_t*); | |
36 | int rzopen(struct open_file*, ...); | 36 | int rzopen(struct open_file*, ...); | |
37 | #if !defined(LIBSA_NO_DEV_CLOSE) | |||
37 | int rzclose(struct open_file*); | 38 | int rzclose(struct open_file*); | |
39 | #endif | |||
40 | #if !defined(LIBSA_NO_DEV_IOCTL) | |||
38 | int rzioctl(struct open_file*, u_long, void*); | 41 | int rzioctl(struct open_file*, u_long, void*); | |
42 | #endif |