From owner-svn-src-all@freebsd.org Tue May 30 17:16:10 2017 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 F0CBAB88EDE; Tue, 30 May 2017 17:16:10 +0000 (UTC) (envelope-from markj@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 B29207042A; Tue, 30 May 2017 17:16:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4UHG9Yc035974; Tue, 30 May 2017 17:16:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UHG9JZ035966; Tue, 30 May 2017 17:16:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201705301716.v4UHG9JZ035966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 30 May 2017 17:16:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319229 - head/sys/compat/linuxkpi/common/include/linux 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.23 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: Tue, 30 May 2017 17:16:11 -0000 Author: markj Date: Tue May 30 17:16:08 2017 New Revision: 319229 URL: https://svnweb.freebsd.org/changeset/base/319229 Log: Add some miscellaneous definitions to support DRM drivers. Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D10985 Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h head/sys/compat/linuxkpi/common/include/linux/device.h head/sys/compat/linuxkpi/common/include/linux/io.h head/sys/compat/linuxkpi/common/include/linux/kernel.h head/sys/compat/linuxkpi/common/include/linux/module.h head/sys/compat/linuxkpi/common/include/linux/pci.h head/sys/compat/linuxkpi/common/include/linux/preempt.h head/sys/compat/linuxkpi/common/include/linux/types.h Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/compiler.h Tue May 30 17:09:47 2017 (r319228) +++ head/sys/compat/linuxkpi/common/include/linux/compiler.h Tue May 30 17:16:08 2017 (r319229) @@ -56,6 +56,7 @@ #define __devexit #define __exit #define __rcu +#define __malloc #define ___stringify(...) #__VA_ARGS__ #define __stringify(...) ___stringify(__VA_ARGS__) #define __attribute_const__ __attribute__((__const__)) Modified: head/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/device.h Tue May 30 17:09:47 2017 (r319228) +++ head/sys/compat/linuxkpi/common/include/linux/device.h Tue May 30 17:16:08 2017 (r319229) @@ -61,6 +61,23 @@ struct class { char * (*devnode)(struct device *dev, umode_t *mode); }; +struct dev_pm_ops { + int (*suspend)(struct device *dev); + int (*suspend_late)(struct device *dev); + int (*resume)(struct device *dev); + int (*resume_early)(struct device *dev); + int (*freeze)(struct device *dev); + int (*freeze_late)(struct device *dev); + int (*thaw)(struct device *dev); + int (*poweroff)(struct device *dev); + int (*poweroff_late)(struct device *dev); + int (*restore)(struct device *dev); + int (*restore_early)(struct device *dev); + int (*runtime_suspend)(struct device *dev); + int (*runtime_resume)(struct device *dev); + int (*runtime_idle)(struct device *dev); +}; + struct device { struct device *parent; struct list_head irqents; Modified: head/sys/compat/linuxkpi/common/include/linux/io.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/io.h Tue May 30 17:09:47 2017 (r319228) +++ head/sys/compat/linuxkpi/common/include/linux/io.h Tue May 30 17:16:08 2017 (r319229) @@ -36,6 +36,7 @@ #include #include +#include static inline uint32_t __raw_readl(const volatile void *addr) Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Tue May 30 17:09:47 2017 (r319228) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Tue May 30 17:16:08 2017 (r319229) @@ -87,7 +87,9 @@ #define S64_C(x) x ## LL #define U64_C(x) x ## ULL -#define BUILD_BUG_ON(x) CTASSERT(!(x)) +#define BUILD_BUG_ON(x) CTASSERT(!(x)) +#define BUILD_BUG_ON_MSG(x, msg) BUILD_BUG_ON(x) +#define BUILD_BUG_ON_NOT_POWER_OF_2(x) BUILD_BUG_ON(!powerof2(x)) #define BUG() panic("BUG at %s:%d", __FILE__, __LINE__) #define BUG_ON(cond) do { \ @@ -118,6 +120,8 @@ } \ unlikely(__ret); \ }) + +#define oops_in_progress SCHEDULER_STOPPED() #undef ALIGN #define ALIGN(x, y) roundup2((x), (y)) Modified: head/sys/compat/linuxkpi/common/include/linux/module.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/module.h Tue May 30 17:09:47 2017 (r319228) +++ head/sys/compat/linuxkpi/common/include/linux/module.h Tue May 30 17:16:08 2017 (r319229) @@ -45,6 +45,8 @@ #define MODULE_AUTHOR(name) #define MODULE_DESCRIPTION(name) #define MODULE_LICENSE(name) +#define MODULE_INFO(tag, info) +#define MODULE_FIRMWARE(firmware) #define THIS_MODULE ((struct module *)0) Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Tue May 30 17:09:47 2017 (r319228) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Tue May 30 17:16:08 2017 (r319229) @@ -72,16 +72,20 @@ struct pci_device_id { #define PCI_VENDOR_ID_IBM 0x1014 #define PCI_VENDOR_ID_INTEL 0x8086 #define PCI_VENDOR_ID_MELLANOX 0x15b3 +#define PCI_VENDOR_ID_REDHAT_QUMRANET 0x1af4 #define PCI_VENDOR_ID_SERVERWORKS 0x1166 #define PCI_VENDOR_ID_SONY 0x104d #define PCI_VENDOR_ID_TOPSPIN 0x1867 #define PCI_VENDOR_ID_VIA 0x1106 +#define PCI_SUBVENDOR_ID_REDHAT_QUMRANET 0x1af4 +#define PCI_DEVICE_ID_ATI_RADEON_QY 0x5159 #define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44 #define PCI_DEVICE_ID_MELLANOX_TAVOR_BRIDGE 0x5a46 #define PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT 0x6278 #define PCI_DEVICE_ID_MELLANOX_ARBEL 0x6282 #define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c #define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274 +#define PCI_SUBDEVICE_ID_QEMU 0x1100 #define PCI_DEVFN(slot, func) ((((slot) & 0x1f) << 3) | ((func) & 0x07)) #define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) Modified: head/sys/compat/linuxkpi/common/include/linux/preempt.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/preempt.h Tue May 30 17:09:47 2017 (r319228) +++ head/sys/compat/linuxkpi/common/include/linux/preempt.h Tue May 30 17:16:08 2017 (r319229) @@ -34,4 +34,7 @@ #define in_interrupt() \ (curthread->td_intr_nesting_level || curthread->td_critnest) +#define preempt_disable() critical_enter() +#define preempt_enable() critical_exit() + #endif /* _LINUX_PREEMPT_H_ */ Modified: head/sys/compat/linuxkpi/common/include/linux/types.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/types.h Tue May 30 17:09:47 2017 (r319228) +++ head/sys/compat/linuxkpi/common/include/linux/types.h Tue May 30 17:16:08 2017 (r319229) @@ -65,6 +65,8 @@ typedef u64 phys_addr_t; #define DECLARE_BITMAP(n, bits) \ unsigned long n[howmany(bits, sizeof(long) * 8)] +typedef unsigned long irq_hw_number_t; + struct rcu_head { void *raw[2]; } __aligned(sizeof(void *));