Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2/include/asm Allow memset_io &c. to tak...
details: https://anonhg.NetBSD.org/src/rev/e9d639c0c544
branches: trunk
changeset: 1028361:e9d639c0c544
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Dec 19 10:48:29 2021 +0000
description:
Allow memset_io &c. to take volatile.
diffstat:
sys/external/bsd/drm2/include/asm/io.h | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diffs (37 lines):
diff -r aab6a8efb512 -r e9d639c0c544 sys/external/bsd/drm2/include/asm/io.h
--- a/sys/external/bsd/drm2/include/asm/io.h Sun Dec 19 10:48:22 2021 +0000
+++ b/sys/external/bsd/drm2/include/asm/io.h Sun Dec 19 10:48:29 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: io.h,v 1.6 2020/01/18 02:42:23 jmcneill Exp $ */
+/* $NetBSD: io.h,v 1.7 2021/12/19 10:48:29 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -44,14 +44,14 @@
*/
#define mmiowb() membar_sync()
-#define memcpy_fromio memcpy
-#define memcpy_toio memcpy
+#define memcpy_fromio(d,s,n) memcpy((d),__UNVOLATILE(s),(n))
+#define memcpy_toio(d,s,n) memcpy(__UNVOLATILE(d),(s),(n))
#if defined(__NetBSD__) && defined(__aarch64__)
static inline void *
-memset_io(void *b, int c, size_t len)
+memset_io(volatile void *b, int c, size_t len)
{
- uint8_t *ptr = b;
+ volatile uint8_t *ptr = b;
while (len > 0) {
*ptr++ = c;
@@ -61,7 +61,7 @@
return b;
}
#else
-#define memset_io memset
+#define memset_io(b,c,n) memset(__UNVOLATILE(b),(c),(n))
#endif
/* XXX wrong place */
Home |
Main Index |
Thread Index |
Old Index