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/linux drm/linux: Add memset32,...



details:   https://anonhg.NetBSD.org/src/rev/be05ccff0e4b
branches:  trunk
changeset: 1028525:be05ccff0e4b
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 11:14:56 2021 +0000

description:
drm/linux: Add memset32, SZ_64K, atomic_sub_return.

diffstat:

 sys/external/bsd/drm2/include/linux/atomic.h |  14 +++++++++++++-
 sys/external/bsd/drm2/include/linux/sizes.h  |   3 ++-
 sys/external/bsd/drm2/include/linux/string.h |  10 +++++++++-
 3 files changed, 24 insertions(+), 3 deletions(-)

diffs (69 lines):

diff -r 60038af7c4e5 -r be05ccff0e4b sys/external/bsd/drm2/include/linux/atomic.h
--- a/sys/external/bsd/drm2/include/linux/atomic.h      Sun Dec 19 11:14:48 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/atomic.h      Sun Dec 19 11:14:56 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atomic.h,v 1.35 2021/12/19 11:04:28 riastradh Exp $    */
+/*     $NetBSD: atomic.h,v 1.36 2021/12/19 11:14:56 riastradh Exp $    */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -113,6 +113,18 @@
        return v;
 }
 
+static inline int
+atomic_sub_return(int subtrahend, atomic_t *atomic)
+{
+       int v;
+
+       smp_mb__before_atomic();
+       v = (int)atomic_add_int_nv(&atomic->a_u.au_uint, -subtrahend);
+       smp_mb__after_atomic();
+
+       return v;
+}
+
 static inline void
 atomic_inc(atomic_t *atomic)
 {
diff -r 60038af7c4e5 -r be05ccff0e4b sys/external/bsd/drm2/include/linux/sizes.h
--- a/sys/external/bsd/drm2/include/linux/sizes.h       Sun Dec 19 11:14:48 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/sizes.h       Sun Dec 19 11:14:56 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sizes.h,v 1.1 2021/12/19 00:30:11 riastradh Exp $      */
+/*     $NetBSD: sizes.h,v 1.2 2021/12/19 11:14:56 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -33,6 +33,7 @@
 #define        _LINUX_SIZES_H_
 
 #define        SZ_8K           0x00008000
+#define        SZ_64K          0x00010000
 #define        SZ_1M           0x00100000
 #define        SZ_2M           0x00200000
 
diff -r 60038af7c4e5 -r be05ccff0e4b sys/external/bsd/drm2/include/linux/string.h
--- a/sys/external/bsd/drm2/include/linux/string.h      Sun Dec 19 11:14:48 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/string.h      Sun Dec 19 11:14:56 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: string.h,v 1.9 2021/12/19 10:48:00 riastradh Exp $     */
+/*     $NetBSD: string.h,v 1.10 2021/12/19 11:14:56 riastradh Exp $    */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -116,6 +116,14 @@
 }
 
 static inline void
+memset32(uint32_t *p, uint32_t v, size_t n)
+{
+
+       while (n --> 0)
+               *p++ = v;
+}
+
+static inline void
 memset64(uint64_t *p, uint64_t v, size_t n)
 {
 



Home | Main Index | Thread Index | Old Index