Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Apr 2017 14:31:41 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r316656 - in head/sys/compat/linuxkpi/common: include/linux src
Message-ID:  <201704091431.v39EVfLW078861@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Sun Apr  9 14:31:41 2017
New Revision: 316656
URL: https://svnweb.freebsd.org/changeset/base/316656

Log:
  Fix compilation of LinuxKPI for PowerPC.
  
  Found by:		emaste @
  MFC after:		1 week
  Sponsored by:		Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/mm.h
  head/sys/compat/linuxkpi/common/include/linux/page.h
  head/sys/compat/linuxkpi/common/src/linux_compat.c

Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/mm.h	Sun Apr  9 12:32:22 2017	(r316655)
+++ head/sys/compat/linuxkpi/common/include/linux/mm.h	Sun Apr  9 14:31:41 2017	(r316656)
@@ -91,7 +91,7 @@ CTASSERT((VM_PROT_ALL & -(1 << 8)) == 0)
 #define	FAULT_FLAG_REMOTE	(1 << 7)
 #define	FAULT_FLAG_INSTRUCTION	(1 << 8)
 
-typedef int (*pte_fn_t)(pte_t *, pgtable_t, unsigned long addr, void *data);
+typedef int (*pte_fn_t)(linux_pte_t *, pgtable_t, unsigned long addr, void *data);
 
 struct vm_area_struct {
 	vm_offset_t vm_start;

Modified: head/sys/compat/linuxkpi/common/include/linux/page.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/page.h	Sun Apr  9 12:32:22 2017	(r316655)
+++ head/sys/compat/linuxkpi/common/include/linux/page.h	Sun Apr  9 14:31:41 2017	(r316656)
@@ -40,9 +40,9 @@
 #include <vm/vm_page.h>
 #include <vm/pmap.h>
 
-typedef unsigned long pte_t;
-typedef unsigned long pmd_t;
-typedef unsigned long pgd_t;
+typedef unsigned long linux_pte_t;
+typedef unsigned long linux_pmd_t;
+typedef unsigned long linux_pgd_t;
 typedef unsigned long pgprot_t;
 
 #define page	vm_page

Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c
==============================================================================
--- head/sys/compat/linuxkpi/common/src/linux_compat.c	Sun Apr  9 12:32:22 2017	(r316655)
+++ head/sys/compat/linuxkpi/common/src/linux_compat.c	Sun Apr  9 14:31:41 2017	(r316656)
@@ -411,7 +411,7 @@ linux_cdev_pager_populate(vm_object_t vm
 	MPASS(vmap->vm_private_data == vm_obj->handle);
 
 	/* fill out VM fault structure */
-	vmf.virtual_address = (void *)(pidx << PAGE_SHIFT);
+	vmf.virtual_address = (void *)((uintptr_t)pidx << PAGE_SHIFT);
 	vmf.flags = (fault_type & VM_PROT_WRITE) ? FAULT_FLAG_WRITE : 0;
 	vmf.pgoff = 0;
 	vmf.page = NULL;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704091431.v39EVfLW078861>