Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 4065 → Rev 4064

/drivers/include/linux/time.h
File deleted
/drivers/include/linux/rculist.h
File deleted
/drivers/include/linux/hash.h
File deleted
/drivers/include/linux/jiffies.h
130,10 → 130,6
((__s64)(a) - (__s64)(b) >= 0))
#define time_before_eq64(a,b) time_after_eq64(b,a)
 
#define time_in_range64(a, b, c) \
(time_after_eq64(a, b) && \
time_before_eq64(a, c))
 
/*
* These four macros compare jiffies and 'a' for convenience.
*/
/drivers/include/linux/compiler-gcc4.h
13,7 → 13,7
#define __must_check __attribute__((warn_unused_result))
#define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
 
#if GCC_VERSION >= 40100 && GCC_VERSION < 40600
#if GCC_VERSION >= 40100
# define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
#endif
 
/drivers/include/linux/idr.h
48,7 → 48,6
struct idr_layer *id_free;
int layers; /* only valid w/o concurrent changes */
int id_free_cnt;
int cur; /* current pos for cyclic allocation */
spinlock_t lock;
};
 
80,9 → 79,10
*/
 
void *idr_find_slowpath(struct idr *idp, int id);
int idr_pre_get(struct idr *idp, gfp_t gfp_mask);
int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id);
void idr_preload(gfp_t gfp_mask);
int idr_alloc(struct idr *idp, void *ptr, int start, int end, gfp_t gfp_mask);
int idr_alloc_cyclic(struct idr *idr, void *ptr, int start, int end, gfp_t gfp_mask);
int idr_for_each(struct idr *idp,
int (*fn)(int id, void *p, void *data), void *data);
void *idr_get_next(struct idr *idp, int *nextid);
105,7 → 105,7
 
/**
* idr_find - return pointer for given id
* @idr: idr handle
* @idp: idr handle
* @id: lookup key
*
* Return the pointer given the id it has been registered with. A %NULL
126,69 → 126,31
}
 
/**
* idr_for_each_entry - iterate over an idr's elements of a given type
* idr_get_new - allocate new idr entry
* @idp: idr handle
* @entry: the type * to use as cursor
* @id: id entry's key
*
* @entry and @id do not need to be initialized before the loop, and
* after normal terminatinon @entry is left with the value NULL. This
* is convenient for a "not found" value.
*/
#define idr_for_each_entry(idp, entry, id) \
for (id = 0; ((entry) = idr_get_next(idp, &(id))) != NULL; ++id)
 
/*
* Don't use the following functions. These exist only to suppress
* deprecated warnings on EXPORT_SYMBOL()s.
*/
int __idr_pre_get(struct idr *idp, gfp_t gfp_mask);
int __idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id);
void __idr_remove_all(struct idr *idp);
 
/**
* idr_pre_get - reserve resources for idr allocation
* @idp: idr handle
* @gfp_mask: memory allocation flags
*
* Part of old alloc interface. This is going away. Use
* idr_preload[_end]() and idr_alloc() instead.
*/
static inline int __deprecated idr_pre_get(struct idr *idp, gfp_t gfp_mask)
{
return __idr_pre_get(idp, gfp_mask);
}
 
/**
* idr_get_new_above - allocate new idr entry above or equal to a start id
* @idp: idr handle
* @ptr: pointer you want associated with the id
* @starting_id: id to start search at
* @id: pointer to the allocated handle
*
* Part of old alloc interface. This is going away. Use
* idr_preload[_end]() and idr_alloc() instead.
* Simple wrapper around idr_get_new_above() w/ @starting_id of zero.
*/
static inline int __deprecated idr_get_new_above(struct idr *idp, void *ptr,
int starting_id, int *id)
static inline int idr_get_new(struct idr *idp, void *ptr, int *id)
{
return __idr_get_new_above(idp, ptr, starting_id, id);
return idr_get_new_above(idp, ptr, 0, id);
}
 
/**
* idr_get_new - allocate new idr entry
* idr_for_each_entry - iterate over an idr's elements of a given type
* @idp: idr handle
* @ptr: pointer you want associated with the id
* @id: pointer to the allocated handle
*
* Part of old alloc interface. This is going away. Use
* idr_preload[_end]() and idr_alloc() instead.
* @entry: the type * to use as cursor
* @id: id entry's key
*/
static inline int __deprecated idr_get_new(struct idr *idp, void *ptr, int *id)
{
return __idr_get_new_above(idp, ptr, 0, id);
}
#define idr_for_each_entry(idp, entry, id) \
for (id = 0, entry = (typeof(entry))idr_get_next((idp), &(id)); \
entry != NULL; \
++id, entry = (typeof(entry))idr_get_next((idp), &(id)))
 
void __idr_remove_all(struct idr *idp); /* don't use */
 
/**
* idr_remove_all - remove all ids from the given idr tree
* @idp: idr handle
231,22 → 193,8
void ida_destroy(struct ida *ida);
void ida_init(struct ida *ida);
 
int ida_simple_get(struct ida *ida, unsigned int start, unsigned int end,
gfp_t gfp_mask);
void ida_simple_remove(struct ida *ida, unsigned int id);
void __init idr_init_cache(void);
 
/**
* ida_get_new - allocate new ID
* @ida: idr handle
* @p_id: pointer to the allocated handle
*
* Simple wrapper around ida_get_new_above() w/ @starting_id of zero.
*/
static inline int ida_get_new(struct ida *ida, int *p_id)
{
return ida_get_new_above(ida, 0, p_id);
}
 
void __init idr_init_cache(void);
 
#endif /* __IDR_H__ */
/drivers/include/linux/list.h
361,22 → 361,22
list_entry((ptr)->next, type, member)
 
/**
* list_first_entry_or_null - get the first element from a list
* @ptr: the list head to take the element from.
* @type: the type of the struct this is embedded in.
* @member: the name of the list_struct within the struct.
*
* Note that if the list is empty, it returns NULL.
* list_for_each - iterate over a list
* @pos: the &struct list_head to use as a loop cursor.
* @head: the head for your list.
*/
#define list_first_entry_or_null(ptr, type, member) \
(!list_empty(ptr) ? list_first_entry(ptr, type, member) : NULL)
#define list_for_each(pos, head) \
for (pos = (head)->next; pos != (head); pos = pos->next)
 
/**
* list_for_each - iterate over a list
* __list_for_each - iterate over a list
* @pos: the &struct list_head to use as a loop cursor.
* @head: the head for your list.
*
* This variant doesn't differ from list_for_each() any more.
* We don't do prefetching in either case.
*/
#define list_for_each(pos, head) \
#define __list_for_each(pos, head) \
for (pos = (head)->next; pos != (head); pos = pos->next)
 
/**
665,51 → 665,54
for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
pos = n)
 
#define hlist_entry_safe(ptr, type, member) \
({ typeof(ptr) ____ptr = (ptr); \
____ptr ? hlist_entry(____ptr, type, member) : NULL; \
})
 
/**
* hlist_for_each_entry - iterate over list of given type
* @pos: the type * to use as a loop cursor.
* @tpos: the type * to use as a loop cursor.
* @pos: the &struct hlist_node to use as a loop cursor.
* @head: the head for your list.
* @member: the name of the hlist_node within the struct.
*/
#define hlist_for_each_entry(pos, head, member) \
for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\
pos; \
pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))
#define hlist_for_each_entry(tpos, pos, head, member) \
for (pos = (head)->first; \
pos && \
({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
pos = pos->next)
 
/**
* hlist_for_each_entry_continue - iterate over a hlist continuing after current point
* @pos: the type * to use as a loop cursor.
* @tpos: the type * to use as a loop cursor.
* @pos: the &struct hlist_node to use as a loop cursor.
* @member: the name of the hlist_node within the struct.
*/
#define hlist_for_each_entry_continue(pos, member) \
for (pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member);\
pos; \
pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))
#define hlist_for_each_entry_continue(tpos, pos, member) \
for (pos = (pos)->next; \
pos && \
({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
pos = pos->next)
 
/**
* hlist_for_each_entry_from - iterate over a hlist continuing from current point
* @pos: the type * to use as a loop cursor.
* @tpos: the type * to use as a loop cursor.
* @pos: the &struct hlist_node to use as a loop cursor.
* @member: the name of the hlist_node within the struct.
*/
#define hlist_for_each_entry_from(pos, member) \
for (; pos; \
pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))
#define hlist_for_each_entry_from(tpos, pos, member) \
for (; pos && \
({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
pos = pos->next)
 
/**
* hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
* @pos: the type * to use as a loop cursor.
* @tpos: the type * to use as a loop cursor.
* @pos: the &struct hlist_node to use as a loop cursor.
* @n: another &struct hlist_node to use as temporary storage
* @head: the head for your list.
* @member: the name of the hlist_node within the struct.
*/
#define hlist_for_each_entry_safe(pos, n, head, member) \
for (pos = hlist_entry_safe((head)->first, typeof(*pos), member);\
pos && ({ n = pos->member.next; 1; }); \
pos = hlist_entry_safe(n, typeof(*pos), member))
#define hlist_for_each_entry_safe(tpos, pos, n, head, member) \
for (pos = (head)->first; \
pos && ({ n = pos->next; 1; }) && \
({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
pos = n)
 
#endif
/drivers/include/linux/err.h
24,17 → 24,17
return (void *) error;
}
 
static inline long __must_check PTR_ERR(__force const void *ptr)
static inline long __must_check PTR_ERR(const void *ptr)
{
return (long) ptr;
}
 
static inline long __must_check IS_ERR(__force const void *ptr)
static inline long __must_check IS_ERR(const void *ptr)
{
return IS_ERR_VALUE((unsigned long)ptr);
}
 
static inline long __must_check IS_ERR_OR_NULL(__force const void *ptr)
static inline long __must_check IS_ERR_OR_NULL(const void *ptr)
{
return !ptr || IS_ERR_VALUE((unsigned long)ptr);
}
46,13 → 46,13
* Explicitly cast an error-valued pointer to another pointer type in such a
* way as to make it clear that's what's going on.
*/
static inline void * __must_check ERR_CAST(__force const void *ptr)
static inline void * __must_check ERR_CAST(const void *ptr)
{
/* cast away the const */
return (void *) ptr;
}
 
static inline int __must_check PTR_RET(__force const void *ptr)
static inline int __must_check PTR_RET(const void *ptr)
{
if (IS_ERR(ptr))
return PTR_ERR(ptr);
/drivers/include/linux/i2c.h
55,6 → 55,7
* struct i2c_driver - represent an I2C device driver
* @class: What kind of i2c device we instantiate (for detect)
* @attach_adapter: Callback for bus addition (deprecated)
* @detach_adapter: Callback for bus removal (deprecated)
* @probe: Callback for device binding
* @remove: Callback for device unbinding
* @shutdown: Callback for device shutdown
91,10 → 92,12
struct i2c_driver {
unsigned int class;
 
/* Notifies the driver that a new bus has appeared. You should avoid
* using this, it will be removed in a near future.
/* Notifies the driver that a new bus has appeared or is about to be
* removed. You should avoid using this, it will be removed in a
* near future.
*/
int (*attach_adapter)(struct i2c_adapter *) __deprecated;
int (*detach_adapter)(struct i2c_adapter *) __deprecated;
 
/* Standard driver model interfaces */
int (*probe)(struct i2c_client *, const struct i2c_device_id *);
189,6 → 192,9
unsigned short addr;
void *platform_data;
struct dev_archdata *archdata;
#ifdef CONFIG_OF
struct device_node *of_node;
#endif
int irq;
};
 
/drivers/include/linux/slab.h
1,14 → 1,3
/*
* Written by Mark Hemment, 1996 (markhe@nextd.demon.co.uk).
*
* (C) SGI 2006, Christoph Lameter
* Cleaned up and restructured to ease the addition of alternative
* implementations of SLAB allocators.
*/
 
#ifndef _LINUX_SLAB_H
#define _LINUX_SLAB_H
 
#include <errno.h>
// stub
#endif /* _LINUX_SLAB_H */
/drivers/include/linux/mod_devicetable.h
33,7 → 33,8
__u32 model_id;
__u32 specifier_id;
__u32 version;
kernel_ulong_t driver_data;
kernel_ulong_t driver_data
__attribute__((aligned(sizeof(kernel_ulong_t))));
};
 
 
146,7 → 147,8
__u16 group;
__u32 vendor;
__u32 product;
kernel_ulong_t driver_data;
kernel_ulong_t driver_data
__attribute__((aligned(sizeof(kernel_ulong_t))));
};
 
/* s390 CCW devices */
170,6 → 172,8
struct ap_device_id {
__u16 match_flags; /* which fields to match against */
__u8 dev_type; /* device type */
__u8 pad1;
__u32 pad2;
kernel_ulong_t driver_info;
};
 
179,10 → 183,13
struct css_device_id {
__u8 match_flags;
__u8 type; /* subchannel type */
__u16 pad2;
__u32 pad3;
kernel_ulong_t driver_data;
};
 
#define ACPI_ID_LEN 9
#define ACPI_ID_LEN 16 /* only 9 bytes needed here, 16 bytes are used */
/* to workaround crosscompile issues */
 
struct acpi_device_id {
__u8 id[ACPI_ID_LEN];
223,7 → 230,11
char name[32];
char type[32];
char compatible[128];
#ifdef __KERNEL__
const void *data;
#else
kernel_ulong_t data;
#endif
};
 
/* VIO */
248,14 → 259,24
/* for pseudo multi-function devices */
__u8 device_no;
 
__u32 prod_id_hash[4];
__u32 prod_id_hash[4]
__attribute__((aligned(sizeof(__u32))));
 
/* not matched against in kernelspace*/
#ifdef __KERNEL__
const char * prod_id[4];
#else
kernel_ulong_t prod_id[4]
__attribute__((aligned(sizeof(kernel_ulong_t))));
#endif
 
/* not matched against */
kernel_ulong_t driver_info;
#ifdef __KERNEL__
char * cisfile;
#else
kernel_ulong_t cisfile;
#endif
};
 
#define PCMCIA_DEV_ID_MATCH_MANF_ID 0x0001
351,7 → 372,8
__u8 class; /* Standard interface or SDIO_ANY_ID */
__u16 vendor; /* Vendor or SDIO_ANY_ID */
__u16 device; /* Device ID or SDIO_ANY_ID */
kernel_ulong_t driver_data; /* Data private to the driver */
kernel_ulong_t driver_data /* Data private to the driver */
__attribute__((aligned(sizeof(kernel_ulong_t))));
};
 
/* SSB core, see drivers/ssb/ */
359,8 → 381,7
__u16 vendor;
__u16 coreid;
__u8 revision;
__u8 __pad;
} __attribute__((packed, aligned(2)));
};
#define SSB_DEVICE(_vendor, _coreid, _revision) \
{ .vendor = _vendor, .coreid = _coreid, .revision = _revision, }
#define SSB_DEVTABLE_END \
376,7 → 397,7
__u16 id;
__u8 rev;
__u8 class;
} __attribute__((packed,aligned(2)));
};
#define BCMA_CORE(_manuf, _id, _rev, _class) \
{ .manuf = _manuf, .id = _id, .rev = _rev, .class = _class, }
#define BCMA_CORETABLE_END \
393,23 → 414,6
};
#define VIRTIO_DEV_ANY_ID 0xffffffff
 
/*
* For Hyper-V devices we use the device guid as the id.
*/
struct hv_vmbus_device_id {
__u8 guid[16];
kernel_ulong_t driver_data; /* Data private to the driver */
};
 
/* rpmsg */
 
#define RPMSG_NAME_SIZE 32
#define RPMSG_DEVICE_MODALIAS_FMT "rpmsg:%s"
 
struct rpmsg_device_id {
char name[RPMSG_NAME_SIZE];
};
 
/* i2c */
 
#define I2C_NAME_SIZE 20
417,7 → 421,8
 
struct i2c_device_id {
char name[I2C_NAME_SIZE];
kernel_ulong_t driver_data; /* Data private to the driver */
kernel_ulong_t driver_data /* Data private to the driver */
__attribute__((aligned(sizeof(kernel_ulong_t))));
};
 
/* spi */
427,7 → 432,8
 
struct spi_device_id {
char name[SPI_NAME_SIZE];
kernel_ulong_t driver_data; /* Data private to the driver */
kernel_ulong_t driver_data /* Data private to the driver */
__attribute__((aligned(sizeof(kernel_ulong_t))));
};
 
/* dmi */
455,12 → 461,20
};
 
struct dmi_strmatch {
unsigned char slot:7;
unsigned char exact_match:1;
unsigned char slot;
char substr[79];
};
 
#ifndef __KERNEL__
struct dmi_system_id {
kernel_ulong_t callback;
kernel_ulong_t ident;
struct dmi_strmatch matches[4];
kernel_ulong_t driver_data
__attribute__((aligned(sizeof(kernel_ulong_t))));
};
#else
struct dmi_system_id {
int (*callback)(const struct dmi_system_id *);
const char *ident;
struct dmi_strmatch matches[4];
473,9 → 487,9
* error: storage size of '__mod_dmi_device_table' isn't known
*/
#define dmi_device_id dmi_system_id
#endif
 
#define DMI_MATCH(a, b) { .slot = a, .substr = b }
#define DMI_EXACT_MATCH(a, b) { .slot = a, .substr = b, .exact_match = 1 }
#define DMI_MATCH(a, b) { a, b }
 
#define PLATFORM_NAME_SIZE 20
#define PLATFORM_MODULE_PREFIX "platform:"
482,7 → 496,8
 
struct platform_device_id {
char name[PLATFORM_NAME_SIZE];
kernel_ulong_t driver_data;
kernel_ulong_t driver_data
__attribute__((aligned(sizeof(kernel_ulong_t))));
};
 
#define MDIO_MODULE_PREFIX "mdio:"
527,74 → 542,4
kernel_ulong_t driver_data; /* data private to the driver */
};
 
/**
* struct amba_id - identifies a device on an AMBA bus
* @id: The significant bits if the hardware device ID
* @mask: Bitmask specifying which bits of the id field are significant when
* matching. A driver binds to a device when ((hardware device ID) & mask)
* == id.
* @data: Private data used by the driver.
*/
struct amba_id {
unsigned int id;
unsigned int mask;
void *data;
};
 
/*
* Match x86 CPUs for CPU specific drivers.
* See documentation of "x86_match_cpu" for details.
*/
 
struct x86_cpu_id {
__u16 vendor;
__u16 family;
__u16 model;
__u16 feature; /* bit index */
kernel_ulong_t driver_data;
};
 
#define X86_FEATURE_MATCH(x) \
{ X86_VENDOR_ANY, X86_FAMILY_ANY, X86_MODEL_ANY, x }
 
#define X86_VENDOR_ANY 0xffff
#define X86_FAMILY_ANY 0
#define X86_MODEL_ANY 0
#define X86_FEATURE_ANY 0 /* Same as FPU, you can't test for that */
 
#define IPACK_ANY_FORMAT 0xff
#define IPACK_ANY_ID (~0)
struct ipack_device_id {
__u8 format; /* Format version or IPACK_ANY_ID */
__u32 vendor; /* Vendor ID or IPACK_ANY_ID */
__u32 device; /* Device ID or IPACK_ANY_ID */
};
 
#define MEI_CL_MODULE_PREFIX "mei:"
#define MEI_CL_NAME_SIZE 32
 
struct mei_cl_device_id {
char name[MEI_CL_NAME_SIZE];
kernel_ulong_t driver_info;
};
 
/* RapidIO */
 
#define RIO_ANY_ID 0xffff
 
/**
* struct rio_device_id - RIO device identifier
* @did: RapidIO device ID
* @vid: RapidIO vendor ID
* @asm_did: RapidIO assembly device ID
* @asm_vid: RapidIO assembly vendor ID
*
* Identifies a RapidIO device based on both the device/vendor IDs and
* the assembly device/vendor IDs.
*/
struct rio_device_id {
__u16 did, vid;
__u16 asm_did, asm_vid;
};
 
#endif /* LINUX_MOD_DEVICETABLE_H */
/drivers/include/linux/string.h
142,15 → 142,4
 
extern size_t memweight(const void *ptr, size_t bytes);
 
/**
* kbasename - return the last part of a pathname.
*
* @path: path to extract the filename from.
*/
static inline const char *kbasename(const char *path)
{
const char *tail = strrchr(path, '/');
return tail ? tail + 1 : path;
}
 
#endif /* _LINUX_STRING_H_ */
/drivers/include/linux/math64.h
7,7 → 7,6
#if BITS_PER_LONG == 64
 
#define div64_long(x,y) div64_s64((x),(y))
#define div64_ul(x, y) div64_u64((x), (y))
 
/**
* div_u64_rem - unsigned 64bit divide with 32bit divisor with remainder
49,7 → 48,6
#elif BITS_PER_LONG == 32
 
#define div64_long(x,y) div_s64((x),(y))
#define div64_ul(x, y) div_u64((x), (y))
 
#ifndef div_u64_rem
static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder)
/drivers/include/linux/ctype.h
61,10 → 61,4
return c | 0x20;
}
 
/* Fast check for octal digit */
static inline int isodigit(const char c)
{
return c >= '0' && c <= '7';
}
 
#endif
/drivers/include/linux/spinlock_up.h
14,10 → 14,7
* In the debug case, 1 means unlocked, 0 means locked. (the values
* are inverted, to catch initialization bugs)
*
* No atomicity anywhere, we are on UP. However, we still need
* the compiler barriers, because we do not want the compiler to
* move potentially faulting instructions (notably user accesses)
* into the locked sequence, resulting in non-atomic execution.
* No atomicity anywhere, we are on UP.
*/
 
#ifdef CONFIG_DEBUG_SPINLOCK