Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/hp300/stand/common Make hp300 bootloaders UFS2 ready.
details: https://anonhg.NetBSD.org/src/rev/becf79ccb2b3
branches: trunk
changeset: 372600:becf79ccb2b3
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Sun Dec 11 07:39:30 2022 +0000
description:
Make hp300 bootloaders UFS2 ready.
diffstat:
sys/arch/hp300/stand/common/conf.c | 17 +++++++++++------
sys/arch/hp300/stand/common/conf.h | 20 +++++++++++++++++++-
sys/arch/hp300/stand/common/devopen.c | 24 +++++++++++++++++-------
sys/arch/hp300/stand/common/samachdep.h | 20 ++++----------------
4 files changed, 51 insertions(+), 30 deletions(-)
diffs (170 lines):
diff -r 3ab02c6d3568 -r becf79ccb2b3 sys/arch/hp300/stand/common/conf.c
--- a/sys/arch/hp300/stand/common/conf.c Sun Dec 11 07:14:05 2022 +0000
+++ b/sys/arch/hp300/stand/common/conf.c Sun Dec 11 07:39:30 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: conf.c,v 1.13 2022/12/11 06:27:35 tsutsui Exp $ */
+/* $NetBSD: conf.c,v 1.14 2022/12/11 07:39:30 tsutsui Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@@ -137,9 +137,14 @@
/*
* Filesystem configuration
*/
-struct fs_ops file_system_rawfs[] = { FS_OPS(rawfs) };
-struct fs_ops file_system_ufs[] = { FS_OPS(ufs) };
-struct fs_ops file_system_nfs[] = { FS_OPS(nfs) };
+struct fs_ops file_system_rawfs[1] = { FS_OPS(rawfs) };
+struct fs_ops file_system_ufs[NFSYS_UFS] = {
+ FS_OPS(ffsv1),
+#ifdef SUPPORT_UFS2
+ FS_OPS(ffsv2),
+#endif
+};
+struct fs_ops file_system_nfs[1] = { FS_OPS(nfs) };
-struct fs_ops file_system[1];
-int nfsys = 1; /* we always know which one we want */
+struct fs_ops file_system[NFSYS_UFS];
+int nfsys = 1; /* default value; should be overrieded */
diff -r 3ab02c6d3568 -r becf79ccb2b3 sys/arch/hp300/stand/common/conf.h
--- a/sys/arch/hp300/stand/common/conf.h Sun Dec 11 07:14:05 2022 +0000
+++ b/sys/arch/hp300/stand/common/conf.h Sun Dec 11 07:39:30 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: conf.h,v 1.2 2005/12/11 12:17:19 christos Exp $ */
+/* $NetBSD: conf.h,v 1.3 2022/12/11 07:39:30 tsutsui Exp $ */
/*
* Copyright (c) 1982, 1990, 1993
@@ -52,7 +52,25 @@
int sdopen(struct open_file *, ...);
int sdclose(struct open_file *);
#endif
+#ifdef SUPPORT_UFS2
+#define NFSYS_UFS 2
+#else
+#define NFSYS_UFS 1
+#endif
#ifdef SUPPORT_ETHERNET
extern struct netif_driver le_driver;
#endif
+
+/*
+ * Switch we use to set punit in devopen.
+ */
+struct punitsw {
+ int (*p_punit)(int, int, int *);
+};
+extern struct punitsw punitsw[];
+extern int npunit;
+
+extern struct fs_ops file_system_rawfs[1];
+extern struct fs_ops file_system_ufs[NFSYS_UFS];
+extern struct fs_ops file_system_nfs[1];
diff -r 3ab02c6d3568 -r becf79ccb2b3 sys/arch/hp300/stand/common/devopen.c
--- a/sys/arch/hp300/stand/common/devopen.c Sun Dec 11 07:14:05 2022 +0000
+++ b/sys/arch/hp300/stand/common/devopen.c Sun Dec 11 07:39:30 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: devopen.c,v 1.12 2018/03/08 03:12:01 mrg Exp $ */
+/* $NetBSD: devopen.c,v 1.13 2022/12/11 07:39:30 tsutsui Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -63,6 +63,7 @@
#include <lib/libkern/libkern.h>
#include <lib/libsa/stand.h>
+#include <hp300/stand/common/conf.h>
#include <hp300/stand/common/samachdep.h>
u_int opendev;
@@ -96,18 +97,21 @@
switch (i) {
case 0: /* ct */
memcpy(file_system, file_system_rawfs,
- sizeof(struct fs_ops));
+ sizeof(file_system_rawfs));
+ nfsys = 1;
break;
case 2: /* rd */
case 4: /* sd */
memcpy(file_system, file_system_ufs,
- sizeof(struct fs_ops));
+ sizeof(file_system_ufs));
+ nfsys = NFSYS_UFS;
break;
case 6: /* le */
memcpy(file_system, file_system_nfs,
- sizeof(struct fs_ops));
+ sizeof(file_system_nfs));
+ nfsys = 1;
break;
default:
@@ -250,16 +254,22 @@
*/
switch (dev) {
case 0: /* ct */
- memcpy(file_system, file_system_rawfs, sizeof(struct fs_ops));
+ memcpy(file_system, file_system_rawfs,
+ sizeof(file_system_rawfs));
+ nfsys = 1;
break;
case 2: /* rd */
case 4: /* sd */
- memcpy(file_system, file_system_ufs, sizeof(struct fs_ops));
+ memcpy(file_system, file_system_ufs,
+ sizeof(file_system_ufs));
+ nfsys = NFSYS_UFS;
break;
case 6: /* le */
- memcpy(file_system, file_system_nfs, sizeof(struct fs_ops));
+ memcpy(file_system, file_system_nfs,
+ sizeof(file_system_nfs));
+ nfsys = 1;
break;
default:
diff -r 3ab02c6d3568 -r becf79ccb2b3 sys/arch/hp300/stand/common/samachdep.h
--- a/sys/arch/hp300/stand/common/samachdep.h Sun Dec 11 07:14:05 2022 +0000
+++ b/sys/arch/hp300/stand/common/samachdep.h Sun Dec 11 07:39:30 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: samachdep.h,v 1.21 2022/12/11 06:20:07 tsutsui Exp $ */
+/* $NetBSD: samachdep.h,v 1.22 2022/12/11 07:39:30 tsutsui Exp $ */
/*
* Copyright (c) 1982, 1990, 1993
@@ -105,6 +105,9 @@
/* tget.c */
int tgets(char *, size_t);
+/* vers.c (generated by sys/conf/newvers_stand.sh) */
+extern char bootprog_name[], bootprog_rev[], bootprog_kernrev[];
+
#define DELAY(n) \
do { \
@@ -118,18 +121,3 @@
struct grfinfo {
int grf_foo;
};
-
-/*
- * Switch we use to set punit in devopen.
- */
-struct punitsw {
- int (*p_punit)(int, int, int *);
-};
-extern struct punitsw punitsw[];
-extern int npunit;
-
-extern struct fs_ops file_system_rawfs[];
-extern struct fs_ops file_system_ufs[];
-extern struct fs_ops file_system_nfs[];
-
-extern char bootprog_name[], bootprog_rev[], bootprog_kernrev[];
Home |
Main Index |
Thread Index |
Old Index