Make all the LinuxKPI include files compile standalone.

Sponsored by:	Mellanox Technologies
This commit is contained in:
hselasky 2015-11-03 12:37:55 +00:00
parent 52522b4db0
commit 1973c3319b
25 changed files with 72 additions and 26 deletions

View File

@ -86,7 +86,7 @@
#define swab64 bswap64
static inline void
be16_add_cpu(u16 *var, u16 val)
be16_add_cpu(uint16_t *var, uint16_t val)
{
*var = cpu_to_be16(be16_to_cpu(*var) + val);
}

View File

@ -33,6 +33,8 @@
#ifdef _KERNEL
#include <sys/types.h>
typedef uint8_t u8;
typedef uint8_t __u8;
typedef uint16_t u16;

View File

@ -33,6 +33,7 @@
#include <sys/types.h>
#include <sys/systm.h>
#include <sys/errno.h>
#define BIT(nr) (1UL << (nr))
#ifdef __LP64__

View File

@ -32,6 +32,7 @@
#define _LINUX_CDEV_H_
#include <linux/kobject.h>
#include <linux/sysfs.h>
#include <linux/kdev_t.h>
#include <linux/list.h>

View File

@ -31,6 +31,8 @@
#ifndef _LINUX_CLOCKSOURCE_H
#define _LINUX_CLOCKSOURCE_H
#include <asm/types.h>
/* clocksource cycle base type */
typedef u64 cycle_t;

View File

@ -33,6 +33,7 @@
#include <linux/types.h>
#include <linux/kobject.h>
#include <linux/sysfs.h>
#include <linux/list.h>
#include <linux/compiler.h>
#include <linux/types.h>

View File

@ -31,7 +31,11 @@
#ifndef _LINUX_IDR_H_
#define _LINUX_IDR_H_
#include <sys/kernel.h>
#include <sys/param.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <linux/types.h>
#define IDR_BITS 5
#define IDR_SIZE (1 << IDR_BITS)

View File

@ -30,6 +30,8 @@
*/
#ifndef _LINUX_IF_ARP_H_
#define _LINUX_IF_ARP_H_
#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if_arp.h>
#endif /* _LINUX_IF_ARP_H_ */

View File

@ -31,6 +31,7 @@
#ifndef _LINUX_IF_VLAN_H_
#define _LINUX_IF_VLAN_H_
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/ethernet.h>

View File

@ -61,7 +61,7 @@ _irq_rid(struct device *dev, int irq)
return irq - dev->msix + 1;
}
static void
static inline void
_irq_handler(void *ent)
{
struct irq_ent *irqe;

View File

@ -33,6 +33,7 @@
#include <machine/vm.h>
#include <sys/endian.h>
#include <sys/types.h>
static inline uint32_t
__raw_readl(const volatile void *addr)

View File

@ -1,6 +1,8 @@
#ifndef _LINUX_JHASH_H_
#define _LINUX_JHASH_H_
#include <asm/types.h>
/* jhash.h: Jenkins hash support.
*
* Copyright (C) 1996 Bob Jenkins (bob_jenkins@burtleburtle.net)

View File

@ -59,6 +59,20 @@ struct kobject {
extern struct kobject *mm_kobj;
struct attribute {
const char *name;
struct module *owner;
mode_t mode;
};
struct kobj_attribute {
struct attribute attr;
ssize_t (*show)(struct kobject *kobj, struct kobj_attribute *attr,
char *buf);
ssize_t (*store)(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count);
};
static inline void
kobject_init(struct kobject *kobj, struct kobj_type *ktype)
{
@ -155,17 +169,4 @@ int kobject_set_name(struct kobject *kobj, const char *fmt, ...);
int kobject_init_and_add(struct kobject *kobj, struct kobj_type *ktype,
struct kobject *parent, const char *fmt, ...);
/* sysfs.h calles for 'kobject' which is defined here,
* so we need to add the include only after the 'kobject' def.
*/
#include <linux/sysfs.h>
struct kobj_attribute {
struct attribute attr;
ssize_t (*show)(struct kobject *kobj, struct kobj_attribute *attr,
char *buf);
ssize_t (*store)(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count);
};
#endif /* _LINUX_KOBJECT_H_ */

View File

@ -35,6 +35,7 @@
#include <sys/types.h>
#include <sys/refcount.h>
#include <linux/compiler.h>
#include <asm/atomic.h>
struct kref {

View File

@ -38,6 +38,7 @@
#include <linux/list.h>
#include <linux/compiler.h>
#include <linux/kobject.h>
#include <linux/sysfs.h>
#include <linux/moduleparam.h>
#include <linux/slab.h>

View File

@ -31,9 +31,13 @@
#ifndef _LINUX_NET_H_
#define _LINUX_NET_H_
#include <sys/types.h>
#include <sys/malloc.h>
#include <sys/proc.h>
#include <sys/protosw.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/errno.h>
static inline int
sock_create_kern(int family, int type, int proto, struct socket **res)

View File

@ -31,6 +31,7 @@
#ifndef _LINUX_NOTIFIER_H_
#define _LINUX_NOTIFIER_H_
#include <sys/types.h>
#include <sys/eventhandler.h>
/*

View File

@ -34,11 +34,14 @@
#include <sys/poll.h>
#include <sys/fcntl.h>
#include <linux/wait.h>
#include <linux/file.h>
typedef struct poll_table_struct {
} poll_table;
static inline void
poll_wait(struct file *filp, wait_queue_head_t *wait_address, poll_table *p)
poll_wait(struct linux_file *filp, wait_queue_head_t *wait_address, poll_table *p)
{
selrecord(curthread, &filp->f_selinfo);
}

View File

@ -31,6 +31,8 @@
#ifndef _LINUX_RADIX_TREE_H_
#define _LINUX_RADIX_TREE_H_
#include <linux/types.h>
#define RADIX_TREE_MAP_SHIFT 6
#define RADIX_TREE_MAP_SIZE (1 << RADIX_TREE_MAP_SHIFT)
#define RADIX_TREE_MAP_MASK (RADIX_TREE_MAP_SIZE - 1)

View File

@ -31,6 +31,7 @@
#ifndef _LINUX_RWLOCK_H_
#define _LINUX_RWLOCK_H_
#include <sys/types.h>
#include <sys/lock.h>
#include <sys/rwlock.h>

View File

@ -31,13 +31,11 @@
#ifndef _LINUX_SYSFS_H_
#define _LINUX_SYSFS_H_
#include <sys/types.h>
#include <sys/sysctl.h>
#include <sys/errno.h>
struct attribute {
const char *name;
struct module *owner;
mode_t mode;
};
#include <linux/kobject.h>
struct sysfs_ops {
ssize_t (*show)(struct kobject *, struct attribute *, char *);

View File

@ -28,6 +28,15 @@
#ifndef _USB_COMPAT_LINUX_H
#define _USB_COMPAT_LINUX_H
#include <sys/types.h>
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/condvar.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usbdi_util.h>
struct usb_device;
struct usb_interface;
struct usb_driver;

View File

@ -31,6 +31,11 @@
#ifndef _NET_IF_INET6_H_
#define _NET_IF_INET6_H_
#include <sys/types.h>
#include <netinet/in.h>
#include <asm/types.h>
static inline void ipv6_eth_mc_map(const struct in6_addr *addr, char *buf)
{
/*

View File

@ -31,13 +31,14 @@
#ifndef _LINUX_NET_IPV6_H_
#define _LINUX_NET_IPV6_H_
#include "opt_inet6.h"
#include <sys/types.h>
#include <netinet/in.h>
#include <linux/types.h>
#define ipv6_addr_loopback IN6_IS_ADDR_LOOPBACK
#define ipv6_addr_copy(dst, src) \
memcpy((dst), (src), sizeof(struct in6_addr))
#ifdef INET6
static inline void
ipv6_ib_mc_map(const struct in6_addr *addr, const unsigned char *broadcast,
char *buf)
@ -57,7 +58,6 @@ ipv6_ib_mc_map(const struct in6_addr *addr, const unsigned char *broadcast,
buf[9] = broadcast[9];
memcpy(&buf[10], &addr->s6_addr[6], 10);
}
#endif
static inline void __ipv6_addr_set_half(__be32 *addr,
__be32 wh, __be32 wl)

View File

@ -31,7 +31,10 @@
#ifndef _LINUX_NET_NETEVENT_H_
#define _LINUX_NET_NETEVENT_H_
#include <netinet/if_ether.h>
#include <sys/types.h>
#include <sys/eventhandler.h>
#include <linux/notifier.h>
enum netevent_notif_type {
NETEVENT_NEIGH_UPDATE = 0,