From: dlg Date: Fri, 28 May 2021 01:51:11 +0000 (+0000) Subject: move the nvme_read4 and nvme_write4 macros to the header. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ef9c7800123214ad85829a7fe632e0e169bd0b85;p=openbsd move the nvme_read4 and nvme_write4 macros to the header. this allows nvme bus glue to use the macros too. ok jmatthew@ --- diff --git a/sys/dev/ic/nvme.c b/sys/dev/ic/nvme.c index 9a79c8b1bfe..74b8fa6fbb2 100644 --- a/sys/dev/ic/nvme.c +++ b/sys/dev/ic/nvme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nvme.c,v 1.91 2021/02/25 07:30:36 jan Exp $ */ +/* $OpenBSD: nvme.c,v 1.92 2021/05/28 01:51:11 dlg Exp $ */ /* * Copyright (c) 2014 David Gwynne @@ -117,10 +117,6 @@ void nvme_scsi_inquiry(struct scsi_xfer *); void nvme_scsi_capacity16(struct scsi_xfer *); void nvme_scsi_capacity(struct scsi_xfer *); -#define nvme_read4(_s, _r) \ - bus_space_read_4((_s)->sc_iot, (_s)->sc_ioh, (_r)) -#define nvme_write4(_s, _r, _v) \ - bus_space_write_4((_s)->sc_iot, (_s)->sc_ioh, (_r), (_v)) /* * Some controllers, at least Apple NVMe, always require split * transfers, so don't use bus_space_{read,write}_8() on LP64. diff --git a/sys/dev/ic/nvmevar.h b/sys/dev/ic/nvmevar.h index 39cfda88b5c..3624ab29e5d 100644 --- a/sys/dev/ic/nvmevar.h +++ b/sys/dev/ic/nvmevar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: nvmevar.h,v 1.20 2020/07/22 13:16:04 krw Exp $ */ +/* $OpenBSD: nvmevar.h,v 1.21 2021/05/28 01:51:11 dlg Exp $ */ /* * Copyright (c) 2014 David Gwynne @@ -107,4 +107,9 @@ int nvme_activate(struct nvme_softc *, int); int nvme_intr(void *); int nvme_intr_intx(void *); +#define nvme_read4(_s, _r) \ + bus_space_read_4((_s)->sc_iot, (_s)->sc_ioh, (_r)) +#define nvme_write4(_s, _r, _v) \ + bus_space_write_4((_s)->sc_iot, (_s)->sc_ioh, (_r), (_v)) + #define DEVNAME(_sc) ((_sc)->sc_dev.dv_xname)