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 get_order



details:   https://anonhg.NetBSD.org/src/rev/6ce477731534
branches:  trunk
changeset: 1027936:6ce477731534
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 01:18:45 2021 +0000

description:
get_order

diffstat:

 sys/external/bsd/drm2/include/asm/page.h |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (28 lines):

diff -r 82f8de4b2143 -r 6ce477731534 sys/external/bsd/drm2/include/asm/page.h
--- a/sys/external/bsd/drm2/include/asm/page.h  Sun Dec 19 01:18:39 2021 +0000
+++ b/sys/external/bsd/drm2/include/asm/page.h  Sun Dec 19 01:18:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: page.h,v 1.2 2014/07/16 20:59:58 riastradh Exp $       */
+/*     $NetBSD: page.h,v 1.3 2021/12/19 01:18:45 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -32,6 +32,7 @@
 #ifndef _ASM_PAGE_H_
 #define _ASM_PAGE_H_
 
+#include <sys/bitops.h>
 #include <sys/bus.h>
 
 #include <uvm/uvm_page.h>
@@ -56,4 +57,10 @@
        return (page_to_phys(page) >> PAGE_SHIFT);
 }
 
+static inline size_t
+get_order(size_t n)
+{
+       return fls64((n - 1) >> PAGE_SHIFT);
+}
+
 #endif /* _ASM_PAGE_H_ */



Home | Main Index | Thread Index | Old Index