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 Allow maximum number of ...



details:   https://anonhg.NetBSD.org/src/rev/06a600ce0ee0
branches:  trunk
changeset: 1027761:06a600ce0ee0
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 00:25:41 2021 +0000

description:
Allow maximum number of bits in DMA_BIT_MASK.

diffstat:

 sys/external/bsd/drm2/include/linux/dma-mapping.h |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (26 lines):

diff -r 90da807723a1 -r 06a600ce0ee0 sys/external/bsd/drm2/include/linux/dma-mapping.h
--- a/sys/external/bsd/drm2/include/linux/dma-mapping.h Sun Dec 19 00:25:34 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/dma-mapping.h Sun Dec 19 00:25:41 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dma-mapping.h,v 1.5 2018/08/27 06:17:40 riastradh Exp $        */
+/*     $NetBSD: dma-mapping.h,v 1.6 2021/12/19 00:25:41 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -34,12 +34,16 @@
 
 #include <sys/bus.h>
 
+#include <machine/limits.h>
+
 typedef bus_addr_t dma_addr_t;
 
 static inline uintmax_t
 DMA_BIT_MASK(unsigned nbits)
 {
 
+       if (nbits == CHAR_BIT*sizeof(uintmax_t))
+               return ~(uintmax_t)0;
        return ~(~(uintmax_t)0 << nbits);
 }
 



Home | Main Index | Thread Index | Old Index