From owner-svn-src-all@freebsd.org Thu Nov 12 09:18:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 422DAA2CF3F; Thu, 12 Nov 2015 09:18:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F7FA1178; Thu, 12 Nov 2015 09:18:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC9IN26058279; Thu, 12 Nov 2015 09:18:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC9IMP8058276; Thu, 12 Nov 2015 09:18:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511120918.tAC9IMP8058276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 12 Nov 2015 09:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290706 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 09:18:24 -0000 Author: hselasky Date: Thu Nov 12 09:18:22 2015 New Revision: 290706 URL: https://svnweb.freebsd.org/changeset/base/290706 Log: Build fixes: - Add some missing I/O functions for non-i386 and amd64 platforms. - Stub ioremap() to NULL using a macro to ensure non-existing memory attributes are not referred when they do not exist. - Add more header files to linux/list.h to resolve driver compilation issues on Sparc64 and PowerPC platforms. Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/io.h head/sys/compat/linuxkpi/common/include/linux/list.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/io.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/io.h Thu Nov 12 08:47:10 2015 (r290705) +++ head/sys/compat/linuxkpi/common/include/linux/io.h Thu Nov 12 09:18:22 2015 (r290706) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -106,12 +106,39 @@ iowrite32be(uint32_t v, volatile void *a *(volatile uint32_t *)addr = htobe32(v); } +#undef readb +static inline uint8_t +readb(const volatile void *addr) +{ + return *(const volatile uint8_t *)addr; +} + +#undef readw +static inline uint16_t +readw(const volatile void *addr) +{ + return *(const volatile uint16_t *)addr; +} + +#undef readl +static inline uint32_t +readl(const volatile void *addr) +{ + return *(const volatile uint32_t *)addr; +} + +#if defined(__i386__) || defined(__amd64__) void *_ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr); +#else +#define _ioremap_attr(...) NULL +#endif + #define ioremap_nocache(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE) #define ioremap_wc(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_COMBINING) -#define ioremap ioremap_nocache +#define ioremap(addr, size) \ + _ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE) void iounmap(void *addr); #define memset_io(a, b, c) memset((a), (b), (c)) Modified: head/sys/compat/linuxkpi/common/include/linux/list.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/list.h Thu Nov 12 08:47:10 2015 (r290705) +++ head/sys/compat/linuxkpi/common/include/linux/list.h Thu Nov 12 09:18:22 2015 (r290706) @@ -67,6 +67,8 @@ #include #include +#include +#include #define prefetch(x) Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Thu Nov 12 08:47:10 2015 (r290705) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Thu Nov 12 09:18:22 2015 (r290706) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -658,22 +658,20 @@ vmmap_remove(void *addr) return (vmmap); } +#if defined(__i386__) || defined(__amd64__) void * _ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr) { void *addr; -#if defined(__i386__) || defined(__amd64__) addr = pmap_mapdev_attr(phys_addr, size, attr); -#else - addr = NULL; -#endif if (addr == NULL) return (NULL); vmmap_add(addr, size); return (addr); } +#endif void iounmap(void *addr)