From 9ba437bf08c30fb2ccbfba11c247c794c2d26f01 Mon Sep 17 00:00:00 2001 From: jsg Date: Wed, 12 Jun 2024 02:50:25 +0000 Subject: [PATCH] remove BMAJ and CMAJ defines only used by arm64; ok deraadt@ --- sys/arch/arm64/arm64/conf.c | 18 +++++++-------- sys/arch/arm64/include/conf.h | 41 +---------------------------------- 2 files changed, 10 insertions(+), 49 deletions(-) diff --git a/sys/arch/arm64/arm64/conf.c b/sys/arch/arm64/arm64/conf.c index b5a0d2eab42..a239133825b 100644 --- a/sys/arch/arm64/arm64/conf.c +++ b/sys/arch/arm64/arm64/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.23 2024/06/11 09:21:32 jsg Exp $ */ +/* $OpenBSD: conf.c,v 1.24 2024/06/12 02:50:25 jsg Exp $ */ /* * Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved. @@ -236,6 +236,8 @@ struct cdevsw cdevsw[] = }; int nchrdev = nitems(cdevsw); +int mem_no = 2; /* major device number of memory special file */ + /* * Swapdev is a fake device implemented * in sw.c used only internally to get to swstrategy. @@ -245,7 +247,7 @@ int nchrdev = nitems(cdevsw); * confuse, e.g. the hashing routines. Instead, /dev/drum is * provided as a character (raw) device. */ -dev_t swapdev = makedev(BMAJ_SW, 0); +dev_t swapdev = makedev(1, 0); /* * Returns true if dev is /dev/mem or /dev/kmem. @@ -253,8 +255,7 @@ dev_t swapdev = makedev(BMAJ_SW, 0); int iskmemdev(dev_t dev) { - - return (major(dev) == CMAJ_MM && minor(dev) < 2); + return (major(dev) == mem_no && minor(dev) < 2); } /* @@ -263,14 +264,13 @@ iskmemdev(dev_t dev) int iszerodev(dev_t dev) { - - return (major(dev) == CMAJ_MM && minor(dev) == 12); + return (major(dev) == mem_no && minor(dev) == 12); } dev_t getnulldev(void) { - return makedev(CMAJ_MM, 2); + return makedev(mem_no, 2); } const int chrtoblktbl[] = { @@ -347,8 +347,8 @@ dev_rawpart(struct device *dv) switch (majdev) { /* add here any device you want to be checksummed on boot */ - case BMAJ_WD: - case BMAJ_SD: + case 0: /* wd */ + case 4: /* sd */ return (MAKEDISKDEV(majdev, dv->dv_unit, RAW_PART)); break; default: diff --git a/sys/arch/arm64/include/conf.h b/sys/arch/arm64/include/conf.h index 1eefde6be5c..c933c5c1135 100644 --- a/sys/arch/arm64/include/conf.h +++ b/sys/arch/arm64/include/conf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.h,v 1.4 2022/06/28 14:43:50 visa Exp $ */ +/* $OpenBSD: conf.h,v 1.5 2024/06/12 02:50:25 jsg Exp $ */ /* $NetBSD: conf.h,v 1.2 1996/05/05 19:28:34 christos Exp $ */ /* @@ -58,43 +58,4 @@ cdev_decl(openprom); cdev_decl(apm); cdev_decl(acpiapm); -/* - * These numbers have to be in sync with bdevsw/cdevsw. - */ - -#define BMAJ_WD 0 -#define BMAJ_SW 1 -#define BMAJ_SD 4 -#define BMAJ_ST 5 - -#define CMAJ_MM 2 -#define CMAJ_PTS 5 -#define CMAJ_PTC 6 -#define CMAJ_COM 8 -#define CMAJ_WSDISPLAY 12 -#define CMAJ_ST 14 -#define CMAJ_LPT 16 -#define CMAJ_CH 17 -#define CMAJ_UK 20 -#define CMAJ_BPF 23 -#define CMAJ_TUN 40 -#define CMAJ_AUDIO 42 -#define CMAJ_VIDEO 44 -#define CMAJ_BKTR 49 -#define CMAJ_MIDI 52 -#define CMAJ_USB 61 -#define CMAJ_UHID 62 -#define CMAJ_UGEN 63 -#define CMAJ_ULPT 64 -#define CMAJ_UCOM 66 -#define CMAJ_WSKBD 67 -#define CMAJ_WSMOUSE 68 -#ifdef USER_PCICONF -#define CMAJ_PCI 72 -#endif -#define CMAJ_RADIO 76 -#define CMAJ_DRM 87 -#define CMAJ_GPIO 88 -#define CMAJ_VSCSI 89 - #endif /* _MACHINE_CONF_H_ */ -- 2.20.1