From owner-svn-src-head@freebsd.org Tue Jan 26 15:26:37 2016 Return-Path: Delivered-To: svn-src-head@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 EFC96A6E803; Tue, 26 Jan 2016 15:26:37 +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 A68411065; Tue, 26 Jan 2016 15:26:37 +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 u0QFQaeX063366; Tue, 26 Jan 2016 15:26:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QFQatQ063359; Tue, 26 Jan 2016 15:26:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601261526.u0QFQatQ063359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 26 Jan 2016 15:26:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294839 - in head/sys: compat/linuxkpi/common/include/asm compat/linuxkpi/common/include/linux dev/cxgb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 15:26:38 -0000 Author: hselasky Date: Tue Jan 26 15:26:35 2016 New Revision: 294839 URL: https://svnweb.freebsd.org/changeset/base/294839 Log: Update and add various macros to the LinuxKPI and resolve a macro redefinition issue in the cxgb driver. MFC after: 1 week Sponsored by: Mellanox Technologies Reviewed by: np @ Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h head/sys/compat/linuxkpi/common/include/linux/clocksource.h head/sys/compat/linuxkpi/common/include/linux/completion.h head/sys/compat/linuxkpi/common/include/linux/gfp.h head/sys/compat/linuxkpi/common/include/linux/kernel.h head/sys/dev/cxgb/cxgb_osdep.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic.h Tue Jan 26 15:22:04 2016 (r294838) +++ head/sys/compat/linuxkpi/common/include/asm/atomic.h Tue Jan 26 15:26:35 2016 (r294839) @@ -35,6 +35,8 @@ #include #include +#define ATOMIC_INIT(x) { .counter = (x) } + typedef struct { volatile int counter; } atomic_t; Modified: head/sys/compat/linuxkpi/common/include/linux/clocksource.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/clocksource.h Tue Jan 26 15:22:04 2016 (r294838) +++ head/sys/compat/linuxkpi/common/include/linux/clocksource.h Tue Jan 26 15:26:35 2016 (r294839) @@ -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-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,12 +29,13 @@ * $FreeBSD$ */ #ifndef _LINUX_CLOCKSOURCE_H -#define _LINUX_CLOCKSOURCE_H +#define _LINUX_CLOCKSOURCE_H #include +#define CLOCKSOURCE_MASK(x) ((cycle_t)(-1ULL >> ((-(x)) & 63))) + /* clocksource cycle base type */ typedef u64 cycle_t; - -#endif /* _LINUX_CLOCKSOURCE_H */ +#endif /* _LINUX_CLOCKSOURCE_H */ Modified: head/sys/compat/linuxkpi/common/include/linux/completion.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/completion.h Tue Jan 26 15:22:04 2016 (r294838) +++ head/sys/compat/linuxkpi/common/include/linux/completion.h Tue Jan 26 15:26:35 2016 (r294839) @@ -40,7 +40,9 @@ struct completion { #define INIT_COMPLETION(c) \ ((c).done = 0) #define init_completion(c) \ - ((c)->done = 0) + do { (c)->done = 0; } while (0) +#define reinit_completion(c) \ + do { (c)->done = 0; } while (0) #define complete(c) \ linux_complete_common((c), 0) #define complete_all(c) \ Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/gfp.h Tue Jan 26 15:22:04 2016 (r294838) +++ head/sys/compat/linuxkpi/common/include/linux/gfp.h Tue Jan 26 15:26:35 2016 (r294839) @@ -54,6 +54,7 @@ #define GFP_HIGHUSER M_WAITOK #define GFP_HIGHUSER_MOVABLE M_WAITOK #define GFP_IOFS M_NOWAIT +#define GFP_NOIO M_NOWAIT static inline void * page_address(struct page *page) Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Tue Jan 26 15:22:04 2016 (r294838) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Tue Jan 26 15:26:35 2016 (r294839) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * Copyright (c) 2014-2015 François Tigeot * All rights reserved. * @@ -159,9 +159,10 @@ #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -#define simple_strtoul strtoul -#define simple_strtol strtol -#define kstrtol(a,b,c) ({*(c) = strtol(a,0,b);}) +#define simple_strtoul(...) strtoul(__VA_ARGS__) +#define simple_strtol(...) strtol(__VA_ARGS__) +#define kstrtol(a,b,c) ({*(c) = strtol(a,0,b); 0;}) +#define kstrtoint(a,b,c) ({*(c) = strtol(a,0,b); 0;}) #define min(x, y) ((x) < (y) ? (x) : (y)) #define max(x, y) ((x) > (y) ? (x) : (y)) @@ -185,6 +186,7 @@ #define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1) #define round_down(x, y) ((x) & ~__round_mask(x, y)) +#define smp_processor_id() PCPU_GET(cpuid) #define num_possible_cpus() mp_ncpus #define num_online_cpus() mp_ncpus Modified: head/sys/dev/cxgb/cxgb_osdep.h ============================================================================== --- head/sys/dev/cxgb/cxgb_osdep.h Tue Jan 26 15:22:04 2016 (r294838) +++ head/sys/dev/cxgb/cxgb_osdep.h Tue Jan 26 15:26:35 2016 (r294839) @@ -231,7 +231,9 @@ static const int debug_flags = DBG_RX; #define le16_to_cpu(x) le16toh(x) #define cpu_to_le32(x) htole32(x) #define swab32(x) bswap32(x) -#define simple_strtoul strtoul +#ifndef simple_strtoul +#define simple_strtoul(...) strtoul(__VA_ARGS__) +#endif #ifndef LINUX_TYPES_DEFINED