Module Name: src
Committed By: isaki
Date: Thu Jun 23 12:32:22 UTC 2022
Modified Files:
src/sys/arch/x68k/stand/boot: conf.c
src/sys/arch/x68k/stand/libsa: libx68k.h sdcd.c
Log Message:
x68k/stand: Merge {sd,cd}strategy and {sd,cd}close respectively.
For sd and cd devs, only open differs and the rest is the same.
No functional changes intended.
Suggested by tsutsui@ at port-x68k.
To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/x68k/stand/boot/conf.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x68k/stand/libsa/libx68k.h
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/x68k/stand/libsa/sdcd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/x68k/stand/boot/conf.c
diff -u src/sys/arch/x68k/stand/boot/conf.c:1.12 src/sys/arch/x68k/stand/boot/conf.c:1.13
--- src/sys/arch/x68k/stand/boot/conf.c:1.12 Mon Apr 25 15:12:07 2022
+++ src/sys/arch/x68k/stand/boot/conf.c Thu Jun 23 12:32:22 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: conf.c,v 1.12 2022/04/25 15:12:07 mlelstv Exp $ */
+/* $NetBSD: conf.c,v 1.13 2022/06/23 12:32:22 isaki Exp $ */
/*
* Copyright (c) 2001 Minoura Makoto
@@ -40,8 +40,8 @@
#include "libx68k.h"
struct devsw devsw[] = {
- { "sd", sdstrategy, sdopen, sdclose, noioctl },
- { "cd", cdstrategy, cdopen, cdclose, noioctl },
+ { "sd", sdcdstrategy, sdopen, sdcdclose, noioctl },
+ { "cd", sdcdstrategy, cdopen, sdcdclose, noioctl },
{ "fd", fdstrategy, fdopen, fdclose, noioctl },
{ "nfs", net_strategy, net_open, net_close, net_ioctl },
{ 0, 0, 0, 0, 0 }
Index: src/sys/arch/x68k/stand/libsa/libx68k.h
diff -u src/sys/arch/x68k/stand/libsa/libx68k.h:1.7 src/sys/arch/x68k/stand/libsa/libx68k.h:1.8
--- src/sys/arch/x68k/stand/libsa/libx68k.h:1.7 Sun Jun 26 04:17:17 2016
+++ src/sys/arch/x68k/stand/libsa/libx68k.h Thu Jun 23 12:32:22 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: libx68k.h,v 1.7 2016/06/26 04:17:17 isaki Exp $ */
+/* $NetBSD: libx68k.h,v 1.8 2022/06/23 12:32:22 isaki Exp $ */
/*
* Copyright (c) 2001 Minoura Makoto
@@ -50,13 +50,11 @@ int parseboot(char *, char **, int *);
/* sdcd.c */
struct sd_softc;
-int sdstrategy(void *, int, daddr_t, size_t, void *, size_t *);
int sdopen(struct open_file *, ...);
-int sdclose(struct open_file *);
+int sdcdstrategy(void *, int, daddr_t, size_t, void *, size_t *);
+int sdcdclose(struct open_file *);
int sd_getbsdpartition(int, int);
-int cdstrategy(void *, int, daddr_t, size_t, void *, size_t *);
int cdopen(struct open_file *, ...);
-int cdclose(struct open_file *);
/* fd.c */
int fdstrategy(void *, int, daddr_t, size_t, void *, size_t *);
Index: src/sys/arch/x68k/stand/libsa/sdcd.c
diff -u src/sys/arch/x68k/stand/libsa/sdcd.c:1.17 src/sys/arch/x68k/stand/libsa/sdcd.c:1.18
--- src/sys/arch/x68k/stand/libsa/sdcd.c:1.17 Tue Jun 21 12:43:57 2022
+++ src/sys/arch/x68k/stand/libsa/sdcd.c Thu Jun 23 12:32:22 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: sdcd.c,v 1.17 2022/06/21 12:43:57 isaki Exp $ */
+/* $NetBSD: sdcd.c,v 1.18 2022/06/23 12:32:22 isaki Exp $ */
/*
* Copyright (c) 2001 MINOURA Makoto.
@@ -301,7 +301,7 @@ sdopen(struct open_file *f, ...)
}
int
-sdclose(struct open_file *f)
+sdcdclose(struct open_file *f)
{
dealloc(f->f_devdata, sizeof(struct sdcd_softc));
@@ -309,7 +309,7 @@ sdclose(struct open_file *f)
}
int
-sdstrategy(void *arg, int rw, daddr_t dblk, size_t size,
+sdcdstrategy(void *arg, int rw, daddr_t dblk, size_t size,
void *buf, size_t *rsize)
{
struct sdcd_softc *sc = arg;
@@ -382,18 +382,3 @@ cdopen(struct open_file *f, ...)
return 0;
}
-
-int
-cdclose(struct open_file *f)
-{
-
- dealloc(f->f_devdata, sizeof(struct sdcd_softc));
- return 0;
-}
-
-int
-cdstrategy(void *arg, int rw, daddr_t dblk, size_t size,
- void *buf, size_t *rsize)
-{
- return sdstrategy(arg, rw, dblk, size, buf, rsize);
-}