drm/linux: Add set_pages_uc()
authorFrançois Tigeot <ftigeot@wolfpond.org>
Fri, 22 May 2015 18:38:34 +0000 (20:38 +0200)
committerFrançois Tigeot <ftigeot@wolfpond.org>
Fri, 22 May 2015 18:39:55 +0000 (20:39 +0200)
sys/dev/drm/include/asm/cacheflush.h [copied from sys/dev/drm/include/linux/highmem.h with 68% similarity]
sys/dev/drm/include/linux/highmem.h

similarity index 68%
copy from sys/dev/drm/include/linux/highmem.h
copy to sys/dev/drm/include/asm/cacheflush.h
index 1958eff..b149a56 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 François Tigeot
+ * Copyright (c) 2015 François Tigeot
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef _LINUX_HIGHMEM_H_
-#define _LINUX_HIGHMEM_H_
+#ifndef _ASM_CACHEFLUSH_H_
+#define _ASM_CACHEFLUSH_H_
 
-#include <machine/vmparam.h>
-
-#include <linux/uaccess.h>
-
-static inline void *kmap(struct vm_page *pg)
-{
-       return (void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pg));
-}
-
-static inline void kunmap(struct vm_page *pg)
+static inline int set_pages_uc(struct vm_page *page, int num_pages)
 {
-       /* Nothing to do on systems with a direct memory map */
-}
+       pmap_change_attr(PHYS_TO_DMAP(VM_PAGE_TO_PHYS(page)),
+                        num_pages << PAGE_SHIFT, PAT_UNCACHED);
 
-static inline void *kmap_atomic(struct vm_page *pg)
-{
-       return (void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pg));
-}
-
-static inline void kunmap_atomic(void *vaddr)
-{
-       /* Nothing to do on systems with a direct memory map */
+       return 0;
 }
 
-#endif /* _LINUX_HIGHMEM_H_ */
+#endif /* _ASM_CACHEFLUSH_H_ */
index 1958eff..cee1a16 100644 (file)
@@ -31,6 +31,8 @@
 
 #include <linux/uaccess.h>
 
+#include <asm/cacheflush.h>
+
 static inline void *kmap(struct vm_page *pg)
 {
        return (void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pg));