Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Add a comment explaining why bus_space_write_8 i...



details:   https://anonhg.NetBSD.org/src/rev/21cf9eef2a1b
branches:  trunk
changeset: 950276:21cf9eef2a1b
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jan 24 01:44:11 2021 +0000

description:
Add a comment explaining why bus_space_write_8 is limited to virtio.

diffstat:

 sys/dev/pci/virtio_pci.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 147820c7ecb4 -r 21cf9eef2a1b sys/dev/pci/virtio_pci.c
--- a/sys/dev/pci/virtio_pci.c  Sun Jan 24 00:15:20 2021 +0000
+++ b/sys/dev/pci/virtio_pci.c  Sun Jan 24 01:44:11 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio_pci.c,v 1.19 2021/01/23 20:00:19 christos Exp $ */
+/* $NetBSD: virtio_pci.c,v 1.20 2021/01/24 01:44:11 christos Exp $ */
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.19 2021/01/23 20:00:19 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.20 2021/01/24 01:44:11 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -733,6 +733,12 @@
  * written as two 4 byters
  */
 #ifndef __HAVE_BUS_SPACE_8
+/*
+ * This is not a general purpose function that can be used in any
+ * driver. Virtio specifically allows the 8 byte bus transaction
+ * to be split into two 4 byte transactions. Do not copy/use it
+ * in other device drivers unless you know that the device accepts it.
+ */
 static __inline void
 bus_space_write_8(bus_space_tag_t iot, bus_space_handle_t ioh,
      bus_size_t offset, uint64_t value)



Home | Main Index | Thread Index | Old Index