Source-Changes-HG archive

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

[src/riastradh-drm2]: src/sys/external/bsd/drm2/include/linux Fix definition ...



details:   https://anonhg.NetBSD.org/src/rev/0964a835e5b2
branches:  riastradh-drm2
changeset: 788515:0964a835e5b2
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Sep 08 15:38:35 2013 +0000

description:
Fix definition of Linux PAGE_ALIGN in <linux/mm.h>.

Can't use uvm round_page because that depends on PAGE_MASK, whose
sense we have to invert for Linux!  Plurgh.

diffstat:

 sys/external/bsd/drm2/include/linux/mm.h |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (25 lines):

diff -r fac2e90470b7 -r 0964a835e5b2 sys/external/bsd/drm2/include/linux/mm.h
--- a/sys/external/bsd/drm2/include/linux/mm.h  Sun Sep 08 15:38:04 2013 +0000
+++ b/sys/external/bsd/drm2/include/linux/mm.h  Sun Sep 08 15:38:35 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mm.h,v 1.1.2.4 2013/07/24 03:58:04 riastradh Exp $     */
+/*     $NetBSD: mm.h,v 1.1.2.5 2013/09/08 15:38:35 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -40,12 +40,13 @@
 
 #include <uvm/uvm_extern.h>
 
-#define        PAGE_ALIGN(x)   round_page(x)
-
 /* XXX Ugh bletch!  Whattakludge!  Linux's sense is reversed...  */
 #undef PAGE_MASK
 #define        PAGE_MASK       (~(PAGE_SIZE-1))
 
+#define        PAGE_ALIGN(x)           (((x) + (PAGE_SIZE-1)) & ~(PAGE_SIZE-1))
+#define        offset_in_page(x)       ((x) & (PAGE_SIZE-1))
+
 /*
  * ###################################################################
  * ############### XXX THIS NEEDS SERIOUS SCRUTINY XXX ###############



Home | Main Index | Thread Index | Old Index