/drivers/include/linux/clocksource.h |
---|
13,6 → 13,7 |
#include <linux/time.h> |
#include <linux/list.h> |
#include <linux/cache.h> |
#include <linux/timer.h> |
#include <linux/init.h> |
#include <asm/div64.h> |
#include <asm/io.h> |
/drivers/include/linux/compiler-gcc.h |
---|
251,7 → 251,9 |
#endif |
#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ |
#if GCC_VERSION >= 50000 |
#if GCC_VERSION >= 70000 |
#define KASAN_ABI_VERSION 5 |
#elif GCC_VERSION >= 50000 |
#define KASAN_ABI_VERSION 4 |
#elif GCC_VERSION >= 40902 |
#define KASAN_ABI_VERSION 3 |
/drivers/include/linux/cpumask.h |
---|
556,7 → 556,7 |
static inline int cpumask_parse_user(const char __user *buf, int len, |
struct cpumask *dstp) |
{ |
return bitmap_parse_user(buf, len, cpumask_bits(dstp), nr_cpu_ids); |
return bitmap_parse_user(buf, len, cpumask_bits(dstp), nr_cpumask_bits); |
} |
/** |
571,7 → 571,7 |
struct cpumask *dstp) |
{ |
return bitmap_parselist_user(buf, len, cpumask_bits(dstp), |
nr_cpu_ids); |
nr_cpumask_bits); |
} |
/** |
586,7 → 586,7 |
char *nl = strchr(buf, '\n'); |
unsigned int len = nl ? (unsigned int)(nl - buf) : strlen(buf); |
return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpu_ids); |
return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpumask_bits); |
} |
/** |
598,7 → 598,7 |
*/ |
static inline int cpulist_parse(const char *buf, struct cpumask *dstp) |
{ |
return bitmap_parselist(buf, cpumask_bits(dstp), nr_cpu_ids); |
return bitmap_parselist(buf, cpumask_bits(dstp), nr_cpumask_bits); |
} |
/** |
/drivers/include/linux/export.h |
---|
8,6 → 8,15 |
* Try not to add #includes here. It slows compilation and makes kernel |
* hackers place grumpy comments in header files. |
*/ |
/* Some toolchains use a `_' prefix for all user symbols. */ |
#ifdef CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX |
#define __VMLINUX_SYMBOL(x) _##x |
#define __VMLINUX_SYMBOL_STR(x) "_" #x |
#else |
#define __VMLINUX_SYMBOL(x) x |
#define __VMLINUX_SYMBOL_STR(x) #x |
#endif |
#define EXPORT_SYMBOL(sym) |
#define EXPORT_SYMBOL_GPL(sym) |
#define EXPORT_SYMBOL_GPL_FUTURE(sym) |
/drivers/include/linux/file.h |
---|
12,5 → 12,11 |
struct file; |
extern void fput(struct file *); |
struct fd { |
struct file *file; |
unsigned int flags; |
}; |
#define FDPUT_FPUT 1 |
#define FDPUT_POS_UNLOCK 2 |
extern struct file *fget(unsigned int fd); |
#endif /* __LINUX_FILE_H */ |
/drivers/include/linux/hash.h |
---|
32,12 → 32,28 |
#error Wordsize not 32 or 64 |
#endif |
/* |
* The above primes are actively bad for hashing, since they are |
* too sparse. The 32-bit one is mostly ok, the 64-bit one causes |
* real problems. Besides, the "prime" part is pointless for the |
* multiplicative hash. |
* |
* Although a random odd number will do, it turns out that the golden |
* ratio phi = (sqrt(5)-1)/2, or its negative, has particularly nice |
* properties. |
* |
* These are the negative, (1 - phi) = (phi^2) = (3 - sqrt(5))/2. |
* (See Knuth vol 3, section 6.4, exercise 9.) |
*/ |
#define GOLDEN_RATIO_32 0x61C88647 |
#define GOLDEN_RATIO_64 0x61C8864680B583EBull |
static __always_inline u64 hash_64(u64 val, unsigned int bits) |
{ |
u64 hash = val; |
#if defined(CONFIG_ARCH_HAS_FAST_MULTIPLIER) && BITS_PER_LONG == 64 |
hash = hash * GOLDEN_RATIO_PRIME_64; |
#if BITS_PER_LONG == 64 |
hash = hash * GOLDEN_RATIO_64; |
#else |
/* Sigh, gcc can't optimise this alone like it does for 32 bits. */ |
u64 n = hash; |
/drivers/include/linux/interrupt.h |
---|
6,6 → 6,7 |
#include <linux/bitops.h> |
#include <linux/irqreturn.h> |
#include <linux/kref.h> |
#include <linux/atomic.h> |
/* |
* These correspond to the IORESOURCE_IRQ_* defines in |
* linux/ioport.h to select the interrupt line behaviour. When |
/drivers/include/linux/io.h |
---|
1,0 → 0,0 |
//stub |
/* |
* Copyright 2006 PathScale, Inc. All Rights Reserved. |
* |
* This file is free software; you can redistribute it and/or modify |
* it under the terms of version 2 of the GNU General Public License |
* as published by the Free Software Foundation. |
* |
* This program is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU General Public License for more details. |
* |
* You should have received a copy of the GNU General Public License |
* along with this program; if not, write to the Free Software Foundation, |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. |
*/ |
#ifndef _LINUX_IO_H |
#define _LINUX_IO_H |
#include <linux/types.h> |
#include <linux/init.h> |
#include <linux/bug.h> |
#include <linux/err.h> |
struct device; |
struct resource; |
#endif /* _LINUX_IO_H */ |
/drivers/include/linux/jiffies.h |
---|
354,7 → 354,7 |
* directly here and from __msecs_to_jiffies() in the case where |
* constant folding is not possible. |
*/ |
static inline unsigned long msecs_to_jiffies(const unsigned int m) |
static __always_inline unsigned long msecs_to_jiffies(const unsigned int m) |
{ |
if (__builtin_constant_p(m)) { |
if ((int)m < 0) |
/drivers/include/linux/kernel.h |
---|
201,27 → 201,27 |
/** |
* abs - return absolute value of an argument |
* @x: the value. If it is unsigned type, it is converted to signed type first |
* (s64, long or int depending on its size). |
* @x: the value. If it is unsigned type, it is converted to signed type first. |
* char is treated as if it was signed (regardless of whether it really is) |
* but the macro's return type is preserved as char. |
* |
* Return: an absolute value of x. If x is 64-bit, macro's return type is s64, |
* otherwise it is signed long. |
* Return: an absolute value of x. |
*/ |
#define abs(x) __builtin_choose_expr(sizeof(x) == sizeof(s64), ({ \ |
s64 __x = (x); \ |
(__x < 0) ? -__x : __x; \ |
}), ({ \ |
long ret; \ |
if (sizeof(x) == sizeof(long)) { \ |
long __x = (x); \ |
ret = (__x < 0) ? -__x : __x; \ |
} else { \ |
int __x = (x); \ |
ret = (__x < 0) ? -__x : __x; \ |
} \ |
ret; \ |
})) |
#define abs(x) __abs_choose_expr(x, long long, \ |
__abs_choose_expr(x, long, \ |
__abs_choose_expr(x, int, \ |
__abs_choose_expr(x, short, \ |
__abs_choose_expr(x, char, \ |
__builtin_choose_expr( \ |
__builtin_types_compatible_p(typeof(x), char), \ |
(char)({ signed char __x = (x); __x<0?-__x:__x; }), \ |
((void)0))))))) |
#define __abs_choose_expr(x, type, other) __builtin_choose_expr( \ |
__builtin_types_compatible_p(typeof(x), signed type) || \ |
__builtin_types_compatible_p(typeof(x), unsigned type), \ |
({ signed type __x = (x); __x < 0 ? -__x : __x; }), other) |
/** |
* reciprocal_scale - "scale" a value into range [0, ep_ro) |
* @val: value |
440,7 → 440,7 |
#define do_trace_printk(fmt, args...) \ |
do { \ |
static const char *trace_printk_fmt \ |
static const char *trace_printk_fmt __used \ |
__attribute__((section("__trace_printk_fmt"))) = \ |
__builtin_constant_p(fmt) ? fmt : NULL; \ |
\ |
484,7 → 484,7 |
*/ |
#define trace_puts(str) ({ \ |
static const char *trace_printk_fmt \ |
static const char *trace_printk_fmt __used \ |
__attribute__((section("__trace_printk_fmt"))) = \ |
__builtin_constant_p(str) ? str : NULL; \ |
\ |
506,7 → 506,7 |
#define ftrace_vprintk(fmt, vargs) \ |
do { \ |
if (__builtin_constant_p(fmt)) { \ |
static const char *trace_printk_fmt \ |
static const char *trace_printk_fmt __used \ |
__attribute__((section("__trace_printk_fmt"))) = \ |
__builtin_constant_p(fmt) ? fmt : NULL; \ |
\ |
/drivers/include/linux/list.h |
---|
87,7 → 87,7 |
static inline void __list_del(struct list_head * prev, struct list_head * next) |
{ |
next->prev = prev; |
prev->next = next; |
WRITE_ONCE(prev->next, next); |
} |
/** |
615,7 → 615,8 |
{ |
struct hlist_node *next = n->next; |
struct hlist_node **pprev = n->pprev; |
*pprev = next; |
WRITE_ONCE(*pprev, next); |
if (next) |
next->pprev = pprev; |
} |
/drivers/include/linux/log2.h |
---|
16,12 → 16,6 |
#include <linux/bitops.h> |
/* |
* deal with unrepresentable constant logarithms |
*/ |
extern __attribute__((const, noreturn)) |
int ____ilog2_NaN(void); |
/* |
* non-constant log of base 2 calculators |
* - the arch may override these in asm/bitops.h if they can be implemented |
* more efficiently than using fls() and fls64() |
85,7 → 79,7 |
#define ilog2(n) \ |
( \ |
__builtin_constant_p(n) ? ( \ |
(n) < 1 ? ____ilog2_NaN() : \ |
(n) < 2 ? 0 : \ |
(n) & (1ULL << 63) ? 63 : \ |
(n) & (1ULL << 62) ? 62 : \ |
(n) & (1ULL << 61) ? 61 : \ |
148,10 → 142,7 |
(n) & (1ULL << 4) ? 4 : \ |
(n) & (1ULL << 3) ? 3 : \ |
(n) & (1ULL << 2) ? 2 : \ |
(n) & (1ULL << 1) ? 1 : \ |
(n) & (1ULL << 0) ? 0 : \ |
____ilog2_NaN() \ |
) : \ |
1 ) : \ |
(sizeof(n) <= 4) ? \ |
__ilog2_u32(n) : \ |
__ilog2_u64(n) \ |
203,6 → 194,17 |
* ... and so on. |
*/ |
#define order_base_2(n) ilog2(roundup_pow_of_two(n)) |
static inline __attribute_const__ |
int __order_base_2(unsigned long n) |
{ |
return n > 1 ? ilog2(n - 1) + 1 : 0; |
} |
#define order_base_2(n) \ |
( \ |
__builtin_constant_p(n) ? ( \ |
((n) == 0 || (n) == 1) ? 0 : \ |
ilog2((n) - 1) + 1) : \ |
__order_base_2(n) \ |
) |
#endif /* _LINUX_LOG2_H */ |
/drivers/include/linux/module.h |
---|
9,6 → 9,7 |
#include <linux/list.h> |
#include <linux/compiler.h> |
#include <linux/cache.h> |
#include <linux/init.h> |
#include <linux/kobject.h> |
#include <linux/moduleparam.h> |
/drivers/include/linux/moduleparam.h |
---|
1,6 → 1,7 |
#ifndef _LINUX_MODULE_PARAMS_H |
#define _LINUX_MODULE_PARAMS_H |
/* (C) Copyright 2001, 2002 Rusty Russell IBM Corporation */ |
#include <linux/init.h> |
#include <linux/kernel.h> |
/** |
* module_param - typesafe helper for a module/cmdline parameter |
/drivers/include/linux/pci.h |
---|
59,6 → 59,11 |
struct kobject kobj; |
}; |
static inline const char *pci_slot_name(const struct pci_slot *slot) |
{ |
return kobject_name(&slot->kobj); |
} |
/* File state for mmap()s on /proc/bus/pci/X/Y */ |
enum pci_mmap_state { |
pci_mmap_io, |
352,6 → 357,7 |
unsigned int io_window_1k:1; /* Intel P2P bridge 1K I/O windows */ |
unsigned int irq_managed:1; |
unsigned int has_secondary_link:1; |
unsigned int non_compliant_bars:1; /* broken BARs; ignore them */ |
pci_dev_flags_t dev_flags; |
atomic_t enable_cnt; /* pci_enable_device has been called */ |
/drivers/include/linux/pci_ids.h |
---|
2495,6 → 2495,13 |
#define PCI_DEVICE_ID_KORENIX_JETCARDF2 0x1700 |
#define PCI_DEVICE_ID_KORENIX_JETCARDF3 0x17ff |
#define PCI_VENDOR_ID_NETRONOME 0x19ee |
#define PCI_DEVICE_ID_NETRONOME_NFP3200 0x3200 |
#define PCI_DEVICE_ID_NETRONOME_NFP3240 0x3240 |
#define PCI_DEVICE_ID_NETRONOME_NFP4000 0x4000 |
#define PCI_DEVICE_ID_NETRONOME_NFP6000 0x6000 |
#define PCI_DEVICE_ID_NETRONOME_NFP6000_VF 0x6003 |
#define PCI_VENDOR_ID_QMI 0x1a32 |
#define PCI_VENDOR_ID_AZWAVE 0x1a3b |
/drivers/include/linux/personality.h |
---|
3,43 → 3,7 |
#include <uapi/linux/personality.h> |
/* |
* Handling of different ABIs (personalities). |
*/ |
struct exec_domain; |
struct pt_regs; |
extern int register_exec_domain(struct exec_domain *); |
extern int unregister_exec_domain(struct exec_domain *); |
extern int __set_personality(unsigned int); |
/* |
* Description of an execution domain. |
* |
* The first two members are refernced from assembly source |
* and should stay where they are unless explicitly needed. |
*/ |
typedef void (*handler_t)(int, struct pt_regs *); |
struct exec_domain { |
const char *name; /* name of the execdomain */ |
handler_t handler; /* handler for syscalls */ |
unsigned char pers_low; /* lowest personality */ |
unsigned char pers_high; /* highest personality */ |
unsigned long *signal_map; /* signal mapping */ |
unsigned long *signal_invmap; /* reverse signal mapping */ |
struct map_segment *err_map; /* error mapping */ |
struct map_segment *socktype_map; /* socket type mapping */ |
struct map_segment *sockopt_map; /* socket option mapping */ |
struct map_segment *af_map; /* address family mapping */ |
struct module *module; /* module context of the ed. */ |
struct exec_domain *next; /* linked list (internal) */ |
}; |
/* |
* Return the base personality without flags. |
*/ |
#define personality(pers) (pers & PER_MASK) |
/drivers/include/linux/pm.h |
---|
25,7 → 25,7 |
#include <linux/workqueue.h> |
#include <linux/spinlock.h> |
#include <linux/wait.h> |
//#include <linux/timer.h> |
#include <linux/timer.h> |
#include <linux/completion.h> |
/* |
/drivers/include/linux/scatterlist.h |
---|
5,6 → 5,7 |
#include <linux/types.h> |
#include <linux/bug.h> |
#include <linux/mm.h> |
#include <asm/io.h> |
struct scatterlist { |
#ifdef CONFIG_DEBUG_SG |
/drivers/include/linux/seqlock.h |
---|
33,7 → 33,7 |
*/ |
#include <linux/spinlock.h> |
//#include <linux/preempt.h> |
#include <linux/preempt.h> |
#include <linux/lockdep.h> |
#include <linux/compiler.h> |
#include <asm/processor.h> |
/drivers/include/linux/string.h |
---|
127,7 → 127,11 |
extern void argv_free(char **argv); |
extern bool sysfs_streq(const char *s1, const char *s2); |
extern int strtobool(const char *s, bool *res); |
extern int kstrtobool(const char *s, bool *res); |
static inline int strtobool(const char *s, bool *res) |
{ |
return kstrtobool(s, res); |
} |
#ifdef CONFIG_BINARY_PRINTF |
int vbin_printf(u32 *bin_buf, size_t size, const char *fmt, va_list args); |
/drivers/include/linux/swap.h |
---|
2,6 → 2,9 |
#define _LINUX_SWAP_H |
#include <linux/spinlock.h> |
#include <linux/list.h> |
#include <linux/fs.h> |
#include <linux/atomic.h> |
struct notifier_block; |
/drivers/include/linux/sysfs.h |
---|
14,6 → 14,7 |
#include <linux/compiler.h> |
#include <linux/errno.h> |
#include <linux/list.h> |
#include <linux/lockdep.h> |
#include <linux/atomic.h> |
struct kobject; |
/drivers/include/linux/time.h |
---|
125,6 → 125,32 |
extern struct timespec timespec_trunc(struct timespec t, unsigned gran); |
/* |
* Validates if a timespec/timeval used to inject a time offset is valid. |
* Offsets can be postive or negative. The value of the timeval/timespec |
* is the sum of its fields, but *NOTE*: the field tv_usec/tv_nsec must |
* always be non-negative. |
*/ |
static inline bool timeval_inject_offset_valid(const struct timeval *tv) |
{ |
/* We don't check the tv_sec as it can be positive or negative */ |
/* Can't have more microseconds then a second */ |
if (tv->tv_usec < 0 || tv->tv_usec >= USEC_PER_SEC) |
return false; |
return true; |
} |
static inline bool timespec_inject_offset_valid(const struct timespec *ts) |
{ |
/* We don't check the tv_sec as it can be positive or negative */ |
/* Can't have more nanoseconds then a second */ |
if (ts->tv_nsec < 0 || ts->tv_nsec >= NSEC_PER_SEC) |
return false; |
return true; |
} |
#define CURRENT_TIME (current_kernel_time()) |
#define CURRENT_TIME_SEC ((struct timespec) { get_seconds(), 0 }) |
/drivers/include/linux/timer.h |
---|
0,0 → 1,16 |
#ifndef _LINUX_TIMER_H |
#define _LINUX_TIMER_H |
#include <linux/list.h> |
unsigned long __round_jiffies(unsigned long j, int cpu); |
unsigned long __round_jiffies_relative(unsigned long j, int cpu); |
unsigned long round_jiffies(unsigned long j); |
unsigned long round_jiffies_relative(unsigned long j); |
unsigned long __round_jiffies_up(unsigned long j, int cpu); |
unsigned long __round_jiffies_up_relative(unsigned long j, int cpu); |
unsigned long round_jiffies_up(unsigned long j); |
unsigned long round_jiffies_up_relative(unsigned long j); |
#endif |
/drivers/include/linux/timex.h |
---|
53,6 → 53,8 |
#ifndef _LINUX_TIMEX_H |
#define _LINUX_TIMEX_H |
#include <uapi/linux/timex.h> |
#define ADJ_ADJTIME 0x8000 /* switch between adjtime/adjtimex modes */ |
#define ADJ_OFFSET_SINGLESHOT 0x0001 /* old-fashioned adjtime */ |
#define ADJ_OFFSET_READONLY 0x2000 /* read-only adjtime */ |
59,6 → 61,7 |
#include <linux/compiler.h> |
#include <linux/types.h> |
#include <asm/timex.h> |
#ifndef random_get_entropy |
/* |
147,8 → 150,9 |
#define NTP_INTERVAL_FREQ (HZ) |
#define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ) |
extern int do_adjtimex(struct timex *); |
extern void hardpps(const struct timespec64 *, const struct timespec64 *); |
int read_current_timer(unsigned long *timer_val); |
void ntp_notify_cmos_timer(void); |
/drivers/include/linux/uaccess.h |
---|
0,0 → 1,20 |
#ifndef __LINUX_UACCESS_H__ |
#define __LINUX_UACCESS_H__ |
#include <linux/sched.h> |
/* |
* These routines enable/disable the pagefault handler. If disabled, it will |
* not take any locks and go straight to the fixup table. |
* |
* User access methods will not sleep when called from a pagefault_disabled() |
* environment. |
*/ |
static inline void pagefault_disable(void) |
{ |
} |
static inline void pagefault_enable(void) |
{ |
} |
#endif /* __LINUX_UACCESS_H__ */ |
/drivers/include/linux/vgaarb.h |
---|
31,7 → 31,7 |
#ifndef LINUX_VGA_H |
#define LINUX_VGA_H |
//#include <video/vga.h> |
#include <video/vga.h> |
/* Legacy VGA regions */ |
#define VGA_RSRC_NONE 0x00 |
/drivers/include/linux/vmalloc.h |
---|
4,6 → 4,8 |
#include <linux/spinlock.h> |
#include <linux/init.h> |
#include <linux/list.h> |
#include <linux/rbtree.h> |
struct vm_area_struct; /* vma defining user mapping in mm_types.h */ |
/* bits in flags of vmalloc's vm_struct below */ |
/drivers/include/linux/workqueue.h |
---|
5,7 → 5,7 |
#ifndef _LINUX_WORKQUEUE_H |
#define _LINUX_WORKQUEUE_H |
#include <linux/list.h> |
#include <linux/timer.h> |
#include <linux/linkage.h> |
#include <linux/bitops.h> |
#include <linux/lockdep.h> |