66354 lines
2.0 MiB
Executable File
66354 lines
2.0 MiB
Executable File
# 1 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c"
|
|
# 1 "<built-in>"
|
|
# 1 "<command-line>"
|
|
# 1 "././include/linux/kconfig.h" 1
|
|
|
|
|
|
|
|
# 1 "include/generated/autoconf.h" 1
|
|
# 5 "././include/linux/kconfig.h" 2
|
|
# 1 "<command-line>" 2
|
|
# 1 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c"
|
|
# 42 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c"
|
|
# 1 "include/linux/module.h" 1
|
|
# 9 "include/linux/module.h"
|
|
# 1 "include/linux/list.h" 1
|
|
|
|
|
|
|
|
# 1 "include/linux/types.h" 1
|
|
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/types.h" 1
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/types.h" 1
|
|
|
|
|
|
|
|
# 1 "include/asm-generic/int-ll64.h" 1
|
|
# 10 "include/asm-generic/int-ll64.h"
|
|
# 1 "include/uapi/asm-generic/int-ll64.h" 1
|
|
# 11 "include/uapi/asm-generic/int-ll64.h"
|
|
# 1 "arch/arm/include/generated/asm/bitsperlong.h" 1
|
|
# 1 "include/asm-generic/bitsperlong.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/asm-generic/bitsperlong.h" 1
|
|
# 5 "include/asm-generic/bitsperlong.h" 2
|
|
# 1 "arch/arm/include/generated/asm/bitsperlong.h" 2
|
|
# 12 "include/uapi/asm-generic/int-ll64.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef __signed__ char __s8;
|
|
typedef unsigned char __u8;
|
|
|
|
typedef __signed__ short __s16;
|
|
typedef unsigned short __u16;
|
|
|
|
typedef __signed__ int __s32;
|
|
typedef unsigned int __u32;
|
|
|
|
|
|
__extension__ typedef __signed__ long long __s64;
|
|
__extension__ typedef unsigned long long __u64;
|
|
# 11 "include/asm-generic/int-ll64.h" 2
|
|
|
|
|
|
|
|
|
|
typedef signed char s8;
|
|
typedef unsigned char u8;
|
|
|
|
typedef signed short s16;
|
|
typedef unsigned short u16;
|
|
|
|
typedef signed int s32;
|
|
typedef unsigned int u32;
|
|
|
|
typedef signed long long s64;
|
|
typedef unsigned long long u64;
|
|
# 5 "./arch/arm/include/asm/types.h" 2
|
|
# 5 "include/uapi/linux/types.h" 2
|
|
# 13 "include/uapi/linux/types.h"
|
|
# 1 "./include/uapi/linux/posix_types.h" 1
|
|
|
|
|
|
|
|
# 1 "include/linux/stddef.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/stddef.h" 1
|
|
# 1 "include/linux/compiler.h" 1
|
|
# 56 "include/linux/compiler.h"
|
|
# 1 "include/linux/compiler-gcc.h" 1
|
|
# 57 "include/linux/compiler.h" 2
|
|
# 85 "include/linux/compiler.h"
|
|
struct ftrace_branch_data {
|
|
const char *func;
|
|
const char *file;
|
|
unsigned line;
|
|
union {
|
|
struct {
|
|
unsigned long correct;
|
|
unsigned long incorrect;
|
|
};
|
|
struct {
|
|
unsigned long miss;
|
|
unsigned long hit;
|
|
};
|
|
unsigned long miss_hit[2];
|
|
};
|
|
};
|
|
# 199 "include/linux/compiler.h"
|
|
# 1 "include/uapi/linux/types.h" 1
|
|
# 200 "include/linux/compiler.h" 2
|
|
# 215 "include/linux/compiler.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline))
|
|
void __read_once_size(const volatile void *p, void *res, int size)
|
|
{
|
|
({ switch (size) { case 1: *(__u8 *)res = *(volatile __u8 *)p; break; case 2: *(__u16 *)res = *(volatile __u16 *)p; break; case 4: *(__u32 *)res = *(volatile __u32 *)p; break; case 8: *(__u64 *)res = *(volatile __u64 *)p; break; default: __asm__ __volatile__("": : :"memory"); __builtin_memcpy((void *)res, (const void *)p, size); __asm__ __volatile__("": : :"memory"); } });
|
|
}
|
|
# 234 "include/linux/compiler.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline))
|
|
void __read_once_size_nocheck(const volatile void *p, void *res, int size)
|
|
{
|
|
({ switch (size) { case 1: *(__u8 *)res = *(volatile __u8 *)p; break; case 2: *(__u16 *)res = *(volatile __u16 *)p; break; case 4: *(__u32 *)res = *(volatile __u32 *)p; break; case 8: *(__u64 *)res = *(volatile __u64 *)p; break; default: __asm__ __volatile__("": : :"memory"); __builtin_memcpy((void *)res, (const void *)p, size); __asm__ __volatile__("": : :"memory"); } });
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void __write_once_size(volatile void *p, void *res, int size)
|
|
{
|
|
switch (size) {
|
|
case 1: *(volatile __u8 *)p = *(__u8 *)res; break;
|
|
case 2: *(volatile __u16 *)p = *(__u16 *)res; break;
|
|
case 4: *(volatile __u32 *)p = *(__u32 *)res; break;
|
|
case 8: *(volatile __u64 *)p = *(__u64 *)res; break;
|
|
default:
|
|
__asm__ __volatile__("": : :"memory");
|
|
__builtin_memcpy((void *)p, (const void *)res, size);
|
|
__asm__ __volatile__("": : :"memory");
|
|
}
|
|
}
|
|
# 1 "include/uapi/linux/stddef.h" 2
|
|
# 5 "include/linux/stddef.h" 2
|
|
|
|
|
|
|
|
|
|
enum {
|
|
false = 0,
|
|
true = 1
|
|
};
|
|
# 5 "./include/uapi/linux/posix_types.h" 2
|
|
# 24 "./include/uapi/linux/posix_types.h"
|
|
typedef struct {
|
|
unsigned long fds_bits[1024 / (8 * sizeof(long))];
|
|
} __kernel_fd_set;
|
|
|
|
|
|
typedef void (*__kernel_sighandler_t)(int);
|
|
|
|
|
|
typedef int __kernel_key_t;
|
|
typedef int __kernel_mqd_t;
|
|
|
|
# 1 "./arch/arm/include/uapi/asm/posix_types.h" 1
|
|
# 22 "./arch/arm/include/uapi/asm/posix_types.h"
|
|
typedef unsigned short __kernel_mode_t;
|
|
|
|
|
|
typedef unsigned short __kernel_ipc_pid_t;
|
|
|
|
|
|
typedef unsigned short __kernel_uid_t;
|
|
typedef unsigned short __kernel_gid_t;
|
|
|
|
|
|
typedef unsigned short __kernel_old_dev_t;
|
|
|
|
|
|
# 1 "./include/uapi/asm-generic/posix_types.h" 1
|
|
|
|
|
|
|
|
# 1 "arch/arm/include/generated/asm/bitsperlong.h" 1
|
|
# 5 "./include/uapi/asm-generic/posix_types.h" 2
|
|
# 14 "./include/uapi/asm-generic/posix_types.h"
|
|
typedef long __kernel_long_t;
|
|
typedef unsigned long __kernel_ulong_t;
|
|
|
|
|
|
|
|
typedef __kernel_ulong_t __kernel_ino_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef int __kernel_pid_t;
|
|
# 40 "./include/uapi/asm-generic/posix_types.h"
|
|
typedef __kernel_long_t __kernel_suseconds_t;
|
|
|
|
|
|
|
|
typedef int __kernel_daddr_t;
|
|
|
|
|
|
|
|
typedef unsigned int __kernel_uid32_t;
|
|
typedef unsigned int __kernel_gid32_t;
|
|
|
|
|
|
|
|
typedef __kernel_uid_t __kernel_old_uid_t;
|
|
typedef __kernel_gid_t __kernel_old_gid_t;
|
|
# 67 "./include/uapi/asm-generic/posix_types.h"
|
|
typedef unsigned int __kernel_size_t;
|
|
typedef int __kernel_ssize_t;
|
|
typedef int __kernel_ptrdiff_t;
|
|
# 78 "./include/uapi/asm-generic/posix_types.h"
|
|
typedef struct {
|
|
int val[2];
|
|
} __kernel_fsid_t;
|
|
|
|
|
|
|
|
|
|
|
|
typedef __kernel_long_t __kernel_off_t;
|
|
typedef long long __kernel_loff_t;
|
|
typedef __kernel_long_t __kernel_time_t;
|
|
typedef __kernel_long_t __kernel_clock_t;
|
|
typedef int __kernel_timer_t;
|
|
typedef int __kernel_clockid_t;
|
|
typedef char * __kernel_caddr_t;
|
|
typedef unsigned short __kernel_uid16_t;
|
|
typedef unsigned short __kernel_gid16_t;
|
|
# 36 "./arch/arm/include/uapi/asm/posix_types.h" 2
|
|
# 36 "./include/uapi/linux/posix_types.h" 2
|
|
# 14 "include/uapi/linux/types.h" 2
|
|
# 32 "include/uapi/linux/types.h"
|
|
typedef __u16 __le16;
|
|
typedef __u16 __be16;
|
|
typedef __u32 __le32;
|
|
typedef __u32 __be32;
|
|
typedef __u64 __le64;
|
|
typedef __u64 __be64;
|
|
|
|
typedef __u16 __sum16;
|
|
typedef __u32 __wsum;
|
|
# 6 "include/linux/types.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef __u32 __kernel_dev_t;
|
|
|
|
typedef __kernel_fd_set fd_set;
|
|
typedef __kernel_dev_t dev_t;
|
|
typedef __kernel_ino_t ino_t;
|
|
typedef __kernel_mode_t mode_t;
|
|
typedef unsigned short umode_t;
|
|
typedef __u32 nlink_t;
|
|
typedef __kernel_off_t off_t;
|
|
typedef __kernel_pid_t pid_t;
|
|
typedef __kernel_daddr_t daddr_t;
|
|
typedef __kernel_key_t key_t;
|
|
typedef __kernel_suseconds_t suseconds_t;
|
|
typedef __kernel_timer_t timer_t;
|
|
typedef __kernel_clockid_t clockid_t;
|
|
typedef __kernel_mqd_t mqd_t;
|
|
|
|
typedef _Bool bool;
|
|
|
|
typedef __kernel_uid32_t uid_t;
|
|
typedef __kernel_gid32_t gid_t;
|
|
typedef __kernel_uid16_t uid16_t;
|
|
typedef __kernel_gid16_t gid16_t;
|
|
|
|
typedef unsigned long uintptr_t;
|
|
|
|
|
|
|
|
typedef __kernel_old_uid_t old_uid_t;
|
|
typedef __kernel_old_gid_t old_gid_t;
|
|
|
|
|
|
|
|
typedef __kernel_loff_t loff_t;
|
|
# 54 "include/linux/types.h"
|
|
typedef __kernel_size_t size_t;
|
|
|
|
|
|
|
|
|
|
typedef __kernel_ssize_t ssize_t;
|
|
|
|
|
|
|
|
|
|
typedef __kernel_ptrdiff_t ptrdiff_t;
|
|
|
|
|
|
|
|
|
|
typedef __kernel_time_t time_t;
|
|
|
|
|
|
|
|
|
|
typedef __kernel_clock_t clock_t;
|
|
|
|
|
|
|
|
|
|
typedef __kernel_caddr_t caddr_t;
|
|
|
|
|
|
|
|
typedef unsigned char u_char;
|
|
typedef unsigned short u_short;
|
|
typedef unsigned int u_int;
|
|
typedef unsigned long u_long;
|
|
|
|
|
|
typedef unsigned char unchar;
|
|
typedef unsigned short ushort;
|
|
typedef unsigned int uint;
|
|
typedef unsigned long ulong;
|
|
|
|
|
|
|
|
|
|
typedef __u8 u_int8_t;
|
|
typedef __s8 int8_t;
|
|
typedef __u16 u_int16_t;
|
|
typedef __s16 int16_t;
|
|
typedef __u32 u_int32_t;
|
|
typedef __s32 int32_t;
|
|
|
|
|
|
|
|
typedef __u8 uint8_t;
|
|
typedef __u16 uint16_t;
|
|
typedef __u32 uint32_t;
|
|
|
|
|
|
typedef __u64 uint64_t;
|
|
typedef __u64 u_int64_t;
|
|
typedef __s64 int64_t;
|
|
# 130 "include/linux/types.h"
|
|
typedef u64 sector_t;
|
|
typedef u64 blkcnt_t;
|
|
# 154 "include/linux/types.h"
|
|
typedef u32 dma_addr_t;
|
|
|
|
|
|
typedef unsigned gfp_t;
|
|
typedef unsigned fmode_t;
|
|
typedef unsigned oom_flags_t;
|
|
|
|
|
|
|
|
|
|
typedef u32 phys_addr_t;
|
|
|
|
|
|
typedef phys_addr_t resource_size_t;
|
|
|
|
|
|
|
|
|
|
|
|
typedef unsigned long irq_hw_number_t;
|
|
|
|
typedef struct {
|
|
int counter;
|
|
} atomic_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct list_head {
|
|
struct list_head *next, *prev;
|
|
};
|
|
|
|
struct hlist_head {
|
|
struct hlist_node *first;
|
|
};
|
|
|
|
struct hlist_node {
|
|
struct hlist_node *next, **pprev;
|
|
};
|
|
|
|
struct ustat {
|
|
__kernel_daddr_t f_tfree;
|
|
__kernel_ino_t f_tinode;
|
|
char f_fname[6];
|
|
char f_fpack[6];
|
|
};
|
|
# 223 "include/linux/types.h"
|
|
struct callback_head {
|
|
struct callback_head *next;
|
|
void (*func)(struct callback_head *head);
|
|
} __attribute__((aligned(sizeof(void *))));
|
|
|
|
|
|
typedef void (*rcu_callback_t)(struct callback_head *head);
|
|
typedef void (*call_rcu_func_t)(struct callback_head *head, rcu_callback_t func);
|
|
|
|
|
|
typedef u64 cycle_t;
|
|
# 5 "include/linux/list.h" 2
|
|
|
|
# 1 "include/linux/poison.h" 1
|
|
# 7 "include/linux/list.h" 2
|
|
# 1 "./include/uapi/linux/const.h" 1
|
|
# 8 "include/linux/list.h" 2
|
|
# 1 "include/linux/kernel.h" 1
|
|
|
|
|
|
|
|
|
|
# 1 "/opt/trendchip/buildroot-gcc493_glibc222_arm32_32bServer/usr/lib/gcc/arm-buildroot-linux-gnueabi/4.9.3/include/stdarg.h" 1 3 4
|
|
# 40 "/opt/trendchip/buildroot-gcc493_glibc222_arm32_32bServer/usr/lib/gcc/arm-buildroot-linux-gnueabi/4.9.3/include/stdarg.h" 3 4
|
|
typedef __builtin_va_list __gnuc_va_list;
|
|
# 98 "/opt/trendchip/buildroot-gcc493_glibc222_arm32_32bServer/usr/lib/gcc/arm-buildroot-linux-gnueabi/4.9.3/include/stdarg.h" 3 4
|
|
typedef __gnuc_va_list va_list;
|
|
# 6 "include/linux/kernel.h" 2
|
|
# 1 "include/linux/linkage.h" 1
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/stringify.h" 1
|
|
# 6 "include/linux/linkage.h" 2
|
|
# 1 "include/linux/export.h" 1
|
|
# 26 "include/linux/export.h"
|
|
struct kernel_symbol
|
|
{
|
|
unsigned long value;
|
|
const char *name;
|
|
};
|
|
|
|
|
|
extern struct module __this_module;
|
|
# 7 "include/linux/linkage.h" 2
|
|
# 1 "./arch/arm/include/asm/linkage.h" 1
|
|
# 8 "include/linux/linkage.h" 2
|
|
# 7 "include/linux/kernel.h" 2
|
|
|
|
|
|
|
|
# 1 "include/linux/bitops.h" 1
|
|
# 27 "include/linux/bitops.h"
|
|
extern unsigned int __sw_hweight8(unsigned int w);
|
|
extern unsigned int __sw_hweight16(unsigned int w);
|
|
extern unsigned int __sw_hweight32(unsigned int w);
|
|
extern unsigned long __sw_hweight64(__u64 w);
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/bitops.h" 1
|
|
# 27 "./arch/arm/include/asm/bitops.h"
|
|
# 1 "include/linux/irqflags.h" 1
|
|
# 14 "include/linux/irqflags.h"
|
|
# 1 "include/linux/typecheck.h" 1
|
|
# 15 "include/linux/irqflags.h" 2
|
|
# 1 "./arch/arm/include/asm/irqflags.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/ptrace.h" 1
|
|
# 13 "./arch/arm/include/asm/ptrace.h"
|
|
# 1 "./arch/arm/include/uapi/asm/ptrace.h" 1
|
|
# 13 "./arch/arm/include/uapi/asm/ptrace.h"
|
|
# 1 "./arch/arm/include/asm/hwcap.h" 1
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/uapi/asm/hwcap.h" 1
|
|
# 5 "./arch/arm/include/asm/hwcap.h" 2
|
|
# 13 "./arch/arm/include/asm/hwcap.h"
|
|
extern unsigned int elf_hwcap, elf_hwcap2;
|
|
# 14 "./arch/arm/include/uapi/asm/ptrace.h" 2
|
|
# 14 "./arch/arm/include/asm/ptrace.h" 2
|
|
|
|
|
|
struct pt_regs {
|
|
unsigned long uregs[18];
|
|
};
|
|
# 50 "./arch/arm/include/asm/ptrace.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int valid_user_regs(struct pt_regs *regs)
|
|
{
|
|
|
|
unsigned long mode = regs->uregs[16] & 0x0000001f;
|
|
|
|
|
|
|
|
|
|
regs->uregs[16] &= ~(0x00000040 | 0x00000100);
|
|
|
|
if ((regs->uregs[16] & 0x00000080) == 0) {
|
|
if (mode == 0x00000010)
|
|
return 1;
|
|
if (elf_hwcap & (1 << 3) && mode == 0x00000000)
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
|
|
regs->uregs[16] &= 0xff000000 | 0x00ff0000 | 0x0000ff00 | 0x00000020 | 0x00000010;
|
|
if (!(elf_hwcap & (1 << 3)))
|
|
regs->uregs[16] |= 0x00000010;
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long regs_return_value(struct pt_regs *regs)
|
|
{
|
|
return regs->uregs[0];
|
|
}
|
|
# 93 "./arch/arm/include/asm/ptrace.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void instruction_pointer_set(struct pt_regs *regs,
|
|
unsigned long val)
|
|
{
|
|
(regs)->uregs[15] = val;
|
|
}
|
|
|
|
|
|
extern unsigned long profile_pc(struct pt_regs *regs);
|
|
# 123 "./arch/arm/include/asm/ptrace.h"
|
|
extern int regs_query_register_offset(const char *name);
|
|
extern const char *regs_query_register_name(unsigned int offset);
|
|
extern bool regs_within_kernel_stack(struct pt_regs *regs, unsigned long addr);
|
|
extern unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,
|
|
unsigned int n);
|
|
# 138 "./arch/arm/include/asm/ptrace.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long regs_get_register(struct pt_regs *regs,
|
|
unsigned int offset)
|
|
{
|
|
if (__builtin_expect(!!(offset > (__builtin_offsetof(struct pt_regs, uregs[17]))), 0))
|
|
return 0;
|
|
return *(unsigned long *)((unsigned long)regs + offset);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long kernel_stack_pointer(struct pt_regs *regs)
|
|
{
|
|
return regs->uregs[13];
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long user_stack_pointer(struct pt_regs *regs)
|
|
{
|
|
return regs->uregs[13];
|
|
}
|
|
# 7 "./arch/arm/include/asm/irqflags.h" 2
|
|
# 24 "./arch/arm/include/asm/irqflags.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long arch_local_irq_save(void)
|
|
{
|
|
unsigned long flags;
|
|
|
|
asm volatile(
|
|
" mrs %0, " "cpsr" " @ arch_local_irq_save\n"
|
|
" cpsid i"
|
|
: "=r" (flags) : : "memory", "cc");
|
|
return flags;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_local_irq_enable(void)
|
|
{
|
|
asm volatile(
|
|
" cpsie i @ arch_local_irq_enable"
|
|
:
|
|
:
|
|
: "memory", "cc");
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_local_irq_disable(void)
|
|
{
|
|
asm volatile(
|
|
" cpsid i @ arch_local_irq_disable"
|
|
:
|
|
:
|
|
: "memory", "cc");
|
|
}
|
|
# 155 "./arch/arm/include/asm/irqflags.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long arch_local_save_flags(void)
|
|
{
|
|
unsigned long flags;
|
|
asm volatile(
|
|
" mrs %0, " "cpsr" " @ local_save_flags"
|
|
: "=r" (flags) : : "memory", "cc");
|
|
return flags;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_local_irq_restore(unsigned long flags)
|
|
{
|
|
asm volatile(
|
|
" msr " "cpsr_c" ", %0 @ local_irq_restore"
|
|
:
|
|
: "r" (flags)
|
|
: "memory", "cc");
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int arch_irqs_disabled_flags(unsigned long flags)
|
|
{
|
|
return flags & 0x00000080;
|
|
}
|
|
|
|
# 1 "include/asm-generic/irqflags.h" 1
|
|
# 60 "include/asm-generic/irqflags.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int arch_irqs_disabled(void)
|
|
{
|
|
return arch_irqs_disabled_flags(arch_local_save_flags());
|
|
}
|
|
# 184 "./arch/arm/include/asm/irqflags.h" 2
|
|
# 16 "include/linux/irqflags.h" 2
|
|
# 28 "./arch/arm/include/asm/bitops.h" 2
|
|
# 1 "./arch/arm/include/asm/barrier.h" 1
|
|
# 40 "./arch/arm/include/asm/barrier.h"
|
|
extern void (*soc_mb)(void);
|
|
extern void arm_heavy_mb(void);
|
|
# 29 "./arch/arm/include/asm/bitops.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ____atomic_set_bit(unsigned int bit, volatile unsigned long *p)
|
|
{
|
|
unsigned long flags;
|
|
unsigned long mask = (1UL << ((bit) % 32));
|
|
|
|
p += ((bit) / 32);
|
|
|
|
do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0);
|
|
*p |= mask;
|
|
do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ____atomic_clear_bit(unsigned int bit, volatile unsigned long *p)
|
|
{
|
|
unsigned long flags;
|
|
unsigned long mask = (1UL << ((bit) % 32));
|
|
|
|
p += ((bit) / 32);
|
|
|
|
do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0);
|
|
*p &= ~mask;
|
|
do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ____atomic_change_bit(unsigned int bit, volatile unsigned long *p)
|
|
{
|
|
unsigned long flags;
|
|
unsigned long mask = (1UL << ((bit) % 32));
|
|
|
|
p += ((bit) / 32);
|
|
|
|
do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0);
|
|
*p ^= mask;
|
|
do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
____atomic_test_and_set_bit(unsigned int bit, volatile unsigned long *p)
|
|
{
|
|
unsigned long flags;
|
|
unsigned int res;
|
|
unsigned long mask = (1UL << ((bit) % 32));
|
|
|
|
p += ((bit) / 32);
|
|
|
|
do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0);
|
|
res = *p;
|
|
*p = res | mask;
|
|
do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0);
|
|
|
|
return (res & mask) != 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
____atomic_test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
|
|
{
|
|
unsigned long flags;
|
|
unsigned int res;
|
|
unsigned long mask = (1UL << ((bit) % 32));
|
|
|
|
p += ((bit) / 32);
|
|
|
|
do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0);
|
|
res = *p;
|
|
*p = res & ~mask;
|
|
do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0);
|
|
|
|
return (res & mask) != 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
____atomic_test_and_change_bit(unsigned int bit, volatile unsigned long *p)
|
|
{
|
|
unsigned long flags;
|
|
unsigned int res;
|
|
unsigned long mask = (1UL << ((bit) % 32));
|
|
|
|
p += ((bit) / 32);
|
|
|
|
do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0);
|
|
res = *p;
|
|
*p = res ^ mask;
|
|
do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0);
|
|
|
|
return (res & mask) != 0;
|
|
}
|
|
|
|
# 1 "include/asm-generic/bitops/non-atomic.h" 1
|
|
# 15 "include/asm-generic/bitops/non-atomic.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __set_bit(int nr, volatile unsigned long *addr)
|
|
{
|
|
unsigned long mask = (1UL << ((nr) % 32));
|
|
unsigned long *p = ((unsigned long *)addr) + ((nr) / 32);
|
|
|
|
*p |= mask;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __clear_bit(int nr, volatile unsigned long *addr)
|
|
{
|
|
unsigned long mask = (1UL << ((nr) % 32));
|
|
unsigned long *p = ((unsigned long *)addr) + ((nr) / 32);
|
|
|
|
*p &= ~mask;
|
|
}
|
|
# 40 "include/asm-generic/bitops/non-atomic.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __change_bit(int nr, volatile unsigned long *addr)
|
|
{
|
|
unsigned long mask = (1UL << ((nr) % 32));
|
|
unsigned long *p = ((unsigned long *)addr) + ((nr) / 32);
|
|
|
|
*p ^= mask;
|
|
}
|
|
# 57 "include/asm-generic/bitops/non-atomic.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __test_and_set_bit(int nr, volatile unsigned long *addr)
|
|
{
|
|
unsigned long mask = (1UL << ((nr) % 32));
|
|
unsigned long *p = ((unsigned long *)addr) + ((nr) / 32);
|
|
unsigned long old = *p;
|
|
|
|
*p = old | mask;
|
|
return (old & mask) != 0;
|
|
}
|
|
# 76 "include/asm-generic/bitops/non-atomic.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __test_and_clear_bit(int nr, volatile unsigned long *addr)
|
|
{
|
|
unsigned long mask = (1UL << ((nr) % 32));
|
|
unsigned long *p = ((unsigned long *)addr) + ((nr) / 32);
|
|
unsigned long old = *p;
|
|
|
|
*p = old & ~mask;
|
|
return (old & mask) != 0;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __test_and_change_bit(int nr,
|
|
volatile unsigned long *addr)
|
|
{
|
|
unsigned long mask = (1UL << ((nr) % 32));
|
|
unsigned long *p = ((unsigned long *)addr) + ((nr) / 32);
|
|
unsigned long old = *p;
|
|
|
|
*p = old ^ mask;
|
|
return (old & mask) != 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_bit(int nr, const volatile unsigned long *addr)
|
|
{
|
|
return 1UL & (addr[((nr) / 32)] >> (nr & (32 -1)));
|
|
}
|
|
# 123 "./arch/arm/include/asm/bitops.h" 2
|
|
# 152 "./arch/arm/include/asm/bitops.h"
|
|
extern void _set_bit(int nr, volatile unsigned long * p);
|
|
extern void _clear_bit(int nr, volatile unsigned long * p);
|
|
extern void _change_bit(int nr, volatile unsigned long * p);
|
|
extern int _test_and_set_bit(int nr, volatile unsigned long * p);
|
|
extern int _test_and_clear_bit(int nr, volatile unsigned long * p);
|
|
extern int _test_and_change_bit(int nr, volatile unsigned long * p);
|
|
|
|
|
|
|
|
|
|
extern int _find_first_zero_bit_le(const void * p, unsigned size);
|
|
extern int _find_next_zero_bit_le(const void * p, int size, int offset);
|
|
extern int _find_first_bit_le(const unsigned long *p, unsigned size);
|
|
extern int _find_next_bit_le(const unsigned long *p, int size, int offset);
|
|
|
|
|
|
|
|
|
|
extern int _find_first_zero_bit_be(const void * p, unsigned size);
|
|
extern int _find_next_zero_bit_be(const void * p, int size, int offset);
|
|
extern int _find_first_bit_be(const unsigned long *p, unsigned size);
|
|
extern int _find_next_bit_be(const unsigned long *p, int size, int offset);
|
|
# 225 "./arch/arm/include/asm/bitops.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int constant_fls(int x)
|
|
{
|
|
int r = 32;
|
|
|
|
if (!x)
|
|
return 0;
|
|
if (!(x & 0xffff0000u)) {
|
|
x <<= 16;
|
|
r -= 16;
|
|
}
|
|
if (!(x & 0xff000000u)) {
|
|
x <<= 8;
|
|
r -= 8;
|
|
}
|
|
if (!(x & 0xf0000000u)) {
|
|
x <<= 4;
|
|
r -= 4;
|
|
}
|
|
if (!(x & 0xc0000000u)) {
|
|
x <<= 2;
|
|
r -= 2;
|
|
}
|
|
if (!(x & 0x80000000u)) {
|
|
x <<= 1;
|
|
r -= 1;
|
|
}
|
|
return r;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int __clz(unsigned int x)
|
|
{
|
|
unsigned int ret;
|
|
|
|
asm("clz\t%0, %1" : "=r" (ret) : "r" (x));
|
|
|
|
return ret;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fls(int x)
|
|
{
|
|
if (__builtin_constant_p(x))
|
|
return constant_fls(x);
|
|
|
|
return 32 - __clz(x);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __fls(unsigned long x)
|
|
{
|
|
return fls(x) - 1;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ffs(int x)
|
|
{
|
|
return fls(x & -x);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __ffs(unsigned long x)
|
|
{
|
|
return ffs(x) - 1;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/asm-generic/bitops/fls64.h" 1
|
|
# 18 "include/asm-generic/bitops/fls64.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) int fls64(__u64 x)
|
|
{
|
|
__u32 h = x >> 32;
|
|
if (h)
|
|
return fls(h) + 32;
|
|
return fls(x);
|
|
}
|
|
# 313 "./arch/arm/include/asm/bitops.h" 2
|
|
|
|
# 1 "include/asm-generic/bitops/sched.h" 1
|
|
# 12 "include/asm-generic/bitops/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sched_find_first_bit(const unsigned long *b)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
if (b[0])
|
|
return __ffs(b[0]);
|
|
if (b[1])
|
|
return __ffs(b[1]) + 32;
|
|
if (b[2])
|
|
return __ffs(b[2]) + 64;
|
|
return __ffs(b[3]) + 96;
|
|
|
|
|
|
|
|
}
|
|
# 315 "./arch/arm/include/asm/bitops.h" 2
|
|
# 1 "include/asm-generic/bitops/hweight.h" 1
|
|
|
|
|
|
|
|
# 1 "include/asm-generic/bitops/arch_hweight.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int __arch_hweight32(unsigned int w)
|
|
{
|
|
return __sw_hweight32(w);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int __arch_hweight16(unsigned int w)
|
|
{
|
|
return __sw_hweight16(w);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int __arch_hweight8(unsigned int w)
|
|
{
|
|
return __sw_hweight8(w);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __arch_hweight64(__u64 w)
|
|
{
|
|
return __sw_hweight64(w);
|
|
}
|
|
# 5 "include/asm-generic/bitops/hweight.h" 2
|
|
# 1 "include/asm-generic/bitops/const_hweight.h" 1
|
|
# 6 "include/asm-generic/bitops/hweight.h" 2
|
|
# 316 "./arch/arm/include/asm/bitops.h" 2
|
|
# 1 "include/asm-generic/bitops/lock.h" 1
|
|
# 317 "./arch/arm/include/asm/bitops.h" 2
|
|
# 340 "./arch/arm/include/asm/bitops.h"
|
|
# 1 "include/asm-generic/bitops/le.h" 1
|
|
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/uapi/asm/byteorder.h" 1
|
|
# 21 "./arch/arm/include/uapi/asm/byteorder.h"
|
|
# 1 "include/linux/byteorder/little_endian.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/byteorder/little_endian.h" 1
|
|
# 12 "include/uapi/linux/byteorder/little_endian.h"
|
|
# 1 "include/linux/swab.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/swab.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/swab.h" 1
|
|
# 18 "./arch/arm/include/asm/swab.h"
|
|
# 1 "./arch/arm/include/uapi/asm/swab.h" 1
|
|
# 19 "./arch/arm/include/asm/swab.h" 2
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((__const__)) __u32 __arch_swahb32(__u32 x)
|
|
{
|
|
__asm__ ("rev16 %0, %1" : "=r" (x) : "r" (x));
|
|
return x;
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((__const__)) __u32 __arch_swab32(__u32 x)
|
|
{
|
|
__asm__ ("rev %0, %1" : "=r" (x) : "r" (x));
|
|
return x;
|
|
}
|
|
# 7 "include/uapi/linux/swab.h" 2
|
|
# 46 "include/uapi/linux/swab.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((__const__)) __u16 __fswab16(__u16 val)
|
|
{
|
|
|
|
return __builtin_bswap16(val);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((__const__)) __u32 __fswab32(__u32 val)
|
|
{
|
|
|
|
return __builtin_bswap32(val);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((__const__)) __u64 __fswab64(__u64 val)
|
|
{
|
|
|
|
return __builtin_bswap64(val);
|
|
# 81 "include/uapi/linux/swab.h"
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((__const__)) __u32 __fswahw32(__u32 val)
|
|
{
|
|
|
|
|
|
|
|
return ((__u32)( (((__u32)(val) & (__u32)0x0000ffffUL) << 16) | (((__u32)(val) & (__u32)0xffff0000UL) >> 16)));
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((__const__)) __u32 __fswahb32(__u32 val)
|
|
{
|
|
|
|
return __arch_swahb32(val);
|
|
|
|
|
|
|
|
}
|
|
# 154 "include/uapi/linux/swab.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u16 __swab16p(const __u16 *p)
|
|
{
|
|
|
|
|
|
|
|
return (__builtin_constant_p((__u16)(*p)) ? ((__u16)( (((__u16)(*p) & (__u16)0x00ffU) << 8) | (((__u16)(*p) & (__u16)0xff00U) >> 8))) : __fswab16(*p));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 __swab32p(const __u32 *p)
|
|
{
|
|
|
|
|
|
|
|
return (__builtin_constant_p((__u32)(*p)) ? ((__u32)( (((__u32)(*p) & (__u32)0x000000ffUL) << 24) | (((__u32)(*p) & (__u32)0x0000ff00UL) << 8) | (((__u32)(*p) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(*p) & (__u32)0xff000000UL) >> 24))) : __fswab32(*p));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u64 __swab64p(const __u64 *p)
|
|
{
|
|
|
|
|
|
|
|
return (__builtin_constant_p((__u64)(*p)) ? ((__u64)( (((__u64)(*p) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(*p) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(*p) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(*p) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(*p) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(*p) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(*p) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(*p) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(*p));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 __swahw32p(const __u32 *p)
|
|
{
|
|
|
|
|
|
|
|
return (__builtin_constant_p((__u32)(*p)) ? ((__u32)( (((__u32)(*p) & (__u32)0x0000ffffUL) << 16) | (((__u32)(*p) & (__u32)0xffff0000UL) >> 16))) : __fswahw32(*p));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 __swahb32p(const __u32 *p)
|
|
{
|
|
|
|
|
|
|
|
return (__builtin_constant_p((__u32)(*p)) ? ((__u32)( (((__u32)(*p) & (__u32)0x00ff00ffUL) << 8) | (((__u32)(*p) & (__u32)0xff00ff00UL) >> 8))) : __fswahb32(*p));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __swab16s(__u16 *p)
|
|
{
|
|
|
|
|
|
|
|
*p = __swab16p(p);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __swab32s(__u32 *p)
|
|
{
|
|
|
|
|
|
|
|
*p = __swab32p(p);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __swab64s(__u64 *p)
|
|
{
|
|
|
|
|
|
|
|
*p = __swab64p(p);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __swahw32s(__u32 *p)
|
|
{
|
|
|
|
|
|
|
|
*p = __swahw32p(p);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __swahb32s(__u32 *p)
|
|
{
|
|
|
|
|
|
|
|
*p = __swahb32p(p);
|
|
|
|
}
|
|
# 5 "include/linux/swab.h" 2
|
|
# 13 "include/uapi/linux/byteorder/little_endian.h" 2
|
|
# 43 "include/uapi/linux/byteorder/little_endian.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __le64 __cpu_to_le64p(const __u64 *p)
|
|
{
|
|
return ( __le64)*p;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u64 __le64_to_cpup(const __le64 *p)
|
|
{
|
|
return ( __u64)*p;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __le32 __cpu_to_le32p(const __u32 *p)
|
|
{
|
|
return ( __le32)*p;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 __le32_to_cpup(const __le32 *p)
|
|
{
|
|
return ( __u32)*p;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __le16 __cpu_to_le16p(const __u16 *p)
|
|
{
|
|
return ( __le16)*p;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u16 __le16_to_cpup(const __le16 *p)
|
|
{
|
|
return ( __u16)*p;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __be64 __cpu_to_be64p(const __u64 *p)
|
|
{
|
|
return ( __be64)__swab64p(p);
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u64 __be64_to_cpup(const __be64 *p)
|
|
{
|
|
return __swab64p((__u64 *)p);
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __be32 __cpu_to_be32p(const __u32 *p)
|
|
{
|
|
return ( __be32)__swab32p(p);
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 __be32_to_cpup(const __be32 *p)
|
|
{
|
|
return __swab32p((__u32 *)p);
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __be16 __cpu_to_be16p(const __u16 *p)
|
|
{
|
|
return ( __be16)__swab16p(p);
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u16 __be16_to_cpup(const __be16 *p)
|
|
{
|
|
return __swab16p((__u16 *)p);
|
|
}
|
|
# 5 "include/linux/byteorder/little_endian.h" 2
|
|
|
|
# 1 "include/linux/byteorder/generic.h" 1
|
|
# 143 "include/linux/byteorder/generic.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void le16_add_cpu(__le16 *var, u16 val)
|
|
{
|
|
*var = (( __le16)(__u16)((( __u16)(__le16)(*var)) + val));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void le32_add_cpu(__le32 *var, u32 val)
|
|
{
|
|
*var = (( __le32)(__u32)((( __u32)(__le32)(*var)) + val));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void le64_add_cpu(__le64 *var, u64 val)
|
|
{
|
|
*var = (( __le64)(__u64)((( __u64)(__le64)(*var)) + val));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void be16_add_cpu(__be16 *var, u16 val)
|
|
{
|
|
*var = (( __be16)(__builtin_constant_p((__u16)(((__builtin_constant_p((__u16)(( __u16)(__be16)(*var))) ? ((__u16)( (((__u16)(( __u16)(__be16)(*var)) & (__u16)0x00ffU) << 8) | (((__u16)(( __u16)(__be16)(*var)) & (__u16)0xff00U) >> 8))) : __fswab16(( __u16)(__be16)(*var))) + val))) ? ((__u16)( (((__u16)(((__builtin_constant_p((__u16)(( __u16)(__be16)(*var))) ? ((__u16)( (((__u16)(( __u16)(__be16)(*var)) & (__u16)0x00ffU) << 8) | (((__u16)(( __u16)(__be16)(*var)) & (__u16)0xff00U) >> 8))) : __fswab16(( __u16)(__be16)(*var))) + val)) & (__u16)0x00ffU) << 8) | (((__u16)(((__builtin_constant_p((__u16)(( __u16)(__be16)(*var))) ? ((__u16)( (((__u16)(( __u16)(__be16)(*var)) & (__u16)0x00ffU) << 8) | (((__u16)(( __u16)(__be16)(*var)) & (__u16)0xff00U) >> 8))) : __fswab16(( __u16)(__be16)(*var))) + val)) & (__u16)0xff00U) >> 8))) : __fswab16(((__builtin_constant_p((__u16)(( __u16)(__be16)(*var))) ? ((__u16)( (((__u16)(( __u16)(__be16)(*var)) & (__u16)0x00ffU) << 8) | (((__u16)(( __u16)(__be16)(*var)) & (__u16)0xff00U) >> 8))) : __fswab16(( __u16)(__be16)(*var))) + val))));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void be32_add_cpu(__be32 *var, u32 val)
|
|
{
|
|
*var = (( __be32)(__builtin_constant_p((__u32)(((__builtin_constant_p((__u32)(( __u32)(__be32)(*var))) ? ((__u32)( (((__u32)(( __u32)(__be32)(*var)) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__be32)(*var)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__be32)(*var)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__be32)(*var)) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__be32)(*var))) + val))) ? ((__u32)( (((__u32)(((__builtin_constant_p((__u32)(( __u32)(__be32)(*var))) ? ((__u32)( (((__u32)(( __u32)(__be32)(*var)) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__be32)(*var)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__be32)(*var)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__be32)(*var)) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__be32)(*var))) + val)) & (__u32)0x000000ffUL) << 24) | (((__u32)(((__builtin_constant_p((__u32)(( __u32)(__be32)(*var))) ? ((__u32)( (((__u32)(( __u32)(__be32)(*var)) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__be32)(*var)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__be32)(*var)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__be32)(*var)) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__be32)(*var))) + val)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(((__builtin_constant_p((__u32)(( __u32)(__be32)(*var))) ? ((__u32)( (((__u32)(( __u32)(__be32)(*var)) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__be32)(*var)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__be32)(*var)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__be32)(*var)) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__be32)(*var))) + val)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(((__builtin_constant_p((__u32)(( __u32)(__be32)(*var))) ? ((__u32)( (((__u32)(( __u32)(__be32)(*var)) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__be32)(*var)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__be32)(*var)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__be32)(*var)) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__be32)(*var))) + val)) & (__u32)0xff000000UL) >> 24))) : __fswab32(((__builtin_constant_p((__u32)(( __u32)(__be32)(*var))) ? ((__u32)( (((__u32)(( __u32)(__be32)(*var)) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__be32)(*var)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__be32)(*var)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__be32)(*var)) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__be32)(*var))) + val))));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void be64_add_cpu(__be64 *var, u64 val)
|
|
{
|
|
*var = (( __be64)(__builtin_constant_p((__u64)(((__builtin_constant_p((__u64)(( __u64)(__be64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__be64)(*var))) + val))) ? ((__u64)( (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__be64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__be64)(*var))) + val)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__be64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__be64)(*var))) + val)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__be64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__be64)(*var))) + val)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__be64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__be64)(*var))) + val)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__be64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__be64)(*var))) + val)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__be64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__be64)(*var))) + val)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__be64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__be64)(*var))) + val)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(((__builtin_constant_p((__u64)(( __u64)(__be64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__be64)(*var))) + val)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(((__builtin_constant_p((__u64)(( __u64)(__be64)(*var))) ? ((__u64)( (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(( __u64)(__be64)(*var)) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(( __u64)(__be64)(*var))) + val))));
|
|
}
|
|
# 7 "include/linux/byteorder/little_endian.h" 2
|
|
# 22 "./arch/arm/include/uapi/asm/byteorder.h" 2
|
|
# 6 "include/asm-generic/bitops/le.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long find_next_zero_bit_le(const void *addr,
|
|
unsigned long size, unsigned long offset)
|
|
{
|
|
return _find_next_zero_bit_le(addr,size,offset);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long find_next_bit_le(const void *addr,
|
|
unsigned long size, unsigned long offset)
|
|
{
|
|
return _find_next_bit_le(addr,size,offset);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long find_first_zero_bit_le(const void *addr,
|
|
unsigned long size)
|
|
{
|
|
return _find_first_zero_bit_le(addr,size);
|
|
}
|
|
# 52 "include/asm-generic/bitops/le.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_bit_le(int nr, const void *addr)
|
|
{
|
|
return test_bit(nr ^ 0, addr);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_bit_le(int nr, void *addr)
|
|
{
|
|
_set_bit(nr ^ 0,addr);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_bit_le(int nr, void *addr)
|
|
{
|
|
_clear_bit(nr ^ 0,addr);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __set_bit_le(int nr, void *addr)
|
|
{
|
|
__set_bit(nr ^ 0, addr);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __clear_bit_le(int nr, void *addr)
|
|
{
|
|
__clear_bit(nr ^ 0, addr);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_and_set_bit_le(int nr, void *addr)
|
|
{
|
|
return _test_and_set_bit(nr ^ 0,addr);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_and_clear_bit_le(int nr, void *addr)
|
|
{
|
|
return _test_and_clear_bit(nr ^ 0,addr);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __test_and_set_bit_le(int nr, void *addr)
|
|
{
|
|
return __test_and_set_bit(nr ^ 0, addr);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __test_and_clear_bit_le(int nr, void *addr)
|
|
{
|
|
return __test_and_clear_bit(nr ^ 0, addr);
|
|
}
|
|
# 341 "./arch/arm/include/asm/bitops.h" 2
|
|
|
|
|
|
|
|
|
|
# 1 "include/asm-generic/bitops/ext2-atomic-setbit.h" 1
|
|
# 346 "./arch/arm/include/asm/bitops.h" 2
|
|
# 37 "include/linux/bitops.h" 2
|
|
# 60 "include/linux/bitops.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_bitmask_order(unsigned int count)
|
|
{
|
|
int order;
|
|
|
|
order = fls(count);
|
|
return order;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_count_order(unsigned int count)
|
|
{
|
|
int order;
|
|
|
|
order = fls(count) - 1;
|
|
if (count & (count - 1))
|
|
order++;
|
|
return order;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) unsigned long hweight_long(unsigned long w)
|
|
{
|
|
return sizeof(w) == 4 ? (__builtin_constant_p(w) ? ((((unsigned int) ((!!((w) & (1ULL << 0))) + (!!((w) & (1ULL << 1))) + (!!((w) & (1ULL << 2))) + (!!((w) & (1ULL << 3))) + (!!((w) & (1ULL << 4))) + (!!((w) & (1ULL << 5))) + (!!((w) & (1ULL << 6))) + (!!((w) & (1ULL << 7))))) + ((unsigned int) ((!!(((w) >> 8) & (1ULL << 0))) + (!!(((w) >> 8) & (1ULL << 1))) + (!!(((w) >> 8) & (1ULL << 2))) + (!!(((w) >> 8) & (1ULL << 3))) + (!!(((w) >> 8) & (1ULL << 4))) + (!!(((w) >> 8) & (1ULL << 5))) + (!!(((w) >> 8) & (1ULL << 6))) + (!!(((w) >> 8) & (1ULL << 7)))))) + (((unsigned int) ((!!(((w) >> 16) & (1ULL << 0))) + (!!(((w) >> 16) & (1ULL << 1))) + (!!(((w) >> 16) & (1ULL << 2))) + (!!(((w) >> 16) & (1ULL << 3))) + (!!(((w) >> 16) & (1ULL << 4))) + (!!(((w) >> 16) & (1ULL << 5))) + (!!(((w) >> 16) & (1ULL << 6))) + (!!(((w) >> 16) & (1ULL << 7))))) + ((unsigned int) ((!!((((w) >> 16) >> 8) & (1ULL << 0))) + (!!((((w) >> 16) >> 8) & (1ULL << 1))) + (!!((((w) >> 16) >> 8) & (1ULL << 2))) + (!!((((w) >> 16) >> 8) & (1ULL << 3))) + (!!((((w) >> 16) >> 8) & (1ULL << 4))) + (!!((((w) >> 16) >> 8) & (1ULL << 5))) + (!!((((w) >> 16) >> 8) & (1ULL << 6))) + (!!((((w) >> 16) >> 8) & (1ULL << 7))))))) : __arch_hweight32(w)) : (__builtin_constant_p(w) ? (((((unsigned int) ((!!((w) & (1ULL << 0))) + (!!((w) & (1ULL << 1))) + (!!((w) & (1ULL << 2))) + (!!((w) & (1ULL << 3))) + (!!((w) & (1ULL << 4))) + (!!((w) & (1ULL << 5))) + (!!((w) & (1ULL << 6))) + (!!((w) & (1ULL << 7))))) + ((unsigned int) ((!!(((w) >> 8) & (1ULL << 0))) + (!!(((w) >> 8) & (1ULL << 1))) + (!!(((w) >> 8) & (1ULL << 2))) + (!!(((w) >> 8) & (1ULL << 3))) + (!!(((w) >> 8) & (1ULL << 4))) + (!!(((w) >> 8) & (1ULL << 5))) + (!!(((w) >> 8) & (1ULL << 6))) + (!!(((w) >> 8) & (1ULL << 7)))))) + (((unsigned int) ((!!(((w) >> 16) & (1ULL << 0))) + (!!(((w) >> 16) & (1ULL << 1))) + (!!(((w) >> 16) & (1ULL << 2))) + (!!(((w) >> 16) & (1ULL << 3))) + (!!(((w) >> 16) & (1ULL << 4))) + (!!(((w) >> 16) & (1ULL << 5))) + (!!(((w) >> 16) & (1ULL << 6))) + (!!(((w) >> 16) & (1ULL << 7))))) + ((unsigned int) ((!!((((w) >> 16) >> 8) & (1ULL << 0))) + (!!((((w) >> 16) >> 8) & (1ULL << 1))) + (!!((((w) >> 16) >> 8) & (1ULL << 2))) + (!!((((w) >> 16) >> 8) & (1ULL << 3))) + (!!((((w) >> 16) >> 8) & (1ULL << 4))) + (!!((((w) >> 16) >> 8) & (1ULL << 5))) + (!!((((w) >> 16) >> 8) & (1ULL << 6))) + (!!((((w) >> 16) >> 8) & (1ULL << 7))))))) + ((((unsigned int) ((!!(((w) >> 32) & (1ULL << 0))) + (!!(((w) >> 32) & (1ULL << 1))) + (!!(((w) >> 32) & (1ULL << 2))) + (!!(((w) >> 32) & (1ULL << 3))) + (!!(((w) >> 32) & (1ULL << 4))) + (!!(((w) >> 32) & (1ULL << 5))) + (!!(((w) >> 32) & (1ULL << 6))) + (!!(((w) >> 32) & (1ULL << 7))))) + ((unsigned int) ((!!((((w) >> 32) >> 8) & (1ULL << 0))) + (!!((((w) >> 32) >> 8) & (1ULL << 1))) + (!!((((w) >> 32) >> 8) & (1ULL << 2))) + (!!((((w) >> 32) >> 8) & (1ULL << 3))) + (!!((((w) >> 32) >> 8) & (1ULL << 4))) + (!!((((w) >> 32) >> 8) & (1ULL << 5))) + (!!((((w) >> 32) >> 8) & (1ULL << 6))) + (!!((((w) >> 32) >> 8) & (1ULL << 7)))))) + (((unsigned int) ((!!((((w) >> 32) >> 16) & (1ULL << 0))) + (!!((((w) >> 32) >> 16) & (1ULL << 1))) + (!!((((w) >> 32) >> 16) & (1ULL << 2))) + (!!((((w) >> 32) >> 16) & (1ULL << 3))) + (!!((((w) >> 32) >> 16) & (1ULL << 4))) + (!!((((w) >> 32) >> 16) & (1ULL << 5))) + (!!((((w) >> 32) >> 16) & (1ULL << 6))) + (!!((((w) >> 32) >> 16) & (1ULL << 7))))) + ((unsigned int) ((!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 0))) + (!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 1))) + (!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 2))) + (!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 3))) + (!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 4))) + (!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 5))) + (!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 6))) + (!!(((((w) >> 32) >> 16) >> 8) & (1ULL << 7)))))))) : __arch_hweight64(w));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u64 rol64(__u64 word, unsigned int shift)
|
|
{
|
|
return (word << shift) | (word >> (64 - shift));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u64 ror64(__u64 word, unsigned int shift)
|
|
{
|
|
return (word >> shift) | (word << (64 - shift));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 rol32(__u32 word, unsigned int shift)
|
|
{
|
|
return (word << shift) | (word >> ((-shift) & 31));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 ror32(__u32 word, unsigned int shift)
|
|
{
|
|
return (word >> shift) | (word << (32 - shift));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u16 rol16(__u16 word, unsigned int shift)
|
|
{
|
|
return (word << shift) | (word >> (16 - shift));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u16 ror16(__u16 word, unsigned int shift)
|
|
{
|
|
return (word >> shift) | (word << (16 - shift));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u8 rol8(__u8 word, unsigned int shift)
|
|
{
|
|
return (word << shift) | (word >> (8 - shift));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u8 ror8(__u8 word, unsigned int shift)
|
|
{
|
|
return (word >> shift) | (word << (8 - shift));
|
|
}
|
|
# 170 "include/linux/bitops.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __s32 sign_extend32(__u32 value, int index)
|
|
{
|
|
__u8 shift = 31 - index;
|
|
return (__s32)(value << shift) >> shift;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __s64 sign_extend64(__u64 value, int index)
|
|
{
|
|
__u8 shift = 63 - index;
|
|
return (__s64)(value << shift) >> shift;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned fls_long(unsigned long l)
|
|
{
|
|
if (sizeof(l) == 4)
|
|
return fls(l);
|
|
return fls64(l);
|
|
}
|
|
# 202 "include/linux/bitops.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __ffs64(u64 word)
|
|
{
|
|
|
|
if (((u32)word) == 0UL)
|
|
return __ffs((u32)(word >> 32)) + 32;
|
|
|
|
|
|
|
|
return __ffs((unsigned long)word);
|
|
}
|
|
# 238 "include/linux/bitops.h"
|
|
extern unsigned long find_last_bit(const unsigned long *addr,
|
|
unsigned long size);
|
|
# 11 "include/linux/kernel.h" 2
|
|
# 1 "include/linux/log2.h" 1
|
|
# 25 "include/linux/log2.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((const))
|
|
int __ilog2_u32(u32 n)
|
|
{
|
|
return fls(n) - 1;
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((const))
|
|
int __ilog2_u64(u64 n)
|
|
{
|
|
return fls64(n) - 1;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((const))
|
|
bool is_power_of_2(unsigned long n)
|
|
{
|
|
return (n != 0 && ((n & (n - 1)) == 0));
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((const))
|
|
unsigned long __roundup_pow_of_two(unsigned long n)
|
|
{
|
|
return 1UL << fls_long(n - 1);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((const))
|
|
unsigned long __rounddown_pow_of_two(unsigned long n)
|
|
{
|
|
return 1UL << (fls_long(n) - 1);
|
|
}
|
|
# 197 "include/linux/log2.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((__const__))
|
|
int __order_base_2(unsigned long n)
|
|
{
|
|
return n > 1 ? ( __builtin_constant_p(n - 1) ? ( (n - 1) < 2 ? 0 : (n - 1) & (1ULL << 63) ? 63 : (n - 1) & (1ULL << 62) ? 62 : (n - 1) & (1ULL << 61) ? 61 : (n - 1) & (1ULL << 60) ? 60 : (n - 1) & (1ULL << 59) ? 59 : (n - 1) & (1ULL << 58) ? 58 : (n - 1) & (1ULL << 57) ? 57 : (n - 1) & (1ULL << 56) ? 56 : (n - 1) & (1ULL << 55) ? 55 : (n - 1) & (1ULL << 54) ? 54 : (n - 1) & (1ULL << 53) ? 53 : (n - 1) & (1ULL << 52) ? 52 : (n - 1) & (1ULL << 51) ? 51 : (n - 1) & (1ULL << 50) ? 50 : (n - 1) & (1ULL << 49) ? 49 : (n - 1) & (1ULL << 48) ? 48 : (n - 1) & (1ULL << 47) ? 47 : (n - 1) & (1ULL << 46) ? 46 : (n - 1) & (1ULL << 45) ? 45 : (n - 1) & (1ULL << 44) ? 44 : (n - 1) & (1ULL << 43) ? 43 : (n - 1) & (1ULL << 42) ? 42 : (n - 1) & (1ULL << 41) ? 41 : (n - 1) & (1ULL << 40) ? 40 : (n - 1) & (1ULL << 39) ? 39 : (n - 1) & (1ULL << 38) ? 38 : (n - 1) & (1ULL << 37) ? 37 : (n - 1) & (1ULL << 36) ? 36 : (n - 1) & (1ULL << 35) ? 35 : (n - 1) & (1ULL << 34) ? 34 : (n - 1) & (1ULL << 33) ? 33 : (n - 1) & (1ULL << 32) ? 32 : (n - 1) & (1ULL << 31) ? 31 : (n - 1) & (1ULL << 30) ? 30 : (n - 1) & (1ULL << 29) ? 29 : (n - 1) & (1ULL << 28) ? 28 : (n - 1) & (1ULL << 27) ? 27 : (n - 1) & (1ULL << 26) ? 26 : (n - 1) & (1ULL << 25) ? 25 : (n - 1) & (1ULL << 24) ? 24 : (n - 1) & (1ULL << 23) ? 23 : (n - 1) & (1ULL << 22) ? 22 : (n - 1) & (1ULL << 21) ? 21 : (n - 1) & (1ULL << 20) ? 20 : (n - 1) & (1ULL << 19) ? 19 : (n - 1) & (1ULL << 18) ? 18 : (n - 1) & (1ULL << 17) ? 17 : (n - 1) & (1ULL << 16) ? 16 : (n - 1) & (1ULL << 15) ? 15 : (n - 1) & (1ULL << 14) ? 14 : (n - 1) & (1ULL << 13) ? 13 : (n - 1) & (1ULL << 12) ? 12 : (n - 1) & (1ULL << 11) ? 11 : (n - 1) & (1ULL << 10) ? 10 : (n - 1) & (1ULL << 9) ? 9 : (n - 1) & (1ULL << 8) ? 8 : (n - 1) & (1ULL << 7) ? 7 : (n - 1) & (1ULL << 6) ? 6 : (n - 1) & (1ULL << 5) ? 5 : (n - 1) & (1ULL << 4) ? 4 : (n - 1) & (1ULL << 3) ? 3 : (n - 1) & (1ULL << 2) ? 2 : 1 ) : (sizeof(n - 1) <= 4) ? __ilog2_u32(n - 1) : __ilog2_u64(n - 1) ) + 1 : 0;
|
|
}
|
|
# 12 "include/linux/kernel.h" 2
|
|
|
|
# 1 "include/linux/printk.h" 1
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/init.h" 1
|
|
# 131 "include/linux/init.h"
|
|
typedef int (*initcall_t)(void);
|
|
typedef void (*exitcall_t)(void);
|
|
|
|
extern initcall_t __con_initcall_start[], __con_initcall_end[];
|
|
extern initcall_t __security_initcall_start[], __security_initcall_end[];
|
|
|
|
|
|
typedef void (*ctor_fn_t)(void);
|
|
|
|
|
|
extern int do_one_initcall(initcall_t fn);
|
|
extern char __attribute__ ((__section__(".init.data"))) boot_command_line[];
|
|
extern char *saved_command_line;
|
|
extern unsigned int reset_devices;
|
|
|
|
|
|
void setup_arch(char **);
|
|
void prepare_namespace(void);
|
|
void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) load_default_modules(void);
|
|
int __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) init_rootfs(void);
|
|
|
|
extern void (*late_time_init)(void);
|
|
|
|
extern bool initcall_debug;
|
|
# 6 "include/linux/printk.h" 2
|
|
# 1 "include/linux/kern_levels.h" 1
|
|
# 7 "include/linux/printk.h" 2
|
|
|
|
# 1 "include/linux/cache.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/kernel.h" 1
|
|
|
|
|
|
|
|
# 1 "./include/uapi/linux/sysinfo.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct sysinfo {
|
|
__kernel_long_t uptime;
|
|
__kernel_ulong_t loads[3];
|
|
__kernel_ulong_t totalram;
|
|
__kernel_ulong_t freeram;
|
|
__kernel_ulong_t sharedram;
|
|
__kernel_ulong_t bufferram;
|
|
__kernel_ulong_t totalswap;
|
|
__kernel_ulong_t freeswap;
|
|
__u16 procs;
|
|
__u16 pad;
|
|
__kernel_ulong_t totalhigh;
|
|
__kernel_ulong_t freehigh;
|
|
__u32 mem_unit;
|
|
char _f[20-2*sizeof(__kernel_ulong_t)-sizeof(__u32)];
|
|
};
|
|
# 5 "include/uapi/linux/kernel.h" 2
|
|
# 5 "include/linux/cache.h" 2
|
|
# 1 "./arch/arm/include/asm/cache.h" 1
|
|
# 6 "include/linux/cache.h" 2
|
|
# 9 "include/linux/printk.h" 2
|
|
|
|
extern const char linux_banner[];
|
|
extern const char linux_proc_banner[];
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int printk_get_level(const char *buffer)
|
|
{
|
|
if (buffer[0] == '\001' && buffer[1]) {
|
|
switch (buffer[1]) {
|
|
case '0' ... '7':
|
|
case 'd':
|
|
return buffer[1];
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const char *printk_skip_level(const char *buffer)
|
|
{
|
|
if (printk_get_level(buffer))
|
|
return buffer + 2;
|
|
|
|
return buffer;
|
|
}
|
|
# 46 "include/linux/printk.h"
|
|
extern int console_printk[];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void console_silent(void)
|
|
{
|
|
(console_printk[0]) = 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void console_verbose(void)
|
|
{
|
|
if ((console_printk[0]))
|
|
(console_printk[0]) = 15;
|
|
}
|
|
|
|
struct va_format {
|
|
const char *fmt;
|
|
va_list *va;
|
|
};
|
|
# 111 "include/linux/printk.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((format(printf, 1, 2)))
|
|
int no_printk(const char *fmt, ...)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((format(printf, 1, 2))) __attribute__((__cold__))
|
|
void early_printk(const char *s, ...) { }
|
|
|
|
|
|
typedef __attribute__((format(printf, 1, 0))) int (*printk_func_t)(const char *fmt, va_list args);
|
|
|
|
|
|
__attribute__((format(printf, 5, 0)))
|
|
int vprintk_emit(int facility, int level,
|
|
const char *dict, size_t dictlen,
|
|
const char *fmt, va_list args);
|
|
|
|
__attribute__((format(printf, 1, 0)))
|
|
int vprintk(const char *fmt, va_list args);
|
|
|
|
__attribute__((format(printf, 5, 6))) __attribute__((__cold__))
|
|
int printk_emit(int facility, int level,
|
|
const char *dict, size_t dictlen,
|
|
const char *fmt, ...);
|
|
|
|
__attribute__((format(printf, 1, 2))) __attribute__((__cold__))
|
|
int printk(const char *fmt, ...);
|
|
|
|
|
|
|
|
|
|
__attribute__((format(printf, 1, 2))) __attribute__((__cold__)) int printk_deferred(const char *fmt, ...);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern int __printk_ratelimit(const char *func);
|
|
|
|
extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
|
|
unsigned int interval_msec);
|
|
|
|
extern int printk_delay_msec;
|
|
extern int dmesg_restrict;
|
|
extern int kptr_restrict;
|
|
|
|
extern void wake_up_klogd(void);
|
|
|
|
char *log_buf_addr_get(void);
|
|
u32 log_buf_len_get(void);
|
|
void log_buf_kexec_setup(void);
|
|
void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) setup_log_buf(int early);
|
|
__attribute__((format(printf, 1, 2))) void dump_stack_set_arch_desc(const char *fmt, ...);
|
|
void dump_stack_print_info(const char *log_lvl);
|
|
void show_regs_print_info(const char *log_lvl);
|
|
# 233 "include/linux/printk.h"
|
|
extern void dump_stack(void) __attribute__((__cold__));
|
|
# 277 "include/linux/printk.h"
|
|
# 1 "include/linux/dynamic_debug.h" 1
|
|
# 9 "include/linux/dynamic_debug.h"
|
|
struct _ddebug {
|
|
|
|
|
|
|
|
|
|
const char *modname;
|
|
const char *function;
|
|
const char *filename;
|
|
const char *format;
|
|
unsigned int lineno:18;
|
|
# 35 "include/linux/dynamic_debug.h"
|
|
unsigned int flags:8;
|
|
} __attribute__((aligned(8)));
|
|
|
|
|
|
int ddebug_add_module(struct _ddebug *tab, unsigned int n,
|
|
const char *modname);
|
|
# 111 "include/linux/dynamic_debug.h"
|
|
# 1 "include/linux/string.h" 1
|
|
# 9 "include/linux/string.h"
|
|
# 1 "include/uapi/linux/string.h" 1
|
|
# 10 "include/linux/string.h" 2
|
|
|
|
extern char *strndup_user(const char *, long);
|
|
extern void *memdup_user(const void *, size_t);
|
|
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/string.h" 1
|
|
# 10 "./arch/arm/include/asm/string.h"
|
|
extern char * strrchr(const char * s, int c);
|
|
|
|
|
|
extern char * strchr(const char * s, int c);
|
|
|
|
|
|
extern void * memcpy(void *, const void *, __kernel_size_t);
|
|
|
|
|
|
extern void * memmove(void *, const void *, __kernel_size_t);
|
|
|
|
|
|
extern void * memchr(const void *, int, __kernel_size_t);
|
|
|
|
|
|
extern void * memset(void *, int, __kernel_size_t);
|
|
|
|
extern void __memzero(void *ptr, __kernel_size_t n);
|
|
# 18 "include/linux/string.h" 2
|
|
|
|
|
|
extern char * strcpy(char *,const char *);
|
|
|
|
|
|
extern char * strncpy(char *,const char *, __kernel_size_t);
|
|
|
|
|
|
size_t strlcpy(char *, const char *, size_t);
|
|
|
|
|
|
ssize_t __attribute__((warn_unused_result)) strscpy(char *, const char *, size_t);
|
|
|
|
|
|
extern char * strcat(char *, const char *);
|
|
|
|
|
|
extern char * strncat(char *, const char *, __kernel_size_t);
|
|
|
|
|
|
extern size_t strlcat(char *, const char *, __kernel_size_t);
|
|
|
|
|
|
extern int strcmp(const char *,const char *);
|
|
|
|
|
|
extern int strncmp(const char *,const char *,__kernel_size_t);
|
|
|
|
|
|
|
|
|
|
|
|
extern int strcasecmp(const char *s1, const char *s2);
|
|
|
|
|
|
extern int strncasecmp(const char *s1, const char *s2, size_t n);
|
|
|
|
|
|
|
|
|
|
|
|
extern char * strchrnul(const char *,int);
|
|
|
|
|
|
extern char * strnchr(const char *, size_t, int);
|
|
|
|
|
|
|
|
|
|
extern char * __attribute__((warn_unused_result)) skip_spaces(const char *);
|
|
|
|
extern char *strim(char *);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((warn_unused_result)) char *strstrip(char *str)
|
|
{
|
|
return strim(str);
|
|
}
|
|
|
|
|
|
extern char * strstr(const char *, const char *);
|
|
|
|
|
|
extern char * strnstr(const char *, const char *, size_t);
|
|
|
|
|
|
extern __kernel_size_t strlen(const char *);
|
|
|
|
|
|
extern __kernel_size_t strnlen(const char *,__kernel_size_t);
|
|
|
|
|
|
extern char * strpbrk(const char *,const char *);
|
|
|
|
|
|
extern char * strsep(char **,const char *);
|
|
|
|
|
|
extern __kernel_size_t strspn(const char *,const char *);
|
|
|
|
|
|
extern __kernel_size_t strcspn(const char *,const char *);
|
|
# 111 "include/linux/string.h"
|
|
extern void * memscan(void *,int,__kernel_size_t);
|
|
|
|
|
|
extern int memcmp(const void *,const void *,__kernel_size_t);
|
|
|
|
|
|
|
|
|
|
void *memchr_inv(const void *s, int c, size_t n);
|
|
char *strreplace(char *s, char old, char new);
|
|
|
|
extern void kfree_const(const void *x);
|
|
|
|
extern char *kstrdup(const char *s, gfp_t gfp);
|
|
extern const char *kstrdup_const(const char *s, gfp_t gfp);
|
|
extern char *kstrndup(const char *s, size_t len, gfp_t gfp);
|
|
extern void *kmemdup(const void *src, size_t len, gfp_t gfp);
|
|
extern char *kmemdup_nul(const char *s, size_t len, gfp_t gfp);
|
|
|
|
extern char **argv_split(gfp_t gfp, const char *str, int *argcp);
|
|
extern void argv_free(char **argv);
|
|
|
|
extern bool sysfs_streq(const char *s1, const char *s2);
|
|
extern int kstrtobool(const char *s, bool *res);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int strtobool(const char *s, bool *res)
|
|
{
|
|
return kstrtobool(s, res);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
|
|
const void *from, size_t available);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool strstarts(const char *str, const char *prefix)
|
|
{
|
|
return strncmp(str, prefix, strlen(prefix)) == 0;
|
|
}
|
|
|
|
size_t memweight(const void *ptr, size_t bytes);
|
|
void memzero_explicit(void *s, size_t count);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const char *kbasename(const char *path)
|
|
{
|
|
const char *tail = strrchr(path, '/');
|
|
return tail ? tail + 1 : path;
|
|
}
|
|
# 112 "include/linux/dynamic_debug.h" 2
|
|
# 1 "include/linux/errno.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/errno.h" 1
|
|
# 1 "arch/arm/include/generated/asm/errno.h" 1
|
|
# 1 "./include/uapi/asm-generic/errno.h" 1
|
|
|
|
|
|
|
|
# 1 "./include/uapi/asm-generic/errno-base.h" 1
|
|
# 5 "./include/uapi/asm-generic/errno.h" 2
|
|
# 1 "arch/arm/include/generated/asm/errno.h" 2
|
|
# 1 "include/uapi/linux/errno.h" 2
|
|
# 5 "include/linux/errno.h" 2
|
|
# 113 "include/linux/dynamic_debug.h" 2
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ddebug_remove_module(const char *mod)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ddebug_dyndbg_module_param_cb(char *param, char *val,
|
|
const char *modname)
|
|
{
|
|
if (strstr(param, "dyndbg")) {
|
|
|
|
printk("\001" "4" "dyndbg param is supported only in "
|
|
"CONFIG_DYNAMIC_DEBUG builds\n");
|
|
return 0;
|
|
}
|
|
return -22;
|
|
}
|
|
# 278 "include/linux/printk.h" 2
|
|
# 420 "include/linux/printk.h"
|
|
extern const struct file_operations kmsg_fops;
|
|
|
|
enum {
|
|
DUMP_PREFIX_NONE,
|
|
DUMP_PREFIX_ADDRESS,
|
|
DUMP_PREFIX_OFFSET
|
|
};
|
|
extern int hex_dump_to_buffer(const void *buf, size_t len, int rowsize,
|
|
int groupsize, char *linebuf, size_t linebuflen,
|
|
bool ascii);
|
|
|
|
extern void print_hex_dump(const char *level, const char *prefix_str,
|
|
int prefix_type, int rowsize, int groupsize,
|
|
const void *buf, size_t len, bool ascii);
|
|
|
|
|
|
|
|
|
|
extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
|
|
const void *buf, size_t len);
|
|
# 465 "include/linux/printk.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void print_hex_dump_debug(const char *prefix_str, int prefix_type,
|
|
int rowsize, int groupsize,
|
|
const void *buf, size_t len, bool ascii)
|
|
{
|
|
}
|
|
# 14 "include/linux/kernel.h" 2
|
|
|
|
|
|
|
|
# 1 "include/linux/ecnt_kernel.h" 1
|
|
|
|
|
|
|
|
|
|
# 1 "include/generated/uapi/linux/version.h" 1
|
|
# 6 "include/linux/ecnt_kernel.h" 2
|
|
# 18 "include/linux/kernel.h" 2
|
|
# 193 "include/linux/kernel.h"
|
|
# 1 "./arch/arm/include/asm/div64.h" 1
|
|
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/compiler.h" 1
|
|
# 6 "./arch/arm/include/asm/div64.h" 2
|
|
# 63 "./arch/arm/include/asm/div64.h"
|
|
# 1 "./arch/arm/include/asm/bug.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/opcodes.h" 1
|
|
# 14 "./arch/arm/include/asm/opcodes.h"
|
|
extern unsigned int arm_check_condition(u32 opcode, u32 psr);
|
|
# 7 "./arch/arm/include/asm/bug.h" 2
|
|
# 62 "./arch/arm/include/asm/bug.h"
|
|
# 1 "include/asm-generic/bug.h" 1
|
|
# 13 "include/asm-generic/bug.h"
|
|
# 1 "include/linux/kernel.h" 1
|
|
# 14 "include/asm-generic/bug.h" 2
|
|
|
|
|
|
|
|
|
|
struct bug_entry {
|
|
|
|
unsigned long bug_addr;
|
|
|
|
|
|
|
|
|
|
|
|
const char *file;
|
|
|
|
|
|
|
|
unsigned short line;
|
|
|
|
unsigned short flags;
|
|
};
|
|
# 65 "include/asm-generic/bug.h"
|
|
extern __attribute__((format(printf, 3, 4)))
|
|
void warn_slowpath_fmt(const char *file, const int line,
|
|
const char *fmt, ...);
|
|
extern __attribute__((format(printf, 4, 5)))
|
|
void warn_slowpath_fmt_taint(const char *file, const int line, unsigned taint,
|
|
const char *fmt, ...);
|
|
extern void warn_slowpath_null(const char *file, const int line);
|
|
# 63 "./arch/arm/include/asm/bug.h" 2
|
|
|
|
struct pt_regs;
|
|
void die(const char *msg, struct pt_regs *regs, int err);
|
|
|
|
struct siginfo;
|
|
void arm_notify_die(const char *str, struct pt_regs *regs, struct siginfo *info,
|
|
unsigned long err, unsigned long trap);
|
|
# 79 "./arch/arm/include/asm/bug.h"
|
|
void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
|
|
struct pt_regs *),
|
|
int sig, int code, const char *name);
|
|
|
|
void hook_ifault_code(int nr, int (*fn)(unsigned long, unsigned int,
|
|
struct pt_regs *),
|
|
int sig, int code, const char *name);
|
|
|
|
extern void c_backtrace(unsigned long fp, int pmode);
|
|
|
|
struct mm_struct;
|
|
extern void show_pte(struct mm_struct *mm, unsigned long addr);
|
|
extern void __show_regs(struct pt_regs *);
|
|
# 64 "./arch/arm/include/asm/div64.h" 2
|
|
# 194 "include/linux/kernel.h" 2
|
|
# 222 "include/linux/kernel.h"
|
|
struct completion;
|
|
struct pt_regs;
|
|
struct user;
|
|
# 250 "include/linux/kernel.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ___might_sleep(const char *file, int line,
|
|
int preempt_offset) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __might_sleep(const char *file, int line,
|
|
int preempt_offset) { }
|
|
# 297 "include/linux/kernel.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 reciprocal_scale(u32 val, u32 ep_ro)
|
|
{
|
|
return (u32)(((u64) val * ep_ro) >> 32);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void might_fault(void) { }
|
|
|
|
|
|
extern struct atomic_notifier_head panic_notifier_list;
|
|
extern long (*panic_blink)(int state);
|
|
__attribute__((format(printf, 1, 2)))
|
|
void panic(const char *fmt, ...)
|
|
__attribute__((noreturn)) __attribute__((__cold__));
|
|
extern void oops_enter(void);
|
|
extern void oops_exit(void);
|
|
void print_oops_end_marker(void);
|
|
extern int oops_may_print(void);
|
|
void do_exit(long error_code)
|
|
__attribute__((noreturn));
|
|
void complete_and_exit(struct completion *, long)
|
|
__attribute__((noreturn));
|
|
|
|
|
|
int __attribute__((warn_unused_result)) _kstrtoul(const char *s, unsigned int base, unsigned long *res);
|
|
int __attribute__((warn_unused_result)) _kstrtol(const char *s, unsigned int base, long *res);
|
|
|
|
int __attribute__((warn_unused_result)) kstrtoull(const char *s, unsigned int base, unsigned long long *res);
|
|
int __attribute__((warn_unused_result)) kstrtoll(const char *s, unsigned int base, long long *res);
|
|
# 347 "include/linux/kernel.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtoul(const char *s, unsigned int base, unsigned long *res)
|
|
{
|
|
|
|
|
|
|
|
|
|
if (sizeof(unsigned long) == sizeof(unsigned long long) &&
|
|
__alignof__(unsigned long) == __alignof__(unsigned long long))
|
|
return kstrtoull(s, base, (unsigned long long *)res);
|
|
else
|
|
return _kstrtoul(s, base, res);
|
|
}
|
|
# 376 "include/linux/kernel.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtol(const char *s, unsigned int base, long *res)
|
|
{
|
|
|
|
|
|
|
|
|
|
if (sizeof(long) == sizeof(long long) &&
|
|
__alignof__(long) == __alignof__(long long))
|
|
return kstrtoll(s, base, (long long *)res);
|
|
else
|
|
return _kstrtol(s, base, res);
|
|
}
|
|
|
|
int __attribute__((warn_unused_result)) kstrtouint(const char *s, unsigned int base, unsigned int *res);
|
|
int __attribute__((warn_unused_result)) kstrtoint(const char *s, unsigned int base, int *res);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtou64(const char *s, unsigned int base, u64 *res)
|
|
{
|
|
return kstrtoull(s, base, res);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtos64(const char *s, unsigned int base, s64 *res)
|
|
{
|
|
return kstrtoll(s, base, res);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtou32(const char *s, unsigned int base, u32 *res)
|
|
{
|
|
return kstrtouint(s, base, res);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtos32(const char *s, unsigned int base, s32 *res)
|
|
{
|
|
return kstrtoint(s, base, res);
|
|
}
|
|
|
|
int __attribute__((warn_unused_result)) kstrtou16(const char *s, unsigned int base, u16 *res);
|
|
int __attribute__((warn_unused_result)) kstrtos16(const char *s, unsigned int base, s16 *res);
|
|
int __attribute__((warn_unused_result)) kstrtou8(const char *s, unsigned int base, u8 *res);
|
|
int __attribute__((warn_unused_result)) kstrtos8(const char *s, unsigned int base, s8 *res);
|
|
int __attribute__((warn_unused_result)) kstrtobool(const char *s, bool *res);
|
|
|
|
int __attribute__((warn_unused_result)) kstrtoull_from_user(const char *s, size_t count, unsigned int base, unsigned long long *res);
|
|
int __attribute__((warn_unused_result)) kstrtoll_from_user(const char *s, size_t count, unsigned int base, long long *res);
|
|
int __attribute__((warn_unused_result)) kstrtoul_from_user(const char *s, size_t count, unsigned int base, unsigned long *res);
|
|
int __attribute__((warn_unused_result)) kstrtol_from_user(const char *s, size_t count, unsigned int base, long *res);
|
|
int __attribute__((warn_unused_result)) kstrtouint_from_user(const char *s, size_t count, unsigned int base, unsigned int *res);
|
|
int __attribute__((warn_unused_result)) kstrtoint_from_user(const char *s, size_t count, unsigned int base, int *res);
|
|
int __attribute__((warn_unused_result)) kstrtou16_from_user(const char *s, size_t count, unsigned int base, u16 *res);
|
|
int __attribute__((warn_unused_result)) kstrtos16_from_user(const char *s, size_t count, unsigned int base, s16 *res);
|
|
int __attribute__((warn_unused_result)) kstrtou8_from_user(const char *s, size_t count, unsigned int base, u8 *res);
|
|
int __attribute__((warn_unused_result)) kstrtos8_from_user(const char *s, size_t count, unsigned int base, s8 *res);
|
|
int __attribute__((warn_unused_result)) kstrtobool_from_user(const char *s, size_t count, bool *res);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtou64_from_user(const char *s, size_t count, unsigned int base, u64 *res)
|
|
{
|
|
return kstrtoull_from_user(s, count, base, res);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtos64_from_user(const char *s, size_t count, unsigned int base, s64 *res)
|
|
{
|
|
return kstrtoll_from_user(s, count, base, res);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtou32_from_user(const char *s, size_t count, unsigned int base, u32 *res)
|
|
{
|
|
return kstrtouint_from_user(s, count, base, res);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kstrtos32_from_user(const char *s, size_t count, unsigned int base, s32 *res)
|
|
{
|
|
return kstrtoint_from_user(s, count, base, res);
|
|
}
|
|
|
|
|
|
|
|
extern unsigned long simple_strtoul(const char *,char **,unsigned int);
|
|
extern long simple_strtol(const char *,char **,unsigned int);
|
|
extern unsigned long long simple_strtoull(const char *,char **,unsigned int);
|
|
extern long long simple_strtoll(const char *,char **,unsigned int);
|
|
|
|
extern int num_to_str(char *buf, int size, unsigned long long num);
|
|
|
|
|
|
|
|
extern __attribute__((format(printf, 2, 3))) int sprintf(char *buf, const char * fmt, ...);
|
|
extern __attribute__((format(printf, 2, 0))) int vsprintf(char *buf, const char *, va_list);
|
|
extern __attribute__((format(printf, 3, 4)))
|
|
int snprintf(char *buf, size_t size, const char *fmt, ...);
|
|
extern __attribute__((format(printf, 3, 0)))
|
|
int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
|
|
extern __attribute__((format(printf, 3, 4)))
|
|
int scnprintf(char *buf, size_t size, const char *fmt, ...);
|
|
extern __attribute__((format(printf, 3, 0)))
|
|
int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
|
|
extern __attribute__((format(printf, 2, 3)))
|
|
char *kasprintf(gfp_t gfp, const char *fmt, ...);
|
|
extern __attribute__((format(printf, 2, 0)))
|
|
char *kvasprintf(gfp_t gfp, const char *fmt, va_list args);
|
|
extern __attribute__((format(printf, 2, 0)))
|
|
const char *kvasprintf_const(gfp_t gfp, const char *fmt, va_list args);
|
|
|
|
extern __attribute__((format(scanf, 2, 3)))
|
|
int sscanf(const char *, const char *, ...);
|
|
extern __attribute__((format(scanf, 2, 0)))
|
|
int vsscanf(const char *, const char *, va_list);
|
|
|
|
extern int get_option(char **str, int *pint);
|
|
extern char *get_options(const char *str, int nints, int *ints);
|
|
extern unsigned long long memparse(const char *ptr, char **retptr);
|
|
extern bool parse_option_str(const char *str, const char *option);
|
|
|
|
extern int core_kernel_text(unsigned long addr);
|
|
extern int core_kernel_data(unsigned long addr);
|
|
extern int __kernel_text_address(unsigned long addr);
|
|
extern int kernel_text_address(unsigned long addr);
|
|
extern int func_ptr_is_kernel_text(void *ptr);
|
|
|
|
unsigned long int_sqrt(unsigned long);
|
|
|
|
extern void bust_spinlocks(int yes);
|
|
extern int oops_in_progress;
|
|
extern int panic_timeout;
|
|
extern int panic_on_oops;
|
|
extern int panic_on_unrecovered_nmi;
|
|
extern int panic_on_io_nmi;
|
|
extern int panic_on_warn;
|
|
extern int sysctl_panic_on_stackoverflow;
|
|
|
|
extern bool crash_kexec_post_notifiers;
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_arch_panic_timeout(int timeout, int arch_default_timeout)
|
|
{
|
|
if (panic_timeout == arch_default_timeout)
|
|
panic_timeout = timeout;
|
|
}
|
|
extern const char *print_tainted(void);
|
|
enum lockdep_ok {
|
|
LOCKDEP_STILL_OK,
|
|
LOCKDEP_NOW_UNRELIABLE
|
|
};
|
|
extern void add_taint(unsigned flag, enum lockdep_ok);
|
|
extern int test_taint(unsigned flag);
|
|
extern unsigned long get_taint(void);
|
|
extern int root_mountflags;
|
|
|
|
extern bool early_boot_irqs_disabled;
|
|
|
|
|
|
extern enum system_states {
|
|
SYSTEM_BOOTING,
|
|
SYSTEM_RUNNING,
|
|
SYSTEM_HALT,
|
|
SYSTEM_POWER_OFF,
|
|
SYSTEM_RESTART,
|
|
} system_state;
|
|
# 554 "include/linux/kernel.h"
|
|
extern const char hex_asc[];
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) char *hex_byte_pack(char *buf, u8 byte)
|
|
{
|
|
*buf++ = hex_asc[((byte) & 0xf0) >> 4];
|
|
*buf++ = hex_asc[((byte) & 0x0f)];
|
|
return buf;
|
|
}
|
|
|
|
extern const char hex_asc_upper[];
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) char *hex_byte_pack_upper(char *buf, u8 byte)
|
|
{
|
|
*buf++ = hex_asc_upper[((byte) & 0xf0) >> 4];
|
|
*buf++ = hex_asc_upper[((byte) & 0x0f)];
|
|
return buf;
|
|
}
|
|
|
|
extern int hex_to_bin(char ch);
|
|
extern int __attribute__((warn_unused_result)) hex2bin(u8 *dst, const char *src, size_t count);
|
|
extern char *bin2hex(char *dst, const void *src, size_t count);
|
|
|
|
bool mac_pton(const char *s, u8 *mac);
|
|
# 602 "include/linux/kernel.h"
|
|
enum ftrace_dump_mode {
|
|
DUMP_NONE,
|
|
DUMP_ALL,
|
|
DUMP_ORIG,
|
|
};
|
|
# 752 "include/linux/kernel.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tracing_start(void) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tracing_stop(void) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void trace_dump_stack(int skip) { }
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tracing_on(void) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tracing_off(void) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int tracing_is_on(void) { return 0; }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tracing_snapshot(void) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tracing_snapshot_alloc(void) { }
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((format(printf, 1, 2)))
|
|
int trace_printk(const char *fmt, ...)
|
|
{
|
|
return 0;
|
|
}
|
|
static __attribute__((format(printf, 1, 0))) inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
ftrace_vprintk(const char *fmt, va_list ap)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
|
|
# 9 "include/linux/list.h" 2
|
|
# 25 "include/linux/list.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void INIT_LIST_HEAD(struct list_head *list)
|
|
{
|
|
list->next = list;
|
|
list->prev = list;
|
|
}
|
|
# 38 "include/linux/list.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __list_add(struct list_head *new,
|
|
struct list_head *prev,
|
|
struct list_head *next)
|
|
{
|
|
next->prev = new;
|
|
new->next = next;
|
|
new->prev = prev;
|
|
prev->next = new;
|
|
}
|
|
# 61 "include/linux/list.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_add(struct list_head *new, struct list_head *head)
|
|
{
|
|
__list_add(new, head, head->next);
|
|
}
|
|
# 75 "include/linux/list.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_add_tail(struct list_head *new, struct list_head *head)
|
|
{
|
|
__list_add(new, head->prev, head);
|
|
}
|
|
# 87 "include/linux/list.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __list_del(struct list_head * prev, struct list_head * next)
|
|
{
|
|
next->prev = prev;
|
|
({ union { typeof(prev->next) __val; char __c[1]; } __u = { .__val = ( typeof(prev->next)) (next) }; __write_once_size(&(prev->next), __u.__c, sizeof(prev->next)); __u.__val; });
|
|
}
|
|
# 100 "include/linux/list.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __list_del_entry(struct list_head *entry)
|
|
{
|
|
__list_del(entry->prev, entry->next);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_del(struct list_head *entry)
|
|
{
|
|
__list_del(entry->prev, entry->next);
|
|
entry->next = ((void *) 0x100 + 0);
|
|
entry->prev = ((void *) 0x200 + 0);
|
|
}
|
|
# 123 "include/linux/list.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_replace(struct list_head *old,
|
|
struct list_head *new)
|
|
{
|
|
new->next = old->next;
|
|
new->next->prev = new;
|
|
new->prev = old->prev;
|
|
new->prev->next = new;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_replace_init(struct list_head *old,
|
|
struct list_head *new)
|
|
{
|
|
list_replace(old, new);
|
|
INIT_LIST_HEAD(old);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_del_init(struct list_head *entry)
|
|
{
|
|
__list_del_entry(entry);
|
|
INIT_LIST_HEAD(entry);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_move(struct list_head *list, struct list_head *head)
|
|
{
|
|
__list_del_entry(list);
|
|
list_add(list, head);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_move_tail(struct list_head *list,
|
|
struct list_head *head)
|
|
{
|
|
__list_del_entry(list);
|
|
list_add_tail(list, head);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int list_is_last(const struct list_head *list,
|
|
const struct list_head *head)
|
|
{
|
|
return list->next == head;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int list_empty(const struct list_head *head)
|
|
{
|
|
return head->next == head;
|
|
}
|
|
# 205 "include/linux/list.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int list_empty_careful(const struct list_head *head)
|
|
{
|
|
struct list_head *next = head->next;
|
|
return (next == head) && (next == head->prev);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_rotate_left(struct list_head *head)
|
|
{
|
|
struct list_head *first;
|
|
|
|
if (!list_empty(head)) {
|
|
first = head->next;
|
|
list_move_tail(first, head);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int list_is_singular(const struct list_head *head)
|
|
{
|
|
return !list_empty(head) && (head->next == head->prev);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __list_cut_position(struct list_head *list,
|
|
struct list_head *head, struct list_head *entry)
|
|
{
|
|
struct list_head *new_first = entry->next;
|
|
list->next = head->next;
|
|
list->next->prev = list;
|
|
list->prev = entry;
|
|
entry->next = list;
|
|
head->next = new_first;
|
|
new_first->prev = head;
|
|
}
|
|
# 260 "include/linux/list.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_cut_position(struct list_head *list,
|
|
struct list_head *head, struct list_head *entry)
|
|
{
|
|
if (list_empty(head))
|
|
return;
|
|
if (list_is_singular(head) &&
|
|
(head->next != entry && head != entry))
|
|
return;
|
|
if (entry == head)
|
|
INIT_LIST_HEAD(list);
|
|
else
|
|
__list_cut_position(list, head, entry);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __list_splice(const struct list_head *list,
|
|
struct list_head *prev,
|
|
struct list_head *next)
|
|
{
|
|
struct list_head *first = list->next;
|
|
struct list_head *last = list->prev;
|
|
|
|
first->prev = prev;
|
|
prev->next = first;
|
|
|
|
last->next = next;
|
|
next->prev = last;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_splice(const struct list_head *list,
|
|
struct list_head *head)
|
|
{
|
|
if (!list_empty(list))
|
|
__list_splice(list, head, head->next);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_splice_tail(struct list_head *list,
|
|
struct list_head *head)
|
|
{
|
|
if (!list_empty(list))
|
|
__list_splice(list, head->prev, head);
|
|
}
|
|
# 319 "include/linux/list.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_splice_init(struct list_head *list,
|
|
struct list_head *head)
|
|
{
|
|
if (!list_empty(list)) {
|
|
__list_splice(list, head, head->next);
|
|
INIT_LIST_HEAD(list);
|
|
}
|
|
}
|
|
# 336 "include/linux/list.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_splice_tail_init(struct list_head *list,
|
|
struct list_head *head)
|
|
{
|
|
if (!list_empty(list)) {
|
|
__list_splice(list, head->prev, head);
|
|
INIT_LIST_HEAD(list);
|
|
}
|
|
}
|
|
# 598 "include/linux/list.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void INIT_HLIST_NODE(struct hlist_node *h)
|
|
{
|
|
h->next = ((void *)0);
|
|
h->pprev = ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hlist_unhashed(const struct hlist_node *h)
|
|
{
|
|
return !h->pprev;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hlist_empty(const struct hlist_head *h)
|
|
{
|
|
return !h->first;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __hlist_del(struct hlist_node *n)
|
|
{
|
|
struct hlist_node *next = n->next;
|
|
struct hlist_node **pprev = n->pprev;
|
|
|
|
({ union { typeof(*pprev) __val; char __c[1]; } __u = { .__val = ( typeof(*pprev)) (next) }; __write_once_size(&(*pprev), __u.__c, sizeof(*pprev)); __u.__val; });
|
|
if (next)
|
|
next->pprev = pprev;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_del(struct hlist_node *n)
|
|
{
|
|
__hlist_del(n);
|
|
n->next = ((void *) 0x100 + 0);
|
|
n->pprev = ((void *) 0x200 + 0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_del_init(struct hlist_node *n)
|
|
{
|
|
if (!hlist_unhashed(n)) {
|
|
__hlist_del(n);
|
|
INIT_HLIST_NODE(n);
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
|
|
{
|
|
struct hlist_node *first = h->first;
|
|
n->next = first;
|
|
if (first)
|
|
first->pprev = &n->next;
|
|
h->first = n;
|
|
n->pprev = &h->first;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_add_before(struct hlist_node *n,
|
|
struct hlist_node *next)
|
|
{
|
|
n->pprev = next->pprev;
|
|
n->next = next;
|
|
next->pprev = &n->next;
|
|
*(n->pprev) = n;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_add_behind(struct hlist_node *n,
|
|
struct hlist_node *prev)
|
|
{
|
|
n->next = prev->next;
|
|
prev->next = n;
|
|
n->pprev = &prev->next;
|
|
|
|
if (n->next)
|
|
n->next->pprev = &n->next;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_add_fake(struct hlist_node *n)
|
|
{
|
|
n->pprev = &n->next;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool hlist_fake(struct hlist_node *h)
|
|
{
|
|
return h->pprev == &h->next;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_move_list(struct hlist_head *old,
|
|
struct hlist_head *new)
|
|
{
|
|
new->first = old->first;
|
|
if (new->first)
|
|
new->first->pprev = &new->first;
|
|
old->first = ((void *)0);
|
|
}
|
|
# 10 "include/linux/module.h" 2
|
|
# 1 "include/linux/stat.h" 1
|
|
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/uapi/asm/stat.h" 1
|
|
|
|
|
|
|
|
struct __old_kernel_stat {
|
|
unsigned short st_dev;
|
|
unsigned short st_ino;
|
|
unsigned short st_mode;
|
|
unsigned short st_nlink;
|
|
unsigned short st_uid;
|
|
unsigned short st_gid;
|
|
unsigned short st_rdev;
|
|
unsigned long st_size;
|
|
unsigned long st_atime;
|
|
unsigned long st_mtime;
|
|
unsigned long st_ctime;
|
|
};
|
|
|
|
|
|
|
|
struct stat {
|
|
|
|
|
|
|
|
|
|
unsigned long st_dev;
|
|
|
|
unsigned long st_ino;
|
|
unsigned short st_mode;
|
|
unsigned short st_nlink;
|
|
unsigned short st_uid;
|
|
unsigned short st_gid;
|
|
|
|
|
|
|
|
|
|
unsigned long st_rdev;
|
|
|
|
unsigned long st_size;
|
|
unsigned long st_blksize;
|
|
unsigned long st_blocks;
|
|
unsigned long st_atime;
|
|
unsigned long st_atime_nsec;
|
|
unsigned long st_mtime;
|
|
unsigned long st_mtime_nsec;
|
|
unsigned long st_ctime;
|
|
unsigned long st_ctime_nsec;
|
|
unsigned long __unused4;
|
|
unsigned long __unused5;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct stat64 {
|
|
unsigned long long st_dev;
|
|
unsigned char __pad0[4];
|
|
|
|
|
|
unsigned long __st_ino;
|
|
unsigned int st_mode;
|
|
unsigned int st_nlink;
|
|
|
|
unsigned long st_uid;
|
|
unsigned long st_gid;
|
|
|
|
unsigned long long st_rdev;
|
|
unsigned char __pad3[4];
|
|
|
|
long long st_size;
|
|
unsigned long st_blksize;
|
|
unsigned long long st_blocks;
|
|
|
|
unsigned long st_atime;
|
|
unsigned long st_atime_nsec;
|
|
|
|
unsigned long st_mtime;
|
|
unsigned long st_mtime_nsec;
|
|
|
|
unsigned long st_ctime;
|
|
unsigned long st_ctime_nsec;
|
|
|
|
unsigned long long st_ino;
|
|
};
|
|
# 6 "include/linux/stat.h" 2
|
|
# 1 "include/uapi/linux/stat.h" 1
|
|
# 7 "include/linux/stat.h" 2
|
|
# 18 "include/linux/stat.h"
|
|
# 1 "include/linux/time.h" 1
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/seqlock.h" 1
|
|
# 35 "include/linux/seqlock.h"
|
|
# 1 "include/linux/spinlock.h" 1
|
|
# 50 "include/linux/spinlock.h"
|
|
# 1 "include/linux/preempt.h" 1
|
|
# 59 "include/linux/preempt.h"
|
|
# 1 "arch/arm/include/generated/asm/preempt.h" 1
|
|
# 1 "include/asm-generic/preempt.h" 1
|
|
|
|
|
|
|
|
# 1 "include/linux/thread_info.h" 1
|
|
# 11 "include/linux/thread_info.h"
|
|
# 1 "include/linux/bug.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum bug_trap_type {
|
|
BUG_TRAP_TYPE_NONE = 0,
|
|
BUG_TRAP_TYPE_WARN = 1,
|
|
BUG_TRAP_TYPE_BUG = 2,
|
|
};
|
|
|
|
struct pt_regs;
|
|
# 91 "include/linux/bug.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_warning_bug(const struct bug_entry *bug)
|
|
{
|
|
return bug->flags & (1 << 0);
|
|
}
|
|
|
|
const struct bug_entry *find_bug(unsigned long bugaddr);
|
|
|
|
enum bug_trap_type report_bug(unsigned long bug_addr, struct pt_regs *regs);
|
|
|
|
|
|
int is_valid_bugaddr(unsigned long addr);
|
|
# 12 "include/linux/thread_info.h" 2
|
|
|
|
struct timespec;
|
|
struct compat_timespec;
|
|
|
|
|
|
|
|
|
|
struct restart_block {
|
|
long (*fn)(struct restart_block *);
|
|
union {
|
|
|
|
struct {
|
|
u32 *uaddr;
|
|
u32 val;
|
|
u32 flags;
|
|
u32 bitset;
|
|
u64 time;
|
|
u32 *uaddr2;
|
|
} futex;
|
|
|
|
struct {
|
|
clockid_t clockid;
|
|
struct timespec *rmtp;
|
|
|
|
|
|
|
|
u64 expires;
|
|
} nanosleep;
|
|
|
|
struct {
|
|
struct pollfd *ufds;
|
|
int nfds;
|
|
int has_timeout;
|
|
unsigned long tv_sec;
|
|
unsigned long tv_nsec;
|
|
} poll;
|
|
};
|
|
};
|
|
|
|
extern long do_no_restart_syscall(struct restart_block *parm);
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/thread_info.h" 1
|
|
# 16 "./arch/arm/include/asm/thread_info.h"
|
|
# 1 "./arch/arm/include/asm/fpstate.h" 1
|
|
# 26 "./arch/arm/include/asm/fpstate.h"
|
|
struct vfp_hard_struct {
|
|
|
|
|
|
|
|
__u64 fpregs[16];
|
|
|
|
|
|
|
|
|
|
__u32 fpexc;
|
|
__u32 fpscr;
|
|
|
|
|
|
|
|
__u32 fpinst;
|
|
__u32 fpinst2;
|
|
|
|
|
|
__u32 cpu;
|
|
|
|
};
|
|
|
|
union vfp_state {
|
|
struct vfp_hard_struct hard;
|
|
};
|
|
|
|
extern void vfp_flush_thread(union vfp_state *);
|
|
extern void vfp_release_thread(union vfp_state *);
|
|
|
|
|
|
|
|
struct fp_hard_struct {
|
|
unsigned int save[35];
|
|
};
|
|
|
|
|
|
|
|
struct fp_soft_struct {
|
|
unsigned int save[35];
|
|
};
|
|
|
|
|
|
|
|
struct iwmmxt_struct {
|
|
unsigned int save[0x98 / sizeof(unsigned int)];
|
|
};
|
|
|
|
union fp_state {
|
|
struct fp_hard_struct hard;
|
|
struct fp_soft_struct soft;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
struct crunch_state {
|
|
unsigned int mvdx[16][2];
|
|
unsigned int mvax[4][3];
|
|
unsigned int dspsc[2];
|
|
};
|
|
# 17 "./arch/arm/include/asm/thread_info.h" 2
|
|
# 1 "./arch/arm/include/asm/page.h" 1
|
|
# 26 "./arch/arm/include/asm/page.h"
|
|
# 1 "./arch/arm/include/asm/glue.h" 1
|
|
# 27 "./arch/arm/include/asm/page.h" 2
|
|
# 110 "./arch/arm/include/asm/page.h"
|
|
struct page;
|
|
struct vm_area_struct;
|
|
|
|
struct cpu_user_fns {
|
|
void (*cpu_clear_user_highpage)(struct page *page, unsigned long vaddr);
|
|
void (*cpu_copy_user_highpage)(struct page *to, struct page *from,
|
|
unsigned long vaddr, struct vm_area_struct *vma);
|
|
};
|
|
|
|
|
|
extern struct cpu_user_fns cpu_user;
|
|
# 143 "./arch/arm/include/asm/page.h"
|
|
extern void copy_page(void *to, const void *from);
|
|
# 152 "./arch/arm/include/asm/page.h"
|
|
# 1 "./arch/arm/include/asm/pgtable-2level-types.h" 1
|
|
# 24 "./arch/arm/include/asm/pgtable-2level-types.h"
|
|
typedef u32 pteval_t;
|
|
typedef u32 pmdval_t;
|
|
# 51 "./arch/arm/include/asm/pgtable-2level-types.h"
|
|
typedef pteval_t pte_t;
|
|
typedef pmdval_t pmd_t;
|
|
typedef pmdval_t pgd_t[2];
|
|
typedef pteval_t pgprot_t;
|
|
# 153 "./arch/arm/include/asm/page.h" 2
|
|
|
|
|
|
|
|
|
|
typedef struct page *pgtable_t;
|
|
|
|
|
|
extern int pfn_valid(unsigned long);
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/memory.h" 1
|
|
# 19 "./arch/arm/include/asm/memory.h"
|
|
# 1 "include/linux/sizes.h" 1
|
|
# 20 "./arch/arm/include/asm/memory.h" 2
|
|
# 162 "./arch/arm/include/asm/memory.h"
|
|
extern unsigned long __pv_phys_pfn_offset;
|
|
extern u64 __pv_offset;
|
|
extern void fixup_pv_table(const void *, unsigned long);
|
|
extern const void *__pv_table_begin, *__pv_table_end;
|
|
# 203 "./arch/arm/include/asm/memory.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) phys_addr_t __virt_to_phys(unsigned long x)
|
|
{
|
|
phys_addr_t t;
|
|
|
|
if (sizeof(phys_addr_t) == 4) {
|
|
__asm__("@ __pv_stub\n" "1: " "add" " %0, %1, %2\n" " .pushsection .pv_table,\"a\"\n" " .long 1b\n" " .popsection\n" : "=r" (t) : "r" (x), "I" (0x81000000));
|
|
} else {
|
|
__asm__ volatile("@ __pv_stub_mov\n" "1: mov %R0, %1\n" " .pushsection .pv_table,\"a\"\n" " .long 1b\n" " .popsection\n" : "=r" (t) : "I" (0x81));
|
|
__asm__ volatile("@ __pv_add_carry_stub\n" "1: adds %Q0, %1, %2\n" " adc %R0, %R0, #0\n" " .pushsection .pv_table,\"a\"\n" " .long 1b\n" " .popsection\n" : "+r" (t) : "r" (x), "I" (0x81000000) : "cc");
|
|
}
|
|
return t;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __phys_to_virt(phys_addr_t x)
|
|
{
|
|
unsigned long t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__asm__("@ __pv_stub\n" "1: " "sub" " %0, %1, %2\n" " .pushsection .pv_table,\"a\"\n" " .long 1b\n" " .popsection\n" : "=r" (t) : "r" ((unsigned long) x), "I" (0x81000000));
|
|
return t;
|
|
}
|
|
# 258 "./arch/arm/include/asm/memory.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) phys_addr_t virt_to_phys(const volatile void *x)
|
|
{
|
|
return __virt_to_phys((unsigned long)(x));
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *phys_to_virt(phys_addr_t x)
|
|
{
|
|
return (void *)__phys_to_virt(x);
|
|
}
|
|
# 276 "./arch/arm/include/asm/memory.h"
|
|
extern phys_addr_t (*arch_virt_to_idmap)(unsigned long x);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) phys_addr_t __virt_to_idmap(unsigned long x)
|
|
{
|
|
if ((1 || 0) && arch_virt_to_idmap)
|
|
return arch_virt_to_idmap(x);
|
|
else
|
|
return __virt_to_phys(x);
|
|
}
|
|
# 337 "./arch/arm/include/asm/memory.h"
|
|
# 1 "include/asm-generic/memory_model.h" 1
|
|
|
|
|
|
|
|
# 1 "include/linux/pfn.h" 1
|
|
# 5 "include/asm-generic/memory_model.h" 2
|
|
# 338 "./arch/arm/include/asm/memory.h" 2
|
|
# 164 "./arch/arm/include/asm/page.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/asm-generic/getorder.h" 1
|
|
# 12 "include/asm-generic/getorder.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((__const__))
|
|
int __get_order(unsigned long size)
|
|
{
|
|
int order;
|
|
|
|
size--;
|
|
size >>= 12;
|
|
|
|
order = fls(size);
|
|
|
|
|
|
|
|
return order;
|
|
}
|
|
# 172 "./arch/arm/include/asm/page.h" 2
|
|
# 18 "./arch/arm/include/asm/thread_info.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct task_struct;
|
|
|
|
|
|
|
|
typedef unsigned long mm_segment_t;
|
|
|
|
struct cpu_context_save {
|
|
__u32 r4;
|
|
__u32 r5;
|
|
__u32 r6;
|
|
__u32 r7;
|
|
__u32 r8;
|
|
__u32 r9;
|
|
__u32 sl;
|
|
__u32 fp;
|
|
__u32 sp;
|
|
__u32 pc;
|
|
__u32 extra[2];
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct thread_info {
|
|
unsigned long flags;
|
|
int preempt_count;
|
|
mm_segment_t addr_limit;
|
|
struct task_struct *task;
|
|
__u32 cpu;
|
|
__u32 cpu_domain;
|
|
struct cpu_context_save cpu_context;
|
|
__u32 syscall;
|
|
__u8 used_cp[16];
|
|
unsigned long tp_value[2];
|
|
|
|
|
|
|
|
union fp_state fpstate __attribute__((aligned(8)));
|
|
union vfp_state vfpstate;
|
|
|
|
|
|
|
|
};
|
|
# 84 "./arch/arm/include/asm/thread_info.h"
|
|
register unsigned long current_stack_pointer asm ("sp");
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct thread_info *current_thread_info(void) __attribute__((__const__));
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct thread_info *current_thread_info(void)
|
|
{
|
|
return (struct thread_info *)
|
|
(current_stack_pointer & ~((((1UL) << 12) << 2) - 1));
|
|
}
|
|
# 110 "./arch/arm/include/asm/thread_info.h"
|
|
extern void crunch_task_disable(struct thread_info *);
|
|
extern void crunch_task_copy(struct thread_info *, void *);
|
|
extern void crunch_task_restore(struct thread_info *, void *);
|
|
extern void crunch_task_release(struct thread_info *);
|
|
|
|
extern void iwmmxt_task_disable(struct thread_info *);
|
|
extern void iwmmxt_task_copy(struct thread_info *, void *);
|
|
extern void iwmmxt_task_restore(struct thread_info *, void *);
|
|
extern void iwmmxt_task_release(struct thread_info *);
|
|
extern void iwmmxt_task_switch(struct thread_info *);
|
|
|
|
extern void vfp_sync_hwstate(struct thread_info *);
|
|
extern void vfp_flush_hwstate(struct thread_info *);
|
|
|
|
struct user_vfp;
|
|
struct user_vfp_exc;
|
|
|
|
extern int vfp_preserve_user_clear_hwstate(struct user_vfp *,
|
|
struct user_vfp_exc *);
|
|
extern int vfp_restore_user_hwstate(struct user_vfp *,
|
|
struct user_vfp_exc *);
|
|
# 55 "include/linux/thread_info.h" 2
|
|
# 69 "include/linux/thread_info.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_ti_thread_flag(struct thread_info *ti, int flag)
|
|
{
|
|
_set_bit(flag,(unsigned long *)&ti->flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_ti_thread_flag(struct thread_info *ti, int flag)
|
|
{
|
|
_clear_bit(flag,(unsigned long *)&ti->flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_and_set_ti_thread_flag(struct thread_info *ti, int flag)
|
|
{
|
|
return _test_and_set_bit(flag,(unsigned long *)&ti->flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_and_clear_ti_thread_flag(struct thread_info *ti, int flag)
|
|
{
|
|
return _test_and_clear_bit(flag,(unsigned long *)&ti->flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_ti_thread_flag(struct thread_info *ti, int flag)
|
|
{
|
|
return test_bit(flag, (unsigned long *)&ti->flags);
|
|
}
|
|
# 125 "include/linux/thread_info.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_restore_sigmask(void)
|
|
{
|
|
set_ti_thread_flag(current_thread_info(), 20);
|
|
({ int __ret_warn_on = !!(!test_ti_thread_flag(current_thread_info(), 0)); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/thread_info.h", 128); __builtin_expect(!!(__ret_warn_on), 0); });
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_restore_sigmask(void)
|
|
{
|
|
clear_ti_thread_flag(current_thread_info(), 20);
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool test_restore_sigmask(void)
|
|
{
|
|
return test_ti_thread_flag(current_thread_info(), 20);
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool test_and_clear_restore_sigmask(void)
|
|
{
|
|
return test_and_clear_ti_thread_flag(current_thread_info(), 20);
|
|
}
|
|
# 5 "include/asm-generic/preempt.h" 2
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) int preempt_count(void)
|
|
{
|
|
return current_thread_info()->preempt_count;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) int *preempt_count_ptr(void)
|
|
{
|
|
return ¤t_thread_info()->preempt_count;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void preempt_count_set(int pc)
|
|
{
|
|
*preempt_count_ptr() = pc;
|
|
}
|
|
# 34 "include/asm-generic/preempt.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void set_preempt_need_resched(void)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void clear_preempt_need_resched(void)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) bool test_preempt_need_resched(void)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void __preempt_count_add(int val)
|
|
{
|
|
*preempt_count_ptr() += val;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void __preempt_count_sub(int val)
|
|
{
|
|
*preempt_count_ptr() -= val;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) bool __preempt_count_dec_and_test(void)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
return !--*preempt_count_ptr() && test_ti_thread_flag(current_thread_info(), 1);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) bool should_resched(int preempt_offset)
|
|
{
|
|
return __builtin_expect(!!(preempt_count() == preempt_offset && test_ti_thread_flag(current_thread_info(), 1)), 0)
|
|
;
|
|
}
|
|
# 1 "arch/arm/include/generated/asm/preempt.h" 2
|
|
# 60 "include/linux/preempt.h" 2
|
|
# 51 "include/linux/spinlock.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/bottom_half.h" 1
|
|
# 9 "include/linux/bottom_half.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void __local_bh_disable_ip(unsigned long ip, unsigned int cnt)
|
|
{
|
|
__preempt_count_add(cnt);
|
|
__asm__ __volatile__("": : :"memory");
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void local_bh_disable(void)
|
|
{
|
|
__local_bh_disable_ip(({ __label__ __here; __here: (unsigned long)&&__here; }), (2 * (1UL << (0 + 8))));
|
|
}
|
|
|
|
extern void _local_bh_enable(void);
|
|
extern void __local_bh_enable_ip(unsigned long ip, unsigned int cnt);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void local_bh_enable_ip(unsigned long ip)
|
|
{
|
|
__local_bh_enable_ip(ip, (2 * (1UL << (0 + 8))));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void local_bh_enable(void)
|
|
{
|
|
__local_bh_enable_ip(({ __label__ __here; __here: (unsigned long)&&__here; }), (2 * (1UL << (0 + 8))));
|
|
}
|
|
# 58 "include/linux/spinlock.h" 2
|
|
# 81 "include/linux/spinlock.h"
|
|
# 1 "include/linux/spinlock_types.h" 1
|
|
# 13 "include/linux/spinlock_types.h"
|
|
# 1 "./arch/arm/include/asm/spinlock_types.h" 1
|
|
# 10 "./arch/arm/include/asm/spinlock_types.h"
|
|
typedef struct {
|
|
union {
|
|
u32 slock;
|
|
struct __raw_tickets {
|
|
|
|
|
|
|
|
|
|
u16 owner;
|
|
u16 next;
|
|
|
|
} tickets;
|
|
};
|
|
} arch_spinlock_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
u32 lock;
|
|
} arch_rwlock_t;
|
|
# 14 "include/linux/spinlock_types.h" 2
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/lockdep.h" 1
|
|
# 12 "include/linux/lockdep.h"
|
|
struct task_struct;
|
|
struct lockdep_map;
|
|
|
|
|
|
extern int prove_locking;
|
|
extern int lock_stat;
|
|
# 380 "include/linux/lockdep.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void lockdep_off(void)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void lockdep_on(void)
|
|
{
|
|
}
|
|
# 421 "include/linux/lockdep.h"
|
|
struct lock_class_key { };
|
|
# 479 "include/linux/lockdep.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void print_irqtrace_events(struct task_struct *curr)
|
|
{
|
|
}
|
|
# 547 "include/linux/lockdep.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
lockdep_rcu_suspicious(const char *file, const int line, const char *s)
|
|
{
|
|
}
|
|
# 19 "include/linux/spinlock_types.h" 2
|
|
|
|
typedef struct raw_spinlock {
|
|
arch_spinlock_t raw_lock;
|
|
# 32 "include/linux/spinlock_types.h"
|
|
} raw_spinlock_t;
|
|
# 64 "include/linux/spinlock_types.h"
|
|
typedef struct spinlock {
|
|
union {
|
|
struct raw_spinlock rlock;
|
|
# 75 "include/linux/spinlock_types.h"
|
|
};
|
|
} spinlock_t;
|
|
# 86 "include/linux/spinlock_types.h"
|
|
# 1 "include/linux/rwlock_types.h" 1
|
|
# 11 "include/linux/rwlock_types.h"
|
|
typedef struct {
|
|
arch_rwlock_t raw_lock;
|
|
# 23 "include/linux/rwlock_types.h"
|
|
} rwlock_t;
|
|
# 87 "include/linux/spinlock_types.h" 2
|
|
# 82 "include/linux/spinlock.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/spinlock.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/prefetch.h" 1
|
|
# 14 "include/linux/prefetch.h"
|
|
# 1 "./arch/arm/include/asm/processor.h" 1
|
|
# 22 "./arch/arm/include/asm/processor.h"
|
|
# 1 "./arch/arm/include/asm/hw_breakpoint.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
struct task_struct;
|
|
|
|
|
|
|
|
struct arch_hw_breakpoint_ctrl {
|
|
u32 __reserved : 9,
|
|
mismatch : 1,
|
|
: 9,
|
|
len : 8,
|
|
type : 2,
|
|
privilege : 2,
|
|
enabled : 1;
|
|
};
|
|
|
|
struct arch_hw_breakpoint {
|
|
u32 address;
|
|
u32 trigger;
|
|
struct arch_hw_breakpoint_ctrl step_ctrl;
|
|
struct arch_hw_breakpoint_ctrl ctrl;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 encode_ctrl_reg(struct arch_hw_breakpoint_ctrl ctrl)
|
|
{
|
|
return (ctrl.mismatch << 22) | (ctrl.len << 5) | (ctrl.type << 3) |
|
|
(ctrl.privilege << 1) | ctrl.enabled;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void decode_ctrl_reg(u32 reg,
|
|
struct arch_hw_breakpoint_ctrl *ctrl)
|
|
{
|
|
ctrl->enabled = reg & 0x1;
|
|
reg >>= 1;
|
|
ctrl->privilege = reg & 0x3;
|
|
reg >>= 2;
|
|
ctrl->type = reg & 0x3;
|
|
reg >>= 2;
|
|
ctrl->len = reg & 0xff;
|
|
reg >>= 17;
|
|
ctrl->mismatch = reg & 0x1;
|
|
}
|
|
# 113 "./arch/arm/include/asm/hw_breakpoint.h"
|
|
struct notifier_block;
|
|
struct perf_event;
|
|
struct pmu;
|
|
|
|
extern struct pmu perf_ops_bp;
|
|
extern int arch_bp_generic_fields(struct arch_hw_breakpoint_ctrl ctrl,
|
|
int *gen_len, int *gen_type);
|
|
extern int arch_check_bp_in_kernelspace(struct perf_event *bp);
|
|
extern int arch_validate_hwbkpt_settings(struct perf_event *bp);
|
|
extern int hw_breakpoint_exceptions_notify(struct notifier_block *unused,
|
|
unsigned long val, void *data);
|
|
|
|
extern u8 arch_get_debug_arch(void);
|
|
extern u8 arch_get_max_wp_len(void);
|
|
extern void clear_ptrace_hw_breakpoint(struct task_struct *tsk);
|
|
|
|
int arch_install_hw_breakpoint(struct perf_event *bp);
|
|
void arch_uninstall_hw_breakpoint(struct perf_event *bp);
|
|
void hw_breakpoint_pmu_read(struct perf_event *bp);
|
|
int hw_breakpoint_slots(int type);
|
|
# 23 "./arch/arm/include/asm/processor.h" 2
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/unified.h" 1
|
|
# 105 "./arch/arm/include/asm/unified.h"
|
|
__asm__(
|
|
" .macro it, cond\n"
|
|
" .endm\n"
|
|
" .macro itt, cond\n"
|
|
" .endm\n"
|
|
" .macro ite, cond\n"
|
|
" .endm\n"
|
|
" .macro ittt, cond\n"
|
|
" .endm\n"
|
|
" .macro itte, cond\n"
|
|
" .endm\n"
|
|
" .macro itet, cond\n"
|
|
" .endm\n"
|
|
" .macro itee, cond\n"
|
|
" .endm\n"
|
|
" .macro itttt, cond\n"
|
|
" .endm\n"
|
|
" .macro ittte, cond\n"
|
|
" .endm\n"
|
|
" .macro ittet, cond\n"
|
|
" .endm\n"
|
|
" .macro ittee, cond\n"
|
|
" .endm\n"
|
|
" .macro itett, cond\n"
|
|
" .endm\n"
|
|
" .macro itete, cond\n"
|
|
" .endm\n"
|
|
" .macro iteet, cond\n"
|
|
" .endm\n"
|
|
" .macro iteee, cond\n"
|
|
" .endm\n");
|
|
# 26 "./arch/arm/include/asm/processor.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct debug_info {
|
|
|
|
struct perf_event *hbp[(16 + 16)];
|
|
|
|
};
|
|
|
|
struct thread_struct {
|
|
|
|
unsigned long address;
|
|
unsigned long trap_no;
|
|
unsigned long error_code;
|
|
|
|
struct debug_info debug;
|
|
};
|
|
# 72 "./arch/arm/include/asm/processor.h"
|
|
struct task_struct;
|
|
|
|
|
|
extern void release_thread(struct task_struct *);
|
|
|
|
unsigned long get_wchan(struct task_struct *p);
|
|
# 110 "./arch/arm/include/asm/processor.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void prefetch(const void *ptr)
|
|
{
|
|
__asm__ __volatile__(
|
|
"pld\t%a0"
|
|
:: "p" (ptr));
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void prefetchw(const void *ptr)
|
|
{
|
|
__asm__ __volatile__(
|
|
".arch_extension mp\n"
|
|
"9998: " "pldw" "\t%a0" "\n" " .pushsection \".alt.smp.init\", \"a\"\n" " .long 9998b\n" " " "pld" "\t%a0" "\n" " .popsection\n"
|
|
|
|
|
|
|
|
:: "p" (ptr));
|
|
}
|
|
# 15 "include/linux/prefetch.h" 2
|
|
# 53 "include/linux/prefetch.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void prefetch_range(void *addr, size_t len)
|
|
{
|
|
|
|
char *cp;
|
|
char *end = addr + len;
|
|
|
|
for (cp = addr; cp < end; cp += (4*(1 << 6)))
|
|
prefetch(cp);
|
|
|
|
}
|
|
# 9 "./arch/arm/include/asm/spinlock.h" 2
|
|
# 38 "./arch/arm/include/asm/spinlock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dsb_sev(void)
|
|
{
|
|
|
|
__asm__ __volatile__ ("dsb " "ishst" : : : "memory");
|
|
__asm__("9998: " "sev" "\n" " .pushsection \".alt.smp.init\", \"a\"\n" " .long 9998b\n" " " "nop" "\n" " .popsection\n");
|
|
}
|
|
# 58 "./arch/arm/include/asm/spinlock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_spin_lock(arch_spinlock_t *lock)
|
|
{
|
|
unsigned long tmp;
|
|
u32 newval;
|
|
arch_spinlock_t lockval;
|
|
|
|
prefetchw(&lock->slock);
|
|
__asm__ __volatile__(
|
|
"1: ldrex %0, [%3]\n"
|
|
" add %1, %0, %4\n"
|
|
" strex %2, %1, [%3]\n"
|
|
" teq %2, #0\n"
|
|
" bne 1b"
|
|
: "=&r" (lockval), "=&r" (newval), "=&r" (tmp)
|
|
: "r" (&lock->slock), "I" (1 << 16)
|
|
: "cc");
|
|
|
|
while (lockval.tickets.next != lockval.tickets.owner) {
|
|
__asm__ __volatile__ ("wfe" : : : "memory");
|
|
lockval.tickets.owner = (*({ __attribute__((unused)) typeof(lock->tickets.owner) __var = ( typeof(lock->tickets.owner)) 0; (volatile typeof(lock->tickets.owner) *)&(lock->tickets.owner); }));
|
|
}
|
|
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int arch_spin_trylock(arch_spinlock_t *lock)
|
|
{
|
|
unsigned long contended, res;
|
|
u32 slock;
|
|
|
|
prefetchw(&lock->slock);
|
|
do {
|
|
__asm__ __volatile__(
|
|
" ldrex %0, [%3]\n"
|
|
" mov %2, #0\n"
|
|
" subs %1, %0, %0, ror #16\n"
|
|
" addeq %0, %0, %4\n"
|
|
" strexeq %2, %0, [%3]"
|
|
: "=&r" (slock), "=&r" (contended), "=&r" (res)
|
|
: "r" (&lock->slock), "I" (1 << 16)
|
|
: "cc");
|
|
} while (res);
|
|
|
|
if (!contended) {
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
return 1;
|
|
} else {
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_spin_unlock(arch_spinlock_t *lock)
|
|
{
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
lock->tickets.owner++;
|
|
dsb_sev();
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int arch_spin_value_unlocked(arch_spinlock_t lock)
|
|
{
|
|
return lock.tickets.owner == lock.tickets.next;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int arch_spin_is_locked(arch_spinlock_t *lock)
|
|
{
|
|
return !arch_spin_value_unlocked(({ union { typeof(*lock) __val; char __c[1]; } __u; if (1) __read_once_size(&(*lock), __u.__c, sizeof(*lock)); else __read_once_size_nocheck(&(*lock), __u.__c, sizeof(*lock)); __u.__val; }));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int arch_spin_is_contended(arch_spinlock_t *lock)
|
|
{
|
|
struct __raw_tickets tickets = ({ union { typeof(lock->tickets) __val; char __c[1]; } __u; if (1) __read_once_size(&(lock->tickets), __u.__c, sizeof(lock->tickets)); else __read_once_size_nocheck(&(lock->tickets), __u.__c, sizeof(lock->tickets)); __u.__val; });
|
|
return (tickets.next - tickets.owner) > 1;
|
|
}
|
|
# 141 "./arch/arm/include/asm/spinlock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_write_lock(arch_rwlock_t *rw)
|
|
{
|
|
unsigned long tmp;
|
|
|
|
prefetchw(&rw->lock);
|
|
__asm__ __volatile__(
|
|
"1: ldrex %0, [%1]\n"
|
|
" teq %0, #0\n"
|
|
"9998: " "wfe" "ne" "\n" " .pushsection \".alt.smp.init\", \"a\"\n" " .long 9998b\n" " " "nop" "\n" " .popsection\n"
|
|
" strexeq %0, %2, [%1]\n"
|
|
" teq %0, #0\n"
|
|
" bne 1b"
|
|
: "=&r" (tmp)
|
|
: "r" (&rw->lock), "r" (0x80000000)
|
|
: "cc");
|
|
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int arch_write_trylock(arch_rwlock_t *rw)
|
|
{
|
|
unsigned long contended, res;
|
|
|
|
prefetchw(&rw->lock);
|
|
do {
|
|
__asm__ __volatile__(
|
|
" ldrex %0, [%2]\n"
|
|
" mov %1, #0\n"
|
|
" teq %0, #0\n"
|
|
" strexeq %1, %3, [%2]"
|
|
: "=&r" (contended), "=&r" (res)
|
|
: "r" (&rw->lock), "r" (0x80000000)
|
|
: "cc");
|
|
} while (res);
|
|
|
|
if (!contended) {
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
return 1;
|
|
} else {
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_write_unlock(arch_rwlock_t *rw)
|
|
{
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
|
|
__asm__ __volatile__(
|
|
"str %1, [%0]\n"
|
|
:
|
|
: "r" (&rw->lock), "r" (0)
|
|
: "cc");
|
|
|
|
dsb_sev();
|
|
}
|
|
# 212 "./arch/arm/include/asm/spinlock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_read_lock(arch_rwlock_t *rw)
|
|
{
|
|
unsigned long tmp, tmp2;
|
|
|
|
prefetchw(&rw->lock);
|
|
__asm__ __volatile__(
|
|
"1: ldrex %0, [%2]\n"
|
|
" adds %0, %0, #1\n"
|
|
" strexpl %1, %0, [%2]\n"
|
|
"9998: " "wfe" "mi" "\n" " .pushsection \".alt.smp.init\", \"a\"\n" " .long 9998b\n" " " "nop" "\n" " .popsection\n"
|
|
" rsbpls %0, %1, #0\n"
|
|
" bmi 1b"
|
|
: "=&r" (tmp), "=&r" (tmp2)
|
|
: "r" (&rw->lock)
|
|
: "cc");
|
|
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_read_unlock(arch_rwlock_t *rw)
|
|
{
|
|
unsigned long tmp, tmp2;
|
|
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
|
|
prefetchw(&rw->lock);
|
|
__asm__ __volatile__(
|
|
"1: ldrex %0, [%2]\n"
|
|
" sub %0, %0, #1\n"
|
|
" strex %1, %0, [%2]\n"
|
|
" teq %1, #0\n"
|
|
" bne 1b"
|
|
: "=&r" (tmp), "=&r" (tmp2)
|
|
: "r" (&rw->lock)
|
|
: "cc");
|
|
|
|
if (tmp == 0)
|
|
dsb_sev();
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int arch_read_trylock(arch_rwlock_t *rw)
|
|
{
|
|
unsigned long contended, res;
|
|
|
|
prefetchw(&rw->lock);
|
|
do {
|
|
__asm__ __volatile__(
|
|
" ldrex %0, [%2]\n"
|
|
" mov %1, #0\n"
|
|
" adds %0, %0, #1\n"
|
|
" strexpl %1, %0, [%2]"
|
|
: "=&r" (contended), "=&r" (res)
|
|
: "r" (&rw->lock)
|
|
: "cc");
|
|
} while (res);
|
|
|
|
|
|
if (contended < 0x80000000) {
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
return 1;
|
|
} else {
|
|
return 0;
|
|
}
|
|
}
|
|
# 88 "include/linux/spinlock.h" 2
|
|
# 145 "include/linux/spinlock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void do_raw_spin_lock(raw_spinlock_t *lock)
|
|
{
|
|
(void)0;
|
|
arch_spin_lock(&lock->raw_lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
do_raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long *flags)
|
|
{
|
|
(void)0;
|
|
arch_spin_lock(&lock->raw_lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int do_raw_spin_trylock(raw_spinlock_t *lock)
|
|
{
|
|
return arch_spin_trylock(&(lock)->raw_lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void do_raw_spin_unlock(raw_spinlock_t *lock)
|
|
{
|
|
arch_spin_unlock(&lock->raw_lock);
|
|
(void)0;
|
|
}
|
|
# 274 "include/linux/spinlock.h"
|
|
# 1 "include/linux/rwlock.h" 1
|
|
# 275 "include/linux/spinlock.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/spinlock_api_smp.h" 1
|
|
# 18 "include/linux/spinlock_api_smp.h"
|
|
int in_lock_functions(unsigned long addr);
|
|
|
|
|
|
|
|
void __attribute__((section(".spinlock.text"))) _raw_spin_lock(raw_spinlock_t *lock) ;
|
|
void __attribute__((section(".spinlock.text"))) _raw_spin_lock_nested(raw_spinlock_t *lock, int subclass)
|
|
;
|
|
void __attribute__((section(".spinlock.text"))) _raw_spin_lock_bh_nested(raw_spinlock_t *lock, int subclass)
|
|
;
|
|
void __attribute__((section(".spinlock.text")))
|
|
_raw_spin_lock_nest_lock(raw_spinlock_t *lock, struct lockdep_map *map)
|
|
;
|
|
void __attribute__((section(".spinlock.text"))) _raw_spin_lock_bh(raw_spinlock_t *lock) ;
|
|
void __attribute__((section(".spinlock.text"))) _raw_spin_lock_irq(raw_spinlock_t *lock)
|
|
;
|
|
|
|
unsigned long __attribute__((section(".spinlock.text"))) _raw_spin_lock_irqsave(raw_spinlock_t *lock)
|
|
;
|
|
unsigned long __attribute__((section(".spinlock.text")))
|
|
_raw_spin_lock_irqsave_nested(raw_spinlock_t *lock, int subclass)
|
|
;
|
|
int __attribute__((section(".spinlock.text"))) _raw_spin_trylock(raw_spinlock_t *lock);
|
|
int __attribute__((section(".spinlock.text"))) _raw_spin_trylock_bh(raw_spinlock_t *lock);
|
|
void __attribute__((section(".spinlock.text"))) _raw_spin_unlock(raw_spinlock_t *lock) ;
|
|
void __attribute__((section(".spinlock.text"))) _raw_spin_unlock_bh(raw_spinlock_t *lock) ;
|
|
void __attribute__((section(".spinlock.text"))) _raw_spin_unlock_irq(raw_spinlock_t *lock) ;
|
|
void __attribute__((section(".spinlock.text")))
|
|
_raw_spin_unlock_irqrestore(raw_spinlock_t *lock, unsigned long flags)
|
|
;
|
|
# 88 "include/linux/spinlock_api_smp.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __raw_spin_trylock(raw_spinlock_t *lock)
|
|
{
|
|
__asm__ __volatile__("": : :"memory");
|
|
if (do_raw_spin_trylock(lock)) {
|
|
do { } while (0);
|
|
return 1;
|
|
}
|
|
__asm__ __volatile__("": : :"memory");
|
|
return 0;
|
|
}
|
|
# 106 "include/linux/spinlock_api_smp.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __raw_spin_lock_irqsave(raw_spinlock_t *lock)
|
|
{
|
|
unsigned long flags;
|
|
|
|
do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0); } while (0);
|
|
__asm__ __volatile__("": : :"memory");
|
|
do { } while (0);
|
|
# 121 "include/linux/spinlock_api_smp.h"
|
|
do_raw_spin_lock_flags(lock, &flags);
|
|
|
|
return flags;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_spin_lock_irq(raw_spinlock_t *lock)
|
|
{
|
|
do { arch_local_irq_disable(); } while (0);
|
|
__asm__ __volatile__("": : :"memory");
|
|
do { } while (0);
|
|
do_raw_spin_lock(lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_spin_lock_bh(raw_spinlock_t *lock)
|
|
{
|
|
__local_bh_disable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
|
|
do { } while (0);
|
|
do_raw_spin_lock(lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_spin_lock(raw_spinlock_t *lock)
|
|
{
|
|
__asm__ __volatile__("": : :"memory");
|
|
do { } while (0);
|
|
do_raw_spin_lock(lock);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_spin_unlock(raw_spinlock_t *lock)
|
|
{
|
|
do { } while (0);
|
|
do_raw_spin_unlock(lock);
|
|
__asm__ __volatile__("": : :"memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_spin_unlock_irqrestore(raw_spinlock_t *lock,
|
|
unsigned long flags)
|
|
{
|
|
do { } while (0);
|
|
do_raw_spin_unlock(lock);
|
|
do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); } while (0);
|
|
__asm__ __volatile__("": : :"memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_spin_unlock_irq(raw_spinlock_t *lock)
|
|
{
|
|
do { } while (0);
|
|
do_raw_spin_unlock(lock);
|
|
do { arch_local_irq_enable(); } while (0);
|
|
__asm__ __volatile__("": : :"memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_spin_unlock_bh(raw_spinlock_t *lock)
|
|
{
|
|
do { } while (0);
|
|
do_raw_spin_unlock(lock);
|
|
__local_bh_enable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __raw_spin_trylock_bh(raw_spinlock_t *lock)
|
|
{
|
|
__local_bh_disable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
|
|
if (do_raw_spin_trylock(lock)) {
|
|
do { } while (0);
|
|
return 1;
|
|
}
|
|
__local_bh_enable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
|
|
return 0;
|
|
}
|
|
|
|
# 1 "include/linux/rwlock_api_smp.h" 1
|
|
# 18 "include/linux/rwlock_api_smp.h"
|
|
void __attribute__((section(".spinlock.text"))) _raw_read_lock(rwlock_t *lock) ;
|
|
void __attribute__((section(".spinlock.text"))) _raw_write_lock(rwlock_t *lock) ;
|
|
void __attribute__((section(".spinlock.text"))) _raw_read_lock_bh(rwlock_t *lock) ;
|
|
void __attribute__((section(".spinlock.text"))) _raw_write_lock_bh(rwlock_t *lock) ;
|
|
void __attribute__((section(".spinlock.text"))) _raw_read_lock_irq(rwlock_t *lock) ;
|
|
void __attribute__((section(".spinlock.text"))) _raw_write_lock_irq(rwlock_t *lock) ;
|
|
unsigned long __attribute__((section(".spinlock.text"))) _raw_read_lock_irqsave(rwlock_t *lock)
|
|
;
|
|
unsigned long __attribute__((section(".spinlock.text"))) _raw_write_lock_irqsave(rwlock_t *lock)
|
|
;
|
|
int __attribute__((section(".spinlock.text"))) _raw_read_trylock(rwlock_t *lock);
|
|
int __attribute__((section(".spinlock.text"))) _raw_write_trylock(rwlock_t *lock);
|
|
void __attribute__((section(".spinlock.text"))) _raw_read_unlock(rwlock_t *lock) ;
|
|
void __attribute__((section(".spinlock.text"))) _raw_write_unlock(rwlock_t *lock) ;
|
|
void __attribute__((section(".spinlock.text"))) _raw_read_unlock_bh(rwlock_t *lock) ;
|
|
void __attribute__((section(".spinlock.text"))) _raw_write_unlock_bh(rwlock_t *lock) ;
|
|
void __attribute__((section(".spinlock.text"))) _raw_read_unlock_irq(rwlock_t *lock) ;
|
|
void __attribute__((section(".spinlock.text"))) _raw_write_unlock_irq(rwlock_t *lock) ;
|
|
void __attribute__((section(".spinlock.text")))
|
|
_raw_read_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
|
|
;
|
|
void __attribute__((section(".spinlock.text")))
|
|
_raw_write_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
|
|
;
|
|
# 117 "include/linux/rwlock_api_smp.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __raw_read_trylock(rwlock_t *lock)
|
|
{
|
|
__asm__ __volatile__("": : :"memory");
|
|
if (arch_read_trylock(&(lock)->raw_lock)) {
|
|
do { } while (0);
|
|
return 1;
|
|
}
|
|
__asm__ __volatile__("": : :"memory");
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __raw_write_trylock(rwlock_t *lock)
|
|
{
|
|
__asm__ __volatile__("": : :"memory");
|
|
if (arch_write_trylock(&(lock)->raw_lock)) {
|
|
do { } while (0);
|
|
return 1;
|
|
}
|
|
__asm__ __volatile__("": : :"memory");
|
|
return 0;
|
|
}
|
|
# 146 "include/linux/rwlock_api_smp.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_read_lock(rwlock_t *lock)
|
|
{
|
|
__asm__ __volatile__("": : :"memory");
|
|
do { } while (0);
|
|
do {(void)0; arch_read_lock(&(lock)->raw_lock); } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __raw_read_lock_irqsave(rwlock_t *lock)
|
|
{
|
|
unsigned long flags;
|
|
|
|
do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0); } while (0);
|
|
__asm__ __volatile__("": : :"memory");
|
|
do { } while (0);
|
|
do {(void)0; arch_read_lock(&((lock))->raw_lock); } while (0)
|
|
;
|
|
return flags;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_read_lock_irq(rwlock_t *lock)
|
|
{
|
|
do { arch_local_irq_disable(); } while (0);
|
|
__asm__ __volatile__("": : :"memory");
|
|
do { } while (0);
|
|
do {(void)0; arch_read_lock(&(lock)->raw_lock); } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_read_lock_bh(rwlock_t *lock)
|
|
{
|
|
__local_bh_disable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
|
|
do { } while (0);
|
|
do {(void)0; arch_read_lock(&(lock)->raw_lock); } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __raw_write_lock_irqsave(rwlock_t *lock)
|
|
{
|
|
unsigned long flags;
|
|
|
|
do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0); } while (0);
|
|
__asm__ __volatile__("": : :"memory");
|
|
do { } while (0);
|
|
do {(void)0; arch_write_lock(&((lock))->raw_lock); } while (0)
|
|
;
|
|
return flags;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_write_lock_irq(rwlock_t *lock)
|
|
{
|
|
do { arch_local_irq_disable(); } while (0);
|
|
__asm__ __volatile__("": : :"memory");
|
|
do { } while (0);
|
|
do {(void)0; arch_write_lock(&(lock)->raw_lock); } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_write_lock_bh(rwlock_t *lock)
|
|
{
|
|
__local_bh_disable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
|
|
do { } while (0);
|
|
do {(void)0; arch_write_lock(&(lock)->raw_lock); } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_write_lock(rwlock_t *lock)
|
|
{
|
|
__asm__ __volatile__("": : :"memory");
|
|
do { } while (0);
|
|
do {(void)0; arch_write_lock(&(lock)->raw_lock); } while (0);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_write_unlock(rwlock_t *lock)
|
|
{
|
|
do { } while (0);
|
|
do {arch_write_unlock(&(lock)->raw_lock); (void)0; } while (0);
|
|
__asm__ __volatile__("": : :"memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_read_unlock(rwlock_t *lock)
|
|
{
|
|
do { } while (0);
|
|
do {arch_read_unlock(&(lock)->raw_lock); (void)0; } while (0);
|
|
__asm__ __volatile__("": : :"memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
__raw_read_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
|
|
{
|
|
do { } while (0);
|
|
do {arch_read_unlock(&(lock)->raw_lock); (void)0; } while (0);
|
|
do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); } while (0);
|
|
__asm__ __volatile__("": : :"memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_read_unlock_irq(rwlock_t *lock)
|
|
{
|
|
do { } while (0);
|
|
do {arch_read_unlock(&(lock)->raw_lock); (void)0; } while (0);
|
|
do { arch_local_irq_enable(); } while (0);
|
|
__asm__ __volatile__("": : :"memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_read_unlock_bh(rwlock_t *lock)
|
|
{
|
|
do { } while (0);
|
|
do {arch_read_unlock(&(lock)->raw_lock); (void)0; } while (0);
|
|
__local_bh_enable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_write_unlock_irqrestore(rwlock_t *lock,
|
|
unsigned long flags)
|
|
{
|
|
do { } while (0);
|
|
do {arch_write_unlock(&(lock)->raw_lock); (void)0; } while (0);
|
|
do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); } while (0);
|
|
__asm__ __volatile__("": : :"memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_write_unlock_irq(rwlock_t *lock)
|
|
{
|
|
do { } while (0);
|
|
do {arch_write_unlock(&(lock)->raw_lock); (void)0; } while (0);
|
|
do { arch_local_irq_enable(); } while (0);
|
|
__asm__ __volatile__("": : :"memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_write_unlock_bh(rwlock_t *lock)
|
|
{
|
|
do { } while (0);
|
|
do {arch_write_unlock(&(lock)->raw_lock); (void)0; } while (0);
|
|
__local_bh_enable_ip((unsigned long)__builtin_return_address(0), ((2 * (1UL << (0 + 8))) + 0));
|
|
}
|
|
# 193 "include/linux/spinlock_api_smp.h" 2
|
|
# 281 "include/linux/spinlock.h" 2
|
|
# 289 "include/linux/spinlock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) raw_spinlock_t *spinlock_check(spinlock_t *lock)
|
|
{
|
|
return &lock->rlock;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void spin_lock(spinlock_t *lock)
|
|
{
|
|
_raw_spin_lock(&lock->rlock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void spin_lock_bh(spinlock_t *lock)
|
|
{
|
|
_raw_spin_lock_bh(&lock->rlock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) int spin_trylock(spinlock_t *lock)
|
|
{
|
|
return (_raw_spin_trylock(&lock->rlock));
|
|
}
|
|
# 330 "include/linux/spinlock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void spin_lock_irq(spinlock_t *lock)
|
|
{
|
|
_raw_spin_lock_irq(&lock->rlock);
|
|
}
|
|
# 345 "include/linux/spinlock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void spin_unlock(spinlock_t *lock)
|
|
{
|
|
__raw_spin_unlock(&lock->rlock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void spin_unlock_bh(spinlock_t *lock)
|
|
{
|
|
_raw_spin_unlock_bh(&lock->rlock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void spin_unlock_irq(spinlock_t *lock)
|
|
{
|
|
__raw_spin_unlock_irq(&lock->rlock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags)
|
|
{
|
|
do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); _raw_spin_unlock_irqrestore(&lock->rlock, flags); } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) int spin_trylock_bh(spinlock_t *lock)
|
|
{
|
|
return (_raw_spin_trylock_bh(&lock->rlock));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) int spin_trylock_irq(spinlock_t *lock)
|
|
{
|
|
return ({ do { arch_local_irq_disable(); } while (0); (_raw_spin_trylock(&lock->rlock)) ? 1 : ({ do { arch_local_irq_enable(); } while (0); 0; }); });
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void spin_unlock_wait(spinlock_t *lock)
|
|
{
|
|
do { while (arch_spin_is_locked(&(&lock->rlock)->raw_lock)) __asm__ __volatile__("": : :"memory"); } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) int spin_is_locked(spinlock_t *lock)
|
|
{
|
|
return arch_spin_is_locked(&(&lock->rlock)->raw_lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) int spin_is_contended(spinlock_t *lock)
|
|
{
|
|
return arch_spin_is_contended(&(&lock->rlock)->raw_lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) int spin_can_lock(spinlock_t *lock)
|
|
{
|
|
return (!arch_spin_is_locked(&(&lock->rlock)->raw_lock));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/atomic.h" 1
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/atomic.h" 1
|
|
# 19 "./arch/arm/include/asm/atomic.h"
|
|
# 1 "./arch/arm/include/asm/cmpxchg.h" 1
|
|
# 27 "./arch/arm/include/asm/cmpxchg.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
|
|
{
|
|
extern void __bad_xchg(volatile void *, int);
|
|
unsigned long ret;
|
|
|
|
|
|
|
|
|
|
unsigned int tmp;
|
|
|
|
|
|
prefetchw((const void *)ptr);
|
|
|
|
switch (size) {
|
|
|
|
|
|
case 1:
|
|
asm volatile("@ __xchg1\n"
|
|
"1: ldrexb %0, [%3]\n"
|
|
" strexb %1, %2, [%3]\n"
|
|
" teq %1, #0\n"
|
|
" bne 1b"
|
|
: "=&r" (ret), "=&r" (tmp)
|
|
: "r" (x), "r" (ptr)
|
|
: "memory", "cc");
|
|
break;
|
|
case 2:
|
|
asm volatile("@ __xchg2\n"
|
|
"1: ldrexh %0, [%3]\n"
|
|
" strexh %1, %2, [%3]\n"
|
|
" teq %1, #0\n"
|
|
" bne 1b"
|
|
: "=&r" (ret), "=&r" (tmp)
|
|
: "r" (x), "r" (ptr)
|
|
: "memory", "cc");
|
|
break;
|
|
|
|
case 4:
|
|
asm volatile("@ __xchg4\n"
|
|
"1: ldrex %0, [%3]\n"
|
|
" strex %1, %2, [%3]\n"
|
|
" teq %1, #0\n"
|
|
" bne 1b"
|
|
: "=&r" (ret), "=&r" (tmp)
|
|
: "r" (x), "r" (ptr)
|
|
: "memory", "cc");
|
|
break;
|
|
# 107 "./arch/arm/include/asm/cmpxchg.h"
|
|
default:
|
|
|
|
__bad_xchg(ptr, size), ret = 0;
|
|
break;
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/asm-generic/cmpxchg-local.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern unsigned long wrong_size_cmpxchg(volatile void *ptr)
|
|
__attribute__((noreturn));
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __cmpxchg_local_generic(volatile void *ptr,
|
|
unsigned long old, unsigned long new, int size)
|
|
{
|
|
unsigned long flags, prev;
|
|
|
|
|
|
|
|
|
|
if (size == 8 && sizeof(unsigned long) != 8)
|
|
wrong_size_cmpxchg(ptr);
|
|
|
|
do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0);
|
|
switch (size) {
|
|
case 1: prev = *(u8 *)ptr;
|
|
if (prev == old)
|
|
*(u8 *)ptr = (u8)new;
|
|
break;
|
|
case 2: prev = *(u16 *)ptr;
|
|
if (prev == old)
|
|
*(u16 *)ptr = (u16)new;
|
|
break;
|
|
case 4: prev = *(u32 *)ptr;
|
|
if (prev == old)
|
|
*(u32 *)ptr = (u32)new;
|
|
break;
|
|
case 8: prev = *(u64 *)ptr;
|
|
if (prev == old)
|
|
*(u64 *)ptr = (u64)new;
|
|
break;
|
|
default:
|
|
wrong_size_cmpxchg(ptr);
|
|
}
|
|
do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0);
|
|
return prev;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 __cmpxchg64_local_generic(volatile void *ptr,
|
|
u64 old, u64 new)
|
|
{
|
|
u64 prev;
|
|
unsigned long flags;
|
|
|
|
do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0);
|
|
prev = *(u64 *)ptr;
|
|
if (prev == old)
|
|
*(u64 *)ptr = new;
|
|
do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0);
|
|
return prev;
|
|
}
|
|
# 122 "./arch/arm/include/asm/cmpxchg.h" 2
|
|
# 149 "./arch/arm/include/asm/cmpxchg.h"
|
|
extern void __bad_cmpxchg(volatile void *ptr, int size);
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
|
|
unsigned long new, int size)
|
|
{
|
|
unsigned long oldval, res;
|
|
|
|
prefetchw((const void *)ptr);
|
|
|
|
switch (size) {
|
|
|
|
case 1:
|
|
do {
|
|
asm volatile("@ __cmpxchg1\n"
|
|
" ldrexb %1, [%2]\n"
|
|
" mov %0, #0\n"
|
|
" teq %1, %3\n"
|
|
" strexbeq %0, %4, [%2]\n"
|
|
: "=&r" (res), "=&r" (oldval)
|
|
: "r" (ptr), "Ir" (old), "r" (new)
|
|
: "memory", "cc");
|
|
} while (res);
|
|
break;
|
|
case 2:
|
|
do {
|
|
asm volatile("@ __cmpxchg1\n"
|
|
" ldrexh %1, [%2]\n"
|
|
" mov %0, #0\n"
|
|
" teq %1, %3\n"
|
|
" strexheq %0, %4, [%2]\n"
|
|
: "=&r" (res), "=&r" (oldval)
|
|
: "r" (ptr), "Ir" (old), "r" (new)
|
|
: "memory", "cc");
|
|
} while (res);
|
|
break;
|
|
|
|
case 4:
|
|
do {
|
|
asm volatile("@ __cmpxchg4\n"
|
|
" ldrex %1, [%2]\n"
|
|
" mov %0, #0\n"
|
|
" teq %1, %3\n"
|
|
" strexeq %0, %4, [%2]\n"
|
|
: "=&r" (res), "=&r" (oldval)
|
|
: "r" (ptr), "Ir" (old), "r" (new)
|
|
: "memory", "cc");
|
|
} while (res);
|
|
break;
|
|
default:
|
|
__bad_cmpxchg(ptr, size);
|
|
oldval = 0;
|
|
}
|
|
|
|
return oldval;
|
|
}
|
|
# 216 "./arch/arm/include/asm/cmpxchg.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __cmpxchg_local(volatile void *ptr,
|
|
unsigned long old,
|
|
unsigned long new, int size)
|
|
{
|
|
unsigned long ret;
|
|
|
|
switch (size) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
ret = __cmpxchg(ptr, old, new, size);
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
# 243 "./arch/arm/include/asm/cmpxchg.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long long __cmpxchg64(unsigned long long *ptr,
|
|
unsigned long long old,
|
|
unsigned long long new)
|
|
{
|
|
unsigned long long oldval;
|
|
unsigned long res;
|
|
|
|
prefetchw(ptr);
|
|
|
|
__asm__ __volatile__(
|
|
"1: ldrexd %1, %H1, [%3]\n"
|
|
" teq %1, %4\n"
|
|
" teqeq %H1, %H4\n"
|
|
" bne 2f\n"
|
|
" strexd %0, %5, %H5, [%3]\n"
|
|
" teq %0, #0\n"
|
|
" bne 1b\n"
|
|
"2:"
|
|
: "=&r" (res), "=&r" (oldval), "+Qo" (*ptr)
|
|
: "r" (ptr), "r" (old), "r" (new)
|
|
: "cc");
|
|
|
|
return oldval;
|
|
}
|
|
# 20 "./arch/arm/include/asm/atomic.h" 2
|
|
# 83 "./arch/arm/include/asm/atomic.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_cmpxchg_relaxed(atomic_t *ptr, int old, int new)
|
|
{
|
|
int oldval;
|
|
unsigned long res;
|
|
|
|
prefetchw(&ptr->counter);
|
|
|
|
do {
|
|
__asm__ __volatile__("@ atomic_cmpxchg\n"
|
|
"ldrex %1, [%3]\n"
|
|
"mov %0, #0\n"
|
|
"teq %1, %4\n"
|
|
"strexeq %0, %5, [%3]\n"
|
|
: "=&r" (res), "=&r" (oldval), "+Qo" (ptr->counter)
|
|
: "r" (&ptr->counter), "Ir" (old), "r" (new)
|
|
: "cc");
|
|
} while (res);
|
|
|
|
return oldval;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __atomic_add_unless(atomic_t *v, int a, int u)
|
|
{
|
|
int oldval, newval;
|
|
unsigned long tmp;
|
|
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
prefetchw(&v->counter);
|
|
|
|
__asm__ __volatile__ ("@ atomic_add_unless\n"
|
|
"1: ldrex %0, [%4]\n"
|
|
" teq %0, %5\n"
|
|
" beq 2f\n"
|
|
" add %1, %0, %6\n"
|
|
" strex %2, %1, [%4]\n"
|
|
" teq %2, #0\n"
|
|
" bne 1b\n"
|
|
"2:"
|
|
: "=&r" (oldval), "=&r" (newval), "=&r" (tmp), "+Qo" (v->counter)
|
|
: "r" (&v->counter), "r" (u), "r" (a)
|
|
: "cc");
|
|
|
|
if (oldval != u)
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
|
|
return oldval;
|
|
}
|
|
# 192 "./arch/arm/include/asm/atomic.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_add(int i, atomic_t *v) { unsigned long tmp; int result; prefetchw(&v->counter); __asm__ __volatile__("@ atomic_" "add" "\n" "1: ldrex %0, [%3]\n" " " "add" " %0, %0, %4\n" " strex %1, %0, [%3]\n" " teq %1, #0\n" " bne 1b" : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) : "r" (&v->counter), "Ir" (i) : "cc"); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_add_return_relaxed(int i, atomic_t *v) { unsigned long tmp; int result; prefetchw(&v->counter); __asm__ __volatile__("@ atomic_" "add" "_return\n" "1: ldrex %0, [%3]\n" " " "add" " %0, %0, %4\n" " strex %1, %0, [%3]\n" " teq %1, #0\n" " bne 1b" : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) : "r" (&v->counter), "Ir" (i) : "cc"); return result; }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_sub(int i, atomic_t *v) { unsigned long tmp; int result; prefetchw(&v->counter); __asm__ __volatile__("@ atomic_" "sub" "\n" "1: ldrex %0, [%3]\n" " " "sub" " %0, %0, %4\n" " strex %1, %0, [%3]\n" " teq %1, #0\n" " bne 1b" : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) : "r" (&v->counter), "Ir" (i) : "cc"); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_sub_return_relaxed(int i, atomic_t *v) { unsigned long tmp; int result; prefetchw(&v->counter); __asm__ __volatile__("@ atomic_" "sub" "_return\n" "1: ldrex %0, [%3]\n" " " "sub" " %0, %0, %4\n" " strex %1, %0, [%3]\n" " teq %1, #0\n" " bne 1b" : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) : "r" (&v->counter), "Ir" (i) : "cc"); return result; }
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_and(int i, atomic_t *v) { unsigned long tmp; int result; prefetchw(&v->counter); __asm__ __volatile__("@ atomic_" "and" "\n" "1: ldrex %0, [%3]\n" " " "and" " %0, %0, %4\n" " strex %1, %0, [%3]\n" " teq %1, #0\n" " bne 1b" : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) : "r" (&v->counter), "Ir" (i) : "cc"); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_andnot(int i, atomic_t *v) { unsigned long tmp; int result; prefetchw(&v->counter); __asm__ __volatile__("@ atomic_" "andnot" "\n" "1: ldrex %0, [%3]\n" " " "bic" " %0, %0, %4\n" " strex %1, %0, [%3]\n" " teq %1, #0\n" " bne 1b" : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) : "r" (&v->counter), "Ir" (i) : "cc"); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_or(int i, atomic_t *v) { unsigned long tmp; int result; prefetchw(&v->counter); __asm__ __volatile__("@ atomic_" "or" "\n" "1: ldrex %0, [%3]\n" " " "orr" " %0, %0, %4\n" " strex %1, %0, [%3]\n" " teq %1, #0\n" " bne 1b" : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) : "r" (&v->counter), "Ir" (i) : "cc"); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_xor(int i, atomic_t *v) { unsigned long tmp; int result; prefetchw(&v->counter); __asm__ __volatile__("@ atomic_" "xor" "\n" "1: ldrex %0, [%3]\n" " " "eor" " %0, %0, %4\n" " strex %1, %0, [%3]\n" " teq %1, #0\n" " bne 1b" : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) : "r" (&v->counter), "Ir" (i) : "cc"); }
|
|
# 220 "./arch/arm/include/asm/atomic.h"
|
|
typedef struct {
|
|
long long counter;
|
|
} atomic64_t;
|
|
# 249 "./arch/arm/include/asm/atomic.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long long atomic64_read(const atomic64_t *v)
|
|
{
|
|
long long result;
|
|
|
|
__asm__ __volatile__("@ atomic64_read\n"
|
|
" ldrexd %0, %H0, [%1]"
|
|
: "=&r" (result)
|
|
: "r" (&v->counter), "Qo" (v->counter)
|
|
);
|
|
|
|
return result;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic64_set(atomic64_t *v, long long i)
|
|
{
|
|
long long tmp;
|
|
|
|
prefetchw(&v->counter);
|
|
__asm__ __volatile__("@ atomic64_set\n"
|
|
"1: ldrexd %0, %H0, [%2]\n"
|
|
" strexd %0, %3, %H3, [%2]\n"
|
|
" teq %0, #0\n"
|
|
" bne 1b"
|
|
: "=&r" (tmp), "=Qo" (v->counter)
|
|
: "r" (&v->counter), "r" (i)
|
|
: "cc");
|
|
}
|
|
# 324 "./arch/arm/include/asm/atomic.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic64_add(long long i, atomic64_t *v) { long long result; unsigned long tmp; prefetchw(&v->counter); __asm__ __volatile__("@ atomic64_" "add" "\n" "1: ldrexd %0, %H0, [%3]\n" " " "adds" " %Q0, %Q0, %Q4\n" " " "adc" " %R0, %R0, %R4\n" " strexd %1, %0, %H0, [%3]\n" " teq %1, #0\n" " bne 1b" : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) : "r" (&v->counter), "r" (i) : "cc"); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long long atomic64_add_return_relaxed(long long i, atomic64_t *v) { long long result; unsigned long tmp; prefetchw(&v->counter); __asm__ __volatile__("@ atomic64_" "add" "_return\n" "1: ldrexd %0, %H0, [%3]\n" " " "adds" " %Q0, %Q0, %Q4\n" " " "adc" " %R0, %R0, %R4\n" " strexd %1, %0, %H0, [%3]\n" " teq %1, #0\n" " bne 1b" : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) : "r" (&v->counter), "r" (i) : "cc"); return result; }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic64_sub(long long i, atomic64_t *v) { long long result; unsigned long tmp; prefetchw(&v->counter); __asm__ __volatile__("@ atomic64_" "sub" "\n" "1: ldrexd %0, %H0, [%3]\n" " " "subs" " %Q0, %Q0, %Q4\n" " " "sbc" " %R0, %R0, %R4\n" " strexd %1, %0, %H0, [%3]\n" " teq %1, #0\n" " bne 1b" : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) : "r" (&v->counter), "r" (i) : "cc"); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long long atomic64_sub_return_relaxed(long long i, atomic64_t *v) { long long result; unsigned long tmp; prefetchw(&v->counter); __asm__ __volatile__("@ atomic64_" "sub" "_return\n" "1: ldrexd %0, %H0, [%3]\n" " " "subs" " %Q0, %Q0, %Q4\n" " " "sbc" " %R0, %R0, %R4\n" " strexd %1, %0, %H0, [%3]\n" " teq %1, #0\n" " bne 1b" : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) : "r" (&v->counter), "r" (i) : "cc"); return result; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic64_and(long long i, atomic64_t *v) { long long result; unsigned long tmp; prefetchw(&v->counter); __asm__ __volatile__("@ atomic64_" "and" "\n" "1: ldrexd %0, %H0, [%3]\n" " " "and" " %Q0, %Q0, %Q4\n" " " "and" " %R0, %R0, %R4\n" " strexd %1, %0, %H0, [%3]\n" " teq %1, #0\n" " bne 1b" : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) : "r" (&v->counter), "r" (i) : "cc"); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic64_andnot(long long i, atomic64_t *v) { long long result; unsigned long tmp; prefetchw(&v->counter); __asm__ __volatile__("@ atomic64_" "andnot" "\n" "1: ldrexd %0, %H0, [%3]\n" " " "bic" " %Q0, %Q0, %Q4\n" " " "bic" " %R0, %R0, %R4\n" " strexd %1, %0, %H0, [%3]\n" " teq %1, #0\n" " bne 1b" : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) : "r" (&v->counter), "r" (i) : "cc"); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic64_or(long long i, atomic64_t *v) { long long result; unsigned long tmp; prefetchw(&v->counter); __asm__ __volatile__("@ atomic64_" "or" "\n" "1: ldrexd %0, %H0, [%3]\n" " " "orr" " %Q0, %Q0, %Q4\n" " " "orr" " %R0, %R0, %R4\n" " strexd %1, %0, %H0, [%3]\n" " teq %1, #0\n" " bne 1b" : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) : "r" (&v->counter), "r" (i) : "cc"); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic64_xor(long long i, atomic64_t *v) { long long result; unsigned long tmp; prefetchw(&v->counter); __asm__ __volatile__("@ atomic64_" "xor" "\n" "1: ldrexd %0, %H0, [%3]\n" " " "eor" " %Q0, %Q0, %Q4\n" " " "eor" " %R0, %R0, %R4\n" " strexd %1, %0, %H0, [%3]\n" " teq %1, #0\n" " bne 1b" : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) : "r" (&v->counter), "r" (i) : "cc"); }
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long long
|
|
atomic64_cmpxchg_relaxed(atomic64_t *ptr, long long old, long long new)
|
|
{
|
|
long long oldval;
|
|
unsigned long res;
|
|
|
|
prefetchw(&ptr->counter);
|
|
|
|
do {
|
|
__asm__ __volatile__("@ atomic64_cmpxchg\n"
|
|
"ldrexd %1, %H1, [%3]\n"
|
|
"mov %0, #0\n"
|
|
"teq %1, %4\n"
|
|
"teqeq %H1, %H4\n"
|
|
"strexdeq %0, %5, %H5, [%3]"
|
|
: "=&r" (res), "=&r" (oldval), "+Qo" (ptr->counter)
|
|
: "r" (&ptr->counter), "r" (old), "r" (new)
|
|
: "cc");
|
|
} while (res);
|
|
|
|
return oldval;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long long atomic64_xchg_relaxed(atomic64_t *ptr, long long new)
|
|
{
|
|
long long result;
|
|
unsigned long tmp;
|
|
|
|
prefetchw(&ptr->counter);
|
|
|
|
__asm__ __volatile__("@ atomic64_xchg\n"
|
|
"1: ldrexd %0, %H0, [%3]\n"
|
|
" strexd %1, %4, %H4, [%3]\n"
|
|
" teq %1, #0\n"
|
|
" bne 1b"
|
|
: "=&r" (result), "=&r" (tmp), "+Qo" (ptr->counter)
|
|
: "r" (&ptr->counter), "r" (new)
|
|
: "cc");
|
|
|
|
return result;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long long atomic64_dec_if_positive(atomic64_t *v)
|
|
{
|
|
long long result;
|
|
unsigned long tmp;
|
|
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
prefetchw(&v->counter);
|
|
|
|
__asm__ __volatile__("@ atomic64_dec_if_positive\n"
|
|
"1: ldrexd %0, %H0, [%3]\n"
|
|
" subs %Q0, %Q0, #1\n"
|
|
" sbc %R0, %R0, #0\n"
|
|
" teq %R0, #0\n"
|
|
" bmi 2f\n"
|
|
" strexd %1, %0, %H0, [%3]\n"
|
|
" teq %1, #0\n"
|
|
" bne 1b\n"
|
|
"2:"
|
|
: "=&r" (result), "=&r" (tmp), "+Qo" (v->counter)
|
|
: "r" (&v->counter)
|
|
: "cc");
|
|
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
|
|
return result;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic64_add_unless(atomic64_t *v, long long a, long long u)
|
|
{
|
|
long long val;
|
|
unsigned long tmp;
|
|
int ret = 1;
|
|
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
prefetchw(&v->counter);
|
|
|
|
__asm__ __volatile__("@ atomic64_add_unless\n"
|
|
"1: ldrexd %0, %H0, [%4]\n"
|
|
" teq %0, %5\n"
|
|
" teqeq %H0, %H5\n"
|
|
" moveq %1, #0\n"
|
|
" beq 2f\n"
|
|
" adds %Q0, %Q0, %Q6\n"
|
|
" adc %R0, %R0, %R6\n"
|
|
" strexd %2, %0, %H0, [%4]\n"
|
|
" teq %2, #0\n"
|
|
" bne 1b\n"
|
|
"2:"
|
|
: "=&r" (val), "+r" (ret), "=&r" (tmp), "+Qo" (v->counter)
|
|
: "r" (&v->counter), "r" (u), "r" (a)
|
|
: "cc");
|
|
|
|
if (ret)
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
|
|
return ret;
|
|
}
|
|
# 5 "include/linux/atomic.h" 2
|
|
# 435 "include/linux/atomic.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_add_unless(atomic_t *v, int a, int u)
|
|
{
|
|
return __atomic_add_unless(v, a, u) != u;
|
|
}
|
|
# 458 "include/linux/atomic.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((deprecated)) void atomic_clear_mask(unsigned int mask, atomic_t *v)
|
|
{
|
|
atomic_andnot(mask, v);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((deprecated)) void atomic_set_mask(unsigned int mask, atomic_t *v)
|
|
{
|
|
atomic_or(mask, v);
|
|
}
|
|
# 481 "include/linux/atomic.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_inc_not_zero_hint(atomic_t *v, int hint)
|
|
{
|
|
int val, c = hint;
|
|
|
|
|
|
if (!hint)
|
|
return atomic_add_unless((v), 1, 0);
|
|
|
|
do {
|
|
val = ({ typeof(atomic_cmpxchg_relaxed(v, c, c + 1)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_cmpxchg_relaxed(v, c, c + 1); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; });
|
|
if (val == c)
|
|
return 1;
|
|
c = val;
|
|
} while (c);
|
|
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_inc_unless_negative(atomic_t *p)
|
|
{
|
|
int v, v1;
|
|
for (v = 0; v >= 0; v = v1) {
|
|
v1 = ({ typeof(atomic_cmpxchg_relaxed(p, v, v + 1)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_cmpxchg_relaxed(p, v, v + 1); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; });
|
|
if (__builtin_expect(!!(v1 == v), 1))
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_dec_unless_positive(atomic_t *p)
|
|
{
|
|
int v, v1;
|
|
for (v = 0; v <= 0; v = v1) {
|
|
v1 = ({ typeof(atomic_cmpxchg_relaxed(p, v, v - 1)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_cmpxchg_relaxed(p, v, v - 1); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; });
|
|
if (__builtin_expect(!!(v1 == v), 1))
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
# 534 "include/linux/atomic.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_dec_if_positive(atomic_t *v)
|
|
{
|
|
int c, old, dec;
|
|
c = ({ union { typeof((v)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((v)->counter), __u.__c, sizeof((v)->counter)); else __read_once_size_nocheck(&((v)->counter), __u.__c, sizeof((v)->counter)); __u.__val; });
|
|
for (;;) {
|
|
dec = c - 1;
|
|
if (__builtin_expect(!!(dec < 0), 0))
|
|
break;
|
|
old = ({ typeof(atomic_cmpxchg_relaxed((v), c, dec)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_cmpxchg_relaxed((v), c, dec); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; });
|
|
if (__builtin_expect(!!(old == c), 1))
|
|
break;
|
|
c = old;
|
|
}
|
|
return dec;
|
|
}
|
|
# 562 "include/linux/atomic.h"
|
|
# 1 "include/asm-generic/atomic-long.h" 1
|
|
# 30 "include/asm-generic/atomic-long.h"
|
|
typedef atomic_t atomic_long_t;
|
|
# 44 "include/asm-generic/atomic-long.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_read(const atomic_long_t *l) { atomic_t *v = (atomic_t *)l; return (long)({ union { typeof((v)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((v)->counter), __u.__c, sizeof((v)->counter)); else __read_once_size_nocheck(&((v)->counter), __u.__c, sizeof((v)->counter)); __u.__val; }); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_read_acquire(const atomic_long_t *l) { atomic_t *v = (atomic_t *)l; return (long)({ typeof(*&(v)->counter) ___p1 = ({ union { typeof(*&(v)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&(*&(v)->counter), __u.__c, sizeof(*&(v)->counter)); else __read_once_size_nocheck(&(*&(v)->counter), __u.__c, sizeof(*&(v)->counter)); __u.__val; }); do { bool __cond = !((sizeof(*&(v)->counter) == sizeof(char) || sizeof(*&(v)->counter) == sizeof(short) || sizeof(*&(v)->counter) == sizeof(int) || sizeof(*&(v)->counter) == sizeof(long))); extern void __compiletime_assert_45(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_45(); do { } while (0); } while (0); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); ___p1; }); }
|
|
# 56 "include/asm-generic/atomic-long.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_long_set(atomic_long_t *l, long i) { atomic_t *v = (atomic_t *)l; ({ union { typeof(((v)->counter)) __val; char __c[1]; } __u = { .__val = ( typeof(((v)->counter))) ((i)) }; __write_once_size(&(((v)->counter)), __u.__c, sizeof(((v)->counter))); __u.__val; }); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_long_set_release(atomic_long_t *l, long i) { atomic_t *v = (atomic_t *)l; do { do { bool __cond = !((sizeof(*&(v)->counter) == sizeof(char) || sizeof(*&(v)->counter) == sizeof(short) || sizeof(*&(v)->counter) == sizeof(int) || sizeof(*&(v)->counter) == sizeof(long))); extern void __compiletime_assert_57(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_57(); do { } while (0); } while (0); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); ({ union { typeof(*&(v)->counter) __val; char __c[1]; } __u = { .__val = ( typeof(*&(v)->counter)) ((i)) }; __write_once_size(&(*&(v)->counter), __u.__c, sizeof(*&(v)->counter)); __u.__val; }); } while (0); }
|
|
# 69 "include/asm-generic/atomic-long.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_add_return(long i, atomic_long_t *l) { atomic_t *v = (atomic_t *)l; return (long)({ typeof(atomic_add_return_relaxed(i, v)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_add_return_relaxed(i, v); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_add_return_relaxed(long i, atomic_long_t *l) { atomic_t *v = (atomic_t *)l; return (long)atomic_add_return_relaxed(i, v); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_add_return_acquire(long i, atomic_long_t *l) { atomic_t *v = (atomic_t *)l; return (long)({ typeof(atomic_add_return_relaxed(i, v)) __ret = atomic_add_return_relaxed(i, v); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_add_return_release(long i, atomic_long_t *l) { atomic_t *v = (atomic_t *)l; return (long)({ __asm__ __volatile__ ("dmb " "ish" : : : "memory"); atomic_add_return_relaxed(i, v); }); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_sub_return(long i, atomic_long_t *l) { atomic_t *v = (atomic_t *)l; return (long)({ typeof(atomic_sub_return_relaxed(i, v)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_sub_return_relaxed(i, v); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_sub_return_relaxed(long i, atomic_long_t *l) { atomic_t *v = (atomic_t *)l; return (long)atomic_sub_return_relaxed(i, v); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_sub_return_acquire(long i, atomic_long_t *l) { atomic_t *v = (atomic_t *)l; return (long)({ typeof(atomic_sub_return_relaxed(i, v)) __ret = atomic_sub_return_relaxed(i, v); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_sub_return_release(long i, atomic_long_t *l) { atomic_t *v = (atomic_t *)l; return (long)({ __asm__ __volatile__ ("dmb " "ish" : : : "memory"); atomic_sub_return_relaxed(i, v); }); }
|
|
# 101 "include/asm-generic/atomic-long.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_long_inc(atomic_long_t *l)
|
|
{
|
|
atomic_t *v = (atomic_t *)l;
|
|
|
|
atomic_add(1, v);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_long_dec(atomic_long_t *l)
|
|
{
|
|
atomic_t *v = (atomic_t *)l;
|
|
|
|
atomic_sub(1, v);
|
|
}
|
|
# 124 "include/asm-generic/atomic-long.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_long_add(long i, atomic_long_t *l) { atomic_t *v = (atomic_t *)l; atomic_add(i, v); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_long_sub(long i, atomic_long_t *l) { atomic_t *v = (atomic_t *)l; atomic_sub(i, v); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_long_and(long i, atomic_long_t *l) { atomic_t *v = (atomic_t *)l; atomic_and(i, v); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_long_or(long i, atomic_long_t *l) { atomic_t *v = (atomic_t *)l; atomic_or(i, v); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_long_xor(long i, atomic_long_t *l) { atomic_t *v = (atomic_t *)l; atomic_xor(i, v); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void atomic_long_andnot(long i, atomic_long_t *l) { atomic_t *v = (atomic_t *)l; atomic_andnot(i, v); }
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_long_sub_and_test(long i, atomic_long_t *l)
|
|
{
|
|
atomic_t *v = (atomic_t *)l;
|
|
|
|
return (({ typeof(atomic_sub_return_relaxed(i, v)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_sub_return_relaxed(i, v); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) == 0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_long_dec_and_test(atomic_long_t *l)
|
|
{
|
|
atomic_t *v = (atomic_t *)l;
|
|
|
|
return (({ typeof(atomic_sub_return_relaxed(1, v)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_sub_return_relaxed(1, v); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) == 0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_long_inc_and_test(atomic_long_t *l)
|
|
{
|
|
atomic_t *v = (atomic_t *)l;
|
|
|
|
return (({ typeof(atomic_add_return_relaxed(1, v)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_add_return_relaxed(1, v); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) == 0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int atomic_long_add_negative(long i, atomic_long_t *l)
|
|
{
|
|
atomic_t *v = (atomic_t *)l;
|
|
|
|
return (({ typeof(atomic_add_return_relaxed(i, v)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_add_return_relaxed(i, v); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) < 0);
|
|
}
|
|
# 169 "include/asm-generic/atomic-long.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_inc_return(atomic_long_t *l) { atomic_t *v = (atomic_t *)l; return (long)({ typeof((atomic_add_return_relaxed(1, v))) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = (atomic_add_return_relaxed(1, v)); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_inc_return_relaxed(atomic_long_t *l) { atomic_t *v = (atomic_t *)l; return (long)(atomic_add_return_relaxed(1, v)); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_inc_return_acquire(atomic_long_t *l) { atomic_t *v = (atomic_t *)l; return (long)({ typeof((atomic_add_return_relaxed(1, v))) __ret = (atomic_add_return_relaxed(1, v)); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_inc_return_release(atomic_long_t *l) { atomic_t *v = (atomic_t *)l; return (long)({ __asm__ __volatile__ ("dmb " "ish" : : : "memory"); (atomic_add_return_relaxed(1, v)); }); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_dec_return(atomic_long_t *l) { atomic_t *v = (atomic_t *)l; return (long)({ typeof((atomic_sub_return_relaxed(1, v))) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = (atomic_sub_return_relaxed(1, v)); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_dec_return_relaxed(atomic_long_t *l) { atomic_t *v = (atomic_t *)l; return (long)(atomic_sub_return_relaxed(1, v)); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_dec_return_acquire(atomic_long_t *l) { atomic_t *v = (atomic_t *)l; return (long)({ typeof((atomic_sub_return_relaxed(1, v))) __ret = (atomic_sub_return_relaxed(1, v)); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_dec_return_release(atomic_long_t *l) { atomic_t *v = (atomic_t *)l; return (long)({ __asm__ __volatile__ ("dmb " "ish" : : : "memory"); (atomic_sub_return_relaxed(1, v)); }); }
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long atomic_long_add_unless(atomic_long_t *l, long a, long u)
|
|
{
|
|
atomic_t *v = (atomic_t *)l;
|
|
|
|
return (long)atomic_add_unless(v, a, u);
|
|
}
|
|
# 563 "include/linux/atomic.h" 2
|
|
# 407 "include/linux/spinlock.h" 2
|
|
# 415 "include/linux/spinlock.h"
|
|
extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock);
|
|
# 36 "include/linux/seqlock.h" 2
|
|
# 47 "include/linux/seqlock.h"
|
|
typedef struct seqcount {
|
|
unsigned sequence;
|
|
|
|
|
|
|
|
} seqcount_t;
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __seqcount_init(seqcount_t *s, const char *name,
|
|
struct lock_class_key *key)
|
|
{
|
|
|
|
|
|
|
|
do { (void)(name); (void)(key); } while (0);
|
|
s->sequence = 0;
|
|
}
|
|
# 107 "include/linux/seqlock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned __read_seqcount_begin(const seqcount_t *s)
|
|
{
|
|
unsigned ret;
|
|
|
|
repeat:
|
|
ret = ({ union { typeof(s->sequence) __val; char __c[1]; } __u; if (1) __read_once_size(&(s->sequence), __u.__c, sizeof(s->sequence)); else __read_once_size_nocheck(&(s->sequence), __u.__c, sizeof(s->sequence)); __u.__val; });
|
|
if (__builtin_expect(!!(ret & 1), 0)) {
|
|
__asm__ __volatile__("": : :"memory");
|
|
goto repeat;
|
|
}
|
|
return ret;
|
|
}
|
|
# 129 "include/linux/seqlock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned raw_read_seqcount(const seqcount_t *s)
|
|
{
|
|
unsigned ret = ({ union { typeof(s->sequence) __val; char __c[1]; } __u; if (1) __read_once_size(&(s->sequence), __u.__c, sizeof(s->sequence)); else __read_once_size_nocheck(&(s->sequence), __u.__c, sizeof(s->sequence)); __u.__val; });
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
return ret;
|
|
}
|
|
# 145 "include/linux/seqlock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned raw_read_seqcount_begin(const seqcount_t *s)
|
|
{
|
|
unsigned ret = __read_seqcount_begin(s);
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
return ret;
|
|
}
|
|
# 161 "include/linux/seqlock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned read_seqcount_begin(const seqcount_t *s)
|
|
{
|
|
;
|
|
return raw_read_seqcount_begin(s);
|
|
}
|
|
# 181 "include/linux/seqlock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned raw_seqcount_begin(const seqcount_t *s)
|
|
{
|
|
unsigned ret = ({ union { typeof(s->sequence) __val; char __c[1]; } __u; if (1) __read_once_size(&(s->sequence), __u.__c, sizeof(s->sequence)); else __read_once_size_nocheck(&(s->sequence), __u.__c, sizeof(s->sequence)); __u.__val; });
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
return ret & ~1;
|
|
}
|
|
# 202 "include/linux/seqlock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __read_seqcount_retry(const seqcount_t *s, unsigned start)
|
|
{
|
|
return __builtin_expect(!!(s->sequence != start), 0);
|
|
}
|
|
# 217 "include/linux/seqlock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int read_seqcount_retry(const seqcount_t *s, unsigned start)
|
|
{
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
return __read_seqcount_retry(s, start);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void raw_write_seqcount_begin(seqcount_t *s)
|
|
{
|
|
s->sequence++;
|
|
__asm__ __volatile__ ("dmb " "ishst" : : : "memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void raw_write_seqcount_end(seqcount_t *s)
|
|
{
|
|
__asm__ __volatile__ ("dmb " "ishst" : : : "memory");
|
|
s->sequence++;
|
|
}
|
|
# 271 "include/linux/seqlock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void raw_write_seqcount_barrier(seqcount_t *s)
|
|
{
|
|
s->sequence++;
|
|
__asm__ __volatile__ ("dmb " "ishst" : : : "memory");
|
|
s->sequence++;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int raw_read_seqcount_latch(seqcount_t *s)
|
|
{
|
|
return ({ typeof(s->sequence) _________p1 = ({ union { typeof(s->sequence) __val; char __c[1]; } __u; if (1) __read_once_size(&(s->sequence), __u.__c, sizeof(s->sequence)); else __read_once_size_nocheck(&(s->sequence), __u.__c, sizeof(s->sequence)); __u.__val; }); do { } while(0); (_________p1); });
|
|
}
|
|
# 360 "include/linux/seqlock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void raw_write_seqcount_latch(seqcount_t *s)
|
|
{
|
|
__asm__ __volatile__ ("dmb " "ishst" : : : "memory");
|
|
s->sequence++;
|
|
__asm__ __volatile__ ("dmb " "ishst" : : : "memory");
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_seqcount_begin_nested(seqcount_t *s, int subclass)
|
|
{
|
|
raw_write_seqcount_begin(s);
|
|
do { } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_seqcount_begin(seqcount_t *s)
|
|
{
|
|
write_seqcount_begin_nested(s, 0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_seqcount_end(seqcount_t *s)
|
|
{
|
|
do { } while (0);
|
|
raw_write_seqcount_end(s);
|
|
}
|
|
# 395 "include/linux/seqlock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_seqcount_invalidate(seqcount_t *s)
|
|
{
|
|
__asm__ __volatile__ ("dmb " "ishst" : : : "memory");
|
|
s->sequence+=2;
|
|
}
|
|
|
|
typedef struct {
|
|
struct seqcount seqcount;
|
|
spinlock_t lock;
|
|
} seqlock_t;
|
|
# 428 "include/linux/seqlock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned read_seqbegin(const seqlock_t *sl)
|
|
{
|
|
return read_seqcount_begin(&sl->seqcount);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned read_seqretry(const seqlock_t *sl, unsigned start)
|
|
{
|
|
return read_seqcount_retry(&sl->seqcount, start);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_seqlock(seqlock_t *sl)
|
|
{
|
|
spin_lock(&sl->lock);
|
|
write_seqcount_begin(&sl->seqcount);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_sequnlock(seqlock_t *sl)
|
|
{
|
|
write_seqcount_end(&sl->seqcount);
|
|
spin_unlock(&sl->lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_seqlock_bh(seqlock_t *sl)
|
|
{
|
|
spin_lock_bh(&sl->lock);
|
|
write_seqcount_begin(&sl->seqcount);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_sequnlock_bh(seqlock_t *sl)
|
|
{
|
|
write_seqcount_end(&sl->seqcount);
|
|
spin_unlock_bh(&sl->lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_seqlock_irq(seqlock_t *sl)
|
|
{
|
|
spin_lock_irq(&sl->lock);
|
|
write_seqcount_begin(&sl->seqcount);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_sequnlock_irq(seqlock_t *sl)
|
|
{
|
|
write_seqcount_end(&sl->seqcount);
|
|
spin_unlock_irq(&sl->lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __write_seqlock_irqsave(seqlock_t *sl)
|
|
{
|
|
unsigned long flags;
|
|
|
|
do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = _raw_spin_lock_irqsave(spinlock_check(&sl->lock)); } while (0); } while (0);
|
|
write_seqcount_begin(&sl->seqcount);
|
|
return flags;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
write_sequnlock_irqrestore(seqlock_t *sl, unsigned long flags)
|
|
{
|
|
write_seqcount_end(&sl->seqcount);
|
|
spin_unlock_irqrestore(&sl->lock, flags);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void read_seqlock_excl(seqlock_t *sl)
|
|
{
|
|
spin_lock(&sl->lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void read_sequnlock_excl(seqlock_t *sl)
|
|
{
|
|
spin_unlock(&sl->lock);
|
|
}
|
|
# 523 "include/linux/seqlock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void read_seqbegin_or_lock(seqlock_t *lock, int *seq)
|
|
{
|
|
if (!(*seq & 1))
|
|
*seq = read_seqbegin(lock);
|
|
else
|
|
read_seqlock_excl(lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int need_seqretry(seqlock_t *lock, int seq)
|
|
{
|
|
return !(seq & 1) && read_seqretry(lock, seq);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void done_seqretry(seqlock_t *lock, int seq)
|
|
{
|
|
if (seq & 1)
|
|
read_sequnlock_excl(lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void read_seqlock_excl_bh(seqlock_t *sl)
|
|
{
|
|
spin_lock_bh(&sl->lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void read_sequnlock_excl_bh(seqlock_t *sl)
|
|
{
|
|
spin_unlock_bh(&sl->lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void read_seqlock_excl_irq(seqlock_t *sl)
|
|
{
|
|
spin_lock_irq(&sl->lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void read_sequnlock_excl_irq(seqlock_t *sl)
|
|
{
|
|
spin_unlock_irq(&sl->lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __read_seqlock_excl_irqsave(seqlock_t *sl)
|
|
{
|
|
unsigned long flags;
|
|
|
|
do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = _raw_spin_lock_irqsave(spinlock_check(&sl->lock)); } while (0); } while (0);
|
|
return flags;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
read_sequnlock_excl_irqrestore(seqlock_t *sl, unsigned long flags)
|
|
{
|
|
spin_unlock_irqrestore(&sl->lock, flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
|
|
read_seqbegin_or_lock_irqsave(seqlock_t *lock, int *seq)
|
|
{
|
|
unsigned long flags = 0;
|
|
|
|
if (!(*seq & 1))
|
|
*seq = read_seqbegin(lock);
|
|
else
|
|
do { flags = __read_seqlock_excl_irqsave(lock); } while (0);
|
|
|
|
return flags;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
done_seqretry_irqrestore(seqlock_t *lock, int seq, unsigned long flags)
|
|
{
|
|
if (seq & 1)
|
|
read_sequnlock_excl_irqrestore(lock, flags);
|
|
}
|
|
# 6 "include/linux/time.h" 2
|
|
# 1 "include/linux/math64.h" 1
|
|
# 64 "include/linux/math64.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder)
|
|
{
|
|
*remainder = ({ unsigned int __r, __b = (divisor); if (!__builtin_constant_p(__b) || __b == 0 || (7 < 4 && (__b & (__b - 1)) != 0)) { __r = ({ register unsigned int __base asm("r4") = __b; register unsigned long long __n asm("r0") = dividend; register unsigned long long __res asm("r2"); register unsigned int __rem asm("r1"); asm( ".ifnc " "%0" "," "r1" "; " ".ifnc " "%0" "r1" ",fpr11; " ".ifnc " "%0" "r1" ",r11fp; " ".ifnc " "%0" "r1" ",ipr12; " ".ifnc " "%0" "r1" ",r12ip; " ".err; " ".endif; " ".endif; " ".endif; " ".endif; " ".endif\n\t" ".ifnc " "%1" "," "r2" "; " ".ifnc " "%1" "r2" ",fpr11; " ".ifnc " "%1" "r2" ",r11fp; " ".ifnc " "%1" "r2" ",ipr12; " ".ifnc " "%1" "r2" ",r12ip; " ".err; " ".endif; " ".endif; " ".endif; " ".endif; " ".endif\n\t" ".ifnc " "%2" "," "r0" "; " ".ifnc " "%2" "r0" ",fpr11; " ".ifnc " "%2" "r0" ",r11fp; " ".ifnc " "%2" "r0" ",ipr12; " ".ifnc " "%2" "r0" ",r12ip; " ".err; " ".endif; " ".endif; " ".endif; " ".endif; " ".endif\n\t" ".ifnc " "%3" "," "r4" "; " ".ifnc " "%3" "r4" ",fpr11; " ".ifnc " "%3" "r4" ",r11fp; " ".ifnc " "%3" "r4" ",ipr12; " ".ifnc " "%3" "r4" ",r12ip; " ".err; " ".endif; " ".endif; " ".endif; " ".endif; " ".endif\n\t" "bl __do_div64" : "=r" (__rem), "=r" (__res) : "r" (__n), "r" (__base) : "ip", "lr", "cc"); dividend = __res; __rem; }); } else if ((__b & (__b - 1)) == 0) { __r = dividend; __r &= (__b - 1); dividend /= __b; } else { unsigned long long __res, __x, __t, __m, __n = dividend; unsigned int __c, __p, __z = 0; __r = __n; __p = 1 << ({ unsigned int __left = (__b), __nr = 0; if (__left & 0xffff0000) __nr += 16, __left >>= 16; if (__left & 0x0000ff00) __nr += 8, __left >>= 8; if (__left & 0x000000f0) __nr += 4, __left >>= 4; if (__left & 0x0000000c) __nr += 2, __left >>= 2; if (__left & 0x00000002) __nr += 1; __nr; }); __m = (~0ULL / __b) * __p; __m += (((~0ULL % __b + 1) * __p) + __b - 1) / __b; __x = ~0ULL / __b * __b - 1; __res = (__m & 0xffffffff) * (__x & 0xffffffff); __res >>= 32; __res += (__m & 0xffffffff) * (__x >> 32); __t = __res; __res += (__x & 0xffffffff) * (__m >> 32); __t = (__res < __t) ? (1ULL << 32) : 0; __res = (__res >> 32) + __t; __res += (__m >> 32) * (__x >> 32); __res /= __p; if (~0ULL % (__b / (__b & -__b)) == 0) { __n /= (__b & -__b); __m = ~0ULL / (__b / (__b & -__b)); __p = 1; __c = 1; } else if (__res != __x / __b) { __c = 1; __m = (~0ULL / __b) * __p; __m += ((~0ULL % __b + 1) * __p) / __b; } else { unsigned int __bits = -(__m & -__m); __bits |= __m >> 32; __bits = (~__bits) << 1; if (!__bits) { __p /= (__m & -__m); __m /= (__m & -__m); } else { __p >>= ({ unsigned int __left = (__bits), __nr = 0; if (__left & 0xffff0000) __nr += 16, __left >>= 16; if (__left & 0x0000ff00) __nr += 8, __left >>= 8; if (__left & 0x000000f0) __nr += 4, __left >>= 4; if (__left & 0x0000000c) __nr += 2, __left >>= 2; if (__left & 0x00000002) __nr += 1; __nr; }); __m >>= ({ unsigned int __left = (__bits), __nr = 0; if (__left & 0xffff0000) __nr += 16, __left >>= 16; if (__left & 0x0000ff00) __nr += 8, __left >>= 8; if (__left & 0x000000f0) __nr += 4, __left >>= 4; if (__left & 0x0000000c) __nr += 2, __left >>= 2; if (__left & 0x00000002) __nr += 1; __nr; }); } __c = 0; } if (!__c) { asm ( "umull %Q0, %R0, %Q1, %Q2\n\t" "mov %Q0, #0" : "=&r" (__res) : "r" (__m), "r" (__n) : "cc" ); } else if (!(__m & ((1ULL << 63) | (1ULL << 31)))) { __res = __m; asm ( "umlal %Q0, %R0, %Q1, %Q2\n\t" "mov %Q0, #0" : "+&r" (__res) : "r" (__m), "r" (__n) : "cc" ); } else { asm ( "umull %Q0, %R0, %Q1, %Q2\n\t" "cmn %Q0, %Q1\n\t" "adcs %R0, %R0, %R1\n\t" "adc %Q0, %3, #0" : "=&r" (__res) : "r" (__m), "r" (__n), "r" (__z) : "cc" ); } if (!(__m & ((1ULL << 63) | (1ULL << 31)))) { asm ( "umlal %R0, %Q0, %R1, %Q2\n\t" "umlal %R0, %Q0, %Q1, %R2\n\t" "mov %R0, #0\n\t" "umlal %Q0, %R0, %R1, %R2" : "+&r" (__res) : "r" (__m), "r" (__n) : "cc" ); } else { asm ( "umlal %R0, %Q0, %R2, %Q3\n\t" "umlal %R0, %1, %Q2, %R3\n\t" "mov %R0, #0\n\t" "adds %Q0, %1, %Q0\n\t" "adc %R0, %R0, #0\n\t" "umlal %Q0, %R0, %R2, %R3" : "+&r" (__res), "+&r" (__z) : "r" (__m), "r" (__n) : "cc" ); } __res /= __p; { unsigned int __res0 = __res; unsigned int __b0 = __b; __r -= __res0 * __b0; } dividend = __res; } __r; });
|
|
return dividend;
|
|
}
|
|
|
|
|
|
|
|
extern s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder);
|
|
|
|
|
|
|
|
extern u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder);
|
|
|
|
|
|
|
|
extern u64 div64_u64(u64 dividend, u64 divisor);
|
|
|
|
|
|
|
|
extern s64 div64_s64(s64 dividend, s64 divisor);
|
|
# 97 "include/linux/math64.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 div_u64(u64 dividend, u32 divisor)
|
|
{
|
|
u32 remainder;
|
|
return div_u64_rem(dividend, divisor, &remainder);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 div_s64(s64 dividend, s32 divisor)
|
|
{
|
|
s32 remainder;
|
|
return div_s64_rem(dividend, divisor, &remainder);
|
|
}
|
|
|
|
|
|
u32 iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) u32
|
|
__iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder)
|
|
{
|
|
u32 ret = 0;
|
|
|
|
while (dividend >= divisor) {
|
|
|
|
|
|
asm("" : "+rm"(dividend));
|
|
|
|
dividend -= divisor;
|
|
ret++;
|
|
}
|
|
|
|
*remainder = dividend;
|
|
|
|
return ret;
|
|
}
|
|
# 155 "include/linux/math64.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 mul_u64_u32_shr(u64 a, u32 mul, unsigned int shift)
|
|
{
|
|
u32 ah, al;
|
|
u64 ret;
|
|
|
|
al = a;
|
|
ah = a >> 32;
|
|
|
|
ret = ((u64)al * mul) >> shift;
|
|
if (ah)
|
|
ret += ((u64)ah * mul) << (32 - shift);
|
|
|
|
return ret;
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 mul_u64_u64_shr(u64 a, u64 b, unsigned int shift)
|
|
{
|
|
union {
|
|
u64 ll;
|
|
struct {
|
|
|
|
|
|
|
|
u32 low, high;
|
|
|
|
} l;
|
|
} rl, rm, rn, rh, a0, b0;
|
|
u64 c;
|
|
|
|
a0.ll = a;
|
|
b0.ll = b;
|
|
|
|
rl.ll = (u64)a0.l.low * b0.l.low;
|
|
rm.ll = (u64)a0.l.low * b0.l.high;
|
|
rn.ll = (u64)a0.l.high * b0.l.low;
|
|
rh.ll = (u64)a0.l.high * b0.l.high;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rl.l.high = c = (u64)rl.l.high + rm.l.low + rn.l.low;
|
|
rh.l.low = c = (c >> 32) + rm.l.high + rn.l.high + rh.l.low;
|
|
rh.l.high = (c >> 32) + rh.l.high;
|
|
|
|
|
|
|
|
|
|
|
|
if (shift == 0)
|
|
return rl.ll;
|
|
if (shift < 64)
|
|
return (rl.ll >> shift) | (rh.ll << (64 - shift));
|
|
return rh.ll >> (shift & 63);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 mul_u64_u32_div(u64 a, u32 mul, u32 divisor)
|
|
{
|
|
union {
|
|
u64 ll;
|
|
struct {
|
|
|
|
|
|
|
|
u32 low, high;
|
|
|
|
} l;
|
|
} u, rl, rh;
|
|
|
|
u.ll = a;
|
|
rl.ll = (u64)u.l.low * mul;
|
|
rh.ll = (u64)u.l.high * mul + rl.l.high;
|
|
|
|
|
|
rl.l.high = ({ unsigned int __r, __b = (divisor); if (!__builtin_constant_p(__b) || __b == 0 || (7 < 4 && (__b & (__b - 1)) != 0)) { __r = ({ register unsigned int __base asm("r4") = __b; register unsigned long long __n asm("r0") = rh.ll; register unsigned long long __res asm("r2"); register unsigned int __rem asm("r1"); asm( ".ifnc " "%0" "," "r1" "; " ".ifnc " "%0" "r1" ",fpr11; " ".ifnc " "%0" "r1" ",r11fp; " ".ifnc " "%0" "r1" ",ipr12; " ".ifnc " "%0" "r1" ",r12ip; " ".err; " ".endif; " ".endif; " ".endif; " ".endif; " ".endif\n\t" ".ifnc " "%1" "," "r2" "; " ".ifnc " "%1" "r2" ",fpr11; " ".ifnc " "%1" "r2" ",r11fp; " ".ifnc " "%1" "r2" ",ipr12; " ".ifnc " "%1" "r2" ",r12ip; " ".err; " ".endif; " ".endif; " ".endif; " ".endif; " ".endif\n\t" ".ifnc " "%2" "," "r0" "; " ".ifnc " "%2" "r0" ",fpr11; " ".ifnc " "%2" "r0" ",r11fp; " ".ifnc " "%2" "r0" ",ipr12; " ".ifnc " "%2" "r0" ",r12ip; " ".err; " ".endif; " ".endif; " ".endif; " ".endif; " ".endif\n\t" ".ifnc " "%3" "," "r4" "; " ".ifnc " "%3" "r4" ",fpr11; " ".ifnc " "%3" "r4" ",r11fp; " ".ifnc " "%3" "r4" ",ipr12; " ".ifnc " "%3" "r4" ",r12ip; " ".err; " ".endif; " ".endif; " ".endif; " ".endif; " ".endif\n\t" "bl __do_div64" : "=r" (__rem), "=r" (__res) : "r" (__n), "r" (__base) : "ip", "lr", "cc"); rh.ll = __res; __rem; }); } else if ((__b & (__b - 1)) == 0) { __r = rh.ll; __r &= (__b - 1); rh.ll /= __b; } else { unsigned long long __res, __x, __t, __m, __n = rh.ll; unsigned int __c, __p, __z = 0; __r = __n; __p = 1 << ({ unsigned int __left = (__b), __nr = 0; if (__left & 0xffff0000) __nr += 16, __left >>= 16; if (__left & 0x0000ff00) __nr += 8, __left >>= 8; if (__left & 0x000000f0) __nr += 4, __left >>= 4; if (__left & 0x0000000c) __nr += 2, __left >>= 2; if (__left & 0x00000002) __nr += 1; __nr; }); __m = (~0ULL / __b) * __p; __m += (((~0ULL % __b + 1) * __p) + __b - 1) / __b; __x = ~0ULL / __b * __b - 1; __res = (__m & 0xffffffff) * (__x & 0xffffffff); __res >>= 32; __res += (__m & 0xffffffff) * (__x >> 32); __t = __res; __res += (__x & 0xffffffff) * (__m >> 32); __t = (__res < __t) ? (1ULL << 32) : 0; __res = (__res >> 32) + __t; __res += (__m >> 32) * (__x >> 32); __res /= __p; if (~0ULL % (__b / (__b & -__b)) == 0) { __n /= (__b & -__b); __m = ~0ULL / (__b / (__b & -__b)); __p = 1; __c = 1; } else if (__res != __x / __b) { __c = 1; __m = (~0ULL / __b) * __p; __m += ((~0ULL % __b + 1) * __p) / __b; } else { unsigned int __bits = -(__m & -__m); __bits |= __m >> 32; __bits = (~__bits) << 1; if (!__bits) { __p /= (__m & -__m); __m /= (__m & -__m); } else { __p >>= ({ unsigned int __left = (__bits), __nr = 0; if (__left & 0xffff0000) __nr += 16, __left >>= 16; if (__left & 0x0000ff00) __nr += 8, __left >>= 8; if (__left & 0x000000f0) __nr += 4, __left >>= 4; if (__left & 0x0000000c) __nr += 2, __left >>= 2; if (__left & 0x00000002) __nr += 1; __nr; }); __m >>= ({ unsigned int __left = (__bits), __nr = 0; if (__left & 0xffff0000) __nr += 16, __left >>= 16; if (__left & 0x0000ff00) __nr += 8, __left >>= 8; if (__left & 0x000000f0) __nr += 4, __left >>= 4; if (__left & 0x0000000c) __nr += 2, __left >>= 2; if (__left & 0x00000002) __nr += 1; __nr; }); } __c = 0; } if (!__c) { asm ( "umull %Q0, %R0, %Q1, %Q2\n\t" "mov %Q0, #0" : "=&r" (__res) : "r" (__m), "r" (__n) : "cc" ); } else if (!(__m & ((1ULL << 63) | (1ULL << 31)))) { __res = __m; asm ( "umlal %Q0, %R0, %Q1, %Q2\n\t" "mov %Q0, #0" : "+&r" (__res) : "r" (__m), "r" (__n) : "cc" ); } else { asm ( "umull %Q0, %R0, %Q1, %Q2\n\t" "cmn %Q0, %Q1\n\t" "adcs %R0, %R0, %R1\n\t" "adc %Q0, %3, #0" : "=&r" (__res) : "r" (__m), "r" (__n), "r" (__z) : "cc" ); } if (!(__m & ((1ULL << 63) | (1ULL << 31)))) { asm ( "umlal %R0, %Q0, %R1, %Q2\n\t" "umlal %R0, %Q0, %Q1, %R2\n\t" "mov %R0, #0\n\t" "umlal %Q0, %R0, %R1, %R2" : "+&r" (__res) : "r" (__m), "r" (__n) : "cc" ); } else { asm ( "umlal %R0, %Q0, %R2, %Q3\n\t" "umlal %R0, %1, %Q2, %R3\n\t" "mov %R0, #0\n\t" "adds %Q0, %1, %Q0\n\t" "adc %R0, %R0, #0\n\t" "umlal %Q0, %R0, %R2, %R3" : "+&r" (__res), "+&r" (__z) : "r" (__m), "r" (__n) : "cc" ); } __res /= __p; { unsigned int __res0 = __res; unsigned int __b0 = __b; __r -= __res0 * __b0; } rh.ll = __res; } __r; });
|
|
|
|
|
|
({ unsigned int __r, __b = (divisor); if (!__builtin_constant_p(__b) || __b == 0 || (7 < 4 && (__b & (__b - 1)) != 0)) { __r = ({ register unsigned int __base asm("r4") = __b; register unsigned long long __n asm("r0") = rl.ll; register unsigned long long __res asm("r2"); register unsigned int __rem asm("r1"); asm( ".ifnc " "%0" "," "r1" "; " ".ifnc " "%0" "r1" ",fpr11; " ".ifnc " "%0" "r1" ",r11fp; " ".ifnc " "%0" "r1" ",ipr12; " ".ifnc " "%0" "r1" ",r12ip; " ".err; " ".endif; " ".endif; " ".endif; " ".endif; " ".endif\n\t" ".ifnc " "%1" "," "r2" "; " ".ifnc " "%1" "r2" ",fpr11; " ".ifnc " "%1" "r2" ",r11fp; " ".ifnc " "%1" "r2" ",ipr12; " ".ifnc " "%1" "r2" ",r12ip; " ".err; " ".endif; " ".endif; " ".endif; " ".endif; " ".endif\n\t" ".ifnc " "%2" "," "r0" "; " ".ifnc " "%2" "r0" ",fpr11; " ".ifnc " "%2" "r0" ",r11fp; " ".ifnc " "%2" "r0" ",ipr12; " ".ifnc " "%2" "r0" ",r12ip; " ".err; " ".endif; " ".endif; " ".endif; " ".endif; " ".endif\n\t" ".ifnc " "%3" "," "r4" "; " ".ifnc " "%3" "r4" ",fpr11; " ".ifnc " "%3" "r4" ",r11fp; " ".ifnc " "%3" "r4" ",ipr12; " ".ifnc " "%3" "r4" ",r12ip; " ".err; " ".endif; " ".endif; " ".endif; " ".endif; " ".endif\n\t" "bl __do_div64" : "=r" (__rem), "=r" (__res) : "r" (__n), "r" (__base) : "ip", "lr", "cc"); rl.ll = __res; __rem; }); } else if ((__b & (__b - 1)) == 0) { __r = rl.ll; __r &= (__b - 1); rl.ll /= __b; } else { unsigned long long __res, __x, __t, __m, __n = rl.ll; unsigned int __c, __p, __z = 0; __r = __n; __p = 1 << ({ unsigned int __left = (__b), __nr = 0; if (__left & 0xffff0000) __nr += 16, __left >>= 16; if (__left & 0x0000ff00) __nr += 8, __left >>= 8; if (__left & 0x000000f0) __nr += 4, __left >>= 4; if (__left & 0x0000000c) __nr += 2, __left >>= 2; if (__left & 0x00000002) __nr += 1; __nr; }); __m = (~0ULL / __b) * __p; __m += (((~0ULL % __b + 1) * __p) + __b - 1) / __b; __x = ~0ULL / __b * __b - 1; __res = (__m & 0xffffffff) * (__x & 0xffffffff); __res >>= 32; __res += (__m & 0xffffffff) * (__x >> 32); __t = __res; __res += (__x & 0xffffffff) * (__m >> 32); __t = (__res < __t) ? (1ULL << 32) : 0; __res = (__res >> 32) + __t; __res += (__m >> 32) * (__x >> 32); __res /= __p; if (~0ULL % (__b / (__b & -__b)) == 0) { __n /= (__b & -__b); __m = ~0ULL / (__b / (__b & -__b)); __p = 1; __c = 1; } else if (__res != __x / __b) { __c = 1; __m = (~0ULL / __b) * __p; __m += ((~0ULL % __b + 1) * __p) / __b; } else { unsigned int __bits = -(__m & -__m); __bits |= __m >> 32; __bits = (~__bits) << 1; if (!__bits) { __p /= (__m & -__m); __m /= (__m & -__m); } else { __p >>= ({ unsigned int __left = (__bits), __nr = 0; if (__left & 0xffff0000) __nr += 16, __left >>= 16; if (__left & 0x0000ff00) __nr += 8, __left >>= 8; if (__left & 0x000000f0) __nr += 4, __left >>= 4; if (__left & 0x0000000c) __nr += 2, __left >>= 2; if (__left & 0x00000002) __nr += 1; __nr; }); __m >>= ({ unsigned int __left = (__bits), __nr = 0; if (__left & 0xffff0000) __nr += 16, __left >>= 16; if (__left & 0x0000ff00) __nr += 8, __left >>= 8; if (__left & 0x000000f0) __nr += 4, __left >>= 4; if (__left & 0x0000000c) __nr += 2, __left >>= 2; if (__left & 0x00000002) __nr += 1; __nr; }); } __c = 0; } if (!__c) { asm ( "umull %Q0, %R0, %Q1, %Q2\n\t" "mov %Q0, #0" : "=&r" (__res) : "r" (__m), "r" (__n) : "cc" ); } else if (!(__m & ((1ULL << 63) | (1ULL << 31)))) { __res = __m; asm ( "umlal %Q0, %R0, %Q1, %Q2\n\t" "mov %Q0, #0" : "+&r" (__res) : "r" (__m), "r" (__n) : "cc" ); } else { asm ( "umull %Q0, %R0, %Q1, %Q2\n\t" "cmn %Q0, %Q1\n\t" "adcs %R0, %R0, %R1\n\t" "adc %Q0, %3, #0" : "=&r" (__res) : "r" (__m), "r" (__n), "r" (__z) : "cc" ); } if (!(__m & ((1ULL << 63) | (1ULL << 31)))) { asm ( "umlal %R0, %Q0, %R1, %Q2\n\t" "umlal %R0, %Q0, %Q1, %R2\n\t" "mov %R0, #0\n\t" "umlal %Q0, %R0, %R1, %R2" : "+&r" (__res) : "r" (__m), "r" (__n) : "cc" ); } else { asm ( "umlal %R0, %Q0, %R2, %Q3\n\t" "umlal %R0, %1, %Q2, %R3\n\t" "mov %R0, #0\n\t" "adds %Q0, %1, %Q0\n\t" "adc %R0, %R0, #0\n\t" "umlal %Q0, %R0, %R2, %R3" : "+&r" (__res), "+&r" (__z) : "r" (__m), "r" (__n) : "cc" ); } __res /= __p; { unsigned int __res0 = __res; unsigned int __b0 = __b; __r -= __res0 * __b0; } rl.ll = __res; } __r; });
|
|
|
|
rl.l.high = rh.l.low;
|
|
return rl.ll;
|
|
}
|
|
# 7 "include/linux/time.h" 2
|
|
# 1 "include/linux/time64.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/time.h" 1
|
|
# 9 "include/uapi/linux/time.h"
|
|
struct timespec {
|
|
__kernel_time_t tv_sec;
|
|
long tv_nsec;
|
|
};
|
|
|
|
|
|
struct timeval {
|
|
__kernel_time_t tv_sec;
|
|
__kernel_suseconds_t tv_usec;
|
|
};
|
|
|
|
struct timezone {
|
|
int tz_minuteswest;
|
|
int tz_dsttime;
|
|
};
|
|
# 34 "include/uapi/linux/time.h"
|
|
struct itimerspec {
|
|
struct timespec it_interval;
|
|
struct timespec it_value;
|
|
};
|
|
|
|
struct itimerval {
|
|
struct timeval it_interval;
|
|
struct timeval it_value;
|
|
};
|
|
# 5 "include/linux/time64.h" 2
|
|
|
|
|
|
typedef __s64 time64_t;
|
|
# 17 "include/linux/time64.h"
|
|
struct timespec64 {
|
|
time64_t tv_sec;
|
|
long tv_nsec;
|
|
};
|
|
|
|
struct itimerspec64 {
|
|
struct timespec64 it_interval;
|
|
struct timespec64 it_value;
|
|
};
|
|
# 79 "include/linux/time64.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct timespec timespec64_to_timespec(const struct timespec64 ts64)
|
|
{
|
|
struct timespec ret;
|
|
|
|
ret.tv_sec = (time_t)ts64.tv_sec;
|
|
ret.tv_nsec = ts64.tv_nsec;
|
|
return ret;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct timespec64 timespec_to_timespec64(const struct timespec ts)
|
|
{
|
|
struct timespec64 ret;
|
|
|
|
ret.tv_sec = ts.tv_sec;
|
|
ret.tv_nsec = ts.tv_nsec;
|
|
return ret;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct itimerspec itimerspec64_to_itimerspec(struct itimerspec64 *its64)
|
|
{
|
|
struct itimerspec ret;
|
|
|
|
ret.it_interval = timespec64_to_timespec(its64->it_interval);
|
|
ret.it_value = timespec64_to_timespec(its64->it_value);
|
|
return ret;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct itimerspec64 itimerspec_to_itimerspec64(struct itimerspec *its)
|
|
{
|
|
struct itimerspec64 ret;
|
|
|
|
ret.it_interval = timespec_to_timespec64(its->it_interval);
|
|
ret.it_value = timespec_to_timespec64(its->it_value);
|
|
return ret;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int timespec64_equal(const struct timespec64 *a,
|
|
const struct timespec64 *b)
|
|
{
|
|
return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int timespec64_compare(const struct timespec64 *lhs, const struct timespec64 *rhs)
|
|
{
|
|
if (lhs->tv_sec < rhs->tv_sec)
|
|
return -1;
|
|
if (lhs->tv_sec > rhs->tv_sec)
|
|
return 1;
|
|
return lhs->tv_nsec - rhs->tv_nsec;
|
|
}
|
|
|
|
extern void set_normalized_timespec64(struct timespec64 *ts, time64_t sec, s64 nsec);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern struct timespec64 timespec64_add_safe(const struct timespec64 lhs,
|
|
const struct timespec64 rhs);
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct timespec64 timespec64_add(struct timespec64 lhs,
|
|
struct timespec64 rhs)
|
|
{
|
|
struct timespec64 ts_delta;
|
|
set_normalized_timespec64(&ts_delta, lhs.tv_sec + rhs.tv_sec,
|
|
lhs.tv_nsec + rhs.tv_nsec);
|
|
return ts_delta;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct timespec64 timespec64_sub(struct timespec64 lhs,
|
|
struct timespec64 rhs)
|
|
{
|
|
struct timespec64 ts_delta;
|
|
set_normalized_timespec64(&ts_delta, lhs.tv_sec - rhs.tv_sec,
|
|
lhs.tv_nsec - rhs.tv_nsec);
|
|
return ts_delta;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool timespec64_valid(const struct timespec64 *ts)
|
|
{
|
|
|
|
if (ts->tv_sec < 0)
|
|
return false;
|
|
|
|
if ((unsigned long)ts->tv_nsec >= 1000000000L)
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool timespec64_valid_strict(const struct timespec64 *ts)
|
|
{
|
|
if (!timespec64_valid(ts))
|
|
return false;
|
|
|
|
if ((unsigned long long)ts->tv_sec >= (((s64)~((u64)1 << 63)) / 1000000000L))
|
|
return false;
|
|
return true;
|
|
}
|
|
# 198 "include/linux/time64.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 timespec64_to_ns(const struct timespec64 *ts)
|
|
{
|
|
return ((s64) ts->tv_sec * 1000000000L) + ts->tv_nsec;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern struct timespec64 ns_to_timespec64(const s64 nsec);
|
|
# 219 "include/linux/time64.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void timespec64_add_ns(struct timespec64 *a, u64 ns)
|
|
{
|
|
a->tv_sec += __iter_div_u64_rem(a->tv_nsec + ns, 1000000000L, &ns);
|
|
a->tv_nsec = ns;
|
|
}
|
|
# 8 "include/linux/time.h" 2
|
|
|
|
extern struct timezone sys_tz;
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int timespec_equal(const struct timespec *a,
|
|
const struct timespec *b)
|
|
{
|
|
return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int timespec_compare(const struct timespec *lhs, const struct timespec *rhs)
|
|
{
|
|
if (lhs->tv_sec < rhs->tv_sec)
|
|
return -1;
|
|
if (lhs->tv_sec > rhs->tv_sec)
|
|
return 1;
|
|
return lhs->tv_nsec - rhs->tv_nsec;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int timeval_compare(const struct timeval *lhs, const struct timeval *rhs)
|
|
{
|
|
if (lhs->tv_sec < rhs->tv_sec)
|
|
return -1;
|
|
if (lhs->tv_sec > rhs->tv_sec)
|
|
return 1;
|
|
return lhs->tv_usec - rhs->tv_usec;
|
|
}
|
|
|
|
extern time64_t mktime64(const unsigned int year, const unsigned int mon,
|
|
const unsigned int day, const unsigned int hour,
|
|
const unsigned int min, const unsigned int sec);
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long mktime(const unsigned int year,
|
|
const unsigned int mon, const unsigned int day,
|
|
const unsigned int hour, const unsigned int min,
|
|
const unsigned int sec)
|
|
{
|
|
return mktime64(year, mon, day, hour, min, sec);
|
|
}
|
|
|
|
extern void set_normalized_timespec(struct timespec *ts, time_t sec, s64 nsec);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern struct timespec timespec_add_safe(const struct timespec lhs,
|
|
const struct timespec rhs);
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct timespec timespec_add(struct timespec lhs,
|
|
struct timespec rhs)
|
|
{
|
|
struct timespec ts_delta;
|
|
set_normalized_timespec(&ts_delta, lhs.tv_sec + rhs.tv_sec,
|
|
lhs.tv_nsec + rhs.tv_nsec);
|
|
return ts_delta;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct timespec timespec_sub(struct timespec lhs,
|
|
struct timespec rhs)
|
|
{
|
|
struct timespec ts_delta;
|
|
set_normalized_timespec(&ts_delta, lhs.tv_sec - rhs.tv_sec,
|
|
lhs.tv_nsec - rhs.tv_nsec);
|
|
return ts_delta;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool timespec_valid(const struct timespec *ts)
|
|
{
|
|
|
|
if (ts->tv_sec < 0)
|
|
return false;
|
|
|
|
if ((unsigned long)ts->tv_nsec >= 1000000000L)
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool timespec_valid_strict(const struct timespec *ts)
|
|
{
|
|
if (!timespec_valid(ts))
|
|
return false;
|
|
|
|
if ((unsigned long long)ts->tv_sec >= (((s64)~((u64)1 << 63)) / 1000000000L))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool timeval_valid(const struct timeval *tv)
|
|
{
|
|
|
|
if (tv->tv_sec < 0)
|
|
return false;
|
|
|
|
|
|
if (tv->tv_usec < 0 || tv->tv_usec >= 1000000L)
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
|
|
extern struct timespec timespec_trunc(struct timespec t, unsigned gran);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool timeval_inject_offset_valid(const struct timeval *tv)
|
|
{
|
|
|
|
|
|
|
|
if (tv->tv_usec < 0 || tv->tv_usec >= 1000000L)
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool timespec_inject_offset_valid(const struct timespec *ts)
|
|
{
|
|
|
|
|
|
|
|
if (ts->tv_nsec < 0 || ts->tv_nsec >= 1000000000L)
|
|
return false;
|
|
return true;
|
|
}
|
|
# 170 "include/linux/time.h"
|
|
struct itimerval;
|
|
extern int do_setitimer(int which, struct itimerval *value,
|
|
struct itimerval *ovalue);
|
|
extern int do_getitimer(int which, struct itimerval *value);
|
|
|
|
extern unsigned int alarm_setitimer(unsigned int seconds);
|
|
|
|
extern long do_utimes(int dfd, const char *filename, struct timespec *times, int flags);
|
|
|
|
struct tms;
|
|
extern void do_sys_times(struct tms *);
|
|
|
|
|
|
|
|
|
|
|
|
struct tm {
|
|
|
|
|
|
|
|
|
|
int tm_sec;
|
|
|
|
int tm_min;
|
|
|
|
int tm_hour;
|
|
|
|
int tm_mday;
|
|
|
|
int tm_mon;
|
|
|
|
long tm_year;
|
|
|
|
int tm_wday;
|
|
|
|
int tm_yday;
|
|
};
|
|
|
|
void time_to_tm(time_t totalsecs, int offset, struct tm *result);
|
|
# 217 "include/linux/time.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 timespec_to_ns(const struct timespec *ts)
|
|
{
|
|
return ((s64) ts->tv_sec * 1000000000L) + ts->tv_nsec;
|
|
}
|
|
# 229 "include/linux/time.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 timeval_to_ns(const struct timeval *tv)
|
|
{
|
|
return ((s64) tv->tv_sec * 1000000000L) +
|
|
tv->tv_usec * 1000L;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern struct timespec ns_to_timespec(const s64 nsec);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern struct timeval ns_to_timeval(const s64 nsec);
|
|
# 259 "include/linux/time.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void timespec_add_ns(struct timespec *a, u64 ns)
|
|
{
|
|
a->tv_sec += __iter_div_u64_rem(a->tv_nsec + ns, 1000000000L, &ns);
|
|
a->tv_nsec = ns;
|
|
}
|
|
# 19 "include/linux/stat.h" 2
|
|
# 1 "include/linux/uidgid.h" 1
|
|
# 15 "include/linux/uidgid.h"
|
|
# 1 "include/linux/highuid.h" 1
|
|
# 34 "include/linux/highuid.h"
|
|
extern int overflowuid;
|
|
extern int overflowgid;
|
|
|
|
extern void __bad_uid(void);
|
|
extern void __bad_gid(void);
|
|
# 81 "include/linux/highuid.h"
|
|
extern int fs_overflowuid;
|
|
extern int fs_overflowgid;
|
|
# 16 "include/linux/uidgid.h" 2
|
|
|
|
struct user_namespace;
|
|
extern struct user_namespace init_user_ns;
|
|
|
|
typedef struct {
|
|
uid_t val;
|
|
} kuid_t;
|
|
|
|
|
|
typedef struct {
|
|
gid_t val;
|
|
} kgid_t;
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) uid_t __kuid_val(kuid_t uid)
|
|
{
|
|
return uid.val;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) gid_t __kgid_val(kgid_t gid)
|
|
{
|
|
return gid.val;
|
|
}
|
|
# 60 "include/linux/uidgid.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool uid_eq(kuid_t left, kuid_t right)
|
|
{
|
|
return __kuid_val(left) == __kuid_val(right);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool gid_eq(kgid_t left, kgid_t right)
|
|
{
|
|
return __kgid_val(left) == __kgid_val(right);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool uid_gt(kuid_t left, kuid_t right)
|
|
{
|
|
return __kuid_val(left) > __kuid_val(right);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool gid_gt(kgid_t left, kgid_t right)
|
|
{
|
|
return __kgid_val(left) > __kgid_val(right);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool uid_gte(kuid_t left, kuid_t right)
|
|
{
|
|
return __kuid_val(left) >= __kuid_val(right);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool gid_gte(kgid_t left, kgid_t right)
|
|
{
|
|
return __kgid_val(left) >= __kgid_val(right);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool uid_lt(kuid_t left, kuid_t right)
|
|
{
|
|
return __kuid_val(left) < __kuid_val(right);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool gid_lt(kgid_t left, kgid_t right)
|
|
{
|
|
return __kgid_val(left) < __kgid_val(right);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool uid_lte(kuid_t left, kuid_t right)
|
|
{
|
|
return __kuid_val(left) <= __kuid_val(right);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool gid_lte(kgid_t left, kgid_t right)
|
|
{
|
|
return __kgid_val(left) <= __kgid_val(right);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool uid_valid(kuid_t uid)
|
|
{
|
|
return __kuid_val(uid) != (uid_t) -1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool gid_valid(kgid_t gid)
|
|
{
|
|
return __kgid_val(gid) != (gid_t) -1;
|
|
}
|
|
|
|
|
|
|
|
extern kuid_t make_kuid(struct user_namespace *from, uid_t uid);
|
|
extern kgid_t make_kgid(struct user_namespace *from, gid_t gid);
|
|
|
|
extern uid_t from_kuid(struct user_namespace *to, kuid_t uid);
|
|
extern gid_t from_kgid(struct user_namespace *to, kgid_t gid);
|
|
extern uid_t from_kuid_munged(struct user_namespace *to, kuid_t uid);
|
|
extern gid_t from_kgid_munged(struct user_namespace *to, kgid_t gid);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool kuid_has_mapping(struct user_namespace *ns, kuid_t uid)
|
|
{
|
|
return from_kuid(ns, uid) != (uid_t) -1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool kgid_has_mapping(struct user_namespace *ns, kgid_t gid)
|
|
{
|
|
return from_kgid(ns, gid) != (gid_t) -1;
|
|
}
|
|
# 20 "include/linux/stat.h" 2
|
|
|
|
struct kstat {
|
|
u64 ino;
|
|
dev_t dev;
|
|
umode_t mode;
|
|
unsigned int nlink;
|
|
kuid_t uid;
|
|
kgid_t gid;
|
|
dev_t rdev;
|
|
loff_t size;
|
|
struct timespec atime;
|
|
struct timespec mtime;
|
|
struct timespec ctime;
|
|
unsigned long blksize;
|
|
unsigned long long blocks;
|
|
};
|
|
# 11 "include/linux/module.h" 2
|
|
|
|
|
|
# 1 "include/linux/kmod.h" 1
|
|
# 22 "include/linux/kmod.h"
|
|
# 1 "include/linux/gfp.h" 1
|
|
|
|
|
|
|
|
# 1 "include/linux/mmdebug.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct page;
|
|
struct vm_area_struct;
|
|
struct mm_struct;
|
|
|
|
extern void dump_page(struct page *page, const char *reason);
|
|
extern void dump_page_badflags(struct page *page, const char *reason,
|
|
unsigned long badflags);
|
|
void dump_vma(const struct vm_area_struct *vma);
|
|
void dump_mm(const struct mm_struct *mm);
|
|
# 5 "include/linux/gfp.h" 2
|
|
# 1 "include/linux/mmzone.h" 1
|
|
# 9 "include/linux/mmzone.h"
|
|
# 1 "include/linux/wait.h" 1
|
|
# 9 "include/linux/wait.h"
|
|
# 1 "arch/arm/include/generated/asm/current.h" 1
|
|
# 1 "include/asm-generic/current.h" 1
|
|
# 1 "arch/arm/include/generated/asm/current.h" 2
|
|
# 10 "include/linux/wait.h" 2
|
|
# 1 "include/uapi/linux/wait.h" 1
|
|
# 11 "include/linux/wait.h" 2
|
|
|
|
typedef struct __wait_queue wait_queue_t;
|
|
typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int flags, void *key);
|
|
int default_wake_function(wait_queue_t *wait, unsigned mode, int flags, void *key);
|
|
|
|
|
|
|
|
|
|
|
|
struct __wait_queue {
|
|
unsigned int flags;
|
|
void *private;
|
|
wait_queue_func_t func;
|
|
struct list_head task_list;
|
|
};
|
|
|
|
struct wait_bit_key {
|
|
void *flags;
|
|
int bit_nr;
|
|
|
|
unsigned long timeout;
|
|
};
|
|
|
|
struct wait_bit_queue {
|
|
struct wait_bit_key key;
|
|
wait_queue_t wait;
|
|
};
|
|
|
|
struct __wait_queue_head {
|
|
spinlock_t lock;
|
|
struct list_head task_list;
|
|
};
|
|
typedef struct __wait_queue_head wait_queue_head_t;
|
|
|
|
struct task_struct;
|
|
# 72 "include/linux/wait.h"
|
|
extern void __init_waitqueue_head(wait_queue_head_t *q, const char *name, struct lock_class_key *);
|
|
# 90 "include/linux/wait.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p)
|
|
{
|
|
q->flags = 0;
|
|
q->private = p;
|
|
q->func = default_wake_function;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
init_waitqueue_func_entry(wait_queue_t *q, wait_queue_func_t func)
|
|
{
|
|
q->flags = 0;
|
|
q->private = ((void *)0);
|
|
q->func = func;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int waitqueue_active(wait_queue_head_t *q)
|
|
{
|
|
return !list_empty(&q->task_list);
|
|
}
|
|
|
|
extern void add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait);
|
|
extern void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait);
|
|
extern void remove_wait_queue(wait_queue_head_t *q, wait_queue_t *wait);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new)
|
|
{
|
|
list_add(&new->task_list, &head->task_list);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
__add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait)
|
|
{
|
|
wait->flags |= 0x01;
|
|
__add_wait_queue(q, wait);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __add_wait_queue_tail(wait_queue_head_t *head,
|
|
wait_queue_t *new)
|
|
{
|
|
list_add_tail(&new->task_list, &head->task_list);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
__add_wait_queue_tail_exclusive(wait_queue_head_t *q, wait_queue_t *wait)
|
|
{
|
|
wait->flags |= 0x01;
|
|
__add_wait_queue_tail(q, wait);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
__remove_wait_queue(wait_queue_head_t *head, wait_queue_t *old)
|
|
{
|
|
list_del(&old->task_list);
|
|
}
|
|
|
|
typedef int wait_bit_action_f(struct wait_bit_key *, int mode);
|
|
void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key);
|
|
void __wake_up_locked_key(wait_queue_head_t *q, unsigned int mode, void *key);
|
|
void __wake_up_sync_key(wait_queue_head_t *q, unsigned int mode, int nr, void *key);
|
|
void __wake_up_locked(wait_queue_head_t *q, unsigned int mode, int nr);
|
|
void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr);
|
|
void __wake_up_bit(wait_queue_head_t *, void *, int);
|
|
int __wait_on_bit(wait_queue_head_t *, struct wait_bit_queue *, wait_bit_action_f *, unsigned);
|
|
int __wait_on_bit_lock(wait_queue_head_t *, struct wait_bit_queue *, wait_bit_action_f *, unsigned);
|
|
void wake_up_bit(void *, int);
|
|
void wake_up_atomic_t(atomic_t *);
|
|
int out_of_line_wait_on_bit(void *, int, wait_bit_action_f *, unsigned);
|
|
int out_of_line_wait_on_bit_timeout(void *, int, wait_bit_action_f *, unsigned, unsigned long);
|
|
int out_of_line_wait_on_bit_lock(void *, int, wait_bit_action_f *, unsigned);
|
|
int out_of_line_wait_on_atomic_t(atomic_t *, int (*)(atomic_t *), unsigned);
|
|
wait_queue_head_t *bit_waitqueue(void *, int);
|
|
# 924 "include/linux/wait.h"
|
|
void prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state);
|
|
void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state);
|
|
long prepare_to_wait_event(wait_queue_head_t *q, wait_queue_t *wait, int state);
|
|
void finish_wait(wait_queue_head_t *q, wait_queue_t *wait);
|
|
void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait, unsigned int mode, void *key);
|
|
long wait_woken(wait_queue_t *wait, unsigned mode, long timeout);
|
|
int woken_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
|
|
int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
|
|
int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
|
|
# 963 "include/linux/wait.h"
|
|
extern int bit_wait(struct wait_bit_key *, int);
|
|
extern int bit_wait_io(struct wait_bit_key *, int);
|
|
extern int bit_wait_timeout(struct wait_bit_key *, int);
|
|
extern int bit_wait_io_timeout(struct wait_bit_key *, int);
|
|
# 984 "include/linux/wait.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
wait_on_bit(unsigned long *word, int bit, unsigned mode)
|
|
{
|
|
do { do { } while (0); } while (0);
|
|
if (!test_bit(bit, word))
|
|
return 0;
|
|
return out_of_line_wait_on_bit(word, bit,
|
|
bit_wait,
|
|
mode);
|
|
}
|
|
# 1009 "include/linux/wait.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
wait_on_bit_io(unsigned long *word, int bit, unsigned mode)
|
|
{
|
|
do { do { } while (0); } while (0);
|
|
if (!test_bit(bit, word))
|
|
return 0;
|
|
return out_of_line_wait_on_bit(word, bit,
|
|
bit_wait_io,
|
|
mode);
|
|
}
|
|
# 1035 "include/linux/wait.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
wait_on_bit_timeout(unsigned long *word, int bit, unsigned mode,
|
|
unsigned long timeout)
|
|
{
|
|
do { do { } while (0); } while (0);
|
|
if (!test_bit(bit, word))
|
|
return 0;
|
|
return out_of_line_wait_on_bit_timeout(word, bit,
|
|
bit_wait_timeout,
|
|
mode, timeout);
|
|
}
|
|
# 1063 "include/linux/wait.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
wait_on_bit_action(unsigned long *word, int bit, wait_bit_action_f *action,
|
|
unsigned mode)
|
|
{
|
|
do { do { } while (0); } while (0);
|
|
if (!test_bit(bit, word))
|
|
return 0;
|
|
return out_of_line_wait_on_bit(word, bit, action, mode);
|
|
}
|
|
# 1092 "include/linux/wait.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
wait_on_bit_lock(unsigned long *word, int bit, unsigned mode)
|
|
{
|
|
do { do { } while (0); } while (0);
|
|
if (!_test_and_set_bit(bit,word))
|
|
return 0;
|
|
return out_of_line_wait_on_bit_lock(word, bit, bit_wait, mode);
|
|
}
|
|
# 1116 "include/linux/wait.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
wait_on_bit_lock_io(unsigned long *word, int bit, unsigned mode)
|
|
{
|
|
do { do { } while (0); } while (0);
|
|
if (!_test_and_set_bit(bit,word))
|
|
return 0;
|
|
return out_of_line_wait_on_bit_lock(word, bit, bit_wait_io, mode);
|
|
}
|
|
# 1142 "include/linux/wait.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
wait_on_bit_lock_action(unsigned long *word, int bit, wait_bit_action_f *action,
|
|
unsigned mode)
|
|
{
|
|
do { do { } while (0); } while (0);
|
|
if (!_test_and_set_bit(bit,word))
|
|
return 0;
|
|
return out_of_line_wait_on_bit_lock(word, bit, action, mode);
|
|
}
|
|
# 1162 "include/linux/wait.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
int wait_on_atomic_t(atomic_t *val, int (*action)(atomic_t *), unsigned mode)
|
|
{
|
|
do { do { } while (0); } while (0);
|
|
if (({ union { typeof((val)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((val)->counter), __u.__c, sizeof((val)->counter)); else __read_once_size_nocheck(&((val)->counter), __u.__c, sizeof((val)->counter)); __u.__val; }) == 0)
|
|
return 0;
|
|
return out_of_line_wait_on_atomic_t(val, action, mode);
|
|
}
|
|
# 10 "include/linux/mmzone.h" 2
|
|
|
|
|
|
# 1 "include/linux/threads.h" 1
|
|
# 13 "include/linux/mmzone.h" 2
|
|
# 1 "include/linux/numa.h" 1
|
|
# 14 "include/linux/mmzone.h" 2
|
|
|
|
|
|
# 1 "include/linux/nodemask.h" 1
|
|
# 92 "include/linux/nodemask.h"
|
|
# 1 "include/linux/bitmap.h" 1
|
|
# 90 "include/linux/bitmap.h"
|
|
extern int __bitmap_empty(const unsigned long *bitmap, unsigned int nbits);
|
|
extern int __bitmap_full(const unsigned long *bitmap, unsigned int nbits);
|
|
extern int __bitmap_equal(const unsigned long *bitmap1,
|
|
const unsigned long *bitmap2, unsigned int nbits);
|
|
extern void __bitmap_complement(unsigned long *dst, const unsigned long *src,
|
|
unsigned int nbits);
|
|
extern void __bitmap_shift_right(unsigned long *dst, const unsigned long *src,
|
|
unsigned int shift, unsigned int nbits);
|
|
extern void __bitmap_shift_left(unsigned long *dst, const unsigned long *src,
|
|
unsigned int shift, unsigned int nbits);
|
|
extern int __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
|
|
const unsigned long *bitmap2, unsigned int nbits);
|
|
extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
|
|
const unsigned long *bitmap2, unsigned int nbits);
|
|
extern void __bitmap_xor(unsigned long *dst, const unsigned long *bitmap1,
|
|
const unsigned long *bitmap2, unsigned int nbits);
|
|
extern int __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1,
|
|
const unsigned long *bitmap2, unsigned int nbits);
|
|
extern int __bitmap_intersects(const unsigned long *bitmap1,
|
|
const unsigned long *bitmap2, unsigned int nbits);
|
|
extern int __bitmap_subset(const unsigned long *bitmap1,
|
|
const unsigned long *bitmap2, unsigned int nbits);
|
|
extern int __bitmap_weight(const unsigned long *bitmap, unsigned int nbits);
|
|
|
|
extern void bitmap_set(unsigned long *map, unsigned int start, int len);
|
|
extern void bitmap_clear(unsigned long *map, unsigned int start, int len);
|
|
|
|
extern unsigned long bitmap_find_next_zero_area_off(unsigned long *map,
|
|
unsigned long size,
|
|
unsigned long start,
|
|
unsigned int nr,
|
|
unsigned long align_mask,
|
|
unsigned long align_offset);
|
|
# 136 "include/linux/bitmap.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
|
|
bitmap_find_next_zero_area(unsigned long *map,
|
|
unsigned long size,
|
|
unsigned long start,
|
|
unsigned int nr,
|
|
unsigned long align_mask)
|
|
{
|
|
return bitmap_find_next_zero_area_off(map, size, start, nr,
|
|
align_mask, 0);
|
|
}
|
|
|
|
extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user,
|
|
unsigned long *dst, int nbits);
|
|
extern int bitmap_parse_user(const char *ubuf, unsigned int ulen,
|
|
unsigned long *dst, int nbits);
|
|
extern int bitmap_parselist(const char *buf, unsigned long *maskp,
|
|
int nmaskbits);
|
|
extern int bitmap_parselist_user(const char *ubuf, unsigned int ulen,
|
|
unsigned long *dst, int nbits);
|
|
extern void bitmap_remap(unsigned long *dst, const unsigned long *src,
|
|
const unsigned long *old, const unsigned long *new, unsigned int nbits);
|
|
extern int bitmap_bitremap(int oldbit,
|
|
const unsigned long *old, const unsigned long *new, int bits);
|
|
extern void bitmap_onto(unsigned long *dst, const unsigned long *orig,
|
|
const unsigned long *relmap, unsigned int bits);
|
|
extern void bitmap_fold(unsigned long *dst, const unsigned long *orig,
|
|
unsigned int sz, unsigned int nbits);
|
|
extern int bitmap_find_free_region(unsigned long *bitmap, unsigned int bits, int order);
|
|
extern void bitmap_release_region(unsigned long *bitmap, unsigned int pos, int order);
|
|
extern int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order);
|
|
|
|
|
|
|
|
|
|
|
|
extern unsigned int bitmap_ord_to_pos(const unsigned long *bitmap, unsigned int ord, unsigned int nbits);
|
|
extern int bitmap_print_to_pagebuf(bool list, char *buf,
|
|
const unsigned long *maskp, int nmaskbits);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_zero(unsigned long *dst, unsigned int nbits)
|
|
{
|
|
if ((__builtin_constant_p(nbits) && (nbits) <= 32))
|
|
*dst = 0UL;
|
|
else {
|
|
unsigned int len = (((nbits) + (8 * sizeof(long)) - 1) / (8 * sizeof(long))) * sizeof(unsigned long);
|
|
({ void *__p = (dst); size_t __n = len; if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); });
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_fill(unsigned long *dst, unsigned int nbits)
|
|
{
|
|
unsigned int nlongs = (((nbits) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)));
|
|
if (!(__builtin_constant_p(nbits) && (nbits) <= 32)) {
|
|
unsigned int len = (nlongs - 1) * sizeof(unsigned long);
|
|
({ void *__p = (dst); size_t __n = len; if ((__n) != 0) { if (__builtin_constant_p((0xff)) && (0xff) == 0) __memzero((__p),(__n)); else memset((__p),(0xff),(__n)); } (__p); });
|
|
}
|
|
dst[nlongs - 1] = (~0UL >> (-(nbits) & (32 - 1)));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_copy(unsigned long *dst, const unsigned long *src,
|
|
unsigned int nbits)
|
|
{
|
|
if ((__builtin_constant_p(nbits) && (nbits) <= 32))
|
|
*dst = *src;
|
|
else {
|
|
unsigned int len = (((nbits) + (8 * sizeof(long)) - 1) / (8 * sizeof(long))) * sizeof(unsigned long);
|
|
memcpy(dst, src, len);
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_and(unsigned long *dst, const unsigned long *src1,
|
|
const unsigned long *src2, unsigned int nbits)
|
|
{
|
|
if ((__builtin_constant_p(nbits) && (nbits) <= 32))
|
|
return (*dst = *src1 & *src2 & (~0UL >> (-(nbits) & (32 - 1)))) != 0;
|
|
return __bitmap_and(dst, src1, src2, nbits);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_or(unsigned long *dst, const unsigned long *src1,
|
|
const unsigned long *src2, unsigned int nbits)
|
|
{
|
|
if ((__builtin_constant_p(nbits) && (nbits) <= 32))
|
|
*dst = *src1 | *src2;
|
|
else
|
|
__bitmap_or(dst, src1, src2, nbits);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_xor(unsigned long *dst, const unsigned long *src1,
|
|
const unsigned long *src2, unsigned int nbits)
|
|
{
|
|
if ((__builtin_constant_p(nbits) && (nbits) <= 32))
|
|
*dst = *src1 ^ *src2;
|
|
else
|
|
__bitmap_xor(dst, src1, src2, nbits);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_andnot(unsigned long *dst, const unsigned long *src1,
|
|
const unsigned long *src2, unsigned int nbits)
|
|
{
|
|
if ((__builtin_constant_p(nbits) && (nbits) <= 32))
|
|
return (*dst = *src1 & ~(*src2) & (~0UL >> (-(nbits) & (32 - 1)))) != 0;
|
|
return __bitmap_andnot(dst, src1, src2, nbits);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_complement(unsigned long *dst, const unsigned long *src,
|
|
unsigned int nbits)
|
|
{
|
|
if ((__builtin_constant_p(nbits) && (nbits) <= 32))
|
|
*dst = ~(*src);
|
|
else
|
|
__bitmap_complement(dst, src, nbits);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_equal(const unsigned long *src1,
|
|
const unsigned long *src2, unsigned int nbits)
|
|
{
|
|
if ((__builtin_constant_p(nbits) && (nbits) <= 32))
|
|
return ! ((*src1 ^ *src2) & (~0UL >> (-(nbits) & (32 - 1))));
|
|
else
|
|
return __bitmap_equal(src1, src2, nbits);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_intersects(const unsigned long *src1,
|
|
const unsigned long *src2, unsigned int nbits)
|
|
{
|
|
if ((__builtin_constant_p(nbits) && (nbits) <= 32))
|
|
return ((*src1 & *src2) & (~0UL >> (-(nbits) & (32 - 1)))) != 0;
|
|
else
|
|
return __bitmap_intersects(src1, src2, nbits);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_subset(const unsigned long *src1,
|
|
const unsigned long *src2, unsigned int nbits)
|
|
{
|
|
if ((__builtin_constant_p(nbits) && (nbits) <= 32))
|
|
return ! ((*src1 & ~(*src2)) & (~0UL >> (-(nbits) & (32 - 1))));
|
|
else
|
|
return __bitmap_subset(src1, src2, nbits);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_empty(const unsigned long *src, unsigned nbits)
|
|
{
|
|
if ((__builtin_constant_p(nbits) && (nbits) <= 32))
|
|
return ! (*src & (~0UL >> (-(nbits) & (32 - 1))));
|
|
|
|
return _find_first_bit_le(src,nbits) == nbits;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_full(const unsigned long *src, unsigned int nbits)
|
|
{
|
|
if ((__builtin_constant_p(nbits) && (nbits) <= 32))
|
|
return ! (~(*src) & (~0UL >> (-(nbits) & (32 - 1))));
|
|
|
|
return _find_first_zero_bit_le(src,nbits) == nbits;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) int bitmap_weight(const unsigned long *src, unsigned int nbits)
|
|
{
|
|
if ((__builtin_constant_p(nbits) && (nbits) <= 32))
|
|
return hweight_long(*src & (~0UL >> (-(nbits) & (32 - 1))));
|
|
return __bitmap_weight(src, nbits);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_shift_right(unsigned long *dst, const unsigned long *src,
|
|
unsigned int shift, int nbits)
|
|
{
|
|
if ((__builtin_constant_p(nbits) && (nbits) <= 32))
|
|
*dst = (*src & (~0UL >> (-(nbits) & (32 - 1)))) >> shift;
|
|
else
|
|
__bitmap_shift_right(dst, src, shift, nbits);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bitmap_shift_left(unsigned long *dst, const unsigned long *src,
|
|
unsigned int shift, unsigned int nbits)
|
|
{
|
|
if ((__builtin_constant_p(nbits) && (nbits) <= 32))
|
|
*dst = (*src << shift) & (~0UL >> (-(nbits) & (32 - 1)));
|
|
else
|
|
__bitmap_shift_left(dst, src, shift, nbits);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bitmap_parse(const char *buf, unsigned int buflen,
|
|
unsigned long *maskp, int nmaskbits)
|
|
{
|
|
return __bitmap_parse(buf, buflen, 0, maskp, nmaskbits);
|
|
}
|
|
# 93 "include/linux/nodemask.h" 2
|
|
|
|
|
|
typedef struct { unsigned long bits[((((1 << 0)) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))]; } nodemask_t;
|
|
extern nodemask_t _unused_nodemask_arg_;
|
|
# 116 "include/linux/nodemask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void __node_set(int node, volatile nodemask_t *dstp)
|
|
{
|
|
_set_bit(node,dstp->bits);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __node_clear(int node, volatile nodemask_t *dstp)
|
|
{
|
|
_clear_bit(node,dstp->bits);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_setall(nodemask_t *dstp, unsigned int nbits)
|
|
{
|
|
bitmap_fill(dstp->bits, nbits);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_clear(nodemask_t *dstp, unsigned int nbits)
|
|
{
|
|
bitmap_zero(dstp->bits, nbits);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __node_test_and_set(int node, nodemask_t *addr)
|
|
{
|
|
return _test_and_set_bit(node,addr->bits);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_and(nodemask_t *dstp, const nodemask_t *src1p,
|
|
const nodemask_t *src2p, unsigned int nbits)
|
|
{
|
|
bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_or(nodemask_t *dstp, const nodemask_t *src1p,
|
|
const nodemask_t *src2p, unsigned int nbits)
|
|
{
|
|
bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_xor(nodemask_t *dstp, const nodemask_t *src1p,
|
|
const nodemask_t *src2p, unsigned int nbits)
|
|
{
|
|
bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_andnot(nodemask_t *dstp, const nodemask_t *src1p,
|
|
const nodemask_t *src2p, unsigned int nbits)
|
|
{
|
|
bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_complement(nodemask_t *dstp,
|
|
const nodemask_t *srcp, unsigned int nbits)
|
|
{
|
|
bitmap_complement(dstp->bits, srcp->bits, nbits);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodes_equal(const nodemask_t *src1p,
|
|
const nodemask_t *src2p, unsigned int nbits)
|
|
{
|
|
return bitmap_equal(src1p->bits, src2p->bits, nbits);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodes_intersects(const nodemask_t *src1p,
|
|
const nodemask_t *src2p, unsigned int nbits)
|
|
{
|
|
return bitmap_intersects(src1p->bits, src2p->bits, nbits);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodes_subset(const nodemask_t *src1p,
|
|
const nodemask_t *src2p, unsigned int nbits)
|
|
{
|
|
return bitmap_subset(src1p->bits, src2p->bits, nbits);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodes_empty(const nodemask_t *srcp, unsigned int nbits)
|
|
{
|
|
return bitmap_empty(srcp->bits, nbits);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodes_full(const nodemask_t *srcp, unsigned int nbits)
|
|
{
|
|
return bitmap_full(srcp->bits, nbits);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodes_weight(const nodemask_t *srcp, unsigned int nbits)
|
|
{
|
|
return bitmap_weight(srcp->bits, nbits);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_shift_right(nodemask_t *dstp,
|
|
const nodemask_t *srcp, int n, int nbits)
|
|
{
|
|
bitmap_shift_right(dstp->bits, srcp->bits, n, nbits);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_shift_left(nodemask_t *dstp,
|
|
const nodemask_t *srcp, int n, int nbits)
|
|
{
|
|
bitmap_shift_left(dstp->bits, srcp->bits, n, nbits);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __first_node(const nodemask_t *srcp)
|
|
{
|
|
return ({ int __min1 = ((1 << 0)); int __min2 = (_find_first_bit_le(srcp->bits,(1 << 0))); __min1 < __min2 ? __min1: __min2; });
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __next_node(int n, const nodemask_t *srcp)
|
|
{
|
|
return ({ int __min1 = ((1 << 0)); int __min2 = (_find_next_bit_le(srcp->bits,(1 << 0),n+1)); __min1 < __min2 ? __min1: __min2; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_nodemask_of_node(nodemask_t *mask, int node)
|
|
{
|
|
__nodes_clear(&(*mask), (1 << 0));
|
|
__node_set((node), &(*mask));
|
|
}
|
|
# 280 "include/linux/nodemask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __first_unset_node(const nodemask_t *maskp)
|
|
{
|
|
return ({ int __min1 = ((1 << 0)); int __min2 = (_find_first_zero_bit_le(maskp->bits,(1 << 0))); __min1 < __min2 ? __min1: __min2; })
|
|
;
|
|
}
|
|
# 314 "include/linux/nodemask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodemask_parse_user(const char *buf, int len,
|
|
nodemask_t *dstp, int nbits)
|
|
{
|
|
return bitmap_parse_user(buf, len, dstp->bits, nbits);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __nodelist_parse(const char *buf, nodemask_t *dstp, int nbits)
|
|
{
|
|
return bitmap_parselist(buf, dstp->bits, nbits);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __node_remap(int oldbit,
|
|
const nodemask_t *oldp, const nodemask_t *newp, int nbits)
|
|
{
|
|
return bitmap_bitremap(oldbit, oldp->bits, newp->bits, nbits);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_remap(nodemask_t *dstp, const nodemask_t *srcp,
|
|
const nodemask_t *oldp, const nodemask_t *newp, int nbits)
|
|
{
|
|
bitmap_remap(dstp->bits, srcp->bits, oldp->bits, newp->bits, nbits);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_onto(nodemask_t *dstp, const nodemask_t *origp,
|
|
const nodemask_t *relmapp, int nbits)
|
|
{
|
|
bitmap_onto(dstp->bits, origp->bits, relmapp->bits, nbits);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nodes_fold(nodemask_t *dstp, const nodemask_t *origp,
|
|
int sz, int nbits)
|
|
{
|
|
bitmap_fold(dstp->bits, origp->bits, sz, nbits);
|
|
}
|
|
# 372 "include/linux/nodemask.h"
|
|
enum node_states {
|
|
N_POSSIBLE,
|
|
N_ONLINE,
|
|
N_NORMAL_MEMORY,
|
|
|
|
N_HIGH_MEMORY,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
N_MEMORY = N_HIGH_MEMORY,
|
|
|
|
N_CPU,
|
|
NR_NODE_STATES
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern nodemask_t node_states[NR_NODE_STATES];
|
|
# 449 "include/linux/nodemask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int node_state(int node, enum node_states state)
|
|
{
|
|
return node == 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void node_set_state(int node, enum node_states state)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void node_clear_state(int node, enum node_states state)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int num_node_state(enum node_states state)
|
|
{
|
|
return 1;
|
|
}
|
|
# 484 "include/linux/nodemask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int node_random(const nodemask_t *mask)
|
|
{
|
|
return 0;
|
|
}
|
|
# 516 "include/linux/nodemask.h"
|
|
struct nodemask_scratch {
|
|
nodemask_t mask1;
|
|
nodemask_t mask2;
|
|
};
|
|
# 17 "include/linux/mmzone.h" 2
|
|
# 1 "include/linux/pageblock-flags.h" 1
|
|
# 29 "include/linux/pageblock-flags.h"
|
|
enum pageblock_bits {
|
|
PB_migrate,
|
|
PB_migrate_end = PB_migrate + 3 - 1,
|
|
|
|
PB_migrate_skip,
|
|
|
|
|
|
|
|
|
|
|
|
NR_PAGEBLOCK_BITS
|
|
};
|
|
# 66 "include/linux/pageblock-flags.h"
|
|
struct page;
|
|
|
|
unsigned long get_pfnblock_flags_mask(struct page *page,
|
|
unsigned long pfn,
|
|
unsigned long end_bitidx,
|
|
unsigned long mask);
|
|
|
|
void set_pfnblock_flags_mask(struct page *page,
|
|
unsigned long flags,
|
|
unsigned long pfn,
|
|
unsigned long end_bitidx,
|
|
unsigned long mask);
|
|
# 18 "include/linux/mmzone.h" 2
|
|
# 1 "include/linux/page-flags-layout.h" 1
|
|
|
|
|
|
|
|
|
|
# 1 "include/generated/bounds.h" 1
|
|
# 6 "include/linux/page-flags-layout.h" 2
|
|
# 19 "include/linux/mmzone.h" 2
|
|
# 38 "include/linux/mmzone.h"
|
|
enum {
|
|
MIGRATE_UNMOVABLE,
|
|
MIGRATE_MOVABLE,
|
|
MIGRATE_RECLAIMABLE,
|
|
MIGRATE_PCPTYPES,
|
|
MIGRATE_HIGHATOMIC = MIGRATE_PCPTYPES,
|
|
# 63 "include/linux/mmzone.h"
|
|
MIGRATE_TYPES
|
|
};
|
|
# 76 "include/linux/mmzone.h"
|
|
extern int page_group_by_mobility_disabled;
|
|
# 85 "include/linux/mmzone.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_pfnblock_migratetype(struct page *page, unsigned long pfn)
|
|
{
|
|
((void)sizeof(char[1 - 2*!!(PB_migrate_end - PB_migrate != 2)]));
|
|
return get_pfnblock_flags_mask(page, pfn, PB_migrate_end,
|
|
((1UL << (PB_migrate_end - PB_migrate + 1)) - 1));
|
|
}
|
|
|
|
struct free_area {
|
|
struct list_head free_list[MIGRATE_TYPES];
|
|
unsigned long nr_free;
|
|
};
|
|
|
|
struct pglist_data;
|
|
# 106 "include/linux/mmzone.h"
|
|
struct zone_padding {
|
|
char x[0];
|
|
} __attribute__((__aligned__(1 << (6))));
|
|
|
|
|
|
|
|
|
|
|
|
enum zone_stat_item {
|
|
|
|
NR_FREE_PAGES,
|
|
NR_ALLOC_BATCH,
|
|
NR_LRU_BASE,
|
|
NR_INACTIVE_ANON = NR_LRU_BASE,
|
|
NR_ACTIVE_ANON,
|
|
NR_INACTIVE_FILE,
|
|
NR_ACTIVE_FILE,
|
|
NR_UNEVICTABLE,
|
|
NR_MLOCK,
|
|
NR_ANON_PAGES,
|
|
NR_FILE_MAPPED,
|
|
|
|
NR_FILE_PAGES,
|
|
NR_FILE_DIRTY,
|
|
NR_WRITEBACK,
|
|
NR_SLAB_RECLAIMABLE,
|
|
NR_SLAB_UNRECLAIMABLE,
|
|
NR_PAGETABLE,
|
|
|
|
NR_KERNEL_STACK,
|
|
NR_KAISERTABLE,
|
|
NR_UNSTABLE_NFS,
|
|
NR_BOUNCE,
|
|
NR_VMSCAN_WRITE,
|
|
NR_VMSCAN_IMMEDIATE,
|
|
NR_WRITEBACK_TEMP,
|
|
NR_ISOLATED_ANON,
|
|
NR_ISOLATED_FILE,
|
|
NR_SHMEM,
|
|
NR_DIRTIED,
|
|
NR_WRITTEN,
|
|
NR_PAGES_SCANNED,
|
|
# 156 "include/linux/mmzone.h"
|
|
WORKINGSET_REFAULT,
|
|
WORKINGSET_ACTIVATE,
|
|
WORKINGSET_NODERECLAIM,
|
|
NR_ANON_TRANSPARENT_HUGEPAGES,
|
|
NR_FREE_CMA_PAGES,
|
|
NR_VM_ZONE_STAT_ITEMS };
|
|
# 176 "include/linux/mmzone.h"
|
|
enum lru_list {
|
|
LRU_INACTIVE_ANON = 0,
|
|
LRU_ACTIVE_ANON = 0 + 1,
|
|
LRU_INACTIVE_FILE = 0 + 2,
|
|
LRU_ACTIVE_FILE = 0 + 2 + 1,
|
|
LRU_UNEVICTABLE,
|
|
NR_LRU_LISTS
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_file_lru(enum lru_list lru)
|
|
{
|
|
return (lru == LRU_INACTIVE_FILE || lru == LRU_ACTIVE_FILE);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_active_lru(enum lru_list lru)
|
|
{
|
|
return (lru == LRU_ACTIVE_ANON || lru == LRU_ACTIVE_FILE);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_unevictable_lru(enum lru_list lru)
|
|
{
|
|
return (lru == LRU_UNEVICTABLE);
|
|
}
|
|
|
|
struct zone_reclaim_stat {
|
|
# 213 "include/linux/mmzone.h"
|
|
unsigned long recent_rotated[2];
|
|
unsigned long recent_scanned[2];
|
|
};
|
|
|
|
struct lruvec {
|
|
struct list_head lists[NR_LRU_LISTS];
|
|
struct zone_reclaim_stat reclaim_stat;
|
|
|
|
|
|
|
|
};
|
|
# 240 "include/linux/mmzone.h"
|
|
typedef unsigned isolate_mode_t;
|
|
|
|
enum zone_watermarks {
|
|
WMARK_MIN,
|
|
WMARK_LOW,
|
|
WMARK_HIGH,
|
|
NR_WMARK
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct per_cpu_pages {
|
|
int count;
|
|
int high;
|
|
int batch;
|
|
|
|
|
|
struct list_head lists[MIGRATE_PCPTYPES];
|
|
};
|
|
|
|
struct per_cpu_pageset {
|
|
struct per_cpu_pages pcp;
|
|
|
|
|
|
|
|
|
|
s8 stat_threshold;
|
|
s8 vm_stat_diff[NR_VM_ZONE_STAT_ITEMS];
|
|
|
|
};
|
|
|
|
|
|
|
|
enum zone_type {
|
|
# 310 "include/linux/mmzone.h"
|
|
ZONE_NORMAL,
|
|
# 320 "include/linux/mmzone.h"
|
|
ZONE_HIGHMEM,
|
|
|
|
ZONE_MOVABLE,
|
|
|
|
|
|
|
|
__MAX_NR_ZONES
|
|
|
|
};
|
|
|
|
|
|
|
|
struct zone {
|
|
|
|
|
|
|
|
unsigned long watermark[NR_WMARK];
|
|
|
|
unsigned long nr_reserved_highatomic;
|
|
# 349 "include/linux/mmzone.h"
|
|
long lowmem_reserve[3];
|
|
# 359 "include/linux/mmzone.h"
|
|
unsigned int inactive_ratio;
|
|
|
|
struct pglist_data *zone_pgdat;
|
|
struct per_cpu_pageset *pageset;
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long dirty_balance_reserve;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long *pageblock_flags;
|
|
# 387 "include/linux/mmzone.h"
|
|
unsigned long zone_start_pfn;
|
|
# 430 "include/linux/mmzone.h"
|
|
unsigned long managed_pages;
|
|
unsigned long spanned_pages;
|
|
unsigned long present_pages;
|
|
|
|
const char *name;
|
|
# 474 "include/linux/mmzone.h"
|
|
wait_queue_head_t *wait_table;
|
|
unsigned long wait_table_hash_nr_entries;
|
|
unsigned long wait_table_bits;
|
|
|
|
struct zone_padding _pad1_;
|
|
|
|
struct free_area free_area[11];
|
|
|
|
|
|
unsigned long flags;
|
|
|
|
|
|
spinlock_t lock;
|
|
|
|
struct zone_padding _pad2_;
|
|
|
|
|
|
|
|
|
|
spinlock_t lru_lock;
|
|
struct lruvec lruvec;
|
|
|
|
|
|
atomic_long_t inactive_age;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long percpu_drift_mark;
|
|
|
|
|
|
|
|
unsigned long compact_cached_free_pfn;
|
|
|
|
unsigned long compact_cached_migrate_pfn[2];
|
|
# 519 "include/linux/mmzone.h"
|
|
unsigned int compact_considered;
|
|
unsigned int compact_defer_shift;
|
|
int compact_order_failed;
|
|
|
|
|
|
|
|
|
|
bool compact_blockskip_flush;
|
|
|
|
|
|
struct zone_padding _pad3_;
|
|
|
|
atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
|
|
} __attribute__((__aligned__(1 << (6))));
|
|
|
|
enum zone_flags {
|
|
ZONE_RECLAIM_LOCKED,
|
|
ZONE_OOM_LOCKED,
|
|
ZONE_CONGESTED,
|
|
|
|
|
|
ZONE_DIRTY,
|
|
|
|
|
|
|
|
ZONE_WRITEBACK,
|
|
|
|
|
|
ZONE_FAIR_DEPLETED,
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long zone_end_pfn(const struct zone *zone)
|
|
{
|
|
return zone->zone_start_pfn + zone->spanned_pages;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool zone_spans_pfn(const struct zone *zone, unsigned long pfn)
|
|
{
|
|
return zone->zone_start_pfn <= pfn && pfn < zone_end_pfn(zone);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool zone_is_initialized(struct zone *zone)
|
|
{
|
|
return !!zone->wait_table;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool zone_is_empty(struct zone *zone)
|
|
{
|
|
return zone->spanned_pages == 0;
|
|
}
|
|
# 598 "include/linux/mmzone.h"
|
|
struct zoneref {
|
|
struct zone *zone;
|
|
int zone_idx;
|
|
};
|
|
# 617 "include/linux/mmzone.h"
|
|
struct zonelist {
|
|
struct zoneref _zonerefs[((1 << 0) * 3) + 1];
|
|
};
|
|
|
|
|
|
|
|
extern struct page *mem_map;
|
|
# 637 "include/linux/mmzone.h"
|
|
struct bootmem_data;
|
|
typedef struct pglist_data {
|
|
struct zone node_zones[3];
|
|
struct zonelist node_zonelists[1];
|
|
int nr_zones;
|
|
|
|
struct page *node_mem_map;
|
|
# 664 "include/linux/mmzone.h"
|
|
unsigned long node_start_pfn;
|
|
unsigned long node_present_pages;
|
|
unsigned long node_spanned_pages;
|
|
|
|
int node_id;
|
|
wait_queue_head_t kswapd_wait;
|
|
wait_queue_head_t pfmemalloc_wait;
|
|
struct task_struct *kswapd;
|
|
|
|
int kswapd_max_order;
|
|
enum zone_type classzone_idx;
|
|
# 695 "include/linux/mmzone.h"
|
|
} pg_data_t;
|
|
# 709 "include/linux/mmzone.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long pgdat_end_pfn(pg_data_t *pgdat)
|
|
{
|
|
return pgdat->node_start_pfn + pgdat->node_spanned_pages;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool pgdat_is_empty(pg_data_t *pgdat)
|
|
{
|
|
return !pgdat->node_start_pfn && !pgdat->node_spanned_pages;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int zone_id(const struct zone *zone)
|
|
{
|
|
struct pglist_data *pgdat = zone->zone_pgdat;
|
|
|
|
return zone - pgdat->node_zones;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_dev_zone(const struct zone *zone)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
|
|
# 1 "include/linux/memory_hotplug.h" 1
|
|
|
|
|
|
|
|
# 1 "include/linux/mmzone.h" 1
|
|
# 5 "include/linux/memory_hotplug.h" 2
|
|
|
|
# 1 "include/linux/notifier.h" 1
|
|
# 13 "include/linux/notifier.h"
|
|
# 1 "include/linux/mutex.h" 1
|
|
# 13 "include/linux/mutex.h"
|
|
# 1 "arch/arm/include/generated/asm/current.h" 1
|
|
# 14 "include/linux/mutex.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/osq_lock.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct optimistic_spin_node {
|
|
struct optimistic_spin_node *next, *prev;
|
|
int locked;
|
|
int cpu;
|
|
};
|
|
|
|
struct optimistic_spin_queue {
|
|
|
|
|
|
|
|
|
|
atomic_t tail;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void osq_lock_init(struct optimistic_spin_queue *lock)
|
|
{
|
|
({ union { typeof(((&lock->tail)->counter)) __val; char __c[1]; } __u = { .__val = ( typeof(((&lock->tail)->counter))) (((0))) }; __write_once_size(&(((&lock->tail)->counter)), __u.__c, sizeof(((&lock->tail)->counter))); __u.__val; });
|
|
}
|
|
|
|
extern bool osq_lock(struct optimistic_spin_queue *lock);
|
|
extern void osq_unlock(struct optimistic_spin_queue *lock);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool osq_is_locked(struct optimistic_spin_queue *lock)
|
|
{
|
|
return ({ union { typeof((&lock->tail)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&lock->tail)->counter), __u.__c, sizeof((&lock->tail)->counter)); else __read_once_size_nocheck(&((&lock->tail)->counter), __u.__c, sizeof((&lock->tail)->counter)); __u.__val; }) != (0);
|
|
}
|
|
# 21 "include/linux/mutex.h" 2
|
|
# 50 "include/linux/mutex.h"
|
|
struct mutex {
|
|
|
|
atomic_t count;
|
|
spinlock_t wait_lock;
|
|
struct list_head wait_list;
|
|
|
|
struct task_struct *owner;
|
|
|
|
|
|
struct optimistic_spin_queue osq;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct mutex_waiter {
|
|
struct list_head list;
|
|
struct task_struct *task;
|
|
|
|
|
|
|
|
};
|
|
# 99 "include/linux/mutex.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mutex_destroy(struct mutex *lock) {}
|
|
# 119 "include/linux/mutex.h"
|
|
extern void __mutex_init(struct mutex *lock, const char *name,
|
|
struct lock_class_key *key);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mutex_is_locked(struct mutex *lock)
|
|
{
|
|
return ({ union { typeof((&lock->count)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&lock->count)->counter), __u.__c, sizeof((&lock->count)->counter)); else __read_once_size_nocheck(&((&lock->count)->counter), __u.__c, sizeof((&lock->count)->counter)); __u.__val; }) != 1;
|
|
}
|
|
# 157 "include/linux/mutex.h"
|
|
extern void mutex_lock(struct mutex *lock);
|
|
extern int __attribute__((warn_unused_result)) mutex_lock_interruptible(struct mutex *lock);
|
|
extern int __attribute__((warn_unused_result)) mutex_lock_killable(struct mutex *lock);
|
|
# 173 "include/linux/mutex.h"
|
|
extern int mutex_trylock(struct mutex *lock);
|
|
extern void mutex_unlock(struct mutex *lock);
|
|
|
|
extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock);
|
|
# 14 "include/linux/notifier.h" 2
|
|
# 1 "include/linux/rwsem.h" 1
|
|
# 21 "include/linux/rwsem.h"
|
|
struct rw_semaphore;
|
|
|
|
|
|
|
|
|
|
|
|
struct rw_semaphore {
|
|
long count;
|
|
struct list_head wait_list;
|
|
raw_spinlock_t wait_lock;
|
|
|
|
struct optimistic_spin_queue osq;
|
|
|
|
|
|
|
|
|
|
struct task_struct *owner;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem);
|
|
extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem);
|
|
extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *);
|
|
extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);
|
|
|
|
|
|
# 1 "arch/arm/include/generated/asm/rwsem.h" 1
|
|
# 1 "include/asm-generic/rwsem.h" 1
|
|
# 34 "include/asm-generic/rwsem.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __down_read(struct rw_semaphore *sem)
|
|
{
|
|
if (__builtin_expect(!!(atomic_long_inc_return_acquire((atomic_long_t *)&sem->count) <= 0), 0))
|
|
rwsem_down_read_failed(sem);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __down_read_trylock(struct rw_semaphore *sem)
|
|
{
|
|
long tmp;
|
|
|
|
while ((tmp = sem->count) >= 0) {
|
|
if (tmp == ({ typeof(({ (__typeof__(*(&sem->count)))__cmpxchg((&sem->count), (unsigned long)(tmp), (unsigned long)(tmp + 0x00000001L), sizeof(*(&sem->count))); })) __ret = ({ (__typeof__(*(&sem->count)))__cmpxchg((&sem->count), (unsigned long)(tmp), (unsigned long)(tmp + 0x00000001L), sizeof(*(&sem->count))); }); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; })
|
|
) {
|
|
return 1;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __down_write_nested(struct rw_semaphore *sem, int subclass)
|
|
{
|
|
long tmp;
|
|
|
|
tmp = atomic_long_add_return_acquire(((-0x0000ffffL -1) + 0x00000001L),
|
|
(atomic_long_t *)&sem->count);
|
|
if (__builtin_expect(!!(tmp != ((-0x0000ffffL -1) + 0x00000001L)), 0))
|
|
rwsem_down_write_failed(sem);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __down_write(struct rw_semaphore *sem)
|
|
{
|
|
__down_write_nested(sem, 0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __down_write_trylock(struct rw_semaphore *sem)
|
|
{
|
|
long tmp;
|
|
|
|
tmp = ({ typeof(({ (__typeof__(*(&sem->count)))__cmpxchg((&sem->count), (unsigned long)(0x00000000L), (unsigned long)(((-0x0000ffffL -1) + 0x00000001L)), sizeof(*(&sem->count))); })) __ret = ({ (__typeof__(*(&sem->count)))__cmpxchg((&sem->count), (unsigned long)(0x00000000L), (unsigned long)(((-0x0000ffffL -1) + 0x00000001L)), sizeof(*(&sem->count))); }); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; })
|
|
;
|
|
return tmp == 0x00000000L;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __up_read(struct rw_semaphore *sem)
|
|
{
|
|
long tmp;
|
|
|
|
tmp = atomic_long_dec_return_release((atomic_long_t *)&sem->count);
|
|
if (__builtin_expect(!!(tmp < -1 && (tmp & 0x0000ffffL) == 0), 0))
|
|
rwsem_wake(sem);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __up_write(struct rw_semaphore *sem)
|
|
{
|
|
if (__builtin_expect(!!(atomic_long_sub_return_release(((-0x0000ffffL -1) + 0x00000001L), (atomic_long_t *)&sem->count) < 0), 0)
|
|
)
|
|
rwsem_wake(sem);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rwsem_atomic_add(long delta, struct rw_semaphore *sem)
|
|
{
|
|
atomic_long_add(delta, (atomic_long_t *)&sem->count);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __downgrade_write(struct rw_semaphore *sem)
|
|
{
|
|
long tmp;
|
|
# 124 "include/asm-generic/rwsem.h"
|
|
tmp = atomic_long_add_return_release(-(-0x0000ffffL -1),
|
|
(atomic_long_t *)&sem->count);
|
|
if (tmp < 0)
|
|
rwsem_downgrade_wake(sem);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long rwsem_atomic_update(long delta, struct rw_semaphore *sem)
|
|
{
|
|
return atomic_long_add_return(delta, (atomic_long_t *)&sem->count);
|
|
}
|
|
# 1 "arch/arm/include/generated/asm/rwsem.h" 2
|
|
# 51 "include/linux/rwsem.h" 2
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rwsem_is_locked(struct rw_semaphore *sem)
|
|
{
|
|
return sem->count != 0;
|
|
}
|
|
# 84 "include/linux/rwsem.h"
|
|
extern void __init_rwsem(struct rw_semaphore *sem, const char *name,
|
|
struct lock_class_key *key);
|
|
# 100 "include/linux/rwsem.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rwsem_is_contended(struct rw_semaphore *sem)
|
|
{
|
|
return !list_empty(&sem->wait_list);
|
|
}
|
|
|
|
|
|
|
|
|
|
extern void down_read(struct rw_semaphore *sem);
|
|
|
|
|
|
|
|
|
|
extern int down_read_trylock(struct rw_semaphore *sem);
|
|
|
|
|
|
|
|
|
|
extern void down_write(struct rw_semaphore *sem);
|
|
|
|
|
|
|
|
|
|
extern int down_write_trylock(struct rw_semaphore *sem);
|
|
|
|
|
|
|
|
|
|
extern void up_read(struct rw_semaphore *sem);
|
|
|
|
|
|
|
|
|
|
extern void up_write(struct rw_semaphore *sem);
|
|
|
|
|
|
|
|
|
|
extern void downgrade_write(struct rw_semaphore *sem);
|
|
# 15 "include/linux/notifier.h" 2
|
|
# 1 "include/linux/srcu.h" 1
|
|
# 33 "include/linux/srcu.h"
|
|
# 1 "include/linux/rcupdate.h" 1
|
|
# 40 "include/linux/rcupdate.h"
|
|
# 1 "include/linux/cpumask.h" 1
|
|
# 15 "include/linux/cpumask.h"
|
|
typedef struct cpumask { unsigned long bits[(((2) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))]; } cpumask_t;
|
|
# 37 "include/linux/cpumask.h"
|
|
extern int nr_cpu_ids;
|
|
# 88 "include/linux/cpumask.h"
|
|
extern const struct cpumask *const cpu_possible_mask;
|
|
extern const struct cpumask *const cpu_online_mask;
|
|
extern const struct cpumask *const cpu_present_mask;
|
|
extern const struct cpumask *const cpu_active_mask;
|
|
# 114 "include/linux/cpumask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int cpumask_check(unsigned int cpu)
|
|
{
|
|
|
|
|
|
|
|
return cpu;
|
|
}
|
|
# 172 "include/linux/cpumask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int cpumask_first(const struct cpumask *srcp)
|
|
{
|
|
return _find_first_bit_le(((srcp)->bits),2);
|
|
}
|
|
# 184 "include/linux/cpumask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int cpumask_next(int n, const struct cpumask *srcp)
|
|
{
|
|
|
|
if (n != -1)
|
|
cpumask_check(n);
|
|
return _find_next_bit_le(((srcp)->bits),2,n+1);
|
|
}
|
|
# 199 "include/linux/cpumask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int cpumask_next_zero(int n, const struct cpumask *srcp)
|
|
{
|
|
|
|
if (n != -1)
|
|
cpumask_check(n);
|
|
return _find_next_zero_bit_le(((srcp)->bits),2,n+1);
|
|
}
|
|
|
|
int cpumask_next_and(int n, const struct cpumask *, const struct cpumask *);
|
|
int cpumask_any_but(const struct cpumask *mask, unsigned int cpu);
|
|
unsigned int cpumask_local_spread(unsigned int i, int node);
|
|
# 270 "include/linux/cpumask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_set_cpu(unsigned int cpu, struct cpumask *dstp)
|
|
{
|
|
_set_bit(cpumask_check(cpu),((dstp)->bits));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_clear_cpu(int cpu, struct cpumask *dstp)
|
|
{
|
|
_clear_bit(cpumask_check(cpu),((dstp)->bits));
|
|
}
|
|
# 292 "include/linux/cpumask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_test_cpu(int cpu, const struct cpumask *cpumask)
|
|
{
|
|
return test_bit(cpumask_check(cpu), (((cpumask))->bits));
|
|
}
|
|
# 306 "include/linux/cpumask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask)
|
|
{
|
|
return _test_and_set_bit(cpumask_check(cpu),((cpumask)->bits));
|
|
}
|
|
# 320 "include/linux/cpumask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_test_and_clear_cpu(int cpu, struct cpumask *cpumask)
|
|
{
|
|
return _test_and_clear_bit(cpumask_check(cpu),((cpumask)->bits));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_setall(struct cpumask *dstp)
|
|
{
|
|
bitmap_fill(((dstp)->bits), 2);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_clear(struct cpumask *dstp)
|
|
{
|
|
bitmap_zero(((dstp)->bits), 2);
|
|
}
|
|
# 351 "include/linux/cpumask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_and(struct cpumask *dstp,
|
|
const struct cpumask *src1p,
|
|
const struct cpumask *src2p)
|
|
{
|
|
return bitmap_and(((dstp)->bits), ((src1p)->bits),
|
|
((src2p)->bits), 2);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_or(struct cpumask *dstp, const struct cpumask *src1p,
|
|
const struct cpumask *src2p)
|
|
{
|
|
bitmap_or(((dstp)->bits), ((src1p)->bits),
|
|
((src2p)->bits), 2);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_xor(struct cpumask *dstp,
|
|
const struct cpumask *src1p,
|
|
const struct cpumask *src2p)
|
|
{
|
|
bitmap_xor(((dstp)->bits), ((src1p)->bits),
|
|
((src2p)->bits), 2);
|
|
}
|
|
# 394 "include/linux/cpumask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_andnot(struct cpumask *dstp,
|
|
const struct cpumask *src1p,
|
|
const struct cpumask *src2p)
|
|
{
|
|
return bitmap_andnot(((dstp)->bits), ((src1p)->bits),
|
|
((src2p)->bits), 2);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_complement(struct cpumask *dstp,
|
|
const struct cpumask *srcp)
|
|
{
|
|
bitmap_complement(((dstp)->bits), ((srcp)->bits),
|
|
2);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool cpumask_equal(const struct cpumask *src1p,
|
|
const struct cpumask *src2p)
|
|
{
|
|
return bitmap_equal(((src1p)->bits), ((src2p)->bits),
|
|
2);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool cpumask_intersects(const struct cpumask *src1p,
|
|
const struct cpumask *src2p)
|
|
{
|
|
return bitmap_intersects(((src1p)->bits), ((src2p)->bits),
|
|
2);
|
|
}
|
|
# 445 "include/linux/cpumask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_subset(const struct cpumask *src1p,
|
|
const struct cpumask *src2p)
|
|
{
|
|
return bitmap_subset(((src1p)->bits), ((src2p)->bits),
|
|
2);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool cpumask_empty(const struct cpumask *srcp)
|
|
{
|
|
return bitmap_empty(((srcp)->bits), 2);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool cpumask_full(const struct cpumask *srcp)
|
|
{
|
|
return bitmap_full(((srcp)->bits), 2);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int cpumask_weight(const struct cpumask *srcp)
|
|
{
|
|
return bitmap_weight(((srcp)->bits), 2);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_shift_right(struct cpumask *dstp,
|
|
const struct cpumask *srcp, int n)
|
|
{
|
|
bitmap_shift_right(((dstp)->bits), ((srcp)->bits), n,
|
|
2);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_shift_left(struct cpumask *dstp,
|
|
const struct cpumask *srcp, int n)
|
|
{
|
|
bitmap_shift_left(((dstp)->bits), ((srcp)->bits), n,
|
|
2);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cpumask_copy(struct cpumask *dstp,
|
|
const struct cpumask *srcp)
|
|
{
|
|
bitmap_copy(((dstp)->bits), ((srcp)->bits), 2);
|
|
}
|
|
# 556 "include/linux/cpumask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_parse_user(const char *buf, int len,
|
|
struct cpumask *dstp)
|
|
{
|
|
return bitmap_parse_user(buf, len, ((dstp)->bits), 2);
|
|
}
|
|
# 570 "include/linux/cpumask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_parselist_user(const char *buf, int len,
|
|
struct cpumask *dstp)
|
|
{
|
|
return bitmap_parselist_user(buf, len, ((dstp)->bits),
|
|
2);
|
|
}
|
|
# 584 "include/linux/cpumask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpumask_parse(const char *buf, struct cpumask *dstp)
|
|
{
|
|
char *nl = strchr(buf, '\n');
|
|
unsigned int len = nl ? (unsigned int)(nl - buf) : strlen(buf);
|
|
|
|
return bitmap_parse(buf, len, ((dstp)->bits), 2);
|
|
}
|
|
# 599 "include/linux/cpumask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpulist_parse(const char *buf, struct cpumask *dstp)
|
|
{
|
|
return bitmap_parselist(buf, ((dstp)->bits), 2);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) size_t cpumask_size(void)
|
|
{
|
|
return (((2) + (8 * sizeof(long)) - 1) / (8 * sizeof(long))) * sizeof(long);
|
|
}
|
|
# 670 "include/linux/cpumask.h"
|
|
typedef struct cpumask cpumask_var_t[1];
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags,
|
|
int node)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool zalloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
|
|
{
|
|
cpumask_clear(*mask);
|
|
return true;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool zalloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags,
|
|
int node)
|
|
{
|
|
cpumask_clear(*mask);
|
|
return true;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void alloc_bootmem_cpumask_var(cpumask_var_t *mask)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void free_cpumask_var(cpumask_var_t mask)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void free_bootmem_cpumask_var(cpumask_var_t mask)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool cpumask_available(cpumask_var_t mask)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
|
|
|
|
|
|
extern const unsigned long cpu_all_bits[(((2) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))];
|
|
# 729 "include/linux/cpumask.h"
|
|
void set_cpu_possible(unsigned int cpu, bool possible);
|
|
void set_cpu_present(unsigned int cpu, bool present);
|
|
void set_cpu_online(unsigned int cpu, bool online);
|
|
void set_cpu_active(unsigned int cpu, bool active);
|
|
void init_cpu_present(const struct cpumask *src);
|
|
void init_cpu_possible(const struct cpumask *src);
|
|
void init_cpu_online(const struct cpumask *src);
|
|
# 751 "include/linux/cpumask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __check_is_bitmap(const unsigned long *bitmap)
|
|
{
|
|
return 1;
|
|
}
|
|
# 763 "include/linux/cpumask.h"
|
|
extern const unsigned long
|
|
cpu_bit_bitmap[32 +1][(((2) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))];
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const struct cpumask *get_cpu_mask(unsigned int cpu)
|
|
{
|
|
const unsigned long *p = cpu_bit_bitmap[1 + cpu % 32];
|
|
p -= cpu / 32;
|
|
return ((struct cpumask *)(1 ? (p) : (void *)sizeof(__check_is_bitmap(p))));
|
|
}
|
|
# 800 "include/linux/cpumask.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ssize_t
|
|
cpumap_print_to_pagebuf(bool list, char *buf, const struct cpumask *mask)
|
|
{
|
|
return bitmap_print_to_pagebuf(list, buf, ((mask)->bits),
|
|
nr_cpu_ids);
|
|
}
|
|
# 41 "include/linux/rcupdate.h" 2
|
|
|
|
|
|
# 1 "include/linux/completion.h" 1
|
|
# 25 "include/linux/completion.h"
|
|
struct completion {
|
|
unsigned int done;
|
|
wait_queue_head_t wait;
|
|
};
|
|
# 73 "include/linux/completion.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_completion(struct completion *x)
|
|
{
|
|
x->done = 0;
|
|
do { static struct lock_class_key __key; __init_waitqueue_head((&x->wait), "&x->wait", &__key); } while (0);
|
|
}
|
|
# 86 "include/linux/completion.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void reinit_completion(struct completion *x)
|
|
{
|
|
x->done = 0;
|
|
}
|
|
|
|
extern void wait_for_completion(struct completion *);
|
|
extern void wait_for_completion_io(struct completion *);
|
|
extern int wait_for_completion_interruptible(struct completion *x);
|
|
extern int wait_for_completion_killable(struct completion *x);
|
|
extern unsigned long wait_for_completion_timeout(struct completion *x,
|
|
unsigned long timeout);
|
|
extern unsigned long wait_for_completion_io_timeout(struct completion *x,
|
|
unsigned long timeout);
|
|
extern long wait_for_completion_interruptible_timeout(
|
|
struct completion *x, unsigned long timeout);
|
|
extern long wait_for_completion_killable_timeout(
|
|
struct completion *x, unsigned long timeout);
|
|
extern bool try_wait_for_completion(struct completion *x);
|
|
extern bool completion_done(struct completion *x);
|
|
|
|
extern void complete(struct completion *);
|
|
extern void complete_all(struct completion *);
|
|
# 44 "include/linux/rcupdate.h" 2
|
|
# 1 "include/linux/debugobjects.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum debug_obj_state {
|
|
ODEBUG_STATE_NONE,
|
|
ODEBUG_STATE_INIT,
|
|
ODEBUG_STATE_INACTIVE,
|
|
ODEBUG_STATE_ACTIVE,
|
|
ODEBUG_STATE_DESTROYED,
|
|
ODEBUG_STATE_NOTAVAILABLE,
|
|
ODEBUG_STATE_MAX,
|
|
};
|
|
|
|
struct debug_obj_descr;
|
|
# 27 "include/linux/debugobjects.h"
|
|
struct debug_obj {
|
|
struct hlist_node node;
|
|
enum debug_obj_state state;
|
|
unsigned int astate;
|
|
void *object;
|
|
struct debug_obj_descr *descr;
|
|
};
|
|
# 52 "include/linux/debugobjects.h"
|
|
struct debug_obj_descr {
|
|
const char *name;
|
|
void *(*debug_hint) (void *addr);
|
|
int (*fixup_init) (void *addr, enum debug_obj_state state);
|
|
int (*fixup_activate) (void *addr, enum debug_obj_state state);
|
|
int (*fixup_destroy) (void *addr, enum debug_obj_state state);
|
|
int (*fixup_free) (void *addr, enum debug_obj_state state);
|
|
int (*fixup_assert_init)(void *addr, enum debug_obj_state state);
|
|
};
|
|
# 84 "include/linux/debugobjects.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
debug_object_init (void *addr, struct debug_obj_descr *descr) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
debug_object_init_on_stack(void *addr, struct debug_obj_descr *descr) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
debug_object_activate (void *addr, struct debug_obj_descr *descr) { return 0; }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
debug_object_deactivate(void *addr, struct debug_obj_descr *descr) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
debug_object_destroy (void *addr, struct debug_obj_descr *descr) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
debug_object_free (void *addr, struct debug_obj_descr *descr) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
debug_object_assert_init(void *addr, struct debug_obj_descr *descr) { }
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_objects_early_init(void) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_objects_mem_init(void) { }
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
debug_check_no_obj_freed(const void *address, unsigned long size) { }
|
|
# 45 "include/linux/rcupdate.h" 2
|
|
|
|
|
|
# 1 "include/linux/ktime.h" 1
|
|
# 25 "include/linux/ktime.h"
|
|
# 1 "include/linux/jiffies.h" 1
|
|
# 9 "include/linux/jiffies.h"
|
|
# 1 "include/linux/timex.h" 1
|
|
# 56 "include/linux/timex.h"
|
|
# 1 "include/uapi/linux/timex.h" 1
|
|
# 64 "include/uapi/linux/timex.h"
|
|
struct timex {
|
|
unsigned int modes;
|
|
__kernel_long_t offset;
|
|
__kernel_long_t freq;
|
|
__kernel_long_t maxerror;
|
|
__kernel_long_t esterror;
|
|
int status;
|
|
__kernel_long_t constant;
|
|
__kernel_long_t precision;
|
|
__kernel_long_t tolerance;
|
|
|
|
|
|
struct timeval time;
|
|
__kernel_long_t tick;
|
|
|
|
__kernel_long_t ppsfreq;
|
|
__kernel_long_t jitter;
|
|
int shift;
|
|
__kernel_long_t stabil;
|
|
__kernel_long_t jitcnt;
|
|
__kernel_long_t calcnt;
|
|
__kernel_long_t errcnt;
|
|
__kernel_long_t stbcnt;
|
|
|
|
int tai;
|
|
|
|
int :32; int :32; int :32; int :32;
|
|
int :32; int :32; int :32; int :32;
|
|
int :32; int :32; int :32;
|
|
};
|
|
# 57 "include/linux/timex.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "./include/uapi/linux/param.h" 1
|
|
|
|
|
|
|
|
# 1 "arch/arm/include/generated/asm/param.h" 1
|
|
# 1 "include/asm-generic/param.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/asm-generic/param.h" 1
|
|
# 5 "include/asm-generic/param.h" 2
|
|
# 1 "arch/arm/include/generated/asm/param.h" 2
|
|
# 5 "./include/uapi/linux/param.h" 2
|
|
# 64 "include/linux/timex.h" 2
|
|
|
|
# 1 "./arch/arm/include/asm/timex.h" 1
|
|
# 15 "./arch/arm/include/asm/timex.h"
|
|
typedef unsigned long cycles_t;
|
|
# 66 "include/linux/timex.h" 2
|
|
# 139 "include/linux/timex.h"
|
|
extern unsigned long tick_usec;
|
|
extern unsigned long tick_nsec;
|
|
# 154 "include/linux/timex.h"
|
|
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);
|
|
# 10 "include/linux/jiffies.h" 2
|
|
# 1 "arch/arm/include/generated/asm/param.h" 1
|
|
# 11 "include/linux/jiffies.h" 2
|
|
# 1 "include/generated/timeconst.h" 1
|
|
# 12 "include/linux/jiffies.h" 2
|
|
# 59 "include/linux/jiffies.h"
|
|
extern int register_refined_jiffies(long clock_tick_rate);
|
|
# 76 "include/linux/jiffies.h"
|
|
extern u64 __attribute__((__aligned__((1 << 6)), __section__(".data..cacheline_aligned"))) jiffies_64;
|
|
extern unsigned long volatile __attribute__((__aligned__((1 << 6)), __section__(".data..cacheline_aligned"))) jiffies;
|
|
|
|
|
|
u64 get_jiffies_64(void);
|
|
# 182 "include/linux/jiffies.h"
|
|
extern unsigned long preset_lpj;
|
|
# 283 "include/linux/jiffies.h"
|
|
extern unsigned int jiffies_to_msecs(const unsigned long j);
|
|
extern unsigned int jiffies_to_usecs(const unsigned long j);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 jiffies_to_nsecs(const unsigned long j)
|
|
{
|
|
return (u64)jiffies_to_usecs(j) * 1000L;
|
|
}
|
|
|
|
extern unsigned long __msecs_to_jiffies(const unsigned int m);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long _msecs_to_jiffies(const unsigned int m)
|
|
{
|
|
return (m + (1000L / 100) - 1) / (1000L / 100);
|
|
}
|
|
# 353 "include/linux/jiffies.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) unsigned long msecs_to_jiffies(const unsigned int m)
|
|
{
|
|
if (__builtin_constant_p(m)) {
|
|
if ((int)m < 0)
|
|
return ((((long)(~0UL>>1)) >> 1)-1);
|
|
return _msecs_to_jiffies(m);
|
|
} else {
|
|
return __msecs_to_jiffies(m);
|
|
}
|
|
}
|
|
|
|
extern unsigned long __usecs_to_jiffies(const unsigned int u);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long _usecs_to_jiffies(const unsigned int u)
|
|
{
|
|
return (u + (1000000L / 100) - 1) / (1000000L / 100);
|
|
}
|
|
# 400 "include/linux/jiffies.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) unsigned long usecs_to_jiffies(const unsigned int u)
|
|
{
|
|
if (__builtin_constant_p(u)) {
|
|
if (u > jiffies_to_usecs(((((long)(~0UL>>1)) >> 1)-1)))
|
|
return ((((long)(~0UL>>1)) >> 1)-1);
|
|
return _usecs_to_jiffies(u);
|
|
} else {
|
|
return __usecs_to_jiffies(u);
|
|
}
|
|
}
|
|
|
|
extern unsigned long timespec64_to_jiffies(const struct timespec64 *value);
|
|
extern void jiffies_to_timespec64(const unsigned long jiffies,
|
|
struct timespec64 *value);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long timespec_to_jiffies(const struct timespec *value)
|
|
{
|
|
struct timespec64 ts = timespec_to_timespec64(*value);
|
|
|
|
return timespec64_to_jiffies(&ts);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void jiffies_to_timespec(const unsigned long jiffies,
|
|
struct timespec *value)
|
|
{
|
|
struct timespec64 ts;
|
|
|
|
jiffies_to_timespec64(jiffies, &ts);
|
|
*value = timespec64_to_timespec(ts);
|
|
}
|
|
|
|
extern unsigned long timeval_to_jiffies(const struct timeval *value);
|
|
extern void jiffies_to_timeval(const unsigned long jiffies,
|
|
struct timeval *value);
|
|
|
|
extern clock_t jiffies_to_clock_t(unsigned long x);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) clock_t jiffies_delta_to_clock_t(long delta)
|
|
{
|
|
return jiffies_to_clock_t(({ typeof(0L) _max1 = (0L); typeof(delta) _max2 = (delta); (void) (&_max1 == &_max2); _max1 > _max2 ? _max1 : _max2; }));
|
|
}
|
|
|
|
extern unsigned long clock_t_to_jiffies(unsigned long x);
|
|
extern u64 jiffies_64_to_clock_t(u64 x);
|
|
extern u64 nsec_to_clock_t(u64 x);
|
|
extern u64 nsecs_to_jiffies64(u64 n);
|
|
extern unsigned long nsecs_to_jiffies(u64 n);
|
|
# 26 "include/linux/ktime.h" 2
|
|
# 37 "include/linux/ktime.h"
|
|
union ktime {
|
|
s64 tv64;
|
|
};
|
|
|
|
typedef union ktime ktime_t;
|
|
# 50 "include/linux/ktime.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_set(const s64 secs, const unsigned long nsecs)
|
|
{
|
|
if (__builtin_expect(!!(secs >= (((s64)~((u64)1 << 63)) / 1000000000L)), 0))
|
|
return (ktime_t){ .tv64 = ((s64)~((u64)1 << 63)) };
|
|
|
|
return (ktime_t) { .tv64 = secs * 1000000000L + (s64)nsecs };
|
|
}
|
|
# 88 "include/linux/ktime.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t timespec_to_ktime(struct timespec ts)
|
|
{
|
|
return ktime_set(ts.tv_sec, ts.tv_nsec);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t timespec64_to_ktime(struct timespec64 ts)
|
|
{
|
|
return ktime_set(ts.tv_sec, ts.tv_nsec);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t timeval_to_ktime(struct timeval tv)
|
|
{
|
|
return ktime_set(tv.tv_sec, tv.tv_usec * 1000L);
|
|
}
|
|
# 127 "include/linux/ktime.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ktime_equal(const ktime_t cmp1, const ktime_t cmp2)
|
|
{
|
|
return cmp1.tv64 == cmp2.tv64;
|
|
}
|
|
# 142 "include/linux/ktime.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ktime_compare(const ktime_t cmp1, const ktime_t cmp2)
|
|
{
|
|
if (cmp1.tv64 < cmp2.tv64)
|
|
return -1;
|
|
if (cmp1.tv64 > cmp2.tv64)
|
|
return 1;
|
|
return 0;
|
|
}
|
|
# 158 "include/linux/ktime.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ktime_after(const ktime_t cmp1, const ktime_t cmp2)
|
|
{
|
|
return ktime_compare(cmp1, cmp2) > 0;
|
|
}
|
|
# 170 "include/linux/ktime.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ktime_before(const ktime_t cmp1, const ktime_t cmp2)
|
|
{
|
|
return ktime_compare(cmp1, cmp2) < 0;
|
|
}
|
|
|
|
|
|
extern s64 __ktime_divns(const ktime_t kt, s64 div);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 ktime_divns(const ktime_t kt, s64 div)
|
|
{
|
|
|
|
|
|
|
|
|
|
do { if (__builtin_expect(!!(div < 0), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/ktime.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "183" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
if (__builtin_constant_p(div) && !(div >> 32)) {
|
|
s64 ns = kt.tv64;
|
|
u64 tmp = ns < 0 ? -ns : ns;
|
|
|
|
({ unsigned int __r, __b = (div); if (!__builtin_constant_p(__b) || __b == 0 || (7 < 4 && (__b & (__b - 1)) != 0)) { __r = ({ register unsigned int __base asm("r4") = __b; register unsigned long long __n asm("r0") = tmp; register unsigned long long __res asm("r2"); register unsigned int __rem asm("r1"); asm( ".ifnc " "%0" "," "r1" "; " ".ifnc " "%0" "r1" ",fpr11; " ".ifnc " "%0" "r1" ",r11fp; " ".ifnc " "%0" "r1" ",ipr12; " ".ifnc " "%0" "r1" ",r12ip; " ".err; " ".endif; " ".endif; " ".endif; " ".endif; " ".endif\n\t" ".ifnc " "%1" "," "r2" "; " ".ifnc " "%1" "r2" ",fpr11; " ".ifnc " "%1" "r2" ",r11fp; " ".ifnc " "%1" "r2" ",ipr12; " ".ifnc " "%1" "r2" ",r12ip; " ".err; " ".endif; " ".endif; " ".endif; " ".endif; " ".endif\n\t" ".ifnc " "%2" "," "r0" "; " ".ifnc " "%2" "r0" ",fpr11; " ".ifnc " "%2" "r0" ",r11fp; " ".ifnc " "%2" "r0" ",ipr12; " ".ifnc " "%2" "r0" ",r12ip; " ".err; " ".endif; " ".endif; " ".endif; " ".endif; " ".endif\n\t" ".ifnc " "%3" "," "r4" "; " ".ifnc " "%3" "r4" ",fpr11; " ".ifnc " "%3" "r4" ",r11fp; " ".ifnc " "%3" "r4" ",ipr12; " ".ifnc " "%3" "r4" ",r12ip; " ".err; " ".endif; " ".endif; " ".endif; " ".endif; " ".endif\n\t" "bl __do_div64" : "=r" (__rem), "=r" (__res) : "r" (__n), "r" (__base) : "ip", "lr", "cc"); tmp = __res; __rem; }); } else if ((__b & (__b - 1)) == 0) { __r = tmp; __r &= (__b - 1); tmp /= __b; } else { unsigned long long __res, __x, __t, __m, __n = tmp; unsigned int __c, __p, __z = 0; __r = __n; __p = 1 << ({ unsigned int __left = (__b), __nr = 0; if (__left & 0xffff0000) __nr += 16, __left >>= 16; if (__left & 0x0000ff00) __nr += 8, __left >>= 8; if (__left & 0x000000f0) __nr += 4, __left >>= 4; if (__left & 0x0000000c) __nr += 2, __left >>= 2; if (__left & 0x00000002) __nr += 1; __nr; }); __m = (~0ULL / __b) * __p; __m += (((~0ULL % __b + 1) * __p) + __b - 1) / __b; __x = ~0ULL / __b * __b - 1; __res = (__m & 0xffffffff) * (__x & 0xffffffff); __res >>= 32; __res += (__m & 0xffffffff) * (__x >> 32); __t = __res; __res += (__x & 0xffffffff) * (__m >> 32); __t = (__res < __t) ? (1ULL << 32) : 0; __res = (__res >> 32) + __t; __res += (__m >> 32) * (__x >> 32); __res /= __p; if (~0ULL % (__b / (__b & -__b)) == 0) { __n /= (__b & -__b); __m = ~0ULL / (__b / (__b & -__b)); __p = 1; __c = 1; } else if (__res != __x / __b) { __c = 1; __m = (~0ULL / __b) * __p; __m += ((~0ULL % __b + 1) * __p) / __b; } else { unsigned int __bits = -(__m & -__m); __bits |= __m >> 32; __bits = (~__bits) << 1; if (!__bits) { __p /= (__m & -__m); __m /= (__m & -__m); } else { __p >>= ({ unsigned int __left = (__bits), __nr = 0; if (__left & 0xffff0000) __nr += 16, __left >>= 16; if (__left & 0x0000ff00) __nr += 8, __left >>= 8; if (__left & 0x000000f0) __nr += 4, __left >>= 4; if (__left & 0x0000000c) __nr += 2, __left >>= 2; if (__left & 0x00000002) __nr += 1; __nr; }); __m >>= ({ unsigned int __left = (__bits), __nr = 0; if (__left & 0xffff0000) __nr += 16, __left >>= 16; if (__left & 0x0000ff00) __nr += 8, __left >>= 8; if (__left & 0x000000f0) __nr += 4, __left >>= 4; if (__left & 0x0000000c) __nr += 2, __left >>= 2; if (__left & 0x00000002) __nr += 1; __nr; }); } __c = 0; } if (!__c) { asm ( "umull %Q0, %R0, %Q1, %Q2\n\t" "mov %Q0, #0" : "=&r" (__res) : "r" (__m), "r" (__n) : "cc" ); } else if (!(__m & ((1ULL << 63) | (1ULL << 31)))) { __res = __m; asm ( "umlal %Q0, %R0, %Q1, %Q2\n\t" "mov %Q0, #0" : "+&r" (__res) : "r" (__m), "r" (__n) : "cc" ); } else { asm ( "umull %Q0, %R0, %Q1, %Q2\n\t" "cmn %Q0, %Q1\n\t" "adcs %R0, %R0, %R1\n\t" "adc %Q0, %3, #0" : "=&r" (__res) : "r" (__m), "r" (__n), "r" (__z) : "cc" ); } if (!(__m & ((1ULL << 63) | (1ULL << 31)))) { asm ( "umlal %R0, %Q0, %R1, %Q2\n\t" "umlal %R0, %Q0, %Q1, %R2\n\t" "mov %R0, #0\n\t" "umlal %Q0, %R0, %R1, %R2" : "+&r" (__res) : "r" (__m), "r" (__n) : "cc" ); } else { asm ( "umlal %R0, %Q0, %R2, %Q3\n\t" "umlal %R0, %1, %Q2, %R3\n\t" "mov %R0, #0\n\t" "adds %Q0, %1, %Q0\n\t" "adc %R0, %R0, #0\n\t" "umlal %Q0, %R0, %R2, %R3" : "+&r" (__res), "+&r" (__z) : "r" (__m), "r" (__n) : "cc" ); } __res /= __p; { unsigned int __res0 = __res; unsigned int __b0 = __b; __r -= __res0 * __b0; } tmp = __res; } __r; });
|
|
return ns < 0 ? -tmp : tmp;
|
|
} else {
|
|
return __ktime_divns(kt, div);
|
|
}
|
|
}
|
|
# 206 "include/linux/ktime.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 ktime_to_us(const ktime_t kt)
|
|
{
|
|
return ktime_divns(kt, 1000L);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 ktime_to_ms(const ktime_t kt)
|
|
{
|
|
return ktime_divns(kt, 1000000L);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 ktime_us_delta(const ktime_t later, const ktime_t earlier)
|
|
{
|
|
return ktime_to_us(({ (ktime_t){ .tv64 = (later).tv64 - (earlier).tv64 }; }));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 ktime_ms_delta(const ktime_t later, const ktime_t earlier)
|
|
{
|
|
return ktime_to_ms(({ (ktime_t){ .tv64 = (later).tv64 - (earlier).tv64 }; }));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_add_us(const ktime_t kt, const u64 usec)
|
|
{
|
|
return ({ (ktime_t){ .tv64 = (kt).tv64 + (usec * 1000L) }; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_add_ms(const ktime_t kt, const u64 msec)
|
|
{
|
|
return ({ (ktime_t){ .tv64 = (kt).tv64 + (msec * 1000000L) }; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_sub_us(const ktime_t kt, const u64 usec)
|
|
{
|
|
return ({ (ktime_t){ .tv64 = (kt).tv64 - (usec * 1000L) }; });
|
|
}
|
|
|
|
extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs);
|
|
# 251 "include/linux/ktime.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((warn_unused_result)) bool ktime_to_timespec_cond(const ktime_t kt,
|
|
struct timespec *ts)
|
|
{
|
|
if (kt.tv64) {
|
|
*ts = ns_to_timespec((kt).tv64);
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
# 270 "include/linux/ktime.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((warn_unused_result)) bool ktime_to_timespec64_cond(const ktime_t kt,
|
|
struct timespec64 *ts)
|
|
{
|
|
if (kt.tv64) {
|
|
*ts = ns_to_timespec64((kt).tv64);
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
# 290 "include/linux/ktime.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ns_to_ktime(u64 ns)
|
|
{
|
|
static const ktime_t ktime_zero = { .tv64 = 0 };
|
|
|
|
return ({ (ktime_t){ .tv64 = (ktime_zero).tv64 + (ns) }; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ms_to_ktime(u64 ms)
|
|
{
|
|
static const ktime_t ktime_zero = { .tv64 = 0 };
|
|
|
|
return ktime_add_ms(ktime_zero, ms);
|
|
}
|
|
|
|
# 1 "include/linux/timekeeping.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
void timekeeping_init(void);
|
|
extern int timekeeping_suspended;
|
|
|
|
|
|
|
|
|
|
extern void do_gettimeofday(struct timeval *tv);
|
|
extern int do_settimeofday64(const struct timespec64 *ts);
|
|
extern int do_sys_settimeofday(const struct timespec *tv,
|
|
const struct timezone *tz);
|
|
|
|
|
|
|
|
|
|
unsigned long get_seconds(void);
|
|
struct timespec64 current_kernel_time64(void);
|
|
|
|
struct timespec __current_kernel_time(void);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct timespec current_kernel_time(void)
|
|
{
|
|
struct timespec64 now = current_kernel_time64();
|
|
|
|
return timespec64_to_timespec(now);
|
|
}
|
|
|
|
|
|
|
|
|
|
struct timespec64 get_monotonic_coarse64(void);
|
|
extern void getrawmonotonic64(struct timespec64 *ts);
|
|
extern void ktime_get_ts64(struct timespec64 *ts);
|
|
extern time64_t ktime_get_seconds(void);
|
|
extern time64_t ktime_get_real_seconds(void);
|
|
|
|
extern int __getnstimeofday64(struct timespec64 *tv);
|
|
extern void getnstimeofday64(struct timespec64 *tv);
|
|
extern void getboottime64(struct timespec64 *ts);
|
|
# 92 "include/linux/timekeeping.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int do_settimeofday(const struct timespec *ts)
|
|
{
|
|
struct timespec64 ts64;
|
|
|
|
ts64 = timespec_to_timespec64(*ts);
|
|
return do_settimeofday64(&ts64);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __getnstimeofday(struct timespec *ts)
|
|
{
|
|
struct timespec64 ts64;
|
|
int ret = __getnstimeofday64(&ts64);
|
|
|
|
*ts = timespec64_to_timespec(ts64);
|
|
return ret;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void getnstimeofday(struct timespec *ts)
|
|
{
|
|
struct timespec64 ts64;
|
|
|
|
getnstimeofday64(&ts64);
|
|
*ts = timespec64_to_timespec(ts64);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ktime_get_ts(struct timespec *ts)
|
|
{
|
|
struct timespec64 ts64;
|
|
|
|
ktime_get_ts64(&ts64);
|
|
*ts = timespec64_to_timespec(ts64);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ktime_get_real_ts(struct timespec *ts)
|
|
{
|
|
struct timespec64 ts64;
|
|
|
|
getnstimeofday64(&ts64);
|
|
*ts = timespec64_to_timespec(ts64);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void getrawmonotonic(struct timespec *ts)
|
|
{
|
|
struct timespec64 ts64;
|
|
|
|
getrawmonotonic64(&ts64);
|
|
*ts = timespec64_to_timespec(ts64);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct timespec get_monotonic_coarse(void)
|
|
{
|
|
return timespec64_to_timespec(get_monotonic_coarse64());
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void getboottime(struct timespec *ts)
|
|
{
|
|
struct timespec64 ts64;
|
|
|
|
getboottime64(&ts64);
|
|
*ts = timespec64_to_timespec(ts64);
|
|
}
|
|
# 161 "include/linux/timekeeping.h"
|
|
enum tk_offsets {
|
|
TK_OFFS_REAL,
|
|
TK_OFFS_BOOT,
|
|
TK_OFFS_TAI,
|
|
TK_OFFS_MAX,
|
|
};
|
|
|
|
extern ktime_t ktime_get(void);
|
|
extern ktime_t ktime_get_with_offset(enum tk_offsets offs);
|
|
extern ktime_t ktime_mono_to_any(ktime_t tmono, enum tk_offsets offs);
|
|
extern ktime_t ktime_get_raw(void);
|
|
extern u32 ktime_get_resolution_ns(void);
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_get_real(void)
|
|
{
|
|
return ktime_get_with_offset(TK_OFFS_REAL);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_get_boottime(void)
|
|
{
|
|
return ktime_get_with_offset(TK_OFFS_BOOT);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_get_clocktai(void)
|
|
{
|
|
return ktime_get_with_offset(TK_OFFS_TAI);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t ktime_mono_to_real(ktime_t mono)
|
|
{
|
|
return ktime_mono_to_any(mono, TK_OFFS_REAL);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 ktime_get_ns(void)
|
|
{
|
|
return ((ktime_get()).tv64);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 ktime_get_real_ns(void)
|
|
{
|
|
return ((ktime_get_real()).tv64);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 ktime_get_boot_ns(void)
|
|
{
|
|
return ((ktime_get_boottime()).tv64);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 ktime_get_tai_ns(void)
|
|
{
|
|
return ((ktime_get_clocktai()).tv64);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 ktime_get_raw_ns(void)
|
|
{
|
|
return ((ktime_get_raw()).tv64);
|
|
}
|
|
|
|
extern u64 ktime_get_mono_fast_ns(void);
|
|
extern u64 ktime_get_raw_fast_ns(void);
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void get_monotonic_boottime(struct timespec *ts)
|
|
{
|
|
*ts = ns_to_timespec((ktime_get_boottime()).tv64);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void get_monotonic_boottime64(struct timespec64 *ts)
|
|
{
|
|
*ts = ns_to_timespec64((ktime_get_boottime()).tv64);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void timekeeping_clocktai(struct timespec *ts)
|
|
{
|
|
*ts = ns_to_timespec((ktime_get_clocktai()).tv64);
|
|
}
|
|
|
|
|
|
|
|
|
|
extern bool timekeeping_rtc_skipsuspend(void);
|
|
extern bool timekeeping_rtc_skipresume(void);
|
|
|
|
extern void timekeeping_inject_sleeptime64(struct timespec64 *delta);
|
|
|
|
|
|
|
|
|
|
extern void ktime_get_raw_and_real_ts64(struct timespec64 *ts_raw,
|
|
struct timespec64 *ts_real);
|
|
|
|
|
|
|
|
|
|
extern int persistent_clock_is_local;
|
|
|
|
extern void read_persistent_clock(struct timespec *ts);
|
|
extern void read_persistent_clock64(struct timespec64 *ts);
|
|
extern void read_boot_clock64(struct timespec64 *ts);
|
|
extern int update_persistent_clock(struct timespec now);
|
|
extern int update_persistent_clock64(struct timespec64 now);
|
|
# 305 "include/linux/ktime.h" 2
|
|
# 48 "include/linux/rcupdate.h" 2
|
|
|
|
|
|
|
|
extern int rcu_expedited;
|
|
# 68 "include/linux/rcupdate.h"
|
|
bool rcu_gp_is_expedited(void);
|
|
void rcu_expedite_gp(void);
|
|
void rcu_unexpedite_gp(void);
|
|
|
|
|
|
enum rcutorture_type {
|
|
RCU_FLAVOR,
|
|
RCU_BH_FLAVOR,
|
|
RCU_SCHED_FLAVOR,
|
|
RCU_TASKS_FLAVOR,
|
|
SRCU_FLAVOR,
|
|
INVALID_RCU_FLAVOR
|
|
};
|
|
|
|
|
|
void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
|
|
unsigned long *gpnum, unsigned long *completed);
|
|
void rcutorture_record_test_transition(void);
|
|
void rcutorture_record_progress(unsigned long vernum);
|
|
void do_trace_rcu_torture_read(const char *rcutorturename,
|
|
struct callback_head *rhp,
|
|
unsigned long secs,
|
|
unsigned long c_old,
|
|
unsigned long c);
|
|
# 193 "include/linux/rcupdate.h"
|
|
void call_rcu_bh(struct callback_head *head,
|
|
rcu_callback_t func);
|
|
# 215 "include/linux/rcupdate.h"
|
|
void call_rcu_sched(struct callback_head *head,
|
|
rcu_callback_t func);
|
|
|
|
void synchronize_sched(void);
|
|
|
|
|
|
|
|
|
|
struct rcu_synchronize {
|
|
struct callback_head head;
|
|
struct completion completion;
|
|
};
|
|
void wakeme_after_rcu(struct callback_head *head);
|
|
|
|
void __wait_rcu_gp(bool checktiny, int n, call_rcu_func_t *crcu_array,
|
|
struct rcu_synchronize *rs_array);
|
|
# 277 "include/linux/rcupdate.h"
|
|
void call_rcu_tasks(struct callback_head *head, rcu_callback_t func);
|
|
void synchronize_rcu_tasks(void);
|
|
void rcu_barrier_tasks(void);
|
|
# 298 "include/linux/rcupdate.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __rcu_read_lock(void)
|
|
{
|
|
if ((0 || 0))
|
|
__asm__ __volatile__("": : :"memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __rcu_read_unlock(void)
|
|
{
|
|
if ((0 || 0))
|
|
__asm__ __volatile__("": : :"memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void synchronize_rcu(void)
|
|
{
|
|
synchronize_sched();
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rcu_preempt_depth(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
void rcu_init(void);
|
|
void rcu_end_inkernel_boot(void);
|
|
void rcu_sched_qs(void);
|
|
void rcu_bh_qs(void);
|
|
void rcu_check_callbacks(int user);
|
|
struct notifier_block;
|
|
int rcu_cpu_notify(struct notifier_block *self,
|
|
unsigned long action, void *hcpu);
|
|
|
|
|
|
void rcu_sysrq_start(void);
|
|
void rcu_sysrq_end(void);
|
|
# 348 "include/linux/rcupdate.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_user_enter(void) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_user_exit(void) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_user_hooks_switch(struct task_struct *prev,
|
|
struct task_struct *next) { }
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_init_nohz(void)
|
|
{
|
|
}
|
|
# 419 "include/linux/rcupdate.h"
|
|
bool __rcu_is_watching(void);
|
|
# 428 "include/linux/rcupdate.h"
|
|
# 1 "include/linux/rcutree.h" 1
|
|
# 33 "include/linux/rcutree.h"
|
|
void rcu_note_context_switch(void);
|
|
int rcu_needs_cpu(u64 basem, u64 *nextevt);
|
|
void rcu_cpu_stall_reset(void);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_virt_note_context_switch(int cpu)
|
|
{
|
|
rcu_note_context_switch();
|
|
}
|
|
|
|
void synchronize_rcu_bh(void);
|
|
void synchronize_sched_expedited(void);
|
|
void synchronize_rcu_expedited(void);
|
|
|
|
void kfree_call_rcu(struct callback_head *head, rcu_callback_t func);
|
|
# 69 "include/linux/rcutree.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void synchronize_rcu_bh_expedited(void)
|
|
{
|
|
synchronize_sched_expedited();
|
|
}
|
|
|
|
void rcu_barrier(void);
|
|
void rcu_barrier_bh(void);
|
|
void rcu_barrier_sched(void);
|
|
unsigned long get_state_synchronize_rcu(void);
|
|
void cond_synchronize_rcu(unsigned long oldstate);
|
|
unsigned long get_state_synchronize_sched(void);
|
|
void cond_synchronize_sched(unsigned long oldstate);
|
|
|
|
extern unsigned long rcutorture_testseq;
|
|
extern unsigned long rcutorture_vernum;
|
|
unsigned long rcu_batches_started(void);
|
|
unsigned long rcu_batches_started_bh(void);
|
|
unsigned long rcu_batches_started_sched(void);
|
|
unsigned long rcu_batches_completed(void);
|
|
unsigned long rcu_batches_completed_bh(void);
|
|
unsigned long rcu_batches_completed_sched(void);
|
|
void show_rcu_gp_kthreads(void);
|
|
|
|
void rcu_force_quiescent_state(void);
|
|
void rcu_bh_force_quiescent_state(void);
|
|
void rcu_sched_force_quiescent_state(void);
|
|
|
|
void rcu_idle_enter(void);
|
|
void rcu_idle_exit(void);
|
|
void rcu_irq_enter(void);
|
|
void rcu_irq_exit(void);
|
|
|
|
void exit_rcu(void);
|
|
|
|
void rcu_scheduler_starting(void);
|
|
extern int rcu_scheduler_active __attribute__((__section__(".data..read_mostly")));
|
|
|
|
bool rcu_is_watching(void);
|
|
|
|
void rcu_all_qs(void);
|
|
# 429 "include/linux/rcupdate.h" 2
|
|
# 447 "include/linux/rcupdate.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_rcu_head(struct callback_head *head)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void destroy_rcu_head(struct callback_head *head)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_rcu_head_on_stack(struct callback_head *head)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void destroy_rcu_head_on_stack(struct callback_head *head)
|
|
{
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool rcu_lockdep_current_cpu_online(void)
|
|
{
|
|
return true;
|
|
}
|
|
# 516 "include/linux/rcupdate.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rcu_read_lock_held(void)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rcu_read_lock_bh_held(void)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rcu_read_lock_sched_held(void)
|
|
{
|
|
return 1;
|
|
}
|
|
# 857 "include/linux/rcupdate.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_read_lock(void)
|
|
{
|
|
__rcu_read_lock();
|
|
(void)0;
|
|
do { } while (0);
|
|
do { } while (0)
|
|
;
|
|
}
|
|
# 911 "include/linux/rcupdate.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_read_unlock(void)
|
|
{
|
|
do { } while (0)
|
|
;
|
|
(void)0;
|
|
__rcu_read_unlock();
|
|
do { } while (0);
|
|
}
|
|
# 937 "include/linux/rcupdate.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_read_lock_bh(void)
|
|
{
|
|
local_bh_disable();
|
|
(void)0;
|
|
do { } while (0);
|
|
do { } while (0)
|
|
;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_read_unlock_bh(void)
|
|
{
|
|
do { } while (0)
|
|
;
|
|
do { } while (0);
|
|
(void)0;
|
|
local_bh_enable();
|
|
}
|
|
# 973 "include/linux/rcupdate.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_read_lock_sched(void)
|
|
{
|
|
__asm__ __volatile__("": : :"memory");
|
|
(void)0;
|
|
do { } while (0);
|
|
do { } while (0)
|
|
;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((no_instrument_function)) void rcu_read_lock_sched_notrace(void)
|
|
{
|
|
__asm__ __volatile__("": : :"memory");
|
|
(void)0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_read_unlock_sched(void)
|
|
{
|
|
do { } while (0)
|
|
;
|
|
do { } while (0);
|
|
(void)0;
|
|
__asm__ __volatile__("": : :"memory");
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((no_instrument_function)) void rcu_read_unlock_sched_notrace(void)
|
|
{
|
|
(void)0;
|
|
__asm__ __volatile__("": : :"memory");
|
|
}
|
|
# 1116 "include/linux/rcupdate.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool rcu_is_nocb_cpu(int cpu) { return false; }
|
|
# 1126 "include/linux/rcupdate.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool rcu_sys_is_idle(void)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_sysidle_force_exit(void)
|
|
{
|
|
}
|
|
# 34 "include/linux/srcu.h" 2
|
|
# 1 "include/linux/workqueue.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/timer.h" 1
|
|
# 10 "include/linux/timer.h"
|
|
struct tvec_base;
|
|
|
|
struct timer_list {
|
|
|
|
|
|
|
|
|
|
struct hlist_node entry;
|
|
unsigned long expires;
|
|
void (*function)(unsigned long);
|
|
unsigned long data;
|
|
u32 flags;
|
|
int slack;
|
|
# 32 "include/linux/timer.h"
|
|
};
|
|
# 88 "include/linux/timer.h"
|
|
void init_timer_key(struct timer_list *timer, unsigned int flags,
|
|
const char *name, struct lock_class_key *key);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void destroy_timer_on_stack(struct timer_list *timer) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_timer_on_stack_key(struct timer_list *timer,
|
|
unsigned int flags, const char *name,
|
|
struct lock_class_key *key)
|
|
{
|
|
init_timer_key(timer, flags, name, key);
|
|
}
|
|
# 163 "include/linux/timer.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int timer_pending(const struct timer_list * timer)
|
|
{
|
|
return timer->entry.pprev != ((void *)0);
|
|
}
|
|
|
|
extern void add_timer_on(struct timer_list *timer, int cpu);
|
|
extern int del_timer(struct timer_list * timer);
|
|
extern int mod_timer(struct timer_list *timer, unsigned long expires);
|
|
extern int mod_timer_pending(struct timer_list *timer, unsigned long expires);
|
|
extern int mod_timer_pinned(struct timer_list *timer, unsigned long expires);
|
|
|
|
extern void set_timer_slack(struct timer_list *time, int slack_hz);
|
|
# 211 "include/linux/timer.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_timer_stats(void)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void timer_stats_timer_set_start_info(struct timer_list *timer)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void timer_stats_timer_clear_start_info(struct timer_list *timer)
|
|
{
|
|
}
|
|
|
|
|
|
extern void add_timer(struct timer_list *timer);
|
|
|
|
extern int try_to_del_timer_sync(struct timer_list *timer);
|
|
|
|
|
|
extern int del_timer_sync(struct timer_list *timer);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern void init_timers(void);
|
|
extern void run_local_timers(void);
|
|
struct hrtimer;
|
|
extern enum hrtimer_restart it_real_fn(struct hrtimer *);
|
|
|
|
|
|
# 1 "include/linux/sysctl.h" 1
|
|
# 27 "include/linux/sysctl.h"
|
|
# 1 "include/linux/rbtree.h" 1
|
|
# 36 "include/linux/rbtree.h"
|
|
struct rb_node {
|
|
unsigned long __rb_parent_color;
|
|
struct rb_node *rb_right;
|
|
struct rb_node *rb_left;
|
|
} __attribute__((aligned(sizeof(long))));
|
|
|
|
|
|
struct rb_root {
|
|
struct rb_node *rb_node;
|
|
};
|
|
# 62 "include/linux/rbtree.h"
|
|
extern void rb_insert_color(struct rb_node *, struct rb_root *);
|
|
extern void rb_erase(struct rb_node *, struct rb_root *);
|
|
|
|
|
|
|
|
extern struct rb_node *rb_next(const struct rb_node *);
|
|
extern struct rb_node *rb_prev(const struct rb_node *);
|
|
extern struct rb_node *rb_first(const struct rb_root *);
|
|
extern struct rb_node *rb_last(const struct rb_root *);
|
|
|
|
|
|
extern struct rb_node *rb_first_postorder(const struct rb_root *);
|
|
extern struct rb_node *rb_next_postorder(const struct rb_node *);
|
|
|
|
|
|
extern void rb_replace_node(struct rb_node *victim, struct rb_node *new,
|
|
struct rb_root *root);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rb_link_node(struct rb_node *node, struct rb_node *parent,
|
|
struct rb_node **rb_link)
|
|
{
|
|
node->__rb_parent_color = (unsigned long)parent;
|
|
node->rb_left = node->rb_right = ((void *)0);
|
|
|
|
*rb_link = node;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rb_link_node_rcu(struct rb_node *node, struct rb_node *parent,
|
|
struct rb_node **rb_link)
|
|
{
|
|
node->__rb_parent_color = (unsigned long)parent;
|
|
node->rb_left = node->rb_right = ((void *)0);
|
|
|
|
do { do { bool __cond = !((sizeof(*&*rb_link) == sizeof(char) || sizeof(*&*rb_link) == sizeof(short) || sizeof(*&*rb_link) == sizeof(int) || sizeof(*&*rb_link) == sizeof(long))); extern void __compiletime_assert_95(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_95(); do { } while (0); } while (0); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); ({ union { typeof(*&*rb_link) __val; char __c[1]; } __u = { .__val = ( typeof(*&*rb_link)) ((typeof(*(node)) *)(node)) }; __write_once_size(&(*&*rb_link), __u.__c, sizeof(*&*rb_link)); __u.__val; }); } while (0);
|
|
}
|
|
# 28 "include/linux/sysctl.h" 2
|
|
# 1 "include/uapi/linux/sysctl.h" 1
|
|
# 29 "include/uapi/linux/sysctl.h"
|
|
struct completion;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct __sysctl_args {
|
|
int *name;
|
|
int nlen;
|
|
void *oldval;
|
|
size_t *oldlenp;
|
|
void *newval;
|
|
size_t newlen;
|
|
unsigned long __unused[4];
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum
|
|
{
|
|
CTL_KERN=1,
|
|
CTL_VM=2,
|
|
CTL_NET=3,
|
|
CTL_PROC=4,
|
|
CTL_FS=5,
|
|
CTL_DEBUG=6,
|
|
CTL_DEV=7,
|
|
CTL_BUS=8,
|
|
CTL_ABI=9,
|
|
CTL_CPU=10,
|
|
CTL_ARLAN=254,
|
|
CTL_S390DBF=5677,
|
|
CTL_SUNRPC=7249,
|
|
CTL_PM=9899,
|
|
CTL_FRV=9898,
|
|
};
|
|
|
|
|
|
enum
|
|
{
|
|
CTL_BUS_ISA=1
|
|
};
|
|
|
|
|
|
enum
|
|
{
|
|
INOTIFY_MAX_USER_INSTANCES=1,
|
|
INOTIFY_MAX_USER_WATCHES=2,
|
|
INOTIFY_MAX_QUEUED_EVENTS=3
|
|
};
|
|
|
|
|
|
enum
|
|
{
|
|
KERN_OSTYPE=1,
|
|
KERN_OSRELEASE=2,
|
|
KERN_OSREV=3,
|
|
KERN_VERSION=4,
|
|
KERN_SECUREMASK=5,
|
|
KERN_PROF=6,
|
|
KERN_NODENAME=7,
|
|
KERN_DOMAINNAME=8,
|
|
|
|
KERN_PANIC=15,
|
|
KERN_REALROOTDEV=16,
|
|
|
|
KERN_SPARC_REBOOT=21,
|
|
KERN_CTLALTDEL=22,
|
|
KERN_PRINTK=23,
|
|
KERN_NAMETRANS=24,
|
|
KERN_PPC_HTABRECLAIM=25,
|
|
KERN_PPC_ZEROPAGED=26,
|
|
KERN_PPC_POWERSAVE_NAP=27,
|
|
KERN_MODPROBE=28,
|
|
KERN_SG_BIG_BUFF=29,
|
|
KERN_ACCT=30,
|
|
KERN_PPC_L2CR=31,
|
|
|
|
KERN_RTSIGNR=32,
|
|
KERN_RTSIGMAX=33,
|
|
|
|
KERN_SHMMAX=34,
|
|
KERN_MSGMAX=35,
|
|
KERN_MSGMNB=36,
|
|
KERN_MSGPOOL=37,
|
|
KERN_SYSRQ=38,
|
|
KERN_MAX_THREADS=39,
|
|
KERN_RANDOM=40,
|
|
KERN_SHMALL=41,
|
|
KERN_MSGMNI=42,
|
|
KERN_SEM=43,
|
|
KERN_SPARC_STOP_A=44,
|
|
KERN_SHMMNI=45,
|
|
KERN_OVERFLOWUID=46,
|
|
KERN_OVERFLOWGID=47,
|
|
KERN_SHMPATH=48,
|
|
KERN_HOTPLUG=49,
|
|
KERN_IEEE_EMULATION_WARNINGS=50,
|
|
KERN_S390_USER_DEBUG_LOGGING=51,
|
|
KERN_CORE_USES_PID=52,
|
|
KERN_TAINTED=53,
|
|
KERN_CADPID=54,
|
|
KERN_PIDMAX=55,
|
|
KERN_CORE_PATTERN=56,
|
|
KERN_PANIC_ON_OOPS=57,
|
|
KERN_HPPA_PWRSW=58,
|
|
KERN_HPPA_UNALIGNED=59,
|
|
KERN_PRINTK_RATELIMIT=60,
|
|
KERN_PRINTK_RATELIMIT_BURST=61,
|
|
KERN_PTY=62,
|
|
KERN_NGROUPS_MAX=63,
|
|
KERN_SPARC_SCONS_PWROFF=64,
|
|
KERN_HZ_TIMER=65,
|
|
KERN_UNKNOWN_NMI_PANIC=66,
|
|
KERN_BOOTLOADER_TYPE=67,
|
|
KERN_RANDOMIZE=68,
|
|
KERN_SETUID_DUMPABLE=69,
|
|
KERN_SPIN_RETRY=70,
|
|
KERN_ACPI_VIDEO_FLAGS=71,
|
|
KERN_IA64_UNALIGNED=72,
|
|
KERN_COMPAT_LOG=73,
|
|
KERN_MAX_LOCK_DEPTH=74,
|
|
KERN_NMI_WATCHDOG=75,
|
|
KERN_PANIC_ON_NMI=76,
|
|
KERN_PANIC_ON_WARN=77,
|
|
};
|
|
|
|
|
|
|
|
|
|
enum
|
|
{
|
|
VM_UNUSED1=1,
|
|
VM_UNUSED2=2,
|
|
VM_UNUSED3=3,
|
|
VM_UNUSED4=4,
|
|
VM_OVERCOMMIT_MEMORY=5,
|
|
VM_UNUSED5=6,
|
|
VM_UNUSED7=7,
|
|
VM_UNUSED8=8,
|
|
VM_UNUSED9=9,
|
|
VM_PAGE_CLUSTER=10,
|
|
VM_DIRTY_BACKGROUND=11,
|
|
VM_DIRTY_RATIO=12,
|
|
VM_DIRTY_WB_CS=13,
|
|
VM_DIRTY_EXPIRE_CS=14,
|
|
VM_NR_PDFLUSH_THREADS=15,
|
|
VM_OVERCOMMIT_RATIO=16,
|
|
VM_PAGEBUF=17,
|
|
VM_HUGETLB_PAGES=18,
|
|
VM_SWAPPINESS=19,
|
|
VM_LOWMEM_RESERVE_RATIO=20,
|
|
VM_MIN_FREE_KBYTES=21,
|
|
VM_MAX_MAP_COUNT=22,
|
|
VM_LAPTOP_MODE=23,
|
|
VM_BLOCK_DUMP=24,
|
|
VM_HUGETLB_GROUP=25,
|
|
VM_VFS_CACHE_PRESSURE=26,
|
|
VM_LEGACY_VA_LAYOUT=27,
|
|
VM_SWAP_TOKEN_TIMEOUT=28,
|
|
VM_DROP_PAGECACHE=29,
|
|
VM_PERCPU_PAGELIST_FRACTION=30,
|
|
VM_ZONE_RECLAIM_MODE=31,
|
|
VM_MIN_UNMAPPED=32,
|
|
VM_PANIC_ON_OOM=33,
|
|
VM_VDSO_ENABLED=34,
|
|
VM_MIN_SLAB=35,
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
{
|
|
NET_CORE=1,
|
|
NET_ETHER=2,
|
|
NET_802=3,
|
|
NET_UNIX=4,
|
|
NET_IPV4=5,
|
|
NET_IPX=6,
|
|
NET_ATALK=7,
|
|
NET_NETROM=8,
|
|
NET_AX25=9,
|
|
NET_BRIDGE=10,
|
|
NET_ROSE=11,
|
|
NET_IPV6=12,
|
|
NET_X25=13,
|
|
NET_TR=14,
|
|
NET_DECNET=15,
|
|
NET_ECONET=16,
|
|
NET_SCTP=17,
|
|
NET_LLC=18,
|
|
NET_NETFILTER=19,
|
|
NET_DCCP=20,
|
|
NET_IRDA=412,
|
|
};
|
|
|
|
|
|
enum
|
|
{
|
|
RANDOM_POOLSIZE=1,
|
|
RANDOM_ENTROPY_COUNT=2,
|
|
RANDOM_READ_THRESH=3,
|
|
RANDOM_WRITE_THRESH=4,
|
|
RANDOM_BOOT_ID=5,
|
|
RANDOM_UUID=6
|
|
};
|
|
|
|
|
|
enum
|
|
{
|
|
PTY_MAX=1,
|
|
PTY_NR=2
|
|
};
|
|
|
|
|
|
enum
|
|
{
|
|
BUS_ISA_MEM_BASE=1,
|
|
BUS_ISA_PORT_BASE=2,
|
|
BUS_ISA_PORT_SHIFT=3
|
|
};
|
|
|
|
|
|
enum
|
|
{
|
|
NET_CORE_WMEM_MAX=1,
|
|
NET_CORE_RMEM_MAX=2,
|
|
NET_CORE_WMEM_DEFAULT=3,
|
|
NET_CORE_RMEM_DEFAULT=4,
|
|
|
|
NET_CORE_MAX_BACKLOG=6,
|
|
NET_CORE_FASTROUTE=7,
|
|
NET_CORE_MSG_COST=8,
|
|
NET_CORE_MSG_BURST=9,
|
|
NET_CORE_OPTMEM_MAX=10,
|
|
NET_CORE_HOT_LIST_LENGTH=11,
|
|
NET_CORE_DIVERT_VERSION=12,
|
|
NET_CORE_NO_CONG_THRESH=13,
|
|
NET_CORE_NO_CONG=14,
|
|
NET_CORE_LO_CONG=15,
|
|
NET_CORE_MOD_CONG=16,
|
|
NET_CORE_DEV_WEIGHT=17,
|
|
NET_CORE_SOMAXCONN=18,
|
|
NET_CORE_BUDGET=19,
|
|
NET_CORE_AEVENT_ETIME=20,
|
|
NET_CORE_AEVENT_RSEQTH=21,
|
|
NET_CORE_WARNINGS=22,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum
|
|
{
|
|
NET_UNIX_DESTROY_DELAY=1,
|
|
NET_UNIX_DELETE_DELAY=2,
|
|
NET_UNIX_MAX_DGRAM_QLEN=3,
|
|
};
|
|
|
|
|
|
enum
|
|
{
|
|
NET_NF_CONNTRACK_MAX=1,
|
|
NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
|
|
NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
|
|
NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
|
|
NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
|
|
NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
|
|
NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
|
|
NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
|
|
NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
|
|
NET_NF_CONNTRACK_UDP_TIMEOUT=10,
|
|
NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
|
|
NET_NF_CONNTRACK_ICMP_TIMEOUT=12,
|
|
NET_NF_CONNTRACK_GENERIC_TIMEOUT=13,
|
|
NET_NF_CONNTRACK_BUCKETS=14,
|
|
NET_NF_CONNTRACK_LOG_INVALID=15,
|
|
NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16,
|
|
NET_NF_CONNTRACK_TCP_LOOSE=17,
|
|
NET_NF_CONNTRACK_TCP_BE_LIBERAL=18,
|
|
NET_NF_CONNTRACK_TCP_MAX_RETRANS=19,
|
|
NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20,
|
|
NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21,
|
|
NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22,
|
|
NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23,
|
|
NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24,
|
|
NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
|
|
NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
|
|
NET_NF_CONNTRACK_COUNT=27,
|
|
NET_NF_CONNTRACK_ICMPV6_TIMEOUT=28,
|
|
NET_NF_CONNTRACK_FRAG6_TIMEOUT=29,
|
|
NET_NF_CONNTRACK_FRAG6_LOW_THRESH=30,
|
|
NET_NF_CONNTRACK_FRAG6_HIGH_THRESH=31,
|
|
NET_NF_CONNTRACK_CHECKSUM=32,
|
|
|
|
NET_NF_CONNTRACK_FTP_ENABLE=33,
|
|
NET_NF_CONNTRACK_SIP_ENABLE=34,
|
|
NET_NF_CONNTRACK_H323_ENABLE=35,
|
|
NET_NF_CONNTRACK_RTSP_ENABLE=36,
|
|
NET_NF_CONNTRACK_L2TP_ENABLE=37,
|
|
NET_NF_CONNTRACK_IPSEC_ENABLE=38,
|
|
NET_NF_CONNTRACK_PPTP_ENABLE=39,
|
|
NET_NF_CONNTRACK_PORTSCAN_ENABLE=40,
|
|
NET_NF_CONNTRACK_FTP_PORT=41,
|
|
NET_NF_CONNTRACK_ESP_TIMEOUT=42,
|
|
NET_NF_CONNTRACK_RTCP_ENABLE=43,
|
|
};
|
|
|
|
|
|
enum
|
|
{
|
|
|
|
NET_IPV4_FORWARD=8,
|
|
NET_IPV4_DYNADDR=9,
|
|
|
|
NET_IPV4_CONF=16,
|
|
NET_IPV4_NEIGH=17,
|
|
NET_IPV4_ROUTE=18,
|
|
NET_IPV4_FIB_HASH=19,
|
|
NET_IPV4_NETFILTER=20,
|
|
|
|
NET_IPV4_TCP_TIMESTAMPS=33,
|
|
NET_IPV4_TCP_WINDOW_SCALING=34,
|
|
NET_IPV4_TCP_SACK=35,
|
|
NET_IPV4_TCP_RETRANS_COLLAPSE=36,
|
|
NET_IPV4_DEFAULT_TTL=37,
|
|
NET_IPV4_AUTOCONFIG=38,
|
|
NET_IPV4_NO_PMTU_DISC=39,
|
|
NET_IPV4_TCP_SYN_RETRIES=40,
|
|
NET_IPV4_IPFRAG_HIGH_THRESH=41,
|
|
NET_IPV4_IPFRAG_LOW_THRESH=42,
|
|
NET_IPV4_IPFRAG_TIME=43,
|
|
NET_IPV4_TCP_MAX_KA_PROBES=44,
|
|
NET_IPV4_TCP_KEEPALIVE_TIME=45,
|
|
NET_IPV4_TCP_KEEPALIVE_PROBES=46,
|
|
NET_IPV4_TCP_RETRIES1=47,
|
|
NET_IPV4_TCP_RETRIES2=48,
|
|
NET_IPV4_TCP_FIN_TIMEOUT=49,
|
|
NET_IPV4_IP_MASQ_DEBUG=50,
|
|
NET_TCP_SYNCOOKIES=51,
|
|
NET_TCP_STDURG=52,
|
|
NET_TCP_RFC1337=53,
|
|
NET_TCP_SYN_TAILDROP=54,
|
|
NET_TCP_MAX_SYN_BACKLOG=55,
|
|
NET_IPV4_LOCAL_PORT_RANGE=56,
|
|
NET_IPV4_ICMP_ECHO_IGNORE_ALL=57,
|
|
NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS=58,
|
|
NET_IPV4_ICMP_SOURCEQUENCH_RATE=59,
|
|
NET_IPV4_ICMP_DESTUNREACH_RATE=60,
|
|
NET_IPV4_ICMP_TIMEEXCEED_RATE=61,
|
|
NET_IPV4_ICMP_PARAMPROB_RATE=62,
|
|
NET_IPV4_ICMP_ECHOREPLY_RATE=63,
|
|
NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES=64,
|
|
NET_IPV4_IGMP_MAX_MEMBERSHIPS=65,
|
|
NET_TCP_TW_RECYCLE=66,
|
|
NET_IPV4_ALWAYS_DEFRAG=67,
|
|
NET_IPV4_TCP_KEEPALIVE_INTVL=68,
|
|
NET_IPV4_INET_PEER_THRESHOLD=69,
|
|
NET_IPV4_INET_PEER_MINTTL=70,
|
|
NET_IPV4_INET_PEER_MAXTTL=71,
|
|
NET_IPV4_INET_PEER_GC_MINTIME=72,
|
|
NET_IPV4_INET_PEER_GC_MAXTIME=73,
|
|
NET_TCP_ORPHAN_RETRIES=74,
|
|
NET_TCP_ABORT_ON_OVERFLOW=75,
|
|
NET_TCP_SYNACK_RETRIES=76,
|
|
NET_TCP_MAX_ORPHANS=77,
|
|
NET_TCP_MAX_TW_BUCKETS=78,
|
|
NET_TCP_FACK=79,
|
|
NET_TCP_REORDERING=80,
|
|
NET_TCP_ECN=81,
|
|
NET_TCP_DSACK=82,
|
|
NET_TCP_MEM=83,
|
|
NET_TCP_WMEM=84,
|
|
NET_TCP_RMEM=85,
|
|
NET_TCP_APP_WIN=86,
|
|
NET_TCP_ADV_WIN_SCALE=87,
|
|
NET_IPV4_NONLOCAL_BIND=88,
|
|
NET_IPV4_ICMP_RATELIMIT=89,
|
|
NET_IPV4_ICMP_RATEMASK=90,
|
|
NET_TCP_TW_REUSE=91,
|
|
NET_TCP_FRTO=92,
|
|
NET_TCP_LOW_LATENCY=93,
|
|
NET_IPV4_IPFRAG_SECRET_INTERVAL=94,
|
|
NET_IPV4_IGMP_MAX_MSF=96,
|
|
NET_TCP_NO_METRICS_SAVE=97,
|
|
NET_TCP_DEFAULT_WIN_SCALE=105,
|
|
NET_TCP_MODERATE_RCVBUF=106,
|
|
NET_TCP_TSO_WIN_DIVISOR=107,
|
|
NET_TCP_BIC_BETA=108,
|
|
NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109,
|
|
NET_TCP_CONG_CONTROL=110,
|
|
NET_TCP_ABC=111,
|
|
NET_IPV4_IPFRAG_MAX_DIST=112,
|
|
NET_TCP_MTU_PROBING=113,
|
|
NET_TCP_BASE_MSS=114,
|
|
NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115,
|
|
NET_TCP_DMA_COPYBREAK=116,
|
|
NET_TCP_SLOW_START_AFTER_IDLE=117,
|
|
NET_CIPSOV4_CACHE_ENABLE=118,
|
|
NET_CIPSOV4_CACHE_BUCKET_SIZE=119,
|
|
NET_CIPSOV4_RBM_OPTFMT=120,
|
|
NET_CIPSOV4_RBM_STRICTVALID=121,
|
|
NET_TCP_AVAIL_CONG_CONTROL=122,
|
|
NET_TCP_ALLOWED_CONG_CONTROL=123,
|
|
NET_TCP_MAX_SSTHRESH=124,
|
|
NET_TCP_FRTO_RESPONSE=125,
|
|
};
|
|
|
|
enum {
|
|
NET_IPV4_ROUTE_FLUSH=1,
|
|
NET_IPV4_ROUTE_MIN_DELAY=2,
|
|
NET_IPV4_ROUTE_MAX_DELAY=3,
|
|
NET_IPV4_ROUTE_GC_THRESH=4,
|
|
NET_IPV4_ROUTE_MAX_SIZE=5,
|
|
NET_IPV4_ROUTE_GC_MIN_INTERVAL=6,
|
|
NET_IPV4_ROUTE_GC_TIMEOUT=7,
|
|
NET_IPV4_ROUTE_GC_INTERVAL=8,
|
|
NET_IPV4_ROUTE_REDIRECT_LOAD=9,
|
|
NET_IPV4_ROUTE_REDIRECT_NUMBER=10,
|
|
NET_IPV4_ROUTE_REDIRECT_SILENCE=11,
|
|
NET_IPV4_ROUTE_ERROR_COST=12,
|
|
NET_IPV4_ROUTE_ERROR_BURST=13,
|
|
NET_IPV4_ROUTE_GC_ELASTICITY=14,
|
|
NET_IPV4_ROUTE_MTU_EXPIRES=15,
|
|
NET_IPV4_ROUTE_MIN_PMTU=16,
|
|
NET_IPV4_ROUTE_MIN_ADVMSS=17,
|
|
NET_IPV4_ROUTE_SECRET_INTERVAL=18,
|
|
NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS=19,
|
|
};
|
|
|
|
enum
|
|
{
|
|
NET_PROTO_CONF_ALL=-2,
|
|
NET_PROTO_CONF_DEFAULT=-3
|
|
|
|
|
|
};
|
|
|
|
enum
|
|
{
|
|
NET_IPV4_CONF_FORWARDING=1,
|
|
NET_IPV4_CONF_MC_FORWARDING=2,
|
|
NET_IPV4_CONF_PROXY_ARP=3,
|
|
NET_IPV4_CONF_ACCEPT_REDIRECTS=4,
|
|
NET_IPV4_CONF_SECURE_REDIRECTS=5,
|
|
NET_IPV4_CONF_SEND_REDIRECTS=6,
|
|
NET_IPV4_CONF_SHARED_MEDIA=7,
|
|
NET_IPV4_CONF_RP_FILTER=8,
|
|
NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE=9,
|
|
NET_IPV4_CONF_BOOTP_RELAY=10,
|
|
NET_IPV4_CONF_LOG_MARTIANS=11,
|
|
NET_IPV4_CONF_TAG=12,
|
|
NET_IPV4_CONF_ARPFILTER=13,
|
|
NET_IPV4_CONF_MEDIUM_ID=14,
|
|
NET_IPV4_CONF_NOXFRM=15,
|
|
NET_IPV4_CONF_NOPOLICY=16,
|
|
NET_IPV4_CONF_FORCE_IGMP_VERSION=17,
|
|
NET_IPV4_CONF_ARP_ANNOUNCE=18,
|
|
NET_IPV4_CONF_ARP_IGNORE=19,
|
|
NET_IPV4_CONF_PROMOTE_SECONDARIES=20,
|
|
NET_IPV4_CONF_ARP_ACCEPT=21,
|
|
NET_IPV4_CONF_ARP_NOTIFY=22,
|
|
};
|
|
|
|
|
|
enum
|
|
{
|
|
NET_IPV4_NF_CONNTRACK_MAX=1,
|
|
NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
|
|
NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
|
|
NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
|
|
NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
|
|
NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
|
|
NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
|
|
NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
|
|
NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
|
|
NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT=10,
|
|
NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
|
|
NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT=12,
|
|
NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT=13,
|
|
NET_IPV4_NF_CONNTRACK_BUCKETS=14,
|
|
NET_IPV4_NF_CONNTRACK_LOG_INVALID=15,
|
|
NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16,
|
|
NET_IPV4_NF_CONNTRACK_TCP_LOOSE=17,
|
|
NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL=18,
|
|
NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS=19,
|
|
NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20,
|
|
NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21,
|
|
NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22,
|
|
NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23,
|
|
NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24,
|
|
NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
|
|
NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
|
|
NET_IPV4_NF_CONNTRACK_COUNT=27,
|
|
NET_IPV4_NF_CONNTRACK_CHECKSUM=28,
|
|
};
|
|
|
|
|
|
enum {
|
|
NET_IPV6_CONF=16,
|
|
NET_IPV6_NEIGH=17,
|
|
NET_IPV6_ROUTE=18,
|
|
NET_IPV6_ICMP=19,
|
|
NET_IPV6_BINDV6ONLY=20,
|
|
NET_IPV6_IP6FRAG_HIGH_THRESH=21,
|
|
NET_IPV6_IP6FRAG_LOW_THRESH=22,
|
|
NET_IPV6_IP6FRAG_TIME=23,
|
|
NET_IPV6_IP6FRAG_SECRET_INTERVAL=24,
|
|
NET_IPV6_MLD_MAX_MSF=25,
|
|
};
|
|
|
|
enum {
|
|
NET_IPV6_ROUTE_FLUSH=1,
|
|
NET_IPV6_ROUTE_GC_THRESH=2,
|
|
NET_IPV6_ROUTE_MAX_SIZE=3,
|
|
NET_IPV6_ROUTE_GC_MIN_INTERVAL=4,
|
|
NET_IPV6_ROUTE_GC_TIMEOUT=5,
|
|
NET_IPV6_ROUTE_GC_INTERVAL=6,
|
|
NET_IPV6_ROUTE_GC_ELASTICITY=7,
|
|
NET_IPV6_ROUTE_MTU_EXPIRES=8,
|
|
NET_IPV6_ROUTE_MIN_ADVMSS=9,
|
|
NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS=10
|
|
};
|
|
|
|
enum {
|
|
NET_IPV6_FORWARDING=1,
|
|
NET_IPV6_HOP_LIMIT=2,
|
|
NET_IPV6_MTU=3,
|
|
NET_IPV6_ACCEPT_RA=4,
|
|
NET_IPV6_ACCEPT_REDIRECTS=5,
|
|
NET_IPV6_AUTOCONF=6,
|
|
NET_IPV6_DAD_TRANSMITS=7,
|
|
NET_IPV6_RTR_SOLICITS=8,
|
|
NET_IPV6_RTR_SOLICIT_INTERVAL=9,
|
|
NET_IPV6_RTR_SOLICIT_DELAY=10,
|
|
NET_IPV6_USE_TEMPADDR=11,
|
|
NET_IPV6_TEMP_VALID_LFT=12,
|
|
NET_IPV6_TEMP_PREFERED_LFT=13,
|
|
NET_IPV6_REGEN_MAX_RETRY=14,
|
|
NET_IPV6_MAX_DESYNC_FACTOR=15,
|
|
NET_IPV6_MAX_ADDRESSES=16,
|
|
NET_IPV6_FORCE_MLD_VERSION=17,
|
|
NET_IPV6_ACCEPT_RA_DEFRTR=18,
|
|
NET_IPV6_ACCEPT_RA_PINFO=19,
|
|
NET_IPV6_ACCEPT_RA_RTR_PREF=20,
|
|
NET_IPV6_RTR_PROBE_INTERVAL=21,
|
|
NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22,
|
|
NET_IPV6_PROXY_NDP=23,
|
|
NET_IPV6_ACCEPT_SOURCE_ROUTE=25,
|
|
NET_IPV6_ACCEPT_RA_FROM_LOCAL=26,
|
|
__NET_IPV6_MAX
|
|
};
|
|
|
|
|
|
enum {
|
|
NET_IPV6_ICMP_RATELIMIT=1
|
|
};
|
|
|
|
|
|
enum {
|
|
NET_NEIGH_MCAST_SOLICIT=1,
|
|
NET_NEIGH_UCAST_SOLICIT=2,
|
|
NET_NEIGH_APP_SOLICIT=3,
|
|
NET_NEIGH_RETRANS_TIME=4,
|
|
NET_NEIGH_REACHABLE_TIME=5,
|
|
NET_NEIGH_DELAY_PROBE_TIME=6,
|
|
NET_NEIGH_GC_STALE_TIME=7,
|
|
NET_NEIGH_UNRES_QLEN=8,
|
|
NET_NEIGH_PROXY_QLEN=9,
|
|
NET_NEIGH_ANYCAST_DELAY=10,
|
|
NET_NEIGH_PROXY_DELAY=11,
|
|
NET_NEIGH_LOCKTIME=12,
|
|
NET_NEIGH_GC_INTERVAL=13,
|
|
NET_NEIGH_GC_THRESH1=14,
|
|
NET_NEIGH_GC_THRESH2=15,
|
|
NET_NEIGH_GC_THRESH3=16,
|
|
NET_NEIGH_RETRANS_TIME_MS=17,
|
|
NET_NEIGH_REACHABLE_TIME_MS=18,
|
|
};
|
|
|
|
|
|
enum {
|
|
NET_DCCP_DEFAULT=1,
|
|
};
|
|
|
|
|
|
enum {
|
|
NET_IPX_PPROP_BROADCASTING=1,
|
|
NET_IPX_FORWARDING=2
|
|
};
|
|
|
|
|
|
enum {
|
|
NET_LLC2=1,
|
|
NET_LLC_STATION=2,
|
|
};
|
|
|
|
|
|
enum {
|
|
NET_LLC2_TIMEOUT=1,
|
|
};
|
|
|
|
|
|
enum {
|
|
NET_LLC_STATION_ACK_TIMEOUT=1,
|
|
};
|
|
|
|
|
|
enum {
|
|
NET_LLC2_ACK_TIMEOUT=1,
|
|
NET_LLC2_P_TIMEOUT=2,
|
|
NET_LLC2_REJ_TIMEOUT=3,
|
|
NET_LLC2_BUSY_TIMEOUT=4,
|
|
};
|
|
|
|
|
|
enum {
|
|
NET_ATALK_AARP_EXPIRY_TIME=1,
|
|
NET_ATALK_AARP_TICK_TIME=2,
|
|
NET_ATALK_AARP_RETRANSMIT_LIMIT=3,
|
|
NET_ATALK_AARP_RESOLVE_TIME=4
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
NET_NETROM_DEFAULT_PATH_QUALITY=1,
|
|
NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER=2,
|
|
NET_NETROM_NETWORK_TTL_INITIALISER=3,
|
|
NET_NETROM_TRANSPORT_TIMEOUT=4,
|
|
NET_NETROM_TRANSPORT_MAXIMUM_TRIES=5,
|
|
NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY=6,
|
|
NET_NETROM_TRANSPORT_BUSY_DELAY=7,
|
|
NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE=8,
|
|
NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT=9,
|
|
NET_NETROM_ROUTING_CONTROL=10,
|
|
NET_NETROM_LINK_FAILS_COUNT=11,
|
|
NET_NETROM_RESET=12
|
|
};
|
|
|
|
|
|
enum {
|
|
NET_AX25_IP_DEFAULT_MODE=1,
|
|
NET_AX25_DEFAULT_MODE=2,
|
|
NET_AX25_BACKOFF_TYPE=3,
|
|
NET_AX25_CONNECT_MODE=4,
|
|
NET_AX25_STANDARD_WINDOW=5,
|
|
NET_AX25_EXTENDED_WINDOW=6,
|
|
NET_AX25_T1_TIMEOUT=7,
|
|
NET_AX25_T2_TIMEOUT=8,
|
|
NET_AX25_T3_TIMEOUT=9,
|
|
NET_AX25_IDLE_TIMEOUT=10,
|
|
NET_AX25_N2=11,
|
|
NET_AX25_PACLEN=12,
|
|
NET_AX25_PROTOCOL=13,
|
|
NET_AX25_DAMA_SLAVE_TIMEOUT=14
|
|
};
|
|
|
|
|
|
enum {
|
|
NET_ROSE_RESTART_REQUEST_TIMEOUT=1,
|
|
NET_ROSE_CALL_REQUEST_TIMEOUT=2,
|
|
NET_ROSE_RESET_REQUEST_TIMEOUT=3,
|
|
NET_ROSE_CLEAR_REQUEST_TIMEOUT=4,
|
|
NET_ROSE_ACK_HOLD_BACK_TIMEOUT=5,
|
|
NET_ROSE_ROUTING_CONTROL=6,
|
|
NET_ROSE_LINK_FAIL_TIMEOUT=7,
|
|
NET_ROSE_MAX_VCS=8,
|
|
NET_ROSE_WINDOW_SIZE=9,
|
|
NET_ROSE_NO_ACTIVITY_TIMEOUT=10
|
|
};
|
|
|
|
|
|
enum {
|
|
NET_X25_RESTART_REQUEST_TIMEOUT=1,
|
|
NET_X25_CALL_REQUEST_TIMEOUT=2,
|
|
NET_X25_RESET_REQUEST_TIMEOUT=3,
|
|
NET_X25_CLEAR_REQUEST_TIMEOUT=4,
|
|
NET_X25_ACK_HOLD_BACK_TIMEOUT=5,
|
|
NET_X25_FORWARD=6
|
|
};
|
|
|
|
|
|
enum
|
|
{
|
|
NET_TR_RIF_TIMEOUT=1
|
|
};
|
|
|
|
|
|
enum {
|
|
NET_DECNET_NODE_TYPE = 1,
|
|
NET_DECNET_NODE_ADDRESS = 2,
|
|
NET_DECNET_NODE_NAME = 3,
|
|
NET_DECNET_DEFAULT_DEVICE = 4,
|
|
NET_DECNET_TIME_WAIT = 5,
|
|
NET_DECNET_DN_COUNT = 6,
|
|
NET_DECNET_DI_COUNT = 7,
|
|
NET_DECNET_DR_COUNT = 8,
|
|
NET_DECNET_DST_GC_INTERVAL = 9,
|
|
NET_DECNET_CONF = 10,
|
|
NET_DECNET_NO_FC_MAX_CWND = 11,
|
|
NET_DECNET_MEM = 12,
|
|
NET_DECNET_RMEM = 13,
|
|
NET_DECNET_WMEM = 14,
|
|
NET_DECNET_DEBUG_LEVEL = 255
|
|
};
|
|
|
|
|
|
enum {
|
|
NET_DECNET_CONF_LOOPBACK = -2,
|
|
NET_DECNET_CONF_DDCMP = -3,
|
|
NET_DECNET_CONF_PPP = -4,
|
|
NET_DECNET_CONF_X25 = -5,
|
|
NET_DECNET_CONF_GRE = -6,
|
|
NET_DECNET_CONF_ETHER = -7
|
|
|
|
|
|
};
|
|
|
|
|
|
enum {
|
|
NET_DECNET_CONF_DEV_PRIORITY = 1,
|
|
NET_DECNET_CONF_DEV_T1 = 2,
|
|
NET_DECNET_CONF_DEV_T2 = 3,
|
|
NET_DECNET_CONF_DEV_T3 = 4,
|
|
NET_DECNET_CONF_DEV_FORWARDING = 5,
|
|
NET_DECNET_CONF_DEV_BLKSIZE = 6,
|
|
NET_DECNET_CONF_DEV_STATE = 7
|
|
};
|
|
|
|
|
|
enum {
|
|
NET_SCTP_RTO_INITIAL = 1,
|
|
NET_SCTP_RTO_MIN = 2,
|
|
NET_SCTP_RTO_MAX = 3,
|
|
NET_SCTP_RTO_ALPHA = 4,
|
|
NET_SCTP_RTO_BETA = 5,
|
|
NET_SCTP_VALID_COOKIE_LIFE = 6,
|
|
NET_SCTP_ASSOCIATION_MAX_RETRANS = 7,
|
|
NET_SCTP_PATH_MAX_RETRANS = 8,
|
|
NET_SCTP_MAX_INIT_RETRANSMITS = 9,
|
|
NET_SCTP_HB_INTERVAL = 10,
|
|
NET_SCTP_PRESERVE_ENABLE = 11,
|
|
NET_SCTP_MAX_BURST = 12,
|
|
NET_SCTP_ADDIP_ENABLE = 13,
|
|
NET_SCTP_PRSCTP_ENABLE = 14,
|
|
NET_SCTP_SNDBUF_POLICY = 15,
|
|
NET_SCTP_SACK_TIMEOUT = 16,
|
|
NET_SCTP_RCVBUF_POLICY = 17,
|
|
};
|
|
|
|
|
|
enum {
|
|
NET_BRIDGE_NF_CALL_ARPTABLES = 1,
|
|
NET_BRIDGE_NF_CALL_IPTABLES = 2,
|
|
NET_BRIDGE_NF_CALL_IP6TABLES = 3,
|
|
NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4,
|
|
NET_BRIDGE_NF_FILTER_PPPOE_TAGGED = 5,
|
|
};
|
|
|
|
|
|
enum {
|
|
NET_IRDA_DISCOVERY=1,
|
|
NET_IRDA_DEVNAME=2,
|
|
NET_IRDA_DEBUG=3,
|
|
NET_IRDA_FAST_POLL=4,
|
|
NET_IRDA_DISCOVERY_SLOTS=5,
|
|
NET_IRDA_DISCOVERY_TIMEOUT=6,
|
|
NET_IRDA_SLOT_TIMEOUT=7,
|
|
NET_IRDA_MAX_BAUD_RATE=8,
|
|
NET_IRDA_MIN_TX_TURN_TIME=9,
|
|
NET_IRDA_MAX_TX_DATA_SIZE=10,
|
|
NET_IRDA_MAX_TX_WINDOW=11,
|
|
NET_IRDA_MAX_NOREPLY_TIME=12,
|
|
NET_IRDA_WARN_NOREPLY_TIME=13,
|
|
NET_IRDA_LAP_KEEPALIVE_TIME=14,
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
{
|
|
FS_NRINODE=1,
|
|
FS_STATINODE=2,
|
|
FS_MAXINODE=3,
|
|
FS_NRDQUOT=4,
|
|
FS_MAXDQUOT=5,
|
|
FS_NRFILE=6,
|
|
FS_MAXFILE=7,
|
|
FS_DENTRY=8,
|
|
FS_NRSUPER=9,
|
|
FS_MAXSUPER=10,
|
|
FS_OVERFLOWUID=11,
|
|
FS_OVERFLOWGID=12,
|
|
FS_LEASES=13,
|
|
FS_DIR_NOTIFY=14,
|
|
FS_LEASE_TIME=15,
|
|
FS_DQSTATS=16,
|
|
FS_XFS=17,
|
|
FS_AIO_NR=18,
|
|
FS_AIO_MAX_NR=19,
|
|
FS_INOTIFY=20,
|
|
FS_OCFS2=988,
|
|
};
|
|
|
|
|
|
enum {
|
|
FS_DQ_LOOKUPS = 1,
|
|
FS_DQ_DROPS = 2,
|
|
FS_DQ_READS = 3,
|
|
FS_DQ_WRITES = 4,
|
|
FS_DQ_CACHE_HITS = 5,
|
|
FS_DQ_ALLOCATED = 6,
|
|
FS_DQ_FREE = 7,
|
|
FS_DQ_SYNCS = 8,
|
|
FS_DQ_WARNINGS = 9,
|
|
};
|
|
|
|
|
|
|
|
|
|
enum {
|
|
DEV_CDROM=1,
|
|
DEV_HWMON=2,
|
|
DEV_PARPORT=3,
|
|
DEV_RAID=4,
|
|
DEV_MAC_HID=5,
|
|
DEV_SCSI=6,
|
|
DEV_IPMI=7,
|
|
};
|
|
|
|
|
|
enum {
|
|
DEV_CDROM_INFO=1,
|
|
DEV_CDROM_AUTOCLOSE=2,
|
|
DEV_CDROM_AUTOEJECT=3,
|
|
DEV_CDROM_DEBUG=4,
|
|
DEV_CDROM_LOCK=5,
|
|
DEV_CDROM_CHECK_MEDIA=6
|
|
};
|
|
|
|
|
|
enum {
|
|
DEV_PARPORT_DEFAULT=-3
|
|
};
|
|
|
|
|
|
enum {
|
|
DEV_RAID_SPEED_LIMIT_MIN=1,
|
|
DEV_RAID_SPEED_LIMIT_MAX=2
|
|
};
|
|
|
|
|
|
enum {
|
|
DEV_PARPORT_DEFAULT_TIMESLICE=1,
|
|
DEV_PARPORT_DEFAULT_SPINTIME=2
|
|
};
|
|
|
|
|
|
enum {
|
|
DEV_PARPORT_SPINTIME=1,
|
|
DEV_PARPORT_BASE_ADDR=2,
|
|
DEV_PARPORT_IRQ=3,
|
|
DEV_PARPORT_DMA=4,
|
|
DEV_PARPORT_MODES=5,
|
|
DEV_PARPORT_DEVICES=6,
|
|
DEV_PARPORT_AUTOPROBE=16
|
|
};
|
|
|
|
|
|
enum {
|
|
DEV_PARPORT_DEVICES_ACTIVE=-3,
|
|
};
|
|
|
|
|
|
enum {
|
|
DEV_PARPORT_DEVICE_TIMESLICE=1,
|
|
};
|
|
|
|
|
|
enum {
|
|
DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES=1,
|
|
DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES=2,
|
|
DEV_MAC_HID_MOUSE_BUTTON_EMULATION=3,
|
|
DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=4,
|
|
DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=5,
|
|
DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=6
|
|
};
|
|
|
|
|
|
enum {
|
|
DEV_SCSI_LOGGING_LEVEL=1,
|
|
};
|
|
|
|
|
|
enum {
|
|
DEV_IPMI_POWEROFF_POWERCYCLE=1,
|
|
};
|
|
|
|
|
|
enum
|
|
{
|
|
ABI_DEFHANDLER_COFF=1,
|
|
ABI_DEFHANDLER_ELF=2,
|
|
ABI_DEFHANDLER_LCALL7=3,
|
|
ABI_DEFHANDLER_LIBCSO=4,
|
|
ABI_TRACE=5,
|
|
ABI_FAKE_UTSNAME=6,
|
|
};
|
|
# 29 "include/linux/sysctl.h" 2
|
|
|
|
|
|
struct ctl_table;
|
|
struct nsproxy;
|
|
struct ctl_table_root;
|
|
struct ctl_table_header;
|
|
struct ctl_dir;
|
|
|
|
typedef int proc_handler (struct ctl_table *ctl, int write,
|
|
void *buffer, size_t *lenp, loff_t *ppos);
|
|
|
|
extern int proc_dostring(struct ctl_table *, int,
|
|
void *, size_t *, loff_t *);
|
|
extern int proc_dointvec(struct ctl_table *, int,
|
|
void *, size_t *, loff_t *);
|
|
extern int proc_douintvec(struct ctl_table *, int,
|
|
void *, size_t *, loff_t *);
|
|
extern int proc_dointvec_minmax(struct ctl_table *, int,
|
|
void *, size_t *, loff_t *);
|
|
extern int proc_dointvec_jiffies(struct ctl_table *, int,
|
|
void *, size_t *, loff_t *);
|
|
extern int proc_dointvec_userhz_jiffies(struct ctl_table *, int,
|
|
void *, size_t *, loff_t *);
|
|
extern int proc_dointvec_ms_jiffies(struct ctl_table *, int,
|
|
void *, size_t *, loff_t *);
|
|
extern int proc_doulongvec_minmax(struct ctl_table *, int,
|
|
void *, size_t *, loff_t *);
|
|
extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int,
|
|
void *, size_t *, loff_t *);
|
|
extern int proc_do_large_bitmap(struct ctl_table *, int,
|
|
void *, size_t *, loff_t *);
|
|
# 89 "include/linux/sysctl.h"
|
|
struct ctl_table_poll {
|
|
atomic_t event;
|
|
wait_queue_head_t wait;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *proc_sys_poll_event(struct ctl_table_poll *poll)
|
|
{
|
|
return (void *)(unsigned long)({ union { typeof((&poll->event)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&poll->event)->counter), __u.__c, sizeof((&poll->event)->counter)); else __read_once_size_nocheck(&((&poll->event)->counter), __u.__c, sizeof((&poll->event)->counter)); __u.__val; });
|
|
}
|
|
# 107 "include/linux/sysctl.h"
|
|
struct ctl_table
|
|
{
|
|
const char *procname;
|
|
void *data;
|
|
int maxlen;
|
|
umode_t mode;
|
|
struct ctl_table *child;
|
|
proc_handler *proc_handler;
|
|
struct ctl_table_poll *poll;
|
|
void *extra1;
|
|
void *extra2;
|
|
};
|
|
|
|
struct ctl_node {
|
|
struct rb_node node;
|
|
struct ctl_table_header *header;
|
|
};
|
|
|
|
|
|
|
|
struct ctl_table_header
|
|
{
|
|
union {
|
|
struct {
|
|
struct ctl_table *ctl_table;
|
|
int used;
|
|
int count;
|
|
int nreg;
|
|
};
|
|
struct callback_head rcu;
|
|
};
|
|
struct completion *unregistering;
|
|
struct ctl_table *ctl_table_arg;
|
|
struct ctl_table_root *root;
|
|
struct ctl_table_set *set;
|
|
struct ctl_dir *parent;
|
|
struct ctl_node *node;
|
|
};
|
|
|
|
struct ctl_dir {
|
|
|
|
struct ctl_table_header header;
|
|
struct rb_root root;
|
|
};
|
|
|
|
struct ctl_table_set {
|
|
int (*is_seen)(struct ctl_table_set *);
|
|
struct ctl_dir dir;
|
|
};
|
|
|
|
struct ctl_table_root {
|
|
struct ctl_table_set default_set;
|
|
struct ctl_table_set *(*lookup)(struct ctl_table_root *root,
|
|
struct nsproxy *namespaces);
|
|
int (*permissions)(struct ctl_table_header *head, struct ctl_table *table);
|
|
};
|
|
|
|
|
|
struct ctl_path {
|
|
const char *procname;
|
|
};
|
|
|
|
|
|
|
|
void proc_sys_poll_notify(struct ctl_table_poll *poll);
|
|
|
|
extern void setup_sysctl_set(struct ctl_table_set *p,
|
|
struct ctl_table_root *root,
|
|
int (*is_seen)(struct ctl_table_set *));
|
|
extern void retire_sysctl_set(struct ctl_table_set *set);
|
|
|
|
void register_sysctl_root(struct ctl_table_root *root);
|
|
struct ctl_table_header *__register_sysctl_table(
|
|
struct ctl_table_set *set,
|
|
const char *path, struct ctl_table *table);
|
|
struct ctl_table_header *__register_sysctl_paths(
|
|
struct ctl_table_set *set,
|
|
const struct ctl_path *path, struct ctl_table *table);
|
|
struct ctl_table_header *register_sysctl(const char *path, struct ctl_table *table);
|
|
struct ctl_table_header *register_sysctl_table(struct ctl_table * table);
|
|
struct ctl_table_header *register_sysctl_paths(const struct ctl_path *path,
|
|
struct ctl_table *table);
|
|
|
|
void unregister_sysctl_table(struct ctl_table_header * table);
|
|
|
|
extern int sysctl_init(void);
|
|
|
|
extern struct ctl_table sysctl_mount_point[];
|
|
# 220 "include/linux/sysctl.h"
|
|
int sysctl_max_threads(struct ctl_table *table, int write,
|
|
void *buffer, size_t *lenp, loff_t *ppos);
|
|
# 243 "include/linux/timer.h" 2
|
|
|
|
extern unsigned int sysctl_timer_migration;
|
|
int timer_migration_handler(struct ctl_table *table, int write,
|
|
void *buffer, size_t *lenp,
|
|
loff_t *ppos);
|
|
|
|
|
|
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);
|
|
# 9 "include/linux/workqueue.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct workqueue_struct;
|
|
|
|
struct work_struct;
|
|
typedef void (*work_func_t)(struct work_struct *work);
|
|
void delayed_work_timer_fn(unsigned long __data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
WORK_STRUCT_PENDING_BIT = 0,
|
|
WORK_STRUCT_DELAYED_BIT = 1,
|
|
WORK_STRUCT_PWQ_BIT = 2,
|
|
WORK_STRUCT_LINKED_BIT = 3,
|
|
|
|
|
|
|
|
|
|
WORK_STRUCT_COLOR_SHIFT = 4,
|
|
|
|
|
|
WORK_STRUCT_COLOR_BITS = 4,
|
|
|
|
WORK_STRUCT_PENDING = 1 << WORK_STRUCT_PENDING_BIT,
|
|
WORK_STRUCT_DELAYED = 1 << WORK_STRUCT_DELAYED_BIT,
|
|
WORK_STRUCT_PWQ = 1 << WORK_STRUCT_PWQ_BIT,
|
|
WORK_STRUCT_LINKED = 1 << WORK_STRUCT_LINKED_BIT,
|
|
|
|
|
|
|
|
WORK_STRUCT_STATIC = 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WORK_NR_COLORS = (1 << WORK_STRUCT_COLOR_BITS) - 1,
|
|
WORK_NO_COLOR = WORK_NR_COLORS,
|
|
|
|
|
|
WORK_CPU_UNBOUND = 2,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WORK_STRUCT_FLAG_BITS = WORK_STRUCT_COLOR_SHIFT +
|
|
WORK_STRUCT_COLOR_BITS,
|
|
|
|
|
|
WORK_OFFQ_FLAG_BASE = WORK_STRUCT_COLOR_SHIFT,
|
|
|
|
__WORK_OFFQ_CANCELING = WORK_OFFQ_FLAG_BASE,
|
|
WORK_OFFQ_CANCELING = (1 << __WORK_OFFQ_CANCELING),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WORK_OFFQ_FLAG_BITS = 1,
|
|
WORK_OFFQ_POOL_SHIFT = WORK_OFFQ_FLAG_BASE + WORK_OFFQ_FLAG_BITS,
|
|
WORK_OFFQ_LEFT = 32 - WORK_OFFQ_POOL_SHIFT,
|
|
WORK_OFFQ_POOL_BITS = WORK_OFFQ_LEFT <= 31 ? WORK_OFFQ_LEFT : 31,
|
|
WORK_OFFQ_POOL_NONE = (1LU << WORK_OFFQ_POOL_BITS) - 1,
|
|
|
|
|
|
WORK_STRUCT_FLAG_MASK = (1UL << WORK_STRUCT_FLAG_BITS) - 1,
|
|
WORK_STRUCT_WQ_DATA_MASK = ~WORK_STRUCT_FLAG_MASK,
|
|
WORK_STRUCT_NO_POOL = (unsigned long)WORK_OFFQ_POOL_NONE << WORK_OFFQ_POOL_SHIFT,
|
|
|
|
|
|
WORK_BUSY_PENDING = 1 << 0,
|
|
WORK_BUSY_RUNNING = 1 << 1,
|
|
|
|
|
|
WORKER_DESC_LEN = 24,
|
|
};
|
|
|
|
struct work_struct {
|
|
atomic_long_t data;
|
|
struct list_head entry;
|
|
work_func_t func;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct delayed_work {
|
|
struct work_struct work;
|
|
struct timer_list timer;
|
|
|
|
|
|
struct workqueue_struct *wq;
|
|
int cpu;
|
|
};
|
|
# 130 "include/linux/workqueue.h"
|
|
struct workqueue_attrs {
|
|
int nice;
|
|
cpumask_var_t cpumask;
|
|
bool no_numa;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct delayed_work *to_delayed_work(struct work_struct *work)
|
|
{
|
|
return ({ const typeof( ((struct delayed_work *)0)->work ) *__mptr = (work); (struct delayed_work *)( (char *)__mptr - __builtin_offsetof(struct delayed_work, work) );});
|
|
}
|
|
|
|
struct execute_work {
|
|
struct work_struct work;
|
|
};
|
|
# 189 "include/linux/workqueue.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __init_work(struct work_struct *work, int onstack) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void destroy_work_on_stack(struct work_struct *work) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void destroy_delayed_work_on_stack(struct delayed_work *work) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int work_static(struct work_struct *work) { return 0; }
|
|
# 277 "include/linux/workqueue.h"
|
|
enum {
|
|
WQ_UNBOUND = 1 << 1,
|
|
WQ_FREEZABLE = 1 << 2,
|
|
WQ_MEM_RECLAIM = 1 << 3,
|
|
WQ_HIGHPRI = 1 << 4,
|
|
WQ_CPU_INTENSIVE = 1 << 5,
|
|
WQ_SYSFS = 1 << 6,
|
|
# 310 "include/linux/workqueue.h"
|
|
WQ_POWER_EFFICIENT = 1 << 7,
|
|
|
|
__WQ_DRAINING = 1 << 16,
|
|
__WQ_ORDERED = 1 << 17,
|
|
__WQ_ORDERED_EXPLICIT = 1 << 19,
|
|
|
|
WQ_MAX_ACTIVE = 512,
|
|
WQ_MAX_UNBOUND_PER_CPU = 4,
|
|
WQ_DFL_ACTIVE = WQ_MAX_ACTIVE / 2,
|
|
};
|
|
# 353 "include/linux/workqueue.h"
|
|
extern struct workqueue_struct *system_wq;
|
|
extern struct workqueue_struct *system_highpri_wq;
|
|
extern struct workqueue_struct *system_long_wq;
|
|
extern struct workqueue_struct *system_unbound_wq;
|
|
extern struct workqueue_struct *system_freezable_wq;
|
|
extern struct workqueue_struct *system_power_efficient_wq;
|
|
extern struct workqueue_struct *system_freezable_power_efficient_wq;
|
|
|
|
extern struct workqueue_struct *
|
|
__alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active,
|
|
struct lock_class_key *key, const char *lock_name, ...) __attribute__((format(printf, 1, 6)));
|
|
# 423 "include/linux/workqueue.h"
|
|
extern void destroy_workqueue(struct workqueue_struct *wq);
|
|
|
|
struct workqueue_attrs *alloc_workqueue_attrs(gfp_t gfp_mask);
|
|
void free_workqueue_attrs(struct workqueue_attrs *attrs);
|
|
int apply_workqueue_attrs(struct workqueue_struct *wq,
|
|
const struct workqueue_attrs *attrs);
|
|
int workqueue_set_unbound_cpumask(cpumask_var_t cpumask);
|
|
|
|
extern bool queue_work_on(int cpu, struct workqueue_struct *wq,
|
|
struct work_struct *work);
|
|
extern bool queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
|
|
struct delayed_work *work, unsigned long delay);
|
|
extern bool mod_delayed_work_on(int cpu, struct workqueue_struct *wq,
|
|
struct delayed_work *dwork, unsigned long delay);
|
|
|
|
extern void flush_workqueue(struct workqueue_struct *wq);
|
|
extern void drain_workqueue(struct workqueue_struct *wq);
|
|
|
|
extern int schedule_on_each_cpu(work_func_t func);
|
|
|
|
int execute_in_process_context(work_func_t fn, struct execute_work *);
|
|
|
|
extern bool flush_work(struct work_struct *work);
|
|
extern bool cancel_work_sync(struct work_struct *work);
|
|
|
|
extern bool flush_delayed_work(struct delayed_work *dwork);
|
|
extern bool cancel_delayed_work(struct delayed_work *dwork);
|
|
extern bool cancel_delayed_work_sync(struct delayed_work *dwork);
|
|
|
|
extern void workqueue_set_max_active(struct workqueue_struct *wq,
|
|
int max_active);
|
|
extern struct work_struct *current_work(void);
|
|
extern bool current_is_workqueue_rescuer(void);
|
|
extern bool workqueue_congested(int cpu, struct workqueue_struct *wq);
|
|
extern unsigned int work_busy(struct work_struct *work);
|
|
extern __attribute__((format(printf, 1, 2))) void set_worker_desc(const char *fmt, ...);
|
|
extern void print_worker_info(const char *log_lvl, struct task_struct *task);
|
|
extern void show_workqueue_state(void);
|
|
# 472 "include/linux/workqueue.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool queue_work(struct workqueue_struct *wq,
|
|
struct work_struct *work)
|
|
{
|
|
return queue_work_on(WORK_CPU_UNBOUND, wq, work);
|
|
}
|
|
# 486 "include/linux/workqueue.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool queue_delayed_work(struct workqueue_struct *wq,
|
|
struct delayed_work *dwork,
|
|
unsigned long delay)
|
|
{
|
|
return queue_delayed_work_on(WORK_CPU_UNBOUND, wq, dwork, delay);
|
|
}
|
|
# 501 "include/linux/workqueue.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool mod_delayed_work(struct workqueue_struct *wq,
|
|
struct delayed_work *dwork,
|
|
unsigned long delay)
|
|
{
|
|
return mod_delayed_work_on(WORK_CPU_UNBOUND, wq, dwork, delay);
|
|
}
|
|
# 515 "include/linux/workqueue.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool schedule_work_on(int cpu, struct work_struct *work)
|
|
{
|
|
return queue_work_on(cpu, system_wq, work);
|
|
}
|
|
# 531 "include/linux/workqueue.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool schedule_work(struct work_struct *work)
|
|
{
|
|
return queue_work(system_wq, work);
|
|
}
|
|
# 560 "include/linux/workqueue.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void flush_scheduled_work(void)
|
|
{
|
|
flush_workqueue(system_wq);
|
|
}
|
|
# 574 "include/linux/workqueue.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool schedule_delayed_work_on(int cpu, struct delayed_work *dwork,
|
|
unsigned long delay)
|
|
{
|
|
return queue_delayed_work_on(cpu, system_wq, dwork, delay);
|
|
}
|
|
# 588 "include/linux/workqueue.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool schedule_delayed_work(struct delayed_work *dwork,
|
|
unsigned long delay)
|
|
{
|
|
return queue_delayed_work(system_wq, dwork, delay);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool keventd_up(void)
|
|
{
|
|
return system_wq != ((void *)0);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
long work_on_cpu(int cpu, long (*fn)(void *), void *arg);
|
|
|
|
|
|
|
|
extern void freeze_workqueues_begin(void);
|
|
extern bool freeze_workqueues_busy(void);
|
|
extern void thaw_workqueues(void);
|
|
|
|
|
|
|
|
int workqueue_sysfs_register(struct workqueue_struct *wq);
|
|
# 35 "include/linux/srcu.h" 2
|
|
|
|
struct srcu_struct_array {
|
|
unsigned long c[2];
|
|
unsigned long seq[2];
|
|
};
|
|
|
|
struct rcu_batch {
|
|
struct callback_head *head, **tail;
|
|
};
|
|
|
|
|
|
|
|
struct srcu_struct {
|
|
unsigned long completed;
|
|
struct srcu_struct_array *per_cpu_ref;
|
|
spinlock_t queue_lock;
|
|
bool running;
|
|
|
|
struct rcu_batch batch_queue;
|
|
|
|
struct rcu_batch batch_check0;
|
|
|
|
struct rcu_batch batch_check1;
|
|
struct rcu_batch batch_done;
|
|
struct delayed_work work;
|
|
|
|
|
|
|
|
};
|
|
# 80 "include/linux/srcu.h"
|
|
int init_srcu_struct(struct srcu_struct *sp);
|
|
|
|
|
|
|
|
|
|
void process_srcu(struct work_struct *work);
|
|
# 128 "include/linux/srcu.h"
|
|
void call_srcu(struct srcu_struct *sp, struct callback_head *head,
|
|
void (*func)(struct callback_head *head));
|
|
|
|
void cleanup_srcu_struct(struct srcu_struct *sp);
|
|
int __srcu_read_lock(struct srcu_struct *sp) ;
|
|
void __srcu_read_unlock(struct srcu_struct *sp, int idx) ;
|
|
void synchronize_srcu(struct srcu_struct *sp);
|
|
void synchronize_srcu_expedited(struct srcu_struct *sp);
|
|
unsigned long srcu_batches_completed(struct srcu_struct *sp);
|
|
void srcu_barrier(struct srcu_struct *sp);
|
|
# 165 "include/linux/srcu.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int srcu_read_lock_held(struct srcu_struct *sp)
|
|
{
|
|
return 1;
|
|
}
|
|
# 216 "include/linux/srcu.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int srcu_read_lock(struct srcu_struct *sp)
|
|
{
|
|
int retval;
|
|
|
|
__asm__ __volatile__("": : :"memory");
|
|
retval = __srcu_read_lock(sp);
|
|
__asm__ __volatile__("": : :"memory");
|
|
do { } while (0);
|
|
return retval;
|
|
}
|
|
# 234 "include/linux/srcu.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void srcu_read_unlock(struct srcu_struct *sp, int idx)
|
|
|
|
{
|
|
do { } while (0);
|
|
__srcu_read_unlock(sp, idx);
|
|
}
|
|
# 250 "include/linux/srcu.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void smp_mb__after_srcu_read_unlock(void)
|
|
{
|
|
|
|
}
|
|
# 16 "include/linux/notifier.h" 2
|
|
# 50 "include/linux/notifier.h"
|
|
typedef int (*notifier_fn_t)(struct notifier_block *nb,
|
|
unsigned long action, void *data);
|
|
|
|
struct notifier_block {
|
|
notifier_fn_t notifier_call;
|
|
struct notifier_block *next;
|
|
int priority;
|
|
};
|
|
|
|
struct atomic_notifier_head {
|
|
spinlock_t lock;
|
|
struct notifier_block *head;
|
|
};
|
|
|
|
struct blocking_notifier_head {
|
|
struct rw_semaphore rwsem;
|
|
struct notifier_block *head;
|
|
};
|
|
|
|
struct raw_notifier_head {
|
|
struct notifier_block *head;
|
|
};
|
|
|
|
struct srcu_notifier_head {
|
|
struct mutex mutex;
|
|
struct srcu_struct srcu;
|
|
struct notifier_block *head;
|
|
};
|
|
# 92 "include/linux/notifier.h"
|
|
extern void srcu_init_notifier_head(struct srcu_notifier_head *nh);
|
|
# 118 "include/linux/notifier.h"
|
|
extern int atomic_notifier_chain_register(struct atomic_notifier_head *nh,
|
|
struct notifier_block *nb);
|
|
extern int blocking_notifier_chain_register(struct blocking_notifier_head *nh,
|
|
struct notifier_block *nb);
|
|
extern int raw_notifier_chain_register(struct raw_notifier_head *nh,
|
|
struct notifier_block *nb);
|
|
extern int srcu_notifier_chain_register(struct srcu_notifier_head *nh,
|
|
struct notifier_block *nb);
|
|
|
|
extern int blocking_notifier_chain_cond_register(
|
|
struct blocking_notifier_head *nh,
|
|
struct notifier_block *nb);
|
|
|
|
extern int atomic_notifier_chain_unregister(struct atomic_notifier_head *nh,
|
|
struct notifier_block *nb);
|
|
extern int blocking_notifier_chain_unregister(struct blocking_notifier_head *nh,
|
|
struct notifier_block *nb);
|
|
extern int raw_notifier_chain_unregister(struct raw_notifier_head *nh,
|
|
struct notifier_block *nb);
|
|
extern int srcu_notifier_chain_unregister(struct srcu_notifier_head *nh,
|
|
struct notifier_block *nb);
|
|
|
|
extern int atomic_notifier_call_chain(struct atomic_notifier_head *nh,
|
|
unsigned long val, void *v);
|
|
extern int __atomic_notifier_call_chain(struct atomic_notifier_head *nh,
|
|
unsigned long val, void *v, int nr_to_call, int *nr_calls);
|
|
extern int blocking_notifier_call_chain(struct blocking_notifier_head *nh,
|
|
unsigned long val, void *v);
|
|
extern int __blocking_notifier_call_chain(struct blocking_notifier_head *nh,
|
|
unsigned long val, void *v, int nr_to_call, int *nr_calls);
|
|
extern int raw_notifier_call_chain(struct raw_notifier_head *nh,
|
|
unsigned long val, void *v);
|
|
extern int __raw_notifier_call_chain(struct raw_notifier_head *nh,
|
|
unsigned long val, void *v, int nr_to_call, int *nr_calls);
|
|
extern int srcu_notifier_call_chain(struct srcu_notifier_head *nh,
|
|
unsigned long val, void *v);
|
|
extern int __srcu_notifier_call_chain(struct srcu_notifier_head *nh,
|
|
unsigned long val, void *v, int nr_to_call, int *nr_calls);
|
|
# 168 "include/linux/notifier.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int notifier_from_errno(int err)
|
|
{
|
|
if (err)
|
|
return 0x8000 | (0x0001 - err);
|
|
|
|
return 0x0001;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int notifier_to_errno(int ret)
|
|
{
|
|
ret &= ~0x8000;
|
|
return ret > 0x0001 ? 0x0001 - ret : 0;
|
|
}
|
|
# 212 "include/linux/notifier.h"
|
|
extern struct blocking_notifier_head reboot_notifier_list;
|
|
# 7 "include/linux/memory_hotplug.h" 2
|
|
|
|
|
|
struct page;
|
|
struct zone;
|
|
struct pglist_data;
|
|
struct mem_section;
|
|
struct memory_block;
|
|
struct resource;
|
|
# 204 "include/linux/memory_hotplug.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgdat_resize_lock(struct pglist_data *p, unsigned long *f) {}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgdat_resize_unlock(struct pglist_data *p, unsigned long *f) {}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgdat_resize_init(struct pglist_data *pgdat) {}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned zone_span_seqbegin(struct zone *zone)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int zone_span_seqretry(struct zone *zone, unsigned iv)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void zone_span_writelock(struct zone *zone) {}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void zone_span_writeunlock(struct zone *zone) {}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void zone_seqlock_init(struct zone *zone) {}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mhp_notimplemented(const char *func)
|
|
{
|
|
printk("\001" "4" "%s() called, with CONFIG_MEMORY_HOTPLUG disabled\n", func);
|
|
dump_stack();
|
|
return -38;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void register_page_bootmem_info_node(struct pglist_data *pgdat)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int try_online_node(int nid)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void get_online_mems(void) {}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_online_mems(void) {}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mem_hotplug_begin(void) {}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mem_hotplug_done(void) {}
|
|
# 252 "include/linux/memory_hotplug.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_mem_section_removable(unsigned long pfn,
|
|
unsigned long nr_pages)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void try_offline_node(int nid) {}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int offline_pages(unsigned long start_pfn, unsigned long nr_pages)
|
|
{
|
|
return -22;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void remove_memory(int nid, u64 start, u64 size) {}
|
|
|
|
|
|
extern int walk_memory_range(unsigned long start_pfn, unsigned long end_pfn,
|
|
void *arg, int (*func)(struct memory_block *, void *));
|
|
extern int add_memory(int nid, u64 start, u64 size);
|
|
extern int add_memory_resource(int nid, struct resource *resource);
|
|
extern int zone_for_memory(int nid, u64 start, u64 size, int zone_default,
|
|
bool for_device);
|
|
extern int arch_add_memory(int nid, u64 start, u64 size, bool for_device);
|
|
extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages);
|
|
extern bool is_memblock_offlined(struct memory_block *mem);
|
|
extern void remove_memory(int nid, u64 start, u64 size);
|
|
extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn);
|
|
extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms);
|
|
extern struct page *sparse_decode_mem_map(unsigned long coded_mem_map,
|
|
unsigned long pnum);
|
|
# 739 "include/linux/mmzone.h" 2
|
|
|
|
extern struct mutex zonelists_mutex;
|
|
void build_all_zonelists(pg_data_t *pgdat, struct zone *zone);
|
|
void wakeup_kswapd(struct zone *zone, int order, enum zone_type classzone_idx);
|
|
bool zone_watermark_ok(struct zone *z, unsigned int order,
|
|
unsigned long mark, int classzone_idx, int alloc_flags);
|
|
bool zone_watermark_ok_safe(struct zone *z, unsigned int order,
|
|
unsigned long mark, int classzone_idx);
|
|
enum memmap_context {
|
|
MEMMAP_EARLY,
|
|
MEMMAP_HOTPLUG,
|
|
};
|
|
extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn,
|
|
unsigned long size);
|
|
|
|
extern void lruvec_init(struct lruvec *lruvec);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct zone *lruvec_zone(struct lruvec *lruvec)
|
|
{
|
|
|
|
|
|
|
|
return ({ const typeof( ((struct zone *)0)->lruvec ) *__mptr = (lruvec); (struct zone *)( (char *)__mptr - __builtin_offsetof(struct zone, lruvec) );});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void memory_present(int nid, unsigned long start, unsigned long end) {}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int local_memory_node(int node_id) { return node_id; };
|
|
# 786 "include/linux/mmzone.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int populated_zone(struct zone *zone)
|
|
{
|
|
return (!!zone->present_pages);
|
|
}
|
|
|
|
extern int movable_zone;
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int zone_movable_is_highmem(void)
|
|
{
|
|
|
|
|
|
|
|
return (ZONE_MOVABLE - 1) == ZONE_HIGHMEM;
|
|
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_highmem_idx(enum zone_type idx)
|
|
{
|
|
|
|
return (idx == ZONE_HIGHMEM ||
|
|
(idx == ZONE_MOVABLE && zone_movable_is_highmem()));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_highmem(struct zone *zone)
|
|
{
|
|
|
|
int zone_off = (char *)zone - (char *)zone->zone_pgdat->node_zones;
|
|
return zone_off == ZONE_HIGHMEM * sizeof(*zone) ||
|
|
(zone_off == ZONE_MOVABLE * sizeof(*zone) &&
|
|
zone_movable_is_highmem());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
struct ctl_table;
|
|
int min_free_kbytes_sysctl_handler(struct ctl_table *, int,
|
|
void *, size_t *, loff_t *);
|
|
extern int sysctl_lowmem_reserve_ratio[3 -1];
|
|
int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int,
|
|
void *, size_t *, loff_t *);
|
|
int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int,
|
|
void *, size_t *, loff_t *);
|
|
int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int,
|
|
void *, size_t *, loff_t *);
|
|
int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int,
|
|
void *, size_t *, loff_t *);
|
|
|
|
extern int numa_zonelist_order_handler(struct ctl_table *, int,
|
|
void *, size_t *, loff_t *);
|
|
extern char numa_zonelist_order[];
|
|
|
|
|
|
|
|
|
|
extern struct pglist_data contig_page_data;
|
|
# 863 "include/linux/mmzone.h"
|
|
extern struct pglist_data *first_online_pgdat(void);
|
|
extern struct pglist_data *next_online_pgdat(struct pglist_data *pgdat);
|
|
extern struct zone *next_zone(struct zone *zone);
|
|
# 895 "include/linux/mmzone.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct zone *zonelist_zone(struct zoneref *zoneref)
|
|
{
|
|
return zoneref->zone;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int zonelist_zone_idx(struct zoneref *zoneref)
|
|
{
|
|
return zoneref->zone_idx;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int zonelist_node_idx(struct zoneref *zoneref)
|
|
{
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
# 927 "include/linux/mmzone.h"
|
|
struct zoneref *next_zones_zonelist(struct zoneref *z,
|
|
enum zone_type highest_zoneidx,
|
|
nodemask_t *nodes);
|
|
# 943 "include/linux/mmzone.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct zoneref *first_zones_zonelist(struct zonelist *zonelist,
|
|
enum zone_type highest_zoneidx,
|
|
nodemask_t *nodes,
|
|
struct zone **zone)
|
|
{
|
|
struct zoneref *z = next_zones_zonelist(zonelist->_zonerefs,
|
|
highest_zoneidx, nodes);
|
|
*zone = zonelist_zone(z);
|
|
return z;
|
|
}
|
|
# 989 "include/linux/mmzone.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long early_pfn_to_nid(unsigned long pfn)
|
|
{
|
|
return 0;
|
|
}
|
|
# 1172 "include/linux/mmzone.h"
|
|
struct mminit_pfnnid_cache {
|
|
unsigned long last_start;
|
|
unsigned long last_end;
|
|
int last_nid;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
void memory_present(int nid, unsigned long start, unsigned long end);
|
|
unsigned long __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) node_memmap_size_bytes(int, unsigned long, unsigned long);
|
|
# 1216 "include/linux/mmzone.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int memmap_valid_within(unsigned long pfn,
|
|
struct page *page, struct zone *zone)
|
|
{
|
|
return 1;
|
|
}
|
|
# 6 "include/linux/gfp.h" 2
|
|
|
|
|
|
# 1 "include/linux/topology.h" 1
|
|
# 33 "include/linux/topology.h"
|
|
# 1 "include/linux/smp.h" 1
|
|
# 14 "include/linux/smp.h"
|
|
# 1 "include/linux/llist.h" 1
|
|
# 61 "include/linux/llist.h"
|
|
struct llist_head {
|
|
struct llist_node *first;
|
|
};
|
|
|
|
struct llist_node {
|
|
struct llist_node *next;
|
|
};
|
|
# 76 "include/linux/llist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_llist_head(struct llist_head *list)
|
|
{
|
|
list->first = ((void *)0);
|
|
}
|
|
# 175 "include/linux/llist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool llist_empty(const struct llist_head *head)
|
|
{
|
|
return (*({ __attribute__((unused)) typeof(head->first) __var = ( typeof(head->first)) 0; (volatile typeof(head->first) *)&(head->first); })) == ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct llist_node *llist_next(struct llist_node *node)
|
|
{
|
|
return node->next;
|
|
}
|
|
|
|
extern bool llist_add_batch(struct llist_node *new_first,
|
|
struct llist_node *new_last,
|
|
struct llist_head *head);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool llist_add(struct llist_node *new, struct llist_head *head)
|
|
{
|
|
return llist_add_batch(new, new, head);
|
|
}
|
|
# 208 "include/linux/llist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct llist_node *llist_del_all(struct llist_head *head)
|
|
{
|
|
return ({ typeof(({ (__typeof__(*(&head->first)))__xchg((unsigned long)(((void *)0)), (&head->first), sizeof(*(&head->first))); })) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = ({ (__typeof__(*(&head->first)))__xchg((unsigned long)(((void *)0)), (&head->first), sizeof(*(&head->first))); }); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; });
|
|
}
|
|
|
|
extern struct llist_node *llist_del_first(struct llist_head *head);
|
|
|
|
struct llist_node *llist_reverse_order(struct llist_node *head);
|
|
# 15 "include/linux/smp.h" 2
|
|
|
|
typedef void (*smp_call_func_t)(void *info);
|
|
struct call_single_data {
|
|
struct llist_node llist;
|
|
smp_call_func_t func;
|
|
void *info;
|
|
unsigned int flags;
|
|
};
|
|
|
|
|
|
extern unsigned int total_cpus;
|
|
|
|
int smp_call_function_single(int cpuid, smp_call_func_t func, void *info,
|
|
int wait);
|
|
|
|
|
|
|
|
|
|
int on_each_cpu(smp_call_func_t func, void *info, int wait);
|
|
|
|
|
|
|
|
|
|
|
|
void on_each_cpu_mask(const struct cpumask *mask, smp_call_func_t func,
|
|
void *info, bool wait);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_each_cpu_cond(bool (*cond_func)(int cpu, void *info),
|
|
smp_call_func_t func, void *info, bool wait,
|
|
gfp_t gfp_flags);
|
|
|
|
int smp_call_function_single_async(int cpu, struct call_single_data *csd);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/smp.h" 1
|
|
# 23 "./arch/arm/include/asm/smp.h"
|
|
struct seq_file;
|
|
|
|
|
|
|
|
|
|
extern void show_ipi_list(struct seq_file *, int);
|
|
|
|
|
|
|
|
|
|
void do_IPI(int ipinr, struct pt_regs *regs);
|
|
|
|
|
|
|
|
|
|
void handle_IPI(int ipinr, struct pt_regs *regs);
|
|
|
|
|
|
|
|
|
|
extern void smp_init_cpus(void);
|
|
|
|
|
|
|
|
|
|
|
|
extern void set_smp_cross_call(void (*)(const struct cpumask *, unsigned int));
|
|
|
|
|
|
|
|
|
|
|
|
void secondary_start_kernel(void);
|
|
|
|
|
|
|
|
|
|
|
|
struct secondary_data {
|
|
union {
|
|
unsigned long mpu_rgn_szr;
|
|
u64 pgdir;
|
|
};
|
|
unsigned long swapper_pg_dir;
|
|
void *stack;
|
|
};
|
|
extern struct secondary_data secondary_data;
|
|
extern volatile int pen_release;
|
|
extern void secondary_startup(void);
|
|
extern void secondary_startup_arm(void);
|
|
|
|
extern int __cpu_disable(void);
|
|
|
|
extern void __cpu_die(unsigned int cpu);
|
|
|
|
extern void arch_send_call_function_single_ipi(int cpu);
|
|
extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
|
|
extern void arch_send_wakeup_ipi_mask(const struct cpumask *mask);
|
|
|
|
extern int register_ipi_completion(struct completion *completion, int cpu);
|
|
|
|
struct smp_operations {
|
|
|
|
|
|
|
|
|
|
void (*smp_init_cpus)(void);
|
|
|
|
|
|
|
|
void (*smp_prepare_cpus)(unsigned int max_cpus);
|
|
|
|
|
|
|
|
|
|
void (*smp_secondary_init)(unsigned int cpu);
|
|
|
|
|
|
|
|
|
|
int (*smp_boot_secondary)(unsigned int cpu, struct task_struct *idle);
|
|
|
|
int (*cpu_kill)(unsigned int cpu);
|
|
void (*cpu_die)(unsigned int cpu);
|
|
bool (*cpu_can_disable)(unsigned int cpu);
|
|
int (*cpu_disable)(unsigned int cpu);
|
|
|
|
|
|
};
|
|
|
|
struct of_cpu_method {
|
|
const char *method;
|
|
const struct smp_operations *ops;
|
|
};
|
|
# 125 "./arch/arm/include/asm/smp.h"
|
|
extern void smp_set_ops(const struct smp_operations *);
|
|
# 60 "include/linux/smp.h" 2
|
|
# 69 "include/linux/smp.h"
|
|
extern void smp_send_stop(void);
|
|
|
|
|
|
|
|
|
|
extern void smp_send_reschedule(int cpu);
|
|
|
|
|
|
|
|
|
|
|
|
extern void smp_prepare_cpus(unsigned int max_cpus);
|
|
|
|
|
|
|
|
|
|
extern int __cpu_up(unsigned int cpunum, struct task_struct *tidle);
|
|
|
|
|
|
|
|
|
|
extern void smp_cpus_done(unsigned int max_cpus);
|
|
|
|
|
|
|
|
|
|
int smp_call_function(smp_call_func_t func, void *info, int wait);
|
|
void smp_call_function_many(const struct cpumask *mask,
|
|
smp_call_func_t func, void *info, bool wait);
|
|
|
|
int smp_call_function_any(const struct cpumask *mask,
|
|
smp_call_func_t func, void *info, int wait);
|
|
|
|
void kick_all_cpus_sync(void);
|
|
void wake_up_all_idle_cpus(void);
|
|
|
|
|
|
|
|
|
|
void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) call_function_init(void);
|
|
void generic_smp_call_function_single_interrupt(void);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void smp_prepare_boot_cpu(void);
|
|
|
|
extern unsigned int setup_max_cpus;
|
|
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) setup_nr_cpu_ids(void);
|
|
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) smp_init(void);
|
|
# 192 "include/linux/smp.h"
|
|
extern void arch_disable_smp_support(void);
|
|
|
|
extern void arch_enable_nonboot_cpus_begin(void);
|
|
extern void arch_enable_nonboot_cpus_end(void);
|
|
|
|
void smp_setup_processor_id(void);
|
|
# 34 "include/linux/topology.h" 2
|
|
# 1 "include/linux/percpu.h" 1
|
|
# 12 "include/linux/percpu.h"
|
|
# 1 "./arch/arm/include/asm/percpu.h" 1
|
|
# 24 "./arch/arm/include/asm/percpu.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_my_cpu_offset(unsigned long off)
|
|
{
|
|
|
|
asm volatile("mcr p15, 0, %0, c13, c0, 4" : : "r" (off) : "memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __my_cpu_offset(void)
|
|
{
|
|
unsigned long off;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
asm("mrc p15, 0, %0, c13, c0, 4" : "=r" (off)
|
|
: "Q" (*(const unsigned long *)current_stack_pointer));
|
|
|
|
return off;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/asm-generic/percpu.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/percpu-defs.h" 1
|
|
# 325 "include/linux/percpu-defs.h"
|
|
extern void __bad_size_call_parameter(void);
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __this_cpu_preempt_check(const char *op) { }
|
|
# 7 "include/asm-generic/percpu.h" 2
|
|
# 18 "include/asm-generic/percpu.h"
|
|
extern unsigned long __per_cpu_offset[2];
|
|
# 51 "./arch/arm/include/asm/percpu.h" 2
|
|
# 13 "include/linux/percpu.h" 2
|
|
# 57 "include/linux/percpu.h"
|
|
extern void *pcpu_base_addr;
|
|
extern const unsigned long *pcpu_unit_offsets;
|
|
|
|
struct pcpu_group_info {
|
|
int nr_units;
|
|
unsigned long base_offset;
|
|
unsigned int *cpu_map;
|
|
|
|
};
|
|
|
|
struct pcpu_alloc_info {
|
|
size_t static_size;
|
|
size_t reserved_size;
|
|
size_t dyn_size;
|
|
size_t unit_size;
|
|
size_t atom_size;
|
|
size_t alloc_size;
|
|
size_t __ai_size;
|
|
int nr_groups;
|
|
struct pcpu_group_info groups[];
|
|
};
|
|
|
|
enum pcpu_fc {
|
|
PCPU_FC_AUTO,
|
|
PCPU_FC_EMBED,
|
|
PCPU_FC_PAGE,
|
|
|
|
PCPU_FC_NR,
|
|
};
|
|
extern const char * const pcpu_fc_names[PCPU_FC_NR];
|
|
|
|
extern enum pcpu_fc pcpu_chosen_fc;
|
|
|
|
typedef void * (*pcpu_fc_alloc_fn_t)(unsigned int cpu, size_t size,
|
|
size_t align);
|
|
typedef void (*pcpu_fc_free_fn_t)(void *ptr, size_t size);
|
|
typedef void (*pcpu_fc_populate_pte_fn_t)(unsigned long addr);
|
|
typedef int (pcpu_fc_cpu_distance_fn_t)(unsigned int from, unsigned int to);
|
|
|
|
extern struct pcpu_alloc_info * __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) pcpu_alloc_alloc_info(int nr_groups,
|
|
int nr_units);
|
|
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) pcpu_free_alloc_info(struct pcpu_alloc_info *ai);
|
|
|
|
extern int __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
|
|
void *base_addr);
|
|
# 118 "include/linux/percpu.h"
|
|
extern void *__alloc_reserved_percpu(size_t size, size_t align);
|
|
extern bool is_kernel_percpu_address(unsigned long addr);
|
|
|
|
|
|
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) setup_per_cpu_areas(void);
|
|
|
|
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) percpu_init_late(void);
|
|
|
|
extern void *__alloc_percpu_gfp(size_t size, size_t align, gfp_t gfp);
|
|
extern void *__alloc_percpu(size_t size, size_t align);
|
|
extern void free_percpu(void *__pdata);
|
|
extern phys_addr_t per_cpu_ptr_to_phys(void *addr);
|
|
# 139 "include/linux/percpu.h"
|
|
extern __attribute__((section(".data..percpu" ""))) __typeof__(printk_func_t) printk_func;
|
|
# 35 "include/linux/topology.h" 2
|
|
# 1 "./arch/arm/include/asm/topology.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct cputopo_arm {
|
|
int thread_id;
|
|
int core_id;
|
|
int socket_id;
|
|
cpumask_t thread_sibling;
|
|
cpumask_t core_sibling;
|
|
};
|
|
|
|
extern struct cputopo_arm cpu_topology[2];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void init_cpu_topology(void);
|
|
void store_cpu_topology(unsigned int cpuid);
|
|
const struct cpumask *cpu_coregroup_mask(int cpu);
|
|
# 34 "./arch/arm/include/asm/topology.h"
|
|
# 1 "include/asm-generic/topology.h" 1
|
|
# 35 "./arch/arm/include/asm/topology.h" 2
|
|
# 36 "include/linux/topology.h" 2
|
|
# 49 "include/linux/topology.h"
|
|
int arch_update_cpu_topology(void);
|
|
# 106 "include/linux/topology.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int numa_node_id(void)
|
|
{
|
|
return ((void)((current_thread_info()->cpu)),0);
|
|
}
|
|
# 166 "include/linux/topology.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int numa_mem_id(void)
|
|
{
|
|
return numa_node_id();
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int node_to_mem_node(int node)
|
|
{
|
|
return node;
|
|
}
|
|
# 202 "include/linux/topology.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const struct cpumask *cpu_smt_mask(int cpu)
|
|
{
|
|
return (&cpu_topology[cpu].thread_sibling);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const struct cpumask *cpu_cpu_mask(int cpu)
|
|
{
|
|
return ((void)((void)(cpu),0), cpu_online_mask);
|
|
}
|
|
# 9 "include/linux/gfp.h" 2
|
|
|
|
struct vm_area_struct;
|
|
# 257 "include/linux/gfp.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int gfpflags_to_migratetype(const gfp_t gfp_flags)
|
|
{
|
|
((void)(sizeof(( long)((gfp_flags & ((( gfp_t)0x10u)|(( gfp_t)0x08u))) == ((( gfp_t)0x10u)|(( gfp_t)0x08u))))));
|
|
((void)sizeof(char[1 - 2*!!((1UL << 3) != 0x08u)]));
|
|
((void)sizeof(char[1 - 2*!!((0x08u >> 3) != MIGRATE_MOVABLE)]));
|
|
|
|
if (__builtin_expect(!!(page_group_by_mobility_disabled), 0))
|
|
return MIGRATE_UNMOVABLE;
|
|
|
|
|
|
return (gfp_flags & ((( gfp_t)0x10u)|(( gfp_t)0x08u))) >> 3;
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool gfpflags_allow_blocking(const gfp_t gfp_flags)
|
|
{
|
|
return (bool )(gfp_flags & (( gfp_t)0x400000u));
|
|
}
|
|
# 360 "include/linux/gfp.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) enum zone_type gfp_zone(gfp_t flags)
|
|
{
|
|
enum zone_type z;
|
|
int bit = ( int) (flags & ((( gfp_t)0x01u)|(( gfp_t)0x02u)|(( gfp_t)0x04u)|(( gfp_t)0x08u)));
|
|
|
|
z = (( (ZONE_NORMAL << 0 * 2) | (ZONE_NORMAL << 0x01u * 2) | (ZONE_HIGHMEM << 0x02u * 2) | (ZONE_NORMAL << 0x04u * 2) | (ZONE_NORMAL << 0x08u * 2) | (ZONE_NORMAL << (0x08u | 0x01u) * 2) | (ZONE_MOVABLE << (0x08u | 0x02u) * 2) | (ZONE_NORMAL << (0x08u | 0x04u) * 2) ) >> (bit * 2)) &
|
|
((1 << 2) - 1);
|
|
((void)(sizeof(( long)((( 1 << (0x01u | 0x02u) | 1 << (0x01u | 0x04u) | 1 << (0x04u | 0x02u) | 1 << (0x01u | 0x04u | 0x02u) | 1 << (0x08u | 0x02u | 0x01u) | 1 << (0x08u | 0x04u | 0x01u) | 1 << (0x08u | 0x04u | 0x02u) | 1 << (0x08u | 0x04u | 0x01u | 0x02u) ) >> bit) & 1))));
|
|
return z;
|
|
}
|
|
# 378 "include/linux/gfp.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int gfp_zonelist(gfp_t flags)
|
|
{
|
|
if ((0 || 0) && __builtin_expect(!!(flags & (( gfp_t)0x40000u)), 0))
|
|
return 1;
|
|
|
|
return 0;
|
|
}
|
|
# 395 "include/linux/gfp.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct zonelist *node_zonelist(int nid, gfp_t flags)
|
|
{
|
|
return (&contig_page_data)->node_zonelists + gfp_zonelist(flags);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_free_page(struct page *page, int order) { }
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void arch_alloc_page(struct page *page, int order) { }
|
|
|
|
|
|
struct page *
|
|
__alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
|
|
struct zonelist *zonelist, nodemask_t *nodemask);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *
|
|
__alloc_pages(gfp_t gfp_mask, unsigned int order,
|
|
struct zonelist *zonelist)
|
|
{
|
|
return __alloc_pages_nodemask(gfp_mask, order, zonelist, ((void *)0));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *
|
|
__alloc_pages_node(int nid, gfp_t gfp_mask, unsigned int order)
|
|
{
|
|
((void)(sizeof(( long)(nid < 0 || nid >= (1 << 0)))));
|
|
((void)(sizeof(( long)(!node_state((nid), N_ONLINE)))));
|
|
|
|
return __alloc_pages(gfp_mask, order, node_zonelist(nid, gfp_mask));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *alloc_pages_node(int nid, gfp_t gfp_mask,
|
|
unsigned int order)
|
|
{
|
|
if (nid == (-1))
|
|
nid = numa_mem_id();
|
|
|
|
return __alloc_pages_node(nid, gfp_mask, order);
|
|
}
|
|
# 472 "include/linux/gfp.h"
|
|
extern struct page *alloc_kmem_pages(gfp_t gfp_mask, unsigned int order);
|
|
extern struct page *alloc_kmem_pages_node(int nid, gfp_t gfp_mask,
|
|
unsigned int order);
|
|
|
|
extern unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order);
|
|
extern unsigned long get_zeroed_page(gfp_t gfp_mask);
|
|
|
|
void *alloc_pages_exact(size_t size, gfp_t gfp_mask);
|
|
void free_pages_exact(void *virt, size_t size);
|
|
void * __attribute__ ((__section__(".meminit.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) alloc_pages_exact_nid(int nid, size_t size, gfp_t gfp_mask);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern void __free_pages(struct page *page, unsigned int order);
|
|
extern void free_pages(unsigned long addr, unsigned int order);
|
|
extern void free_hot_cold_page(struct page *page, bool cold);
|
|
extern void free_hot_cold_page_list(struct list_head *list, bool cold);
|
|
|
|
struct page_frag_cache;
|
|
extern void *__alloc_page_frag(struct page_frag_cache *nc,
|
|
unsigned int fragsz, gfp_t gfp_mask);
|
|
extern void __free_page_frag(void *addr);
|
|
|
|
extern void __free_kmem_pages(struct page *page, unsigned int order);
|
|
extern void free_kmem_pages(unsigned long addr, unsigned int order);
|
|
|
|
|
|
|
|
|
|
void page_alloc_init(void);
|
|
void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp);
|
|
void drain_all_pages(struct zone *zone);
|
|
void drain_local_pages(struct zone *zone);
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void page_alloc_init_late(void)
|
|
{
|
|
}
|
|
# 525 "include/linux/gfp.h"
|
|
extern gfp_t gfp_allowed_mask;
|
|
|
|
|
|
bool gfp_pfmemalloc_allowed(gfp_t gfp_mask);
|
|
|
|
extern void pm_restrict_gfp_mask(void);
|
|
extern void pm_restore_gfp_mask(void);
|
|
|
|
|
|
extern bool pm_suspended_storage(void);
|
|
# 23 "include/linux/kmod.h" 2
|
|
# 32 "include/linux/kmod.h"
|
|
extern char modprobe_path[];
|
|
|
|
|
|
extern __attribute__((format(printf, 2, 3)))
|
|
int __request_module(bool wait, const char *name, ...);
|
|
# 48 "include/linux/kmod.h"
|
|
struct cred;
|
|
struct file;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct subprocess_info {
|
|
struct work_struct work;
|
|
struct completion *complete;
|
|
char *path;
|
|
char **argv;
|
|
char **envp;
|
|
int wait;
|
|
int retval;
|
|
int (*init)(struct subprocess_info *info, struct cred *new);
|
|
void (*cleanup)(struct subprocess_info *info);
|
|
void *data;
|
|
};
|
|
|
|
extern int
|
|
call_usermodehelper(char *path, char **argv, char **envp, int wait);
|
|
|
|
extern struct subprocess_info *
|
|
call_usermodehelper_setup(char *path, char **argv, char **envp, gfp_t gfp_mask,
|
|
int (*init)(struct subprocess_info *info, struct cred *new),
|
|
void (*cleanup)(struct subprocess_info *), void *data);
|
|
|
|
extern int
|
|
call_usermodehelper_exec(struct subprocess_info *info, int wait);
|
|
|
|
extern struct ctl_table usermodehelper_table[];
|
|
|
|
enum umh_disable_depth {
|
|
UMH_ENABLED = 0,
|
|
UMH_FREEZING,
|
|
UMH_DISABLED,
|
|
};
|
|
|
|
extern int __usermodehelper_disable(enum umh_disable_depth depth);
|
|
extern void __usermodehelper_set_disable_depth(enum umh_disable_depth depth);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int usermodehelper_disable(void)
|
|
{
|
|
return __usermodehelper_disable(UMH_DISABLED);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void usermodehelper_enable(void)
|
|
{
|
|
__usermodehelper_set_disable_depth(UMH_ENABLED);
|
|
}
|
|
|
|
extern int usermodehelper_read_trylock(void);
|
|
extern long usermodehelper_read_lock_wait(long timeout);
|
|
extern void usermodehelper_read_unlock(void);
|
|
# 14 "include/linux/module.h" 2
|
|
|
|
# 1 "include/linux/elf.h" 1
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/elf.h" 1
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/auxvec.h" 1
|
|
# 1 "./arch/arm/include/uapi/asm/auxvec.h" 1
|
|
# 1 "./arch/arm/include/asm/auxvec.h" 2
|
|
# 5 "./arch/arm/include/asm/elf.h" 2
|
|
|
|
# 1 "./arch/arm/include/asm/vdso_datapage.h" 1
|
|
# 31 "./arch/arm/include/asm/vdso_datapage.h"
|
|
struct vdso_data {
|
|
u32 seq_count;
|
|
u16 tk_is_cntvct;
|
|
u16 cs_shift;
|
|
u32 xtime_coarse_sec;
|
|
u32 xtime_coarse_nsec;
|
|
|
|
u32 wtm_clock_sec;
|
|
u32 wtm_clock_nsec;
|
|
u32 xtime_clock_sec;
|
|
u32 cs_mult;
|
|
|
|
u64 cs_cycle_last;
|
|
u64 cs_mask;
|
|
|
|
u64 xtime_clock_snsec;
|
|
u32 tz_minuteswest;
|
|
u32 tz_dsttime;
|
|
};
|
|
|
|
union vdso_data_store {
|
|
struct vdso_data data;
|
|
u8 page[((1UL) << 12)];
|
|
};
|
|
# 7 "./arch/arm/include/asm/elf.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/user.h" 1
|
|
# 33 "./arch/arm/include/asm/user.h"
|
|
struct user_fp {
|
|
struct fp_reg {
|
|
unsigned int sign1:1;
|
|
unsigned int unused:15;
|
|
unsigned int sign2:1;
|
|
unsigned int exponent:14;
|
|
unsigned int j:1;
|
|
unsigned int mantissa1:31;
|
|
unsigned int mantissa0:32;
|
|
} fpregs[8];
|
|
unsigned int fpsr:32;
|
|
unsigned int fpcr:32;
|
|
unsigned char ftype[8];
|
|
unsigned int init_flag;
|
|
};
|
|
|
|
|
|
|
|
|
|
struct user{
|
|
|
|
|
|
struct pt_regs regs;
|
|
|
|
int u_fpvalid;
|
|
|
|
|
|
unsigned long int u_tsize;
|
|
unsigned long int u_dsize;
|
|
unsigned long int u_ssize;
|
|
unsigned long start_code;
|
|
unsigned long start_stack;
|
|
|
|
|
|
|
|
long int signal;
|
|
int reserved;
|
|
unsigned long u_ar0;
|
|
|
|
unsigned long magic;
|
|
char u_comm[32];
|
|
int u_debugreg[8];
|
|
struct user_fp u_fp;
|
|
struct user_fp_struct * u_fp0;
|
|
|
|
};
|
|
# 88 "./arch/arm/include/asm/user.h"
|
|
struct user_vfp {
|
|
unsigned long long fpregs[32];
|
|
unsigned long fpscr;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct user_vfp_exc {
|
|
unsigned long fpexc;
|
|
unsigned long fpinst;
|
|
unsigned long fpinst2;
|
|
};
|
|
# 13 "./arch/arm/include/asm/elf.h" 2
|
|
|
|
struct task_struct;
|
|
|
|
typedef unsigned long elf_greg_t;
|
|
typedef unsigned long elf_freg_t[3];
|
|
|
|
|
|
typedef elf_greg_t elf_gregset_t[(sizeof (struct pt_regs) / sizeof(elf_greg_t))];
|
|
|
|
typedef struct user_fp elf_fpregset_t;
|
|
# 93 "./arch/arm/include/asm/elf.h"
|
|
extern char elf_platform[];
|
|
|
|
struct elf32_hdr;
|
|
|
|
|
|
|
|
|
|
extern int elf_check_arch(const struct elf32_hdr *);
|
|
|
|
|
|
|
|
|
|
extern int arm_elf_read_implies_exec(const struct elf32_hdr *, int);
|
|
|
|
|
|
struct task_struct;
|
|
int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs);
|
|
# 123 "./arch/arm/include/asm/elf.h"
|
|
extern void elf_set_personality(const struct elf32_hdr *);
|
|
# 135 "./arch/arm/include/asm/elf.h"
|
|
struct linux_binprm;
|
|
int arch_setup_additional_pages(struct linux_binprm *, int);
|
|
# 5 "include/linux/elf.h" 2
|
|
# 1 "include/uapi/linux/elf.h" 1
|
|
|
|
|
|
|
|
|
|
# 1 "./include/uapi/linux/elf-em.h" 1
|
|
# 6 "include/uapi/linux/elf.h" 2
|
|
|
|
|
|
typedef __u32 Elf32_Addr;
|
|
typedef __u16 Elf32_Half;
|
|
typedef __u32 Elf32_Off;
|
|
typedef __s32 Elf32_Sword;
|
|
typedef __u32 Elf32_Word;
|
|
|
|
|
|
typedef __u64 Elf64_Addr;
|
|
typedef __u16 Elf64_Half;
|
|
typedef __s16 Elf64_SHalf;
|
|
typedef __u64 Elf64_Off;
|
|
typedef __s32 Elf64_Sword;
|
|
typedef __u32 Elf64_Word;
|
|
typedef __u64 Elf64_Xword;
|
|
typedef __s64 Elf64_Sxword;
|
|
# 137 "include/uapi/linux/elf.h"
|
|
typedef struct dynamic{
|
|
Elf32_Sword d_tag;
|
|
union{
|
|
Elf32_Sword d_val;
|
|
Elf32_Addr d_ptr;
|
|
} d_un;
|
|
} Elf32_Dyn;
|
|
|
|
typedef struct {
|
|
Elf64_Sxword d_tag;
|
|
union {
|
|
Elf64_Xword d_val;
|
|
Elf64_Addr d_ptr;
|
|
} d_un;
|
|
} Elf64_Dyn;
|
|
# 160 "include/uapi/linux/elf.h"
|
|
typedef struct elf32_rel {
|
|
Elf32_Addr r_offset;
|
|
Elf32_Word r_info;
|
|
} Elf32_Rel;
|
|
|
|
typedef struct elf64_rel {
|
|
Elf64_Addr r_offset;
|
|
Elf64_Xword r_info;
|
|
} Elf64_Rel;
|
|
|
|
typedef struct elf32_rela{
|
|
Elf32_Addr r_offset;
|
|
Elf32_Word r_info;
|
|
Elf32_Sword r_addend;
|
|
} Elf32_Rela;
|
|
|
|
typedef struct elf64_rela {
|
|
Elf64_Addr r_offset;
|
|
Elf64_Xword r_info;
|
|
Elf64_Sxword r_addend;
|
|
} Elf64_Rela;
|
|
|
|
typedef struct elf32_sym{
|
|
Elf32_Word st_name;
|
|
Elf32_Addr st_value;
|
|
Elf32_Word st_size;
|
|
unsigned char st_info;
|
|
unsigned char st_other;
|
|
Elf32_Half st_shndx;
|
|
} Elf32_Sym;
|
|
|
|
typedef struct elf64_sym {
|
|
Elf64_Word st_name;
|
|
unsigned char st_info;
|
|
unsigned char st_other;
|
|
Elf64_Half st_shndx;
|
|
Elf64_Addr st_value;
|
|
Elf64_Xword st_size;
|
|
} Elf64_Sym;
|
|
|
|
|
|
|
|
|
|
typedef struct elf32_hdr{
|
|
unsigned char e_ident[16];
|
|
Elf32_Half e_type;
|
|
Elf32_Half e_machine;
|
|
Elf32_Word e_version;
|
|
Elf32_Addr e_entry;
|
|
Elf32_Off e_phoff;
|
|
Elf32_Off e_shoff;
|
|
Elf32_Word e_flags;
|
|
Elf32_Half e_ehsize;
|
|
Elf32_Half e_phentsize;
|
|
Elf32_Half e_phnum;
|
|
Elf32_Half e_shentsize;
|
|
Elf32_Half e_shnum;
|
|
Elf32_Half e_shstrndx;
|
|
} Elf32_Ehdr;
|
|
|
|
typedef struct elf64_hdr {
|
|
unsigned char e_ident[16];
|
|
Elf64_Half e_type;
|
|
Elf64_Half e_machine;
|
|
Elf64_Word e_version;
|
|
Elf64_Addr e_entry;
|
|
Elf64_Off e_phoff;
|
|
Elf64_Off e_shoff;
|
|
Elf64_Word e_flags;
|
|
Elf64_Half e_ehsize;
|
|
Elf64_Half e_phentsize;
|
|
Elf64_Half e_phnum;
|
|
Elf64_Half e_shentsize;
|
|
Elf64_Half e_shnum;
|
|
Elf64_Half e_shstrndx;
|
|
} Elf64_Ehdr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct elf32_phdr{
|
|
Elf32_Word p_type;
|
|
Elf32_Off p_offset;
|
|
Elf32_Addr p_vaddr;
|
|
Elf32_Addr p_paddr;
|
|
Elf32_Word p_filesz;
|
|
Elf32_Word p_memsz;
|
|
Elf32_Word p_flags;
|
|
Elf32_Word p_align;
|
|
} Elf32_Phdr;
|
|
|
|
typedef struct elf64_phdr {
|
|
Elf64_Word p_type;
|
|
Elf64_Word p_flags;
|
|
Elf64_Off p_offset;
|
|
Elf64_Addr p_vaddr;
|
|
Elf64_Addr p_paddr;
|
|
Elf64_Xword p_filesz;
|
|
Elf64_Xword p_memsz;
|
|
Elf64_Xword p_align;
|
|
} Elf64_Phdr;
|
|
# 299 "include/uapi/linux/elf.h"
|
|
typedef struct elf32_shdr {
|
|
Elf32_Word sh_name;
|
|
Elf32_Word sh_type;
|
|
Elf32_Word sh_flags;
|
|
Elf32_Addr sh_addr;
|
|
Elf32_Off sh_offset;
|
|
Elf32_Word sh_size;
|
|
Elf32_Word sh_link;
|
|
Elf32_Word sh_info;
|
|
Elf32_Word sh_addralign;
|
|
Elf32_Word sh_entsize;
|
|
} Elf32_Shdr;
|
|
|
|
typedef struct elf64_shdr {
|
|
Elf64_Word sh_name;
|
|
Elf64_Word sh_type;
|
|
Elf64_Xword sh_flags;
|
|
Elf64_Addr sh_addr;
|
|
Elf64_Off sh_offset;
|
|
Elf64_Xword sh_size;
|
|
Elf64_Word sh_link;
|
|
Elf64_Word sh_info;
|
|
Elf64_Xword sh_addralign;
|
|
Elf64_Xword sh_entsize;
|
|
} Elf64_Shdr;
|
|
# 407 "include/uapi/linux/elf.h"
|
|
typedef struct elf32_note {
|
|
Elf32_Word n_namesz;
|
|
Elf32_Word n_descsz;
|
|
Elf32_Word n_type;
|
|
} Elf32_Nhdr;
|
|
|
|
|
|
typedef struct elf64_note {
|
|
Elf64_Word n_namesz;
|
|
Elf64_Word n_descsz;
|
|
Elf64_Word n_type;
|
|
} Elf64_Nhdr;
|
|
# 6 "include/linux/elf.h" 2
|
|
# 25 "include/linux/elf.h"
|
|
extern Elf32_Dyn _DYNAMIC [];
|
|
# 46 "include/linux/elf.h"
|
|
struct file;
|
|
struct coredump_params;
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int elf_coredump_extra_notes_size(void) { return 0; }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int elf_coredump_extra_notes_write(struct coredump_params *cprm) { return 0; }
|
|
# 16 "include/linux/module.h" 2
|
|
|
|
# 1 "include/linux/kobject.h" 1
|
|
# 21 "include/linux/kobject.h"
|
|
# 1 "include/linux/sysfs.h" 1
|
|
# 15 "include/linux/sysfs.h"
|
|
# 1 "include/linux/kernfs.h" 1
|
|
# 11 "include/linux/kernfs.h"
|
|
# 1 "include/linux/err.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "arch/arm/include/generated/asm/errno.h" 1
|
|
# 8 "include/linux/err.h" 2
|
|
# 23 "include/linux/err.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void * __attribute__((warn_unused_result)) ERR_PTR(long error)
|
|
{
|
|
return (void *) error;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long __attribute__((warn_unused_result)) PTR_ERR( const void *ptr)
|
|
{
|
|
return (long) ptr;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __attribute__((warn_unused_result)) IS_ERR( const void *ptr)
|
|
{
|
|
return __builtin_expect(!!(((unsigned long)ptr) >= (unsigned long)-4095), 0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __attribute__((warn_unused_result)) IS_ERR_OR_NULL( const void *ptr)
|
|
{
|
|
return !ptr || __builtin_expect(!!(((unsigned long)ptr) >= (unsigned long)-4095), 0);
|
|
}
|
|
# 50 "include/linux/err.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void * __attribute__((warn_unused_result)) ERR_CAST( const void *ptr)
|
|
{
|
|
|
|
return (void *) ptr;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) PTR_ERR_OR_ZERO( const void *ptr)
|
|
{
|
|
if (IS_ERR(ptr))
|
|
return PTR_ERR(ptr);
|
|
else
|
|
return 0;
|
|
}
|
|
# 12 "include/linux/kernfs.h" 2
|
|
|
|
|
|
# 1 "include/linux/idr.h" 1
|
|
# 30 "include/linux/idr.h"
|
|
struct idr_layer {
|
|
int prefix;
|
|
int layer;
|
|
struct idr_layer *ary[1<<8];
|
|
int count;
|
|
union {
|
|
|
|
unsigned long bitmap[((((1 << 8)) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))];
|
|
struct callback_head callback_head;
|
|
};
|
|
};
|
|
|
|
struct idr {
|
|
struct idr_layer *hint;
|
|
struct idr_layer *top;
|
|
int layers;
|
|
int cur;
|
|
spinlock_t lock;
|
|
int id_free_cnt;
|
|
struct idr_layer *id_free;
|
|
};
|
|
# 79 "include/linux/idr.h"
|
|
void *idr_find_slowpath(struct idr *idp, 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);
|
|
void *idr_replace(struct idr *idp, void *ptr, int id);
|
|
void idr_remove(struct idr *idp, int id);
|
|
void idr_destroy(struct idr *idp);
|
|
void idr_init(struct idr *idp);
|
|
bool idr_is_empty(struct idr *idp);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void idr_preload_end(void)
|
|
{
|
|
__asm__ __volatile__("": : :"memory");
|
|
}
|
|
# 115 "include/linux/idr.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *idr_find(struct idr *idr, int id)
|
|
{
|
|
struct idr_layer *hint = ({ typeof(*(idr->hint)) *________p1 = (typeof(*(idr->hint)) *)({ typeof((idr->hint)) _________p1 = ({ union { typeof((idr->hint)) __val; char __c[1]; } __u; if (1) __read_once_size(&((idr->hint)), __u.__c, sizeof((idr->hint))); else __read_once_size_nocheck(&((idr->hint)), __u.__c, sizeof((idr->hint))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(idr->hint)) *)(________p1)); });
|
|
|
|
if (hint && (id & ~((1 << 8)-1)) == hint->prefix)
|
|
return ({ typeof(*(hint->ary[id & ((1 << 8)-1)])) *________p1 = (typeof(*(hint->ary[id & ((1 << 8)-1)])) *)({ typeof((hint->ary[id & ((1 << 8)-1)])) _________p1 = ({ union { typeof((hint->ary[id & ((1 << 8)-1)])) __val; char __c[1]; } __u; if (1) __read_once_size(&((hint->ary[id & ((1 << 8)-1)])), __u.__c, sizeof((hint->ary[id & ((1 << 8)-1)]))); else __read_once_size_nocheck(&((hint->ary[id & ((1 << 8)-1)])), __u.__c, sizeof((hint->ary[id & ((1 << 8)-1)]))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(hint->ary[id & ((1 << 8)-1)])) *)(________p1)); });
|
|
|
|
return idr_find_slowpath(idr, id);
|
|
}
|
|
# 149 "include/linux/idr.h"
|
|
struct ida_bitmap {
|
|
long nr_busy;
|
|
unsigned long bitmap[(128 / sizeof(long) - 1)];
|
|
};
|
|
|
|
struct ida {
|
|
struct idr idr;
|
|
struct ida_bitmap *free_bitmap;
|
|
};
|
|
|
|
|
|
|
|
|
|
int ida_pre_get(struct ida *ida, gfp_t gfp_mask);
|
|
int ida_get_new_above(struct ida *ida, int starting_id, int *p_id);
|
|
void ida_remove(struct ida *ida, int id);
|
|
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);
|
|
# 179 "include/linux/idr.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ida_get_new(struct ida *ida, int *p_id)
|
|
{
|
|
return ida_get_new_above(ida, 0, p_id);
|
|
}
|
|
|
|
void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) idr_init_cache(void);
|
|
# 15 "include/linux/kernfs.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
struct file;
|
|
struct dentry;
|
|
struct iattr;
|
|
struct seq_file;
|
|
struct vm_area_struct;
|
|
struct super_block;
|
|
struct file_system_type;
|
|
|
|
struct kernfs_open_node;
|
|
struct kernfs_iattrs;
|
|
|
|
enum kernfs_node_type {
|
|
KERNFS_DIR = 0x0001,
|
|
KERNFS_FILE = 0x0002,
|
|
KERNFS_LINK = 0x0004,
|
|
};
|
|
|
|
|
|
|
|
|
|
enum kernfs_node_flag {
|
|
KERNFS_ACTIVATED = 0x0010,
|
|
KERNFS_NS = 0x0020,
|
|
KERNFS_HAS_SEQ_SHOW = 0x0040,
|
|
KERNFS_HAS_MMAP = 0x0080,
|
|
KERNFS_LOCKDEP = 0x0100,
|
|
KERNFS_SUICIDAL = 0x0400,
|
|
KERNFS_SUICIDED = 0x0800,
|
|
KERNFS_EMPTY_DIR = 0x1000,
|
|
};
|
|
|
|
|
|
enum kernfs_root_flag {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
KERNFS_ROOT_CREATE_DEACTIVATED = 0x0001,
|
|
# 70 "include/linux/kernfs.h"
|
|
KERNFS_ROOT_EXTRA_OPEN_PERM_CHECK = 0x0002,
|
|
};
|
|
|
|
|
|
struct kernfs_elem_dir {
|
|
unsigned long subdirs;
|
|
|
|
struct rb_root children;
|
|
|
|
|
|
|
|
|
|
|
|
struct kernfs_root *root;
|
|
};
|
|
|
|
struct kernfs_elem_symlink {
|
|
struct kernfs_node *target_kn;
|
|
};
|
|
|
|
struct kernfs_elem_attr {
|
|
const struct kernfs_ops *ops;
|
|
struct kernfs_open_node *open;
|
|
loff_t size;
|
|
struct kernfs_node *notify_next;
|
|
};
|
|
# 106 "include/linux/kernfs.h"
|
|
struct kernfs_node {
|
|
atomic_t count;
|
|
atomic_t active;
|
|
# 118 "include/linux/kernfs.h"
|
|
struct kernfs_node *parent;
|
|
const char *name;
|
|
|
|
struct rb_node rb;
|
|
|
|
const void *ns;
|
|
unsigned int hash;
|
|
union {
|
|
struct kernfs_elem_dir dir;
|
|
struct kernfs_elem_symlink symlink;
|
|
struct kernfs_elem_attr attr;
|
|
};
|
|
|
|
void *priv;
|
|
|
|
unsigned short flags;
|
|
umode_t mode;
|
|
unsigned int ino;
|
|
struct kernfs_iattrs *iattr;
|
|
};
|
|
# 146 "include/linux/kernfs.h"
|
|
struct kernfs_syscall_ops {
|
|
int (*remount_fs)(struct kernfs_root *root, int *flags, char *data);
|
|
int (*show_options)(struct seq_file *sf, struct kernfs_root *root);
|
|
|
|
int (*mkdir)(struct kernfs_node *parent, const char *name,
|
|
umode_t mode);
|
|
int (*rmdir)(struct kernfs_node *kn);
|
|
int (*rename)(struct kernfs_node *kn, struct kernfs_node *new_parent,
|
|
const char *new_name);
|
|
};
|
|
|
|
struct kernfs_root {
|
|
|
|
struct kernfs_node *kn;
|
|
unsigned int flags;
|
|
|
|
|
|
struct ida ino_ida;
|
|
struct kernfs_syscall_ops *syscall_ops;
|
|
|
|
|
|
struct list_head supers;
|
|
|
|
wait_queue_head_t deactivate_waitq;
|
|
};
|
|
|
|
struct kernfs_open_file {
|
|
|
|
struct kernfs_node *kn;
|
|
struct file *file;
|
|
void *priv;
|
|
|
|
|
|
struct mutex mutex;
|
|
int event;
|
|
struct list_head list;
|
|
char *prealloc_buf;
|
|
|
|
size_t atomic_write_len;
|
|
bool mmapped;
|
|
const struct vm_operations_struct *vm_ops;
|
|
};
|
|
|
|
struct kernfs_ops {
|
|
# 201 "include/linux/kernfs.h"
|
|
int (*seq_show)(struct seq_file *sf, void *v);
|
|
|
|
void *(*seq_start)(struct seq_file *sf, loff_t *ppos);
|
|
void *(*seq_next)(struct seq_file *sf, void *v, loff_t *ppos);
|
|
void (*seq_stop)(struct seq_file *sf, void *v);
|
|
|
|
ssize_t (*read)(struct kernfs_open_file *of, char *buf, size_t bytes,
|
|
loff_t off);
|
|
# 217 "include/linux/kernfs.h"
|
|
size_t atomic_write_len;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool prealloc;
|
|
ssize_t (*write)(struct kernfs_open_file *of, char *buf, size_t bytes,
|
|
loff_t off);
|
|
|
|
int (*mmap)(struct kernfs_open_file *of, struct vm_area_struct *vma);
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) enum kernfs_node_type kernfs_type(struct kernfs_node *kn)
|
|
{
|
|
return kn->flags & 0x000f;
|
|
}
|
|
# 250 "include/linux/kernfs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kernfs_enable_ns(struct kernfs_node *kn)
|
|
{
|
|
({ static bool __attribute__ ((__section__(".data.unlikely"))) __warned; int __ret_warn_once = !!(kernfs_type(kn) != KERNFS_DIR); if (__builtin_expect(!!(__ret_warn_once), 0)) if (({ int __ret_warn_on = !!(!__warned); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/kernfs.h", 252); __builtin_expect(!!(__ret_warn_on), 0); })) __warned = true; __builtin_expect(!!(__ret_warn_once), 0); });
|
|
({ static bool __attribute__ ((__section__(".data.unlikely"))) __warned; int __ret_warn_once = !!(!((&kn->dir.children)->rb_node == ((void *)0))); if (__builtin_expect(!!(__ret_warn_once), 0)) if (({ int __ret_warn_on = !!(!__warned); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/kernfs.h", 253); __builtin_expect(!!(__ret_warn_on), 0); })) __warned = true; __builtin_expect(!!(__ret_warn_once), 0); });
|
|
kn->flags |= KERNFS_NS;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool kernfs_ns_enabled(struct kernfs_node *kn)
|
|
{
|
|
return kn->flags & KERNFS_NS;
|
|
}
|
|
|
|
int kernfs_name(struct kernfs_node *kn, char *buf, size_t buflen);
|
|
size_t kernfs_path_len(struct kernfs_node *kn);
|
|
char * __attribute__((warn_unused_result)) kernfs_path(struct kernfs_node *kn, char *buf,
|
|
size_t buflen);
|
|
void pr_cont_kernfs_name(struct kernfs_node *kn);
|
|
void pr_cont_kernfs_path(struct kernfs_node *kn);
|
|
struct kernfs_node *kernfs_get_parent(struct kernfs_node *kn);
|
|
struct kernfs_node *kernfs_find_and_get_ns(struct kernfs_node *parent,
|
|
const char *name, const void *ns);
|
|
void kernfs_get(struct kernfs_node *kn);
|
|
void kernfs_put(struct kernfs_node *kn);
|
|
|
|
struct kernfs_node *kernfs_node_from_dentry(struct dentry *dentry);
|
|
struct kernfs_root *kernfs_root_from_sb(struct super_block *sb);
|
|
struct inode *kernfs_get_inode(struct super_block *sb, struct kernfs_node *kn);
|
|
|
|
struct kernfs_root *kernfs_create_root(struct kernfs_syscall_ops *scops,
|
|
unsigned int flags, void *priv);
|
|
void kernfs_destroy_root(struct kernfs_root *root);
|
|
|
|
struct kernfs_node *kernfs_create_dir_ns(struct kernfs_node *parent,
|
|
const char *name, umode_t mode,
|
|
void *priv, const void *ns);
|
|
struct kernfs_node *kernfs_create_empty_dir(struct kernfs_node *parent,
|
|
const char *name);
|
|
struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
|
|
const char *name,
|
|
umode_t mode, loff_t size,
|
|
const struct kernfs_ops *ops,
|
|
void *priv, const void *ns,
|
|
struct lock_class_key *key);
|
|
struct kernfs_node *kernfs_create_link(struct kernfs_node *parent,
|
|
const char *name,
|
|
struct kernfs_node *target);
|
|
void kernfs_activate(struct kernfs_node *kn);
|
|
void kernfs_remove(struct kernfs_node *kn);
|
|
void kernfs_break_active_protection(struct kernfs_node *kn);
|
|
void kernfs_unbreak_active_protection(struct kernfs_node *kn);
|
|
bool kernfs_remove_self(struct kernfs_node *kn);
|
|
int kernfs_remove_by_name_ns(struct kernfs_node *parent, const char *name,
|
|
const void *ns);
|
|
int kernfs_rename_ns(struct kernfs_node *kn, struct kernfs_node *new_parent,
|
|
const char *new_name, const void *new_ns);
|
|
int kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr);
|
|
void kernfs_notify(struct kernfs_node *kn);
|
|
|
|
const void *kernfs_super_ns(struct super_block *sb);
|
|
struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags,
|
|
struct kernfs_root *root, unsigned long magic,
|
|
bool *new_sb_created, const void *ns);
|
|
void kernfs_kill_sb(struct super_block *sb);
|
|
struct super_block *kernfs_pin_sb(struct kernfs_root *root, const void *ns);
|
|
|
|
void kernfs_init(void);
|
|
# 427 "include/linux/kernfs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kernfs_node *
|
|
kernfs_find_and_get(struct kernfs_node *kn, const char *name)
|
|
{
|
|
return kernfs_find_and_get_ns(kn, name, ((void *)0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kernfs_node *
|
|
kernfs_create_dir(struct kernfs_node *parent, const char *name, umode_t mode,
|
|
void *priv)
|
|
{
|
|
return kernfs_create_dir_ns(parent, name, mode, priv, ((void *)0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kernfs_node *
|
|
kernfs_create_file_ns(struct kernfs_node *parent, const char *name,
|
|
umode_t mode, loff_t size, const struct kernfs_ops *ops,
|
|
void *priv, const void *ns)
|
|
{
|
|
struct lock_class_key *key = ((void *)0);
|
|
|
|
|
|
|
|
|
|
return __kernfs_create_file(parent, name, mode, size, ops, priv, ns,
|
|
key);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kernfs_node *
|
|
kernfs_create_file(struct kernfs_node *parent, const char *name, umode_t mode,
|
|
loff_t size, const struct kernfs_ops *ops, void *priv)
|
|
{
|
|
return kernfs_create_file_ns(parent, name, mode, size, ops, priv, ((void *)0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kernfs_remove_by_name(struct kernfs_node *parent,
|
|
const char *name)
|
|
{
|
|
return kernfs_remove_by_name_ns(parent, name, ((void *)0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kernfs_rename(struct kernfs_node *kn,
|
|
struct kernfs_node *new_parent,
|
|
const char *new_name)
|
|
{
|
|
return kernfs_rename_ns(kn, new_parent, new_name, ((void *)0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dentry *
|
|
kernfs_mount(struct file_system_type *fs_type, int flags,
|
|
struct kernfs_root *root, unsigned long magic,
|
|
bool *new_sb_created)
|
|
{
|
|
return kernfs_mount_ns(fs_type, flags, root,
|
|
magic, new_sb_created, ((void *)0));
|
|
}
|
|
# 16 "include/linux/sysfs.h" 2
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/kobject_ns.h" 1
|
|
# 20 "include/linux/kobject_ns.h"
|
|
struct sock;
|
|
struct kobject;
|
|
|
|
|
|
|
|
|
|
|
|
enum kobj_ns_type {
|
|
KOBJ_NS_TYPE_NONE = 0,
|
|
KOBJ_NS_TYPE_NET,
|
|
KOBJ_NS_TYPES
|
|
};
|
|
# 40 "include/linux/kobject_ns.h"
|
|
struct kobj_ns_type_operations {
|
|
enum kobj_ns_type type;
|
|
bool (*current_may_mount)(void);
|
|
void *(*grab_current_ns)(void);
|
|
const void *(*netlink_ns)(struct sock *sk);
|
|
const void *(*initial_ns)(void);
|
|
void (*drop_ns)(void *);
|
|
};
|
|
|
|
int kobj_ns_type_register(const struct kobj_ns_type_operations *ops);
|
|
int kobj_ns_type_registered(enum kobj_ns_type type);
|
|
const struct kobj_ns_type_operations *kobj_child_ns_ops(struct kobject *parent);
|
|
const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj);
|
|
|
|
bool kobj_ns_current_may_mount(enum kobj_ns_type type);
|
|
void *kobj_ns_grab_current(enum kobj_ns_type type);
|
|
const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk);
|
|
const void *kobj_ns_initial(enum kobj_ns_type type);
|
|
void kobj_ns_drop(enum kobj_ns_type type, void *ns);
|
|
# 21 "include/linux/sysfs.h" 2
|
|
|
|
|
|
|
|
struct kobject;
|
|
struct module;
|
|
struct bin_attribute;
|
|
enum kobj_ns_type;
|
|
|
|
struct attribute {
|
|
const char *name;
|
|
umode_t mode;
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
# 83 "include/linux/sysfs.h"
|
|
struct attribute_group {
|
|
const char *name;
|
|
umode_t (*is_visible)(struct kobject *,
|
|
struct attribute *, int);
|
|
umode_t (*is_bin_visible)(struct kobject *,
|
|
struct bin_attribute *, int);
|
|
struct attribute **attrs;
|
|
struct bin_attribute **bin_attrs;
|
|
};
|
|
# 158 "include/linux/sysfs.h"
|
|
struct file;
|
|
struct vm_area_struct;
|
|
|
|
struct bin_attribute {
|
|
struct attribute attr;
|
|
size_t size;
|
|
void *private;
|
|
ssize_t (*read)(struct file *, struct kobject *, struct bin_attribute *,
|
|
char *, loff_t, size_t);
|
|
ssize_t (*write)(struct file *, struct kobject *, struct bin_attribute *,
|
|
char *, loff_t, size_t);
|
|
int (*mmap)(struct file *, struct kobject *, struct bin_attribute *attr,
|
|
struct vm_area_struct *vma);
|
|
};
|
|
# 215 "include/linux/sysfs.h"
|
|
struct sysfs_ops {
|
|
ssize_t (*show)(struct kobject *, struct attribute *, char *);
|
|
ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t);
|
|
};
|
|
|
|
|
|
|
|
int __attribute__((warn_unused_result)) sysfs_create_dir_ns(struct kobject *kobj, const void *ns);
|
|
void sysfs_remove_dir(struct kobject *kobj);
|
|
int __attribute__((warn_unused_result)) sysfs_rename_dir_ns(struct kobject *kobj, const char *new_name,
|
|
const void *new_ns);
|
|
int __attribute__((warn_unused_result)) sysfs_move_dir_ns(struct kobject *kobj,
|
|
struct kobject *new_parent_kobj,
|
|
const void *new_ns);
|
|
int __attribute__((warn_unused_result)) sysfs_create_mount_point(struct kobject *parent_kobj,
|
|
const char *name);
|
|
void sysfs_remove_mount_point(struct kobject *parent_kobj,
|
|
const char *name);
|
|
|
|
int __attribute__((warn_unused_result)) sysfs_create_file_ns(struct kobject *kobj,
|
|
const struct attribute *attr,
|
|
const void *ns);
|
|
int __attribute__((warn_unused_result)) sysfs_create_files(struct kobject *kobj,
|
|
const struct attribute **attr);
|
|
int __attribute__((warn_unused_result)) sysfs_chmod_file(struct kobject *kobj,
|
|
const struct attribute *attr, umode_t mode);
|
|
void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr,
|
|
const void *ns);
|
|
bool sysfs_remove_file_self(struct kobject *kobj, const struct attribute *attr);
|
|
void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr);
|
|
|
|
int __attribute__((warn_unused_result)) sysfs_create_bin_file(struct kobject *kobj,
|
|
const struct bin_attribute *attr);
|
|
void sysfs_remove_bin_file(struct kobject *kobj,
|
|
const struct bin_attribute *attr);
|
|
|
|
int __attribute__((warn_unused_result)) sysfs_create_link(struct kobject *kobj, struct kobject *target,
|
|
const char *name);
|
|
int __attribute__((warn_unused_result)) sysfs_create_link_nowarn(struct kobject *kobj,
|
|
struct kobject *target,
|
|
const char *name);
|
|
void sysfs_remove_link(struct kobject *kobj, const char *name);
|
|
|
|
int sysfs_rename_link_ns(struct kobject *kobj, struct kobject *target,
|
|
const char *old_name, const char *new_name,
|
|
const void *new_ns);
|
|
|
|
void sysfs_delete_link(struct kobject *dir, struct kobject *targ,
|
|
const char *name);
|
|
|
|
int __attribute__((warn_unused_result)) sysfs_create_group(struct kobject *kobj,
|
|
const struct attribute_group *grp);
|
|
int __attribute__((warn_unused_result)) sysfs_create_groups(struct kobject *kobj,
|
|
const struct attribute_group **groups);
|
|
int sysfs_update_group(struct kobject *kobj,
|
|
const struct attribute_group *grp);
|
|
void sysfs_remove_group(struct kobject *kobj,
|
|
const struct attribute_group *grp);
|
|
void sysfs_remove_groups(struct kobject *kobj,
|
|
const struct attribute_group **groups);
|
|
int sysfs_add_file_to_group(struct kobject *kobj,
|
|
const struct attribute *attr, const char *group);
|
|
void sysfs_remove_file_from_group(struct kobject *kobj,
|
|
const struct attribute *attr, const char *group);
|
|
int sysfs_merge_group(struct kobject *kobj,
|
|
const struct attribute_group *grp);
|
|
void sysfs_unmerge_group(struct kobject *kobj,
|
|
const struct attribute_group *grp);
|
|
int sysfs_add_link_to_group(struct kobject *kobj, const char *group_name,
|
|
struct kobject *target, const char *link_name);
|
|
void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name,
|
|
const char *link_name);
|
|
int __compat_only_sysfs_link_entry_to_kobj(struct kobject *kobj,
|
|
struct kobject *target_kobj,
|
|
const char *target_name);
|
|
|
|
void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr);
|
|
|
|
int __attribute__((warn_unused_result)) sysfs_init(void);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sysfs_enable_ns(struct kernfs_node *kn)
|
|
{
|
|
return kernfs_enable_ns(kn);
|
|
}
|
|
# 497 "include/linux/sysfs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) sysfs_create_file(struct kobject *kobj,
|
|
const struct attribute *attr)
|
|
{
|
|
return sysfs_create_file_ns(kobj, attr, ((void *)0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sysfs_remove_file(struct kobject *kobj,
|
|
const struct attribute *attr)
|
|
{
|
|
sysfs_remove_file_ns(kobj, attr, ((void *)0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sysfs_rename_link(struct kobject *kobj, struct kobject *target,
|
|
const char *old_name, const char *new_name)
|
|
{
|
|
return sysfs_rename_link_ns(kobj, target, old_name, new_name, ((void *)0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sysfs_notify_dirent(struct kernfs_node *kn)
|
|
{
|
|
kernfs_notify(kn);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kernfs_node *sysfs_get_dirent(struct kernfs_node *parent,
|
|
const unsigned char *name)
|
|
{
|
|
return kernfs_find_and_get(parent, name);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kernfs_node *sysfs_get(struct kernfs_node *kn)
|
|
{
|
|
kernfs_get(kn);
|
|
return kn;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sysfs_put(struct kernfs_node *kn)
|
|
{
|
|
kernfs_put(kn);
|
|
}
|
|
# 22 "include/linux/kobject.h" 2
|
|
|
|
|
|
# 1 "include/linux/kref.h" 1
|
|
# 23 "include/linux/kref.h"
|
|
struct kref {
|
|
atomic_t refcount;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kref_init(struct kref *kref)
|
|
{
|
|
({ union { typeof(((&kref->refcount)->counter)) __val; char __c[1]; } __u = { .__val = ( typeof(((&kref->refcount)->counter))) ((1)) }; __write_once_size(&(((&kref->refcount)->counter)), __u.__c, sizeof(((&kref->refcount)->counter))); __u.__val; });
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kref_get(struct kref *kref)
|
|
{
|
|
|
|
|
|
|
|
|
|
({ static bool __attribute__ ((__section__(".data.unlikely"))) __warned; int __ret_warn_once = !!(({ typeof((atomic_add_return_relaxed(1, &kref->refcount))) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = (atomic_add_return_relaxed(1, &kref->refcount)); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) < 2); if (__builtin_expect(!!(__ret_warn_once), 0)) if (({ int __ret_warn_on = !!(!__warned); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/kref.h", 46); __builtin_expect(!!(__ret_warn_on), 0); })) __warned = true; __builtin_expect(!!(__ret_warn_once), 0); });
|
|
}
|
|
# 67 "include/linux/kref.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kref_sub(struct kref *kref, unsigned int count,
|
|
void (*release)(struct kref *kref))
|
|
{
|
|
({ int __ret_warn_on = !!(release == ((void *)0)); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/kref.h", 70); __builtin_expect(!!(__ret_warn_on), 0); });
|
|
|
|
if ((({ typeof(atomic_sub_return_relaxed((int) count, &kref->refcount)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_sub_return_relaxed((int) count, &kref->refcount); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) == 0)) {
|
|
release(kref);
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
# 96 "include/linux/kref.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kref_put(struct kref *kref, void (*release)(struct kref *kref))
|
|
{
|
|
return kref_sub(kref, 1, release);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kref_put_mutex(struct kref *kref,
|
|
void (*release)(struct kref *kref),
|
|
struct mutex *lock)
|
|
{
|
|
({ int __ret_warn_on = !!(release == ((void *)0)); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/kref.h", 105); __builtin_expect(!!(__ret_warn_on), 0); });
|
|
if (__builtin_expect(!!(!atomic_add_unless(&kref->refcount, -1, 1)), 0)) {
|
|
mutex_lock(lock);
|
|
if (__builtin_expect(!!(!(({ typeof(atomic_sub_return_relaxed(1, &kref->refcount)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_sub_return_relaxed(1, &kref->refcount); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) == 0)), 0)) {
|
|
mutex_unlock(lock);
|
|
return 0;
|
|
}
|
|
release(kref);
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
# 134 "include/linux/kref.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) kref_get_unless_zero(struct kref *kref)
|
|
{
|
|
return atomic_add_unless(&kref->refcount, 1, 0);
|
|
}
|
|
# 25 "include/linux/kobject.h" 2
|
|
# 37 "include/linux/kobject.h"
|
|
extern char uevent_helper[];
|
|
|
|
|
|
|
|
extern u64 uevent_seqnum;
|
|
# 53 "include/linux/kobject.h"
|
|
enum kobject_action {
|
|
KOBJ_ADD,
|
|
KOBJ_REMOVE,
|
|
KOBJ_CHANGE,
|
|
KOBJ_MOVE,
|
|
KOBJ_ONLINE,
|
|
KOBJ_OFFLINE,
|
|
KOBJ_MAX
|
|
};
|
|
|
|
struct kobject {
|
|
const char *name;
|
|
struct list_head entry;
|
|
struct kobject *parent;
|
|
struct kset *kset;
|
|
struct kobj_type *ktype;
|
|
struct kernfs_node *sd;
|
|
struct kref kref;
|
|
|
|
|
|
|
|
unsigned int state_initialized:1;
|
|
unsigned int state_in_sysfs:1;
|
|
unsigned int state_add_uevent_sent:1;
|
|
unsigned int state_remove_uevent_sent:1;
|
|
unsigned int uevent_suppress:1;
|
|
};
|
|
|
|
extern __attribute__((format(printf, 2, 3)))
|
|
int kobject_set_name(struct kobject *kobj, const char *name, ...);
|
|
extern __attribute__((format(printf, 2, 0)))
|
|
int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
|
|
va_list vargs);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const char *kobject_name(const struct kobject *kobj)
|
|
{
|
|
return kobj->name;
|
|
}
|
|
|
|
extern void kobject_init(struct kobject *kobj, struct kobj_type *ktype);
|
|
extern __attribute__((format(printf, 3, 4))) __attribute__((warn_unused_result))
|
|
int kobject_add(struct kobject *kobj, struct kobject *parent,
|
|
const char *fmt, ...);
|
|
extern __attribute__((format(printf, 4, 5))) __attribute__((warn_unused_result))
|
|
int kobject_init_and_add(struct kobject *kobj,
|
|
struct kobj_type *ktype, struct kobject *parent,
|
|
const char *fmt, ...);
|
|
|
|
extern void kobject_del(struct kobject *kobj);
|
|
|
|
extern struct kobject * __attribute__((warn_unused_result)) kobject_create(void);
|
|
extern struct kobject * __attribute__((warn_unused_result)) kobject_create_and_add(const char *name,
|
|
struct kobject *parent);
|
|
|
|
extern int __attribute__((warn_unused_result)) kobject_rename(struct kobject *, const char *new_name);
|
|
extern int __attribute__((warn_unused_result)) kobject_move(struct kobject *, struct kobject *);
|
|
|
|
extern struct kobject *kobject_get(struct kobject *kobj);
|
|
extern void kobject_put(struct kobject *kobj);
|
|
|
|
extern const void *kobject_namespace(struct kobject *kobj);
|
|
extern char *kobject_get_path(struct kobject *kobj, gfp_t flag);
|
|
|
|
struct kobj_type {
|
|
void (*release)(struct kobject *kobj);
|
|
const struct sysfs_ops *sysfs_ops;
|
|
struct attribute **default_attrs;
|
|
const struct kobj_ns_type_operations *(*child_ns_type)(struct kobject *kobj);
|
|
const void *(*namespace)(struct kobject *kobj);
|
|
};
|
|
|
|
struct kobj_uevent_env {
|
|
char *argv[3];
|
|
char *envp[32];
|
|
int envp_idx;
|
|
char buf[2048];
|
|
int buflen;
|
|
};
|
|
|
|
struct kset_uevent_ops {
|
|
int (* const filter)(struct kset *kset, struct kobject *kobj);
|
|
const char *(* const name)(struct kset *kset, struct kobject *kobj);
|
|
int (* const uevent)(struct kset *kset, struct kobject *kobj,
|
|
struct kobj_uevent_env *env);
|
|
};
|
|
|
|
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);
|
|
};
|
|
|
|
extern const struct sysfs_ops kobj_sysfs_ops;
|
|
|
|
struct sock;
|
|
# 168 "include/linux/kobject.h"
|
|
struct kset {
|
|
struct list_head list;
|
|
spinlock_t list_lock;
|
|
struct kobject kobj;
|
|
const struct kset_uevent_ops *uevent_ops;
|
|
};
|
|
|
|
extern void kset_init(struct kset *kset);
|
|
extern int __attribute__((warn_unused_result)) kset_register(struct kset *kset);
|
|
extern void kset_unregister(struct kset *kset);
|
|
extern struct kset * __attribute__((warn_unused_result)) kset_create_and_add(const char *name,
|
|
const struct kset_uevent_ops *u,
|
|
struct kobject *parent_kobj);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kset *to_kset(struct kobject *kobj)
|
|
{
|
|
return kobj ? ({ const typeof( ((struct kset *)0)->kobj ) *__mptr = (kobj); (struct kset *)( (char *)__mptr - __builtin_offsetof(struct kset, kobj) );}) : ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kset *kset_get(struct kset *k)
|
|
{
|
|
return k ? to_kset(kobject_get(&k->kobj)) : ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kset_put(struct kset *k)
|
|
{
|
|
kobject_put(&k->kobj);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kobj_type *get_ktype(struct kobject *kobj)
|
|
{
|
|
return kobj->ktype;
|
|
}
|
|
|
|
extern struct kobject *kset_find_obj(struct kset *, const char *);
|
|
|
|
|
|
extern struct kobject *kernel_kobj;
|
|
|
|
extern struct kobject *mm_kobj;
|
|
|
|
extern struct kobject *hypervisor_kobj;
|
|
|
|
extern struct kobject *power_kobj;
|
|
|
|
extern struct kobject *firmware_kobj;
|
|
|
|
int kobject_uevent(struct kobject *kobj, enum kobject_action action);
|
|
int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
|
|
char *envp[]);
|
|
|
|
__attribute__((format(printf, 2, 3)))
|
|
int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...);
|
|
|
|
int kobject_action_type(const char *buf, size_t count,
|
|
enum kobject_action *type);
|
|
# 18 "include/linux/module.h" 2
|
|
# 1 "include/linux/moduleparam.h" 1
|
|
# 37 "include/linux/moduleparam.h"
|
|
struct kernel_param;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
KERNEL_PARAM_OPS_FL_NOARG = (1 << 0)
|
|
};
|
|
|
|
struct kernel_param_ops {
|
|
|
|
unsigned int flags;
|
|
|
|
int (*set)(const char *val, const struct kernel_param *kp);
|
|
|
|
int (*get)(char *buffer, const struct kernel_param *kp);
|
|
|
|
void (*free)(void *arg);
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
KERNEL_PARAM_FL_UNSAFE = (1 << 0)
|
|
};
|
|
|
|
struct kernel_param {
|
|
const char *name;
|
|
struct module *mod;
|
|
const struct kernel_param_ops *ops;
|
|
const u16 perm;
|
|
s8 level;
|
|
u8 flags;
|
|
union {
|
|
void *arg;
|
|
const struct kparam_string *str;
|
|
const struct kparam_array *arr;
|
|
};
|
|
};
|
|
|
|
extern const struct kernel_param __start___param[], __stop___param[];
|
|
|
|
|
|
struct kparam_string {
|
|
unsigned int maxlen;
|
|
char *string;
|
|
};
|
|
|
|
|
|
struct kparam_array
|
|
{
|
|
unsigned int max;
|
|
unsigned int elemsize;
|
|
unsigned int *num;
|
|
const struct kernel_param_ops *ops;
|
|
void *elem;
|
|
};
|
|
# 236 "include/linux/moduleparam.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
__check_old_set_param(int (*oldset)(const char *, struct kernel_param *))
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void kernel_param_lock(struct module *mod);
|
|
extern void kernel_param_unlock(struct module *mod);
|
|
# 307 "include/linux/moduleparam.h"
|
|
extern bool parameq(const char *name1, const char *name2);
|
|
# 317 "include/linux/moduleparam.h"
|
|
extern bool parameqn(const char *name1, const char *name2, size_t n);
|
|
|
|
|
|
extern char *parse_args(const char *name,
|
|
char *args,
|
|
const struct kernel_param *params,
|
|
unsigned num,
|
|
s16 level_min,
|
|
s16 level_max,
|
|
void *arg,
|
|
int (*unknown)(char *param, char *val,
|
|
const char *doing, void *arg));
|
|
|
|
|
|
|
|
extern void destroy_params(const struct kernel_param *params, unsigned num);
|
|
# 346 "include/linux/moduleparam.h"
|
|
extern const struct kernel_param_ops param_ops_byte;
|
|
extern int param_set_byte(const char *val, const struct kernel_param *kp);
|
|
extern int param_get_byte(char *buffer, const struct kernel_param *kp);
|
|
|
|
|
|
extern const struct kernel_param_ops param_ops_short;
|
|
extern int param_set_short(const char *val, const struct kernel_param *kp);
|
|
extern int param_get_short(char *buffer, const struct kernel_param *kp);
|
|
|
|
|
|
extern const struct kernel_param_ops param_ops_ushort;
|
|
extern int param_set_ushort(const char *val, const struct kernel_param *kp);
|
|
extern int param_get_ushort(char *buffer, const struct kernel_param *kp);
|
|
|
|
|
|
extern const struct kernel_param_ops param_ops_int;
|
|
extern int param_set_int(const char *val, const struct kernel_param *kp);
|
|
extern int param_get_int(char *buffer, const struct kernel_param *kp);
|
|
|
|
|
|
extern const struct kernel_param_ops param_ops_uint;
|
|
extern int param_set_uint(const char *val, const struct kernel_param *kp);
|
|
extern int param_get_uint(char *buffer, const struct kernel_param *kp);
|
|
|
|
|
|
extern const struct kernel_param_ops param_ops_long;
|
|
extern int param_set_long(const char *val, const struct kernel_param *kp);
|
|
extern int param_get_long(char *buffer, const struct kernel_param *kp);
|
|
|
|
|
|
extern const struct kernel_param_ops param_ops_ulong;
|
|
extern int param_set_ulong(const char *val, const struct kernel_param *kp);
|
|
extern int param_get_ulong(char *buffer, const struct kernel_param *kp);
|
|
|
|
|
|
extern const struct kernel_param_ops param_ops_ullong;
|
|
extern int param_set_ullong(const char *val, const struct kernel_param *kp);
|
|
extern int param_get_ullong(char *buffer, const struct kernel_param *kp);
|
|
|
|
|
|
extern const struct kernel_param_ops param_ops_charp;
|
|
extern int param_set_charp(const char *val, const struct kernel_param *kp);
|
|
extern int param_get_charp(char *buffer, const struct kernel_param *kp);
|
|
extern void param_free_charp(void *arg);
|
|
|
|
|
|
|
|
extern const struct kernel_param_ops param_ops_bool;
|
|
extern int param_set_bool(const char *val, const struct kernel_param *kp);
|
|
extern int param_get_bool(char *buffer, const struct kernel_param *kp);
|
|
|
|
|
|
extern const struct kernel_param_ops param_ops_bool_enable_only;
|
|
extern int param_set_bool_enable_only(const char *val,
|
|
const struct kernel_param *kp);
|
|
|
|
|
|
|
|
extern const struct kernel_param_ops param_ops_invbool;
|
|
extern int param_set_invbool(const char *val, const struct kernel_param *kp);
|
|
extern int param_get_invbool(char *buffer, const struct kernel_param *kp);
|
|
|
|
|
|
|
|
extern const struct kernel_param_ops param_ops_bint;
|
|
extern int param_set_bint(const char *val, const struct kernel_param *kp);
|
|
# 454 "include/linux/moduleparam.h"
|
|
extern const struct kernel_param_ops param_array_ops;
|
|
|
|
extern const struct kernel_param_ops param_ops_string;
|
|
extern int param_set_copystring(const char *val, const struct kernel_param *);
|
|
extern int param_get_string(char *buffer, const struct kernel_param *kp);
|
|
|
|
|
|
|
|
struct module;
|
|
|
|
|
|
extern int module_param_sysfs_setup(struct module *mod,
|
|
const struct kernel_param *kparam,
|
|
unsigned int num_params);
|
|
|
|
extern void module_param_sysfs_remove(struct module *mod);
|
|
# 19 "include/linux/module.h" 2
|
|
# 1 "include/linux/jump_label.h" 1
|
|
# 81 "include/linux/jump_label.h"
|
|
extern bool static_key_initialized;
|
|
# 99 "include/linux/jump_label.h"
|
|
struct static_key {
|
|
atomic_t enabled;
|
|
};
|
|
# 111 "include/linux/jump_label.h"
|
|
enum jump_label_type {
|
|
JUMP_LABEL_NOP = 0,
|
|
JUMP_LABEL_JMP,
|
|
};
|
|
|
|
struct module;
|
|
# 170 "include/linux/jump_label.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int static_key_count(struct static_key *key)
|
|
{
|
|
return ({ union { typeof((&key->enabled)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&key->enabled)->counter), __u.__c, sizeof((&key->enabled)->counter)); else __read_once_size_nocheck(&((&key->enabled)->counter), __u.__c, sizeof((&key->enabled)->counter)); __u.__val; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void jump_label_init(void)
|
|
{
|
|
static_key_initialized = true;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) bool static_key_false(struct static_key *key)
|
|
{
|
|
if (__builtin_expect(!!(static_key_count(key) > 0), 0))
|
|
return true;
|
|
return false;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) bool static_key_true(struct static_key *key)
|
|
{
|
|
if (__builtin_expect(!!(static_key_count(key) > 0), 1))
|
|
return true;
|
|
return false;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void static_key_slow_inc(struct static_key *key)
|
|
{
|
|
({ int __ret_warn_on = !!(!static_key_initialized); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_fmt("include/linux/jump_label.h", 196, "%s used before call to jump_label_init", __func__); __builtin_expect(!!(__ret_warn_on), 0); });
|
|
atomic_add(1, &key->enabled);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void static_key_slow_dec(struct static_key *key)
|
|
{
|
|
({ int __ret_warn_on = !!(!static_key_initialized); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_fmt("include/linux/jump_label.h", 202, "%s used before call to jump_label_init", __func__); __builtin_expect(!!(__ret_warn_on), 0); });
|
|
atomic_sub(1, &key->enabled);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int jump_label_text_reserved(void *start, void *end)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void jump_label_lock(void) {}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void jump_label_unlock(void) {}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int jump_label_apply_nops(struct module *mod)
|
|
{
|
|
return 0;
|
|
}
|
|
# 227 "include/linux/jump_label.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void static_key_enable(struct static_key *key)
|
|
{
|
|
int count = static_key_count(key);
|
|
|
|
({ static bool __attribute__ ((__section__(".data.unlikely"))) __warned; int __ret_warn_once = !!(count < 0 || count > 1); if (__builtin_expect(!!(__ret_warn_once), 0)) if (({ int __ret_warn_on = !!(!__warned); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/jump_label.h", 231); __builtin_expect(!!(__ret_warn_on), 0); })) __warned = true; __builtin_expect(!!(__ret_warn_once), 0); });
|
|
|
|
if (!count)
|
|
static_key_slow_inc(key);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void static_key_disable(struct static_key *key)
|
|
{
|
|
int count = static_key_count(key);
|
|
|
|
({ static bool __attribute__ ((__section__(".data.unlikely"))) __warned; int __ret_warn_once = !!(count < 0 || count > 1); if (__builtin_expect(!!(__ret_warn_once), 0)) if (({ int __ret_warn_on = !!(!__warned); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/jump_label.h", 241); __builtin_expect(!!(__ret_warn_on), 0); })) __warned = true; __builtin_expect(!!(__ret_warn_once), 0); });
|
|
|
|
if (count)
|
|
static_key_slow_dec(key);
|
|
}
|
|
# 256 "include/linux/jump_label.h"
|
|
struct static_key_true {
|
|
struct static_key key;
|
|
};
|
|
|
|
struct static_key_false {
|
|
struct static_key key;
|
|
};
|
|
# 273 "include/linux/jump_label.h"
|
|
extern bool ____wrong_branch_error(void);
|
|
# 20 "include/linux/module.h" 2
|
|
|
|
# 1 "include/linux/rbtree_latch.h" 1
|
|
# 38 "include/linux/rbtree_latch.h"
|
|
struct latch_tree_node {
|
|
struct rb_node node[2];
|
|
};
|
|
|
|
struct latch_tree_root {
|
|
seqcount_t seq;
|
|
struct rb_root tree[2];
|
|
};
|
|
# 62 "include/linux/rbtree_latch.h"
|
|
struct latch_tree_ops {
|
|
bool (*less)(struct latch_tree_node *a, struct latch_tree_node *b);
|
|
int (*comp)(void *key, struct latch_tree_node *b);
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) struct latch_tree_node *
|
|
__lt_from_rb(struct rb_node *node, int idx)
|
|
{
|
|
return ({ const typeof( ((struct latch_tree_node *)0)->node[idx] ) *__mptr = (node); (struct latch_tree_node *)( (char *)__mptr - __builtin_offsetof(struct latch_tree_node, node[idx]) );});
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void
|
|
__lt_insert(struct latch_tree_node *ltn, struct latch_tree_root *ltr, int idx,
|
|
bool (*less)(struct latch_tree_node *a, struct latch_tree_node *b))
|
|
{
|
|
struct rb_root *root = <r->tree[idx];
|
|
struct rb_node **link = &root->rb_node;
|
|
struct rb_node *node = <n->node[idx];
|
|
struct rb_node *parent = ((void *)0);
|
|
struct latch_tree_node *ltp;
|
|
|
|
while (*link) {
|
|
parent = *link;
|
|
ltp = __lt_from_rb(parent, idx);
|
|
|
|
if (less(ltn, ltp))
|
|
link = &parent->rb_left;
|
|
else
|
|
link = &parent->rb_right;
|
|
}
|
|
|
|
rb_link_node_rcu(node, parent, link);
|
|
rb_insert_color(node, root);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void
|
|
__lt_erase(struct latch_tree_node *ltn, struct latch_tree_root *ltr, int idx)
|
|
{
|
|
rb_erase(<n->node[idx], <r->tree[idx]);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) struct latch_tree_node *
|
|
__lt_find(void *key, struct latch_tree_root *ltr, int idx,
|
|
int (*comp)(void *key, struct latch_tree_node *node))
|
|
{
|
|
struct rb_node *node = ({ typeof(*(ltr->tree[idx].rb_node)) *________p1 = (typeof(*(ltr->tree[idx].rb_node)) *)({ typeof((ltr->tree[idx].rb_node)) _________p1 = ({ union { typeof((ltr->tree[idx].rb_node)) __val; char __c[1]; } __u; if (1) __read_once_size(&((ltr->tree[idx].rb_node)), __u.__c, sizeof((ltr->tree[idx].rb_node))); else __read_once_size_nocheck(&((ltr->tree[idx].rb_node)), __u.__c, sizeof((ltr->tree[idx].rb_node))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(ltr->tree[idx].rb_node)) *)(________p1)); });
|
|
struct latch_tree_node *ltn;
|
|
int c;
|
|
|
|
while (node) {
|
|
ltn = __lt_from_rb(node, idx);
|
|
c = comp(key, ltn);
|
|
|
|
if (c < 0)
|
|
node = ({ typeof(*(node->rb_left)) *________p1 = (typeof(*(node->rb_left)) *)({ typeof((node->rb_left)) _________p1 = ({ union { typeof((node->rb_left)) __val; char __c[1]; } __u; if (1) __read_once_size(&((node->rb_left)), __u.__c, sizeof((node->rb_left))); else __read_once_size_nocheck(&((node->rb_left)), __u.__c, sizeof((node->rb_left))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(node->rb_left)) *)(________p1)); });
|
|
else if (c > 0)
|
|
node = ({ typeof(*(node->rb_right)) *________p1 = (typeof(*(node->rb_right)) *)({ typeof((node->rb_right)) _________p1 = ({ union { typeof((node->rb_right)) __val; char __c[1]; } __u; if (1) __read_once_size(&((node->rb_right)), __u.__c, sizeof((node->rb_right))); else __read_once_size_nocheck(&((node->rb_right)), __u.__c, sizeof((node->rb_right))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(node->rb_right)) *)(________p1)); });
|
|
else
|
|
return ltn;
|
|
}
|
|
|
|
return ((void *)0);
|
|
}
|
|
# 141 "include/linux/rbtree_latch.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void
|
|
latch_tree_insert(struct latch_tree_node *node,
|
|
struct latch_tree_root *root,
|
|
const struct latch_tree_ops *ops)
|
|
{
|
|
raw_write_seqcount_latch(&root->seq);
|
|
__lt_insert(node, root, 0, ops->less);
|
|
raw_write_seqcount_latch(&root->seq);
|
|
__lt_insert(node, root, 1, ops->less);
|
|
}
|
|
# 168 "include/linux/rbtree_latch.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void
|
|
latch_tree_erase(struct latch_tree_node *node,
|
|
struct latch_tree_root *root,
|
|
const struct latch_tree_ops *ops)
|
|
{
|
|
raw_write_seqcount_latch(&root->seq);
|
|
__lt_erase(node, root, 0);
|
|
raw_write_seqcount_latch(&root->seq);
|
|
__lt_erase(node, root, 1);
|
|
}
|
|
# 197 "include/linux/rbtree_latch.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) struct latch_tree_node *
|
|
latch_tree_find(void *key, struct latch_tree_root *root,
|
|
const struct latch_tree_ops *ops)
|
|
{
|
|
struct latch_tree_node *node;
|
|
unsigned int seq;
|
|
|
|
do {
|
|
seq = raw_read_seqcount_latch(&root->seq);
|
|
node = __lt_find(key, root, seq & 1, ops->comp);
|
|
} while (read_seqcount_retry(&root->seq, seq));
|
|
|
|
return node;
|
|
}
|
|
# 22 "include/linux/module.h" 2
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/module.h" 1
|
|
|
|
|
|
|
|
# 1 "include/asm-generic/module.h" 1
|
|
# 5 "./arch/arm/include/asm/module.h" 2
|
|
|
|
struct unwind_table;
|
|
|
|
|
|
enum {
|
|
ARM_SEC_INIT,
|
|
ARM_SEC_DEVINIT,
|
|
ARM_SEC_CORE,
|
|
ARM_SEC_EXIT,
|
|
ARM_SEC_DEVEXIT,
|
|
ARM_SEC_HOT,
|
|
ARM_SEC_UNLIKELY,
|
|
ARM_SEC_MAX,
|
|
};
|
|
|
|
|
|
struct mod_arch_specific {
|
|
|
|
struct unwind_table *unwind[ARM_SEC_MAX];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
u32 get_module_plt(struct module *mod, unsigned long loc, Elf32_Addr val);
|
|
# 25 "include/linux/module.h" 2
|
|
# 34 "include/linux/module.h"
|
|
struct modversion_info {
|
|
unsigned long crc;
|
|
char name[(64 - sizeof(unsigned long))];
|
|
};
|
|
|
|
struct module;
|
|
|
|
struct module_kobject {
|
|
struct kobject kobj;
|
|
struct module *mod;
|
|
struct kobject *drivers_dir;
|
|
struct module_param_attrs *mp;
|
|
struct completion *kobj_completion;
|
|
};
|
|
|
|
struct module_attribute {
|
|
struct attribute attr;
|
|
ssize_t (*show)(struct module_attribute *, struct module_kobject *,
|
|
char *);
|
|
ssize_t (*store)(struct module_attribute *, struct module_kobject *,
|
|
const char *, size_t count);
|
|
void (*setup)(struct module *, const char *);
|
|
int (*test)(struct module *);
|
|
void (*free)(struct module *);
|
|
};
|
|
|
|
struct module_version_attribute {
|
|
struct module_attribute mattr;
|
|
const char *module_name;
|
|
const char *version;
|
|
} __attribute__ ((__aligned__(sizeof(void *))));
|
|
|
|
extern ssize_t __modver_version_show(struct module_attribute *,
|
|
struct module_kobject *, char *);
|
|
|
|
extern struct module_attribute module_uevent;
|
|
|
|
|
|
extern int init_module(void);
|
|
extern void cleanup_module(void);
|
|
# 159 "include/linux/module.h"
|
|
struct exception_table_entry;
|
|
|
|
const struct exception_table_entry *
|
|
search_extable(const struct exception_table_entry *first,
|
|
const struct exception_table_entry *last,
|
|
unsigned long value);
|
|
void sort_extable(struct exception_table_entry *start,
|
|
struct exception_table_entry *finish);
|
|
void sort_main_extable(void);
|
|
void trim_init_extable(struct module *m);
|
|
# 272 "include/linux/module.h"
|
|
const struct exception_table_entry *search_exception_tables(unsigned long add);
|
|
|
|
struct notifier_block;
|
|
|
|
|
|
|
|
extern int modules_disabled;
|
|
|
|
void *__symbol_get(const char *symbol);
|
|
void *__symbol_get_gpl(const char *symbol);
|
|
|
|
|
|
|
|
struct module_use {
|
|
struct list_head source_list;
|
|
struct list_head target_list;
|
|
struct module *source, *target;
|
|
};
|
|
|
|
enum module_state {
|
|
MODULE_STATE_LIVE,
|
|
MODULE_STATE_COMING,
|
|
MODULE_STATE_GOING,
|
|
MODULE_STATE_UNFORMED,
|
|
};
|
|
|
|
struct module;
|
|
|
|
struct mod_tree_node {
|
|
struct module *mod;
|
|
struct latch_tree_node node;
|
|
};
|
|
|
|
struct mod_kallsyms {
|
|
Elf32_Sym *symtab;
|
|
unsigned int num_symtab;
|
|
char *strtab;
|
|
};
|
|
|
|
struct module {
|
|
enum module_state state;
|
|
|
|
|
|
struct list_head list;
|
|
|
|
|
|
char name[(64 - sizeof(unsigned long))];
|
|
|
|
|
|
struct module_kobject mkobj;
|
|
struct module_attribute *modinfo_attrs;
|
|
const char *version;
|
|
const char *srcversion;
|
|
struct kobject *holders_dir;
|
|
|
|
|
|
const struct kernel_symbol *syms;
|
|
const unsigned long *crcs;
|
|
unsigned int num_syms;
|
|
|
|
|
|
|
|
struct mutex param_lock;
|
|
|
|
struct kernel_param *kp;
|
|
unsigned int num_kp;
|
|
|
|
|
|
unsigned int num_gpl_syms;
|
|
const struct kernel_symbol *gpl_syms;
|
|
const unsigned long *gpl_crcs;
|
|
# 361 "include/linux/module.h"
|
|
bool async_probe_requested;
|
|
|
|
|
|
const struct kernel_symbol *gpl_future_syms;
|
|
const unsigned long *gpl_future_crcs;
|
|
unsigned int num_gpl_future_syms;
|
|
|
|
|
|
unsigned int num_exentries;
|
|
struct exception_table_entry *extable;
|
|
|
|
|
|
int (*init)(void);
|
|
# 383 "include/linux/module.h"
|
|
void *module_init __attribute__((__aligned__((1 << 6))));
|
|
|
|
|
|
void *module_core;
|
|
|
|
|
|
unsigned int init_size, core_size;
|
|
|
|
|
|
unsigned int init_text_size, core_text_size;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct mod_tree_node mtn_core;
|
|
struct mod_tree_node mtn_init;
|
|
|
|
|
|
|
|
unsigned int init_ro_size, core_ro_size;
|
|
|
|
|
|
struct mod_arch_specific arch;
|
|
|
|
unsigned int taints;
|
|
|
|
|
|
|
|
unsigned num_bugs;
|
|
struct list_head bug_list;
|
|
struct bug_entry *bug_table;
|
|
|
|
|
|
|
|
|
|
struct mod_kallsyms *kallsyms;
|
|
struct mod_kallsyms core_kallsyms;
|
|
|
|
|
|
struct module_sect_attrs *sect_attrs;
|
|
|
|
|
|
struct module_notes_attrs *notes_attrs;
|
|
|
|
|
|
|
|
|
|
char *args;
|
|
|
|
|
|
|
|
void *percpu;
|
|
unsigned int percpu_size;
|
|
# 470 "include/linux/module.h"
|
|
struct list_head source_list;
|
|
|
|
struct list_head target_list;
|
|
|
|
|
|
void (*exit)(void);
|
|
|
|
atomic_t refcnt;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} __attribute__((__aligned__((1 << 6))));
|
|
|
|
|
|
|
|
|
|
extern struct mutex module_mutex;
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int module_is_live(struct module *mod)
|
|
{
|
|
return mod->state != MODULE_STATE_GOING;
|
|
}
|
|
|
|
struct module *__module_text_address(unsigned long addr);
|
|
struct module *__module_address(unsigned long addr);
|
|
bool is_module_address(unsigned long addr);
|
|
bool is_module_percpu_address(unsigned long addr);
|
|
bool is_module_text_address(unsigned long addr);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool within_module_core(unsigned long addr,
|
|
const struct module *mod)
|
|
{
|
|
return (unsigned long)mod->module_core <= addr &&
|
|
addr < (unsigned long)mod->module_core + mod->core_size;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool within_module_init(unsigned long addr,
|
|
const struct module *mod)
|
|
{
|
|
return (unsigned long)mod->module_init <= addr &&
|
|
addr < (unsigned long)mod->module_init + mod->init_size;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool within_module(unsigned long addr, const struct module *mod)
|
|
{
|
|
return within_module_init(addr, mod) || within_module_core(addr, mod);
|
|
}
|
|
|
|
|
|
struct module *find_module(const char *name);
|
|
|
|
struct symsearch {
|
|
const struct kernel_symbol *start, *stop;
|
|
const unsigned long *crcs;
|
|
enum {
|
|
NOT_GPL_ONLY,
|
|
GPL_ONLY,
|
|
WILL_BE_GPL_ONLY,
|
|
} licence;
|
|
bool unused;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const struct kernel_symbol *find_symbol(const char *name,
|
|
struct module **owner,
|
|
const unsigned long **crc,
|
|
bool gplok,
|
|
bool warn);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool each_symbol_section(bool (*fn)(const struct symsearch *arr,
|
|
struct module *owner,
|
|
void *data), void *data);
|
|
|
|
|
|
|
|
int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
|
|
char *name, char *module_name, int *exported);
|
|
|
|
|
|
unsigned long module_kallsyms_lookup_name(const char *name);
|
|
|
|
int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,
|
|
struct module *, unsigned long),
|
|
void *data);
|
|
|
|
extern void __module_put_and_exit(struct module *mod, long code)
|
|
__attribute__((noreturn));
|
|
|
|
|
|
|
|
int module_refcount(struct module *mod);
|
|
void __symbol_put(const char *symbol);
|
|
|
|
void symbol_put_addr(void *addr);
|
|
|
|
|
|
|
|
extern void __module_get(struct module *module);
|
|
|
|
|
|
|
|
extern bool try_module_get(struct module *module);
|
|
|
|
extern void module_put(struct module *module);
|
|
# 606 "include/linux/module.h"
|
|
int ref_module(struct module *a, struct module *b);
|
|
# 618 "include/linux/module.h"
|
|
const char *module_address_lookup(unsigned long addr,
|
|
unsigned long *symbolsize,
|
|
unsigned long *offset,
|
|
char **modname,
|
|
char *namebuf);
|
|
int lookup_module_symbol_name(unsigned long addr, char *symname);
|
|
int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name);
|
|
|
|
|
|
const struct exception_table_entry *search_module_extables(unsigned long addr);
|
|
|
|
int register_module_notifier(struct notifier_block *nb);
|
|
int unregister_module_notifier(struct notifier_block *nb);
|
|
|
|
extern void print_modules(void);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool module_requested_async_probing(struct module *module)
|
|
{
|
|
return module && module->async_probe_requested;
|
|
}
|
|
# 758 "include/linux/module.h"
|
|
extern struct kset *module_kset;
|
|
extern struct kobj_type module_ktype;
|
|
extern int module_sysfs_initialized;
|
|
# 773 "include/linux/module.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_all_modules_text_rw(void) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_all_modules_text_ro(void) { }
|
|
|
|
|
|
|
|
void module_bug_finalize(const Elf32_Ehdr *, const Elf32_Shdr *,
|
|
struct module *);
|
|
void module_bug_cleanup(struct module *);
|
|
# 795 "include/linux/module.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool retpoline_module_ok(bool has_retpoline)
|
|
{
|
|
return true;
|
|
}
|
|
# 807 "include/linux/module.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool module_sig_ok(struct module *module)
|
|
{
|
|
return true;
|
|
}
|
|
# 43 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c" 2
|
|
|
|
|
|
# 1 "include/linux/dma-mapping.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/device.h" 1
|
|
# 16 "include/linux/device.h"
|
|
# 1 "include/linux/ioport.h" 1
|
|
# 18 "include/linux/ioport.h"
|
|
struct resource {
|
|
resource_size_t start;
|
|
resource_size_t end;
|
|
const char *name;
|
|
unsigned long flags;
|
|
struct resource *parent, *sibling, *child;
|
|
};
|
|
# 139 "include/linux/ioport.h"
|
|
extern struct resource ioport_resource;
|
|
extern struct resource iomem_resource;
|
|
|
|
extern struct resource *request_resource_conflict(struct resource *root, struct resource *new);
|
|
extern int request_resource(struct resource *root, struct resource *new);
|
|
extern int release_resource(struct resource *new);
|
|
void release_child_resources(struct resource *new);
|
|
extern void reserve_region_with_split(struct resource *root,
|
|
resource_size_t start, resource_size_t end,
|
|
const char *name);
|
|
extern struct resource *insert_resource_conflict(struct resource *parent, struct resource *new);
|
|
extern int insert_resource(struct resource *parent, struct resource *new);
|
|
extern void insert_resource_expand_to_fit(struct resource *root, struct resource *new);
|
|
extern void arch_remove_reservations(struct resource *avail);
|
|
extern int allocate_resource(struct resource *root, struct resource *new,
|
|
resource_size_t size, resource_size_t min,
|
|
resource_size_t max, resource_size_t align,
|
|
resource_size_t (*alignf)(void *,
|
|
const struct resource *,
|
|
resource_size_t,
|
|
resource_size_t),
|
|
void *alignf_data);
|
|
struct resource *lookup_resource(struct resource *root, resource_size_t start);
|
|
int adjust_resource(struct resource *res, resource_size_t start,
|
|
resource_size_t size);
|
|
resource_size_t resource_alignment(struct resource *res);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) resource_size_t resource_size(const struct resource *res)
|
|
{
|
|
return res->end - res->start + 1;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long resource_type(const struct resource *res)
|
|
{
|
|
return res->flags & 0x00001f00;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool resource_contains(struct resource *r1, struct resource *r2)
|
|
{
|
|
if (resource_type(r1) != resource_type(r2))
|
|
return false;
|
|
if (r1->flags & 0x20000000 || r2->flags & 0x20000000)
|
|
return false;
|
|
return r1->start <= r2->start && r1->end >= r2->end;
|
|
}
|
|
# 193 "include/linux/ioport.h"
|
|
extern struct resource * __request_region(struct resource *,
|
|
resource_size_t start,
|
|
resource_size_t n,
|
|
const char *name, int flags);
|
|
|
|
|
|
|
|
|
|
|
|
extern void __release_region(struct resource *, resource_size_t,
|
|
resource_size_t);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct device;
|
|
|
|
extern int devm_request_resource(struct device *dev, struct resource *root,
|
|
struct resource *new);
|
|
extern void devm_release_resource(struct device *dev, struct resource *new);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern struct resource * __devm_request_region(struct device *dev,
|
|
struct resource *parent, resource_size_t start,
|
|
resource_size_t n, const char *name);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern void __devm_release_region(struct device *dev, struct resource *parent,
|
|
resource_size_t start, resource_size_t n);
|
|
extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size);
|
|
extern int iomem_is_exclusive(u64 addr);
|
|
|
|
extern int
|
|
walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages,
|
|
void *arg, int (*func)(unsigned long, unsigned long, void *));
|
|
extern int
|
|
walk_system_ram_res(u64 start, u64 end, void *arg,
|
|
int (*func)(u64, u64, void *));
|
|
extern int
|
|
walk_iomem_res(char *name, unsigned long flags, u64 start, u64 end, void *arg,
|
|
int (*func)(u64, u64, void *));
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool resource_overlaps(struct resource *r1, struct resource *r2)
|
|
{
|
|
return (r1->start <= r2->end && r1->end >= r2->start);
|
|
}
|
|
# 17 "include/linux/device.h" 2
|
|
|
|
# 1 "include/linux/klist.h" 1
|
|
# 19 "include/linux/klist.h"
|
|
struct klist_node;
|
|
struct klist {
|
|
spinlock_t k_lock;
|
|
struct list_head k_list;
|
|
void (*get)(struct klist_node *);
|
|
void (*put)(struct klist_node *);
|
|
} __attribute__ ((aligned (sizeof(void *))));
|
|
# 36 "include/linux/klist.h"
|
|
extern void klist_init(struct klist *k, void (*get)(struct klist_node *),
|
|
void (*put)(struct klist_node *));
|
|
|
|
struct klist_node {
|
|
void *n_klist;
|
|
struct list_head n_node;
|
|
struct kref n_ref;
|
|
};
|
|
|
|
extern void klist_add_tail(struct klist_node *n, struct klist *k);
|
|
extern void klist_add_head(struct klist_node *n, struct klist *k);
|
|
extern void klist_add_behind(struct klist_node *n, struct klist_node *pos);
|
|
extern void klist_add_before(struct klist_node *n, struct klist_node *pos);
|
|
|
|
extern void klist_del(struct klist_node *n);
|
|
extern void klist_remove(struct klist_node *n);
|
|
|
|
extern int klist_node_attached(struct klist_node *n);
|
|
|
|
|
|
struct klist_iter {
|
|
struct klist *i_klist;
|
|
struct klist_node *i_cur;
|
|
};
|
|
|
|
|
|
extern void klist_iter_init(struct klist *k, struct klist_iter *i);
|
|
extern void klist_iter_init_node(struct klist *k, struct klist_iter *i,
|
|
struct klist_node *n);
|
|
extern void klist_iter_exit(struct klist_iter *i);
|
|
extern struct klist_node *klist_prev(struct klist_iter *i);
|
|
extern struct klist_node *klist_next(struct klist_iter *i);
|
|
# 19 "include/linux/device.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/pinctrl/devinfo.h" 1
|
|
# 48 "include/linux/pinctrl/devinfo.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pinctrl_bind_pins(struct device *dev)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pinctrl_init_done(struct device *dev)
|
|
{
|
|
return 0;
|
|
}
|
|
# 25 "include/linux/device.h" 2
|
|
# 1 "include/linux/pm.h" 1
|
|
# 34 "include/linux/pm.h"
|
|
extern void (*pm_power_off)(void);
|
|
extern void (*pm_power_off_prepare)(void);
|
|
|
|
struct device;
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pm_vt_switch_required(struct device *dev, bool required)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pm_vt_switch_unregister(struct device *dev)
|
|
{
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct device;
|
|
|
|
|
|
extern const char power_group_name[];
|
|
|
|
|
|
|
|
|
|
typedef struct pm_message {
|
|
int event;
|
|
} pm_message_t;
|
|
# 295 "include/linux/pm.h"
|
|
struct dev_pm_ops {
|
|
int (*prepare)(struct device *dev);
|
|
void (*complete)(struct device *dev);
|
|
int (*suspend)(struct device *dev);
|
|
int (*resume)(struct device *dev);
|
|
int (*freeze)(struct device *dev);
|
|
int (*thaw)(struct device *dev);
|
|
int (*poweroff)(struct device *dev);
|
|
int (*restore)(struct device *dev);
|
|
int (*suspend_late)(struct device *dev);
|
|
int (*resume_early)(struct device *dev);
|
|
int (*freeze_late)(struct device *dev);
|
|
int (*thaw_early)(struct device *dev);
|
|
int (*poweroff_late)(struct device *dev);
|
|
int (*restore_early)(struct device *dev);
|
|
int (*suspend_noirq)(struct device *dev);
|
|
int (*resume_noirq)(struct device *dev);
|
|
int (*freeze_noirq)(struct device *dev);
|
|
int (*thaw_noirq)(struct device *dev);
|
|
int (*poweroff_noirq)(struct device *dev);
|
|
int (*restore_noirq)(struct device *dev);
|
|
int (*runtime_suspend)(struct device *dev);
|
|
int (*runtime_resume)(struct device *dev);
|
|
int (*runtime_idle)(struct device *dev);
|
|
};
|
|
# 513 "include/linux/pm.h"
|
|
enum rpm_status {
|
|
RPM_ACTIVE = 0,
|
|
RPM_RESUMING,
|
|
RPM_SUSPENDED,
|
|
RPM_SUSPENDING,
|
|
};
|
|
# 535 "include/linux/pm.h"
|
|
enum rpm_request {
|
|
RPM_REQ_NONE = 0,
|
|
RPM_REQ_IDLE,
|
|
RPM_REQ_SUSPEND,
|
|
RPM_REQ_AUTOSUSPEND,
|
|
RPM_REQ_RESUME,
|
|
};
|
|
|
|
struct wakeup_source;
|
|
struct wake_irq;
|
|
struct pm_domain_data;
|
|
|
|
struct pm_subsys_data {
|
|
spinlock_t lock;
|
|
unsigned int refcount;
|
|
|
|
struct list_head clock_list;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
struct dev_pm_info {
|
|
pm_message_t power_state;
|
|
unsigned int can_wakeup:1;
|
|
unsigned int async_suspend:1;
|
|
bool is_prepared:1;
|
|
bool is_suspended:1;
|
|
bool is_noirq_suspended:1;
|
|
bool is_late_suspended:1;
|
|
bool ignore_children:1;
|
|
bool early_init:1;
|
|
bool direct_complete:1;
|
|
spinlock_t lock;
|
|
|
|
struct list_head entry;
|
|
struct completion completion;
|
|
struct wakeup_source *wakeup;
|
|
bool wakeup_path:1;
|
|
bool syscore:1;
|
|
|
|
|
|
|
|
|
|
struct timer_list suspend_timer;
|
|
unsigned long timer_expires;
|
|
struct work_struct work;
|
|
wait_queue_head_t wait_queue;
|
|
struct wake_irq *wakeirq;
|
|
atomic_t usage_count;
|
|
atomic_t child_count;
|
|
unsigned int disable_depth:3;
|
|
unsigned int idle_notification:1;
|
|
unsigned int request_pending:1;
|
|
unsigned int deferred_resume:1;
|
|
unsigned int run_wake:1;
|
|
unsigned int runtime_auto:1;
|
|
unsigned int no_callbacks:1;
|
|
unsigned int irq_safe:1;
|
|
unsigned int use_autosuspend:1;
|
|
unsigned int timer_autosuspends:1;
|
|
unsigned int memalloc_noio:1;
|
|
enum rpm_request request;
|
|
enum rpm_status runtime_status;
|
|
int runtime_error;
|
|
int autosuspend_delay;
|
|
unsigned long last_busy;
|
|
unsigned long active_jiffies;
|
|
unsigned long suspended_jiffies;
|
|
unsigned long accounting_timestamp;
|
|
|
|
struct pm_subsys_data *subsys_data;
|
|
void (*set_latency_tolerance)(struct device *, s32);
|
|
struct dev_pm_qos *qos;
|
|
};
|
|
|
|
extern void update_pm_runtime_accounting(struct device *dev);
|
|
extern int dev_pm_get_subsys_data(struct device *dev);
|
|
extern void dev_pm_put_subsys_data(struct device *dev);
|
|
# 626 "include/linux/pm.h"
|
|
struct dev_pm_domain {
|
|
struct dev_pm_ops ops;
|
|
void (*detach)(struct device *dev, bool power_off);
|
|
int (*activate)(struct device *dev);
|
|
void (*sync)(struct device *dev);
|
|
void (*dismiss)(struct device *dev);
|
|
};
|
|
# 689 "include/linux/pm.h"
|
|
extern void device_pm_lock(void);
|
|
extern void dpm_resume_start(pm_message_t state);
|
|
extern void dpm_resume_end(pm_message_t state);
|
|
extern void dpm_resume_noirq(pm_message_t state);
|
|
extern void dpm_resume_early(pm_message_t state);
|
|
extern void dpm_resume(pm_message_t state);
|
|
extern void dpm_complete(pm_message_t state);
|
|
|
|
extern void device_pm_unlock(void);
|
|
extern int dpm_suspend_end(pm_message_t state);
|
|
extern int dpm_suspend_start(pm_message_t state);
|
|
extern int dpm_suspend_noirq(pm_message_t state);
|
|
extern int dpm_suspend_late(pm_message_t state);
|
|
extern int dpm_suspend(pm_message_t state);
|
|
extern int dpm_prepare(pm_message_t state);
|
|
|
|
extern void __suspend_report_result(const char *function, void *fn, int ret);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern int device_pm_wait_for_dev(struct device *sub, struct device *dev);
|
|
extern void dpm_for_each_dev(void *data, void (*fn)(struct device *, void *));
|
|
|
|
extern int pm_generic_prepare(struct device *dev);
|
|
extern int pm_generic_suspend_late(struct device *dev);
|
|
extern int pm_generic_suspend_noirq(struct device *dev);
|
|
extern int pm_generic_suspend(struct device *dev);
|
|
extern int pm_generic_resume_early(struct device *dev);
|
|
extern int pm_generic_resume_noirq(struct device *dev);
|
|
extern int pm_generic_resume(struct device *dev);
|
|
extern int pm_generic_freeze_noirq(struct device *dev);
|
|
extern int pm_generic_freeze_late(struct device *dev);
|
|
extern int pm_generic_freeze(struct device *dev);
|
|
extern int pm_generic_thaw_noirq(struct device *dev);
|
|
extern int pm_generic_thaw_early(struct device *dev);
|
|
extern int pm_generic_thaw(struct device *dev);
|
|
extern int pm_generic_restore_noirq(struct device *dev);
|
|
extern int pm_generic_restore_early(struct device *dev);
|
|
extern int pm_generic_restore(struct device *dev);
|
|
extern int pm_generic_poweroff_noirq(struct device *dev);
|
|
extern int pm_generic_poweroff_late(struct device *dev);
|
|
extern int pm_generic_poweroff(struct device *dev);
|
|
extern void pm_generic_complete(struct device *dev);
|
|
extern void pm_complete_with_resume_check(struct device *dev);
|
|
# 781 "include/linux/pm.h"
|
|
enum dpm_order {
|
|
DPM_ORDER_NONE,
|
|
DPM_ORDER_DEV_AFTER_PARENT,
|
|
DPM_ORDER_PARENT_BEFORE_DEV,
|
|
DPM_ORDER_DEV_LAST,
|
|
};
|
|
# 26 "include/linux/device.h" 2
|
|
|
|
# 1 "include/linux/ratelimit.h" 1
|
|
# 10 "include/linux/ratelimit.h"
|
|
struct ratelimit_state {
|
|
raw_spinlock_t lock;
|
|
|
|
int interval;
|
|
int burst;
|
|
int printed;
|
|
int missed;
|
|
unsigned long begin;
|
|
};
|
|
# 34 "include/linux/ratelimit.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ratelimit_state_init(struct ratelimit_state *rs,
|
|
int interval, int burst)
|
|
{
|
|
do { *(&rs->lock) = (raw_spinlock_t) { .raw_lock = { { 0 } }, }; } while (0);
|
|
rs->interval = interval;
|
|
rs->burst = burst;
|
|
rs->printed = 0;
|
|
rs->missed = 0;
|
|
rs->begin = 0;
|
|
}
|
|
|
|
extern struct ratelimit_state printk_ratelimit_state;
|
|
|
|
extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
|
|
# 28 "include/linux/device.h" 2
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/device.h" 1
|
|
# 9 "./arch/arm/include/asm/device.h"
|
|
struct dev_archdata {
|
|
struct dma_map_ops *dma_ops;
|
|
|
|
|
|
|
|
|
|
void *iommu;
|
|
|
|
|
|
struct dma_iommu_mapping *mapping;
|
|
|
|
bool dma_coherent;
|
|
};
|
|
|
|
struct omap_device;
|
|
|
|
struct pdev_archdata {
|
|
|
|
|
|
|
|
};
|
|
# 31 "include/linux/device.h" 2
|
|
|
|
struct device;
|
|
struct device_private;
|
|
struct device_driver;
|
|
struct driver_private;
|
|
struct module;
|
|
struct class;
|
|
struct subsys_private;
|
|
struct bus_type;
|
|
struct device_node;
|
|
struct fwnode_handle;
|
|
struct iommu_ops;
|
|
struct iommu_group;
|
|
|
|
struct bus_attribute {
|
|
struct attribute attr;
|
|
ssize_t (*show)(struct bus_type *bus, char *buf);
|
|
ssize_t (*store)(struct bus_type *bus, const char *buf, size_t count);
|
|
};
|
|
# 58 "include/linux/device.h"
|
|
extern int __attribute__((warn_unused_result)) bus_create_file(struct bus_type *,
|
|
struct bus_attribute *);
|
|
extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
|
|
# 105 "include/linux/device.h"
|
|
struct bus_type {
|
|
const char *name;
|
|
const char *dev_name;
|
|
struct device *dev_root;
|
|
struct device_attribute *dev_attrs;
|
|
const struct attribute_group **bus_groups;
|
|
const struct attribute_group **dev_groups;
|
|
const struct attribute_group **drv_groups;
|
|
|
|
int (*match)(struct device *dev, struct device_driver *drv);
|
|
int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
|
|
int (*probe)(struct device *dev);
|
|
int (*remove)(struct device *dev);
|
|
void (*shutdown)(struct device *dev);
|
|
|
|
int (*online)(struct device *dev);
|
|
int (*offline)(struct device *dev);
|
|
|
|
int (*suspend)(struct device *dev, pm_message_t state);
|
|
int (*resume)(struct device *dev);
|
|
|
|
const struct dev_pm_ops *pm;
|
|
|
|
const struct iommu_ops *iommu_ops;
|
|
|
|
struct subsys_private *p;
|
|
struct lock_class_key lock_key;
|
|
};
|
|
|
|
extern int __attribute__((warn_unused_result)) bus_register(struct bus_type *bus);
|
|
|
|
extern void bus_unregister(struct bus_type *bus);
|
|
|
|
extern int __attribute__((warn_unused_result)) bus_rescan_devices(struct bus_type *bus);
|
|
|
|
|
|
struct subsys_dev_iter {
|
|
struct klist_iter ki;
|
|
const struct device_type *type;
|
|
};
|
|
void subsys_dev_iter_init(struct subsys_dev_iter *iter,
|
|
struct bus_type *subsys,
|
|
struct device *start,
|
|
const struct device_type *type);
|
|
struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter);
|
|
void subsys_dev_iter_exit(struct subsys_dev_iter *iter);
|
|
|
|
int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data,
|
|
int (*fn)(struct device *dev, void *data));
|
|
struct device *bus_find_device(struct bus_type *bus, struct device *start,
|
|
void *data,
|
|
int (*match)(struct device *dev, void *data));
|
|
struct device *bus_find_device_by_name(struct bus_type *bus,
|
|
struct device *start,
|
|
const char *name);
|
|
struct device *subsys_find_device_by_id(struct bus_type *bus, unsigned int id,
|
|
struct device *hint);
|
|
int bus_for_each_drv(struct bus_type *bus, struct device_driver *start,
|
|
void *data, int (*fn)(struct device_driver *, void *));
|
|
void bus_sort_breadthfirst(struct bus_type *bus,
|
|
int (*compare)(const struct device *a,
|
|
const struct device *b));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct notifier_block;
|
|
|
|
extern int bus_register_notifier(struct bus_type *bus,
|
|
struct notifier_block *nb);
|
|
extern int bus_unregister_notifier(struct bus_type *bus,
|
|
struct notifier_block *nb);
|
|
# 195 "include/linux/device.h"
|
|
extern struct kset *bus_get_kset(struct bus_type *bus);
|
|
extern struct klist *bus_get_device_klist(struct bus_type *bus);
|
|
# 220 "include/linux/device.h"
|
|
enum probe_type {
|
|
PROBE_DEFAULT_STRATEGY,
|
|
PROBE_PREFER_ASYNCHRONOUS,
|
|
PROBE_FORCE_SYNCHRONOUS,
|
|
};
|
|
# 259 "include/linux/device.h"
|
|
struct device_driver {
|
|
const char *name;
|
|
struct bus_type *bus;
|
|
|
|
struct module *owner;
|
|
const char *mod_name;
|
|
|
|
bool suppress_bind_attrs;
|
|
enum probe_type probe_type;
|
|
|
|
const struct of_device_id *of_match_table;
|
|
const struct acpi_device_id *acpi_match_table;
|
|
|
|
int (*probe) (struct device *dev);
|
|
int (*remove) (struct device *dev);
|
|
void (*shutdown) (struct device *dev);
|
|
int (*suspend) (struct device *dev, pm_message_t state);
|
|
int (*resume) (struct device *dev);
|
|
const struct attribute_group **groups;
|
|
|
|
const struct dev_pm_ops *pm;
|
|
|
|
struct driver_private *p;
|
|
};
|
|
|
|
|
|
extern int __attribute__((warn_unused_result)) driver_register(struct device_driver *drv);
|
|
extern void driver_unregister(struct device_driver *drv);
|
|
|
|
extern struct device_driver *driver_find(const char *name,
|
|
struct bus_type *bus);
|
|
extern int driver_probe_done(void);
|
|
extern void wait_for_device_probe(void);
|
|
|
|
|
|
|
|
|
|
struct driver_attribute {
|
|
struct attribute attr;
|
|
ssize_t (*show)(struct device_driver *driver, char *buf);
|
|
ssize_t (*store)(struct device_driver *driver, const char *buf,
|
|
size_t count);
|
|
};
|
|
# 312 "include/linux/device.h"
|
|
extern int __attribute__((warn_unused_result)) driver_create_file(struct device_driver *driver,
|
|
const struct driver_attribute *attr);
|
|
extern void driver_remove_file(struct device_driver *driver,
|
|
const struct driver_attribute *attr);
|
|
|
|
extern int __attribute__((warn_unused_result)) driver_for_each_device(struct device_driver *drv,
|
|
struct device *start,
|
|
void *data,
|
|
int (*fn)(struct device *dev,
|
|
void *));
|
|
struct device *driver_find_device(struct device_driver *drv,
|
|
struct device *start, void *data,
|
|
int (*match)(struct device *dev, void *data));
|
|
# 339 "include/linux/device.h"
|
|
struct subsys_interface {
|
|
const char *name;
|
|
struct bus_type *subsys;
|
|
struct list_head node;
|
|
int (*add_dev)(struct device *dev, struct subsys_interface *sif);
|
|
void (*remove_dev)(struct device *dev, struct subsys_interface *sif);
|
|
};
|
|
|
|
int subsys_interface_register(struct subsys_interface *sif);
|
|
void subsys_interface_unregister(struct subsys_interface *sif);
|
|
|
|
int subsys_system_register(struct bus_type *subsys,
|
|
const struct attribute_group **groups);
|
|
int subsys_virtual_register(struct bus_type *subsys,
|
|
const struct attribute_group **groups);
|
|
# 384 "include/linux/device.h"
|
|
struct class {
|
|
const char *name;
|
|
struct module *owner;
|
|
|
|
struct class_attribute *class_attrs;
|
|
const struct attribute_group **dev_groups;
|
|
struct kobject *dev_kobj;
|
|
|
|
int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env);
|
|
char *(*devnode)(struct device *dev, umode_t *mode);
|
|
|
|
void (*class_release)(struct class *class);
|
|
void (*dev_release)(struct device *dev);
|
|
|
|
int (*suspend)(struct device *dev, pm_message_t state);
|
|
int (*resume)(struct device *dev);
|
|
int (*shutdown)(struct device *dev);
|
|
|
|
const struct kobj_ns_type_operations *ns_type;
|
|
const void *(*namespace)(struct device *dev);
|
|
|
|
const struct dev_pm_ops *pm;
|
|
|
|
struct subsys_private *p;
|
|
};
|
|
|
|
struct class_dev_iter {
|
|
struct klist_iter ki;
|
|
const struct device_type *type;
|
|
};
|
|
|
|
extern struct kobject *sysfs_dev_block_kobj;
|
|
extern struct kobject *sysfs_dev_char_kobj;
|
|
extern int __attribute__((warn_unused_result)) __class_register(struct class *class,
|
|
struct lock_class_key *key);
|
|
extern void class_unregister(struct class *class);
|
|
# 429 "include/linux/device.h"
|
|
struct class_compat;
|
|
struct class_compat *class_compat_register(const char *name);
|
|
void class_compat_unregister(struct class_compat *cls);
|
|
int class_compat_create_link(struct class_compat *cls, struct device *dev,
|
|
struct device *device_link);
|
|
void class_compat_remove_link(struct class_compat *cls, struct device *dev,
|
|
struct device *device_link);
|
|
|
|
extern void class_dev_iter_init(struct class_dev_iter *iter,
|
|
struct class *class,
|
|
struct device *start,
|
|
const struct device_type *type);
|
|
extern struct device *class_dev_iter_next(struct class_dev_iter *iter);
|
|
extern void class_dev_iter_exit(struct class_dev_iter *iter);
|
|
|
|
extern int class_for_each_device(struct class *class, struct device *start,
|
|
void *data,
|
|
int (*fn)(struct device *dev, void *data));
|
|
extern struct device *class_find_device(struct class *class,
|
|
struct device *start, const void *data,
|
|
int (*match)(struct device *, const void *));
|
|
|
|
struct class_attribute {
|
|
struct attribute attr;
|
|
ssize_t (*show)(struct class *class, struct class_attribute *attr,
|
|
char *buf);
|
|
ssize_t (*store)(struct class *class, struct class_attribute *attr,
|
|
const char *buf, size_t count);
|
|
};
|
|
# 466 "include/linux/device.h"
|
|
extern int __attribute__((warn_unused_result)) class_create_file_ns(struct class *class,
|
|
const struct class_attribute *attr,
|
|
const void *ns);
|
|
extern void class_remove_file_ns(struct class *class,
|
|
const struct class_attribute *attr,
|
|
const void *ns);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result)) class_create_file(struct class *class,
|
|
const struct class_attribute *attr)
|
|
{
|
|
return class_create_file_ns(class, attr, ((void *)0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void class_remove_file(struct class *class,
|
|
const struct class_attribute *attr)
|
|
{
|
|
return class_remove_file_ns(class, attr, ((void *)0));
|
|
}
|
|
|
|
|
|
struct class_attribute_string {
|
|
struct class_attribute attr;
|
|
char *str;
|
|
};
|
|
# 498 "include/linux/device.h"
|
|
extern ssize_t show_class_attr_string(struct class *class, struct class_attribute *attr,
|
|
char *buf);
|
|
|
|
struct class_interface {
|
|
struct list_head node;
|
|
struct class *class;
|
|
|
|
int (*add_dev) (struct device *, struct class_interface *);
|
|
void (*remove_dev) (struct device *, struct class_interface *);
|
|
};
|
|
|
|
extern int __attribute__((warn_unused_result)) class_interface_register(struct class_interface *);
|
|
extern void class_interface_unregister(struct class_interface *);
|
|
|
|
extern struct class * __attribute__((warn_unused_result)) __class_create(struct module *owner,
|
|
const char *name,
|
|
struct lock_class_key *key);
|
|
extern void class_destroy(struct class *cls);
|
|
# 534 "include/linux/device.h"
|
|
struct device_type {
|
|
const char *name;
|
|
const struct attribute_group **groups;
|
|
int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
|
|
char *(*devnode)(struct device *dev, umode_t *mode,
|
|
kuid_t *uid, kgid_t *gid);
|
|
void (*release)(struct device *dev);
|
|
|
|
const struct dev_pm_ops *pm;
|
|
};
|
|
|
|
|
|
struct device_attribute {
|
|
struct attribute attr;
|
|
ssize_t (*show)(struct device *dev, struct device_attribute *attr,
|
|
char *buf);
|
|
ssize_t (*store)(struct device *dev, struct device_attribute *attr,
|
|
const char *buf, size_t count);
|
|
};
|
|
|
|
struct dev_ext_attribute {
|
|
struct device_attribute attr;
|
|
void *var;
|
|
};
|
|
|
|
ssize_t device_show_ulong(struct device *dev, struct device_attribute *attr,
|
|
char *buf);
|
|
ssize_t device_store_ulong(struct device *dev, struct device_attribute *attr,
|
|
const char *buf, size_t count);
|
|
ssize_t device_show_int(struct device *dev, struct device_attribute *attr,
|
|
char *buf);
|
|
ssize_t device_store_int(struct device *dev, struct device_attribute *attr,
|
|
const char *buf, size_t count);
|
|
ssize_t device_show_bool(struct device *dev, struct device_attribute *attr,
|
|
char *buf);
|
|
ssize_t device_store_bool(struct device *dev, struct device_attribute *attr,
|
|
const char *buf, size_t count);
|
|
# 593 "include/linux/device.h"
|
|
extern int device_create_file(struct device *device,
|
|
const struct device_attribute *entry);
|
|
extern void device_remove_file(struct device *dev,
|
|
const struct device_attribute *attr);
|
|
extern bool device_remove_file_self(struct device *dev,
|
|
const struct device_attribute *attr);
|
|
extern int __attribute__((warn_unused_result)) device_create_bin_file(struct device *dev,
|
|
const struct bin_attribute *attr);
|
|
extern void device_remove_bin_file(struct device *dev,
|
|
const struct bin_attribute *attr);
|
|
|
|
|
|
typedef void (*dr_release_t)(struct device *dev, void *res);
|
|
typedef int (*dr_match_t)(struct device *dev, void *res, void *match_data);
|
|
# 616 "include/linux/device.h"
|
|
extern void *devres_alloc_node(dr_release_t release, size_t size, gfp_t gfp,
|
|
int nid);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp)
|
|
{
|
|
return devres_alloc_node(release, size, gfp, (-1));
|
|
}
|
|
|
|
|
|
extern void devres_for_each_res(struct device *dev, dr_release_t release,
|
|
dr_match_t match, void *match_data,
|
|
void (*fn)(struct device *, void *, void *),
|
|
void *data);
|
|
extern void devres_free(void *res);
|
|
extern void devres_add(struct device *dev, void *res);
|
|
extern void *devres_find(struct device *dev, dr_release_t release,
|
|
dr_match_t match, void *match_data);
|
|
extern void *devres_get(struct device *dev, void *new_res,
|
|
dr_match_t match, void *match_data);
|
|
extern void *devres_remove(struct device *dev, dr_release_t release,
|
|
dr_match_t match, void *match_data);
|
|
extern int devres_destroy(struct device *dev, dr_release_t release,
|
|
dr_match_t match, void *match_data);
|
|
extern int devres_release(struct device *dev, dr_release_t release,
|
|
dr_match_t match, void *match_data);
|
|
|
|
|
|
extern void * __attribute__((warn_unused_result)) devres_open_group(struct device *dev, void *id,
|
|
gfp_t gfp);
|
|
extern void devres_close_group(struct device *dev, void *id);
|
|
extern void devres_remove_group(struct device *dev, void *id);
|
|
extern int devres_release_group(struct device *dev, void *id);
|
|
|
|
|
|
extern void *devm_kmalloc(struct device *dev, size_t size, gfp_t gfp);
|
|
extern __attribute__((format(printf, 3, 0)))
|
|
char *devm_kvasprintf(struct device *dev, gfp_t gfp, const char *fmt,
|
|
va_list ap);
|
|
extern __attribute__((format(printf, 3, 4)))
|
|
char *devm_kasprintf(struct device *dev, gfp_t gfp, const char *fmt, ...);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp)
|
|
{
|
|
return devm_kmalloc(dev, size, gfp | (( gfp_t)0x8000u));
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *devm_kmalloc_array(struct device *dev,
|
|
size_t n, size_t size, gfp_t flags)
|
|
{
|
|
if (size != 0 && n > (~(size_t)0) / size)
|
|
return ((void *)0);
|
|
return devm_kmalloc(dev, n * size, flags);
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *devm_kcalloc(struct device *dev,
|
|
size_t n, size_t size, gfp_t flags)
|
|
{
|
|
return devm_kmalloc_array(dev, n, size, flags | (( gfp_t)0x8000u));
|
|
}
|
|
extern void devm_kfree(struct device *dev, void *p);
|
|
extern char *devm_kstrdup(struct device *dev, const char *s, gfp_t gfp);
|
|
extern void *devm_kmemdup(struct device *dev, const void *src, size_t len,
|
|
gfp_t gfp);
|
|
|
|
extern unsigned long devm_get_free_pages(struct device *dev,
|
|
gfp_t gfp_mask, unsigned int order);
|
|
extern void devm_free_pages(struct device *dev, unsigned long addr);
|
|
|
|
void *devm_ioremap_resource(struct device *dev, struct resource *res);
|
|
|
|
|
|
int devm_add_action(struct device *dev, void (*action)(void *), void *data);
|
|
void devm_remove_action(struct device *dev, void (*action)(void *), void *data);
|
|
|
|
struct device_dma_parameters {
|
|
|
|
|
|
|
|
|
|
unsigned int max_segment_size;
|
|
unsigned long segment_boundary_mask;
|
|
};
|
|
# 766 "include/linux/device.h"
|
|
struct device {
|
|
struct device *parent;
|
|
|
|
struct device_private *p;
|
|
|
|
struct kobject kobj;
|
|
const char *init_name;
|
|
const struct device_type *type;
|
|
|
|
struct mutex mutex;
|
|
|
|
|
|
|
|
struct bus_type *bus;
|
|
struct device_driver *driver;
|
|
|
|
void *platform_data;
|
|
|
|
void *driver_data;
|
|
|
|
struct dev_pm_info power;
|
|
struct dev_pm_domain *pm_domain;
|
|
# 802 "include/linux/device.h"
|
|
u64 *dma_mask;
|
|
u64 coherent_dma_mask;
|
|
|
|
|
|
|
|
|
|
unsigned long dma_pfn_offset;
|
|
|
|
struct device_dma_parameters *dma_parms;
|
|
|
|
struct list_head dma_pools;
|
|
|
|
struct dma_coherent_mem *dma_mem;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct dev_archdata archdata;
|
|
|
|
struct device_node *of_node;
|
|
struct fwnode_handle *fwnode;
|
|
|
|
dev_t devt;
|
|
u32 id;
|
|
|
|
spinlock_t devres_lock;
|
|
struct list_head devres_head;
|
|
|
|
struct klist_node knode_class;
|
|
struct class *class;
|
|
const struct attribute_group **groups;
|
|
|
|
void (*release)(struct device *dev);
|
|
struct iommu_group *iommu_group;
|
|
|
|
bool offline_disabled:1;
|
|
bool offline:1;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct device *kobj_to_dev(struct kobject *kobj)
|
|
{
|
|
return ({ const typeof( ((struct device *)0)->kobj ) *__mptr = (kobj); (struct device *)( (char *)__mptr - __builtin_offsetof(struct device, kobj) );});
|
|
}
|
|
|
|
|
|
# 1 "include/linux/pm_wakeup.h" 1
|
|
# 31 "include/linux/pm_wakeup.h"
|
|
struct wake_irq;
|
|
# 54 "include/linux/pm_wakeup.h"
|
|
struct wakeup_source {
|
|
const char *name;
|
|
struct list_head entry;
|
|
spinlock_t lock;
|
|
struct wake_irq *wakeirq;
|
|
struct timer_list timer;
|
|
unsigned long timer_expires;
|
|
ktime_t total_time;
|
|
ktime_t max_time;
|
|
ktime_t last_time;
|
|
ktime_t start_prevent_time;
|
|
ktime_t prevent_sleep_time;
|
|
unsigned long event_count;
|
|
unsigned long active_count;
|
|
unsigned long relax_count;
|
|
unsigned long expire_count;
|
|
unsigned long wakeup_count;
|
|
bool active:1;
|
|
bool autosleep_enabled:1;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool device_can_wakeup(struct device *dev)
|
|
{
|
|
return dev->power.can_wakeup;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool device_may_wakeup(struct device *dev)
|
|
{
|
|
return dev->power.can_wakeup && !!dev->power.wakeup;
|
|
}
|
|
|
|
|
|
extern void wakeup_source_prepare(struct wakeup_source *ws, const char *name);
|
|
extern struct wakeup_source *wakeup_source_create(const char *name);
|
|
extern void wakeup_source_drop(struct wakeup_source *ws);
|
|
extern void wakeup_source_destroy(struct wakeup_source *ws);
|
|
extern void wakeup_source_add(struct wakeup_source *ws);
|
|
extern void wakeup_source_remove(struct wakeup_source *ws);
|
|
extern struct wakeup_source *wakeup_source_register(const char *name);
|
|
extern void wakeup_source_unregister(struct wakeup_source *ws);
|
|
extern int device_wakeup_enable(struct device *dev);
|
|
extern int device_wakeup_disable(struct device *dev);
|
|
extern void device_set_wakeup_capable(struct device *dev, bool capable);
|
|
extern int device_init_wakeup(struct device *dev, bool val);
|
|
extern int device_set_wakeup_enable(struct device *dev, bool enable);
|
|
extern void __pm_stay_awake(struct wakeup_source *ws);
|
|
extern void pm_stay_awake(struct device *dev);
|
|
extern void __pm_relax(struct wakeup_source *ws);
|
|
extern void pm_relax(struct device *dev);
|
|
extern void __pm_wakeup_event(struct wakeup_source *ws, unsigned int msec);
|
|
extern void pm_wakeup_event(struct device *dev, unsigned int msec);
|
|
# 191 "include/linux/pm_wakeup.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wakeup_source_init(struct wakeup_source *ws,
|
|
const char *name)
|
|
{
|
|
wakeup_source_prepare(ws, name);
|
|
wakeup_source_add(ws);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wakeup_source_trash(struct wakeup_source *ws)
|
|
{
|
|
wakeup_source_remove(ws);
|
|
wakeup_source_drop(ws);
|
|
}
|
|
# 850 "include/linux/device.h" 2
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const char *dev_name(const struct device *dev)
|
|
{
|
|
|
|
if (dev->init_name)
|
|
return dev->init_name;
|
|
|
|
return kobject_name(&dev->kobj);
|
|
}
|
|
|
|
extern __attribute__((format(printf, 2, 3)))
|
|
int dev_set_name(struct device *dev, const char *name, ...);
|
|
# 873 "include/linux/device.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dev_to_node(struct device *dev)
|
|
{
|
|
return -1;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_dev_node(struct device *dev, int node)
|
|
{
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct irq_domain *dev_get_msi_domain(const struct device *dev)
|
|
{
|
|
|
|
|
|
|
|
return ((void *)0);
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dev_set_msi_domain(struct device *dev, struct irq_domain *d)
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *dev_get_drvdata(const struct device *dev)
|
|
{
|
|
return dev->driver_data;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dev_set_drvdata(struct device *dev, void *data)
|
|
{
|
|
dev->driver_data = data;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pm_subsys_data *dev_to_psd(struct device *dev)
|
|
{
|
|
return dev ? dev->power.subsys_data : ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int dev_get_uevent_suppress(const struct device *dev)
|
|
{
|
|
return dev->kobj.uevent_suppress;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dev_set_uevent_suppress(struct device *dev, int val)
|
|
{
|
|
dev->kobj.uevent_suppress = val;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_is_registered(struct device *dev)
|
|
{
|
|
return dev->kobj.state_in_sysfs;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void device_enable_async_suspend(struct device *dev)
|
|
{
|
|
if (!dev->power.is_prepared)
|
|
dev->power.async_suspend = true;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void device_disable_async_suspend(struct device *dev)
|
|
{
|
|
if (!dev->power.is_prepared)
|
|
dev->power.async_suspend = false;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool device_async_suspend_enabled(struct device *dev)
|
|
{
|
|
return !!dev->power.async_suspend;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pm_suspend_ignore_children(struct device *dev, bool enable)
|
|
{
|
|
dev->power.ignore_children = enable;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dev_pm_syscore_device(struct device *dev, bool val)
|
|
{
|
|
|
|
dev->power.syscore = val;
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void device_lock(struct device *dev)
|
|
{
|
|
mutex_lock(&dev->mutex);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_trylock(struct device *dev)
|
|
{
|
|
return mutex_trylock(&dev->mutex);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void device_unlock(struct device *dev)
|
|
{
|
|
mutex_unlock(&dev->mutex);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void device_lock_assert(struct device *dev)
|
|
{
|
|
do { (void)(&dev->mutex); } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct device_node *dev_of_node(struct device *dev)
|
|
{
|
|
if (!(1 || 0))
|
|
return ((void *)0);
|
|
return dev->of_node;
|
|
}
|
|
|
|
void driver_init(void);
|
|
|
|
|
|
|
|
|
|
extern int __attribute__((warn_unused_result)) device_register(struct device *dev);
|
|
extern void device_unregister(struct device *dev);
|
|
extern void device_initialize(struct device *dev);
|
|
extern int __attribute__((warn_unused_result)) device_add(struct device *dev);
|
|
extern void device_del(struct device *dev);
|
|
extern int device_for_each_child(struct device *dev, void *data,
|
|
int (*fn)(struct device *dev, void *data));
|
|
extern int device_for_each_child_reverse(struct device *dev, void *data,
|
|
int (*fn)(struct device *dev, void *data));
|
|
extern struct device *device_find_child(struct device *dev, void *data,
|
|
int (*match)(struct device *dev, void *data));
|
|
extern int device_rename(struct device *dev, const char *new_name);
|
|
extern int device_move(struct device *dev, struct device *new_parent,
|
|
enum dpm_order dpm_order);
|
|
extern const char *device_get_devnode(struct device *dev,
|
|
umode_t *mode, kuid_t *uid, kgid_t *gid,
|
|
const char **tmp);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool device_supports_offline(struct device *dev)
|
|
{
|
|
return dev->bus && dev->bus->offline && dev->bus->online;
|
|
}
|
|
|
|
extern void lock_device_hotplug(void);
|
|
extern void unlock_device_hotplug(void);
|
|
extern int lock_device_hotplug_sysfs(void);
|
|
extern int device_offline(struct device *dev);
|
|
extern int device_online(struct device *dev);
|
|
extern void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode);
|
|
extern void set_secondary_fwnode(struct device *dev, struct fwnode_handle *fwnode);
|
|
|
|
|
|
|
|
|
|
extern struct device *__root_device_register(const char *name,
|
|
struct module *owner);
|
|
|
|
|
|
|
|
|
|
|
|
extern void root_device_unregister(struct device *root);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *dev_get_platdata(const struct device *dev)
|
|
{
|
|
return dev->platform_data;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extern int __attribute__((warn_unused_result)) device_bind_driver(struct device *dev);
|
|
extern void device_release_driver(struct device *dev);
|
|
extern int __attribute__((warn_unused_result)) device_attach(struct device *dev);
|
|
extern int __attribute__((warn_unused_result)) driver_attach(struct device_driver *drv);
|
|
extern void device_initial_probe(struct device *dev);
|
|
extern int __attribute__((warn_unused_result)) device_reprobe(struct device *dev);
|
|
|
|
|
|
|
|
|
|
extern __attribute__((format(printf, 5, 0)))
|
|
struct device *device_create_vargs(struct class *cls, struct device *parent,
|
|
dev_t devt, void *drvdata,
|
|
const char *fmt, va_list vargs);
|
|
extern __attribute__((format(printf, 5, 6)))
|
|
struct device *device_create(struct class *cls, struct device *parent,
|
|
dev_t devt, void *drvdata,
|
|
const char *fmt, ...);
|
|
extern __attribute__((format(printf, 6, 7)))
|
|
struct device *device_create_with_groups(struct class *cls,
|
|
struct device *parent, dev_t devt, void *drvdata,
|
|
const struct attribute_group **groups,
|
|
const char *fmt, ...);
|
|
extern void device_destroy(struct class *cls, dev_t devt);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern int (*platform_notify)(struct device *dev);
|
|
|
|
extern int (*platform_notify_remove)(struct device *dev);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern struct device *get_device(struct device *dev);
|
|
extern void put_device(struct device *dev);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int devtmpfs_create_node(struct device *dev) { return 0; }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int devtmpfs_delete_node(struct device *dev) { return 0; }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int devtmpfs_mount(const char *mountpoint) { return 0; }
|
|
|
|
|
|
|
|
extern void device_shutdown(void);
|
|
|
|
|
|
extern const char *dev_driver_string(const struct device *dev);
|
|
|
|
|
|
|
|
|
|
extern __attribute__((format(printf, 3, 0)))
|
|
int dev_vprintk_emit(int level, const struct device *dev,
|
|
const char *fmt, va_list args);
|
|
extern __attribute__((format(printf, 3, 4)))
|
|
int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...);
|
|
|
|
extern __attribute__((format(printf, 3, 4)))
|
|
void dev_printk(const char *level, const struct device *dev,
|
|
const char *fmt, ...);
|
|
extern __attribute__((format(printf, 2, 3)))
|
|
void dev_emerg(const struct device *dev, const char *fmt, ...);
|
|
extern __attribute__((format(printf, 2, 3)))
|
|
void dev_alert(const struct device *dev, const char *fmt, ...);
|
|
extern __attribute__((format(printf, 2, 3)))
|
|
void dev_crit(const struct device *dev, const char *fmt, ...);
|
|
extern __attribute__((format(printf, 2, 3)))
|
|
void dev_err(const struct device *dev, const char *fmt, ...);
|
|
extern __attribute__((format(printf, 2, 3)))
|
|
void dev_warn(const struct device *dev, const char *fmt, ...);
|
|
extern __attribute__((format(printf, 2, 3)))
|
|
void dev_notice(const struct device *dev, const char *fmt, ...);
|
|
extern __attribute__((format(printf, 2, 3)))
|
|
void _dev_info(const struct device *dev, const char *fmt, ...);
|
|
# 7 "include/linux/dma-mapping.h" 2
|
|
|
|
# 1 "include/linux/dma-attrs.h" 1
|
|
# 13 "include/linux/dma-attrs.h"
|
|
enum dma_attr {
|
|
DMA_ATTR_WRITE_BARRIER,
|
|
DMA_ATTR_WEAK_ORDERING,
|
|
DMA_ATTR_WRITE_COMBINE,
|
|
DMA_ATTR_NON_CONSISTENT,
|
|
DMA_ATTR_NO_KERNEL_MAPPING,
|
|
DMA_ATTR_SKIP_CPU_SYNC,
|
|
DMA_ATTR_FORCE_CONTIGUOUS,
|
|
DMA_ATTR_MAX,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct dma_attrs {
|
|
unsigned long flags[(((DMA_ATTR_MAX) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))];
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_dma_attrs(struct dma_attrs *attrs)
|
|
{
|
|
bitmap_zero(attrs->flags, (((DMA_ATTR_MAX) + (8 * sizeof(long)) - 1) / (8 * sizeof(long))));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dma_set_attr(enum dma_attr attr, struct dma_attrs *attrs)
|
|
{
|
|
if (attrs == ((void *)0))
|
|
return;
|
|
do { if (__builtin_expect(!!(attr >= DMA_ATTR_MAX), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/dma-attrs.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "54" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
__set_bit(attr, attrs->flags);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dma_get_attr(enum dma_attr attr, struct dma_attrs *attrs)
|
|
{
|
|
if (attrs == ((void *)0))
|
|
return 0;
|
|
do { if (__builtin_expect(!!(attr >= DMA_ATTR_MAX), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/dma-attrs.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "67" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
return test_bit(attr, attrs->flags);
|
|
}
|
|
# 9 "include/linux/dma-mapping.h" 2
|
|
# 1 "include/linux/dma-direction.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum dma_data_direction {
|
|
DMA_BIDIRECTIONAL = 0,
|
|
DMA_TO_DEVICE = 1,
|
|
DMA_FROM_DEVICE = 2,
|
|
DMA_NONE = 3,
|
|
};
|
|
# 10 "include/linux/dma-mapping.h" 2
|
|
# 1 "include/linux/scatterlist.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/mm.h" 1
|
|
# 15 "include/linux/mm.h"
|
|
# 1 "include/linux/debug_locks.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct task_struct;
|
|
|
|
extern int debug_locks;
|
|
extern int debug_locks_silent;
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __debug_locks_off(void)
|
|
{
|
|
return ({ typeof(({ (__typeof__(*(&debug_locks)))__xchg((unsigned long)(0), (&debug_locks), sizeof(*(&debug_locks))); })) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = ({ (__typeof__(*(&debug_locks)))__xchg((unsigned long)(0), (&debug_locks), sizeof(*(&debug_locks))); }); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; });
|
|
}
|
|
|
|
|
|
|
|
|
|
extern int debug_locks_off(void);
|
|
# 48 "include/linux/debug_locks.h"
|
|
struct task_struct;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_show_all_locks(void)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_show_held_locks(struct task_struct *task)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
debug_check_no_locks_freed(const void *from, unsigned long len)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
debug_check_no_locks_held(void)
|
|
{
|
|
}
|
|
# 16 "include/linux/mm.h" 2
|
|
# 1 "include/linux/mm_types.h" 1
|
|
|
|
|
|
|
|
# 1 "include/linux/auxvec.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/auxvec.h" 1
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/auxvec.h" 1
|
|
# 5 "include/uapi/linux/auxvec.h" 2
|
|
# 5 "include/linux/auxvec.h" 2
|
|
# 5 "include/linux/mm_types.h" 2
|
|
# 13 "include/linux/mm_types.h"
|
|
# 1 "include/linux/uprobes.h" 1
|
|
# 31 "include/linux/uprobes.h"
|
|
struct vm_area_struct;
|
|
struct mm_struct;
|
|
struct inode;
|
|
struct notifier_block;
|
|
struct page;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum uprobe_filter_ctx {
|
|
UPROBE_FILTER_REGISTER,
|
|
UPROBE_FILTER_UNREGISTER,
|
|
UPROBE_FILTER_MMAP,
|
|
};
|
|
|
|
struct uprobe_consumer {
|
|
int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs);
|
|
int (*ret_handler)(struct uprobe_consumer *self,
|
|
unsigned long func,
|
|
struct pt_regs *regs);
|
|
bool (*filter)(struct uprobe_consumer *self,
|
|
enum uprobe_filter_ctx ctx,
|
|
struct mm_struct *mm);
|
|
|
|
struct uprobe_consumer *next;
|
|
};
|
|
# 152 "include/linux/uprobes.h"
|
|
struct uprobes_state {
|
|
};
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc)
|
|
{
|
|
return -38;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool add)
|
|
{
|
|
return -38;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int uprobe_mmap(struct vm_area_struct *vma)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void uprobe_start_dup_mmap(void)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void uprobe_end_dup_mmap(void)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void uprobe_notify_resume(struct pt_regs *regs)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool uprobe_deny_signal(void)
|
|
{
|
|
return false;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void uprobe_free_utask(struct task_struct *t)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void uprobe_copy_process(struct task_struct *t, unsigned long flags)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void uprobe_clear_state(struct mm_struct *mm)
|
|
{
|
|
}
|
|
# 14 "include/linux/mm_types.h" 2
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/mmu.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
atomic64_t id;
|
|
|
|
|
|
|
|
unsigned int vmalloc_seq;
|
|
unsigned long sigpage;
|
|
|
|
unsigned long vdso;
|
|
|
|
} mm_context_t;
|
|
# 17 "include/linux/mm_types.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct address_space;
|
|
struct mem_cgroup;
|
|
# 44 "include/linux/mm_types.h"
|
|
struct page {
|
|
|
|
unsigned long flags;
|
|
|
|
union {
|
|
struct address_space *mapping;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void *s_mem;
|
|
};
|
|
|
|
|
|
struct {
|
|
union {
|
|
unsigned long index;
|
|
void *freelist;
|
|
};
|
|
|
|
union {
|
|
# 77 "include/linux/mm_types.h"
|
|
unsigned counters;
|
|
|
|
|
|
struct {
|
|
|
|
union {
|
|
# 99 "include/linux/mm_types.h"
|
|
atomic_t _mapcount;
|
|
|
|
struct {
|
|
unsigned inuse:16;
|
|
unsigned objects:15;
|
|
unsigned frozen:1;
|
|
};
|
|
int units;
|
|
};
|
|
atomic_t _count;
|
|
};
|
|
unsigned int active;
|
|
};
|
|
};
|
|
# 121 "include/linux/mm_types.h"
|
|
union {
|
|
struct list_head lru;
|
|
|
|
|
|
|
|
|
|
struct {
|
|
struct page *next;
|
|
|
|
|
|
|
|
|
|
short int pages;
|
|
short int pobjects;
|
|
|
|
};
|
|
|
|
struct callback_head callback_head;
|
|
|
|
|
|
|
|
struct {
|
|
unsigned long compound_head;
|
|
# 156 "include/linux/mm_types.h"
|
|
unsigned short int compound_dtor;
|
|
unsigned short int compound_order;
|
|
|
|
};
|
|
# 170 "include/linux/mm_types.h"
|
|
};
|
|
|
|
|
|
union {
|
|
unsigned long private;
|
|
# 188 "include/linux/mm_types.h"
|
|
struct kmem_cache *slab_cache;
|
|
};
|
|
# 221 "include/linux/mm_types.h"
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
__attribute__((aligned(2 * sizeof(unsigned long))))
|
|
|
|
;
|
|
|
|
struct page_frag {
|
|
struct page *page;
|
|
|
|
|
|
|
|
|
|
__u16 offset;
|
|
__u16 size;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct page_frag_cache {
|
|
void * va;
|
|
|
|
__u16 offset;
|
|
__u16 size;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int pagecnt_bias;
|
|
bool pfmemalloc;
|
|
};
|
|
|
|
typedef unsigned long vm_flags_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct vm_region {
|
|
struct rb_node vm_rb;
|
|
vm_flags_t vm_flags;
|
|
unsigned long vm_start;
|
|
unsigned long vm_end;
|
|
unsigned long vm_top;
|
|
unsigned long vm_pgoff;
|
|
struct file *vm_file;
|
|
|
|
int vm_usage;
|
|
bool vm_icache_flushed : 1;
|
|
|
|
};
|
|
# 288 "include/linux/mm_types.h"
|
|
struct vm_userfaultfd_ctx {};
|
|
# 297 "include/linux/mm_types.h"
|
|
struct vm_area_struct {
|
|
|
|
|
|
unsigned long vm_start;
|
|
unsigned long vm_end;
|
|
|
|
|
|
|
|
struct vm_area_struct *vm_next, *vm_prev;
|
|
|
|
struct rb_node vm_rb;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long rb_subtree_gap;
|
|
|
|
|
|
|
|
struct mm_struct *vm_mm;
|
|
pgprot_t vm_page_prot;
|
|
unsigned long vm_flags;
|
|
|
|
|
|
|
|
|
|
|
|
struct {
|
|
struct rb_node rb;
|
|
unsigned long rb_subtree_last;
|
|
} shared;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct list_head anon_vma_chain;
|
|
|
|
struct anon_vma *anon_vma;
|
|
|
|
|
|
const struct vm_operations_struct *vm_ops;
|
|
|
|
|
|
unsigned long vm_pgoff;
|
|
|
|
struct file * vm_file;
|
|
void * vm_private_data;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct vm_userfaultfd_ctx vm_userfaultfd_ctx;
|
|
};
|
|
|
|
struct core_thread {
|
|
struct task_struct *task;
|
|
struct core_thread *next;
|
|
};
|
|
|
|
struct core_state {
|
|
atomic_t nr_threads;
|
|
struct core_thread dumper;
|
|
struct completion startup;
|
|
};
|
|
|
|
enum {
|
|
MM_FILEPAGES,
|
|
MM_ANONPAGES,
|
|
MM_SWAPENTS,
|
|
NR_MM_COUNTERS
|
|
};
|
|
# 387 "include/linux/mm_types.h"
|
|
struct mm_rss_stat {
|
|
atomic_long_t count[NR_MM_COUNTERS];
|
|
};
|
|
|
|
struct kioctx_table;
|
|
struct mm_struct {
|
|
struct vm_area_struct *mmap;
|
|
struct rb_root mm_rb;
|
|
u32 vmacache_seqnum;
|
|
|
|
unsigned long (*get_unmapped_area) (struct file *filp,
|
|
unsigned long addr, unsigned long len,
|
|
unsigned long pgoff, unsigned long flags);
|
|
|
|
unsigned long mmap_base;
|
|
unsigned long mmap_legacy_base;
|
|
unsigned long task_size;
|
|
unsigned long highest_vm_end;
|
|
pgd_t * pgd;
|
|
atomic_t mm_users;
|
|
atomic_t mm_count;
|
|
atomic_long_t nr_ptes;
|
|
|
|
|
|
|
|
int map_count;
|
|
|
|
spinlock_t page_table_lock;
|
|
struct rw_semaphore mmap_sem;
|
|
|
|
struct list_head mmlist;
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long hiwater_rss;
|
|
unsigned long hiwater_vm;
|
|
|
|
unsigned long total_vm;
|
|
unsigned long locked_vm;
|
|
unsigned long pinned_vm;
|
|
unsigned long shared_vm;
|
|
unsigned long exec_vm;
|
|
unsigned long stack_vm;
|
|
unsigned long def_flags;
|
|
unsigned long start_code, end_code, start_data, end_data;
|
|
unsigned long start_brk, brk, start_stack;
|
|
unsigned long arg_start, arg_end, env_start, env_end;
|
|
|
|
unsigned long saved_auxv[(2*(0 + 20 + 1))];
|
|
|
|
|
|
|
|
|
|
|
|
struct mm_rss_stat rss_stat;
|
|
|
|
struct linux_binfmt *binfmt;
|
|
|
|
cpumask_var_t cpu_vm_mask_var;
|
|
|
|
|
|
mm_context_t context;
|
|
|
|
unsigned long flags;
|
|
|
|
struct core_state *core_state;
|
|
|
|
spinlock_t ioctx_lock;
|
|
struct kioctx_table *ioctx_table;
|
|
# 472 "include/linux/mm_types.h"
|
|
struct user_namespace *user_ns;
|
|
|
|
|
|
struct file *exe_file;
|
|
# 505 "include/linux/mm_types.h"
|
|
bool tlb_flush_pending;
|
|
|
|
|
|
|
|
|
|
|
|
struct uprobes_state uprobes_state;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mm_init_cpumask(struct mm_struct *mm)
|
|
{
|
|
|
|
|
|
|
|
cpumask_clear(mm->cpu_vm_mask_var);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) cpumask_t *mm_cpumask(struct mm_struct *mm)
|
|
{
|
|
return mm->cpu_vm_mask_var;
|
|
}
|
|
# 542 "include/linux/mm_types.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool mm_tlb_flush_pending(struct mm_struct *mm)
|
|
{
|
|
__asm__ __volatile__("": : :"memory");
|
|
return mm->tlb_flush_pending;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_tlb_flush_pending(struct mm_struct *mm)
|
|
{
|
|
mm->tlb_flush_pending = true;
|
|
|
|
|
|
|
|
|
|
|
|
__asm__ __volatile__ ("dmb " "ishst" : : : "memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_tlb_flush_pending(struct mm_struct *mm)
|
|
{
|
|
__asm__ __volatile__("": : :"memory");
|
|
mm->tlb_flush_pending = false;
|
|
}
|
|
# 576 "include/linux/mm_types.h"
|
|
struct vm_special_mapping
|
|
{
|
|
const char *name;
|
|
struct page **pages;
|
|
};
|
|
|
|
enum tlb_flush_reason {
|
|
TLB_FLUSH_ON_TASK_SWITCH,
|
|
TLB_REMOTE_SHOOTDOWN,
|
|
TLB_LOCAL_SHOOTDOWN,
|
|
TLB_LOCAL_MM_SHOOTDOWN,
|
|
TLB_REMOTE_SEND_IPI,
|
|
NR_TLB_FLUSH_REASONS,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
unsigned long val;
|
|
} swp_entry_t;
|
|
# 17 "include/linux/mm.h" 2
|
|
# 1 "include/linux/range.h" 1
|
|
|
|
|
|
|
|
struct range {
|
|
u64 start;
|
|
u64 end;
|
|
};
|
|
|
|
int add_range(struct range *range, int az, int nr_range,
|
|
u64 start, u64 end);
|
|
|
|
|
|
int add_range_with_merge(struct range *range, int az, int nr_range,
|
|
u64 start, u64 end);
|
|
|
|
void subtract_range(struct range *range, int az, u64 start, u64 end);
|
|
|
|
int clean_sort_range(struct range *range, int az);
|
|
|
|
void sort_range(struct range *range, int nr_range);
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) resource_size_t cap_resource(u64 val)
|
|
{
|
|
if (val > ((resource_size_t)~0))
|
|
return ((resource_size_t)~0);
|
|
|
|
return val;
|
|
}
|
|
# 18 "include/linux/mm.h" 2
|
|
|
|
# 1 "include/linux/bit_spinlock.h" 1
|
|
# 15 "include/linux/bit_spinlock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bit_spin_lock(int bitnum, unsigned long *addr)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__asm__ __volatile__("": : :"memory");
|
|
|
|
while (__builtin_expect(!!(_test_and_set_bit(bitnum,addr)), 0)) {
|
|
__asm__ __volatile__("": : :"memory");
|
|
do {
|
|
__asm__ __volatile__("": : :"memory");
|
|
} while (test_bit(bitnum, addr));
|
|
__asm__ __volatile__("": : :"memory");
|
|
}
|
|
|
|
(void)0;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bit_spin_trylock(int bitnum, unsigned long *addr)
|
|
{
|
|
__asm__ __volatile__("": : :"memory");
|
|
|
|
if (__builtin_expect(!!(_test_and_set_bit(bitnum,addr)), 0)) {
|
|
__asm__ __volatile__("": : :"memory");
|
|
return 0;
|
|
}
|
|
|
|
(void)0;
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bit_spin_unlock(int bitnum, unsigned long *addr)
|
|
{
|
|
|
|
|
|
|
|
|
|
do { __asm__ __volatile__ ("dmb " "ish" : : : "memory"); _clear_bit(bitnum,addr); } while (0);
|
|
|
|
__asm__ __volatile__("": : :"memory");
|
|
(void)0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __bit_spin_unlock(int bitnum, unsigned long *addr)
|
|
{
|
|
|
|
|
|
|
|
|
|
do { __asm__ __volatile__ ("dmb " "ish" : : : "memory"); _clear_bit(bitnum,addr); } while (0);
|
|
|
|
__asm__ __volatile__("": : :"memory");
|
|
(void)0;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bit_spin_is_locked(int bitnum, unsigned long *addr)
|
|
{
|
|
|
|
return test_bit(bitnum, addr);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
# 20 "include/linux/mm.h" 2
|
|
# 1 "include/linux/shrinker.h" 1
|
|
# 11 "include/linux/shrinker.h"
|
|
struct shrink_control {
|
|
gfp_t gfp_mask;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long nr_to_scan;
|
|
|
|
|
|
int nid;
|
|
|
|
|
|
struct mem_cgroup *memcg;
|
|
};
|
|
# 49 "include/linux/shrinker.h"
|
|
struct shrinker {
|
|
unsigned long (*count_objects)(struct shrinker *,
|
|
struct shrink_control *sc);
|
|
unsigned long (*scan_objects)(struct shrinker *,
|
|
struct shrink_control *sc);
|
|
|
|
int seeks;
|
|
long batch;
|
|
unsigned long flags;
|
|
|
|
|
|
struct list_head list;
|
|
|
|
atomic_long_t *nr_deferred;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern int register_shrinker(struct shrinker *);
|
|
extern void unregister_shrinker(struct shrinker *);
|
|
# 21 "include/linux/mm.h" 2
|
|
# 1 "include/linux/resource.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/resource.h" 1
|
|
# 23 "include/uapi/linux/resource.h"
|
|
struct rusage {
|
|
struct timeval ru_utime;
|
|
struct timeval ru_stime;
|
|
__kernel_long_t ru_maxrss;
|
|
__kernel_long_t ru_ixrss;
|
|
__kernel_long_t ru_idrss;
|
|
__kernel_long_t ru_isrss;
|
|
__kernel_long_t ru_minflt;
|
|
__kernel_long_t ru_majflt;
|
|
__kernel_long_t ru_nswap;
|
|
__kernel_long_t ru_inblock;
|
|
__kernel_long_t ru_oublock;
|
|
__kernel_long_t ru_msgsnd;
|
|
__kernel_long_t ru_msgrcv;
|
|
__kernel_long_t ru_nsignals;
|
|
__kernel_long_t ru_nvcsw;
|
|
__kernel_long_t ru_nivcsw;
|
|
};
|
|
|
|
struct rlimit {
|
|
__kernel_ulong_t rlim_cur;
|
|
__kernel_ulong_t rlim_max;
|
|
};
|
|
|
|
|
|
|
|
struct rlimit64 {
|
|
__u64 rlim_cur;
|
|
__u64 rlim_max;
|
|
};
|
|
# 77 "include/uapi/linux/resource.h"
|
|
# 1 "arch/arm/include/generated/asm/resource.h" 1
|
|
# 1 "include/asm-generic/resource.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/asm-generic/resource.h" 1
|
|
# 5 "include/asm-generic/resource.h" 2
|
|
# 1 "arch/arm/include/generated/asm/resource.h" 2
|
|
# 78 "include/uapi/linux/resource.h" 2
|
|
# 5 "include/linux/resource.h" 2
|
|
|
|
|
|
struct task_struct;
|
|
|
|
int getrusage(struct task_struct *p, int who, struct rusage *ru);
|
|
int do_prlimit(struct task_struct *tsk, unsigned int resource,
|
|
struct rlimit *new_rlim, struct rlimit *old_rlim);
|
|
# 22 "include/linux/mm.h" 2
|
|
# 1 "include/linux/page_ext.h" 1
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/stacktrace.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
struct task_struct;
|
|
struct pt_regs;
|
|
# 6 "include/linux/page_ext.h" 2
|
|
|
|
struct pglist_data;
|
|
struct page_ext_operations {
|
|
bool (*need)(void);
|
|
void (*init)(void);
|
|
};
|
|
# 69 "include/linux/page_ext.h"
|
|
struct page_ext;
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgdat_page_ext_init(struct pglist_data *pgdat)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page_ext *lookup_page_ext(struct page *page)
|
|
{
|
|
return ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void page_ext_init(void)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void page_ext_init_flatmem(void)
|
|
{
|
|
}
|
|
# 23 "include/linux/mm.h" 2
|
|
|
|
|
|
struct mempolicy;
|
|
struct anon_vma;
|
|
struct anon_vma_chain;
|
|
struct file_ra_state;
|
|
struct user_struct;
|
|
struct writeback_control;
|
|
struct bdi_writeback;
|
|
|
|
|
|
extern unsigned long max_mapnr;
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_max_mapnr(unsigned long limit)
|
|
{
|
|
max_mapnr = limit;
|
|
}
|
|
|
|
|
|
|
|
|
|
extern unsigned long totalram_pages;
|
|
extern void * high_memory;
|
|
extern int page_cluster;
|
|
|
|
|
|
extern int sysctl_legacy_va_layout;
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/pgtable.h" 1
|
|
# 14 "./arch/arm/include/asm/pgtable.h"
|
|
# 1 "./arch/arm/include/asm/proc-fns.h" 1
|
|
# 16 "./arch/arm/include/asm/proc-fns.h"
|
|
# 1 "./arch/arm/include/asm/glue-proc.h" 1
|
|
# 14 "./arch/arm/include/asm/glue-proc.h"
|
|
# 1 "./arch/arm/include/asm/glue.h" 1
|
|
# 15 "./arch/arm/include/asm/glue-proc.h" 2
|
|
# 17 "./arch/arm/include/asm/proc-fns.h" 2
|
|
|
|
|
|
|
|
|
|
struct mm_struct;
|
|
|
|
|
|
|
|
|
|
extern struct processor {
|
|
|
|
|
|
|
|
void (*_data_abort)(unsigned long pc);
|
|
|
|
|
|
|
|
unsigned long (*_prefetch_abort)(unsigned long lr);
|
|
|
|
|
|
|
|
void (*_proc_init)(void);
|
|
|
|
|
|
|
|
void (*_proc_fin)(void);
|
|
|
|
|
|
|
|
void (*reset)(unsigned long addr) __attribute__((noreturn));
|
|
|
|
|
|
|
|
int (*_do_idle)(void);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void (*dcache_clean_area)(void *addr, int size);
|
|
|
|
|
|
|
|
|
|
void (*switch_mm)(phys_addr_t pgd_phys, struct mm_struct *mm);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void (*set_pte_ext)(pte_t *ptep, pte_t pte, unsigned int ext);
|
|
|
|
|
|
|
|
unsigned int suspend_size;
|
|
void (*do_suspend)(void *);
|
|
void (*do_resume)(void *);
|
|
} processor;
|
|
# 110 "./arch/arm/include/asm/proc-fns.h"
|
|
extern void cpu_resume(void);
|
|
# 15 "./arch/arm/include/asm/pgtable.h" 2
|
|
# 23 "./arch/arm/include/asm/pgtable.h"
|
|
# 1 "include/asm-generic/pgtable-nopud.h" 1
|
|
# 13 "include/asm-generic/pgtable-nopud.h"
|
|
typedef struct { pgd_t pgd; } pud_t;
|
|
# 25 "include/asm-generic/pgtable-nopud.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pgd_none(pgd_t pgd) { return 0; }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pgd_bad(pgd_t pgd) { return 0; }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pgd_present(pgd_t pgd) { return 1; }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgd_clear(pgd_t *pgd) { }
|
|
# 38 "include/asm-generic/pgtable-nopud.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pud_t * pud_offset(pgd_t * pgd, unsigned long address)
|
|
{
|
|
return (pud_t *)pgd;
|
|
}
|
|
# 24 "./arch/arm/include/asm/pgtable.h" 2
|
|
|
|
# 1 "./arch/arm/include/asm/pgtable-hwdef.h" 1
|
|
# 16 "./arch/arm/include/asm/pgtable-hwdef.h"
|
|
# 1 "./arch/arm/include/asm/pgtable-2level-hwdef.h" 1
|
|
# 17 "./arch/arm/include/asm/pgtable-hwdef.h" 2
|
|
# 26 "./arch/arm/include/asm/pgtable.h" 2
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/tlbflush.h" 1
|
|
# 15 "./arch/arm/include/asm/tlbflush.h"
|
|
# 1 "./arch/arm/include/asm/glue.h" 1
|
|
# 16 "./arch/arm/include/asm/tlbflush.h" 2
|
|
# 204 "./arch/arm/include/asm/tlbflush.h"
|
|
# 1 "include/linux/sched.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/sched.h" 1
|
|
# 5 "include/linux/sched.h" 2
|
|
|
|
# 1 "include/linux/sched/prio.h" 1
|
|
# 47 "include/linux/sched/prio.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long nice_to_rlimit(long nice)
|
|
{
|
|
return (19 - nice + 1);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long rlimit_to_nice(long prio)
|
|
{
|
|
return (19 - prio + 1);
|
|
}
|
|
# 7 "include/linux/sched.h" 2
|
|
|
|
|
|
struct sched_param {
|
|
int sched_priority;
|
|
};
|
|
|
|
# 1 "arch/arm/include/generated/asm/param.h" 1
|
|
# 14 "include/linux/sched.h" 2
|
|
|
|
# 1 "include/linux/capability.h" 1
|
|
# 15 "include/linux/capability.h"
|
|
# 1 "include/uapi/linux/capability.h" 1
|
|
# 18 "include/uapi/linux/capability.h"
|
|
struct task_struct;
|
|
# 40 "include/uapi/linux/capability.h"
|
|
typedef struct __user_cap_header_struct {
|
|
__u32 version;
|
|
int pid;
|
|
} *cap_user_header_t;
|
|
|
|
typedef struct __user_cap_data_struct {
|
|
__u32 effective;
|
|
__u32 permitted;
|
|
__u32 inheritable;
|
|
} *cap_user_data_t;
|
|
# 69 "include/uapi/linux/capability.h"
|
|
struct vfs_cap_data {
|
|
__le32 magic_etc;
|
|
struct {
|
|
__le32 permitted;
|
|
__le32 inheritable;
|
|
} data[2];
|
|
};
|
|
# 16 "include/linux/capability.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
extern int file_caps_enabled;
|
|
|
|
typedef struct kernel_cap_struct {
|
|
__u32 cap[2];
|
|
} kernel_cap_t;
|
|
|
|
|
|
struct cpu_vfs_cap_data {
|
|
__u32 magic_etc;
|
|
kernel_cap_t permitted;
|
|
kernel_cap_t inheritable;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct file;
|
|
struct inode;
|
|
struct dentry;
|
|
struct user_namespace;
|
|
|
|
extern const kernel_cap_t __cap_empty_set;
|
|
extern const kernel_cap_t __cap_init_eff_set;
|
|
# 115 "include/linux/capability.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_combine(const kernel_cap_t a,
|
|
const kernel_cap_t b)
|
|
{
|
|
kernel_cap_t dest;
|
|
do { unsigned __capi; for (__capi = 0; __capi < 2; ++__capi) { dest.cap[__capi] = a.cap[__capi] | b.cap[__capi]; } } while (0);
|
|
return dest;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_intersect(const kernel_cap_t a,
|
|
const kernel_cap_t b)
|
|
{
|
|
kernel_cap_t dest;
|
|
do { unsigned __capi; for (__capi = 0; __capi < 2; ++__capi) { dest.cap[__capi] = a.cap[__capi] & b.cap[__capi]; } } while (0);
|
|
return dest;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_drop(const kernel_cap_t a,
|
|
const kernel_cap_t drop)
|
|
{
|
|
kernel_cap_t dest;
|
|
do { unsigned __capi; for (__capi = 0; __capi < 2; ++__capi) { dest.cap[__capi] = a.cap[__capi] &~ drop.cap[__capi]; } } while (0);
|
|
return dest;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_invert(const kernel_cap_t c)
|
|
{
|
|
kernel_cap_t dest;
|
|
do { unsigned __capi; for (__capi = 0; __capi < 2; ++__capi) { dest.cap[__capi] = ~ c.cap[__capi]; } } while (0);
|
|
return dest;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cap_isclear(const kernel_cap_t a)
|
|
{
|
|
unsigned __capi;
|
|
for (__capi = 0; __capi < 2; ++__capi) {
|
|
if (a.cap[__capi] != 0)
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
# 163 "include/linux/capability.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cap_issubset(const kernel_cap_t a, const kernel_cap_t set)
|
|
{
|
|
kernel_cap_t dest;
|
|
dest = cap_drop(a, set);
|
|
return cap_isclear(dest);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cap_is_fs_cap(int cap)
|
|
{
|
|
const kernel_cap_t __cap_fs_set = ((kernel_cap_t){{ ((1 << ((0) & 31)) | (1 << ((27) & 31)) | (1 << ((1) & 31)) | (1 << ((2) & 31)) | (1 << ((3) & 31)) | (1 << ((4) & 31))) | (1 << ((9) & 31)), ((1 << ((32) & 31))) } });
|
|
return !!((1 << ((cap) & 31)) & __cap_fs_set.cap[((cap) >> 5)]);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_drop_fs_set(const kernel_cap_t a)
|
|
{
|
|
const kernel_cap_t __cap_fs_set = ((kernel_cap_t){{ ((1 << ((0) & 31)) | (1 << ((27) & 31)) | (1 << ((1) & 31)) | (1 << ((2) & 31)) | (1 << ((3) & 31)) | (1 << ((4) & 31))) | (1 << ((9) & 31)), ((1 << ((32) & 31))) } });
|
|
return cap_drop(a, __cap_fs_set);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_raise_fs_set(const kernel_cap_t a,
|
|
const kernel_cap_t permitted)
|
|
{
|
|
const kernel_cap_t __cap_fs_set = ((kernel_cap_t){{ ((1 << ((0) & 31)) | (1 << ((27) & 31)) | (1 << ((1) & 31)) | (1 << ((2) & 31)) | (1 << ((3) & 31)) | (1 << ((4) & 31))) | (1 << ((9) & 31)), ((1 << ((32) & 31))) } });
|
|
return cap_combine(a,
|
|
cap_intersect(permitted, __cap_fs_set));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_drop_nfsd_set(const kernel_cap_t a)
|
|
{
|
|
const kernel_cap_t __cap_fs_set = ((kernel_cap_t){{ ((1 << ((0) & 31)) | (1 << ((27) & 31)) | (1 << ((1) & 31)) | (1 << ((2) & 31)) | (1 << ((3) & 31)) | (1 << ((4) & 31))) | (1 << ((24) & 31)), ((1 << ((32) & 31))) } });
|
|
return cap_drop(a, __cap_fs_set);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) kernel_cap_t cap_raise_nfsd_set(const kernel_cap_t a,
|
|
const kernel_cap_t permitted)
|
|
{
|
|
const kernel_cap_t __cap_nfsd_set = ((kernel_cap_t){{ ((1 << ((0) & 31)) | (1 << ((27) & 31)) | (1 << ((1) & 31)) | (1 << ((2) & 31)) | (1 << ((3) & 31)) | (1 << ((4) & 31))) | (1 << ((24) & 31)), ((1 << ((32) & 31))) } });
|
|
return cap_combine(a,
|
|
cap_intersect(permitted, __cap_nfsd_set));
|
|
}
|
|
|
|
|
|
extern bool has_capability(struct task_struct *t, int cap);
|
|
extern bool has_ns_capability(struct task_struct *t,
|
|
struct user_namespace *ns, int cap);
|
|
extern bool has_capability_noaudit(struct task_struct *t, int cap);
|
|
extern bool has_ns_capability_noaudit(struct task_struct *t,
|
|
struct user_namespace *ns, int cap);
|
|
extern bool capable(int cap);
|
|
extern bool ns_capable(struct user_namespace *ns, int cap);
|
|
extern bool ns_capable_noaudit(struct user_namespace *ns, int cap);
|
|
# 248 "include/linux/capability.h"
|
|
extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct inode *inode);
|
|
extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap);
|
|
extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);
|
|
extern bool ptracer_capable(struct task_struct *tsk, struct user_namespace *ns);
|
|
|
|
|
|
extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps);
|
|
# 16 "include/linux/sched.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/plist.h" 1
|
|
# 81 "include/linux/plist.h"
|
|
struct plist_head {
|
|
struct list_head node_list;
|
|
};
|
|
|
|
struct plist_node {
|
|
int prio;
|
|
struct list_head prio_list;
|
|
struct list_head node_list;
|
|
};
|
|
# 123 "include/linux/plist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
plist_head_init(struct plist_head *head)
|
|
{
|
|
INIT_LIST_HEAD(&head->node_list);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void plist_node_init(struct plist_node *node, int prio)
|
|
{
|
|
node->prio = prio;
|
|
INIT_LIST_HEAD(&node->prio_list);
|
|
INIT_LIST_HEAD(&node->node_list);
|
|
}
|
|
|
|
extern void plist_add(struct plist_node *node, struct plist_head *head);
|
|
extern void plist_del(struct plist_node *node, struct plist_head *head);
|
|
|
|
extern void plist_requeue(struct plist_node *node, struct plist_head *head);
|
|
# 212 "include/linux/plist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int plist_head_empty(const struct plist_head *head)
|
|
{
|
|
return list_empty(&head->node_list);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int plist_node_empty(const struct plist_node *node)
|
|
{
|
|
return list_empty(&node->node_list);
|
|
}
|
|
# 282 "include/linux/plist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct plist_node *plist_first(const struct plist_head *head)
|
|
{
|
|
return ({ const typeof( ((struct plist_node *)0)->node_list ) *__mptr = (head->node_list.next); (struct plist_node *)( (char *)__mptr - __builtin_offsetof(struct plist_node, node_list) );})
|
|
;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct plist_node *plist_last(const struct plist_head *head)
|
|
{
|
|
return ({ const typeof( ((struct plist_node *)0)->node_list ) *__mptr = (head->node_list.prev); (struct plist_node *)( (char *)__mptr - __builtin_offsetof(struct plist_node, node_list) );})
|
|
;
|
|
}
|
|
# 22 "include/linux/sched.h" 2
|
|
# 32 "include/linux/sched.h"
|
|
# 1 "include/linux/cputime.h" 1
|
|
|
|
|
|
|
|
# 1 "arch/arm/include/generated/asm/cputime.h" 1
|
|
# 1 "include/asm-generic/cputime.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/asm-generic/cputime_jiffies.h" 1
|
|
|
|
|
|
|
|
typedef unsigned long cputime_t;
|
|
# 13 "include/asm-generic/cputime_jiffies.h"
|
|
typedef u64 cputime64_t;
|
|
# 9 "include/asm-generic/cputime.h" 2
|
|
# 1 "arch/arm/include/generated/asm/cputime.h" 2
|
|
# 5 "include/linux/cputime.h" 2
|
|
# 33 "include/linux/sched.h" 2
|
|
|
|
|
|
# 1 "include/linux/sem.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/sem.h" 1
|
|
|
|
|
|
|
|
# 1 "include/linux/ipc.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/ipc.h" 1
|
|
# 9 "include/uapi/linux/ipc.h"
|
|
struct ipc_perm
|
|
{
|
|
__kernel_key_t key;
|
|
__kernel_uid_t uid;
|
|
__kernel_gid_t gid;
|
|
__kernel_uid_t cuid;
|
|
__kernel_gid_t cgid;
|
|
__kernel_mode_t mode;
|
|
unsigned short seq;
|
|
};
|
|
|
|
|
|
# 1 "arch/arm/include/generated/asm/ipcbuf.h" 1
|
|
# 1 "./include/uapi/asm-generic/ipcbuf.h" 1
|
|
# 19 "./include/uapi/asm-generic/ipcbuf.h"
|
|
struct ipc64_perm {
|
|
__kernel_key_t key;
|
|
__kernel_uid32_t uid;
|
|
__kernel_gid32_t gid;
|
|
__kernel_uid32_t cuid;
|
|
__kernel_gid32_t cgid;
|
|
__kernel_mode_t mode;
|
|
|
|
unsigned char __pad1[4 - sizeof(__kernel_mode_t)];
|
|
unsigned short seq;
|
|
unsigned short __pad2;
|
|
__kernel_ulong_t __unused1;
|
|
__kernel_ulong_t __unused2;
|
|
};
|
|
# 1 "arch/arm/include/generated/asm/ipcbuf.h" 2
|
|
# 22 "include/uapi/linux/ipc.h" 2
|
|
# 57 "include/uapi/linux/ipc.h"
|
|
struct ipc_kludge {
|
|
struct msgbuf *msgp;
|
|
long msgtyp;
|
|
};
|
|
# 7 "include/linux/ipc.h" 2
|
|
|
|
|
|
|
|
|
|
struct kern_ipc_perm
|
|
{
|
|
spinlock_t lock;
|
|
bool deleted;
|
|
int id;
|
|
key_t key;
|
|
kuid_t uid;
|
|
kgid_t gid;
|
|
kuid_t cuid;
|
|
kgid_t cgid;
|
|
umode_t mode;
|
|
unsigned long seq;
|
|
void *security;
|
|
};
|
|
# 5 "include/uapi/linux/sem.h" 2
|
|
# 23 "include/uapi/linux/sem.h"
|
|
struct semid_ds {
|
|
struct ipc_perm sem_perm;
|
|
__kernel_time_t sem_otime;
|
|
__kernel_time_t sem_ctime;
|
|
struct sem *sem_base;
|
|
struct sem_queue *sem_pending;
|
|
struct sem_queue **sem_pending_last;
|
|
struct sem_undo *undo;
|
|
unsigned short sem_nsems;
|
|
};
|
|
|
|
|
|
# 1 "arch/arm/include/generated/asm/sembuf.h" 1
|
|
# 1 "./include/uapi/asm-generic/sembuf.h" 1
|
|
|
|
|
|
|
|
# 1 "arch/arm/include/generated/asm/bitsperlong.h" 1
|
|
# 5 "./include/uapi/asm-generic/sembuf.h" 2
|
|
# 23 "./include/uapi/asm-generic/sembuf.h"
|
|
struct semid64_ds {
|
|
struct ipc64_perm sem_perm;
|
|
__kernel_time_t sem_otime;
|
|
|
|
unsigned long __unused1;
|
|
|
|
__kernel_time_t sem_ctime;
|
|
|
|
unsigned long __unused2;
|
|
|
|
unsigned long sem_nsems;
|
|
unsigned long __unused3;
|
|
unsigned long __unused4;
|
|
};
|
|
# 1 "arch/arm/include/generated/asm/sembuf.h" 2
|
|
# 36 "include/uapi/linux/sem.h" 2
|
|
|
|
|
|
struct sembuf {
|
|
unsigned short sem_num;
|
|
short sem_op;
|
|
short sem_flg;
|
|
};
|
|
|
|
|
|
union semun {
|
|
int val;
|
|
struct semid_ds *buf;
|
|
unsigned short *array;
|
|
struct seminfo *__buf;
|
|
void *__pad;
|
|
};
|
|
|
|
struct seminfo {
|
|
int semmap;
|
|
int semmni;
|
|
int semmns;
|
|
int semmnu;
|
|
int semmsl;
|
|
int semopm;
|
|
int semume;
|
|
int semusz;
|
|
int semvmx;
|
|
int semaem;
|
|
};
|
|
# 8 "include/linux/sem.h" 2
|
|
|
|
struct task_struct;
|
|
|
|
|
|
struct sem_array {
|
|
struct kern_ipc_perm __attribute__((__aligned__((1 << 6))))
|
|
sem_perm;
|
|
time_t sem_ctime;
|
|
struct sem *sem_base;
|
|
struct list_head pending_alter;
|
|
|
|
struct list_head pending_const;
|
|
|
|
struct list_head list_id;
|
|
int sem_nsems;
|
|
int complex_count;
|
|
bool complex_mode;
|
|
};
|
|
|
|
|
|
|
|
struct sysv_sem {
|
|
struct sem_undo_list *undo_list;
|
|
};
|
|
|
|
extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk);
|
|
extern void exit_sem(struct task_struct *tsk);
|
|
# 36 "include/linux/sched.h" 2
|
|
# 1 "include/linux/shm.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/shm.h" 1
|
|
# 26 "include/uapi/linux/shm.h"
|
|
struct shmid_ds {
|
|
struct ipc_perm shm_perm;
|
|
int shm_segsz;
|
|
__kernel_time_t shm_atime;
|
|
__kernel_time_t shm_dtime;
|
|
__kernel_time_t shm_ctime;
|
|
__kernel_ipc_pid_t shm_cpid;
|
|
__kernel_ipc_pid_t shm_lpid;
|
|
unsigned short shm_nattch;
|
|
unsigned short shm_unused;
|
|
void *shm_unused2;
|
|
void *shm_unused3;
|
|
};
|
|
|
|
|
|
# 1 "arch/arm/include/generated/asm/shmbuf.h" 1
|
|
# 1 "./include/uapi/asm-generic/shmbuf.h" 1
|
|
|
|
|
|
|
|
# 1 "arch/arm/include/generated/asm/bitsperlong.h" 1
|
|
# 5 "./include/uapi/asm-generic/shmbuf.h" 2
|
|
# 25 "./include/uapi/asm-generic/shmbuf.h"
|
|
struct shmid64_ds {
|
|
struct ipc64_perm shm_perm;
|
|
size_t shm_segsz;
|
|
__kernel_time_t shm_atime;
|
|
|
|
unsigned long __unused1;
|
|
|
|
__kernel_time_t shm_dtime;
|
|
|
|
unsigned long __unused2;
|
|
|
|
__kernel_time_t shm_ctime;
|
|
|
|
unsigned long __unused3;
|
|
|
|
__kernel_pid_t shm_cpid;
|
|
__kernel_pid_t shm_lpid;
|
|
__kernel_ulong_t shm_nattch;
|
|
__kernel_ulong_t __unused4;
|
|
__kernel_ulong_t __unused5;
|
|
};
|
|
|
|
struct shminfo64 {
|
|
__kernel_ulong_t shmmax;
|
|
__kernel_ulong_t shmmin;
|
|
__kernel_ulong_t shmmni;
|
|
__kernel_ulong_t shmseg;
|
|
__kernel_ulong_t shmall;
|
|
__kernel_ulong_t __unused1;
|
|
__kernel_ulong_t __unused2;
|
|
__kernel_ulong_t __unused3;
|
|
__kernel_ulong_t __unused4;
|
|
};
|
|
# 1 "arch/arm/include/generated/asm/shmbuf.h" 2
|
|
# 42 "include/uapi/linux/shm.h" 2
|
|
# 62 "include/uapi/linux/shm.h"
|
|
struct shminfo {
|
|
int shmmax;
|
|
int shmmin;
|
|
int shmmni;
|
|
int shmseg;
|
|
int shmall;
|
|
};
|
|
|
|
struct shm_info {
|
|
int used_ids;
|
|
__kernel_ulong_t shm_tot;
|
|
__kernel_ulong_t shm_rss;
|
|
__kernel_ulong_t shm_swp;
|
|
__kernel_ulong_t swap_attempts;
|
|
__kernel_ulong_t swap_successes;
|
|
};
|
|
# 7 "include/linux/shm.h" 2
|
|
# 1 "./arch/arm/include/asm/shmparam.h" 1
|
|
# 8 "include/linux/shm.h" 2
|
|
|
|
struct shmid_kernel
|
|
{
|
|
struct kern_ipc_perm shm_perm;
|
|
struct file *shm_file;
|
|
unsigned long shm_nattch;
|
|
unsigned long shm_segsz;
|
|
time_t shm_atim;
|
|
time_t shm_dtim;
|
|
time_t shm_ctim;
|
|
pid_t shm_cprid;
|
|
pid_t shm_lprid;
|
|
struct user_struct *mlock_user;
|
|
|
|
|
|
struct task_struct *shm_creator;
|
|
struct list_head shm_clist;
|
|
};
|
|
# 49 "include/linux/shm.h"
|
|
struct sysv_shm {
|
|
struct list_head shm_clist;
|
|
};
|
|
|
|
long do_shmat(int shmid, char *shmaddr, int shmflg, unsigned long *addr,
|
|
unsigned long shmlba);
|
|
int is_file_shm_hugepages(struct file *file);
|
|
void exit_shm(struct task_struct *task);
|
|
# 37 "include/linux/sched.h" 2
|
|
# 1 "include/linux/signal.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/signal.h" 1
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/signal.h" 1
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/uapi/asm/signal.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct siginfo;
|
|
# 93 "./arch/arm/include/uapi/asm/signal.h"
|
|
# 1 "./include/uapi/asm-generic/signal-defs.h" 1
|
|
# 17 "./include/uapi/asm-generic/signal-defs.h"
|
|
typedef void __signalfn_t(int);
|
|
typedef __signalfn_t *__sighandler_t;
|
|
|
|
typedef void __restorefn_t(void);
|
|
typedef __restorefn_t *__sigrestore_t;
|
|
# 94 "./arch/arm/include/uapi/asm/signal.h" 2
|
|
# 113 "./arch/arm/include/uapi/asm/signal.h"
|
|
typedef struct sigaltstack {
|
|
void *ss_sp;
|
|
int ss_flags;
|
|
size_t ss_size;
|
|
} stack_t;
|
|
# 5 "./arch/arm/include/asm/signal.h" 2
|
|
# 13 "./arch/arm/include/asm/signal.h"
|
|
typedef unsigned long old_sigset_t;
|
|
|
|
typedef struct {
|
|
unsigned long sig[(64 / 32)];
|
|
} sigset_t;
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/uapi/asm/sigcontext.h" 1
|
|
# 9 "./arch/arm/include/uapi/asm/sigcontext.h"
|
|
struct sigcontext {
|
|
unsigned long trap_no;
|
|
unsigned long error_code;
|
|
unsigned long oldmask;
|
|
unsigned long arm_r0;
|
|
unsigned long arm_r1;
|
|
unsigned long arm_r2;
|
|
unsigned long arm_r3;
|
|
unsigned long arm_r4;
|
|
unsigned long arm_r5;
|
|
unsigned long arm_r6;
|
|
unsigned long arm_r7;
|
|
unsigned long arm_r8;
|
|
unsigned long arm_r9;
|
|
unsigned long arm_r10;
|
|
unsigned long arm_fp;
|
|
unsigned long arm_ip;
|
|
unsigned long arm_sp;
|
|
unsigned long arm_lr;
|
|
unsigned long arm_pc;
|
|
unsigned long arm_cpsr;
|
|
unsigned long fault_address;
|
|
};
|
|
# 22 "./arch/arm/include/asm/signal.h" 2
|
|
# 5 "include/uapi/linux/signal.h" 2
|
|
# 1 "arch/arm/include/generated/asm/siginfo.h" 1
|
|
# 1 "include/asm-generic/siginfo.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/asm-generic/siginfo.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef union sigval {
|
|
int sival_int;
|
|
void *sival_ptr;
|
|
} sigval_t;
|
|
# 48 "include/uapi/asm-generic/siginfo.h"
|
|
typedef struct siginfo {
|
|
int si_signo;
|
|
int si_errno;
|
|
int si_code;
|
|
|
|
union {
|
|
int _pad[((128 - (3 * sizeof(int))) / sizeof(int))];
|
|
|
|
|
|
struct {
|
|
__kernel_pid_t _pid;
|
|
__kernel_uid32_t _uid;
|
|
} _kill;
|
|
|
|
|
|
struct {
|
|
__kernel_timer_t _tid;
|
|
int _overrun;
|
|
char _pad[sizeof( __kernel_uid32_t) - sizeof(int)];
|
|
sigval_t _sigval;
|
|
int _sys_private;
|
|
} _timer;
|
|
|
|
|
|
struct {
|
|
__kernel_pid_t _pid;
|
|
__kernel_uid32_t _uid;
|
|
sigval_t _sigval;
|
|
} _rt;
|
|
|
|
|
|
struct {
|
|
__kernel_pid_t _pid;
|
|
__kernel_uid32_t _uid;
|
|
int _status;
|
|
__kernel_clock_t _utime;
|
|
__kernel_clock_t _stime;
|
|
} _sigchld;
|
|
|
|
|
|
struct {
|
|
void *_addr;
|
|
|
|
|
|
|
|
short _addr_lsb;
|
|
struct {
|
|
void *_lower;
|
|
void *_upper;
|
|
} _addr_bnd;
|
|
} _sigfault;
|
|
|
|
|
|
struct {
|
|
long _band;
|
|
int _fd;
|
|
} _sigpoll;
|
|
|
|
|
|
struct {
|
|
void *_call_addr;
|
|
int _syscall;
|
|
unsigned int _arch;
|
|
} _sigsys;
|
|
} _sifields;
|
|
} siginfo_t;
|
|
# 285 "include/uapi/asm-generic/siginfo.h"
|
|
typedef struct sigevent {
|
|
sigval_t sigev_value;
|
|
int sigev_signo;
|
|
int sigev_notify;
|
|
union {
|
|
int _pad[((64 - (sizeof(int) * 2 + sizeof(sigval_t))) / sizeof(int))];
|
|
int _tid;
|
|
|
|
struct {
|
|
void (*_function)(sigval_t);
|
|
void *_attribute;
|
|
} _sigev_thread;
|
|
} _sigev_un;
|
|
} sigevent_t;
|
|
# 5 "include/asm-generic/siginfo.h" 2
|
|
# 17 "include/asm-generic/siginfo.h"
|
|
struct siginfo;
|
|
void do_schedule_next_timer(struct siginfo *info);
|
|
|
|
extern int copy_siginfo_to_user(struct siginfo *to, const struct siginfo *from);
|
|
# 1 "arch/arm/include/generated/asm/siginfo.h" 2
|
|
# 6 "include/uapi/linux/signal.h" 2
|
|
# 7 "include/linux/signal.h" 2
|
|
|
|
struct task_struct;
|
|
|
|
|
|
extern int print_fatal_signals;
|
|
|
|
|
|
|
|
|
|
struct sigqueue {
|
|
struct list_head list;
|
|
int flags;
|
|
siginfo_t info;
|
|
struct user_struct *user;
|
|
};
|
|
|
|
|
|
|
|
|
|
struct sigpending {
|
|
struct list_head list;
|
|
sigset_t signal;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void copy_siginfo(struct siginfo *to, struct siginfo *from)
|
|
{
|
|
if (from->si_code < 0)
|
|
memcpy(to, from, sizeof(*to));
|
|
else
|
|
|
|
memcpy(to, from, (3 * sizeof(int)) + sizeof(from->_sifields._sigchld));
|
|
}
|
|
# 55 "include/linux/signal.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigaddset(sigset_t *set, int _sig)
|
|
{
|
|
unsigned long sig = _sig - 1;
|
|
if ((64 / 32) == 1)
|
|
set->sig[0] |= 1UL << sig;
|
|
else
|
|
set->sig[sig / 32] |= 1UL << (sig % 32);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigdelset(sigset_t *set, int _sig)
|
|
{
|
|
unsigned long sig = _sig - 1;
|
|
if ((64 / 32) == 1)
|
|
set->sig[0] &= ~(1UL << sig);
|
|
else
|
|
set->sig[sig / 32] &= ~(1UL << (sig % 32));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sigismember(sigset_t *set, int _sig)
|
|
{
|
|
unsigned long sig = _sig - 1;
|
|
if ((64 / 32) == 1)
|
|
return 1 & (set->sig[0] >> sig);
|
|
else
|
|
return 1 & (set->sig[sig / 32] >> (sig % 32));
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sigisemptyset(sigset_t *set)
|
|
{
|
|
switch ((64 / 32)) {
|
|
case 4:
|
|
return (set->sig[3] | set->sig[2] |
|
|
set->sig[1] | set->sig[0]) == 0;
|
|
case 2:
|
|
return (set->sig[1] | set->sig[0]) == 0;
|
|
case 1:
|
|
return set->sig[0] == 0;
|
|
default:
|
|
do { bool __cond = !(!(1)); extern void __compiletime_assert_95(void) __attribute__((error("BUILD_BUG failed"))); if (__cond) __compiletime_assert_95(); do { } while (0); } while (0);
|
|
return 0;
|
|
}
|
|
}
|
|
# 129 "include/linux/signal.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigorsets(sigset_t *r, const sigset_t *a, const sigset_t *b) { unsigned long a0, a1, a2, a3, b0, b1, b2, b3; switch ((64 / 32)) { case 4: a3 = a->sig[3]; a2 = a->sig[2]; b3 = b->sig[3]; b2 = b->sig[2]; r->sig[3] = ((a3) | (b3)); r->sig[2] = ((a2) | (b2)); case 2: a1 = a->sig[1]; b1 = b->sig[1]; r->sig[1] = ((a1) | (b1)); case 1: a0 = a->sig[0]; b0 = b->sig[0]; r->sig[0] = ((a0) | (b0)); break; default: do { bool __cond = !(!(1)); extern void __compiletime_assert_129(void) __attribute__((error("BUILD_BUG failed"))); if (__cond) __compiletime_assert_129(); do { } while (0); } while (0); } }
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigandsets(sigset_t *r, const sigset_t *a, const sigset_t *b) { unsigned long a0, a1, a2, a3, b0, b1, b2, b3; switch ((64 / 32)) { case 4: a3 = a->sig[3]; a2 = a->sig[2]; b3 = b->sig[3]; b2 = b->sig[2]; r->sig[3] = ((a3) & (b3)); r->sig[2] = ((a2) & (b2)); case 2: a1 = a->sig[1]; b1 = b->sig[1]; r->sig[1] = ((a1) & (b1)); case 1: a0 = a->sig[0]; b0 = b->sig[0]; r->sig[0] = ((a0) & (b0)); break; default: do { bool __cond = !(!(1)); extern void __compiletime_assert_132(void) __attribute__((error("BUILD_BUG failed"))); if (__cond) __compiletime_assert_132(); do { } while (0); } while (0); } }
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigandnsets(sigset_t *r, const sigset_t *a, const sigset_t *b) { unsigned long a0, a1, a2, a3, b0, b1, b2, b3; switch ((64 / 32)) { case 4: a3 = a->sig[3]; a2 = a->sig[2]; b3 = b->sig[3]; b2 = b->sig[2]; r->sig[3] = ((a3) & ~(b3)); r->sig[2] = ((a2) & ~(b2)); case 2: a1 = a->sig[1]; b1 = b->sig[1]; r->sig[1] = ((a1) & ~(b1)); case 1: a0 = a->sig[0]; b0 = b->sig[0]; r->sig[0] = ((a0) & ~(b0)); break; default: do { bool __cond = !(!(1)); extern void __compiletime_assert_135(void) __attribute__((error("BUILD_BUG failed"))); if (__cond) __compiletime_assert_135(); do { } while (0); } while (0); } }
|
|
# 157 "include/linux/signal.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void signotset(sigset_t *set) { switch ((64 / 32)) { case 4: set->sig[3] = (~(set->sig[3])); set->sig[2] = (~(set->sig[2])); case 2: set->sig[1] = (~(set->sig[1])); case 1: set->sig[0] = (~(set->sig[0])); break; default: do { bool __cond = !(!(1)); extern void __compiletime_assert_157(void) __attribute__((error("BUILD_BUG failed"))); if (__cond) __compiletime_assert_157(); do { } while (0); } while (0); } }
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigemptyset(sigset_t *set)
|
|
{
|
|
switch ((64 / 32)) {
|
|
default:
|
|
({ void *__p = (set); size_t __n = sizeof(sigset_t); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); });
|
|
break;
|
|
case 2: set->sig[1] = 0;
|
|
case 1: set->sig[0] = 0;
|
|
break;
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigfillset(sigset_t *set)
|
|
{
|
|
switch ((64 / 32)) {
|
|
default:
|
|
({ void *__p = (set); size_t __n = sizeof(sigset_t); if ((__n) != 0) { if (__builtin_constant_p((-1)) && (-1) == 0) __memzero((__p),(__n)); else memset((__p),(-1),(__n)); } (__p); });
|
|
break;
|
|
case 2: set->sig[1] = -1;
|
|
case 1: set->sig[0] = -1;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigaddsetmask(sigset_t *set, unsigned long mask)
|
|
{
|
|
set->sig[0] |= mask;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sigdelsetmask(sigset_t *set, unsigned long mask)
|
|
{
|
|
set->sig[0] &= ~mask;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sigtestsetmask(sigset_t *set, unsigned long mask)
|
|
{
|
|
return (set->sig[0] & mask) != 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void siginitset(sigset_t *set, unsigned long mask)
|
|
{
|
|
set->sig[0] = mask;
|
|
switch ((64 / 32)) {
|
|
default:
|
|
({ void *__p = (&set->sig[1]); size_t __n = sizeof(long)*((64 / 32)-1); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); });
|
|
break;
|
|
case 2: set->sig[1] = 0;
|
|
case 1: ;
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void siginitsetinv(sigset_t *set, unsigned long mask)
|
|
{
|
|
set->sig[0] = ~mask;
|
|
switch ((64 / 32)) {
|
|
default:
|
|
({ void *__p = (&set->sig[1]); size_t __n = sizeof(long)*((64 / 32)-1); if ((__n) != 0) { if (__builtin_constant_p((-1)) && (-1) == 0) __memzero((__p),(__n)); else memset((__p),(-1),(__n)); } (__p); });
|
|
break;
|
|
case 2: set->sig[1] = -1;
|
|
case 1: ;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_sigpending(struct sigpending *sig)
|
|
{
|
|
sigemptyset(&sig->signal);
|
|
INIT_LIST_HEAD(&sig->list);
|
|
}
|
|
|
|
extern void flush_sigqueue(struct sigpending *queue);
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int valid_signal(unsigned long sig)
|
|
{
|
|
return sig <= 64 ? 1 : 0;
|
|
}
|
|
|
|
struct timespec;
|
|
struct pt_regs;
|
|
|
|
extern int next_signal(struct sigpending *pending, sigset_t *mask);
|
|
extern int do_send_sig_info(int sig, struct siginfo *info,
|
|
struct task_struct *p, bool group);
|
|
extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p);
|
|
extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *);
|
|
extern int do_sigtimedwait(const sigset_t *, siginfo_t *,
|
|
const struct timespec *);
|
|
extern int sigprocmask(int, sigset_t *, sigset_t *);
|
|
extern void set_current_blocked(sigset_t *);
|
|
extern void __set_current_blocked(const sigset_t *);
|
|
extern int show_unhandled_signals;
|
|
|
|
struct sigaction {
|
|
|
|
__sighandler_t sa_handler;
|
|
unsigned long sa_flags;
|
|
|
|
|
|
|
|
|
|
|
|
__sigrestore_t sa_restorer;
|
|
|
|
sigset_t sa_mask;
|
|
};
|
|
|
|
struct k_sigaction {
|
|
struct sigaction sa;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
struct old_sigaction {
|
|
__sighandler_t sa_handler;
|
|
old_sigset_t sa_mask;
|
|
unsigned long sa_flags;
|
|
__sigrestore_t sa_restorer;
|
|
};
|
|
|
|
|
|
struct ksignal {
|
|
struct k_sigaction ka;
|
|
siginfo_t info;
|
|
int sig;
|
|
};
|
|
|
|
extern int get_signal(struct ksignal *ksig);
|
|
extern void signal_setup_done(int failed, struct ksignal *ksig, int stepping);
|
|
extern void exit_signals(struct task_struct *tsk);
|
|
extern void kernel_sigaction(int, __sighandler_t);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void allow_signal(int sig)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
kernel_sigaction(sig, ( __sighandler_t)2);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void disallow_signal(int sig)
|
|
{
|
|
kernel_sigaction(sig, (( __sighandler_t)1));
|
|
}
|
|
|
|
extern struct kmem_cache *sighand_cachep;
|
|
|
|
int unhandled_signal(struct task_struct *tsk, int sig);
|
|
# 441 "include/linux/signal.h"
|
|
void signals_init(void);
|
|
|
|
int restore_altstack(const stack_t *);
|
|
int __save_altstack(stack_t *, unsigned long);
|
|
# 455 "include/linux/signal.h"
|
|
struct seq_file;
|
|
extern void render_sigset_t(struct seq_file *, const char *, sigset_t *);
|
|
# 38 "include/linux/sched.h" 2
|
|
|
|
|
|
# 1 "include/linux/pid.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
enum pid_type
|
|
{
|
|
PIDTYPE_PID,
|
|
PIDTYPE_PGID,
|
|
PIDTYPE_SID,
|
|
PIDTYPE_MAX,
|
|
|
|
__PIDTYPE_TGID
|
|
};
|
|
# 52 "include/linux/pid.h"
|
|
struct upid {
|
|
|
|
int nr;
|
|
struct pid_namespace *ns;
|
|
struct hlist_node pid_chain;
|
|
};
|
|
|
|
struct pid
|
|
{
|
|
atomic_t count;
|
|
unsigned int level;
|
|
|
|
struct hlist_head tasks[PIDTYPE_MAX];
|
|
struct callback_head rcu;
|
|
struct upid numbers[1];
|
|
};
|
|
|
|
extern struct pid init_struct_pid;
|
|
|
|
struct pid_link
|
|
{
|
|
struct hlist_node node;
|
|
struct pid *pid;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pid *get_pid(struct pid *pid)
|
|
{
|
|
if (pid)
|
|
atomic_add(1, &pid->count);
|
|
return pid;
|
|
}
|
|
|
|
extern void put_pid(struct pid *pid);
|
|
extern struct task_struct *pid_task(struct pid *pid, enum pid_type);
|
|
extern struct task_struct *get_pid_task(struct pid *pid, enum pid_type);
|
|
|
|
extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type);
|
|
|
|
|
|
|
|
|
|
extern void attach_pid(struct task_struct *task, enum pid_type);
|
|
extern void detach_pid(struct task_struct *task, enum pid_type);
|
|
extern void change_pid(struct task_struct *task, enum pid_type,
|
|
struct pid *pid);
|
|
extern void transfer_pid(struct task_struct *old, struct task_struct *new,
|
|
enum pid_type);
|
|
|
|
struct pid_namespace;
|
|
extern struct pid_namespace init_pid_ns;
|
|
# 112 "include/linux/pid.h"
|
|
extern struct pid *find_pid_ns(int nr, struct pid_namespace *ns);
|
|
extern struct pid *find_vpid(int nr);
|
|
|
|
|
|
|
|
|
|
extern struct pid *find_get_pid(int nr);
|
|
extern struct pid *find_ge_pid(int nr, struct pid_namespace *);
|
|
int next_pidmap(struct pid_namespace *pid_ns, unsigned int last);
|
|
|
|
extern struct pid *alloc_pid(struct pid_namespace *ns);
|
|
extern void free_pid(struct pid *pid);
|
|
extern void disable_pid_allocation(struct pid_namespace *ns);
|
|
# 136 "include/linux/pid.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pid_namespace *ns_of_pid(struct pid *pid)
|
|
{
|
|
struct pid_namespace *ns = ((void *)0);
|
|
if (pid)
|
|
ns = pid->numbers[pid->level].ns;
|
|
return ns;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_child_reaper(struct pid *pid)
|
|
{
|
|
return pid->numbers[pid->level].nr == 1;
|
|
}
|
|
# 166 "include/linux/pid.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t pid_nr(struct pid *pid)
|
|
{
|
|
pid_t nr = 0;
|
|
if (pid)
|
|
nr = pid->numbers[0].nr;
|
|
return nr;
|
|
}
|
|
|
|
pid_t pid_nr_ns(struct pid *pid, struct pid_namespace *ns);
|
|
pid_t pid_vnr(struct pid *pid);
|
|
# 41 "include/linux/sched.h" 2
|
|
|
|
|
|
# 1 "include/linux/proportions.h" 1
|
|
# 12 "include/linux/proportions.h"
|
|
# 1 "include/linux/percpu_counter.h" 1
|
|
# 19 "include/linux/percpu_counter.h"
|
|
struct percpu_counter {
|
|
raw_spinlock_t lock;
|
|
s64 count;
|
|
|
|
struct list_head list;
|
|
|
|
s32 *counters;
|
|
};
|
|
|
|
extern int percpu_counter_batch;
|
|
|
|
int __percpu_counter_init(struct percpu_counter *fbc, s64 amount, gfp_t gfp,
|
|
struct lock_class_key *key);
|
|
# 40 "include/linux/percpu_counter.h"
|
|
void percpu_counter_destroy(struct percpu_counter *fbc);
|
|
void percpu_counter_set(struct percpu_counter *fbc, s64 amount);
|
|
void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch);
|
|
s64 __percpu_counter_sum(struct percpu_counter *fbc);
|
|
int __percpu_counter_compare(struct percpu_counter *fbc, s64 rhs, s32 batch);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int percpu_counter_compare(struct percpu_counter *fbc, s64 rhs)
|
|
{
|
|
return __percpu_counter_compare(fbc, rhs, percpu_counter_batch);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void percpu_counter_add(struct percpu_counter *fbc, s64 amount)
|
|
{
|
|
__percpu_counter_add(fbc, amount, percpu_counter_batch);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 percpu_counter_sum_positive(struct percpu_counter *fbc)
|
|
{
|
|
s64 ret = __percpu_counter_sum(fbc);
|
|
return ret < 0 ? 0 : ret;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 percpu_counter_sum(struct percpu_counter *fbc)
|
|
{
|
|
return __percpu_counter_sum(fbc);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 percpu_counter_read(struct percpu_counter *fbc)
|
|
{
|
|
return fbc->count;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 percpu_counter_read_positive(struct percpu_counter *fbc)
|
|
{
|
|
s64 ret = fbc->count;
|
|
|
|
__asm__ __volatile__("": : :"memory");
|
|
if (ret >= 0)
|
|
return ret;
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int percpu_counter_initialized(struct percpu_counter *fbc)
|
|
{
|
|
return (fbc->counters != ((void *)0));
|
|
}
|
|
# 175 "include/linux/percpu_counter.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void percpu_counter_inc(struct percpu_counter *fbc)
|
|
{
|
|
percpu_counter_add(fbc, 1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void percpu_counter_dec(struct percpu_counter *fbc)
|
|
{
|
|
percpu_counter_add(fbc, -1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void percpu_counter_sub(struct percpu_counter *fbc, s64 amount)
|
|
{
|
|
percpu_counter_add(fbc, -amount);
|
|
}
|
|
# 13 "include/linux/proportions.h" 2
|
|
|
|
|
|
|
|
|
|
struct prop_global {
|
|
|
|
|
|
|
|
|
|
|
|
int shift;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct percpu_counter events;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct prop_descriptor {
|
|
int index;
|
|
struct prop_global pg[2];
|
|
struct mutex mutex;
|
|
};
|
|
|
|
int prop_descriptor_init(struct prop_descriptor *pd, int shift, gfp_t gfp);
|
|
void prop_change_shift(struct prop_descriptor *pd, int new_shift);
|
|
|
|
|
|
|
|
|
|
|
|
struct prop_local_percpu {
|
|
|
|
|
|
|
|
struct percpu_counter events;
|
|
|
|
|
|
|
|
|
|
int shift;
|
|
unsigned long period;
|
|
raw_spinlock_t lock;
|
|
};
|
|
|
|
int prop_local_init_percpu(struct prop_local_percpu *pl, gfp_t gfp);
|
|
void prop_local_destroy_percpu(struct prop_local_percpu *pl);
|
|
void __prop_inc_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl);
|
|
void prop_fraction_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl,
|
|
long *numerator, long *denominator);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
void prop_inc_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl)
|
|
{
|
|
unsigned long flags;
|
|
|
|
do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0); } while (0);
|
|
__prop_inc_percpu(pd, pl);
|
|
do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); } while (0);
|
|
}
|
|
# 94 "include/linux/proportions.h"
|
|
void __prop_inc_percpu_max(struct prop_descriptor *pd,
|
|
struct prop_local_percpu *pl, long frac);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct prop_local_single {
|
|
|
|
|
|
|
|
unsigned long events;
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long period;
|
|
int shift;
|
|
raw_spinlock_t lock;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
int prop_local_init_single(struct prop_local_single *pl);
|
|
void prop_local_destroy_single(struct prop_local_single *pl);
|
|
void __prop_inc_single(struct prop_descriptor *pd, struct prop_local_single *pl);
|
|
void prop_fraction_single(struct prop_descriptor *pd, struct prop_local_single *pl,
|
|
long *numerator, long *denominator);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
void prop_inc_single(struct prop_descriptor *pd, struct prop_local_single *pl)
|
|
{
|
|
unsigned long flags;
|
|
|
|
do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0); } while (0);
|
|
__prop_inc_single(pd, pl);
|
|
do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); } while (0);
|
|
}
|
|
# 44 "include/linux/sched.h" 2
|
|
# 1 "include/linux/seccomp.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/seccomp.h" 1
|
|
# 47 "include/uapi/linux/seccomp.h"
|
|
struct seccomp_data {
|
|
int nr;
|
|
__u32 arch;
|
|
__u64 instruction_pointer;
|
|
__u64 args[6];
|
|
};
|
|
# 5 "include/linux/seccomp.h" 2
|
|
# 60 "include/linux/seccomp.h"
|
|
struct seccomp { };
|
|
struct seccomp_filter { };
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void secure_computing_strict(int this_syscall) { return; }
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long prctl_get_seccomp(void)
|
|
{
|
|
return -22;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long prctl_set_seccomp(unsigned long arg2, char *arg3)
|
|
{
|
|
return -22;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int seccomp_mode(struct seccomp *s)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_seccomp_filter(struct task_struct *tsk)
|
|
{
|
|
return;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void get_seccomp_filter(struct task_struct *tsk)
|
|
{
|
|
return;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long seccomp_get_filter(struct task_struct *task,
|
|
unsigned long n, void *data)
|
|
{
|
|
return -22;
|
|
}
|
|
# 45 "include/linux/sched.h" 2
|
|
|
|
# 1 "include/linux/rculist.h" 1
|
|
# 30 "include/linux/rculist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void INIT_LIST_HEAD_RCU(struct list_head *list)
|
|
{
|
|
({ union { typeof(list->next) __val; char __c[1]; } __u = { .__val = ( typeof(list->next)) (list) }; __write_once_size(&(list->next), __u.__c, sizeof(list->next)); __u.__val; });
|
|
({ union { typeof(list->prev) __val; char __c[1]; } __u = { .__val = ( typeof(list->prev)) (list) }; __write_once_size(&(list->prev), __u.__c, sizeof(list->prev)); __u.__val; });
|
|
}
|
|
# 49 "include/linux/rculist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __list_add_rcu(struct list_head *new,
|
|
struct list_head *prev, struct list_head *next)
|
|
{
|
|
new->next = next;
|
|
new->prev = prev;
|
|
do { do { bool __cond = !((sizeof(*&(*((struct list_head **)(&(prev)->next)))) == sizeof(char) || sizeof(*&(*((struct list_head **)(&(prev)->next)))) == sizeof(short) || sizeof(*&(*((struct list_head **)(&(prev)->next)))) == sizeof(int) || sizeof(*&(*((struct list_head **)(&(prev)->next)))) == sizeof(long))); extern void __compiletime_assert_54(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_54(); do { } while (0); } while (0); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); ({ union { typeof(*&(*((struct list_head **)(&(prev)->next)))) __val; char __c[1]; } __u = { .__val = ( typeof(*&(*((struct list_head **)(&(prev)->next))))) ((typeof(*(new)) *)(new)) }; __write_once_size(&(*&(*((struct list_head **)(&(prev)->next)))), __u.__c, sizeof(*&(*((struct list_head **)(&(prev)->next))))); __u.__val; }); } while (0);
|
|
next->prev = new;
|
|
}
|
|
# 78 "include/linux/rculist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_add_rcu(struct list_head *new, struct list_head *head)
|
|
{
|
|
__list_add_rcu(new, head, head->next);
|
|
}
|
|
# 99 "include/linux/rculist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_add_tail_rcu(struct list_head *new,
|
|
struct list_head *head)
|
|
{
|
|
__list_add_rcu(new, head->prev, head);
|
|
}
|
|
# 129 "include/linux/rculist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_del_rcu(struct list_head *entry)
|
|
{
|
|
__list_del_entry(entry);
|
|
entry->prev = ((void *) 0x200 + 0);
|
|
}
|
|
# 155 "include/linux/rculist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_del_init_rcu(struct hlist_node *n)
|
|
{
|
|
if (!hlist_unhashed(n)) {
|
|
__hlist_del(n);
|
|
n->pprev = ((void *)0);
|
|
}
|
|
}
|
|
# 171 "include/linux/rculist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_replace_rcu(struct list_head *old,
|
|
struct list_head *new)
|
|
{
|
|
new->next = old->next;
|
|
new->prev = old->prev;
|
|
do { do { bool __cond = !((sizeof(*&(*((struct list_head **)(&(new->prev)->next)))) == sizeof(char) || sizeof(*&(*((struct list_head **)(&(new->prev)->next)))) == sizeof(short) || sizeof(*&(*((struct list_head **)(&(new->prev)->next)))) == sizeof(int) || sizeof(*&(*((struct list_head **)(&(new->prev)->next)))) == sizeof(long))); extern void __compiletime_assert_176(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_176(); do { } while (0); } while (0); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); ({ union { typeof(*&(*((struct list_head **)(&(new->prev)->next)))) __val; char __c[1]; } __u = { .__val = ( typeof(*&(*((struct list_head **)(&(new->prev)->next))))) ((typeof(*(new)) *)(new)) }; __write_once_size(&(*&(*((struct list_head **)(&(new->prev)->next)))), __u.__c, sizeof(*&(*((struct list_head **)(&(new->prev)->next))))); __u.__val; }); } while (0);
|
|
new->next->prev = new;
|
|
old->prev = ((void *) 0x200 + 0);
|
|
}
|
|
# 198 "include/linux/rculist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void list_splice_init_rcu(struct list_head *list,
|
|
struct list_head *head,
|
|
void (*sync)(void))
|
|
{
|
|
struct list_head *first = list->next;
|
|
struct list_head *last = list->prev;
|
|
struct list_head *at = head->next;
|
|
|
|
if (list_empty(list))
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
INIT_LIST_HEAD_RCU(list);
|
|
# 224 "include/linux/rculist.h"
|
|
sync();
|
|
# 234 "include/linux/rculist.h"
|
|
last->next = at;
|
|
do { do { bool __cond = !((sizeof(*&(*((struct list_head **)(&(head)->next)))) == sizeof(char) || sizeof(*&(*((struct list_head **)(&(head)->next)))) == sizeof(short) || sizeof(*&(*((struct list_head **)(&(head)->next)))) == sizeof(int) || sizeof(*&(*((struct list_head **)(&(head)->next)))) == sizeof(long))); extern void __compiletime_assert_235(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_235(); do { } while (0); } while (0); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); ({ union { typeof(*&(*((struct list_head **)(&(head)->next)))) __val; char __c[1]; } __u = { .__val = ( typeof(*&(*((struct list_head **)(&(head)->next))))) ((typeof(*(first)) *)(first)) }; __write_once_size(&(*&(*((struct list_head **)(&(head)->next)))), __u.__c, sizeof(*&(*((struct list_head **)(&(head)->next))))); __u.__val; }); } while (0);
|
|
first->prev = head;
|
|
at->prev = last;
|
|
}
|
|
# 340 "include/linux/rculist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_del_rcu(struct hlist_node *n)
|
|
{
|
|
__hlist_del(n);
|
|
n->pprev = ((void *) 0x200 + 0);
|
|
}
|
|
# 353 "include/linux/rculist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_replace_rcu(struct hlist_node *old,
|
|
struct hlist_node *new)
|
|
{
|
|
struct hlist_node *next = old->next;
|
|
|
|
new->next = next;
|
|
new->pprev = old->pprev;
|
|
do { do { bool __cond = !((sizeof(*&*(struct hlist_node **)new->pprev) == sizeof(char) || sizeof(*&*(struct hlist_node **)new->pprev) == sizeof(short) || sizeof(*&*(struct hlist_node **)new->pprev) == sizeof(int) || sizeof(*&*(struct hlist_node **)new->pprev) == sizeof(long))); extern void __compiletime_assert_360(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_360(); do { } while (0); } while (0); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); ({ union { typeof(*&*(struct hlist_node **)new->pprev) __val; char __c[1]; } __u = { .__val = ( typeof(*&*(struct hlist_node **)new->pprev)) ((typeof(*(new)) *)(new)) }; __write_once_size(&(*&*(struct hlist_node **)new->pprev), __u.__c, sizeof(*&*(struct hlist_node **)new->pprev)); __u.__val; }); } while (0);
|
|
if (next)
|
|
new->next->pprev = &new->next;
|
|
old->pprev = ((void *) 0x200 + 0);
|
|
}
|
|
# 392 "include/linux/rculist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_add_head_rcu(struct hlist_node *n,
|
|
struct hlist_head *h)
|
|
{
|
|
struct hlist_node *first = h->first;
|
|
|
|
n->next = first;
|
|
n->pprev = &h->first;
|
|
do { do { bool __cond = !((sizeof(*&(*((struct hlist_node **)(&(h)->first)))) == sizeof(char) || sizeof(*&(*((struct hlist_node **)(&(h)->first)))) == sizeof(short) || sizeof(*&(*((struct hlist_node **)(&(h)->first)))) == sizeof(int) || sizeof(*&(*((struct hlist_node **)(&(h)->first)))) == sizeof(long))); extern void __compiletime_assert_399(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_399(); do { } while (0); } while (0); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); ({ union { typeof(*&(*((struct hlist_node **)(&(h)->first)))) __val; char __c[1]; } __u = { .__val = ( typeof(*&(*((struct hlist_node **)(&(h)->first))))) ((typeof(*(n)) *)(n)) }; __write_once_size(&(*&(*((struct hlist_node **)(&(h)->first)))), __u.__c, sizeof(*&(*((struct hlist_node **)(&(h)->first))))); __u.__val; }); } while (0);
|
|
if (first)
|
|
first->pprev = &n->next;
|
|
}
|
|
# 422 "include/linux/rculist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_add_before_rcu(struct hlist_node *n,
|
|
struct hlist_node *next)
|
|
{
|
|
n->pprev = next->pprev;
|
|
n->next = next;
|
|
do { do { bool __cond = !((sizeof(*&(*((struct hlist_node **)((n)->pprev)))) == sizeof(char) || sizeof(*&(*((struct hlist_node **)((n)->pprev)))) == sizeof(short) || sizeof(*&(*((struct hlist_node **)((n)->pprev)))) == sizeof(int) || sizeof(*&(*((struct hlist_node **)((n)->pprev)))) == sizeof(long))); extern void __compiletime_assert_427(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_427(); do { } while (0); } while (0); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); ({ union { typeof(*&(*((struct hlist_node **)((n)->pprev)))) __val; char __c[1]; } __u = { .__val = ( typeof(*&(*((struct hlist_node **)((n)->pprev))))) ((typeof(*(n)) *)(n)) }; __write_once_size(&(*&(*((struct hlist_node **)((n)->pprev)))), __u.__c, sizeof(*&(*((struct hlist_node **)((n)->pprev))))); __u.__val; }); } while (0);
|
|
next->pprev = &n->next;
|
|
}
|
|
# 449 "include/linux/rculist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_add_behind_rcu(struct hlist_node *n,
|
|
struct hlist_node *prev)
|
|
{
|
|
n->next = prev->next;
|
|
n->pprev = &prev->next;
|
|
do { do { bool __cond = !((sizeof(*&(*((struct hlist_node **)(&(prev)->next)))) == sizeof(char) || sizeof(*&(*((struct hlist_node **)(&(prev)->next)))) == sizeof(short) || sizeof(*&(*((struct hlist_node **)(&(prev)->next)))) == sizeof(int) || sizeof(*&(*((struct hlist_node **)(&(prev)->next)))) == sizeof(long))); extern void __compiletime_assert_454(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_454(); do { } while (0); } while (0); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); ({ union { typeof(*&(*((struct hlist_node **)(&(prev)->next)))) __val; char __c[1]; } __u = { .__val = ( typeof(*&(*((struct hlist_node **)(&(prev)->next))))) ((typeof(*(n)) *)(n)) }; __write_once_size(&(*&(*((struct hlist_node **)(&(prev)->next)))), __u.__c, sizeof(*&(*((struct hlist_node **)(&(prev)->next))))); __u.__val; }); } while (0);
|
|
if (n->next)
|
|
n->next->pprev = &n->next;
|
|
}
|
|
# 47 "include/linux/sched.h" 2
|
|
# 1 "include/linux/rtmutex.h" 1
|
|
# 19 "include/linux/rtmutex.h"
|
|
extern int max_lock_depth;
|
|
# 29 "include/linux/rtmutex.h"
|
|
struct rt_mutex {
|
|
raw_spinlock_t wait_lock;
|
|
struct rb_root waiters;
|
|
struct rb_node *waiters_leftmost;
|
|
struct task_struct *owner;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
struct rt_mutex_waiter;
|
|
struct hrtimer_sleeper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rt_mutex_debug_check_no_locks_freed(const void *from,
|
|
unsigned long len)
|
|
{
|
|
return 0;
|
|
}
|
|
# 84 "include/linux/rtmutex.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rt_mutex_is_locked(struct rt_mutex *lock)
|
|
{
|
|
return lock->owner != ((void *)0);
|
|
}
|
|
|
|
extern void __rt_mutex_init(struct rt_mutex *lock, const char *name);
|
|
extern void rt_mutex_destroy(struct rt_mutex *lock);
|
|
|
|
extern void rt_mutex_lock(struct rt_mutex *lock);
|
|
extern int rt_mutex_lock_interruptible(struct rt_mutex *lock);
|
|
extern int rt_mutex_timed_lock(struct rt_mutex *lock,
|
|
struct hrtimer_sleeper *timeout);
|
|
|
|
extern int rt_mutex_trylock(struct rt_mutex *lock);
|
|
|
|
extern void rt_mutex_unlock(struct rt_mutex *lock);
|
|
# 48 "include/linux/sched.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/hrtimer.h" 1
|
|
# 25 "include/linux/hrtimer.h"
|
|
# 1 "include/linux/timerqueue.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct timerqueue_node {
|
|
struct rb_node node;
|
|
ktime_t expires;
|
|
};
|
|
|
|
struct timerqueue_head {
|
|
struct rb_root head;
|
|
struct timerqueue_node *next;
|
|
};
|
|
|
|
|
|
extern bool timerqueue_add(struct timerqueue_head *head,
|
|
struct timerqueue_node *node);
|
|
extern bool timerqueue_del(struct timerqueue_head *head,
|
|
struct timerqueue_node *node);
|
|
extern struct timerqueue_node *timerqueue_iterate_next(
|
|
struct timerqueue_node *node);
|
|
# 34 "include/linux/timerqueue.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
struct timerqueue_node *timerqueue_getnext(struct timerqueue_head *head)
|
|
{
|
|
return head->next;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void timerqueue_init(struct timerqueue_node *node)
|
|
{
|
|
((&node->node)->__rb_parent_color = (unsigned long)(&node->node));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void timerqueue_init_head(struct timerqueue_head *head)
|
|
{
|
|
head->head = (struct rb_root) { ((void *)0), };
|
|
head->next = ((void *)0);
|
|
}
|
|
# 26 "include/linux/hrtimer.h" 2
|
|
|
|
struct hrtimer_clock_base;
|
|
struct hrtimer_cpu_base;
|
|
|
|
|
|
|
|
|
|
enum hrtimer_mode {
|
|
HRTIMER_MODE_ABS = 0x0,
|
|
HRTIMER_MODE_REL = 0x1,
|
|
HRTIMER_MODE_PINNED = 0x02,
|
|
HRTIMER_MODE_ABS_PINNED = 0x02,
|
|
HRTIMER_MODE_REL_PINNED = 0x03,
|
|
};
|
|
|
|
|
|
|
|
|
|
enum hrtimer_restart {
|
|
HRTIMER_NORESTART,
|
|
HRTIMER_RESTART,
|
|
};
|
|
# 100 "include/linux/hrtimer.h"
|
|
struct hrtimer {
|
|
struct timerqueue_node node;
|
|
ktime_t _softexpires;
|
|
enum hrtimer_restart (*function)(struct hrtimer *);
|
|
struct hrtimer_clock_base *base;
|
|
u8 state;
|
|
u8 is_rel;
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
# 121 "include/linux/hrtimer.h"
|
|
struct hrtimer_sleeper {
|
|
struct hrtimer timer;
|
|
struct task_struct *task;
|
|
};
|
|
# 142 "include/linux/hrtimer.h"
|
|
struct hrtimer_clock_base {
|
|
struct hrtimer_cpu_base *cpu_base;
|
|
int index;
|
|
clockid_t clockid;
|
|
struct timerqueue_head active;
|
|
ktime_t (*get_time)(void);
|
|
ktime_t offset;
|
|
} __attribute__((__aligned__(32)));
|
|
|
|
enum hrtimer_base_type {
|
|
HRTIMER_BASE_MONOTONIC,
|
|
HRTIMER_BASE_REALTIME,
|
|
HRTIMER_BASE_BOOTTIME,
|
|
HRTIMER_BASE_TAI,
|
|
HRTIMER_MAX_CLOCK_BASES,
|
|
};
|
|
# 186 "include/linux/hrtimer.h"
|
|
struct hrtimer_cpu_base {
|
|
raw_spinlock_t lock;
|
|
seqcount_t seq;
|
|
struct hrtimer *running;
|
|
unsigned int cpu;
|
|
unsigned int active_bases;
|
|
unsigned int clock_was_set_seq;
|
|
bool migration_enabled;
|
|
bool nohz_active;
|
|
# 206 "include/linux/hrtimer.h"
|
|
struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES];
|
|
} __attribute__((__aligned__((1 << 6))));
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_set_expires(struct hrtimer *timer, ktime_t time)
|
|
{
|
|
((void)sizeof(char[1 - 2*!!(sizeof(struct hrtimer_clock_base) > 32)]));
|
|
|
|
timer->node.expires = time;
|
|
timer->_softexpires = time;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_set_expires_range(struct hrtimer *timer, ktime_t time, ktime_t delta)
|
|
{
|
|
timer->_softexpires = time;
|
|
timer->node.expires = ktime_add_safe(time, delta);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_set_expires_range_ns(struct hrtimer *timer, ktime_t time, unsigned long delta)
|
|
{
|
|
timer->_softexpires = time;
|
|
timer->node.expires = ktime_add_safe(time, ns_to_ktime(delta));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_set_expires_tv64(struct hrtimer *timer, s64 tv64)
|
|
{
|
|
timer->node.expires.tv64 = tv64;
|
|
timer->_softexpires.tv64 = tv64;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_add_expires(struct hrtimer *timer, ktime_t time)
|
|
{
|
|
timer->node.expires = ktime_add_safe(timer->node.expires, time);
|
|
timer->_softexpires = ktime_add_safe(timer->_softexpires, time);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_add_expires_ns(struct hrtimer *timer, u64 ns)
|
|
{
|
|
timer->node.expires = ({ (ktime_t){ .tv64 = (timer->node.expires).tv64 + (ns) }; });
|
|
timer->_softexpires = ({ (ktime_t){ .tv64 = (timer->_softexpires).tv64 + (ns) }; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t hrtimer_get_expires(const struct hrtimer *timer)
|
|
{
|
|
return timer->node.expires;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t hrtimer_get_softexpires(const struct hrtimer *timer)
|
|
{
|
|
return timer->_softexpires;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 hrtimer_get_expires_tv64(const struct hrtimer *timer)
|
|
{
|
|
return timer->node.expires.tv64;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 hrtimer_get_softexpires_tv64(const struct hrtimer *timer)
|
|
{
|
|
return timer->_softexpires.tv64;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 hrtimer_get_expires_ns(const struct hrtimer *timer)
|
|
{
|
|
return ((timer->node.expires).tv64);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t hrtimer_expires_remaining(const struct hrtimer *timer)
|
|
{
|
|
return ({ (ktime_t){ .tv64 = (timer->node.expires).tv64 - (timer->base->get_time()).tv64 }; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t hrtimer_cb_get_time(struct hrtimer *timer)
|
|
{
|
|
return timer->base->get_time();
|
|
}
|
|
# 315 "include/linux/hrtimer.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_peek_ahead_timers(void) { }
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hrtimer_is_hres_active(struct hrtimer *timer)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clock_was_set_delayed(void) { }
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t
|
|
__hrtimer_expires_remaining_adjusted(const struct hrtimer *timer, ktime_t now)
|
|
{
|
|
ktime_t rem = ({ (ktime_t){ .tv64 = (timer->node.expires).tv64 - (now).tv64 }; });
|
|
|
|
|
|
|
|
|
|
|
|
if ((0 || 0) && timer->is_rel)
|
|
rem.tv64 -= (unsigned int)((1000000000L +100/2)/100);
|
|
return rem;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t
|
|
hrtimer_expires_remaining_adjusted(const struct hrtimer *timer)
|
|
{
|
|
return __hrtimer_expires_remaining_adjusted(timer,
|
|
timer->base->get_time());
|
|
}
|
|
|
|
extern void clock_was_set(void);
|
|
|
|
extern void timerfd_clock_was_set(void);
|
|
|
|
|
|
|
|
extern void hrtimers_resume(void);
|
|
|
|
extern __attribute__((section(".data..percpu" ""))) __typeof__(struct tick_device) tick_cpu_device;
|
|
|
|
|
|
|
|
|
|
|
|
extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock,
|
|
enum hrtimer_mode mode);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_init_on_stack(struct hrtimer *timer,
|
|
clockid_t which_clock,
|
|
enum hrtimer_mode mode)
|
|
{
|
|
hrtimer_init(timer, which_clock, mode);
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void destroy_hrtimer_on_stack(struct hrtimer *timer) { }
|
|
|
|
|
|
|
|
extern void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
|
|
unsigned long range_ns, const enum hrtimer_mode mode);
|
|
# 390 "include/linux/hrtimer.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_start(struct hrtimer *timer, ktime_t tim,
|
|
const enum hrtimer_mode mode)
|
|
{
|
|
hrtimer_start_range_ns(timer, tim, 0, mode);
|
|
}
|
|
|
|
extern int hrtimer_cancel(struct hrtimer *timer);
|
|
extern int hrtimer_try_to_cancel(struct hrtimer *timer);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_start_expires(struct hrtimer *timer,
|
|
enum hrtimer_mode mode)
|
|
{
|
|
unsigned long delta;
|
|
ktime_t soft, hard;
|
|
soft = hrtimer_get_softexpires(timer);
|
|
hard = hrtimer_get_expires(timer);
|
|
delta = ((({ (ktime_t){ .tv64 = (hard).tv64 - (soft).tv64 }; })).tv64);
|
|
hrtimer_start_range_ns(timer, soft, delta, mode);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hrtimer_restart(struct hrtimer *timer)
|
|
{
|
|
hrtimer_start_expires(timer, HRTIMER_MODE_ABS);
|
|
}
|
|
|
|
|
|
extern ktime_t __hrtimer_get_remaining(const struct hrtimer *timer, bool adjust);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t hrtimer_get_remaining(const struct hrtimer *timer)
|
|
{
|
|
return __hrtimer_get_remaining(timer, false);
|
|
}
|
|
|
|
extern u64 hrtimer_get_next_event(void);
|
|
|
|
extern bool hrtimer_active(const struct hrtimer *timer);
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hrtimer_is_queued(struct hrtimer *timer)
|
|
{
|
|
return timer->state & 0x01;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hrtimer_callback_running(struct hrtimer *timer)
|
|
{
|
|
return timer->base->cpu_base->running == timer;
|
|
}
|
|
|
|
|
|
extern u64
|
|
hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval);
|
|
# 464 "include/linux/hrtimer.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 hrtimer_forward_now(struct hrtimer *timer,
|
|
ktime_t interval)
|
|
{
|
|
return hrtimer_forward(timer, timer->base->get_time(), interval);
|
|
}
|
|
|
|
|
|
extern long hrtimer_nanosleep(struct timespec *rqtp,
|
|
struct timespec *rmtp,
|
|
const enum hrtimer_mode mode,
|
|
const clockid_t clockid);
|
|
extern long hrtimer_nanosleep_restart(struct restart_block *restart_block);
|
|
|
|
extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl,
|
|
struct task_struct *tsk);
|
|
|
|
extern int schedule_hrtimeout_range(ktime_t *expires, unsigned long delta,
|
|
const enum hrtimer_mode mode);
|
|
extern int schedule_hrtimeout_range_clock(ktime_t *expires,
|
|
unsigned long delta, const enum hrtimer_mode mode, int clock);
|
|
extern int schedule_hrtimeout(ktime_t *expires, const enum hrtimer_mode mode);
|
|
|
|
|
|
extern void hrtimer_run_queues(void);
|
|
|
|
|
|
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) hrtimers_init(void);
|
|
|
|
|
|
extern void sysrq_timer_list_show(void);
|
|
# 54 "include/linux/sched.h" 2
|
|
# 1 "include/linux/task_io_accounting.h" 1
|
|
# 11 "include/linux/task_io_accounting.h"
|
|
struct task_io_accounting {
|
|
# 45 "include/linux/task_io_accounting.h"
|
|
};
|
|
# 55 "include/linux/sched.h" 2
|
|
# 1 "include/linux/latencytop.h" 1
|
|
# 13 "include/linux/latencytop.h"
|
|
struct task_struct;
|
|
# 42 "include/linux/latencytop.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
account_scheduler_latency(struct task_struct *task, int usecs, int inter)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_all_latency_tracing(struct task_struct *p)
|
|
{
|
|
}
|
|
# 56 "include/linux/sched.h" 2
|
|
# 1 "include/linux/cred.h" 1
|
|
# 17 "include/linux/cred.h"
|
|
# 1 "include/linux/key.h" 1
|
|
# 25 "include/linux/key.h"
|
|
# 1 "include/linux/assoc_array.h" 1
|
|
# 26 "include/linux/key.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
typedef int32_t key_serial_t;
|
|
|
|
|
|
typedef uint32_t key_perm_t;
|
|
|
|
struct key;
|
|
# 18 "include/linux/cred.h" 2
|
|
# 1 "include/linux/selinux.h" 1
|
|
# 17 "include/linux/selinux.h"
|
|
struct selinux_audit_rule;
|
|
struct audit_context;
|
|
struct kern_ipc_perm;
|
|
# 29 "include/linux/selinux.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool selinux_is_enabled(void)
|
|
{
|
|
return false;
|
|
}
|
|
# 19 "include/linux/cred.h" 2
|
|
|
|
|
|
|
|
struct user_struct;
|
|
struct cred;
|
|
struct inode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct group_info {
|
|
atomic_t usage;
|
|
int ngroups;
|
|
int nblocks;
|
|
kgid_t small_block[32];
|
|
kgid_t *blocks[0];
|
|
};
|
|
# 49 "include/linux/cred.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct group_info *get_group_info(struct group_info *gi)
|
|
{
|
|
atomic_add(1, &gi->usage);
|
|
return gi;
|
|
}
|
|
# 65 "include/linux/cred.h"
|
|
extern struct group_info init_groups;
|
|
|
|
extern struct group_info *groups_alloc(int);
|
|
extern void groups_free(struct group_info *);
|
|
|
|
extern int in_group_p(kgid_t);
|
|
extern int in_egroup_p(kgid_t);
|
|
# 86 "include/linux/cred.h"
|
|
extern int set_current_groups(struct group_info *);
|
|
extern void set_groups(struct cred *, struct group_info *);
|
|
extern int groups_search(const struct group_info *, kgid_t);
|
|
extern bool may_setgroups(void);
|
|
extern void groups_sort(struct group_info *);
|
|
# 119 "include/linux/cred.h"
|
|
struct cred {
|
|
atomic_t usage;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
kuid_t uid;
|
|
kgid_t gid;
|
|
kuid_t suid;
|
|
kgid_t sgid;
|
|
kuid_t euid;
|
|
kgid_t egid;
|
|
kuid_t fsuid;
|
|
kgid_t fsgid;
|
|
unsigned securebits;
|
|
kernel_cap_t cap_inheritable;
|
|
kernel_cap_t cap_permitted;
|
|
kernel_cap_t cap_effective;
|
|
kernel_cap_t cap_bset;
|
|
kernel_cap_t cap_ambient;
|
|
# 151 "include/linux/cred.h"
|
|
void *security;
|
|
|
|
struct user_struct *user;
|
|
struct user_namespace *user_ns;
|
|
struct group_info *group_info;
|
|
struct callback_head rcu;
|
|
};
|
|
|
|
extern void __put_cred(struct cred *);
|
|
extern void exit_creds(struct task_struct *);
|
|
extern int copy_creds(struct task_struct *, unsigned long);
|
|
extern const struct cred *get_task_cred(struct task_struct *);
|
|
extern struct cred *cred_alloc_blank(void);
|
|
extern struct cred *prepare_creds(void);
|
|
extern struct cred *prepare_exec_creds(void);
|
|
extern int commit_creds(struct cred *);
|
|
extern void abort_creds(struct cred *);
|
|
extern const struct cred *override_creds(const struct cred *);
|
|
extern void revert_creds(const struct cred *);
|
|
extern struct cred *prepare_kernel_cred(struct task_struct *);
|
|
extern int change_create_files_as(struct cred *, struct inode *);
|
|
extern int set_security_override(struct cred *, u32);
|
|
extern int set_security_override_from_ctx(struct cred *, const char *);
|
|
extern int set_create_files_as(struct cred *, struct inode *);
|
|
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) cred_init(void);
|
|
# 206 "include/linux/cred.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void validate_creds(const struct cred *cred)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void validate_creds_for_do_exit(struct task_struct *tsk)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void validate_process_creds(void)
|
|
{
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool cap_ambient_invariant_ok(const struct cred *cred)
|
|
{
|
|
return cap_issubset(cred->cap_ambient,
|
|
cap_intersect(cred->cap_permitted,
|
|
cred->cap_inheritable));
|
|
}
|
|
# 231 "include/linux/cred.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct cred *get_new_cred(struct cred *cred)
|
|
{
|
|
atomic_add(1, &cred->usage);
|
|
return cred;
|
|
}
|
|
# 250 "include/linux/cred.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const struct cred *get_cred(const struct cred *cred)
|
|
{
|
|
struct cred *nonconst_cred = (struct cred *) cred;
|
|
validate_creds(cred);
|
|
return get_new_cred(nonconst_cred);
|
|
}
|
|
# 268 "include/linux/cred.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_cred(const struct cred *_cred)
|
|
{
|
|
struct cred *cred = (struct cred *) _cred;
|
|
|
|
validate_creds(cred);
|
|
if ((({ typeof(atomic_sub_return_relaxed(1, &(cred)->usage)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_sub_return_relaxed(1, &(cred)->usage); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) == 0))
|
|
__put_cred(cred);
|
|
}
|
|
# 377 "include/linux/cred.h"
|
|
extern struct user_namespace init_user_ns;
|
|
# 57 "include/linux/sched.h" 2
|
|
|
|
|
|
|
|
# 1 "./include/uapi/linux/magic.h" 1
|
|
# 61 "include/linux/sched.h" 2
|
|
# 1 "include/linux/cgroup-defs.h" 1
|
|
# 10 "include/linux/cgroup-defs.h"
|
|
# 1 "./include/uapi/linux/limits.h" 1
|
|
# 11 "include/linux/cgroup-defs.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/percpu-refcount.h" 1
|
|
# 54 "include/linux/percpu-refcount.h"
|
|
struct percpu_ref;
|
|
typedef void (percpu_ref_func_t)(struct percpu_ref *);
|
|
|
|
|
|
enum {
|
|
__PERCPU_REF_ATOMIC = 1LU << 0,
|
|
__PERCPU_REF_DEAD = 1LU << 1,
|
|
__PERCPU_REF_ATOMIC_DEAD = __PERCPU_REF_ATOMIC | __PERCPU_REF_DEAD,
|
|
|
|
__PERCPU_REF_FLAG_BITS = 2,
|
|
};
|
|
|
|
|
|
enum {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PERCPU_REF_INIT_ATOMIC = 1 << 0,
|
|
|
|
|
|
|
|
|
|
|
|
PERCPU_REF_INIT_DEAD = 1 << 1,
|
|
};
|
|
|
|
struct percpu_ref {
|
|
atomic_long_t count;
|
|
|
|
|
|
|
|
|
|
unsigned long percpu_count_ptr;
|
|
percpu_ref_func_t *release;
|
|
percpu_ref_func_t *confirm_switch;
|
|
bool force_atomic:1;
|
|
struct callback_head rcu;
|
|
};
|
|
|
|
int __attribute__((warn_unused_result)) percpu_ref_init(struct percpu_ref *ref,
|
|
percpu_ref_func_t *release, unsigned int flags,
|
|
gfp_t gfp);
|
|
void percpu_ref_exit(struct percpu_ref *ref);
|
|
void percpu_ref_switch_to_atomic(struct percpu_ref *ref,
|
|
percpu_ref_func_t *confirm_switch);
|
|
void percpu_ref_switch_to_percpu(struct percpu_ref *ref);
|
|
void percpu_ref_kill_and_confirm(struct percpu_ref *ref,
|
|
percpu_ref_func_t *confirm_kill);
|
|
void percpu_ref_reinit(struct percpu_ref *ref);
|
|
# 117 "include/linux/percpu-refcount.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void percpu_ref_kill(struct percpu_ref *ref)
|
|
{
|
|
return percpu_ref_kill_and_confirm(ref, ((void *)0));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __ref_is_percpu(struct percpu_ref *ref,
|
|
unsigned long **percpu_countp)
|
|
{
|
|
unsigned long percpu_ptr;
|
|
# 146 "include/linux/percpu-refcount.h"
|
|
percpu_ptr = ({ typeof(ref->percpu_count_ptr) _________p1 = ({ union { typeof(ref->percpu_count_ptr) __val; char __c[1]; } __u; if (1) __read_once_size(&(ref->percpu_count_ptr), __u.__c, sizeof(ref->percpu_count_ptr)); else __read_once_size_nocheck(&(ref->percpu_count_ptr), __u.__c, sizeof(ref->percpu_count_ptr)); __u.__val; }); do { } while(0); (_________p1); });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (__builtin_expect(!!(percpu_ptr & __PERCPU_REF_ATOMIC_DEAD), 0))
|
|
return false;
|
|
|
|
*percpu_countp = (unsigned long *)percpu_ptr;
|
|
return true;
|
|
}
|
|
# 170 "include/linux/percpu-refcount.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void percpu_ref_get_many(struct percpu_ref *ref, unsigned long nr)
|
|
{
|
|
unsigned long *percpu_count;
|
|
|
|
rcu_read_lock_sched();
|
|
|
|
if (__ref_is_percpu(ref, &percpu_count))
|
|
do { do { const void *__vpp_verify = (typeof((&(*percpu_count)) + 0))((void *)0); (void)__vpp_verify; } while (0); switch(sizeof(*percpu_count)) { case 1: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*percpu_count)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))); (typeof((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))) (__ptr + ((__my_cpu_offset()))); }); }) += nr; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 2: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*percpu_count)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))); (typeof((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))) (__ptr + ((__my_cpu_offset()))); }); }) += nr; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 4: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*percpu_count)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))); (typeof((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))) (__ptr + ((__my_cpu_offset()))); }); }) += nr; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 8: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*percpu_count)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))); (typeof((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))) (__ptr + ((__my_cpu_offset()))); }); }) += nr; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; default: __bad_size_call_parameter();break; } } while (0);
|
|
else
|
|
atomic_long_add(nr, &ref->count);
|
|
|
|
rcu_read_unlock_sched();
|
|
}
|
|
# 192 "include/linux/percpu-refcount.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void percpu_ref_get(struct percpu_ref *ref)
|
|
{
|
|
percpu_ref_get_many(ref, 1);
|
|
}
|
|
# 206 "include/linux/percpu-refcount.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool percpu_ref_tryget(struct percpu_ref *ref)
|
|
{
|
|
unsigned long *percpu_count;
|
|
bool ret;
|
|
|
|
rcu_read_lock_sched();
|
|
|
|
if (__ref_is_percpu(ref, &percpu_count)) {
|
|
do { do { const void *__vpp_verify = (typeof((&(*percpu_count)) + 0))((void *)0); (void)__vpp_verify; } while (0); switch(sizeof(*percpu_count)) { case 1: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*percpu_count)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))); (typeof((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))) (__ptr + ((__my_cpu_offset()))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 2: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*percpu_count)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))); (typeof((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))) (__ptr + ((__my_cpu_offset()))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 4: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*percpu_count)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))); (typeof((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))) (__ptr + ((__my_cpu_offset()))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 8: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*percpu_count)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))); (typeof((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))) (__ptr + ((__my_cpu_offset()))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; default: __bad_size_call_parameter();break; } } while (0);
|
|
ret = true;
|
|
} else {
|
|
ret = atomic_add_unless(((atomic_t *)(&ref->count)), 1, 0);
|
|
}
|
|
|
|
rcu_read_unlock_sched();
|
|
|
|
return ret;
|
|
}
|
|
# 240 "include/linux/percpu-refcount.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool percpu_ref_tryget_live(struct percpu_ref *ref)
|
|
{
|
|
unsigned long *percpu_count;
|
|
bool ret = false;
|
|
|
|
rcu_read_lock_sched();
|
|
|
|
if (__ref_is_percpu(ref, &percpu_count)) {
|
|
do { do { const void *__vpp_verify = (typeof((&(*percpu_count)) + 0))((void *)0); (void)__vpp_verify; } while (0); switch(sizeof(*percpu_count)) { case 1: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*percpu_count)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))); (typeof((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))) (__ptr + ((__my_cpu_offset()))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 2: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*percpu_count)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))); (typeof((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))) (__ptr + ((__my_cpu_offset()))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 4: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*percpu_count)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))); (typeof((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))) (__ptr + ((__my_cpu_offset()))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 8: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*percpu_count)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))); (typeof((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))) (__ptr + ((__my_cpu_offset()))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; default: __bad_size_call_parameter();break; } } while (0);
|
|
ret = true;
|
|
} else if (!(ref->percpu_count_ptr & __PERCPU_REF_DEAD)) {
|
|
ret = atomic_add_unless(((atomic_t *)(&ref->count)), 1, 0);
|
|
}
|
|
|
|
rcu_read_unlock_sched();
|
|
|
|
return ret;
|
|
}
|
|
# 269 "include/linux/percpu-refcount.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void percpu_ref_put_many(struct percpu_ref *ref, unsigned long nr)
|
|
{
|
|
unsigned long *percpu_count;
|
|
|
|
rcu_read_lock_sched();
|
|
|
|
if (__ref_is_percpu(ref, &percpu_count))
|
|
do { do { const void *__vpp_verify = (typeof((&(*percpu_count)) + 0))((void *)0); (void)__vpp_verify; } while (0); switch(sizeof(*percpu_count)) { case 1: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*percpu_count)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))); (typeof((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))) (__ptr + ((__my_cpu_offset()))); }); }) += -(typeof(*percpu_count))(nr); do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 2: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*percpu_count)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))); (typeof((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))) (__ptr + ((__my_cpu_offset()))); }); }) += -(typeof(*percpu_count))(nr); do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 4: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*percpu_count)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))); (typeof((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))) (__ptr + ((__my_cpu_offset()))); }); }) += -(typeof(*percpu_count))(nr); do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 8: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*percpu_count)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))); (typeof((typeof(*(&(*percpu_count))) *)(&(*percpu_count)))) (__ptr + ((__my_cpu_offset()))); }); }) += -(typeof(*percpu_count))(nr); do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; default: __bad_size_call_parameter();break; } } while (0);
|
|
else if (__builtin_expect(!!(atomic_long_sub_and_test(nr, &ref->count)), 0))
|
|
ref->release(ref);
|
|
|
|
rcu_read_unlock_sched();
|
|
}
|
|
# 292 "include/linux/percpu-refcount.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void percpu_ref_put(struct percpu_ref *ref)
|
|
{
|
|
percpu_ref_put_many(ref, 1);
|
|
}
|
|
# 306 "include/linux/percpu-refcount.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool percpu_ref_is_dying(struct percpu_ref *ref)
|
|
{
|
|
return ref->percpu_count_ptr & __PERCPU_REF_DEAD;
|
|
}
|
|
# 319 "include/linux/percpu-refcount.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool percpu_ref_is_zero(struct percpu_ref *ref)
|
|
{
|
|
unsigned long *percpu_count;
|
|
|
|
if (__ref_is_percpu(ref, &percpu_count))
|
|
return false;
|
|
return !atomic_long_read(&ref->count);
|
|
}
|
|
# 17 "include/linux/cgroup-defs.h" 2
|
|
# 1 "include/linux/percpu-rwsem.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/rcu_sync.h" 1
|
|
# 29 "include/linux/rcu_sync.h"
|
|
enum rcu_sync_type { RCU_SYNC, RCU_SCHED_SYNC, RCU_BH_SYNC };
|
|
|
|
|
|
struct rcu_sync {
|
|
int gp_state;
|
|
int gp_count;
|
|
wait_queue_head_t gp_wait;
|
|
|
|
int cb_state;
|
|
struct callback_head cb_head;
|
|
|
|
enum rcu_sync_type gp_type;
|
|
};
|
|
|
|
extern void rcu_sync_lockdep_assert(struct rcu_sync *);
|
|
# 53 "include/linux/rcu_sync.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool rcu_sync_is_idle(struct rcu_sync *rsp)
|
|
{
|
|
|
|
|
|
|
|
return !rsp->gp_state;
|
|
}
|
|
|
|
extern void rcu_sync_init(struct rcu_sync *, enum rcu_sync_type);
|
|
extern void rcu_sync_enter(struct rcu_sync *);
|
|
extern void rcu_sync_exit(struct rcu_sync *);
|
|
extern void rcu_sync_dtor(struct rcu_sync *);
|
|
# 9 "include/linux/percpu-rwsem.h" 2
|
|
|
|
|
|
struct percpu_rw_semaphore {
|
|
struct rcu_sync rss;
|
|
unsigned int *fast_read_ctr;
|
|
struct rw_semaphore rw_sem;
|
|
atomic_t slow_read_ctr;
|
|
wait_queue_head_t write_waitq;
|
|
};
|
|
|
|
extern void percpu_down_read(struct percpu_rw_semaphore *);
|
|
extern int percpu_down_read_trylock(struct percpu_rw_semaphore *);
|
|
extern void percpu_up_read(struct percpu_rw_semaphore *);
|
|
|
|
extern void percpu_down_write(struct percpu_rw_semaphore *);
|
|
extern void percpu_up_write(struct percpu_rw_semaphore *);
|
|
|
|
extern int __percpu_init_rwsem(struct percpu_rw_semaphore *,
|
|
const char *, struct lock_class_key *);
|
|
extern void percpu_free_rwsem(struct percpu_rw_semaphore *);
|
|
# 39 "include/linux/percpu-rwsem.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void percpu_rwsem_release(struct percpu_rw_semaphore *sem,
|
|
bool read, unsigned long ip)
|
|
{
|
|
do { } while (0);
|
|
|
|
if (!read)
|
|
sem->rw_sem.owner = ((void *)0);
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void percpu_rwsem_acquire(struct percpu_rw_semaphore *sem,
|
|
bool read, unsigned long ip)
|
|
{
|
|
do { } while (0);
|
|
}
|
|
# 18 "include/linux/cgroup-defs.h" 2
|
|
|
|
|
|
|
|
|
|
struct cgroup;
|
|
struct cgroup_root;
|
|
struct cgroup_subsys;
|
|
struct cgroup_taskset;
|
|
struct kernfs_node;
|
|
struct kernfs_ops;
|
|
struct kernfs_open_file;
|
|
struct seq_file;
|
|
# 39 "include/linux/cgroup-defs.h"
|
|
enum cgroup_subsys_id {
|
|
# 1 "include/linux/cgroup_subsys.h" 1
|
|
# 18 "include/linux/cgroup_subsys.h"
|
|
cpuset_cgrp_id,
|
|
|
|
|
|
|
|
cpu_cgrp_id,
|
|
|
|
|
|
|
|
cpuacct_cgrp_id,
|
|
# 38 "include/linux/cgroup_subsys.h"
|
|
devices_cgrp_id,
|
|
|
|
|
|
|
|
freezer_cgrp_id,
|
|
# 64 "include/linux/cgroup_subsys.h"
|
|
CGROUP_CANFORK_START, __unused_tag_CANFORK_START = CGROUP_CANFORK_START - 1,
|
|
|
|
|
|
|
|
|
|
|
|
CGROUP_CANFORK_END, __unused_tag_CANFORK_END = CGROUP_CANFORK_END - 1,
|
|
|
|
|
|
|
|
|
|
|
|
debug_cgrp_id,
|
|
# 41 "include/linux/cgroup-defs.h" 2
|
|
CGROUP_SUBSYS_COUNT,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
CSS_NO_REF = (1 << 0),
|
|
CSS_ONLINE = (1 << 1),
|
|
CSS_RELEASED = (1 << 2),
|
|
};
|
|
|
|
|
|
enum {
|
|
|
|
CGRP_NOTIFY_ON_RELEASE,
|
|
|
|
|
|
|
|
|
|
|
|
CGRP_CPUSET_CLONE_CHILDREN,
|
|
};
|
|
|
|
|
|
enum {
|
|
CGRP_ROOT_SANE_BEHAVIOR = (1 << 0),
|
|
CGRP_ROOT_NOPREFIX = (1 << 1),
|
|
CGRP_ROOT_XATTR = (1 << 2),
|
|
};
|
|
|
|
|
|
enum {
|
|
CFTYPE_ONLY_ON_ROOT = (1 << 0),
|
|
CFTYPE_NOT_ON_ROOT = (1 << 1),
|
|
CFTYPE_NO_PREFIX = (1 << 3),
|
|
CFTYPE_WORLD_WRITABLE = (1 << 4),
|
|
|
|
|
|
__CFTYPE_ONLY_ON_DFL = (1 << 16),
|
|
__CFTYPE_NOT_ON_DFL = (1 << 17),
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct cgroup_file {
|
|
|
|
struct kernfs_node *kn;
|
|
};
|
|
# 103 "include/linux/cgroup-defs.h"
|
|
struct cgroup_subsys_state {
|
|
|
|
struct cgroup *cgroup;
|
|
|
|
|
|
struct cgroup_subsys *ss;
|
|
|
|
|
|
struct percpu_ref refcnt;
|
|
|
|
|
|
struct cgroup_subsys_state *parent;
|
|
|
|
|
|
struct list_head sibling;
|
|
struct list_head children;
|
|
|
|
|
|
|
|
|
|
|
|
int id;
|
|
|
|
unsigned int flags;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
u64 serial_nr;
|
|
|
|
|
|
|
|
|
|
|
|
atomic_t online_cnt;
|
|
|
|
|
|
struct callback_head callback_head;
|
|
struct work_struct destroy_work;
|
|
};
|
|
# 154 "include/linux/cgroup-defs.h"
|
|
struct css_set {
|
|
|
|
atomic_t refcount;
|
|
|
|
|
|
|
|
|
|
|
|
struct hlist_node hlist;
|
|
# 171 "include/linux/cgroup-defs.h"
|
|
struct list_head tasks;
|
|
struct list_head mg_tasks;
|
|
|
|
|
|
|
|
|
|
|
|
struct list_head cgrp_links;
|
|
|
|
|
|
struct cgroup *dfl_cgrp;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT];
|
|
|
|
|
|
|
|
|
|
|
|
struct list_head mg_preload_node;
|
|
struct list_head mg_node;
|
|
# 204 "include/linux/cgroup-defs.h"
|
|
struct cgroup *mg_src_cgrp;
|
|
struct css_set *mg_dst_cset;
|
|
# 214 "include/linux/cgroup-defs.h"
|
|
struct list_head e_cset_node[CGROUP_SUBSYS_COUNT];
|
|
|
|
|
|
struct list_head task_iters;
|
|
|
|
|
|
bool dead;
|
|
|
|
|
|
struct callback_head callback_head;
|
|
};
|
|
|
|
struct cgroup {
|
|
|
|
struct cgroup_subsys_state self;
|
|
|
|
unsigned long flags;
|
|
# 240 "include/linux/cgroup-defs.h"
|
|
int id;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int populated_cnt;
|
|
|
|
struct kernfs_node *kn;
|
|
struct cgroup_file procs_file;
|
|
struct cgroup_file events_file;
|
|
# 262 "include/linux/cgroup-defs.h"
|
|
unsigned int subtree_control;
|
|
unsigned int child_subsys_mask;
|
|
|
|
|
|
struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT];
|
|
|
|
struct cgroup_root *root;
|
|
|
|
|
|
|
|
|
|
|
|
struct list_head cset_links;
|
|
# 283 "include/linux/cgroup-defs.h"
|
|
struct list_head e_csets[CGROUP_SUBSYS_COUNT];
|
|
|
|
|
|
|
|
|
|
|
|
struct list_head pidlists;
|
|
struct mutex pidlist_mutex;
|
|
|
|
|
|
wait_queue_head_t offline_waitq;
|
|
|
|
|
|
struct work_struct release_agent_work;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct cgroup_root {
|
|
struct kernfs_root *kf_root;
|
|
|
|
|
|
unsigned int subsys_mask;
|
|
|
|
|
|
int hierarchy_id;
|
|
|
|
|
|
struct cgroup cgrp;
|
|
|
|
|
|
atomic_t nr_cgrps;
|
|
|
|
|
|
struct list_head root_list;
|
|
|
|
|
|
unsigned int flags;
|
|
|
|
|
|
struct idr cgroup_idr;
|
|
|
|
|
|
char release_agent_path[4096];
|
|
|
|
|
|
char name[64];
|
|
};
|
|
# 342 "include/linux/cgroup-defs.h"
|
|
struct cftype {
|
|
|
|
|
|
|
|
|
|
|
|
char name[64];
|
|
unsigned long private;
|
|
|
|
|
|
|
|
|
|
|
|
size_t max_write_len;
|
|
|
|
|
|
unsigned int flags;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int file_offset;
|
|
|
|
|
|
|
|
|
|
|
|
struct cgroup_subsys *ss;
|
|
struct list_head node;
|
|
struct kernfs_ops *kf_ops;
|
|
|
|
|
|
|
|
|
|
|
|
u64 (*read_u64)(struct cgroup_subsys_state *css, struct cftype *cft);
|
|
|
|
|
|
|
|
s64 (*read_s64)(struct cgroup_subsys_state *css, struct cftype *cft);
|
|
|
|
|
|
int (*seq_show)(struct seq_file *sf, void *v);
|
|
|
|
|
|
void *(*seq_start)(struct seq_file *sf, loff_t *ppos);
|
|
void *(*seq_next)(struct seq_file *sf, void *v, loff_t *ppos);
|
|
void (*seq_stop)(struct seq_file *sf, void *v);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int (*write_u64)(struct cgroup_subsys_state *css, struct cftype *cft,
|
|
u64 val);
|
|
|
|
|
|
|
|
int (*write_s64)(struct cgroup_subsys_state *css, struct cftype *cft,
|
|
s64 val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ssize_t (*write)(struct kernfs_open_file *of,
|
|
char *buf, size_t nbytes, loff_t off);
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct cgroup_subsys {
|
|
struct cgroup_subsys_state *(*css_alloc)(struct cgroup_subsys_state *parent_css);
|
|
int (*css_online)(struct cgroup_subsys_state *css);
|
|
void (*css_offline)(struct cgroup_subsys_state *css);
|
|
void (*css_released)(struct cgroup_subsys_state *css);
|
|
void (*css_free)(struct cgroup_subsys_state *css);
|
|
void (*css_reset)(struct cgroup_subsys_state *css);
|
|
void (*css_e_css_changed)(struct cgroup_subsys_state *css);
|
|
|
|
int (*can_attach)(struct cgroup_taskset *tset);
|
|
void (*cancel_attach)(struct cgroup_taskset *tset);
|
|
void (*attach)(struct cgroup_taskset *tset);
|
|
void (*post_attach)(void);
|
|
int (*can_fork)(struct task_struct *task, void **priv_p);
|
|
void (*cancel_fork)(struct task_struct *task, void *priv);
|
|
void (*fork)(struct task_struct *task, void *priv);
|
|
void (*exit)(struct task_struct *task);
|
|
void (*free)(struct task_struct *task);
|
|
void (*bind)(struct cgroup_subsys_state *root_css);
|
|
|
|
int early_init;
|
|
# 459 "include/linux/cgroup-defs.h"
|
|
bool broken_hierarchy;
|
|
bool warned_broken_hierarchy;
|
|
|
|
|
|
int id;
|
|
const char *name;
|
|
|
|
|
|
const char *legacy_name;
|
|
|
|
|
|
struct cgroup_root *root;
|
|
|
|
|
|
struct idr css_idr;
|
|
|
|
|
|
|
|
|
|
|
|
struct list_head cfts;
|
|
|
|
|
|
|
|
|
|
|
|
struct cftype *dfl_cftypes;
|
|
struct cftype *legacy_cftypes;
|
|
# 495 "include/linux/cgroup-defs.h"
|
|
unsigned int depends_on;
|
|
};
|
|
|
|
extern struct percpu_rw_semaphore cgroup_threadgroup_rwsem;
|
|
# 507 "include/linux/cgroup-defs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cgroup_threadgroup_change_begin(struct task_struct *tsk)
|
|
{
|
|
percpu_down_read(&cgroup_threadgroup_rwsem);
|
|
}
|
|
# 519 "include/linux/cgroup-defs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cgroup_threadgroup_change_end(struct task_struct *tsk)
|
|
{
|
|
percpu_up_read(&cgroup_threadgroup_rwsem);
|
|
}
|
|
# 62 "include/linux/sched.h" 2
|
|
# 111 "include/linux/sched.h"
|
|
struct sched_attr {
|
|
u32 size;
|
|
|
|
u32 sched_policy;
|
|
u64 sched_flags;
|
|
|
|
|
|
s32 sched_nice;
|
|
|
|
|
|
u32 sched_priority;
|
|
|
|
|
|
u64 sched_runtime;
|
|
u64 sched_deadline;
|
|
u64 sched_period;
|
|
};
|
|
|
|
struct futex_pi_state;
|
|
struct robust_list_head;
|
|
struct bio_list;
|
|
struct fs_struct;
|
|
struct perf_event_context;
|
|
struct blk_plug;
|
|
struct filename;
|
|
struct nameidata;
|
|
# 152 "include/linux/sched.h"
|
|
extern unsigned long avenrun[];
|
|
extern void get_avenrun(unsigned long *loads, unsigned long offset, int shift);
|
|
# 167 "include/linux/sched.h"
|
|
extern unsigned long total_forks;
|
|
extern int nr_threads;
|
|
extern __attribute__((section(".data..percpu" ""))) __typeof__(unsigned long) process_counts;
|
|
extern int nr_processes(void);
|
|
extern unsigned long nr_running(void);
|
|
extern bool single_task_running(void);
|
|
extern unsigned long nr_iowait(void);
|
|
extern unsigned long nr_iowait_cpu(int cpu);
|
|
extern void get_iowait_load(unsigned long *nr_waiters, unsigned long *load);
|
|
|
|
extern void calc_global_load(unsigned long ticks);
|
|
|
|
|
|
extern void update_cpu_load_nohz(void);
|
|
|
|
|
|
|
|
|
|
extern unsigned long get_parent_ip(unsigned long addr);
|
|
|
|
extern void dump_cpu_task(int cpu);
|
|
|
|
struct seq_file;
|
|
struct cfs_rq;
|
|
struct task_group;
|
|
|
|
extern void proc_sched_show_task(struct task_struct *p, struct seq_file *m);
|
|
extern void proc_sched_set_task(struct task_struct *p);
|
|
# 226 "include/linux/sched.h"
|
|
extern char ___assert_task_state[1 - 2*!!(
|
|
sizeof("RSDTtXZxKWPN")-1 != ( __builtin_constant_p(2048) ? ( (2048) < 2 ? 0 : (2048) & (1ULL << 63) ? 63 : (2048) & (1ULL << 62) ? 62 : (2048) & (1ULL << 61) ? 61 : (2048) & (1ULL << 60) ? 60 : (2048) & (1ULL << 59) ? 59 : (2048) & (1ULL << 58) ? 58 : (2048) & (1ULL << 57) ? 57 : (2048) & (1ULL << 56) ? 56 : (2048) & (1ULL << 55) ? 55 : (2048) & (1ULL << 54) ? 54 : (2048) & (1ULL << 53) ? 53 : (2048) & (1ULL << 52) ? 52 : (2048) & (1ULL << 51) ? 51 : (2048) & (1ULL << 50) ? 50 : (2048) & (1ULL << 49) ? 49 : (2048) & (1ULL << 48) ? 48 : (2048) & (1ULL << 47) ? 47 : (2048) & (1ULL << 46) ? 46 : (2048) & (1ULL << 45) ? 45 : (2048) & (1ULL << 44) ? 44 : (2048) & (1ULL << 43) ? 43 : (2048) & (1ULL << 42) ? 42 : (2048) & (1ULL << 41) ? 41 : (2048) & (1ULL << 40) ? 40 : (2048) & (1ULL << 39) ? 39 : (2048) & (1ULL << 38) ? 38 : (2048) & (1ULL << 37) ? 37 : (2048) & (1ULL << 36) ? 36 : (2048) & (1ULL << 35) ? 35 : (2048) & (1ULL << 34) ? 34 : (2048) & (1ULL << 33) ? 33 : (2048) & (1ULL << 32) ? 32 : (2048) & (1ULL << 31) ? 31 : (2048) & (1ULL << 30) ? 30 : (2048) & (1ULL << 29) ? 29 : (2048) & (1ULL << 28) ? 28 : (2048) & (1ULL << 27) ? 27 : (2048) & (1ULL << 26) ? 26 : (2048) & (1ULL << 25) ? 25 : (2048) & (1ULL << 24) ? 24 : (2048) & (1ULL << 23) ? 23 : (2048) & (1ULL << 22) ? 22 : (2048) & (1ULL << 21) ? 21 : (2048) & (1ULL << 20) ? 20 : (2048) & (1ULL << 19) ? 19 : (2048) & (1ULL << 18) ? 18 : (2048) & (1ULL << 17) ? 17 : (2048) & (1ULL << 16) ? 16 : (2048) & (1ULL << 15) ? 15 : (2048) & (1ULL << 14) ? 14 : (2048) & (1ULL << 13) ? 13 : (2048) & (1ULL << 12) ? 12 : (2048) & (1ULL << 11) ? 11 : (2048) & (1ULL << 10) ? 10 : (2048) & (1ULL << 9) ? 9 : (2048) & (1ULL << 8) ? 8 : (2048) & (1ULL << 7) ? 7 : (2048) & (1ULL << 6) ? 6 : (2048) & (1ULL << 5) ? 5 : (2048) & (1ULL << 4) ? 4 : (2048) & (1ULL << 3) ? 3 : (2048) & (1ULL << 2) ? 2 : 1 ) : (sizeof(2048) <= 4) ? __ilog2_u32(2048) : __ilog2_u64(2048) )+1)];
|
|
# 325 "include/linux/sched.h"
|
|
extern rwlock_t tasklist_lock;
|
|
extern spinlock_t mmlist_lock;
|
|
|
|
struct task_struct;
|
|
|
|
|
|
|
|
|
|
|
|
extern void sched_init(void);
|
|
extern void sched_init_smp(void);
|
|
extern void schedule_tail(struct task_struct *prev);
|
|
extern void init_idle(struct task_struct *idle, int cpu);
|
|
extern void init_idle_bootup_task(struct task_struct *idle);
|
|
|
|
extern cpumask_var_t cpu_isolated_map;
|
|
|
|
extern int runqueue_is_locked(int cpu);
|
|
|
|
|
|
extern void nohz_balance_enter_idle(int cpu);
|
|
extern void set_cpu_sd_state_idle(void);
|
|
extern int get_nohz_timer_target(void);
|
|
# 356 "include/linux/sched.h"
|
|
extern void show_state_filter(unsigned long state_filter);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void show_state(void)
|
|
{
|
|
show_state_filter(0);
|
|
}
|
|
|
|
extern void show_regs(struct pt_regs *);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern void show_stack(struct task_struct *task, unsigned long *sp);
|
|
|
|
extern void cpu_init (void);
|
|
extern void trap_init(void);
|
|
extern void update_process_times(int user);
|
|
extern void scheduler_tick(void);
|
|
|
|
extern void sched_show_task(struct task_struct *p);
|
|
# 390 "include/linux/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void touch_softlockup_watchdog(void)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void touch_softlockup_watchdog_sync(void)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void touch_all_softlockup_watchdogs(void)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void lockup_detector_init(void)
|
|
{
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void reset_hung_task_detector(void)
|
|
{
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern char __sched_text_start[], __sched_text_end[];
|
|
|
|
|
|
extern int in_sched_functions(unsigned long addr);
|
|
|
|
|
|
extern signed long schedule_timeout(signed long timeout);
|
|
extern signed long schedule_timeout_interruptible(signed long timeout);
|
|
extern signed long schedule_timeout_killable(signed long timeout);
|
|
extern signed long schedule_timeout_uninterruptible(signed long timeout);
|
|
void schedule(void);
|
|
extern void schedule_preempt_disabled(void);
|
|
|
|
extern long io_schedule_timeout(long timeout);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void io_schedule(void)
|
|
{
|
|
io_schedule_timeout(((long)(~0UL>>1)));
|
|
}
|
|
|
|
struct nsproxy;
|
|
struct user_namespace;
|
|
|
|
|
|
extern void arch_pick_mmap_layout(struct mm_struct *mm);
|
|
extern unsigned long
|
|
arch_get_unmapped_area(struct file *, unsigned long, unsigned long,
|
|
unsigned long, unsigned long);
|
|
extern unsigned long
|
|
arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
|
|
unsigned long len, unsigned long pgoff,
|
|
unsigned long flags);
|
|
# 462 "include/linux/sched.h"
|
|
extern void set_dumpable(struct mm_struct *mm, int value);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __get_dumpable(unsigned long mm_flags)
|
|
{
|
|
return mm_flags & ((1 << 2) - 1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_dumpable(struct mm_struct *mm)
|
|
{
|
|
return __get_dumpable(mm->flags);
|
|
}
|
|
# 513 "include/linux/sched.h"
|
|
struct sighand_struct {
|
|
atomic_t count;
|
|
struct k_sigaction action[64];
|
|
spinlock_t siglock;
|
|
wait_queue_head_t signalfd_wqh;
|
|
};
|
|
|
|
struct pacct_struct {
|
|
int ac_flag;
|
|
long ac_exitcode;
|
|
unsigned long ac_mem;
|
|
cputime_t ac_utime, ac_stime;
|
|
unsigned long ac_minflt, ac_majflt;
|
|
};
|
|
|
|
struct cpu_itimer {
|
|
cputime_t expires;
|
|
cputime_t incr;
|
|
u32 error;
|
|
u32 incr_error;
|
|
};
|
|
# 544 "include/linux/sched.h"
|
|
struct prev_cputime {
|
|
|
|
cputime_t utime;
|
|
cputime_t stime;
|
|
raw_spinlock_t lock;
|
|
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void prev_cputime_init(struct prev_cputime *prev)
|
|
{
|
|
|
|
prev->utime = prev->stime = 0;
|
|
do { *(&prev->lock) = (raw_spinlock_t) { .raw_lock = { { 0 } }, }; } while (0);
|
|
|
|
}
|
|
# 570 "include/linux/sched.h"
|
|
struct task_cputime {
|
|
cputime_t utime;
|
|
cputime_t stime;
|
|
unsigned long long sum_exec_runtime;
|
|
};
|
|
# 592 "include/linux/sched.h"
|
|
struct task_cputime_atomic {
|
|
atomic64_t utime;
|
|
atomic64_t stime;
|
|
atomic64_t sum_exec_runtime;
|
|
};
|
|
# 637 "include/linux/sched.h"
|
|
struct thread_group_cputimer {
|
|
struct task_cputime_atomic cputime_atomic;
|
|
bool running;
|
|
bool checking_timer;
|
|
};
|
|
|
|
|
|
struct autogroup;
|
|
# 653 "include/linux/sched.h"
|
|
struct signal_struct {
|
|
atomic_t sigcnt;
|
|
atomic_t live;
|
|
int nr_threads;
|
|
struct list_head thread_head;
|
|
|
|
wait_queue_head_t wait_chldexit;
|
|
|
|
|
|
struct task_struct *curr_target;
|
|
|
|
|
|
struct sigpending shared_pending;
|
|
|
|
|
|
int group_exit_code;
|
|
|
|
|
|
|
|
|
|
|
|
int notify_count;
|
|
struct task_struct *group_exit_task;
|
|
|
|
|
|
int group_stop_count;
|
|
unsigned int flags;
|
|
# 690 "include/linux/sched.h"
|
|
unsigned int is_child_subreaper:1;
|
|
unsigned int has_child_subreaper:1;
|
|
|
|
|
|
int posix_timer_id;
|
|
struct list_head posix_timers;
|
|
|
|
|
|
struct hrtimer real_timer;
|
|
struct pid *leader_pid;
|
|
ktime_t it_real_incr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct cpu_itimer it[2];
|
|
|
|
|
|
|
|
|
|
|
|
struct thread_group_cputimer cputimer;
|
|
|
|
|
|
struct task_cputime cputime_expires;
|
|
|
|
struct list_head cpu_timers[3];
|
|
|
|
struct pid *tty_old_pgrp;
|
|
|
|
|
|
int leader;
|
|
|
|
struct tty_struct *tty;
|
|
# 736 "include/linux/sched.h"
|
|
seqlock_t stats_lock;
|
|
cputime_t utime, stime, cutime, cstime;
|
|
cputime_t gtime;
|
|
cputime_t cgtime;
|
|
struct prev_cputime prev_cputime;
|
|
unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
|
|
unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt;
|
|
unsigned long inblock, oublock, cinblock, coublock;
|
|
unsigned long maxrss, cmaxrss;
|
|
struct task_io_accounting ioac;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long long sum_sched_runtime;
|
|
# 764 "include/linux/sched.h"
|
|
struct rlimit rlim[16];
|
|
# 778 "include/linux/sched.h"
|
|
oom_flags_t oom_flags;
|
|
short oom_score_adj;
|
|
short oom_score_adj_min;
|
|
|
|
|
|
struct mutex cred_guard_mutex;
|
|
|
|
|
|
};
|
|
# 807 "include/linux/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void signal_set_stop_flags(struct signal_struct *sig,
|
|
unsigned int flags)
|
|
{
|
|
({ int __ret_warn_on = !!(sig->flags & (0x00000004|0x00000008)); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/sched.h", 810); __builtin_expect(!!(__ret_warn_on), 0); });
|
|
sig->flags = (sig->flags & ~((0x00000010|0x00000020) | 0x00000001 | 0x00000002)) | flags;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int signal_group_exit(const struct signal_struct *sig)
|
|
{
|
|
return (sig->flags & 0x00000004) ||
|
|
(sig->group_exit_task != ((void *)0));
|
|
}
|
|
|
|
|
|
|
|
|
|
struct user_struct {
|
|
atomic_t __count;
|
|
atomic_t processes;
|
|
atomic_t sigpending;
|
|
|
|
atomic_t inotify_watches;
|
|
atomic_t inotify_devs;
|
|
|
|
|
|
|
|
|
|
|
|
atomic_long_t epoll_watches;
|
|
|
|
|
|
|
|
unsigned long mq_bytes;
|
|
|
|
unsigned long locked_shm;
|
|
unsigned long unix_inflight;
|
|
atomic_long_t pipe_bufs;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct hlist_node uidhash_node;
|
|
kuid_t uid;
|
|
|
|
|
|
atomic_long_t locked_vm;
|
|
|
|
};
|
|
|
|
extern int uids_sysfs_init(void);
|
|
|
|
extern struct user_struct *find_user(kuid_t);
|
|
|
|
extern struct user_struct root_user;
|
|
|
|
|
|
|
|
struct backing_dev_info;
|
|
struct reclaim_state;
|
|
# 917 "include/linux/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sched_info_on(void)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
enum cpu_idle_type {
|
|
CPU_IDLE,
|
|
CPU_NOT_IDLE,
|
|
CPU_NEWLY_IDLE,
|
|
CPU_MAX_IDLE_TYPES
|
|
};
|
|
# 968 "include/linux/sched.h"
|
|
struct wake_q_node {
|
|
struct wake_q_node *next;
|
|
};
|
|
|
|
struct wake_q_head {
|
|
struct wake_q_node *first;
|
|
struct wake_q_node **lastp;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern void wake_q_add(struct wake_q_head *head,
|
|
struct task_struct *task);
|
|
extern void wake_up_q(struct wake_q_head *head);
|
|
# 1006 "include/linux/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpu_smt_flags(void)
|
|
{
|
|
return 0x0080 | 0x0200;
|
|
}
|
|
# 1026 "include/linux/sched.h"
|
|
struct sched_domain_attr {
|
|
int relax_domain_level;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
extern int sched_domain_level_max;
|
|
|
|
struct sched_group;
|
|
|
|
struct sched_domain {
|
|
|
|
struct sched_domain *parent;
|
|
struct sched_domain *child;
|
|
struct sched_group *groups;
|
|
unsigned long min_interval;
|
|
unsigned long max_interval;
|
|
unsigned int busy_factor;
|
|
unsigned int imbalance_pct;
|
|
unsigned int cache_nice_tries;
|
|
unsigned int busy_idx;
|
|
unsigned int idle_idx;
|
|
unsigned int newidle_idx;
|
|
unsigned int wake_idx;
|
|
unsigned int forkexec_idx;
|
|
unsigned int smt_gain;
|
|
|
|
int nohz_idle;
|
|
int flags;
|
|
int level;
|
|
|
|
|
|
unsigned long last_balance;
|
|
unsigned int balance_interval;
|
|
unsigned int nr_balance_failed;
|
|
|
|
|
|
u64 max_newidle_lb_cost;
|
|
unsigned long next_decay_max_lb_cost;
|
|
# 1100 "include/linux/sched.h"
|
|
char *name;
|
|
|
|
union {
|
|
void *private;
|
|
struct callback_head rcu;
|
|
};
|
|
|
|
unsigned int span_weight;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long span[0];
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct cpumask *sched_domain_span(struct sched_domain *sd)
|
|
{
|
|
return ((struct cpumask *)(1 ? (sd->span) : (void *)sizeof(__check_is_bitmap(sd->span))));
|
|
}
|
|
|
|
extern void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
|
|
struct sched_domain_attr *dattr_new);
|
|
|
|
|
|
cpumask_var_t *alloc_sched_domains(unsigned int ndoms);
|
|
void free_sched_domains(cpumask_var_t doms[], unsigned int ndoms);
|
|
|
|
bool cpus_share_cache(int this_cpu, int that_cpu);
|
|
|
|
typedef const struct cpumask *(*sched_domain_mask_f)(int cpu);
|
|
typedef int (*sched_domain_flags_f)(void);
|
|
|
|
|
|
|
|
struct sd_data {
|
|
struct sched_domain ** sd;
|
|
struct sched_group ** sg;
|
|
struct sched_group_capacity ** sgc;
|
|
};
|
|
|
|
struct sched_domain_topology_level {
|
|
sched_domain_mask_f mask;
|
|
sched_domain_flags_f sd_flags;
|
|
int flags;
|
|
int numa_level;
|
|
struct sd_data data;
|
|
|
|
char *name;
|
|
|
|
};
|
|
|
|
extern void set_sched_topology(struct sched_domain_topology_level *tl);
|
|
extern void wake_up_if_idle(int cpu);
|
|
# 1181 "include/linux/sched.h"
|
|
struct io_context;
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void prefetch_stack(struct task_struct *t) { }
|
|
|
|
|
|
struct audit_context;
|
|
struct mempolicy;
|
|
struct pipe_inode_info;
|
|
struct uts_namespace;
|
|
|
|
struct load_weight {
|
|
unsigned long weight;
|
|
u32 inv_weight;
|
|
};
|
|
# 1214 "include/linux/sched.h"
|
|
struct sched_avg {
|
|
u64 last_update_time, load_sum;
|
|
u32 util_sum, period_contrib;
|
|
unsigned long load_avg, util_avg;
|
|
};
|
|
# 1256 "include/linux/sched.h"
|
|
struct sched_entity {
|
|
struct load_weight load;
|
|
struct rb_node run_node;
|
|
struct list_head group_node;
|
|
unsigned int on_rq;
|
|
|
|
u64 exec_start;
|
|
u64 sum_exec_runtime;
|
|
u64 vruntime;
|
|
u64 prev_sum_exec_runtime;
|
|
|
|
u64 nr_migrations;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int depth;
|
|
struct sched_entity *parent;
|
|
|
|
struct cfs_rq *cfs_rq;
|
|
|
|
struct cfs_rq *my_q;
|
|
|
|
|
|
|
|
|
|
struct sched_avg avg;
|
|
|
|
};
|
|
|
|
struct sched_rt_entity {
|
|
struct list_head run_list;
|
|
unsigned long timeout;
|
|
unsigned long watchdog_stamp;
|
|
unsigned int time_slice;
|
|
|
|
struct sched_rt_entity *back;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
struct sched_dl_entity {
|
|
struct rb_node rb_node;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
u64 dl_runtime;
|
|
u64 dl_deadline;
|
|
u64 dl_period;
|
|
u64 dl_bw;
|
|
u64 dl_density;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
s64 runtime;
|
|
u64 deadline;
|
|
unsigned int flags;
|
|
# 1345 "include/linux/sched.h"
|
|
int dl_throttled, dl_new, dl_boosted, dl_yielded;
|
|
|
|
|
|
|
|
|
|
|
|
struct hrtimer dl_timer;
|
|
};
|
|
|
|
union rcu_special {
|
|
struct {
|
|
u8 blocked;
|
|
u8 need_qs;
|
|
u8 exp_need_qs;
|
|
u8 pad;
|
|
} b;
|
|
u32 s;
|
|
};
|
|
struct rcu_node;
|
|
|
|
enum perf_event_task_context {
|
|
perf_invalid_context = -1,
|
|
perf_hw_context = 0,
|
|
perf_sw_context,
|
|
perf_nr_task_contexts,
|
|
};
|
|
|
|
|
|
struct tlbflush_unmap_batch {
|
|
|
|
|
|
|
|
|
|
struct cpumask cpumask;
|
|
|
|
|
|
bool flush_required;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool writable;
|
|
};
|
|
|
|
struct task_struct {
|
|
volatile long state;
|
|
void *stack;
|
|
atomic_t usage;
|
|
unsigned int flags;
|
|
unsigned int ptrace;
|
|
|
|
|
|
struct llist_node wake_entry;
|
|
int on_cpu;
|
|
unsigned int wakee_flips;
|
|
unsigned long wakee_flip_decay_ts;
|
|
struct task_struct *last_wakee;
|
|
|
|
int wake_cpu;
|
|
|
|
int on_rq;
|
|
|
|
int prio, static_prio, normal_prio;
|
|
unsigned int rt_priority;
|
|
const struct sched_class *sched_class;
|
|
struct sched_entity se;
|
|
struct sched_rt_entity rt;
|
|
|
|
struct task_group *sched_task_group;
|
|
|
|
struct sched_dl_entity dl;
|
|
# 1428 "include/linux/sched.h"
|
|
unsigned int policy;
|
|
int nr_cpus_allowed;
|
|
cpumask_t cpus_allowed;
|
|
# 1449 "include/linux/sched.h"
|
|
struct list_head tasks;
|
|
|
|
struct plist_node pushable_tasks;
|
|
struct rb_node pushable_dl_tasks;
|
|
|
|
|
|
struct mm_struct *mm, *active_mm;
|
|
|
|
u32 vmacache_seqnum;
|
|
struct vm_area_struct *vmacache[(1U << 2)];
|
|
|
|
|
|
|
|
|
|
int exit_state;
|
|
int exit_code, exit_signal;
|
|
int pdeath_signal;
|
|
unsigned long jobctl;
|
|
|
|
|
|
unsigned int personality;
|
|
|
|
|
|
unsigned sched_reset_on_fork:1;
|
|
unsigned sched_contributes_to_load:1;
|
|
unsigned sched_migrated:1;
|
|
unsigned :0;
|
|
|
|
|
|
unsigned in_execve:1;
|
|
unsigned in_iowait:1;
|
|
# 1491 "include/linux/sched.h"
|
|
unsigned no_cgroup_migration:1;
|
|
|
|
|
|
unsigned long atomic_flags;
|
|
|
|
struct restart_block restart_block;
|
|
|
|
pid_t pid;
|
|
pid_t tgid;
|
|
# 1510 "include/linux/sched.h"
|
|
struct task_struct *real_parent;
|
|
struct task_struct *parent;
|
|
|
|
|
|
|
|
struct list_head children;
|
|
struct list_head sibling;
|
|
struct task_struct *group_leader;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct list_head ptraced;
|
|
struct list_head ptrace_entry;
|
|
|
|
|
|
struct pid_link pids[PIDTYPE_MAX];
|
|
struct list_head thread_group;
|
|
struct list_head thread_node;
|
|
|
|
struct completion *vfork_done;
|
|
int *set_child_tid;
|
|
int *clear_child_tid;
|
|
|
|
cputime_t utime, stime, utimescaled, stimescaled;
|
|
cputime_t gtime;
|
|
struct prev_cputime prev_cputime;
|
|
# 1548 "include/linux/sched.h"
|
|
unsigned long nvcsw, nivcsw;
|
|
u64 start_time;
|
|
u64 real_start_time;
|
|
|
|
unsigned long min_flt, maj_flt;
|
|
|
|
struct task_cputime cputime_expires;
|
|
struct list_head cpu_timers[3];
|
|
|
|
|
|
const struct cred *ptracer_cred;
|
|
const struct cred *real_cred;
|
|
|
|
const struct cred *cred;
|
|
|
|
char comm[16];
|
|
|
|
|
|
|
|
|
|
struct nameidata *nameidata;
|
|
|
|
|
|
struct sysv_sem sysvsem;
|
|
struct sysv_shm sysvshm;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct fs_struct *fs;
|
|
|
|
struct files_struct *files;
|
|
|
|
struct nsproxy *nsproxy;
|
|
|
|
struct signal_struct *signal;
|
|
struct sighand_struct *sighand;
|
|
|
|
sigset_t blocked, real_blocked;
|
|
sigset_t saved_sigmask;
|
|
struct sigpending pending;
|
|
|
|
unsigned long sas_ss_sp;
|
|
size_t sas_ss_size;
|
|
|
|
struct callback_head *task_works;
|
|
|
|
struct audit_context *audit_context;
|
|
|
|
|
|
|
|
|
|
struct seccomp seccomp;
|
|
|
|
|
|
u32 parent_exec_id;
|
|
u32 self_exec_id;
|
|
|
|
|
|
spinlock_t alloc_lock;
|
|
|
|
|
|
raw_spinlock_t pi_lock;
|
|
|
|
struct wake_q_node wake_q;
|
|
|
|
|
|
|
|
struct rb_root pi_waiters;
|
|
struct rb_node *pi_waiters_leftmost;
|
|
|
|
struct rt_mutex_waiter *pi_blocked_on;
|
|
# 1653 "include/linux/sched.h"
|
|
void *journal_info;
|
|
|
|
|
|
struct bio_list *bio_list;
|
|
|
|
|
|
|
|
struct blk_plug *plug;
|
|
|
|
|
|
|
|
struct reclaim_state *reclaim_state;
|
|
|
|
struct backing_dev_info *backing_dev_info;
|
|
|
|
struct io_context *io_context;
|
|
|
|
unsigned long ptrace_message;
|
|
siginfo_t *last_siginfo;
|
|
struct task_io_accounting ioac;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nodemask_t mems_allowed;
|
|
seqcount_t mems_allowed_seq;
|
|
int cpuset_mem_spread_rotor;
|
|
int cpuset_slab_spread_rotor;
|
|
|
|
|
|
|
|
struct css_set *cgroups;
|
|
|
|
struct list_head cg_list;
|
|
|
|
|
|
struct robust_list_head *robust_list;
|
|
|
|
|
|
|
|
struct list_head pi_state_list;
|
|
struct futex_pi_state *pi_state_cache;
|
|
|
|
|
|
struct perf_event_context *perf_event_ctxp[perf_nr_task_contexts];
|
|
struct mutex perf_event_mutex;
|
|
struct list_head perf_event_list;
|
|
# 1757 "include/linux/sched.h"
|
|
struct callback_head rcu;
|
|
|
|
|
|
|
|
|
|
struct pipe_inode_info *splice_pipe;
|
|
|
|
struct page_frag task_frag;
|
|
# 1776 "include/linux/sched.h"
|
|
int nr_dirtied;
|
|
int nr_dirtied_pause;
|
|
unsigned long dirty_paused_when;
|
|
# 1788 "include/linux/sched.h"
|
|
unsigned long timer_slack_ns;
|
|
unsigned long default_timer_slack_ns;
|
|
# 1833 "include/linux/sched.h"
|
|
int pagefault_disabled;
|
|
|
|
struct thread_struct thread;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
# 1867 "include/linux/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_numa_fault(int last_node, int node, int pages,
|
|
int flags)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_numa_group_id(struct task_struct *p)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_numabalancing_state(bool enabled)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_numa_free(struct task_struct *p)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool should_numa_migrate_memory(struct task_struct *p,
|
|
struct page *page, int src_nid, int dst_cpu)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pid *task_pid(struct task_struct *task)
|
|
{
|
|
return task->pids[PIDTYPE_PID].pid;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pid *task_tgid(struct task_struct *task)
|
|
{
|
|
return task->group_leader->pids[PIDTYPE_PID].pid;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pid *task_pgrp(struct task_struct *task)
|
|
{
|
|
return task->group_leader->pids[PIDTYPE_PGID].pid;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pid *task_session(struct task_struct *task)
|
|
{
|
|
return task->group_leader->pids[PIDTYPE_SID].pid;
|
|
}
|
|
|
|
struct pid_namespace;
|
|
# 1928 "include/linux/sched.h"
|
|
pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type,
|
|
struct pid_namespace *ns);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_pid_nr(struct task_struct *tsk)
|
|
{
|
|
return tsk->pid;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_pid_nr_ns(struct task_struct *tsk,
|
|
struct pid_namespace *ns)
|
|
{
|
|
return __task_pid_nr_ns(tsk, PIDTYPE_PID, ns);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_pid_vnr(struct task_struct *tsk)
|
|
{
|
|
return __task_pid_nr_ns(tsk, PIDTYPE_PID, ((void *)0));
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_tgid_nr(struct task_struct *tsk)
|
|
{
|
|
return tsk->tgid;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pid_alive(const struct task_struct *p);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_pgrp_nr_ns(struct task_struct *tsk,
|
|
struct pid_namespace *ns)
|
|
{
|
|
return __task_pid_nr_ns(tsk, PIDTYPE_PGID, ns);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_pgrp_vnr(struct task_struct *tsk)
|
|
{
|
|
return __task_pid_nr_ns(tsk, PIDTYPE_PGID, ((void *)0));
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_session_nr_ns(struct task_struct *tsk,
|
|
struct pid_namespace *ns)
|
|
{
|
|
return __task_pid_nr_ns(tsk, PIDTYPE_SID, ns);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_session_vnr(struct task_struct *tsk)
|
|
{
|
|
return __task_pid_nr_ns(tsk, PIDTYPE_SID, ((void *)0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns)
|
|
{
|
|
return __task_pid_nr_ns(tsk, __PIDTYPE_TGID, ns);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_tgid_vnr(struct task_struct *tsk)
|
|
{
|
|
return __task_pid_nr_ns(tsk, __PIDTYPE_TGID, ((void *)0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_namespace *ns)
|
|
{
|
|
pid_t pid = 0;
|
|
|
|
rcu_read_lock();
|
|
if (pid_alive(tsk))
|
|
pid = task_tgid_nr_ns(({ typeof(*(tsk->real_parent)) *________p1 = (typeof(*(tsk->real_parent)) *)({ typeof((tsk->real_parent)) _________p1 = ({ union { typeof((tsk->real_parent)) __val; char __c[1]; } __u; if (1) __read_once_size(&((tsk->real_parent)), __u.__c, sizeof((tsk->real_parent))); else __read_once_size_nocheck(&((tsk->real_parent)), __u.__c, sizeof((tsk->real_parent))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(tsk->real_parent)) *)(________p1)); }), ns);
|
|
rcu_read_unlock();
|
|
|
|
return pid;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_ppid_nr(const struct task_struct *tsk)
|
|
{
|
|
return task_ppid_nr_ns(tsk, &init_pid_ns);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pid_t task_pgrp_nr(struct task_struct *tsk)
|
|
{
|
|
return task_pgrp_nr_ns(tsk, &init_pid_ns);
|
|
}
|
|
# 2022 "include/linux/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pid_alive(const struct task_struct *p)
|
|
{
|
|
return p->pids[PIDTYPE_PID].pid != ((void *)0);
|
|
}
|
|
# 2036 "include/linux/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_global_init(struct task_struct *tsk)
|
|
{
|
|
return task_tgid_nr(tsk) == 1;
|
|
}
|
|
|
|
extern struct pid *cad_pid;
|
|
|
|
extern void free_task(struct task_struct *tsk);
|
|
|
|
|
|
extern void __put_task_struct(struct task_struct *t);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_task_struct(struct task_struct *t)
|
|
{
|
|
if ((({ typeof(atomic_sub_return_relaxed(1, &t->usage)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_sub_return_relaxed(1, &t->usage); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) == 0))
|
|
__put_task_struct(t);
|
|
}
|
|
# 2061 "include/linux/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_cputime(struct task_struct *t,
|
|
cputime_t *utime, cputime_t *stime)
|
|
{
|
|
if (utime)
|
|
*utime = t->utime;
|
|
if (stime)
|
|
*stime = t->stime;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_cputime_scaled(struct task_struct *t,
|
|
cputime_t *utimescaled,
|
|
cputime_t *stimescaled)
|
|
{
|
|
if (utimescaled)
|
|
*utimescaled = t->utimescaled;
|
|
if (stimescaled)
|
|
*stimescaled = t->stimescaled;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) cputime_t task_gtime(struct task_struct *t)
|
|
{
|
|
return t->gtime;
|
|
}
|
|
|
|
extern void task_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st);
|
|
extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st);
|
|
# 2147 "include/linux/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) gfp_t memalloc_noio_flags(gfp_t flags)
|
|
{
|
|
if (__builtin_expect(!!((current_thread_info()->task)->flags & 0x00080000), 0))
|
|
flags &= ~((( gfp_t)0x40u) | (( gfp_t)0x80u));
|
|
return flags;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int memalloc_noio_save(void)
|
|
{
|
|
unsigned int flags = (current_thread_info()->task)->flags & 0x00080000;
|
|
(current_thread_info()->task)->flags |= 0x00080000;
|
|
return flags;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void memalloc_noio_restore(unsigned int flags)
|
|
{
|
|
(current_thread_info()->task)->flags = ((current_thread_info()->task)->flags & ~0x00080000) | flags;
|
|
}
|
|
# 2182 "include/linux/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool task_no_new_privs(struct task_struct *p) { return test_bit(0, &p->atomic_flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_set_no_new_privs(struct task_struct *p) { _set_bit(0,&p->atomic_flags); }
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool task_spread_page(struct task_struct *p) { return test_bit(1, &p->atomic_flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_set_spread_page(struct task_struct *p) { _set_bit(1,&p->atomic_flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_clear_spread_page(struct task_struct *p) { _clear_bit(1,&p->atomic_flags); }
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool task_spread_slab(struct task_struct *p) { return test_bit(2, &p->atomic_flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_set_spread_slab(struct task_struct *p) { _set_bit(2,&p->atomic_flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_clear_spread_slab(struct task_struct *p) { _clear_bit(2,&p->atomic_flags); }
|
|
# 2217 "include/linux/sched.h"
|
|
extern bool task_set_jobctl_pending(struct task_struct *task,
|
|
unsigned long mask);
|
|
extern void task_clear_jobctl_trapping(struct task_struct *task);
|
|
extern void task_clear_jobctl_pending(struct task_struct *task,
|
|
unsigned long mask);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rcu_copy_process(struct task_struct *p)
|
|
{
|
|
# 2236 "include/linux/sched.h"
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tsk_restore_flags(struct task_struct *task,
|
|
unsigned long orig_flags, unsigned long flags)
|
|
{
|
|
task->flags &= ~flags;
|
|
task->flags |= orig_flags & flags;
|
|
}
|
|
|
|
extern int cpuset_cpumask_can_shrink(const struct cpumask *cur,
|
|
const struct cpumask *trial);
|
|
extern int task_can_attach(struct task_struct *p,
|
|
const struct cpumask *cs_cpus_allowed);
|
|
|
|
extern void do_set_cpus_allowed(struct task_struct *p,
|
|
const struct cpumask *new_mask);
|
|
|
|
extern int set_cpus_allowed_ptr(struct task_struct *p,
|
|
const struct cpumask *new_mask);
|
|
# 2270 "include/linux/sched.h"
|
|
void calc_load_enter_idle(void);
|
|
void calc_load_exit_idle(void);
|
|
# 2285 "include/linux/sched.h"
|
|
extern unsigned long long __attribute__((no_instrument_function)) sched_clock(void);
|
|
|
|
|
|
|
|
extern u64 cpu_clock(int cpu);
|
|
extern u64 local_clock(void);
|
|
extern u64 running_clock(void);
|
|
extern u64 sched_clock_cpu(int cpu);
|
|
|
|
|
|
extern void sched_clock_init(void);
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sched_clock_tick(void)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sched_clock_idle_sleep_event(void)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sched_clock_idle_wakeup_event(u64 delta_ns)
|
|
{
|
|
}
|
|
# 2334 "include/linux/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void enable_sched_clock_irqtime(void) {}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void disable_sched_clock_irqtime(void) {}
|
|
|
|
|
|
extern unsigned long long
|
|
task_sched_runtime(struct task_struct *task);
|
|
|
|
|
|
|
|
extern void sched_exec(void);
|
|
|
|
|
|
|
|
|
|
extern void sched_clock_idle_sleep_event(void);
|
|
extern void sched_clock_idle_wakeup_event(u64 delta_ns);
|
|
|
|
|
|
extern void idle_task_exit(void);
|
|
|
|
|
|
|
|
|
|
|
|
extern void wake_up_nohz_cpu(int cpu);
|
|
# 2367 "include/linux/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sched_can_stop_tick(void) { return false; }
|
|
# 2380 "include/linux/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sched_autogroup_create_attach(struct task_struct *p) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sched_autogroup_detach(struct task_struct *p) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sched_autogroup_fork(struct signal_struct *sig) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sched_autogroup_exit(struct signal_struct *sig) { }
|
|
|
|
|
|
extern int yield_to(struct task_struct *p, bool preempt);
|
|
extern void set_user_nice(struct task_struct *p, long nice);
|
|
extern int task_prio(const struct task_struct *p);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int task_nice(const struct task_struct *p)
|
|
{
|
|
return (((p)->static_prio) - (100 + (19 - -20 + 1) / 2));
|
|
}
|
|
extern int can_nice(const struct task_struct *p, const int nice);
|
|
extern int task_curr(const struct task_struct *p);
|
|
extern int idle_cpu(int cpu);
|
|
extern int sched_setscheduler(struct task_struct *, int,
|
|
const struct sched_param *);
|
|
extern int sched_setscheduler_nocheck(struct task_struct *, int,
|
|
const struct sched_param *);
|
|
extern int sched_setattr(struct task_struct *,
|
|
const struct sched_attr *);
|
|
extern struct task_struct *idle_task(int cpu);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_idle_task(const struct task_struct *p)
|
|
{
|
|
return p->pid == 0;
|
|
}
|
|
extern struct task_struct *curr_task(int cpu);
|
|
extern void set_curr_task(int cpu, struct task_struct *p);
|
|
|
|
void yield(void);
|
|
|
|
union thread_union {
|
|
struct thread_info thread_info;
|
|
unsigned long stack[(((1UL) << 12) << 2)/sizeof(long)];
|
|
};
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kstack_end(void *addr)
|
|
{
|
|
|
|
|
|
|
|
return !(((unsigned long)addr+sizeof(void*)-1) & ((((1UL) << 12) << 2)-sizeof(void*)));
|
|
}
|
|
|
|
|
|
extern union thread_union init_thread_union;
|
|
extern struct task_struct init_task;
|
|
|
|
extern struct mm_struct init_mm;
|
|
|
|
extern struct pid_namespace init_pid_ns;
|
|
# 2457 "include/linux/sched.h"
|
|
extern struct task_struct *find_task_by_vpid(pid_t nr);
|
|
extern struct task_struct *find_task_by_pid_ns(pid_t nr,
|
|
struct pid_namespace *ns);
|
|
|
|
|
|
extern struct user_struct * alloc_uid(kuid_t);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct user_struct *get_uid(struct user_struct *u)
|
|
{
|
|
atomic_add(1, &u->__count);
|
|
return u;
|
|
}
|
|
extern void free_uid(struct user_struct *);
|
|
|
|
# 1 "arch/arm/include/generated/asm/current.h" 1
|
|
# 2471 "include/linux/sched.h" 2
|
|
|
|
extern void xtime_update(unsigned long ticks);
|
|
|
|
extern int wake_up_state(struct task_struct *tsk, unsigned int state);
|
|
extern int wake_up_process(struct task_struct *tsk);
|
|
extern void wake_up_new_task(struct task_struct *tsk);
|
|
|
|
extern void kick_process(struct task_struct *tsk);
|
|
|
|
|
|
|
|
extern int sched_fork(unsigned long clone_flags, struct task_struct *p);
|
|
extern void sched_dead(struct task_struct *p);
|
|
|
|
extern void proc_caches_init(void);
|
|
extern void flush_signals(struct task_struct *);
|
|
extern void ignore_signals(struct task_struct *);
|
|
extern void flush_signal_handlers(struct task_struct *, int force_default);
|
|
extern int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kernel_dequeue_signal(siginfo_t *info)
|
|
{
|
|
struct task_struct *tsk = (current_thread_info()->task);
|
|
siginfo_t __info;
|
|
int ret;
|
|
|
|
spin_lock_irq(&tsk->sighand->siglock);
|
|
ret = dequeue_signal(tsk, &tsk->blocked, info ?: &__info);
|
|
spin_unlock_irq(&tsk->sighand->siglock);
|
|
|
|
return ret;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kernel_signal_stop(void)
|
|
{
|
|
spin_lock_irq(&(current_thread_info()->task)->sighand->siglock);
|
|
if ((current_thread_info()->task)->jobctl & (1UL << 16))
|
|
do { (current_thread_info()->task)->state = ((128 | 4)); } while (0);
|
|
spin_unlock_irq(&(current_thread_info()->task)->sighand->siglock);
|
|
|
|
schedule();
|
|
}
|
|
|
|
extern void release_task(struct task_struct * p);
|
|
extern int send_sig_info(int, struct siginfo *, struct task_struct *);
|
|
extern int force_sigsegv(int, struct task_struct *);
|
|
extern int force_sig_info(int, struct siginfo *, struct task_struct *);
|
|
extern int __kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp);
|
|
extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid);
|
|
extern int kill_pid_info_as_cred(int, struct siginfo *, struct pid *,
|
|
const struct cred *, u32);
|
|
extern int kill_pgrp(struct pid *pid, int sig, int priv);
|
|
extern int kill_pid(struct pid *pid, int sig, int priv);
|
|
extern int kill_proc_info(int, struct siginfo *, pid_t);
|
|
extern __attribute__((warn_unused_result)) bool do_notify_parent(struct task_struct *, int);
|
|
extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent);
|
|
extern void force_sig(int, struct task_struct *);
|
|
extern int send_sig(int, struct task_struct *, int);
|
|
extern int zap_other_threads(struct task_struct *p);
|
|
extern struct sigqueue *sigqueue_alloc(void);
|
|
extern void sigqueue_free(struct sigqueue *);
|
|
extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group);
|
|
extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void restore_saved_sigmask(void)
|
|
{
|
|
if (test_and_clear_restore_sigmask())
|
|
__set_current_blocked(&(current_thread_info()->task)->saved_sigmask);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) sigset_t *sigmask_to_save(void)
|
|
{
|
|
sigset_t *res = &(current_thread_info()->task)->blocked;
|
|
if (__builtin_expect(!!(test_restore_sigmask()), 0))
|
|
res = &(current_thread_info()->task)->saved_sigmask;
|
|
return res;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kill_cad_pid(int sig, int priv)
|
|
{
|
|
return kill_pid(cad_pid, sig, priv);
|
|
}
|
|
# 2562 "include/linux/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int on_sig_stack(unsigned long sp)
|
|
{
|
|
|
|
|
|
|
|
|
|
return sp > (current_thread_info()->task)->sas_ss_sp &&
|
|
sp - (current_thread_info()->task)->sas_ss_sp <= (current_thread_info()->task)->sas_ss_size;
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sas_ss_flags(unsigned long sp)
|
|
{
|
|
if (!(current_thread_info()->task)->sas_ss_size)
|
|
return 2;
|
|
|
|
return on_sig_stack(sp) ? 1 : 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long sigsp(unsigned long sp, struct ksignal *ksig)
|
|
{
|
|
if (__builtin_expect(!!((ksig->ka.sa.sa_flags & 0x08000000)), 0) && ! sas_ss_flags(sp))
|
|
|
|
|
|
|
|
return (current_thread_info()->task)->sas_ss_sp + (current_thread_info()->task)->sas_ss_size;
|
|
|
|
return sp;
|
|
}
|
|
|
|
|
|
|
|
|
|
extern struct mm_struct * mm_alloc(void);
|
|
|
|
|
|
extern void __mmdrop(struct mm_struct *);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mmdrop(struct mm_struct * mm)
|
|
{
|
|
if (__builtin_expect(!!((({ typeof(atomic_sub_return_relaxed(1, &mm->mm_count)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_sub_return_relaxed(1, &mm->mm_count); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) == 0)), 0))
|
|
__mmdrop(mm);
|
|
}
|
|
|
|
|
|
extern void mmput(struct mm_struct *);
|
|
|
|
extern struct mm_struct *get_task_mm(struct task_struct *task);
|
|
|
|
|
|
|
|
|
|
|
|
extern struct mm_struct *mm_access(struct task_struct *task, unsigned int mode);
|
|
|
|
extern void mm_release(struct task_struct *, struct mm_struct *);
|
|
|
|
|
|
|
|
|
|
|
|
extern int copy_thread(unsigned long, unsigned long, unsigned long,
|
|
struct task_struct *);
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int copy_thread_tls(
|
|
unsigned long clone_flags, unsigned long sp, unsigned long arg,
|
|
struct task_struct *p, unsigned long tls)
|
|
{
|
|
return copy_thread(clone_flags, sp, arg, p);
|
|
}
|
|
|
|
extern void flush_thread(void);
|
|
extern void exit_thread(void);
|
|
|
|
extern void exit_files(struct task_struct *);
|
|
extern void __cleanup_sighand(struct sighand_struct *);
|
|
|
|
extern void exit_itimers(struct signal_struct *);
|
|
extern void flush_itimer_signals(void);
|
|
|
|
extern void do_group_exit(int);
|
|
|
|
extern int do_execve(struct filename *,
|
|
const char * const *,
|
|
const char * const *);
|
|
extern int do_execveat(int, struct filename *,
|
|
const char * const *,
|
|
const char * const *,
|
|
int);
|
|
extern long _do_fork(unsigned long, unsigned long, unsigned long, int *, int *, unsigned long);
|
|
extern long do_fork(unsigned long, unsigned long, unsigned long, int *, int *);
|
|
struct task_struct *fork_idle(int);
|
|
extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
|
|
|
|
extern void __set_task_comm(struct task_struct *tsk, const char *from, bool exec);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_task_comm(struct task_struct *tsk, const char *from)
|
|
{
|
|
__set_task_comm(tsk, from, false);
|
|
}
|
|
extern char *get_task_comm(char *to, struct task_struct *tsk);
|
|
|
|
|
|
void scheduler_ipi(void);
|
|
extern unsigned long wait_task_inactive(struct task_struct *, long match_state);
|
|
# 2685 "include/linux/sched.h"
|
|
extern bool current_is_single_threaded(void);
|
|
# 2707 "include/linux/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_nr_threads(struct task_struct *tsk)
|
|
{
|
|
return tsk->signal->nr_threads;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool thread_group_leader(struct task_struct *p)
|
|
{
|
|
return p->exit_signal >= 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool has_group_leader_pid(struct task_struct *p)
|
|
{
|
|
return task_pid(p) == p->signal->leader_pid;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
bool same_thread_group(struct task_struct *p1, struct task_struct *p2)
|
|
{
|
|
return p1->signal == p2->signal;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct task_struct *next_thread(const struct task_struct *p)
|
|
{
|
|
return ({ const typeof( ((struct task_struct *)0)->thread_group ) *__mptr = (({ typeof(p->thread_group.next) _________p1 = ({ union { typeof(p->thread_group.next) __val; char __c[1]; } __u; if (1) __read_once_size(&(p->thread_group.next), __u.__c, sizeof(p->thread_group.next)); else __read_once_size_nocheck(&(p->thread_group.next), __u.__c, sizeof(p->thread_group.next)); __u.__val; }); do { } while(0); (_________p1); })); (struct task_struct *)( (char *)__mptr - __builtin_offsetof(struct task_struct, thread_group) );})
|
|
;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int thread_group_empty(struct task_struct *p)
|
|
{
|
|
return list_empty(&p->thread_group);
|
|
}
|
|
# 2758 "include/linux/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_lock(struct task_struct *p)
|
|
{
|
|
spin_lock(&p->alloc_lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void task_unlock(struct task_struct *p)
|
|
{
|
|
spin_unlock(&p->alloc_lock);
|
|
}
|
|
|
|
extern struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
|
|
unsigned long *flags);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sighand_struct *lock_task_sighand(struct task_struct *tsk,
|
|
unsigned long *flags)
|
|
{
|
|
struct sighand_struct *ret;
|
|
|
|
ret = __lock_task_sighand(tsk, flags);
|
|
(void)(ret);
|
|
return ret;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void unlock_task_sighand(struct task_struct *tsk,
|
|
unsigned long *flags)
|
|
{
|
|
spin_unlock_irqrestore(&tsk->sighand->siglock, *flags);
|
|
}
|
|
# 2798 "include/linux/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void threadgroup_change_begin(struct task_struct *tsk)
|
|
{
|
|
do { do { } while (0); } while (0);
|
|
cgroup_threadgroup_change_begin(tsk);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void threadgroup_change_end(struct task_struct *tsk)
|
|
{
|
|
cgroup_threadgroup_change_end(tsk);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void setup_thread_stack(struct task_struct *p, struct task_struct *org)
|
|
{
|
|
*((struct thread_info *)(p)->stack) = *((struct thread_info *)(org)->stack);
|
|
((struct thread_info *)(p)->stack)->task = p;
|
|
}
|
|
# 2835 "include/linux/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long *end_of_stack(struct task_struct *p)
|
|
{
|
|
|
|
|
|
|
|
return (unsigned long *)(((struct thread_info *)(p)->stack) + 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int object_is_on_stack(void *obj)
|
|
{
|
|
void *stack = (((current_thread_info()->task))->stack);
|
|
|
|
return (obj >= stack) && (obj < (stack + (((1UL) << 12) << 2)));
|
|
}
|
|
|
|
extern void thread_info_cache_init(void);
|
|
# 2869 "include/linux/sched.h"
|
|
extern void set_task_stack_end_magic(struct task_struct *tsk);
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_tsk_thread_flag(struct task_struct *tsk, int flag)
|
|
{
|
|
set_ti_thread_flag(((struct thread_info *)(tsk)->stack), flag);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_tsk_thread_flag(struct task_struct *tsk, int flag)
|
|
{
|
|
clear_ti_thread_flag(((struct thread_info *)(tsk)->stack), flag);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag)
|
|
{
|
|
return test_and_set_ti_thread_flag(((struct thread_info *)(tsk)->stack), flag);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag)
|
|
{
|
|
return test_and_clear_ti_thread_flag(((struct thread_info *)(tsk)->stack), flag);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_tsk_thread_flag(struct task_struct *tsk, int flag)
|
|
{
|
|
return test_ti_thread_flag(((struct thread_info *)(tsk)->stack), flag);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_tsk_need_resched(struct task_struct *tsk)
|
|
{
|
|
set_tsk_thread_flag(tsk,1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_tsk_need_resched(struct task_struct *tsk)
|
|
{
|
|
clear_tsk_thread_flag(tsk,1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int test_tsk_need_resched(struct task_struct *tsk)
|
|
{
|
|
return __builtin_expect(!!(test_tsk_thread_flag(tsk,1)), 0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int restart_syscall(void)
|
|
{
|
|
set_tsk_thread_flag((current_thread_info()->task), 0);
|
|
return -513;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int signal_pending(struct task_struct *p)
|
|
{
|
|
return __builtin_expect(!!(test_tsk_thread_flag(p,0)), 0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __fatal_signal_pending(struct task_struct *p)
|
|
{
|
|
return __builtin_expect(!!(sigismember(&p->pending.signal, 9)), 0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fatal_signal_pending(struct task_struct *p)
|
|
{
|
|
return signal_pending(p) && __fatal_signal_pending(p);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int signal_pending_state(long state, struct task_struct *p)
|
|
{
|
|
if (!(state & (1 | 128)))
|
|
return 0;
|
|
if (!signal_pending(p))
|
|
return 0;
|
|
|
|
return (state & 1) || __fatal_signal_pending(p);
|
|
}
|
|
# 2952 "include/linux/sched.h"
|
|
extern int _cond_resched(void);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern int __cond_resched_lock(spinlock_t *lock);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern int __cond_resched_softirq(void);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cond_resched_rcu(void)
|
|
{
|
|
|
|
rcu_read_unlock();
|
|
({ ___might_sleep("include/linux/sched.h", 2977, 0); _cond_resched(); });
|
|
rcu_read_lock();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int spin_needbreak(spinlock_t *lock)
|
|
{
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
# 3043 "include/linux/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int tsk_is_polling(struct task_struct *p) { return 0; }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __current_set_polling(void) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __current_clr_polling(void) { }
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __attribute__((warn_unused_result)) current_set_polling_and_test(void)
|
|
{
|
|
return __builtin_expect(!!(test_ti_thread_flag(current_thread_info(), 1)), 0);
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __attribute__((warn_unused_result)) current_clr_polling_and_test(void)
|
|
{
|
|
return __builtin_expect(!!(test_ti_thread_flag(current_thread_info(), 1)), 0);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void current_clr_polling(void)
|
|
{
|
|
__current_clr_polling();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
|
|
do { if (test_ti_thread_flag(current_thread_info(), 1)) set_preempt_need_resched(); } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) bool need_resched(void)
|
|
{
|
|
return __builtin_expect(!!(test_ti_thread_flag(current_thread_info(), 1)), 0);
|
|
}
|
|
|
|
|
|
|
|
|
|
void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times);
|
|
void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern void recalc_sigpending_and_wake(struct task_struct *t);
|
|
extern void recalc_sigpending(void);
|
|
|
|
extern void signal_wake_up_state(struct task_struct *t, unsigned int state);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void signal_wake_up(struct task_struct *t, bool resume)
|
|
{
|
|
signal_wake_up_state(t, resume ? 128 : 0);
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptrace_signal_wake_up(struct task_struct *t, bool resume)
|
|
{
|
|
signal_wake_up_state(t, resume ? 8 : 0);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int task_cpu(const struct task_struct *p)
|
|
{
|
|
return ((struct thread_info *)(p)->stack)->cpu;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int task_node(const struct task_struct *p)
|
|
{
|
|
return ((void)(task_cpu(p)),0);
|
|
}
|
|
|
|
extern void set_task_cpu(struct task_struct *p, unsigned int cpu);
|
|
# 3133 "include/linux/sched.h"
|
|
extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask);
|
|
extern long sched_getaffinity(pid_t pid, struct cpumask *mask);
|
|
|
|
|
|
extern struct task_group root_task_group;
|
|
|
|
|
|
extern int task_can_switch_user(struct user_struct *up,
|
|
struct task_struct *tsk);
|
|
# 3164 "include/linux/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void add_rchar(struct task_struct *tsk, ssize_t amt)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void add_wchar(struct task_struct *tsk, ssize_t amt)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inc_syscr(struct task_struct *tsk)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inc_syscw(struct task_struct *tsk)
|
|
{
|
|
}
|
|
# 3188 "include/linux/sched.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mm_update_next_owner(struct mm_struct *mm)
|
|
{
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long task_rlimit(const struct task_struct *tsk,
|
|
unsigned int limit)
|
|
{
|
|
return ({ union { typeof(tsk->signal->rlim[limit].rlim_cur) __val; char __c[1]; } __u; if (1) __read_once_size(&(tsk->signal->rlim[limit].rlim_cur), __u.__c, sizeof(tsk->signal->rlim[limit].rlim_cur)); else __read_once_size_nocheck(&(tsk->signal->rlim[limit].rlim_cur), __u.__c, sizeof(tsk->signal->rlim[limit].rlim_cur)); __u.__val; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long task_rlimit_max(const struct task_struct *tsk,
|
|
unsigned int limit)
|
|
{
|
|
return ({ union { typeof(tsk->signal->rlim[limit].rlim_max) __val; char __c[1]; } __u; if (1) __read_once_size(&(tsk->signal->rlim[limit].rlim_max), __u.__c, sizeof(tsk->signal->rlim[limit].rlim_max)); else __read_once_size_nocheck(&(tsk->signal->rlim[limit].rlim_max), __u.__c, sizeof(tsk->signal->rlim[limit].rlim_max)); __u.__val; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long rlimit(unsigned int limit)
|
|
{
|
|
return task_rlimit((current_thread_info()->task), limit);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long rlimit_max(unsigned int limit)
|
|
{
|
|
return task_rlimit_max((current_thread_info()->task), limit);
|
|
}
|
|
# 205 "./arch/arm/include/asm/tlbflush.h" 2
|
|
|
|
struct cpu_tlb_fns {
|
|
void (*flush_user_range)(unsigned long, unsigned long, struct vm_area_struct *);
|
|
void (*flush_kern_range)(unsigned long, unsigned long);
|
|
unsigned long tlb_flags;
|
|
};
|
|
# 230 "./arch/arm/include/asm/tlbflush.h"
|
|
extern struct cpu_tlb_fns cpu_tlb;
|
|
# 322 "./arch/arm/include/asm/tlbflush.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __local_flush_tlb_all(void)
|
|
{
|
|
const int zero = 0;
|
|
const unsigned int __tlb_flag = cpu_tlb.tlb_flags;
|
|
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 9) | (1 << 12))) asm("mcr " "p15, 0, %0, " "c8, c7, 0" : : "r" (zero) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 9) | (1 << 12))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c7, 0" : : "r" (zero), "r" (__tlb_flag), "Ir" ((1 << 9) | (1 << 12)) : "cc"); } while (0);
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 10) | (1 << 13))) asm("mcr " "p15, 0, %0, " "c8, c6, 0" : : "r" (zero) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 10) | (1 << 13))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c6, 0" : : "r" (zero), "r" (__tlb_flag), "Ir" ((1 << 10) | (1 << 13)) : "cc"); } while (0);
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 11) | (1 << 14))) asm("mcr " "p15, 0, %0, " "c8, c5, 0" : : "r" (zero) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 11) | (1 << 14))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c5, 0" : : "r" (zero), "r" (__tlb_flag), "Ir" ((1 << 11) | (1 << 14)) : "cc"); } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void local_flush_tlb_all(void)
|
|
{
|
|
const int zero = 0;
|
|
const unsigned int __tlb_flag = cpu_tlb.tlb_flags;
|
|
|
|
if (((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 31))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 31)))))
|
|
__asm__ __volatile__ ("dsb " "nshst" : : : "memory");
|
|
|
|
__local_flush_tlb_all();
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 21))) asm("mcr " "p15, 0, %0, " "c8, c7, 0" : : "r" (zero) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 21))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c7, 0" : : "r" (zero), "r" (__tlb_flag), "Ir" ((1 << 21)) : "cc"); } while (0);
|
|
|
|
if (((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 28))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 28))))) {
|
|
__asm__ __volatile__ ("dsb " "nsh" : : : "memory");
|
|
__asm__ __volatile__ ("isb " "" : : : "memory");
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __flush_tlb_all(void)
|
|
{
|
|
const int zero = 0;
|
|
const unsigned int __tlb_flag = cpu_tlb.tlb_flags;
|
|
|
|
if (((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 31))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 31)))))
|
|
__asm__ __volatile__ ("dsb " "ishst" : : : "memory");
|
|
|
|
__local_flush_tlb_all();
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 21))) asm("mcr " "p15, 0, %0, " "c8, c3, 0" : : "r" (zero) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 21))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c3, 0" : : "r" (zero), "r" (__tlb_flag), "Ir" ((1 << 21)) : "cc"); } while (0);
|
|
|
|
if (((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 28))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 28))))) {
|
|
__asm__ __volatile__ ("dsb " "ish" : : : "memory");
|
|
__asm__ __volatile__ ("isb " "" : : : "memory");
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __local_flush_tlb_mm(struct mm_struct *mm)
|
|
{
|
|
const int zero = 0;
|
|
const int asid = ((unsigned int)((mm)->context.id.counter & ~((~0ULL) << 8)));
|
|
const unsigned int __tlb_flag = cpu_tlb.tlb_flags;
|
|
|
|
if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 9)|(1 << 10)|(1 << 11))) {
|
|
if (cpumask_test_cpu((current_thread_info()->cpu), mm_cpumask(mm))) {
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 9))) asm("mcr " "p15, 0, %0, " "c8, c7, 0" : : "r" (zero) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 9))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c7, 0" : : "r" (zero), "r" (__tlb_flag), "Ir" ((1 << 9)) : "cc"); } while (0);
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 10))) asm("mcr " "p15, 0, %0, " "c8, c6, 0" : : "r" (zero) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 10))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c6, 0" : : "r" (zero), "r" (__tlb_flag), "Ir" ((1 << 10)) : "cc"); } while (0);
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 11))) asm("mcr " "p15, 0, %0, " "c8, c5, 0" : : "r" (zero) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 11))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c5, 0" : : "r" (zero), "r" (__tlb_flag), "Ir" ((1 << 11)) : "cc"); } while (0);
|
|
}
|
|
}
|
|
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 16))) asm("mcr " "p15, 0, %0, " "c8, c7, 2" : : "r" (asid) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 16))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c7, 2" : : "r" (asid), "r" (__tlb_flag), "Ir" ((1 << 16)) : "cc"); } while (0);
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 17))) asm("mcr " "p15, 0, %0, " "c8, c6, 2" : : "r" (asid) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 17))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c6, 2" : : "r" (asid), "r" (__tlb_flag), "Ir" ((1 << 17)) : "cc"); } while (0);
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 18))) asm("mcr " "p15, 0, %0, " "c8, c5, 2" : : "r" (asid) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 18))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c5, 2" : : "r" (asid), "r" (__tlb_flag), "Ir" ((1 << 18)) : "cc"); } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void local_flush_tlb_mm(struct mm_struct *mm)
|
|
{
|
|
const int asid = ((unsigned int)((mm)->context.id.counter & ~((~0ULL) << 8)));
|
|
const unsigned int __tlb_flag = cpu_tlb.tlb_flags;
|
|
|
|
if (((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 31))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 31)))))
|
|
__asm__ __volatile__ ("dsb " "nshst" : : : "memory");
|
|
|
|
__local_flush_tlb_mm(mm);
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 22))) asm("mcr " "p15, 0, %0, " "c8, c7, 2" : : "r" (asid) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 22))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c7, 2" : : "r" (asid), "r" (__tlb_flag), "Ir" ((1 << 22)) : "cc"); } while (0);
|
|
|
|
if (((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 28))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 28)))))
|
|
__asm__ __volatile__ ("dsb " "nsh" : : : "memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __flush_tlb_mm(struct mm_struct *mm)
|
|
{
|
|
const unsigned int __tlb_flag = cpu_tlb.tlb_flags;
|
|
|
|
if (((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 31))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 31)))))
|
|
__asm__ __volatile__ ("dsb " "ishst" : : : "memory");
|
|
|
|
__local_flush_tlb_mm(mm);
|
|
|
|
|
|
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 22))) asm("mcr " "p15, 0, %0, " "c8, c3, 2" : : "r" (((unsigned int)((mm)->context.id.counter & ~((~0ULL) << 8)))) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 22))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c3, 2" : : "r" (((unsigned int)((mm)->context.id.counter & ~((~0ULL) << 8)))), "r" (__tlb_flag), "Ir" ((1 << 22)) : "cc"); } while (0);
|
|
|
|
|
|
if (((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 28))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 28)))))
|
|
__asm__ __volatile__ ("dsb " "ish" : : : "memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
__local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
|
|
{
|
|
const int zero = 0;
|
|
const unsigned int __tlb_flag = cpu_tlb.tlb_flags;
|
|
|
|
uaddr = (uaddr & (~((1 << 12) - 1))) | ((unsigned int)((vma->vm_mm)->context.id.counter & ~((~0ULL) << 8)));
|
|
|
|
if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 1)|(1 << 2)|(1 << 3)|(1 << 11)) &&
|
|
cpumask_test_cpu((current_thread_info()->cpu), mm_cpumask(vma->vm_mm))) {
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 1))) asm("mcr " "p15, 0, %0, " "c8, c7, 1" : : "r" (uaddr) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 1))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c7, 1" : : "r" (uaddr), "r" (__tlb_flag), "Ir" ((1 << 1)) : "cc"); } while (0);
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 2))) asm("mcr " "p15, 0, %0, " "c8, c6, 1" : : "r" (uaddr) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 2))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c6, 1" : : "r" (uaddr), "r" (__tlb_flag), "Ir" ((1 << 2)) : "cc"); } while (0);
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 3))) asm("mcr " "p15, 0, %0, " "c8, c5, 1" : : "r" (uaddr) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 3))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c5, 1" : : "r" (uaddr), "r" (__tlb_flag), "Ir" ((1 << 3)) : "cc"); } while (0);
|
|
if (!((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 3))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 3)))) && ((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 11))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 11)))))
|
|
asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc");
|
|
}
|
|
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 4))) asm("mcr " "p15, 0, %0, " "c8, c7, 1" : : "r" (uaddr) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 4))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c7, 1" : : "r" (uaddr), "r" (__tlb_flag), "Ir" ((1 << 4)) : "cc"); } while (0);
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 5))) asm("mcr " "p15, 0, %0, " "c8, c6, 1" : : "r" (uaddr) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 5))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c6, 1" : : "r" (uaddr), "r" (__tlb_flag), "Ir" ((1 << 5)) : "cc"); } while (0);
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 6))) asm("mcr " "p15, 0, %0, " "c8, c5, 1" : : "r" (uaddr) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 6))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c5, 1" : : "r" (uaddr), "r" (__tlb_flag), "Ir" ((1 << 6)) : "cc"); } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
|
|
{
|
|
const unsigned int __tlb_flag = cpu_tlb.tlb_flags;
|
|
|
|
uaddr = (uaddr & (~((1 << 12) - 1))) | ((unsigned int)((vma->vm_mm)->context.id.counter & ~((~0ULL) << 8)));
|
|
|
|
if (((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 31))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 31)))))
|
|
__asm__ __volatile__ ("dsb " "nshst" : : : "memory");
|
|
|
|
__local_flush_tlb_page(vma, uaddr);
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 20))) asm("mcr " "p15, 0, %0, " "c8, c7, 1" : : "r" (uaddr) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 20))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c7, 1" : : "r" (uaddr), "r" (__tlb_flag), "Ir" ((1 << 20)) : "cc"); } while (0);
|
|
|
|
if (((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 28))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 28)))))
|
|
__asm__ __volatile__ ("dsb " "nsh" : : : "memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
__flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
|
|
{
|
|
const unsigned int __tlb_flag = cpu_tlb.tlb_flags;
|
|
|
|
uaddr = (uaddr & (~((1 << 12) - 1))) | ((unsigned int)((vma->vm_mm)->context.id.counter & ~((~0ULL) << 8)));
|
|
|
|
if (((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 31))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 31)))))
|
|
__asm__ __volatile__ ("dsb " "ishst" : : : "memory");
|
|
|
|
__local_flush_tlb_page(vma, uaddr);
|
|
|
|
|
|
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 20))) asm("mcr " "p15, 0, %0, " "c8, c3, 1" : : "r" (uaddr) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 20))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c3, 1" : : "r" (uaddr), "r" (__tlb_flag), "Ir" ((1 << 20)) : "cc"); } while (0);
|
|
|
|
|
|
if (((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 28))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 28)))))
|
|
__asm__ __volatile__ ("dsb " "ish" : : : "memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __local_flush_tlb_kernel_page(unsigned long kaddr)
|
|
{
|
|
const int zero = 0;
|
|
const unsigned int __tlb_flag = cpu_tlb.tlb_flags;
|
|
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 1))) asm("mcr " "p15, 0, %0, " "c8, c7, 1" : : "r" (kaddr) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 1))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c7, 1" : : "r" (kaddr), "r" (__tlb_flag), "Ir" ((1 << 1)) : "cc"); } while (0);
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 2))) asm("mcr " "p15, 0, %0, " "c8, c6, 1" : : "r" (kaddr) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 2))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c6, 1" : : "r" (kaddr), "r" (__tlb_flag), "Ir" ((1 << 2)) : "cc"); } while (0);
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 3))) asm("mcr " "p15, 0, %0, " "c8, c5, 1" : : "r" (kaddr) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 3))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c5, 1" : : "r" (kaddr), "r" (__tlb_flag), "Ir" ((1 << 3)) : "cc"); } while (0);
|
|
if (!((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 3))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 3)))) && ((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 11))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 11)))))
|
|
asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc");
|
|
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 4))) asm("mcr " "p15, 0, %0, " "c8, c7, 1" : : "r" (kaddr) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 4))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c7, 1" : : "r" (kaddr), "r" (__tlb_flag), "Ir" ((1 << 4)) : "cc"); } while (0);
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 5))) asm("mcr " "p15, 0, %0, " "c8, c6, 1" : : "r" (kaddr) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 5))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c6, 1" : : "r" (kaddr), "r" (__tlb_flag), "Ir" ((1 << 5)) : "cc"); } while (0);
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 6))) asm("mcr " "p15, 0, %0, " "c8, c5, 1" : : "r" (kaddr) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 6))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c5, 1" : : "r" (kaddr), "r" (__tlb_flag), "Ir" ((1 << 6)) : "cc"); } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void local_flush_tlb_kernel_page(unsigned long kaddr)
|
|
{
|
|
const unsigned int __tlb_flag = cpu_tlb.tlb_flags;
|
|
|
|
kaddr &= (~((1 << 12) - 1));
|
|
|
|
if (((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 31))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 31)))))
|
|
__asm__ __volatile__ ("dsb " "nshst" : : : "memory");
|
|
|
|
__local_flush_tlb_kernel_page(kaddr);
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 20))) asm("mcr " "p15, 0, %0, " "c8, c7, 1" : : "r" (kaddr) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 20))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c7, 1" : : "r" (kaddr), "r" (__tlb_flag), "Ir" ((1 << 20)) : "cc"); } while (0);
|
|
|
|
if (((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 28))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 28))))) {
|
|
__asm__ __volatile__ ("dsb " "nsh" : : : "memory");
|
|
__asm__ __volatile__ ("isb " "" : : : "memory");
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __flush_tlb_kernel_page(unsigned long kaddr)
|
|
{
|
|
const unsigned int __tlb_flag = cpu_tlb.tlb_flags;
|
|
|
|
kaddr &= (~((1 << 12) - 1));
|
|
|
|
if (((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 31))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 31)))))
|
|
__asm__ __volatile__ ("dsb " "ishst" : : : "memory");
|
|
|
|
__local_flush_tlb_kernel_page(kaddr);
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 20))) asm("mcr " "p15, 0, %0, " "c8, c3, 1" : : "r" (kaddr) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 20))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c8, c3, 1" : : "r" (kaddr), "r" (__tlb_flag), "Ir" ((1 << 20)) : "cc"); } while (0);
|
|
|
|
if (((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 28))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 28))))) {
|
|
__asm__ __volatile__ ("dsb " "ish" : : : "memory");
|
|
__asm__ __volatile__ ("isb " "" : : : "memory");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __local_flush_bp_all(void)
|
|
{
|
|
const int zero = 0;
|
|
const unsigned int __tlb_flag = cpu_tlb.tlb_flags;
|
|
|
|
if (((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 19))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 19)))))
|
|
asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void local_flush_bp_all(void)
|
|
{
|
|
const int zero = 0;
|
|
const unsigned int __tlb_flag = cpu_tlb.tlb_flags;
|
|
|
|
__local_flush_bp_all();
|
|
if (((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 23))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 23)))))
|
|
asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __flush_bp_all(void)
|
|
{
|
|
const int zero = 0;
|
|
const unsigned int __tlb_flag = cpu_tlb.tlb_flags;
|
|
|
|
__local_flush_bp_all();
|
|
if (((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 23))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 23)))))
|
|
asm("mcr p15, 0, %0, c7, c1, 6" : : "r" (zero));
|
|
}
|
|
# 576 "./arch/arm/include/asm/tlbflush.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void flush_pmd_entry(void *pmd)
|
|
{
|
|
const unsigned int __tlb_flag = cpu_tlb.tlb_flags;
|
|
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 30))) asm("mcr " "p15, 0, %0, " "c7, c10, 1 @ flush_pmd" : : "r" (pmd) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 30))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c7, c10, 1 @ flush_pmd" : : "r" (pmd), "r" (__tlb_flag), "Ir" ((1 << 30)) : "cc"); } while (0);
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 29))) asm("mcr " "p15, 1, %0, " "c15, c9, 1 @ L2 flush_pmd" : : "r" (pmd) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 29))) asm("tst %1, %2\n\t" "mcrne " "p15, 1, %0, " "c15, c9, 1 @ L2 flush_pmd" : : "r" (pmd), "r" (__tlb_flag), "Ir" ((1 << 29)) : "cc"); } while (0);
|
|
|
|
if (((((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 31))) || (__tlb_flag & (0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 31)))))
|
|
__asm__ __volatile__ ("dsb " "ishst" : : : "memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clean_pmd_entry(void *pmd)
|
|
{
|
|
const unsigned int __tlb_flag = cpu_tlb.tlb_flags;
|
|
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 30))) asm("mcr " "p15, 0, %0, " "c7, c10, 1 @ flush_pmd" : : "r" (pmd) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 30))) asm("tst %1, %2\n\t" "mcrne " "p15, 0, %0, " "c7, c10, 1 @ flush_pmd" : : "r" (pmd), "r" (__tlb_flag), "Ir" ((1 << 30)) : "cc"); } while (0);
|
|
do { if (((-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (-1UL) & (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) & ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 29))) asm("mcr " "p15, 1, %0, " "c15, c9, 1 @ L2 flush_pmd" : : "r" (pmd) : "cc"); else if ((0 | 0 | 0 | 0 | 0 | 0 | (((1 << 31) | (1 << 28) | (1 << 21) | (1 << 20) | (1 << 22) | (1 << 23)) | ((1 << 31) | (1 << 30) | (1 << 28) | (1 << 12) | (1 << 4) | (1 << 16) | (1 << 19)))) & ((1 << 29))) asm("tst %1, %2\n\t" "mcrne " "p15, 1, %0, " "c15, c9, 1 @ L2 flush_pmd" : : "r" (pmd), "r" (__tlb_flag), "Ir" ((1 << 29)) : "cc"); } while (0);
|
|
}
|
|
# 615 "./arch/arm/include/asm/tlbflush.h"
|
|
extern void flush_tlb_all(void);
|
|
extern void flush_tlb_mm(struct mm_struct *mm);
|
|
extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr);
|
|
extern void flush_tlb_kernel_page(unsigned long kaddr);
|
|
extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end);
|
|
extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
|
|
extern void flush_bp_all(void);
|
|
# 634 "./arch/arm/include/asm/tlbflush.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void update_mmu_cache(struct vm_area_struct *vma,
|
|
unsigned long addr, pte_t *ptep)
|
|
{
|
|
}
|
|
# 673 "./arch/arm/include/asm/tlbflush.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void erratum_a15_798181_init(void) {}
|
|
|
|
extern bool (*erratum_a15_798181_handler)(void);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool erratum_a15_798181(void)
|
|
{
|
|
if (__builtin_expect(!!((0 || 0) && erratum_a15_798181_handler), 0)
|
|
)
|
|
return erratum_a15_798181_handler();
|
|
return false;
|
|
}
|
|
# 29 "./arch/arm/include/asm/pgtable.h" 2
|
|
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/pgtable-2level.h" 1
|
|
# 189 "./arch/arm/include/asm/pgtable-2level.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t *pmd_offset(pud_t *pud, unsigned long addr)
|
|
{
|
|
return (pmd_t *)pud;
|
|
}
|
|
# 217 "./arch/arm/include/asm/pgtable-2level.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mkspecial(pte_t pte) { return pte; }
|
|
# 34 "./arch/arm/include/asm/pgtable.h" 2
|
|
# 51 "./arch/arm/include/asm/pgtable.h"
|
|
extern void __pte_error(const char *file, int line, pte_t);
|
|
extern void __pmd_error(const char *file, int line, pmd_t);
|
|
extern void __pgd_error(const char *file, int line, pgd_t);
|
|
# 83 "./arch/arm/include/asm/pgtable.h"
|
|
extern pgprot_t pgprot_user;
|
|
extern pgprot_t pgprot_kernel;
|
|
extern pgprot_t pgprot_hyp_device;
|
|
extern pgprot_t pgprot_s2;
|
|
extern pgprot_t pgprot_s2_device;
|
|
# 129 "./arch/arm/include/asm/pgtable.h"
|
|
struct file;
|
|
extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
|
|
unsigned long size, pgprot_t vma_prot);
|
|
# 170 "./arch/arm/include/asm/pgtable.h"
|
|
extern struct page *empty_zero_page;
|
|
|
|
|
|
|
|
extern pgd_t swapper_pg_dir[2048];
|
|
# 186 "./arch/arm/include/asm/pgtable.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t *pmd_page_vaddr(pmd_t pmd)
|
|
{
|
|
return ((void *)__phys_to_virt((phys_addr_t)((pmd) & (~0UL) & (s32)(~((1 << 12) - 1)))));
|
|
}
|
|
# 237 "./arch/arm/include/asm/pgtable.h"
|
|
extern void __sync_icache_dcache(pte_t pteval);
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_pte_at(struct mm_struct *mm, unsigned long addr,
|
|
pte_t *ptep, pte_t pteval)
|
|
{
|
|
unsigned long ext = 0;
|
|
|
|
if (addr < ((0xC0000000UL) - ((0x01000000UL) + (0x00400000UL))) && ((((u32)((((pteval_t)(1)) << 0)) == ((((pteval_t)(1)) << 0)) ? ((pteval)) & ((((pteval_t)(1)) << 0)) : !!(((pteval)) & ((((pteval_t)(1)) << 0))))) && ((u32)((((pteval_t)(1)) << 8)) == ((((pteval_t)(1)) << 8)) ? ((pteval)) & ((((pteval_t)(1)) << 8)) : !!(((pteval)) & ((((pteval_t)(1)) << 8)))) && (((u32)((((pteval_t)(1)) << 1)) == ((((pteval_t)(1)) << 1)) ? ((pteval)) & ((((pteval_t)(1)) << 1)) : !!(((pteval)) & ((((pteval_t)(1)) << 1))))))) {
|
|
if (!(0))
|
|
__sync_icache_dcache(pteval);
|
|
ext |= (((pteval_t)(1)) << 11);
|
|
}
|
|
|
|
processor.set_pte_ext(ptep,pteval,ext);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t clear_pte_bit(pte_t pte, pgprot_t prot)
|
|
{
|
|
(pte) &= ~(prot);
|
|
return pte;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t set_pte_bit(pte_t pte, pgprot_t prot)
|
|
{
|
|
(pte) |= (prot);
|
|
return pte;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_wrprotect(pte_t pte)
|
|
{
|
|
return set_pte_bit(pte, ((((pteval_t)(1)) << 7)));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mkwrite(pte_t pte)
|
|
{
|
|
return clear_pte_bit(pte, ((((pteval_t)(1)) << 7)));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mkclean(pte_t pte)
|
|
{
|
|
return clear_pte_bit(pte, ((((pteval_t)(1)) << 6)));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mkdirty(pte_t pte)
|
|
{
|
|
return set_pte_bit(pte, ((((pteval_t)(1)) << 6)));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mkold(pte_t pte)
|
|
{
|
|
return clear_pte_bit(pte, ((((pteval_t)(1)) << 1)));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mkyoung(pte_t pte)
|
|
{
|
|
return set_pte_bit(pte, ((((pteval_t)(1)) << 1)));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mkexec(pte_t pte)
|
|
{
|
|
return clear_pte_bit(pte, ((((pteval_t)(1)) << 9)));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mknexec(pte_t pte)
|
|
{
|
|
return set_pte_bit(pte, ((((pteval_t)(1)) << 9)));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_modify(pte_t pte, pgprot_t newprot)
|
|
{
|
|
const pteval_t mask = (((pteval_t)(1)) << 9) | (((pteval_t)(1)) << 7) | (((pteval_t)(1)) << 8) |
|
|
(((pteval_t)(1)) << 11) | (((pteval_t)(1)) << 0);
|
|
(pte) = ((pte) & ~mask) | ((newprot) & mask);
|
|
return pte;
|
|
}
|
|
# 348 "./arch/arm/include/asm/pgtable.h"
|
|
# 1 "include/asm-generic/pgtable.h" 1
|
|
# 27 "include/asm-generic/pgtable.h"
|
|
extern int ptep_set_access_flags(struct vm_area_struct *vma,
|
|
unsigned long address, pte_t *ptep,
|
|
pte_t entry, int dirty);
|
|
# 38 "include/asm-generic/pgtable.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmdp_set_access_flags(struct vm_area_struct *vma,
|
|
unsigned long address, pmd_t *pmdp,
|
|
pmd_t entry, int dirty)
|
|
{
|
|
do { bool __cond = !(!(1)); extern void __compiletime_assert_42(void) __attribute__((error("BUILD_BUG failed"))); if (__cond) __compiletime_assert_42(); do { } while (0); } while (0);
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ptep_test_and_clear_young(struct vm_area_struct *vma,
|
|
unsigned long address,
|
|
pte_t *ptep)
|
|
{
|
|
pte_t pte = *ptep;
|
|
int r = 1;
|
|
if (!(((u32)((((pteval_t)(1)) << 1)) == ((((pteval_t)(1)) << 1)) ? ((pte)) & ((((pteval_t)(1)) << 1)) : !!(((pte)) & ((((pteval_t)(1)) << 1))))))
|
|
r = 0;
|
|
else
|
|
set_pte_at(vma->vm_mm, address, ptep, pte_mkold(pte));
|
|
return r;
|
|
}
|
|
# 78 "include/asm-generic/pgtable.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmdp_test_and_clear_young(struct vm_area_struct *vma,
|
|
unsigned long address,
|
|
pmd_t *pmdp)
|
|
{
|
|
do { bool __cond = !(!(1)); extern void __compiletime_assert_82(void) __attribute__((error("BUILD_BUG failed"))); if (__cond) __compiletime_assert_82(); do { } while (0); } while (0);
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
int ptep_clear_flush_young(struct vm_area_struct *vma,
|
|
unsigned long address, pte_t *ptep);
|
|
# 102 "include/asm-generic/pgtable.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmdp_clear_flush_young(struct vm_area_struct *vma,
|
|
unsigned long address, pmd_t *pmdp)
|
|
{
|
|
do { bool __cond = !(!(1)); extern void __compiletime_assert_105(void) __attribute__((error("BUILD_BUG failed"))); if (__cond) __compiletime_assert_105(); do { } while (0); } while (0);
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t ptep_get_and_clear(struct mm_struct *mm,
|
|
unsigned long address,
|
|
pte_t *ptep)
|
|
{
|
|
pte_t pte = *ptep;
|
|
processor.set_pte_ext(ptep,(0),0);
|
|
return pte;
|
|
}
|
|
# 147 "include/asm-generic/pgtable.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t ptep_get_and_clear_full(struct mm_struct *mm,
|
|
unsigned long address, pte_t *ptep,
|
|
int full)
|
|
{
|
|
pte_t pte;
|
|
pte = ptep_get_and_clear(mm, address, ptep);
|
|
return pte;
|
|
}
|
|
# 163 "include/asm-generic/pgtable.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pte_clear_not_present_full(struct mm_struct *mm,
|
|
unsigned long address,
|
|
pte_t *ptep,
|
|
int full)
|
|
{
|
|
processor.set_pte_ext(ptep,(0),0);
|
|
}
|
|
|
|
|
|
|
|
extern pte_t ptep_clear_flush(struct vm_area_struct *vma,
|
|
unsigned long address,
|
|
pte_t *ptep);
|
|
|
|
|
|
|
|
extern pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma,
|
|
unsigned long address,
|
|
pmd_t *pmdp);
|
|
|
|
|
|
|
|
struct mm_struct;
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptep_set_wrprotect(struct mm_struct *mm, unsigned long address, pte_t *ptep)
|
|
{
|
|
pte_t old_pte = *ptep;
|
|
set_pte_at(mm, address, ptep, pte_wrprotect(old_pte));
|
|
}
|
|
# 202 "include/asm-generic/pgtable.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pmdp_set_wrprotect(struct mm_struct *mm,
|
|
unsigned long address, pmd_t *pmdp)
|
|
{
|
|
do { bool __cond = !(!(1)); extern void __compiletime_assert_205(void) __attribute__((error("BUILD_BUG failed"))); if (__cond) __compiletime_assert_205(); do { } while (0); } while (0);
|
|
}
|
|
|
|
|
|
|
|
|
|
extern void pmdp_splitting_flush(struct vm_area_struct *vma,
|
|
unsigned long address, pmd_t *pmdp);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmdp_collapse_flush(struct vm_area_struct *vma,
|
|
unsigned long address,
|
|
pmd_t *pmdp)
|
|
{
|
|
do { bool __cond = !(!(1)); extern void __compiletime_assert_224(void) __attribute__((error("BUILD_BUG failed"))); if (__cond) __compiletime_assert_224(); do { } while (0); } while (0);
|
|
return *pmdp;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extern void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp,
|
|
pgtable_t pgtable);
|
|
|
|
|
|
|
|
extern pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp);
|
|
|
|
|
|
|
|
extern void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address,
|
|
pmd_t *pmdp);
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pte_same(pte_t pte_a, pte_t pte_b)
|
|
{
|
|
return (pte_a) == (pte_b);
|
|
}
|
|
# 259 "include/asm-generic/pgtable.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pte_unused(pte_t pte)
|
|
{
|
|
return 0;
|
|
}
|
|
# 272 "include/asm-generic/pgtable.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_same(pmd_t pmd_a, pmd_t pmd_b)
|
|
{
|
|
do { bool __cond = !(!(1)); extern void __compiletime_assert_274(void) __attribute__((error("BUILD_BUG failed"))); if (__cond) __compiletime_assert_274(); do { } while (0); } while (0);
|
|
return 0;
|
|
}
|
|
# 314 "include/asm-generic/pgtable.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)
|
|
{
|
|
if ((oldprot) == ((((oldprot) & ~((((pteval_t)(0x0f)) << 2))) | ((((pteval_t)(0x00)) << 2)))))
|
|
newprot = (((newprot) & ~((((pteval_t)(0x0f)) << 2))) | ((((pteval_t)(0x00)) << 2)));
|
|
if ((oldprot) == ((((oldprot) & ~((((pteval_t)(0x0f)) << 2))) | ((((pteval_t)(0x01)) << 2)))))
|
|
newprot = (((newprot) & ~((((pteval_t)(0x0f)) << 2))) | ((((pteval_t)(0x01)) << 2)));
|
|
if ((oldprot) == ((((oldprot) & ~((((pteval_t)(0x0f)) << 2))) | ((((pteval_t)(0x00)) << 2)))))
|
|
newprot = (((newprot) & ~((((pteval_t)(0x0f)) << 2))) | ((((pteval_t)(0x00)) << 2)));
|
|
return newprot;
|
|
}
|
|
# 356 "include/asm-generic/pgtable.h"
|
|
void pgd_clear_bad(pgd_t *);
|
|
void pud_clear_bad(pud_t *);
|
|
void pmd_clear_bad(pmd_t *);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pgd_none_or_clear_bad(pgd_t *pgd)
|
|
{
|
|
if (pgd_none(*pgd))
|
|
return 1;
|
|
if (__builtin_expect(!!(pgd_bad(*pgd)), 0)) {
|
|
pgd_clear_bad(pgd);
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pud_none_or_clear_bad(pud_t *pud)
|
|
{
|
|
if ((0))
|
|
return 1;
|
|
if (__builtin_expect(!!((0)), 0)) {
|
|
pud_clear_bad(pud);
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_none_or_clear_bad(pmd_t *pmd)
|
|
{
|
|
if ((!(*pmd)))
|
|
return 1;
|
|
if (__builtin_expect(!!(((*pmd) & 2)), 0)) {
|
|
pmd_clear_bad(pmd);
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t __ptep_modify_prot_start(struct mm_struct *mm,
|
|
unsigned long addr,
|
|
pte_t *ptep)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
return ptep_get_and_clear(mm, addr, ptep);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ptep_modify_prot_commit(struct mm_struct *mm,
|
|
unsigned long addr,
|
|
pte_t *ptep, pte_t pte)
|
|
{
|
|
|
|
|
|
|
|
|
|
set_pte_at(mm, addr, ptep, pte);
|
|
}
|
|
# 431 "include/asm-generic/pgtable.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t ptep_modify_prot_start(struct mm_struct *mm,
|
|
unsigned long addr,
|
|
pte_t *ptep)
|
|
{
|
|
return __ptep_modify_prot_start(mm, addr, ptep);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptep_modify_prot_commit(struct mm_struct *mm,
|
|
unsigned long addr,
|
|
pte_t *ptep, pte_t pte)
|
|
{
|
|
__ptep_modify_prot_commit(mm, addr, ptep, pte);
|
|
}
|
|
# 488 "include/asm-generic/pgtable.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pte_soft_dirty(pte_t pte)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_soft_dirty(pmd_t pmd)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_mksoft_dirty(pte_t pte)
|
|
{
|
|
return pte;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_mksoft_dirty(pmd_t pmd)
|
|
{
|
|
return pmd;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_clear_soft_dirty(pte_t pte)
|
|
{
|
|
return pte;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_clear_soft_dirty(pmd_t pmd)
|
|
{
|
|
return pmd;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_swp_mksoft_dirty(pte_t pte)
|
|
{
|
|
return pte;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pte_swp_soft_dirty(pte_t pte)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t pte_swp_clear_soft_dirty(pte_t pte)
|
|
{
|
|
return pte;
|
|
}
|
|
# 545 "include/asm-generic/pgtable.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int track_pfn_remap(struct vm_area_struct *vma, pgprot_t *prot,
|
|
unsigned long pfn, unsigned long addr,
|
|
unsigned long size)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int track_pfn_insert(struct vm_area_struct *vma, pgprot_t *prot,
|
|
unsigned long pfn)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int track_pfn_copy(struct vm_area_struct *vma)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void untrack_pfn(struct vm_area_struct *vma,
|
|
unsigned long pfn, unsigned long size)
|
|
{
|
|
}
|
|
# 602 "include/asm-generic/pgtable.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_zero_pfn(unsigned long pfn)
|
|
{
|
|
extern unsigned long zero_pfn;
|
|
return pfn == zero_pfn;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long my_zero_pfn(unsigned long addr)
|
|
{
|
|
extern unsigned long zero_pfn;
|
|
return zero_pfn;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_trans_huge(pmd_t pmd)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_trans_splitting(pmd_t pmd)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_write(pmd_t pmd)
|
|
{
|
|
do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/asm-generic/pgtable.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "629" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0);
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t pmd_read_atomic(pmd_t *pmdp)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
return *pmdp;
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_move_must_withdraw(spinlock_t *new_pmd_ptl,
|
|
spinlock_t *old_pmd_ptl)
|
|
{
|
|
|
|
|
|
|
|
|
|
return new_pmd_ptl != old_pmd_ptl;
|
|
}
|
|
# 680 "include/asm-generic/pgtable.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_none_or_trans_huge_or_clear_bad(pmd_t *pmd)
|
|
{
|
|
pmd_t pmdval = pmd_read_atomic(pmd);
|
|
# 700 "include/asm-generic/pgtable.h"
|
|
if ((!(pmdval)) || pmd_trans_huge(pmdval))
|
|
return 1;
|
|
if (__builtin_expect(!!(((pmdval) & 2)), 0)) {
|
|
pmd_clear_bad(pmd);
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
# 722 "include/asm-generic/pgtable.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_trans_unstable(pmd_t *pmd)
|
|
{
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
# 740 "include/asm-generic/pgtable.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pte_protnone(pte_t pte)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_protnone(pmd_t pmd)
|
|
{
|
|
return 0;
|
|
}
|
|
# 761 "include/asm-generic/pgtable.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pud_clear_huge(pud_t *pud)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_clear_huge(pmd_t *pmd)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pud_free_pmd_page(pud_t *pud)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_free_pte_page(pmd_t *pmd)
|
|
{
|
|
return 0;
|
|
}
|
|
# 349 "./arch/arm/include/asm/pgtable.h" 2
|
|
# 56 "include/linux/mm.h" 2
|
|
# 73 "include/linux/mm.h"
|
|
extern unsigned long sysctl_user_reserve_kbytes;
|
|
extern unsigned long sysctl_admin_reserve_kbytes;
|
|
|
|
extern int sysctl_overcommit_memory;
|
|
extern int sysctl_overcommit_ratio;
|
|
extern unsigned long sysctl_overcommit_kbytes;
|
|
|
|
extern int overcommit_ratio_handler(struct ctl_table *, int, void *,
|
|
size_t *, loff_t *);
|
|
extern int overcommit_kbytes_handler(struct ctl_table *, int, void *,
|
|
size_t *, loff_t *);
|
|
# 102 "include/linux/mm.h"
|
|
extern struct kmem_cache *vm_area_cachep;
|
|
# 213 "include/linux/mm.h"
|
|
extern pgprot_t protection_map[16];
|
|
# 233 "include/linux/mm.h"
|
|
struct vm_fault {
|
|
unsigned int flags;
|
|
gfp_t gfp_mask;
|
|
unsigned long pgoff;
|
|
void *virtual_address;
|
|
|
|
struct page *cow_page;
|
|
struct page *page;
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long max_pgoff;
|
|
|
|
pte_t *pte;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct vm_operations_struct {
|
|
void (*open)(struct vm_area_struct * area);
|
|
void (*close)(struct vm_area_struct * area);
|
|
int (*mremap)(struct vm_area_struct * area);
|
|
int (*fault)(struct vm_area_struct *vma, struct vm_fault *vmf);
|
|
int (*pmd_fault)(struct vm_area_struct *, unsigned long address,
|
|
pmd_t *, unsigned int flags);
|
|
void (*map_pages)(struct vm_area_struct *vma, struct vm_fault *vmf);
|
|
|
|
|
|
|
|
int (*page_mkwrite)(struct vm_area_struct *vma, struct vm_fault *vmf);
|
|
|
|
|
|
int (*pfn_mkwrite)(struct vm_area_struct *vma, struct vm_fault *vmf);
|
|
|
|
|
|
|
|
|
|
int (*access)(struct vm_area_struct *vma, unsigned long addr,
|
|
void *buf, int len, int write);
|
|
|
|
|
|
|
|
|
|
const char *(*name)(struct vm_area_struct *vma);
|
|
# 311 "include/linux/mm.h"
|
|
struct page *(*find_special_page)(struct vm_area_struct *vma,
|
|
unsigned long addr);
|
|
};
|
|
|
|
struct mmu_gather;
|
|
struct inode;
|
|
# 325 "include/linux/mm.h"
|
|
# 1 "include/linux/page-flags.h" 1
|
|
# 74 "include/linux/page-flags.h"
|
|
enum pageflags {
|
|
PG_locked,
|
|
PG_error,
|
|
PG_referenced,
|
|
PG_uptodate,
|
|
PG_dirty,
|
|
PG_lru,
|
|
PG_active,
|
|
PG_slab,
|
|
PG_owner_priv_1,
|
|
PG_arch_1,
|
|
PG_reserved,
|
|
PG_private,
|
|
PG_private_2,
|
|
PG_writeback,
|
|
PG_head,
|
|
PG_swapcache,
|
|
PG_mappedtodisk,
|
|
PG_reclaim,
|
|
PG_swapbacked,
|
|
PG_unevictable,
|
|
|
|
PG_mlocked,
|
|
# 111 "include/linux/page-flags.h"
|
|
__NR_PAGEFLAGS,
|
|
|
|
|
|
PG_checked = PG_owner_priv_1,
|
|
|
|
|
|
|
|
|
|
|
|
PG_fscache = PG_private_2,
|
|
|
|
|
|
|
|
PG_pinned = PG_owner_priv_1,
|
|
|
|
PG_savepinned = PG_dirty,
|
|
|
|
PG_foreign = PG_owner_priv_1,
|
|
|
|
|
|
PG_slob_free = PG_private,
|
|
};
|
|
# 207 "include/linux/page-flags.h"
|
|
struct page;
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageLocked(const struct page *page) { return test_bit(PG_locked, &page->flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageError(const struct page *page) { return test_bit(PG_error, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageError(struct page *page) { _set_bit(PG_error,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageError(struct page *page) { _clear_bit(PG_error,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageError(struct page *page) { return _test_and_clear_bit(PG_error,&page->flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageReferenced(const struct page *page) { return test_bit(PG_referenced, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageReferenced(struct page *page) { _set_bit(PG_referenced,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageReferenced(struct page *page) { _clear_bit(PG_referenced,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageReferenced(struct page *page) { return _test_and_clear_bit(PG_referenced,&page->flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageReferenced(struct page *page) { __set_bit(PG_referenced, &page->flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageDirty(const struct page *page) { return test_bit(PG_dirty, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageDirty(struct page *page) { _set_bit(PG_dirty,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageDirty(struct page *page) { _clear_bit(PG_dirty,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestSetPageDirty(struct page *page) { return _test_and_set_bit(PG_dirty,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageDirty(struct page *page) { return _test_and_clear_bit(PG_dirty,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageDirty(struct page *page) { __clear_bit(PG_dirty, &page->flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageLRU(const struct page *page) { return test_bit(PG_lru, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageLRU(struct page *page) { _set_bit(PG_lru,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageLRU(struct page *page) { _clear_bit(PG_lru,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageLRU(struct page *page) { __clear_bit(PG_lru, &page->flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageActive(const struct page *page) { return test_bit(PG_active, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageActive(struct page *page) { _set_bit(PG_active,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageActive(struct page *page) { _clear_bit(PG_active,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageActive(struct page *page) { __clear_bit(PG_active, &page->flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageActive(struct page *page) { return _test_and_clear_bit(PG_active,&page->flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageSlab(const struct page *page) { return test_bit(PG_slab, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageSlab(struct page *page) { __set_bit(PG_slab, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageSlab(struct page *page) { __clear_bit(PG_slab, &page->flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageChecked(const struct page *page) { return test_bit(PG_checked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageChecked(struct page *page) { _set_bit(PG_checked,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageChecked(struct page *page) { _clear_bit(PG_checked,&page->flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PagePinned(const struct page *page) { return test_bit(PG_pinned, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPagePinned(struct page *page) { _set_bit(PG_pinned,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPagePinned(struct page *page) { _clear_bit(PG_pinned,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestSetPagePinned(struct page *page) { return _test_and_set_bit(PG_pinned,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPagePinned(struct page *page) { return _test_and_clear_bit(PG_pinned,&page->flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageSavePinned(const struct page *page) { return test_bit(PG_savepinned, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageSavePinned(struct page *page) { _set_bit(PG_savepinned,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageSavePinned(struct page *page) { _clear_bit(PG_savepinned,&page->flags); };
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageForeign(const struct page *page) { return test_bit(PG_foreign, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageForeign(struct page *page) { _set_bit(PG_foreign,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageForeign(struct page *page) { _clear_bit(PG_foreign,&page->flags); };
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageReserved(const struct page *page) { return test_bit(PG_reserved, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageReserved(struct page *page) { _set_bit(PG_reserved,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageReserved(struct page *page) { _clear_bit(PG_reserved,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageReserved(struct page *page) { __clear_bit(PG_reserved, &page->flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageSwapBacked(const struct page *page) { return test_bit(PG_swapbacked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageSwapBacked(struct page *page) { _set_bit(PG_swapbacked,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageSwapBacked(struct page *page) { _clear_bit(PG_swapbacked,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageSwapBacked(struct page *page) { __clear_bit(PG_swapbacked, &page->flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageSwapBacked(struct page *page) { __set_bit(PG_swapbacked, &page->flags); }
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageSlobFree(const struct page *page) { return test_bit(PG_slob_free, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageSlobFree(struct page *page) { __set_bit(PG_slob_free, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageSlobFree(struct page *page) { __clear_bit(PG_slob_free, &page->flags); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PagePrivate(const struct page *page) { return test_bit(PG_private, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPagePrivate(struct page *page) { _set_bit(PG_private,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPagePrivate(struct page *page) { _clear_bit(PG_private,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPagePrivate(struct page *page) { __set_bit(PG_private, &page->flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPagePrivate(struct page *page) { __clear_bit(PG_private, &page->flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PagePrivate2(const struct page *page) { return test_bit(PG_private_2, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPagePrivate2(struct page *page) { _set_bit(PG_private_2,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPagePrivate2(struct page *page) { _clear_bit(PG_private_2,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestSetPagePrivate2(struct page *page) { return _test_and_set_bit(PG_private_2,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPagePrivate2(struct page *page) { return _test_and_clear_bit(PG_private_2,&page->flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageOwnerPriv1(const struct page *page) { return test_bit(PG_owner_priv_1, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageOwnerPriv1(struct page *page) { _set_bit(PG_owner_priv_1,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageOwnerPriv1(struct page *page) { _clear_bit(PG_owner_priv_1,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageOwnerPriv1(struct page *page) { return _test_and_clear_bit(PG_owner_priv_1,&page->flags); }
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageWriteback(const struct page *page) { return test_bit(PG_writeback, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestSetPageWriteback(struct page *page) { return _test_and_set_bit(PG_writeback,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageWriteback(struct page *page) { return _test_and_clear_bit(PG_writeback,&page->flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageMappedToDisk(const struct page *page) { return test_bit(PG_mappedtodisk, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageMappedToDisk(struct page *page) { _set_bit(PG_mappedtodisk,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageMappedToDisk(struct page *page) { _clear_bit(PG_mappedtodisk,&page->flags); }
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageReclaim(const struct page *page) { return test_bit(PG_reclaim, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageReclaim(struct page *page) { _set_bit(PG_reclaim,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageReclaim(struct page *page) { _clear_bit(PG_reclaim,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageReclaim(struct page *page) { return _test_and_clear_bit(PG_reclaim,&page->flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageReadahead(const struct page *page) { return test_bit(PG_reclaim, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageReadahead(struct page *page) { _set_bit(PG_reclaim,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageReadahead(struct page *page) { _clear_bit(PG_reclaim,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageReadahead(struct page *page) { return _test_and_clear_bit(PG_reclaim,&page->flags); }
|
|
# 262 "include/linux/page-flags.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageSwapCache(const struct page *page) { return 0; } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageSwapCache(struct page *page) { } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageSwapCache(struct page *page) { }
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageUnevictable(const struct page *page) { return test_bit(PG_unevictable, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageUnevictable(struct page *page) { _set_bit(PG_unevictable,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageUnevictable(struct page *page) { _clear_bit(PG_unevictable,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageUnevictable(struct page *page) { __clear_bit(PG_unevictable, &page->flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageUnevictable(struct page *page) { return _test_and_clear_bit(PG_unevictable,&page->flags); }
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageMlocked(const struct page *page) { return test_bit(PG_mlocked, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageMlocked(struct page *page) { _set_bit(PG_mlocked,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageMlocked(struct page *page) { _clear_bit(PG_mlocked,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageMlocked(struct page *page) { __clear_bit(PG_mlocked, &page->flags); }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestSetPageMlocked(struct page *page) { return _test_and_set_bit(PG_mlocked,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int TestClearPageMlocked(struct page *page) { return _test_and_clear_bit(PG_mlocked,&page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __TestClearPageMlocked(struct page *page) { return __test_and_clear_bit(PG_mlocked, &page->flags); }
|
|
# 279 "include/linux/page-flags.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageUncached(const struct page *page) { return 0; } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageUncached(struct page *page) { } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageUncached(struct page *page) { }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageHWPoison(const struct page *page) { return 0; } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageHWPoison(struct page *page) { } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageHWPoison(struct page *page) { }
|
|
# 318 "include/linux/page-flags.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageAnon(struct page *page)
|
|
{
|
|
return ((unsigned long)page->mapping & 1) != 0;
|
|
}
|
|
# 336 "include/linux/page-flags.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageKsm(const struct page *page) { return 0; }
|
|
|
|
|
|
u64 stable_page_flags(struct page *page);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageUptodate(struct page *page)
|
|
{
|
|
int ret = test_bit(PG_uptodate, &(page)->flags);
|
|
# 353 "include/linux/page-flags.h"
|
|
if (ret)
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
|
|
return ret;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageUptodate(struct page *page)
|
|
{
|
|
__asm__ __volatile__ ("dmb " "ishst" : : : "memory");
|
|
__set_bit(PG_uptodate, &(page)->flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageUptodate(struct page *page)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
__asm__ __volatile__ ("dmb " "ishst" : : : "memory");
|
|
_set_bit(PG_uptodate,&(page)->flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageUptodate(struct page *page) { _clear_bit(PG_uptodate,&page->flags); }
|
|
|
|
int test_clear_page_writeback(struct page *page);
|
|
int __test_set_page_writeback(struct page *page, bool keep_write);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_page_writeback(struct page *page)
|
|
{
|
|
__test_set_page_writeback(page, false);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_page_writeback_keepwrite(struct page *page)
|
|
{
|
|
__test_set_page_writeback(page, true);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageHead(const struct page *page) { return test_bit(PG_head, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageHead(struct page *page) { __set_bit(PG_head, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageHead(struct page *page) { __clear_bit(PG_head, &page->flags); } static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageHead(struct page *page) { _clear_bit(PG_head,&page->flags); }
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageTail(struct page *page)
|
|
{
|
|
return ({ union { typeof(page->compound_head) __val; char __c[1]; } __u; if (1) __read_once_size(&(page->compound_head), __u.__c, sizeof(page->compound_head)); else __read_once_size_nocheck(&(page->compound_head), __u.__c, sizeof(page->compound_head)); __u.__val; }) & 1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_compound_head(struct page *page, struct page *head)
|
|
{
|
|
({ union { typeof(page->compound_head) __val; char __c[1]; } __u = { .__val = ( typeof(page->compound_head)) ((unsigned long)head + 1) }; __write_once_size(&(page->compound_head), __u.__c, sizeof(page->compound_head)); __u.__val; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_compound_head(struct page *page)
|
|
{
|
|
({ union { typeof(page->compound_head) __val; char __c[1]; } __u = { .__val = ( typeof(page->compound_head)) (0) }; __write_once_size(&(page->compound_head), __u.__c, sizeof(page->compound_head)); __u.__val; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *compound_head(struct page *page)
|
|
{
|
|
unsigned long head = ({ union { typeof(page->compound_head) __val; char __c[1]; } __u; if (1) __read_once_size(&(page->compound_head), __u.__c, sizeof(page->compound_head)); else __read_once_size_nocheck(&(page->compound_head), __u.__c, sizeof(page->compound_head)); __u.__val; });
|
|
|
|
if (__builtin_expect(!!(head & 1), 0))
|
|
return (struct page *) (head - 1);
|
|
return page;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageCompound(struct page *page)
|
|
{
|
|
return PageHead(page) || PageTail(page);
|
|
|
|
}
|
|
# 442 "include/linux/page-flags.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageHuge(const struct page *page) { return 0; }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageHeadHuge(const struct page *page) { return 0; }
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool page_huge_active(struct page *page)
|
|
{
|
|
return 0;
|
|
}
|
|
# 489 "include/linux/page-flags.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageTransHuge(struct page *page)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageTransCompound(struct page *page)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageTransTail(struct page *page)
|
|
{
|
|
return 0;
|
|
}
|
|
# 516 "include/linux/page-flags.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageBuddy(struct page *page)
|
|
{
|
|
return ({ union { typeof((&page->_mapcount)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&page->_mapcount)->counter), __u.__c, sizeof((&page->_mapcount)->counter)); else __read_once_size_nocheck(&((&page->_mapcount)->counter), __u.__c, sizeof((&page->_mapcount)->counter)); __u.__val; }) == (-128);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageBuddy(struct page *page)
|
|
{
|
|
((void)(sizeof(( long)(({ union { typeof((&page->_mapcount)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&page->_mapcount)->counter), __u.__c, sizeof((&page->_mapcount)->counter)); else __read_once_size_nocheck(&((&page->_mapcount)->counter), __u.__c, sizeof((&page->_mapcount)->counter)); __u.__val; }) != -1))));
|
|
({ union { typeof(((&page->_mapcount)->counter)) __val; char __c[1]; } __u = { .__val = ( typeof(((&page->_mapcount)->counter))) (((-128))) }; __write_once_size(&(((&page->_mapcount)->counter)), __u.__c, sizeof(((&page->_mapcount)->counter))); __u.__val; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageBuddy(struct page *page)
|
|
{
|
|
((void)(sizeof(( long)(!PageBuddy(page)))));
|
|
({ union { typeof(((&page->_mapcount)->counter)) __val; char __c[1]; } __u = { .__val = ( typeof(((&page->_mapcount)->counter))) ((-1)) }; __write_once_size(&(((&page->_mapcount)->counter)), __u.__c, sizeof(((&page->_mapcount)->counter))); __u.__val; });
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageBalloon(struct page *page)
|
|
{
|
|
return ({ union { typeof((&page->_mapcount)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&page->_mapcount)->counter), __u.__c, sizeof((&page->_mapcount)->counter)); else __read_once_size_nocheck(&((&page->_mapcount)->counter), __u.__c, sizeof((&page->_mapcount)->counter)); __u.__val; }) == (-256);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __SetPageBalloon(struct page *page)
|
|
{
|
|
((void)(sizeof(( long)(({ union { typeof((&page->_mapcount)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&page->_mapcount)->counter), __u.__c, sizeof((&page->_mapcount)->counter)); else __read_once_size_nocheck(&((&page->_mapcount)->counter), __u.__c, sizeof((&page->_mapcount)->counter)); __u.__val; }) != -1))));
|
|
({ union { typeof(((&page->_mapcount)->counter)) __val; char __c[1]; } __u = { .__val = ( typeof(((&page->_mapcount)->counter))) (((-256))) }; __write_once_size(&(((&page->_mapcount)->counter)), __u.__c, sizeof(((&page->_mapcount)->counter))); __u.__val; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageBalloon(struct page *page)
|
|
{
|
|
((void)(sizeof(( long)(!PageBalloon(page)))));
|
|
({ union { typeof(((&page->_mapcount)->counter)) __val; char __c[1]; } __u = { .__val = ( typeof(((&page->_mapcount)->counter))) ((-1)) }; __write_once_size(&(((&page->_mapcount)->counter)), __u.__c, sizeof(((&page->_mapcount)->counter))); __u.__val; });
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int PageSlabPfmemalloc(struct page *page)
|
|
{
|
|
((void)(sizeof(( long)(!PageSlab(page)))));
|
|
return PageActive(page);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void SetPageSlabPfmemalloc(struct page *page)
|
|
{
|
|
((void)(sizeof(( long)(!PageSlab(page)))));
|
|
SetPageActive(page);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ClearPageSlabPfmemalloc(struct page *page)
|
|
{
|
|
((void)(sizeof(( long)(!PageSlab(page)))));
|
|
__ClearPageActive(page);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ClearPageSlabPfmemalloc(struct page *page)
|
|
{
|
|
((void)(sizeof(( long)(!PageSlab(page)))));
|
|
ClearPageActive(page);
|
|
}
|
|
# 624 "include/linux/page-flags.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_has_private(struct page *page)
|
|
{
|
|
return !!(page->flags & (1 << PG_private | 1 << PG_private_2));
|
|
}
|
|
# 326 "include/linux/mm.h" 2
|
|
# 1 "include/linux/huge_mm.h" 1
|
|
|
|
|
|
|
|
extern int do_huge_pmd_anonymous_page(struct mm_struct *mm,
|
|
struct vm_area_struct *vma,
|
|
unsigned long address, pmd_t *pmd,
|
|
unsigned int flags);
|
|
extern int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm,
|
|
pmd_t *dst_pmd, pmd_t *src_pmd, unsigned long addr,
|
|
struct vm_area_struct *vma);
|
|
extern void huge_pmd_set_accessed(struct mm_struct *mm,
|
|
struct vm_area_struct *vma,
|
|
unsigned long address, pmd_t *pmd,
|
|
pmd_t orig_pmd, int dirty);
|
|
extern int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
|
|
unsigned long address, pmd_t *pmd,
|
|
pmd_t orig_pmd);
|
|
extern struct page *follow_trans_huge_pmd(struct vm_area_struct *vma,
|
|
unsigned long addr,
|
|
pmd_t *pmd,
|
|
unsigned int flags);
|
|
extern int zap_huge_pmd(struct mmu_gather *tlb,
|
|
struct vm_area_struct *vma,
|
|
pmd_t *pmd, unsigned long addr);
|
|
extern int mincore_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
|
|
unsigned long addr, unsigned long end,
|
|
unsigned char *vec);
|
|
extern int move_huge_pmd(struct vm_area_struct *vma,
|
|
struct vm_area_struct *new_vma,
|
|
unsigned long old_addr,
|
|
unsigned long new_addr, unsigned long old_end,
|
|
pmd_t *old_pmd, pmd_t *new_pmd);
|
|
extern int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
|
|
unsigned long addr, pgprot_t newprot,
|
|
int prot_numa);
|
|
int vmf_insert_pfn_pmd(struct vm_area_struct *, unsigned long addr, pmd_t *,
|
|
unsigned long pfn, bool write);
|
|
|
|
enum transparent_hugepage_flag {
|
|
TRANSPARENT_HUGEPAGE_FLAG,
|
|
TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG,
|
|
TRANSPARENT_HUGEPAGE_DEFRAG_FLAG,
|
|
TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG,
|
|
TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG,
|
|
TRANSPARENT_HUGEPAGE_USE_ZERO_PAGE_FLAG,
|
|
|
|
|
|
|
|
};
|
|
|
|
enum page_check_address_pmd_flag {
|
|
PAGE_CHECK_ADDRESS_PMD_FLAG,
|
|
PAGE_CHECK_ADDRESS_PMD_NOTSPLITTING_FLAG,
|
|
PAGE_CHECK_ADDRESS_PMD_SPLITTING_FLAG,
|
|
};
|
|
extern pmd_t *page_check_address_pmd(struct page *page,
|
|
struct mm_struct *mm,
|
|
unsigned long address,
|
|
enum page_check_address_pmd_flag flag,
|
|
spinlock_t **ptl);
|
|
# 177 "include/linux/huge_mm.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
split_huge_page_to_list(struct page *page, struct list_head *list)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int split_huge_page(struct page *page)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hugepage_madvise(struct vm_area_struct *vma,
|
|
unsigned long *vm_flags, int advice)
|
|
{
|
|
do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/huge_mm.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "195" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0);
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void vma_adjust_trans_huge(struct vm_area_struct *vma,
|
|
unsigned long start,
|
|
unsigned long end,
|
|
long adjust_next)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pmd_trans_huge_lock(pmd_t *pmd, struct vm_area_struct *vma,
|
|
spinlock_t **ptl)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma,
|
|
unsigned long addr, pmd_t pmd, pmd_t *pmdp)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_huge_zero_page(struct page *page)
|
|
{
|
|
return false;
|
|
}
|
|
# 327 "include/linux/mm.h" 2
|
|
# 344 "include/linux/mm.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int put_page_testzero(struct page *page)
|
|
{
|
|
((void)(sizeof(( long)(({ union { typeof((&page->_count)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&page->_count)->counter), __u.__c, sizeof((&page->_count)->counter)); else __read_once_size_nocheck(&((&page->_count)->counter), __u.__c, sizeof((&page->_count)->counter)); __u.__val; }) == 0))));
|
|
return (({ typeof(atomic_sub_return_relaxed(1, &page->_count)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_sub_return_relaxed(1, &page->_count); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) == 0);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_page_unless_zero(struct page *page)
|
|
{
|
|
return atomic_add_unless((&page->_count), 1, 0);
|
|
}
|
|
|
|
extern int page_is_ram(unsigned long pfn);
|
|
|
|
enum {
|
|
REGION_INTERSECTS,
|
|
REGION_DISJOINT,
|
|
REGION_MIXED,
|
|
};
|
|
|
|
int region_intersects(resource_size_t offset, size_t size, const char *type);
|
|
|
|
|
|
struct page *vmalloc_to_page(const void *addr);
|
|
unsigned long vmalloc_to_pfn(const void *addr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_vmalloc_addr(const void *x)
|
|
{
|
|
|
|
unsigned long addr = (unsigned long)x;
|
|
|
|
return addr >= (((unsigned long)high_memory + (8*1024*1024)) & ~((8*1024*1024)-1)) && addr < 0xff800000UL;
|
|
|
|
|
|
|
|
}
|
|
|
|
extern int is_vmalloc_or_module_addr(const void *x);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern void kvfree(const void *addr);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void compound_lock(struct page *page)
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void compound_unlock(struct page *page)
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long compound_lock_irqsave(struct page *page)
|
|
{
|
|
unsigned long flags = flags;
|
|
|
|
|
|
|
|
|
|
return flags;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void compound_unlock_irqrestore(struct page *page,
|
|
unsigned long flags)
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void page_mapcount_reset(struct page *page)
|
|
{
|
|
({ union { typeof(((&(page)->_mapcount)->counter)) __val; char __c[1]; } __u = { .__val = ( typeof(((&(page)->_mapcount)->counter))) ((-1)) }; __write_once_size(&(((&(page)->_mapcount)->counter)), __u.__c, sizeof(((&(page)->_mapcount)->counter))); __u.__val; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_mapcount(struct page *page)
|
|
{
|
|
((void)(sizeof(( long)(PageSlab(page)))));
|
|
return ({ union { typeof((&page->_mapcount)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&page->_mapcount)->counter), __u.__c, sizeof((&page->_mapcount)->counter)); else __read_once_size_nocheck(&((&page->_mapcount)->counter), __u.__c, sizeof((&page->_mapcount)->counter)); __u.__val; }) + 1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_count(struct page *page)
|
|
{
|
|
return ({ union { typeof((&compound_head(page)->_count)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&compound_head(page)->_count)->counter), __u.__c, sizeof((&compound_head(page)->_count)->counter)); else __read_once_size_nocheck(&((&compound_head(page)->_count)->counter), __u.__c, sizeof((&compound_head(page)->_count)->counter)); __u.__val; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __compound_tail_refcounted(struct page *page)
|
|
{
|
|
return PageAnon(page) && !PageSlab(page) && !PageHeadHuge(page);
|
|
}
|
|
# 471 "include/linux/mm.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool compound_tail_refcounted(struct page *page)
|
|
{
|
|
((void)(sizeof(( long)(!PageHead(page)))));
|
|
return __compound_tail_refcounted(page);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void get_huge_page_tail(struct page *page)
|
|
{
|
|
|
|
|
|
|
|
((void)(sizeof(( long)(!PageTail(page)))));
|
|
((void)(sizeof(( long)(page_mapcount(page) < 0))));
|
|
((void)(sizeof(( long)(({ union { typeof((&page->_count)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&page->_count)->counter), __u.__c, sizeof((&page->_count)->counter)); else __read_once_size_nocheck(&((&page->_count)->counter), __u.__c, sizeof((&page->_count)->counter)); __u.__val; }) != 0))));
|
|
if (compound_tail_refcounted(compound_head(page)))
|
|
atomic_add(1, &page->_mapcount);
|
|
}
|
|
|
|
extern bool __get_page_tail(struct page *page);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void get_page(struct page *page)
|
|
{
|
|
if (__builtin_expect(!!(PageTail(page)), 0))
|
|
if (__builtin_expect(!!(__get_page_tail(page)), 1))
|
|
return;
|
|
|
|
|
|
|
|
|
|
((void)(sizeof(( long)(({ union { typeof((&page->_count)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&page->_count)->counter), __u.__c, sizeof((&page->_count)->counter)); else __read_once_size_nocheck(&((&page->_count)->counter), __u.__c, sizeof((&page->_count)->counter)); __u.__val; }) <= 0))));
|
|
atomic_add(1, &page->_count);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *virt_to_head_page(const void *x)
|
|
{
|
|
struct page *page = (mem_map + ((((((unsigned long)(x) - (0xC0000000UL)) >> 12) + (__pv_phys_pfn_offset))) - (__pv_phys_pfn_offset)));
|
|
|
|
return compound_head(page);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_page_count(struct page *page)
|
|
{
|
|
({ union { typeof(((&page->_count)->counter)) __val; char __c[1]; } __u = { .__val = ( typeof(((&page->_count)->counter))) ((1)) }; __write_once_size(&(((&page->_count)->counter)), __u.__c, sizeof(((&page->_count)->counter))); __u.__val; });
|
|
}
|
|
|
|
void put_page(struct page *page);
|
|
void put_pages_list(struct list_head *pages);
|
|
|
|
void split_page(struct page *page, unsigned int order);
|
|
int split_free_page(struct page *page);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef void compound_page_dtor(struct page *);
|
|
|
|
|
|
enum compound_dtor_id {
|
|
NULL_COMPOUND_DTOR,
|
|
COMPOUND_PAGE_DTOR,
|
|
|
|
|
|
|
|
NR_COMPOUND_DTORS,
|
|
};
|
|
extern compound_page_dtor * const compound_page_dtors[];
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_compound_page_dtor(struct page *page,
|
|
enum compound_dtor_id compound_dtor)
|
|
{
|
|
((void)(sizeof(( long)(compound_dtor >= NR_COMPOUND_DTORS))));
|
|
page[1].compound_dtor = compound_dtor;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) compound_page_dtor *get_compound_page_dtor(struct page *page)
|
|
{
|
|
((void)(sizeof(( long)(page[1].compound_dtor >= NR_COMPOUND_DTORS))));
|
|
return compound_page_dtors[page[1].compound_dtor];
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int compound_order(struct page *page)
|
|
{
|
|
if (!PageHead(page))
|
|
return 0;
|
|
return page[1].compound_order;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_compound_order(struct page *page, unsigned int order)
|
|
{
|
|
page[1].compound_order = order;
|
|
}
|
|
# 576 "include/linux/mm.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma)
|
|
{
|
|
if (__builtin_expect(!!(vma->vm_flags & 0x00000002), 1))
|
|
pte = pte_mkwrite(pte);
|
|
return pte;
|
|
}
|
|
|
|
void do_set_pte(struct vm_area_struct *vma, unsigned long address,
|
|
struct page *page, pte_t *pte, bool write, bool anon);
|
|
# 691 "include/linux/mm.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) enum zone_type page_zonenum(const struct page *page)
|
|
{
|
|
return (page->flags >> (((((sizeof(unsigned long)*8) - 0) - 0) - 2) * (2 != 0))) & ((1UL << 2) - 1);
|
|
}
|
|
# 708 "include/linux/mm.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_zone_id(struct page *page)
|
|
{
|
|
return (page->flags >> ((((((sizeof(unsigned long)*8) - 0) - 0) < ((((sizeof(unsigned long)*8) - 0) - 0) - 2))? (((sizeof(unsigned long)*8) - 0) - 0) : ((((sizeof(unsigned long)*8) - 0) - 0) - 2)) * ((0 + 2) != 0))) & ((1UL << (0 + 2)) - 1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int zone_to_nid(struct zone *zone)
|
|
{
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_to_nid(const struct page *page)
|
|
{
|
|
return (page->flags >> ((((sizeof(unsigned long)*8) - 0) - 0) * (0 != 0))) & ((1UL << 0) - 1);
|
|
}
|
|
# 799 "include/linux/mm.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_cpupid_xchg_last(struct page *page, int cpupid)
|
|
{
|
|
return page_to_nid(page);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_cpupid_last(struct page *page)
|
|
{
|
|
return page_to_nid(page);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpupid_to_nid(int cpupid)
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpupid_to_pid(int cpupid)
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpupid_to_cpu(int cpupid)
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cpu_pid_to_cpupid(int nid, int pid)
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool cpupid_pid_unset(int cpupid)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void page_cpupid_reset_last(struct page *page)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool cpupid_match_pid(struct task_struct *task, int cpupid)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct zone *page_zone(const struct page *page)
|
|
{
|
|
return &(&contig_page_data)->node_zones[page_zonenum(page)];
|
|
}
|
|
# 862 "include/linux/mm.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_page_zone(struct page *page, enum zone_type zone)
|
|
{
|
|
page->flags &= ~(((1UL << 2) - 1) << (((((sizeof(unsigned long)*8) - 0) - 0) - 2) * (2 != 0)));
|
|
page->flags |= (zone & ((1UL << 2) - 1)) << (((((sizeof(unsigned long)*8) - 0) - 0) - 2) * (2 != 0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_page_node(struct page *page, unsigned long node)
|
|
{
|
|
page->flags &= ~(((1UL << 0) - 1) << ((((sizeof(unsigned long)*8) - 0) - 0) * (0 != 0)));
|
|
page->flags |= (node & ((1UL << 0) - 1)) << ((((sizeof(unsigned long)*8) - 0) - 0) * (0 != 0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_page_links(struct page *page, enum zone_type zone,
|
|
unsigned long node, unsigned long pfn)
|
|
{
|
|
set_page_zone(page, zone);
|
|
set_page_node(page, node);
|
|
|
|
|
|
|
|
}
|
|
# 895 "include/linux/mm.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct mem_cgroup *page_memcg(struct page *page)
|
|
{
|
|
return ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_page_memcg(struct page *page, struct mem_cgroup *memcg)
|
|
{
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/vmstat.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/mm.h" 1
|
|
# 7 "include/linux/vmstat.h" 2
|
|
|
|
# 1 "include/linux/vm_event_item.h" 1
|
|
# 24 "include/linux/vm_event_item.h"
|
|
enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
|
|
PGALLOC_NORMAL, PGALLOC_HIGH, PGALLOC_MOVABLE,
|
|
PGFREE, PGACTIVATE, PGDEACTIVATE,
|
|
PGFAULT, PGMAJFAULT,
|
|
PGREFILL_NORMAL, PGREFILL_HIGH, PGREFILL_MOVABLE,
|
|
PGSTEAL_KSWAPD_NORMAL, PGSTEAL_KSWAPD_HIGH, PGSTEAL_KSWAPD_MOVABLE,
|
|
PGSTEAL_DIRECT_NORMAL, PGSTEAL_DIRECT_HIGH, PGSTEAL_DIRECT_MOVABLE,
|
|
PGSCAN_KSWAPD_NORMAL, PGSCAN_KSWAPD_HIGH, PGSCAN_KSWAPD_MOVABLE,
|
|
PGSCAN_DIRECT_NORMAL, PGSCAN_DIRECT_HIGH, PGSCAN_DIRECT_MOVABLE,
|
|
PGSCAN_DIRECT_THROTTLE,
|
|
|
|
|
|
|
|
PGINODESTEAL, SLABS_SCANNED, KSWAPD_INODESTEAL,
|
|
KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY,
|
|
PAGEOUTRUN, ALLOCSTALL, PGROTATED,
|
|
DROP_PAGECACHE, DROP_SLAB,
|
|
# 49 "include/linux/vm_event_item.h"
|
|
PGMIGRATE_SUCCESS, PGMIGRATE_FAIL,
|
|
|
|
|
|
COMPACTMIGRATE_SCANNED, COMPACTFREE_SCANNED,
|
|
COMPACTISOLATED,
|
|
COMPACTSTALL, COMPACTFAIL, COMPACTSUCCESS,
|
|
|
|
|
|
|
|
|
|
UNEVICTABLE_PGCULLED,
|
|
UNEVICTABLE_PGSCANNED,
|
|
UNEVICTABLE_PGRESCUED,
|
|
UNEVICTABLE_PGMLOCKED,
|
|
UNEVICTABLE_PGMUNLOCKED,
|
|
UNEVICTABLE_PGCLEARED,
|
|
UNEVICTABLE_PGSTRANDED,
|
|
# 93 "include/linux/vm_event_item.h"
|
|
NR_VM_EVENT_ITEMS
|
|
};
|
|
# 9 "include/linux/vmstat.h" 2
|
|
|
|
|
|
extern int sysctl_stat_interval;
|
|
# 24 "include/linux/vmstat.h"
|
|
struct vm_event_state {
|
|
unsigned long event[NR_VM_EVENT_ITEMS];
|
|
};
|
|
|
|
extern __attribute__((section(".data..percpu" ""))) __typeof__(struct vm_event_state) vm_event_states;
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __count_vm_event(enum vm_event_item item)
|
|
{
|
|
do { do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); switch(sizeof(vm_event_states.event[item])) { case 1: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__my_cpu_offset()))); }); }) += 1; } while (0);break; case 2: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__my_cpu_offset()))); }); }) += 1; } while (0);break; case 4: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__my_cpu_offset()))); }); }) += 1; } while (0);break; case 8: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__my_cpu_offset()))); }); }) += 1; } while (0);break; default: __bad_size_call_parameter();break; } } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void count_vm_event(enum vm_event_item item)
|
|
{
|
|
do { do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); switch(sizeof(vm_event_states.event[item])) { case 1: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__my_cpu_offset()))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 2: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__my_cpu_offset()))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 4: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__my_cpu_offset()))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 8: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__my_cpu_offset()))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; default: __bad_size_call_parameter();break; } } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __count_vm_events(enum vm_event_item item, long delta)
|
|
{
|
|
do { do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); switch(sizeof(vm_event_states.event[item])) { case 1: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__my_cpu_offset()))); }); }) += delta; } while (0);break; case 2: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__my_cpu_offset()))); }); }) += delta; } while (0);break; case 4: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__my_cpu_offset()))); }); }) += delta; } while (0);break; case 8: do { *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__my_cpu_offset()))); }); }) += delta; } while (0);break; default: __bad_size_call_parameter();break; } } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void count_vm_events(enum vm_event_item item, long delta)
|
|
{
|
|
do { do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); switch(sizeof(vm_event_states.event[item])) { case 1: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__my_cpu_offset()))); }); }) += delta; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 2: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__my_cpu_offset()))); }); }) += delta; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 4: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__my_cpu_offset()))); }); }) += delta; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 8: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(vm_event_states.event[item])) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))); (typeof((typeof(*(&(vm_event_states.event[item]))) *)(&(vm_event_states.event[item])))) (__ptr + ((__my_cpu_offset()))); }); }) += delta; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; default: __bad_size_call_parameter();break; } } while (0);
|
|
}
|
|
|
|
extern void all_vm_events(unsigned long *);
|
|
|
|
extern void vm_events_fold_cpu(int cpu);
|
|
# 111 "include/linux/vmstat.h"
|
|
extern atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void zone_page_state_add(long x, struct zone *zone,
|
|
enum zone_stat_item item)
|
|
{
|
|
atomic_long_add(x, &zone->vm_stat[item]);
|
|
atomic_long_add(x, &vm_stat[item]);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long global_page_state(enum zone_stat_item item)
|
|
{
|
|
long x = atomic_long_read(&vm_stat[item]);
|
|
|
|
if (x < 0)
|
|
x = 0;
|
|
|
|
return x;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long zone_page_state(struct zone *zone,
|
|
enum zone_stat_item item)
|
|
{
|
|
long x = atomic_long_read(&zone->vm_stat[item]);
|
|
|
|
if (x < 0)
|
|
x = 0;
|
|
|
|
return x;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long zone_page_state_snapshot(struct zone *zone,
|
|
enum zone_stat_item item)
|
|
{
|
|
long x = atomic_long_read(&zone->vm_stat[item]);
|
|
|
|
|
|
int cpu;
|
|
for (((cpu)) = -1; ((cpu)) = cpumask_next(((cpu)), (cpu_online_mask)), ((cpu)) < nr_cpu_ids;)
|
|
x += ({ do { const void *__vpp_verify = (typeof((zone->pageset) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*((zone->pageset))) *)((zone->pageset)))); (typeof((typeof(*((zone->pageset))) *)((zone->pageset)))) (__ptr + (((__per_cpu_offset[(cpu)])))); }); })->vm_stat_diff[item];
|
|
|
|
if (x < 0)
|
|
x = 0;
|
|
|
|
return x;
|
|
}
|
|
# 179 "include/linux/vmstat.h"
|
|
void __mod_zone_page_state(struct zone *, enum zone_stat_item item, long);
|
|
void __inc_zone_page_state(struct page *, enum zone_stat_item);
|
|
void __dec_zone_page_state(struct page *, enum zone_stat_item);
|
|
|
|
void mod_zone_page_state(struct zone *, enum zone_stat_item, long);
|
|
void inc_zone_page_state(struct page *, enum zone_stat_item);
|
|
void dec_zone_page_state(struct page *, enum zone_stat_item);
|
|
|
|
extern void inc_zone_state(struct zone *, enum zone_stat_item);
|
|
extern void __inc_zone_state(struct zone *, enum zone_stat_item);
|
|
extern void dec_zone_state(struct zone *, enum zone_stat_item);
|
|
extern void __dec_zone_state(struct zone *, enum zone_stat_item);
|
|
|
|
void cpu_vm_stats_fold(int cpu);
|
|
void refresh_zone_stat_thresholds(void);
|
|
|
|
void drain_zonestat(struct zone *zone, struct per_cpu_pageset *);
|
|
|
|
int calculate_pressure_threshold(struct zone *zone);
|
|
int calculate_normal_threshold(struct zone *zone);
|
|
void set_pgdat_percpu_threshold(pg_data_t *pgdat,
|
|
int (*calculate_pressure)(struct zone *));
|
|
# 257 "include/linux/vmstat.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __mod_zone_freepage_state(struct zone *zone, int nr_pages,
|
|
int migratetype)
|
|
{
|
|
__mod_zone_page_state(zone, NR_FREE_PAGES, nr_pages);
|
|
if (false)
|
|
__mod_zone_page_state(zone, NR_FREE_CMA_PAGES, nr_pages);
|
|
}
|
|
|
|
extern const char * const vmstat_text[];
|
|
# 909 "include/linux/mm.h" 2
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void *lowmem_page_address(const struct page *page)
|
|
{
|
|
return ((void *)__phys_to_virt((phys_addr_t)(((phys_addr_t)(((unsigned long)((page) - mem_map) + (__pv_phys_pfn_offset))) << 12))));
|
|
}
|
|
# 932 "include/linux/mm.h"
|
|
void *page_address(const struct page *page);
|
|
void set_page_address(struct page *page, void *virtual);
|
|
void page_address_init(void);
|
|
# 943 "include/linux/mm.h"
|
|
extern void *page_rmapping(struct page *page);
|
|
extern struct anon_vma *page_anon_vma(struct page *page);
|
|
extern struct address_space *page_mapping(struct page *page);
|
|
|
|
extern struct address_space *__page_file_mapping(struct page *);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
struct address_space *page_file_mapping(struct page *page)
|
|
{
|
|
if (__builtin_expect(!!(PageSwapCache(page)), 0))
|
|
return __page_file_mapping(page);
|
|
|
|
return page->mapping;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long page_index(struct page *page)
|
|
{
|
|
if (__builtin_expect(!!(PageSwapCache(page)), 0))
|
|
return ((page)->private);
|
|
return page->index;
|
|
}
|
|
|
|
extern unsigned long __page_file_index(struct page *page);
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long page_file_index(struct page *page)
|
|
{
|
|
if (__builtin_expect(!!(PageSwapCache(page)), 0))
|
|
return __page_file_index(page);
|
|
|
|
return page->index;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int page_mapped(struct page *page)
|
|
{
|
|
return ({ union { typeof((&(page)->_mapcount)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&(page)->_mapcount)->counter), __u.__c, sizeof((&(page)->_mapcount)->counter)); else __read_once_size_nocheck(&((&(page)->_mapcount)->counter), __u.__c, sizeof((&(page)->_mapcount)->counter)); __u.__val; }) >= 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool page_is_pfmemalloc(struct page *page)
|
|
{
|
|
|
|
|
|
|
|
|
|
return page->index == -1UL;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_page_pfmemalloc(struct page *page)
|
|
{
|
|
page->index = -1UL;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_page_pfmemalloc(struct page *page)
|
|
{
|
|
page->index = 0;
|
|
}
|
|
# 1053 "include/linux/mm.h"
|
|
extern void pagefault_out_of_memory(void);
|
|
# 1063 "include/linux/mm.h"
|
|
extern void show_free_areas(unsigned int flags);
|
|
extern bool skip_free_areas_node(unsigned int flags, int nid);
|
|
|
|
int shmem_zero_setup(struct vm_area_struct *);
|
|
|
|
bool shmem_mapping(struct address_space *mapping);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern int can_do_mlock(void);
|
|
extern int user_shm_lock(size_t, struct user_struct *);
|
|
extern void user_shm_unlock(size_t, struct user_struct *);
|
|
|
|
|
|
|
|
|
|
struct zap_details {
|
|
struct address_space *check_mapping;
|
|
unsigned long first_index;
|
|
unsigned long last_index;
|
|
};
|
|
|
|
struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr,
|
|
pte_t pte);
|
|
struct page *vm_normal_page_pmd(struct vm_area_struct *vma, unsigned long addr,
|
|
pmd_t pmd);
|
|
|
|
int zap_vma_ptes(struct vm_area_struct *vma, unsigned long address,
|
|
unsigned long size);
|
|
void zap_page_range(struct vm_area_struct *vma, unsigned long address,
|
|
unsigned long size, struct zap_details *);
|
|
void unmap_vmas(struct mmu_gather *tlb, struct vm_area_struct *start_vma,
|
|
unsigned long start, unsigned long end);
|
|
# 1121 "include/linux/mm.h"
|
|
struct mm_walk {
|
|
int (*pmd_entry)(pmd_t *pmd, unsigned long addr,
|
|
unsigned long next, struct mm_walk *walk);
|
|
int (*pte_entry)(pte_t *pte, unsigned long addr,
|
|
unsigned long next, struct mm_walk *walk);
|
|
int (*pte_hole)(unsigned long addr, unsigned long next,
|
|
struct mm_walk *walk);
|
|
int (*hugetlb_entry)(pte_t *pte, unsigned long hmask,
|
|
unsigned long addr, unsigned long next,
|
|
struct mm_walk *walk);
|
|
int (*test_walk)(unsigned long addr, unsigned long next,
|
|
struct mm_walk *walk);
|
|
struct mm_struct *mm;
|
|
struct vm_area_struct *vma;
|
|
void *private;
|
|
};
|
|
|
|
int walk_page_range(unsigned long addr, unsigned long end,
|
|
struct mm_walk *walk);
|
|
int walk_page_vma(struct vm_area_struct *vma, struct mm_walk *walk);
|
|
void free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
|
|
unsigned long end, unsigned long floor, unsigned long ceiling);
|
|
int copy_page_range(struct mm_struct *dst, struct mm_struct *src,
|
|
struct vm_area_struct *vma);
|
|
void unmap_mapping_range(struct address_space *mapping,
|
|
loff_t const holebegin, loff_t const holelen, int even_cows);
|
|
int follow_pfn(struct vm_area_struct *vma, unsigned long address,
|
|
unsigned long *pfn);
|
|
int follow_phys(struct vm_area_struct *vma, unsigned long address,
|
|
unsigned int flags, unsigned long *prot, resource_size_t *phys);
|
|
int generic_access_phys(struct vm_area_struct *vma, unsigned long addr,
|
|
void *buf, int len, int write);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void unmap_shared_mapping_range(struct address_space *mapping,
|
|
loff_t const holebegin, loff_t const holelen)
|
|
{
|
|
unmap_mapping_range(mapping, holebegin, holelen, 0);
|
|
}
|
|
|
|
extern void truncate_pagecache(struct inode *inode, loff_t new);
|
|
extern void truncate_setsize(struct inode *inode, loff_t newsize);
|
|
void pagecache_isize_extended(struct inode *inode, loff_t from, loff_t to);
|
|
void truncate_pagecache_range(struct inode *inode, loff_t offset, loff_t end);
|
|
int truncate_inode_page(struct address_space *mapping, struct page *page);
|
|
int generic_error_remove_page(struct address_space *mapping, struct page *page);
|
|
int invalidate_inode_page(struct page *page);
|
|
|
|
|
|
extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
|
|
unsigned long address, unsigned int flags);
|
|
extern int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
|
|
unsigned long address, unsigned int fault_flags);
|
|
# 1192 "include/linux/mm.h"
|
|
extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);
|
|
extern int access_remote_vm(struct mm_struct *mm, unsigned long addr,
|
|
void *buf, int len, int write);
|
|
|
|
long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
|
|
unsigned long start, unsigned long nr_pages,
|
|
unsigned int foll_flags, struct page **pages,
|
|
struct vm_area_struct **vmas, int *nonblocking);
|
|
long get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
|
|
unsigned long start, unsigned long nr_pages,
|
|
int write, int force, struct page **pages,
|
|
struct vm_area_struct **vmas);
|
|
long get_user_pages_locked(struct task_struct *tsk, struct mm_struct *mm,
|
|
unsigned long start, unsigned long nr_pages,
|
|
int write, int force, struct page **pages,
|
|
int *locked);
|
|
long __get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm,
|
|
unsigned long start, unsigned long nr_pages,
|
|
int write, int force, struct page **pages,
|
|
unsigned int gup_flags);
|
|
long get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm,
|
|
unsigned long start, unsigned long nr_pages,
|
|
int write, int force, struct page **pages);
|
|
int get_user_pages_fast(unsigned long start, int nr_pages, int write,
|
|
struct page **pages);
|
|
|
|
|
|
struct frame_vector {
|
|
unsigned int nr_allocated;
|
|
unsigned int nr_frames;
|
|
bool got_ref;
|
|
bool is_pfns;
|
|
void *ptrs[0];
|
|
|
|
|
|
};
|
|
|
|
struct frame_vector *frame_vector_create(unsigned int nr_frames);
|
|
void frame_vector_destroy(struct frame_vector *vec);
|
|
int get_vaddr_frames(unsigned long start, unsigned int nr_pfns,
|
|
bool write, bool force, struct frame_vector *vec);
|
|
void put_vaddr_frames(struct frame_vector *vec);
|
|
int frame_vector_to_pages(struct frame_vector *vec);
|
|
void frame_vector_to_pfns(struct frame_vector *vec);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int frame_vector_count(struct frame_vector *vec)
|
|
{
|
|
return vec->nr_frames;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page **frame_vector_pages(struct frame_vector *vec)
|
|
{
|
|
if (vec->is_pfns) {
|
|
int err = frame_vector_to_pages(vec);
|
|
|
|
if (err)
|
|
return ERR_PTR(err);
|
|
}
|
|
return (struct page **)(vec->ptrs);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long *frame_vector_pfns(struct frame_vector *vec)
|
|
{
|
|
if (!vec->is_pfns)
|
|
frame_vector_to_pfns(vec);
|
|
return (unsigned long *)(vec->ptrs);
|
|
}
|
|
|
|
struct kvec;
|
|
int get_kernel_pages(const struct kvec *iov, int nr_pages, int write,
|
|
struct page **pages);
|
|
int get_kernel_page(unsigned long start, int write, struct page **pages);
|
|
struct page *get_dump_page(unsigned long addr);
|
|
|
|
extern int try_to_release_page(struct page * page, gfp_t gfp_mask);
|
|
extern void do_invalidatepage(struct page *page, unsigned int offset,
|
|
unsigned int length);
|
|
|
|
int __set_page_dirty_nobuffers(struct page *page);
|
|
int __set_page_dirty_no_writeback(struct page *page);
|
|
int redirty_page_for_writepage(struct writeback_control *wbc,
|
|
struct page *page);
|
|
void account_page_dirtied(struct page *page, struct address_space *mapping,
|
|
struct mem_cgroup *memcg);
|
|
void account_page_cleaned(struct page *page, struct address_space *mapping,
|
|
struct mem_cgroup *memcg, struct bdi_writeback *wb);
|
|
int set_page_dirty(struct page *page);
|
|
int set_page_dirty_lock(struct page *page);
|
|
void cancel_dirty_page(struct page *page);
|
|
int clear_page_dirty_for_io(struct page *page);
|
|
|
|
int get_cmdline(struct task_struct *task, char *buffer, int buflen);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool vma_is_anonymous(struct vm_area_struct *vma)
|
|
{
|
|
return !vma->vm_ops;
|
|
}
|
|
|
|
int vma_is_stack_for_task(struct vm_area_struct *vma, struct task_struct *t);
|
|
|
|
extern unsigned long move_page_tables(struct vm_area_struct *vma,
|
|
unsigned long old_addr, struct vm_area_struct *new_vma,
|
|
unsigned long new_addr, unsigned long len,
|
|
bool need_rmap_locks);
|
|
extern unsigned long change_protection(struct vm_area_struct *vma, unsigned long start,
|
|
unsigned long end, pgprot_t newprot,
|
|
int dirty_accountable, int prot_numa);
|
|
extern int mprotect_fixup(struct vm_area_struct *vma,
|
|
struct vm_area_struct **pprev, unsigned long start,
|
|
unsigned long end, unsigned long newflags);
|
|
|
|
|
|
|
|
|
|
int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
|
|
struct page **pages);
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long get_mm_counter(struct mm_struct *mm, int member)
|
|
{
|
|
long val = atomic_long_read(&mm->rss_stat.count[member]);
|
|
# 1323 "include/linux/mm.h"
|
|
return (unsigned long)val;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void add_mm_counter(struct mm_struct *mm, int member, long value)
|
|
{
|
|
atomic_long_add(value, &mm->rss_stat.count[member]);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inc_mm_counter(struct mm_struct *mm, int member)
|
|
{
|
|
atomic_long_inc(&mm->rss_stat.count[member]);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dec_mm_counter(struct mm_struct *mm, int member)
|
|
{
|
|
atomic_long_dec(&mm->rss_stat.count[member]);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long get_mm_rss(struct mm_struct *mm)
|
|
{
|
|
return get_mm_counter(mm, MM_FILEPAGES) +
|
|
get_mm_counter(mm, MM_ANONPAGES);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long get_mm_hiwater_rss(struct mm_struct *mm)
|
|
{
|
|
return ({ typeof(mm->hiwater_rss) _max1 = (mm->hiwater_rss); typeof(get_mm_rss(mm)) _max2 = (get_mm_rss(mm)); (void) (&_max1 == &_max2); _max1 > _max2 ? _max1 : _max2; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long get_mm_hiwater_vm(struct mm_struct *mm)
|
|
{
|
|
return ({ typeof(mm->hiwater_vm) _max1 = (mm->hiwater_vm); typeof(mm->total_vm) _max2 = (mm->total_vm); (void) (&_max1 == &_max2); _max1 > _max2 ? _max1 : _max2; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void update_hiwater_rss(struct mm_struct *mm)
|
|
{
|
|
unsigned long _rss = get_mm_rss(mm);
|
|
|
|
if ((mm)->hiwater_rss < _rss)
|
|
(mm)->hiwater_rss = _rss;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void update_hiwater_vm(struct mm_struct *mm)
|
|
{
|
|
if (mm->hiwater_vm < mm->total_vm)
|
|
mm->hiwater_vm = mm->total_vm;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void reset_mm_hiwater_rss(struct mm_struct *mm)
|
|
{
|
|
mm->hiwater_rss = get_mm_rss(mm);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void setmax_mm_hiwater_rss(unsigned long *maxrss,
|
|
struct mm_struct *mm)
|
|
{
|
|
unsigned long hiwater_rss = get_mm_hiwater_rss(mm);
|
|
|
|
if (*maxrss < hiwater_rss)
|
|
*maxrss = hiwater_rss;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sync_mm_rss(struct mm_struct *mm)
|
|
{
|
|
}
|
|
|
|
|
|
int vma_wants_writenotify(struct vm_area_struct *vma);
|
|
|
|
extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr,
|
|
spinlock_t **ptl);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr,
|
|
spinlock_t **ptl)
|
|
{
|
|
pte_t *ptep;
|
|
(ptep = __get_locked_pte(mm, addr, ptl));
|
|
return ptep;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __pud_alloc(struct mm_struct *mm, pgd_t *pgd,
|
|
unsigned long address)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __pmd_alloc(struct mm_struct *mm, pud_t *pud,
|
|
unsigned long address)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mm_nr_pmds_init(struct mm_struct *mm) {}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long mm_nr_pmds(struct mm_struct *mm)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mm_inc_nr_pmds(struct mm_struct *mm) {}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mm_dec_nr_pmds(struct mm_struct *mm) {}
|
|
# 1456 "include/linux/mm.h"
|
|
int __pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma,
|
|
pmd_t *pmd, unsigned long address);
|
|
int __pte_alloc_kernel(pmd_t *pmd, unsigned long address);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)
|
|
{
|
|
return (__builtin_expect(!!(pgd_none(*pgd)), 0) && __pud_alloc(mm, pgd, address))?
|
|
((void *)0): pud_offset(pgd, address);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
|
|
{
|
|
return (__builtin_expect(!!((0)), 0) && __pmd_alloc(mm, pud, address))?
|
|
((void *)0): pmd_offset(pud, address);
|
|
}
|
|
# 1540 "include/linux/mm.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd)
|
|
{
|
|
return &mm->page_table_lock;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ptlock_cache_init(void) {}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ptlock_init(struct page *page) { return true; }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pte_lock_deinit(struct page *page) {}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgtable_init(void)
|
|
{
|
|
ptlock_cache_init();
|
|
do { } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool pgtable_page_ctor(struct page *page)
|
|
{
|
|
if (!ptlock_init(page))
|
|
return false;
|
|
inc_zone_page_state(page, NR_PAGETABLE);
|
|
return true;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgtable_page_dtor(struct page *page)
|
|
{
|
|
pte_lock_deinit(page);
|
|
dec_zone_page_state(page, NR_PAGETABLE);
|
|
}
|
|
# 1630 "include/linux/mm.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd)
|
|
{
|
|
return &mm->page_table_lock;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool pgtable_pmd_page_ctor(struct page *page) { return true; }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pgtable_pmd_page_dtor(struct page *page) {}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) spinlock_t *pmd_lock(struct mm_struct *mm, pmd_t *pmd)
|
|
{
|
|
spinlock_t *ptl = pmd_lockptr(mm, pmd);
|
|
spin_lock(ptl);
|
|
return ptl;
|
|
}
|
|
|
|
extern void free_area_init(unsigned long * zones_size);
|
|
extern void free_area_init_node(int nid, unsigned long * zones_size,
|
|
unsigned long zone_start_pfn, unsigned long *zholes_size);
|
|
extern void free_initmem(void);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern unsigned long free_reserved_area(void *start, void *end,
|
|
int poison, char *s);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern void free_highmem_page(struct page *page);
|
|
|
|
|
|
extern void adjust_managed_page_count(struct page *page, long count);
|
|
extern void mem_init_print_info(const char *str);
|
|
|
|
extern void reserve_bootmem_region(phys_addr_t start, phys_addr_t end);
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __free_reserved_page(struct page *page)
|
|
{
|
|
ClearPageReserved(page);
|
|
init_page_count(page);
|
|
__free_pages((page), 0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void free_reserved_page(struct page *page)
|
|
{
|
|
__free_reserved_page(page);
|
|
adjust_managed_page_count(page, 1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mark_page_reserved(struct page *page)
|
|
{
|
|
SetPageReserved(page);
|
|
adjust_managed_page_count(page, -1);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long free_initmem_default(int poison)
|
|
{
|
|
extern char __init_begin[], __init_end[];
|
|
|
|
return free_reserved_area(&__init_begin, &__init_end,
|
|
poison, "unused kernel");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long get_num_physpages(void)
|
|
{
|
|
int nid;
|
|
unsigned long phys_pages = 0;
|
|
|
|
for ( (nid) = 0; (nid) == 0; (nid) = 1)
|
|
phys_pages += ((&contig_page_data)->node_present_pages);
|
|
|
|
return phys_pages;
|
|
}
|
|
# 1765 "include/linux/mm.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __early_pfn_to_nid(unsigned long pfn,
|
|
struct mminit_pfnnid_cache *state)
|
|
{
|
|
return 0;
|
|
}
|
|
# 1778 "include/linux/mm.h"
|
|
extern void set_dma_reserve(unsigned long new_dma_reserve);
|
|
extern void memmap_init_zone(unsigned long, int, unsigned long,
|
|
unsigned long, enum memmap_context);
|
|
extern void setup_per_zone_wmarks(void);
|
|
extern int __attribute__ ((__section__(".meminit.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) init_per_zone_wmark_min(void);
|
|
extern void mem_init(void);
|
|
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) mmap_init(void);
|
|
extern void show_mem(unsigned int flags);
|
|
extern void si_meminfo(struct sysinfo * val);
|
|
extern void si_meminfo_node(struct sysinfo *val, int nid);
|
|
|
|
extern __attribute__((format(printf, 3, 4)))
|
|
void warn_alloc_failed(gfp_t gfp_mask, unsigned int order,
|
|
const char *fmt, ...);
|
|
|
|
extern void setup_per_cpu_pageset(void);
|
|
|
|
extern void zone_pcp_update(struct zone *zone);
|
|
extern void zone_pcp_reset(struct zone *zone);
|
|
|
|
|
|
extern int min_free_kbytes;
|
|
|
|
|
|
extern atomic_long_t mmap_pages_allocated;
|
|
extern int nommu_shrink_inode_mappings(struct inode *, size_t, size_t);
|
|
|
|
|
|
void vma_interval_tree_insert(struct vm_area_struct *node,
|
|
struct rb_root *root);
|
|
void vma_interval_tree_insert_after(struct vm_area_struct *node,
|
|
struct vm_area_struct *prev,
|
|
struct rb_root *root);
|
|
void vma_interval_tree_remove(struct vm_area_struct *node,
|
|
struct rb_root *root);
|
|
struct vm_area_struct *vma_interval_tree_iter_first(struct rb_root *root,
|
|
unsigned long start, unsigned long last);
|
|
struct vm_area_struct *vma_interval_tree_iter_next(struct vm_area_struct *node,
|
|
unsigned long start, unsigned long last);
|
|
|
|
|
|
|
|
|
|
|
|
void anon_vma_interval_tree_insert(struct anon_vma_chain *node,
|
|
struct rb_root *root);
|
|
void anon_vma_interval_tree_remove(struct anon_vma_chain *node,
|
|
struct rb_root *root);
|
|
struct anon_vma_chain *anon_vma_interval_tree_iter_first(
|
|
struct rb_root *root, unsigned long start, unsigned long last);
|
|
struct anon_vma_chain *anon_vma_interval_tree_iter_next(
|
|
struct anon_vma_chain *node, unsigned long start, unsigned long last);
|
|
# 1839 "include/linux/mm.h"
|
|
extern int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin);
|
|
extern int vma_adjust(struct vm_area_struct *vma, unsigned long start,
|
|
unsigned long end, unsigned long pgoff, struct vm_area_struct *insert);
|
|
extern struct vm_area_struct *vma_merge(struct mm_struct *,
|
|
struct vm_area_struct *prev, unsigned long addr, unsigned long end,
|
|
unsigned long vm_flags, struct anon_vma *, struct file *, unsigned long,
|
|
struct mempolicy *, struct vm_userfaultfd_ctx);
|
|
extern struct anon_vma *find_mergeable_anon_vma(struct vm_area_struct *);
|
|
extern int split_vma(struct mm_struct *,
|
|
struct vm_area_struct *, unsigned long addr, int new_below);
|
|
extern int insert_vm_struct(struct mm_struct *, struct vm_area_struct *);
|
|
extern void __vma_link_rb(struct mm_struct *, struct vm_area_struct *,
|
|
struct rb_node **, struct rb_node *);
|
|
extern void unlink_file_vma(struct vm_area_struct *);
|
|
extern struct vm_area_struct *copy_vma(struct vm_area_struct **,
|
|
unsigned long addr, unsigned long len, unsigned long pgoff,
|
|
bool *need_rmap_locks);
|
|
extern void exit_mmap(struct mm_struct *);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int check_data_rlimit(unsigned long rlim,
|
|
unsigned long new,
|
|
unsigned long start,
|
|
unsigned long end_data,
|
|
unsigned long start_data)
|
|
{
|
|
if (rlim < (~0UL)) {
|
|
if (((new - start) + (end_data - start_data)) > rlim)
|
|
return -28;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
extern int mm_take_all_locks(struct mm_struct *mm);
|
|
extern void mm_drop_all_locks(struct mm_struct *mm);
|
|
|
|
extern void set_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file);
|
|
extern struct file *get_mm_exe_file(struct mm_struct *mm);
|
|
extern struct file *get_task_exe_file(struct task_struct *task);
|
|
|
|
extern int may_expand_vm(struct mm_struct *mm, unsigned long npages);
|
|
extern struct vm_area_struct *_install_special_mapping(struct mm_struct *mm,
|
|
unsigned long addr, unsigned long len,
|
|
unsigned long flags,
|
|
const struct vm_special_mapping *spec);
|
|
|
|
extern int install_special_mapping(struct mm_struct *mm,
|
|
unsigned long addr, unsigned long len,
|
|
unsigned long flags, struct page **pages);
|
|
|
|
extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
|
|
|
|
extern unsigned long mmap_region(struct file *file, unsigned long addr,
|
|
unsigned long len, vm_flags_t vm_flags, unsigned long pgoff);
|
|
extern unsigned long do_mmap(struct file *file, unsigned long addr,
|
|
unsigned long len, unsigned long prot, unsigned long flags,
|
|
vm_flags_t vm_flags, unsigned long pgoff, unsigned long *populate);
|
|
extern int do_munmap(struct mm_struct *, unsigned long, size_t);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
|
|
do_mmap_pgoff(struct file *file, unsigned long addr,
|
|
unsigned long len, unsigned long prot, unsigned long flags,
|
|
unsigned long pgoff, unsigned long *populate)
|
|
{
|
|
return do_mmap(file, addr, len, prot, flags, 0, pgoff, populate);
|
|
}
|
|
|
|
|
|
extern int __mm_populate(unsigned long addr, unsigned long len,
|
|
int ignore_errors);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mm_populate(unsigned long addr, unsigned long len)
|
|
{
|
|
|
|
(void) __mm_populate(addr, len, 1);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extern unsigned long vm_brk(unsigned long, unsigned long);
|
|
extern int vm_munmap(unsigned long, size_t);
|
|
extern unsigned long vm_mmap(struct file *, unsigned long,
|
|
unsigned long, unsigned long,
|
|
unsigned long, unsigned long);
|
|
|
|
struct vm_unmapped_area_info {
|
|
|
|
unsigned long flags;
|
|
unsigned long length;
|
|
unsigned long low_limit;
|
|
unsigned long high_limit;
|
|
unsigned long align_mask;
|
|
unsigned long align_offset;
|
|
};
|
|
|
|
extern unsigned long unmapped_area(struct vm_unmapped_area_info *info);
|
|
extern unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info);
|
|
# 1947 "include/linux/mm.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
|
|
vm_unmapped_area(struct vm_unmapped_area_info *info)
|
|
{
|
|
if (info->flags & 1)
|
|
return unmapped_area_topdown(info);
|
|
else
|
|
return unmapped_area(info);
|
|
}
|
|
|
|
|
|
extern void truncate_inode_pages(struct address_space *, loff_t);
|
|
extern void truncate_inode_pages_range(struct address_space *,
|
|
loff_t lstart, loff_t lend);
|
|
extern void truncate_inode_pages_final(struct address_space *);
|
|
|
|
|
|
extern int filemap_fault(struct vm_area_struct *, struct vm_fault *);
|
|
extern void filemap_map_pages(struct vm_area_struct *vma, struct vm_fault *vmf);
|
|
extern int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf);
|
|
|
|
|
|
int write_one_page(struct page *page, int wait);
|
|
void task_dirty_inc(struct task_struct *tsk);
|
|
|
|
|
|
|
|
|
|
|
|
int force_page_cache_readahead(struct address_space *mapping, struct file *filp,
|
|
unsigned long offset, unsigned long nr_to_read);
|
|
|
|
void page_cache_sync_readahead(struct address_space *mapping,
|
|
struct file_ra_state *ra,
|
|
struct file *filp,
|
|
unsigned long offset,
|
|
unsigned long size);
|
|
|
|
void page_cache_async_readahead(struct address_space *mapping,
|
|
struct file_ra_state *ra,
|
|
struct file *filp,
|
|
struct page *pg,
|
|
unsigned long offset,
|
|
unsigned long size);
|
|
|
|
extern unsigned long stack_guard_gap;
|
|
|
|
extern int expand_stack(struct vm_area_struct *vma, unsigned long address);
|
|
|
|
|
|
extern int expand_downwards(struct vm_area_struct *vma,
|
|
unsigned long address);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr);
|
|
extern struct vm_area_struct * find_vma_prev(struct mm_struct * mm, unsigned long addr,
|
|
struct vm_area_struct **pprev);
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct vm_area_struct * find_vma_intersection(struct mm_struct * mm, unsigned long start_addr, unsigned long end_addr)
|
|
{
|
|
struct vm_area_struct * vma = find_vma(mm,start_addr);
|
|
|
|
if (vma && end_addr <= vma->vm_start)
|
|
vma = ((void *)0);
|
|
return vma;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long vm_start_gap(struct vm_area_struct *vma)
|
|
{
|
|
unsigned long vm_start = vma->vm_start;
|
|
|
|
if (vma->vm_flags & 0x00000100) {
|
|
vm_start -= stack_guard_gap;
|
|
if (vm_start > vma->vm_start)
|
|
vm_start = 0;
|
|
}
|
|
return vm_start;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long vm_end_gap(struct vm_area_struct *vma)
|
|
{
|
|
unsigned long vm_end = vma->vm_end;
|
|
|
|
if (vma->vm_flags & 0x00000000) {
|
|
vm_end += stack_guard_gap;
|
|
if (vm_end < vma->vm_end)
|
|
vm_end = -((1UL) << 12);
|
|
}
|
|
return vm_end;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long vma_pages(struct vm_area_struct *vma)
|
|
{
|
|
return (vma->vm_end - vma->vm_start) >> 12;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct vm_area_struct *find_exact_vma(struct mm_struct *mm,
|
|
unsigned long vm_start, unsigned long vm_end)
|
|
{
|
|
struct vm_area_struct *vma = find_vma(mm, vm_start);
|
|
|
|
if (vma && (vma->vm_start != vm_start || vma->vm_end != vm_end))
|
|
vma = ((void *)0);
|
|
|
|
return vma;
|
|
}
|
|
|
|
|
|
pgprot_t vm_get_page_prot(unsigned long vm_flags);
|
|
void vma_set_page_prot(struct vm_area_struct *vma);
|
|
# 2080 "include/linux/mm.h"
|
|
struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr);
|
|
int remap_pfn_range(struct vm_area_struct *, unsigned long addr,
|
|
unsigned long pfn, unsigned long size, pgprot_t);
|
|
int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *);
|
|
int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr,
|
|
unsigned long pfn);
|
|
int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr,
|
|
unsigned long pfn);
|
|
int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len);
|
|
|
|
|
|
struct page *follow_page_mask(struct vm_area_struct *vma,
|
|
unsigned long address, unsigned int foll_flags,
|
|
unsigned int *page_mask);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *follow_page(struct vm_area_struct *vma,
|
|
unsigned long address, unsigned int foll_flags)
|
|
{
|
|
unsigned int unused_page_mask;
|
|
return follow_page_mask(vma, address, foll_flags, &unused_page_mask);
|
|
}
|
|
# 2118 "include/linux/mm.h"
|
|
typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr,
|
|
void *data);
|
|
extern int apply_to_page_range(struct mm_struct *mm, unsigned long address,
|
|
unsigned long size, pte_fn_t fn, void *data);
|
|
|
|
|
|
void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long);
|
|
# 2154 "include/linux/mm.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
kernel_map_pages(struct page *page, int numpages, int enable) {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern struct vm_area_struct *get_gate_vma(struct mm_struct *mm);
|
|
extern int in_gate_area_no_mm(unsigned long addr);
|
|
extern int in_gate_area(struct mm_struct *mm, unsigned long addr);
|
|
# 2178 "include/linux/mm.h"
|
|
extern int sysctl_drop_caches;
|
|
int drop_caches_sysctl_handler(struct ctl_table *, int,
|
|
void *, size_t *, loff_t *);
|
|
|
|
|
|
void drop_slab(void);
|
|
void drop_slab_node(int nid);
|
|
|
|
|
|
|
|
|
|
extern int randomize_va_space;
|
|
|
|
|
|
const char * arch_vma_name(struct vm_area_struct *vma);
|
|
void print_vma_addr(char *prefix, unsigned long rip);
|
|
|
|
void sparse_mem_maps_populate_node(struct page **map_map,
|
|
unsigned long pnum_begin,
|
|
unsigned long pnum_end,
|
|
unsigned long map_count,
|
|
int nodeid);
|
|
|
|
struct page *sparse_mem_map_populate(unsigned long pnum, int nid);
|
|
pgd_t *vmemmap_pgd_populate(unsigned long addr, int node);
|
|
pud_t *vmemmap_pud_populate(pgd_t *pgd, unsigned long addr, int node);
|
|
pmd_t *vmemmap_pmd_populate(pud_t *pud, unsigned long addr, int node);
|
|
pte_t *vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node);
|
|
void *vmemmap_alloc_block(unsigned long size, int node);
|
|
void *vmemmap_alloc_block_buf(unsigned long size, int node);
|
|
void vmemmap_verify(pte_t *, int, unsigned long, unsigned long);
|
|
int vmemmap_populate_basepages(unsigned long start, unsigned long end,
|
|
int node);
|
|
int vmemmap_populate(unsigned long start, unsigned long end, int node);
|
|
void vmemmap_populate_print_last(void);
|
|
|
|
|
|
|
|
void register_page_bootmem_memmap(unsigned long section_nr, struct page *map,
|
|
unsigned long size);
|
|
|
|
enum mf_flags {
|
|
MF_COUNT_INCREASED = 1 << 0,
|
|
MF_ACTION_REQUIRED = 1 << 1,
|
|
MF_MUST_KILL = 1 << 2,
|
|
MF_SOFT_OFFLINE = 1 << 3,
|
|
};
|
|
extern int memory_failure(unsigned long pfn, int trapno, int flags);
|
|
extern void memory_failure_queue(unsigned long pfn, int trapno, int flags);
|
|
extern int unpoison_memory(unsigned long pfn);
|
|
extern int get_hwpoison_page(struct page *page);
|
|
extern void put_hwpoison_page(struct page *page);
|
|
extern int sysctl_memory_failure_early_kill;
|
|
extern int sysctl_memory_failure_recovery;
|
|
extern void shake_page(struct page *p, int access);
|
|
extern atomic_long_t num_poisoned_pages;
|
|
extern int soft_offline_page(struct page *page, int flags);
|
|
|
|
|
|
|
|
|
|
|
|
enum mf_result {
|
|
MF_IGNORED,
|
|
MF_FAILED,
|
|
MF_DELAYED,
|
|
MF_RECOVERED,
|
|
};
|
|
|
|
enum mf_action_page_type {
|
|
MF_MSG_KERNEL,
|
|
MF_MSG_KERNEL_HIGH_ORDER,
|
|
MF_MSG_SLAB,
|
|
MF_MSG_DIFFERENT_COMPOUND,
|
|
MF_MSG_POISONED_HUGE,
|
|
MF_MSG_HUGE,
|
|
MF_MSG_FREE_HUGE,
|
|
MF_MSG_UNMAP_FAILED,
|
|
MF_MSG_DIRTY_SWAPCACHE,
|
|
MF_MSG_CLEAN_SWAPCACHE,
|
|
MF_MSG_DIRTY_MLOCKED_LRU,
|
|
MF_MSG_CLEAN_MLOCKED_LRU,
|
|
MF_MSG_DIRTY_UNEVICTABLE_LRU,
|
|
MF_MSG_CLEAN_UNEVICTABLE_LRU,
|
|
MF_MSG_DIRTY_LRU,
|
|
MF_MSG_CLEAN_LRU,
|
|
MF_MSG_TRUNCATED_LRU,
|
|
MF_MSG_BUDDY,
|
|
MF_MSG_BUDDY_2ND,
|
|
MF_MSG_UNKNOWN,
|
|
};
|
|
# 2279 "include/linux/mm.h"
|
|
extern struct page_ext_operations debug_guardpage_ops;
|
|
extern struct page_ext_operations page_poisoning_ops;
|
|
# 2307 "include/linux/mm.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int debug_guardpage_minorder(void) { return 0; }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool debug_guardpage_enabled(void) { return false; }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool page_is_guard(struct page *page) { return false; }
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void setup_nr_node_ids(void) {}
|
|
# 8 "include/linux/scatterlist.h" 2
|
|
# 1 "./arch/arm/include/asm/io.h" 1
|
|
# 28 "./arch/arm/include/asm/io.h"
|
|
# 1 "include/linux/blk_types.h" 1
|
|
# 10 "include/linux/blk_types.h"
|
|
struct bio_set;
|
|
struct bio;
|
|
struct bio_integrity_payload;
|
|
struct page;
|
|
struct block_device;
|
|
struct io_context;
|
|
struct cgroup_subsys_state;
|
|
typedef void (bio_end_io_t) (struct bio *);
|
|
typedef void (bio_destructor_t) (struct bio *);
|
|
|
|
|
|
|
|
|
|
struct bio_vec {
|
|
struct page *bv_page;
|
|
unsigned int bv_len;
|
|
unsigned int bv_offset;
|
|
};
|
|
|
|
|
|
|
|
struct bvec_iter {
|
|
sector_t bi_sector;
|
|
|
|
unsigned int bi_size;
|
|
|
|
unsigned int bi_idx;
|
|
|
|
unsigned int bi_bvec_done;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct bio {
|
|
struct bio *bi_next;
|
|
struct block_device *bi_bdev;
|
|
unsigned int bi_flags;
|
|
int bi_error;
|
|
unsigned long bi_rw;
|
|
|
|
|
|
|
|
struct bvec_iter bi_iter;
|
|
|
|
|
|
|
|
|
|
unsigned int bi_phys_segments;
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int bi_seg_front_size;
|
|
unsigned int bi_seg_back_size;
|
|
|
|
atomic_t __bi_remaining;
|
|
|
|
bio_end_io_t *bi_end_io;
|
|
|
|
void *bi_private;
|
|
# 82 "include/linux/blk_types.h"
|
|
union {
|
|
|
|
|
|
|
|
};
|
|
|
|
unsigned short bi_vcnt;
|
|
|
|
|
|
|
|
|
|
|
|
unsigned short bi_max_vecs;
|
|
|
|
atomic_t __bi_cnt;
|
|
|
|
struct bio_vec *bi_io_vec;
|
|
|
|
struct bio_set *bi_pool;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct bio_vec bi_inline_vecs[0];
|
|
};
|
|
# 146 "include/linux/blk_types.h"
|
|
enum rq_flag_bits {
|
|
|
|
__REQ_WRITE,
|
|
__REQ_FAILFAST_DEV,
|
|
__REQ_FAILFAST_TRANSPORT,
|
|
__REQ_FAILFAST_DRIVER,
|
|
|
|
__REQ_SYNC,
|
|
__REQ_META,
|
|
__REQ_PRIO,
|
|
__REQ_DISCARD,
|
|
__REQ_SECURE,
|
|
__REQ_WRITE_SAME,
|
|
|
|
__REQ_NOIDLE,
|
|
__REQ_INTEGRITY,
|
|
__REQ_FUA,
|
|
__REQ_FLUSH,
|
|
|
|
|
|
__REQ_RAHEAD,
|
|
__REQ_THROTTLED,
|
|
|
|
|
|
|
|
__REQ_SORTED,
|
|
__REQ_SOFTBARRIER,
|
|
__REQ_NOMERGE,
|
|
__REQ_STARTED,
|
|
__REQ_DONTPREP,
|
|
__REQ_QUEUED,
|
|
__REQ_ELVPRIV,
|
|
__REQ_FAILED,
|
|
__REQ_QUIET,
|
|
__REQ_PREEMPT,
|
|
|
|
|
|
__REQ_ALLOCED,
|
|
__REQ_COPY_USER,
|
|
__REQ_FLUSH_SEQ,
|
|
__REQ_IO_STAT,
|
|
__REQ_MIXED_MERGE,
|
|
__REQ_PM,
|
|
__REQ_HASHED,
|
|
__REQ_MQ_INFLIGHT,
|
|
__REQ_NO_TIMEOUT,
|
|
__REQ_NR_BITS,
|
|
};
|
|
# 247 "include/linux/blk_types.h"
|
|
typedef unsigned int blk_qc_t;
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool blk_qc_t_valid(blk_qc_t cookie)
|
|
{
|
|
return cookie != -1U;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) blk_qc_t blk_tag_to_qc_t(unsigned int tag, unsigned int queue_num)
|
|
{
|
|
return tag | (queue_num << 16);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int blk_qc_t_to_queue_num(blk_qc_t cookie)
|
|
{
|
|
return cookie >> 16;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int blk_qc_t_to_tag(blk_qc_t cookie)
|
|
{
|
|
return cookie & ((1u << 16) - 1);
|
|
}
|
|
# 29 "./arch/arm/include/asm/io.h" 2
|
|
|
|
|
|
# 1 "include/asm-generic/pci_iomap.h" 1
|
|
# 14 "include/asm-generic/pci_iomap.h"
|
|
struct pci_dev;
|
|
|
|
|
|
extern void *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
|
|
extern void *pci_iomap_wc(struct pci_dev *dev, int bar, unsigned long max);
|
|
extern void *pci_iomap_range(struct pci_dev *dev, int bar,
|
|
unsigned long offset,
|
|
unsigned long maxlen);
|
|
extern void *pci_iomap_wc_range(struct pci_dev *dev, int bar,
|
|
unsigned long offset,
|
|
unsigned long maxlen);
|
|
# 32 "./arch/arm/include/asm/io.h" 2
|
|
# 1 "include/xen/xen.h" 1
|
|
|
|
|
|
|
|
enum xen_domain_type {
|
|
XEN_NATIVE,
|
|
XEN_PV_DOMAIN,
|
|
XEN_HVM_DOMAIN,
|
|
};
|
|
# 33 "./arch/arm/include/asm/io.h" 2
|
|
# 44 "./arch/arm/include/asm/io.h"
|
|
extern void atomic_io_modify(void *reg, u32 mask, u32 set);
|
|
extern void atomic_io_modify_relaxed(void *reg, u32 mask, u32 set);
|
|
|
|
|
|
|
|
|
|
|
|
void __raw_writesb(volatile void *addr, const void *data, int bytelen);
|
|
void __raw_writesw(volatile void *addr, const void *data, int wordlen);
|
|
void __raw_writesl(volatile void *addr, const void *data, int longlen);
|
|
|
|
void __raw_readsb(const volatile void *addr, void *data, int bytelen);
|
|
void __raw_readsw(const volatile void *addr, void *data, int wordlen);
|
|
void __raw_readsl(const volatile void *addr, void *data, int longlen);
|
|
# 74 "./arch/arm/include/asm/io.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_writew(u16 val, volatile void *addr)
|
|
{
|
|
asm volatile("strh %1, %0"
|
|
: : "Q" (*(volatile u16 *)addr), "r" (val));
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u16 __raw_readw(const volatile void *addr)
|
|
{
|
|
u16 val;
|
|
asm volatile("ldrh %0, %1"
|
|
: "=r" (val)
|
|
: "Q" (*(volatile u16 *)addr));
|
|
return val;
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_writeb(u8 val, volatile void *addr)
|
|
{
|
|
asm volatile("strb %1, %0"
|
|
: : "Qo" (*(volatile u8 *)addr), "r" (val));
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __raw_writel(u32 val, volatile void *addr)
|
|
{
|
|
asm volatile("str %1, %0"
|
|
: : "Qo" (*(volatile u32 *)addr), "r" (val));
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u8 __raw_readb(const volatile void *addr)
|
|
{
|
|
u8 val;
|
|
asm volatile("ldrb %0, %1"
|
|
: "=r" (val)
|
|
: "Qo" (*(volatile u8 *)addr));
|
|
return val;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 __raw_readl(const volatile void *addr)
|
|
{
|
|
u32 val;
|
|
asm volatile("ldr %0, %1"
|
|
: "=r" (val)
|
|
: "Qo" (*(volatile u32 *)addr));
|
|
return val;
|
|
}
|
|
# 143 "./arch/arm/include/asm/io.h"
|
|
extern void *__arm_ioremap_caller(phys_addr_t, size_t, unsigned int,
|
|
void *);
|
|
extern void *__arm_ioremap_pfn(unsigned long, unsigned long, size_t, unsigned int);
|
|
extern void *__arm_ioremap_exec(phys_addr_t, size_t, bool cached);
|
|
extern void __iounmap(volatile void *addr);
|
|
|
|
extern void * (*arch_ioremap_caller)(phys_addr_t, size_t,
|
|
unsigned int, void *);
|
|
extern void (*arch_iounmap)(volatile void *);
|
|
|
|
|
|
|
|
|
|
extern void __readwrite_bug(const char *fn);
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *__typesafe_io(unsigned long addr)
|
|
{
|
|
return (void *)addr;
|
|
}
|
|
# 183 "./arch/arm/include/asm/io.h"
|
|
void pci_ioremap_set_mem_type(int mem_type);
|
|
|
|
|
|
|
|
|
|
extern int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr);
|
|
# 272 "./arch/arm/include/asm/io.h"
|
|
extern void _memcpy_fromio(void *, const volatile void *, size_t);
|
|
extern void _memcpy_toio(volatile void *, const void *, size_t);
|
|
extern void _memset_io(volatile void *, int, size_t);
|
|
# 316 "./arch/arm/include/asm/io.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void memset_io(volatile void *dst, unsigned c,
|
|
size_t count)
|
|
{
|
|
extern void mmioset(void *, unsigned int, size_t);
|
|
mmioset((void *)dst, c, count);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void memcpy_fromio(void *to, const volatile void *from,
|
|
size_t count)
|
|
{
|
|
extern void mmiocpy(void *, const void *, size_t);
|
|
mmiocpy(to, (const void *)from, count);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void memcpy_toio(volatile void *to, const void *from,
|
|
size_t count)
|
|
{
|
|
extern void mmiocpy(void *, const void *, size_t);
|
|
mmiocpy((void *)to, from, count);
|
|
}
|
|
# 391 "./arch/arm/include/asm/io.h"
|
|
void *ioremap(resource_size_t res_cookie, size_t size);
|
|
|
|
|
|
|
|
void *ioremap_cache(resource_size_t res_cookie, size_t size);
|
|
|
|
|
|
void *ioremap_wc(resource_size_t res_cookie, size_t size);
|
|
|
|
|
|
|
|
void iounmap(volatile void *iomem_cookie);
|
|
# 416 "./arch/arm/include/asm/io.h"
|
|
extern void *ioport_map(unsigned long port, unsigned int nr);
|
|
|
|
|
|
|
|
extern void ioport_unmap(void *addr);
|
|
|
|
|
|
struct pci_dev;
|
|
|
|
|
|
extern void pci_iounmap(struct pci_dev *dev, void *addr);
|
|
# 439 "./arch/arm/include/asm/io.h"
|
|
# 1 "include/asm-generic/io.h" 1
|
|
# 410 "include/asm-generic/io.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u8 inb_p(unsigned long addr)
|
|
{
|
|
return ({ __u8 __v = __raw_readb(__typesafe_io(0xfee00000 + ((addr) & ((resource_size_t)0xfffff)))); __asm__ __volatile__ ("dsb " "" : : : "memory"); __v; });
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u16 inw_p(unsigned long addr)
|
|
{
|
|
return ({ __u16 __v = (( __u16)(__le16)(( __le16) __raw_readw(__typesafe_io(0xfee00000 + ((addr) & ((resource_size_t)0xfffff)))))); __asm__ __volatile__ ("dsb " "" : : : "memory"); __v; });
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 inl_p(unsigned long addr)
|
|
{
|
|
return ({ __u32 __v = (( __u32)(__le32)(( __le32) __raw_readl(__typesafe_io(0xfee00000 + ((addr) & ((resource_size_t)0xfffff)))))); __asm__ __volatile__ ("dsb " "" : : : "memory"); __v; });
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void outb_p(u8 value, unsigned long addr)
|
|
{
|
|
({ do { __asm__ __volatile__ ("dsb " "st" : : : "memory"); arm_heavy_mb(); } while (0); __raw_writeb(value,__typesafe_io(0xfee00000 + ((addr) & ((resource_size_t)0xfffff)))); });
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void outw_p(u16 value, unsigned long addr)
|
|
{
|
|
({ do { __asm__ __volatile__ ("dsb " "st" : : : "memory"); arm_heavy_mb(); } while (0); __raw_writew(( __u16) (( __le16)(__u16)(value)),__typesafe_io(0xfee00000 + ((addr) & ((resource_size_t)0xfffff)))); });
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void outl_p(u32 value, unsigned long addr)
|
|
{
|
|
({ do { __asm__ __volatile__ ("dsb " "st" : : : "memory"); arm_heavy_mb(); } while (0); __raw_writel(( __u32) (( __le32)(__u32)(value)),__typesafe_io(0xfee00000 + ((addr) & ((resource_size_t)0xfffff)))); });
|
|
}
|
|
# 514 "include/asm-generic/io.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void insb_p(unsigned long addr, void *buffer, unsigned int count)
|
|
{
|
|
__raw_readsb(__typesafe_io(0xfee00000 + ((addr) & ((resource_size_t)0xfffff))),buffer,count);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void insw_p(unsigned long addr, void *buffer, unsigned int count)
|
|
{
|
|
__raw_readsw(__typesafe_io(0xfee00000 + ((addr) & ((resource_size_t)0xfffff))),buffer,count);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void insl_p(unsigned long addr, void *buffer, unsigned int count)
|
|
{
|
|
__raw_readsl(__typesafe_io(0xfee00000 + ((addr) & ((resource_size_t)0xfffff))),buffer,count);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void outsb_p(unsigned long addr, const void *buffer,
|
|
unsigned int count)
|
|
{
|
|
__raw_writesb(__typesafe_io(0xfee00000 + ((addr) & ((resource_size_t)0xfffff))),buffer,count);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void outsw_p(unsigned long addr, const void *buffer,
|
|
unsigned int count)
|
|
{
|
|
__raw_writesw(__typesafe_io(0xfee00000 + ((addr) & ((resource_size_t)0xfffff))),buffer,count);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void outsl_p(unsigned long addr, const void *buffer,
|
|
unsigned int count)
|
|
{
|
|
__raw_writesl(__typesafe_io(0xfee00000 + ((addr) & ((resource_size_t)0xfffff))),buffer,count);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u8 ioread8(const volatile void *addr)
|
|
{
|
|
return ({ u8 __v = ({ u8 __r = __raw_readb(addr); __r; }); __asm__ __volatile__ ("dsb " "" : : : "memory"); __v; });
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u16 ioread16(const volatile void *addr)
|
|
{
|
|
return ({ u16 __v = ({ u16 __r = (( __u16)(__le16)(( __le16) __raw_readw(addr))); __r; }); __asm__ __volatile__ ("dsb " "" : : : "memory"); __v; });
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 ioread32(const volatile void *addr)
|
|
{
|
|
return ({ u32 __v = ({ u32 __r = (( __u32)(__le32)(( __le32) __raw_readl(addr))); __r; }); __asm__ __volatile__ ("dsb " "" : : : "memory"); __v; });
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void iowrite8(u8 value, volatile void *addr)
|
|
{
|
|
({ do { __asm__ __volatile__ ("dsb " "st" : : : "memory"); arm_heavy_mb(); } while (0); __raw_writeb(value,addr); });
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void iowrite16(u16 value, volatile void *addr)
|
|
{
|
|
({ do { __asm__ __volatile__ ("dsb " "st" : : : "memory"); arm_heavy_mb(); } while (0); __raw_writew(( u16) (( __le16)(__u16)(value)),addr); });
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void iowrite32(u32 value, volatile void *addr)
|
|
{
|
|
({ do { __asm__ __volatile__ ("dsb " "st" : : : "memory"); arm_heavy_mb(); } while (0); __raw_writel(( u32) (( __le32)(__u32)(value)),addr); });
|
|
}
|
|
# 646 "include/asm-generic/io.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ioread8_rep(const volatile void *addr, void *buffer,
|
|
unsigned int count)
|
|
{
|
|
__raw_readsb(addr,buffer,count);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ioread16_rep(const volatile void *addr,
|
|
void *buffer, unsigned int count)
|
|
{
|
|
__raw_readsw(addr,buffer,count);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ioread32_rep(const volatile void *addr,
|
|
void *buffer, unsigned int count)
|
|
{
|
|
__raw_readsl(addr,buffer,count);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void iowrite8_rep(volatile void *addr,
|
|
const void *buffer,
|
|
unsigned int count)
|
|
{
|
|
__raw_writesb(addr,buffer,count);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void iowrite16_rep(volatile void *addr,
|
|
const void *buffer,
|
|
unsigned int count)
|
|
{
|
|
__raw_writesw(addr,buffer,count);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void iowrite32_rep(volatile void *addr,
|
|
const void *buffer,
|
|
unsigned int count)
|
|
{
|
|
__raw_writesl(addr,buffer,count);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/vmalloc.h" 1
|
|
# 10 "include/linux/vmalloc.h"
|
|
struct vm_area_struct;
|
|
# 31 "include/linux/vmalloc.h"
|
|
struct vm_struct {
|
|
struct vm_struct *next;
|
|
void *addr;
|
|
unsigned long size;
|
|
unsigned long flags;
|
|
struct page **pages;
|
|
unsigned int nr_pages;
|
|
phys_addr_t phys_addr;
|
|
const void *caller;
|
|
};
|
|
|
|
struct vmap_area {
|
|
unsigned long va_start;
|
|
unsigned long va_end;
|
|
unsigned long flags;
|
|
struct rb_node rb_node;
|
|
struct list_head list;
|
|
struct list_head purge_list;
|
|
struct vm_struct *vm;
|
|
struct callback_head callback_head;
|
|
};
|
|
|
|
|
|
|
|
|
|
extern void vm_unmap_ram(const void *mem, unsigned int count);
|
|
extern void *vm_map_ram(struct page **pages, unsigned int count,
|
|
int node, pgprot_t prot);
|
|
extern void vm_unmap_aliases(void);
|
|
|
|
|
|
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) vmalloc_init(void);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern void *vmalloc(unsigned long size);
|
|
extern void *vzalloc(unsigned long size);
|
|
extern void *vmalloc_user(unsigned long size);
|
|
extern void *vmalloc_node(unsigned long size, int node);
|
|
extern void *vzalloc_node(unsigned long size, int node);
|
|
extern void *vmalloc_exec(unsigned long size);
|
|
extern void *vmalloc_32(unsigned long size);
|
|
extern void *vmalloc_32_user(unsigned long size);
|
|
extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot);
|
|
extern void *__vmalloc_node_range(unsigned long size, unsigned long align,
|
|
unsigned long start, unsigned long end, gfp_t gfp_mask,
|
|
pgprot_t prot, unsigned long vm_flags, int node,
|
|
const void *caller);
|
|
|
|
extern void vfree(const void *addr);
|
|
|
|
extern void *vmap(struct page **pages, unsigned int count,
|
|
unsigned long flags, pgprot_t prot);
|
|
extern void vunmap(const void *addr);
|
|
|
|
extern int remap_vmalloc_range_partial(struct vm_area_struct *vma,
|
|
unsigned long uaddr, void *kaddr,
|
|
unsigned long size);
|
|
|
|
extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
|
|
unsigned long pgoff);
|
|
void vmalloc_sync_all(void);
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) size_t get_vm_area_size(const struct vm_struct *area)
|
|
{
|
|
if (!(area->flags & 0x00000040))
|
|
|
|
return area->size - ((1UL) << 12);
|
|
else
|
|
return area->size;
|
|
|
|
}
|
|
|
|
extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags);
|
|
extern struct vm_struct *get_vm_area_caller(unsigned long size,
|
|
unsigned long flags, const void *caller);
|
|
extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags,
|
|
unsigned long start, unsigned long end);
|
|
extern struct vm_struct *__get_vm_area_caller(unsigned long size,
|
|
unsigned long flags,
|
|
unsigned long start, unsigned long end,
|
|
const void *caller);
|
|
extern struct vm_struct *remove_vm_area(const void *addr);
|
|
extern struct vm_struct *find_vm_area(const void *addr);
|
|
|
|
extern int map_vm_area(struct vm_struct *area, pgprot_t prot,
|
|
struct page **pages);
|
|
|
|
extern int map_kernel_range_noflush(unsigned long start, unsigned long size,
|
|
pgprot_t prot, struct page **pages);
|
|
extern void unmap_kernel_range_noflush(unsigned long addr, unsigned long size);
|
|
extern void unmap_kernel_range(unsigned long addr, unsigned long size);
|
|
# 148 "include/linux/vmalloc.h"
|
|
extern struct vm_struct *alloc_vm_area(size_t size, pte_t **ptes);
|
|
extern void free_vm_area(struct vm_struct *area);
|
|
|
|
|
|
extern long vread(char *buf, char *addr, unsigned long count);
|
|
extern long vwrite(char *buf, char *addr, unsigned long count);
|
|
|
|
|
|
|
|
|
|
extern struct list_head vmap_area_list;
|
|
extern __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) void vm_area_add_early(struct vm_struct *vm);
|
|
extern __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) void vm_area_register_early(struct vm_struct *vm, size_t align);
|
|
|
|
|
|
|
|
struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets,
|
|
const size_t *sizes, int nr_vms,
|
|
size_t align);
|
|
|
|
void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms);
|
|
# 705 "include/asm-generic/io.h" 2
|
|
|
|
|
|
|
|
struct pci_dev;
|
|
extern void *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
|
|
# 760 "include/asm-generic/io.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *ioremap_uc(phys_addr_t offset, size_t size)
|
|
{
|
|
return ((void *)0);
|
|
}
|
|
# 873 "include/asm-generic/io.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr)
|
|
{
|
|
}
|
|
# 440 "./arch/arm/include/asm/io.h" 2
|
|
# 448 "./arch/arm/include/asm/io.h"
|
|
struct bio_vec;
|
|
extern bool xen_biovec_phys_mergeable(const struct bio_vec *vec1,
|
|
const struct bio_vec *vec2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern int valid_phys_addr_range(phys_addr_t addr, size_t size);
|
|
extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size);
|
|
extern int devmem_is_allowed(unsigned long pfn);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern void register_isa_ports(unsigned int mmio, unsigned int io,
|
|
unsigned int io_shift);
|
|
# 9 "include/linux/scatterlist.h" 2
|
|
|
|
struct scatterlist {
|
|
|
|
|
|
|
|
unsigned long page_link;
|
|
unsigned int offset;
|
|
unsigned int length;
|
|
dma_addr_t dma_address;
|
|
|
|
unsigned int dma_length;
|
|
|
|
};
|
|
# 38 "include/linux/scatterlist.h"
|
|
struct sg_table {
|
|
struct scatterlist *sgl;
|
|
unsigned int nents;
|
|
unsigned int orig_nents;
|
|
};
|
|
# 82 "include/linux/scatterlist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sg_assign_page(struct scatterlist *sg, struct page *page)
|
|
{
|
|
unsigned long page_link = sg->page_link & 0x3;
|
|
|
|
|
|
|
|
|
|
|
|
do { if (__builtin_expect(!!((unsigned long) page & 0x03), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/scatterlist.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "90" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
|
|
|
|
|
|
|
|
sg->page_link = page_link | (unsigned long) page;
|
|
}
|
|
# 112 "include/linux/scatterlist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sg_set_page(struct scatterlist *sg, struct page *page,
|
|
unsigned int len, unsigned int offset)
|
|
{
|
|
sg_assign_page(sg, page);
|
|
sg->offset = offset;
|
|
sg->length = len;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *sg_page(struct scatterlist *sg)
|
|
{
|
|
|
|
|
|
|
|
|
|
return (struct page *)((sg)->page_link & ~0x3);
|
|
}
|
|
# 136 "include/linux/scatterlist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sg_set_buf(struct scatterlist *sg, const void *buf,
|
|
unsigned int buflen)
|
|
{
|
|
|
|
|
|
|
|
sg_set_page(sg, (mem_map + ((((((unsigned long)(buf) - (0xC0000000UL)) >> 12) + (__pv_phys_pfn_offset))) - (__pv_phys_pfn_offset))), buflen, ((unsigned long)(buf) & ~(~((1 << 12) - 1))));
|
|
}
|
|
# 161 "include/linux/scatterlist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sg_chain(struct scatterlist *prv, unsigned int prv_nents,
|
|
struct scatterlist *sgl)
|
|
{
|
|
|
|
|
|
|
|
prv[prv_nents - 1].offset = 0;
|
|
prv[prv_nents - 1].length = 0;
|
|
|
|
|
|
|
|
|
|
|
|
prv[prv_nents - 1].page_link = ((unsigned long) sgl | 0x01) & ~0x02;
|
|
}
|
|
# 186 "include/linux/scatterlist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sg_mark_end(struct scatterlist *sg)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sg->page_link |= 0x02;
|
|
sg->page_link &= ~0x01;
|
|
}
|
|
# 206 "include/linux/scatterlist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sg_unmark_end(struct scatterlist *sg)
|
|
{
|
|
|
|
|
|
|
|
sg->page_link &= ~0x02;
|
|
}
|
|
# 224 "include/linux/scatterlist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) dma_addr_t sg_phys(struct scatterlist *sg)
|
|
{
|
|
return (((phys_addr_t)(((unsigned long)((sg_page(sg)) - mem_map) + (__pv_phys_pfn_offset))) << 12)) + sg->offset;
|
|
}
|
|
# 239 "include/linux/scatterlist.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *sg_virt(struct scatterlist *sg)
|
|
{
|
|
return page_address(sg_page(sg)) + sg->offset;
|
|
}
|
|
|
|
int sg_nents(struct scatterlist *sg);
|
|
int sg_nents_for_len(struct scatterlist *sg, u64 len);
|
|
struct scatterlist *sg_next(struct scatterlist *);
|
|
struct scatterlist *sg_last(struct scatterlist *s, unsigned int);
|
|
void sg_init_table(struct scatterlist *, unsigned int);
|
|
void sg_init_one(struct scatterlist *, const void *, unsigned int);
|
|
int sg_split(struct scatterlist *in, const int in_mapped_nents,
|
|
const off_t skip, const int nb_splits,
|
|
const size_t *split_sizes,
|
|
struct scatterlist **out, int *out_mapped_nents,
|
|
gfp_t gfp_mask);
|
|
|
|
typedef struct scatterlist *(sg_alloc_fn)(unsigned int, gfp_t);
|
|
typedef void (sg_free_fn)(struct scatterlist *, unsigned int);
|
|
|
|
void __sg_free_table(struct sg_table *, unsigned int, bool, sg_free_fn *);
|
|
void sg_free_table(struct sg_table *);
|
|
int __sg_alloc_table(struct sg_table *, unsigned int, unsigned int,
|
|
struct scatterlist *, gfp_t, sg_alloc_fn *);
|
|
int sg_alloc_table(struct sg_table *, unsigned int, gfp_t);
|
|
int sg_alloc_table_from_pages(struct sg_table *sgt,
|
|
struct page **pages, unsigned int n_pages,
|
|
unsigned long offset, unsigned long size,
|
|
gfp_t gfp_mask);
|
|
|
|
size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf,
|
|
size_t buflen, off_t skip, bool to_buffer);
|
|
|
|
size_t sg_copy_from_buffer(struct scatterlist *sgl, unsigned int nents,
|
|
const void *buf, size_t buflen);
|
|
size_t sg_copy_to_buffer(struct scatterlist *sgl, unsigned int nents,
|
|
void *buf, size_t buflen);
|
|
|
|
size_t sg_pcopy_from_buffer(struct scatterlist *sgl, unsigned int nents,
|
|
const void *buf, size_t buflen, off_t skip);
|
|
size_t sg_pcopy_to_buffer(struct scatterlist *sgl, unsigned int nents,
|
|
void *buf, size_t buflen, off_t skip);
|
|
# 298 "include/linux/scatterlist.h"
|
|
struct sg_page_iter {
|
|
struct scatterlist *sg;
|
|
unsigned int sg_pgoffset;
|
|
|
|
|
|
unsigned int __nents;
|
|
int __pg_advance;
|
|
|
|
};
|
|
|
|
bool __sg_page_iter_next(struct sg_page_iter *piter);
|
|
void __sg_page_iter_start(struct sg_page_iter *piter,
|
|
struct scatterlist *sglist, unsigned int nents,
|
|
unsigned long pgoffset);
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *sg_page_iter_page(struct sg_page_iter *piter)
|
|
{
|
|
return (mem_map + ((((unsigned long)(((sg_page(piter->sg))) - mem_map) + (__pv_phys_pfn_offset)) + (piter->sg_pgoffset)) - (__pv_phys_pfn_offset)));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) dma_addr_t sg_page_iter_dma_address(struct sg_page_iter *piter)
|
|
{
|
|
return ((piter->sg)->dma_address) + (piter->sg_pgoffset << 12);
|
|
}
|
|
# 362 "include/linux/scatterlist.h"
|
|
struct sg_mapping_iter {
|
|
|
|
struct page *page;
|
|
void *addr;
|
|
size_t length;
|
|
size_t consumed;
|
|
struct sg_page_iter piter;
|
|
|
|
|
|
unsigned int __offset;
|
|
unsigned int __remaining;
|
|
unsigned int __flags;
|
|
};
|
|
|
|
void sg_miter_start(struct sg_mapping_iter *miter, struct scatterlist *sgl,
|
|
unsigned int nents, unsigned int flags);
|
|
bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset);
|
|
bool sg_miter_next(struct sg_mapping_iter *miter);
|
|
void sg_miter_stop(struct sg_mapping_iter *miter);
|
|
# 11 "include/linux/dma-mapping.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct dma_map_ops {
|
|
void* (*alloc)(struct device *dev, size_t size,
|
|
dma_addr_t *dma_handle, gfp_t gfp,
|
|
struct dma_attrs *attrs);
|
|
void (*free)(struct device *dev, size_t size,
|
|
void *vaddr, dma_addr_t dma_handle,
|
|
struct dma_attrs *attrs);
|
|
int (*mmap)(struct device *, struct vm_area_struct *,
|
|
void *, dma_addr_t, size_t, struct dma_attrs *attrs);
|
|
|
|
int (*get_sgtable)(struct device *dev, struct sg_table *sgt, void *,
|
|
dma_addr_t, size_t, struct dma_attrs *attrs);
|
|
|
|
dma_addr_t (*map_page)(struct device *dev, struct page *page,
|
|
unsigned long offset, size_t size,
|
|
enum dma_data_direction dir,
|
|
struct dma_attrs *attrs);
|
|
void (*unmap_page)(struct device *dev, dma_addr_t dma_handle,
|
|
size_t size, enum dma_data_direction dir,
|
|
struct dma_attrs *attrs);
|
|
|
|
|
|
|
|
|
|
int (*map_sg)(struct device *dev, struct scatterlist *sg,
|
|
int nents, enum dma_data_direction dir,
|
|
struct dma_attrs *attrs);
|
|
void (*unmap_sg)(struct device *dev,
|
|
struct scatterlist *sg, int nents,
|
|
enum dma_data_direction dir,
|
|
struct dma_attrs *attrs);
|
|
void (*sync_single_for_cpu)(struct device *dev,
|
|
dma_addr_t dma_handle, size_t size,
|
|
enum dma_data_direction dir);
|
|
void (*sync_single_for_device)(struct device *dev,
|
|
dma_addr_t dma_handle, size_t size,
|
|
enum dma_data_direction dir);
|
|
void (*sync_sg_for_cpu)(struct device *dev,
|
|
struct scatterlist *sg, int nents,
|
|
enum dma_data_direction dir);
|
|
void (*sync_sg_for_device)(struct device *dev,
|
|
struct scatterlist *sg, int nents,
|
|
enum dma_data_direction dir);
|
|
int (*mapping_error)(struct device *dev, dma_addr_t dma_addr);
|
|
int (*dma_supported)(struct device *dev, u64 mask);
|
|
int (*set_dma_mask)(struct device *dev, u64 mask);
|
|
|
|
|
|
|
|
int is_phys;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int valid_dma_direction(int dma_direction)
|
|
{
|
|
return ((dma_direction == DMA_BIDIRECTIONAL) ||
|
|
(dma_direction == DMA_TO_DEVICE) ||
|
|
(dma_direction == DMA_FROM_DEVICE));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_device_dma_capable(struct device *dev)
|
|
{
|
|
return dev->dma_mask != ((void *)0) && *dev->dma_mask != 0x0ULL;
|
|
}
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/dma-mapping.h" 1
|
|
# 9 "./arch/arm/include/asm/dma-mapping.h"
|
|
# 1 "include/linux/dma-debug.h" 1
|
|
# 25 "include/linux/dma-debug.h"
|
|
struct device;
|
|
struct scatterlist;
|
|
struct bus_type;
|
|
# 92 "include/linux/dma-debug.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dma_debug_add_bus(struct bus_type *bus)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dma_debug_init(u32 num_entries)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dma_debug_resize_entries(u32 num_entries)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_dma_map_page(struct device *dev, struct page *page,
|
|
size_t offset, size_t size,
|
|
int direction, dma_addr_t dma_addr,
|
|
bool map_single)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_dma_mapping_error(struct device *dev,
|
|
dma_addr_t dma_addr)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_dma_unmap_page(struct device *dev, dma_addr_t addr,
|
|
size_t size, int direction,
|
|
bool map_single)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_dma_map_sg(struct device *dev, struct scatterlist *sg,
|
|
int nents, int mapped_ents, int direction)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_dma_unmap_sg(struct device *dev,
|
|
struct scatterlist *sglist,
|
|
int nelems, int dir)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_dma_alloc_coherent(struct device *dev, size_t size,
|
|
dma_addr_t dma_addr, void *virt)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_dma_free_coherent(struct device *dev, size_t size,
|
|
void *virt, dma_addr_t addr)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_dma_sync_single_for_cpu(struct device *dev,
|
|
dma_addr_t dma_handle,
|
|
size_t size, int direction)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_dma_sync_single_for_device(struct device *dev,
|
|
dma_addr_t dma_handle,
|
|
size_t size, int direction)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_dma_sync_single_range_for_cpu(struct device *dev,
|
|
dma_addr_t dma_handle,
|
|
unsigned long offset,
|
|
size_t size,
|
|
int direction)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_dma_sync_single_range_for_device(struct device *dev,
|
|
dma_addr_t dma_handle,
|
|
unsigned long offset,
|
|
size_t size,
|
|
int direction)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_dma_sync_sg_for_cpu(struct device *dev,
|
|
struct scatterlist *sg,
|
|
int nelems, int direction)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_dma_sync_sg_for_device(struct device *dev,
|
|
struct scatterlist *sg,
|
|
int nelems, int direction)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_dma_dump_mappings(struct device *dev)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void debug_dma_assert_idle(struct page *page)
|
|
{
|
|
}
|
|
# 10 "./arch/arm/include/asm/dma-mapping.h" 2
|
|
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/xen/hypervisor.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
extern struct shared_info *HYPERVISOR_shared_info;
|
|
extern struct start_info *xen_start_info;
|
|
|
|
|
|
enum paravirt_lazy_mode {
|
|
PARAVIRT_LAZY_NONE,
|
|
PARAVIRT_LAZY_MMU,
|
|
PARAVIRT_LAZY_CPU,
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) enum paravirt_lazy_mode paravirt_get_lazy_mode(void)
|
|
{
|
|
return PARAVIRT_LAZY_NONE;
|
|
}
|
|
|
|
extern struct dma_map_ops *xen_dma_ops;
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void xen_early_init(void) { return; }
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void xen_arch_register_cpu(int num)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void xen_arch_unregister_cpu(int num)
|
|
{
|
|
}
|
|
# 15 "./arch/arm/include/asm/dma-mapping.h" 2
|
|
|
|
|
|
extern struct dma_map_ops arm_dma_ops;
|
|
extern struct dma_map_ops arm_coherent_dma_ops;
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dma_map_ops *__generic_dma_ops(struct device *dev)
|
|
{
|
|
if (dev && dev->archdata.dma_ops)
|
|
return dev->archdata.dma_ops;
|
|
return &arm_dma_ops;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dma_map_ops *get_dma_ops(struct device *dev)
|
|
{
|
|
if ((0))
|
|
return xen_dma_ops;
|
|
else
|
|
return __generic_dma_ops(dev);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_dma_ops(struct device *dev, struct dma_map_ops *ops)
|
|
{
|
|
do { if (__builtin_expect(!!(!dev), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"./arch/arm/include/asm/dma-mapping.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "37" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
dev->archdata.dma_ops = ops;
|
|
}
|
|
|
|
|
|
extern int dma_supported(struct device *dev, u64 mask);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/asm-generic/dma-mapping-common.h" 1
|
|
|
|
|
|
|
|
# 1 "include/linux/kmemcheck.h" 1
|
|
# 92 "include/linux/kmemcheck.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
kmemcheck_alloc_shadow(struct page *page, int order, gfp_t flags, int node)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
kmemcheck_free_shadow(struct page *page, int order)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
kmemcheck_slab_alloc(struct kmem_cache *s, gfp_t gfpflags, void *object,
|
|
size_t size)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemcheck_slab_free(struct kmem_cache *s, void *object,
|
|
size_t size)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemcheck_pagealloc_alloc(struct page *p,
|
|
unsigned int order, gfp_t gfpflags)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool kmemcheck_page_is_tracked(struct page *p)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemcheck_mark_unallocated(void *address, unsigned int n)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemcheck_mark_uninitialized(void *address, unsigned int n)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemcheck_mark_initialized(void *address, unsigned int n)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemcheck_mark_freed(void *address, unsigned int n)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemcheck_mark_unallocated_pages(struct page *p,
|
|
unsigned int n)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemcheck_mark_uninitialized_pages(struct page *p,
|
|
unsigned int n)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemcheck_mark_initialized_pages(struct page *p,
|
|
unsigned int n)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size)
|
|
{
|
|
return true;
|
|
}
|
|
# 5 "include/asm-generic/dma-mapping-common.h" 2
|
|
|
|
|
|
|
|
|
|
# 1 "include/asm-generic/dma-coherent.h" 1
|
|
# 9 "include/asm-generic/dma-coherent.h"
|
|
int dma_alloc_from_coherent(struct device *dev, ssize_t size,
|
|
dma_addr_t *dma_handle, void **ret);
|
|
int dma_release_from_coherent(struct device *dev, int order, void *vaddr);
|
|
|
|
int dma_mmap_from_coherent(struct device *dev, struct vm_area_struct *vma,
|
|
void *cpu_addr, size_t size, int *ret);
|
|
|
|
|
|
|
|
|
|
int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,
|
|
dma_addr_t device_addr, size_t size, int flags);
|
|
|
|
void dma_release_declared_memory(struct device *dev);
|
|
|
|
void *dma_mark_declared_memory_occupied(struct device *dev,
|
|
dma_addr_t device_addr, size_t size);
|
|
# 10 "include/asm-generic/dma-mapping-common.h" 2
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr,
|
|
size_t size,
|
|
enum dma_data_direction dir,
|
|
struct dma_attrs *attrs)
|
|
{
|
|
struct dma_map_ops *ops = get_dma_ops(dev);
|
|
dma_addr_t addr;
|
|
|
|
kmemcheck_mark_initialized(ptr, size);
|
|
do { if (__builtin_expect(!!(!valid_dma_direction(dir)), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/asm-generic/dma-mapping-common.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "20" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
addr = ops->map_page(dev, (mem_map + ((((((unsigned long)(ptr) - (0xC0000000UL)) >> 12) + (__pv_phys_pfn_offset))) - (__pv_phys_pfn_offset))),
|
|
(unsigned long)ptr & ~(~((1 << 12) - 1)), size,
|
|
dir, attrs);
|
|
debug_dma_map_page(dev, (mem_map + ((((((unsigned long)(ptr) - (0xC0000000UL)) >> 12) + (__pv_phys_pfn_offset))) - (__pv_phys_pfn_offset))),
|
|
(unsigned long)ptr & ~(~((1 << 12) - 1)), size,
|
|
dir, addr, true);
|
|
return addr;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dma_unmap_single_attrs(struct device *dev, dma_addr_t addr,
|
|
size_t size,
|
|
enum dma_data_direction dir,
|
|
struct dma_attrs *attrs)
|
|
{
|
|
struct dma_map_ops *ops = get_dma_ops(dev);
|
|
|
|
do { if (__builtin_expect(!!(!valid_dma_direction(dir)), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/asm-generic/dma-mapping-common.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "37" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
if (ops->unmap_page)
|
|
ops->unmap_page(dev, addr, size, dir, attrs);
|
|
debug_dma_unmap_page(dev, addr, size, dir, true);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dma_map_sg_attrs(struct device *dev, struct scatterlist *sg,
|
|
int nents, enum dma_data_direction dir,
|
|
struct dma_attrs *attrs)
|
|
{
|
|
struct dma_map_ops *ops = get_dma_ops(dev);
|
|
int i, ents;
|
|
struct scatterlist *s;
|
|
|
|
for (i = 0, s = (sg); i < (nents); i++, s = sg_next(s))
|
|
kmemcheck_mark_initialized(sg_virt(s), s->length);
|
|
do { if (__builtin_expect(!!(!valid_dma_direction(dir)), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/asm-generic/dma-mapping-common.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "57" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
ents = ops->map_sg(dev, sg, nents, dir, attrs);
|
|
do { if (__builtin_expect(!!(ents < 0), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/asm-generic/dma-mapping-common.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "59" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
debug_dma_map_sg(dev, sg, nents, ents, dir);
|
|
|
|
return ents;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sg,
|
|
int nents, enum dma_data_direction dir,
|
|
struct dma_attrs *attrs)
|
|
{
|
|
struct dma_map_ops *ops = get_dma_ops(dev);
|
|
|
|
do { if (__builtin_expect(!!(!valid_dma_direction(dir)), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/asm-generic/dma-mapping-common.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "71" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
debug_dma_unmap_sg(dev, sg, nents, dir);
|
|
if (ops->unmap_sg)
|
|
ops->unmap_sg(dev, sg, nents, dir, attrs);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) dma_addr_t dma_map_page(struct device *dev, struct page *page,
|
|
size_t offset, size_t size,
|
|
enum dma_data_direction dir)
|
|
{
|
|
struct dma_map_ops *ops = get_dma_ops(dev);
|
|
dma_addr_t addr;
|
|
|
|
kmemcheck_mark_initialized(page_address(page) + offset, size);
|
|
do { if (__builtin_expect(!!(!valid_dma_direction(dir)), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/asm-generic/dma-mapping-common.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "85" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
addr = ops->map_page(dev, page, offset, size, dir, ((void *)0));
|
|
debug_dma_map_page(dev, page, offset, size, dir, addr, false);
|
|
|
|
return addr;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dma_unmap_page(struct device *dev, dma_addr_t addr,
|
|
size_t size, enum dma_data_direction dir)
|
|
{
|
|
struct dma_map_ops *ops = get_dma_ops(dev);
|
|
|
|
do { if (__builtin_expect(!!(!valid_dma_direction(dir)), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/asm-generic/dma-mapping-common.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "97" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
if (ops->unmap_page)
|
|
ops->unmap_page(dev, addr, size, dir, ((void *)0));
|
|
debug_dma_unmap_page(dev, addr, size, dir, false);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dma_sync_single_for_cpu(struct device *dev, dma_addr_t addr,
|
|
size_t size,
|
|
enum dma_data_direction dir)
|
|
{
|
|
struct dma_map_ops *ops = get_dma_ops(dev);
|
|
|
|
do { if (__builtin_expect(!!(!valid_dma_direction(dir)), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/asm-generic/dma-mapping-common.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "109" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
if (ops->sync_single_for_cpu)
|
|
ops->sync_single_for_cpu(dev, addr, size, dir);
|
|
debug_dma_sync_single_for_cpu(dev, addr, size, dir);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dma_sync_single_for_device(struct device *dev,
|
|
dma_addr_t addr, size_t size,
|
|
enum dma_data_direction dir)
|
|
{
|
|
struct dma_map_ops *ops = get_dma_ops(dev);
|
|
|
|
do { if (__builtin_expect(!!(!valid_dma_direction(dir)), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/asm-generic/dma-mapping-common.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "121" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
if (ops->sync_single_for_device)
|
|
ops->sync_single_for_device(dev, addr, size, dir);
|
|
debug_dma_sync_single_for_device(dev, addr, size, dir);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dma_sync_single_range_for_cpu(struct device *dev,
|
|
dma_addr_t addr,
|
|
unsigned long offset,
|
|
size_t size,
|
|
enum dma_data_direction dir)
|
|
{
|
|
const struct dma_map_ops *ops = get_dma_ops(dev);
|
|
|
|
do { if (__builtin_expect(!!(!valid_dma_direction(dir)), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/asm-generic/dma-mapping-common.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "135" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
if (ops->sync_single_for_cpu)
|
|
ops->sync_single_for_cpu(dev, addr + offset, size, dir);
|
|
debug_dma_sync_single_range_for_cpu(dev, addr, offset, size, dir);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dma_sync_single_range_for_device(struct device *dev,
|
|
dma_addr_t addr,
|
|
unsigned long offset,
|
|
size_t size,
|
|
enum dma_data_direction dir)
|
|
{
|
|
const struct dma_map_ops *ops = get_dma_ops(dev);
|
|
|
|
do { if (__builtin_expect(!!(!valid_dma_direction(dir)), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/asm-generic/dma-mapping-common.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "149" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
if (ops->sync_single_for_device)
|
|
ops->sync_single_for_device(dev, addr + offset, size, dir);
|
|
debug_dma_sync_single_range_for_device(dev, addr, offset, size, dir);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
|
|
int nelems, enum dma_data_direction dir)
|
|
{
|
|
struct dma_map_ops *ops = get_dma_ops(dev);
|
|
|
|
do { if (__builtin_expect(!!(!valid_dma_direction(dir)), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/asm-generic/dma-mapping-common.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "161" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
if (ops->sync_sg_for_cpu)
|
|
ops->sync_sg_for_cpu(dev, sg, nelems, dir);
|
|
debug_dma_sync_sg_for_cpu(dev, sg, nelems, dir);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
|
|
int nelems, enum dma_data_direction dir)
|
|
{
|
|
struct dma_map_ops *ops = get_dma_ops(dev);
|
|
|
|
do { if (__builtin_expect(!!(!valid_dma_direction(dir)), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/asm-generic/dma-mapping-common.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "173" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
if (ops->sync_sg_for_device)
|
|
ops->sync_sg_for_device(dev, sg, nelems, dir);
|
|
debug_dma_sync_sg_for_device(dev, sg, nelems, dir);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma,
|
|
void *cpu_addr, dma_addr_t dma_addr, size_t size);
|
|
|
|
void *dma_common_contiguous_remap(struct page *page, size_t size,
|
|
unsigned long vm_flags,
|
|
pgprot_t prot, const void *caller);
|
|
|
|
void *dma_common_pages_remap(struct page **pages, size_t size,
|
|
unsigned long vm_flags, pgprot_t prot,
|
|
const void *caller);
|
|
void dma_common_free_remap(void *cpu_addr, size_t size, unsigned long vm_flags);
|
|
# 210 "include/asm-generic/dma-mapping-common.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
dma_mmap_attrs(struct device *dev, struct vm_area_struct *vma, void *cpu_addr,
|
|
dma_addr_t dma_addr, size_t size, struct dma_attrs *attrs)
|
|
{
|
|
struct dma_map_ops *ops = get_dma_ops(dev);
|
|
do { if (__builtin_expect(!!(!ops), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/asm-generic/dma-mapping-common.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "215" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
if (ops->mmap)
|
|
return ops->mmap(dev, vma, cpu_addr, dma_addr, size, attrs);
|
|
return dma_common_mmap(dev, vma, cpu_addr, dma_addr, size);
|
|
}
|
|
|
|
|
|
|
|
int
|
|
dma_common_get_sgtable(struct device *dev, struct sg_table *sgt,
|
|
void *cpu_addr, dma_addr_t dma_addr, size_t size);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
dma_get_sgtable_attrs(struct device *dev, struct sg_table *sgt, void *cpu_addr,
|
|
dma_addr_t dma_addr, size_t size, struct dma_attrs *attrs)
|
|
{
|
|
struct dma_map_ops *ops = get_dma_ops(dev);
|
|
do { if (__builtin_expect(!!(!ops), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/asm-generic/dma-mapping-common.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "232" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
if (ops->get_sgtable)
|
|
return ops->get_sgtable(dev, sgt, cpu_addr, dma_addr, size,
|
|
attrs);
|
|
return dma_common_get_sgtable(dev, sgt, cpu_addr, dma_addr, size);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *dma_alloc_attrs(struct device *dev, size_t size,
|
|
dma_addr_t *dma_handle, gfp_t flag,
|
|
struct dma_attrs *attrs)
|
|
{
|
|
struct dma_map_ops *ops = get_dma_ops(dev);
|
|
void *cpu_addr;
|
|
|
|
do { if (__builtin_expect(!!(!ops), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/asm-generic/dma-mapping-common.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "252" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
|
|
if (dma_alloc_from_coherent(dev, size, dma_handle, &cpu_addr))
|
|
return cpu_addr;
|
|
|
|
if (!(true))
|
|
return ((void *)0);
|
|
if (!ops->alloc)
|
|
return ((void *)0);
|
|
|
|
cpu_addr = ops->alloc(dev, size, dma_handle, flag, attrs);
|
|
debug_dma_alloc_coherent(dev, size, *dma_handle, cpu_addr);
|
|
return cpu_addr;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dma_free_attrs(struct device *dev, size_t size,
|
|
void *cpu_addr, dma_addr_t dma_handle,
|
|
struct dma_attrs *attrs)
|
|
{
|
|
struct dma_map_ops *ops = get_dma_ops(dev);
|
|
|
|
do { if (__builtin_expect(!!(!ops), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/asm-generic/dma-mapping-common.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "273" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
({ int __ret_warn_on = !!(({ unsigned long _flags; do { ({ unsigned long __dummy; typeof(_flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); _flags = arch_local_save_flags(); } while (0); ({ ({ unsigned long __dummy; typeof(_flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_irqs_disabled_flags(_flags); }); })); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/asm-generic/dma-mapping-common.h", 274); __builtin_expect(!!(__ret_warn_on), 0); });
|
|
|
|
if (dma_release_from_coherent(dev, ( __builtin_constant_p(size) ? ( ((size) == 0UL) ? 32 - 12 : (((size) < (1UL << 12)) ? 0 : ( __builtin_constant_p((size) - 1) ? ( ((size) - 1) < 2 ? 0 : ((size) - 1) & (1ULL << 63) ? 63 : ((size) - 1) & (1ULL << 62) ? 62 : ((size) - 1) & (1ULL << 61) ? 61 : ((size) - 1) & (1ULL << 60) ? 60 : ((size) - 1) & (1ULL << 59) ? 59 : ((size) - 1) & (1ULL << 58) ? 58 : ((size) - 1) & (1ULL << 57) ? 57 : ((size) - 1) & (1ULL << 56) ? 56 : ((size) - 1) & (1ULL << 55) ? 55 : ((size) - 1) & (1ULL << 54) ? 54 : ((size) - 1) & (1ULL << 53) ? 53 : ((size) - 1) & (1ULL << 52) ? 52 : ((size) - 1) & (1ULL << 51) ? 51 : ((size) - 1) & (1ULL << 50) ? 50 : ((size) - 1) & (1ULL << 49) ? 49 : ((size) - 1) & (1ULL << 48) ? 48 : ((size) - 1) & (1ULL << 47) ? 47 : ((size) - 1) & (1ULL << 46) ? 46 : ((size) - 1) & (1ULL << 45) ? 45 : ((size) - 1) & (1ULL << 44) ? 44 : ((size) - 1) & (1ULL << 43) ? 43 : ((size) - 1) & (1ULL << 42) ? 42 : ((size) - 1) & (1ULL << 41) ? 41 : ((size) - 1) & (1ULL << 40) ? 40 : ((size) - 1) & (1ULL << 39) ? 39 : ((size) - 1) & (1ULL << 38) ? 38 : ((size) - 1) & (1ULL << 37) ? 37 : ((size) - 1) & (1ULL << 36) ? 36 : ((size) - 1) & (1ULL << 35) ? 35 : ((size) - 1) & (1ULL << 34) ? 34 : ((size) - 1) & (1ULL << 33) ? 33 : ((size) - 1) & (1ULL << 32) ? 32 : ((size) - 1) & (1ULL << 31) ? 31 : ((size) - 1) & (1ULL << 30) ? 30 : ((size) - 1) & (1ULL << 29) ? 29 : ((size) - 1) & (1ULL << 28) ? 28 : ((size) - 1) & (1ULL << 27) ? 27 : ((size) - 1) & (1ULL << 26) ? 26 : ((size) - 1) & (1ULL << 25) ? 25 : ((size) - 1) & (1ULL << 24) ? 24 : ((size) - 1) & (1ULL << 23) ? 23 : ((size) - 1) & (1ULL << 22) ? 22 : ((size) - 1) & (1ULL << 21) ? 21 : ((size) - 1) & (1ULL << 20) ? 20 : ((size) - 1) & (1ULL << 19) ? 19 : ((size) - 1) & (1ULL << 18) ? 18 : ((size) - 1) & (1ULL << 17) ? 17 : ((size) - 1) & (1ULL << 16) ? 16 : ((size) - 1) & (1ULL << 15) ? 15 : ((size) - 1) & (1ULL << 14) ? 14 : ((size) - 1) & (1ULL << 13) ? 13 : ((size) - 1) & (1ULL << 12) ? 12 : ((size) - 1) & (1ULL << 11) ? 11 : ((size) - 1) & (1ULL << 10) ? 10 : ((size) - 1) & (1ULL << 9) ? 9 : ((size) - 1) & (1ULL << 8) ? 8 : ((size) - 1) & (1ULL << 7) ? 7 : ((size) - 1) & (1ULL << 6) ? 6 : ((size) - 1) & (1ULL << 5) ? 5 : ((size) - 1) & (1ULL << 4) ? 4 : ((size) - 1) & (1ULL << 3) ? 3 : ((size) - 1) & (1ULL << 2) ? 2 : 1 ) : (sizeof((size) - 1) <= 4) ? __ilog2_u32((size) - 1) : __ilog2_u64((size) - 1) ) - 12 + 1) ) : __get_order(size) ), cpu_addr))
|
|
return;
|
|
|
|
if (!ops->free)
|
|
return;
|
|
|
|
debug_dma_free_coherent(dev, size, cpu_addr, dma_handle);
|
|
ops->free(dev, size, cpu_addr, dma_handle, attrs);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *dma_alloc_coherent(struct device *dev, size_t size,
|
|
dma_addr_t *dma_handle, gfp_t flag)
|
|
{
|
|
return dma_alloc_attrs(dev, size, dma_handle, flag, ((void *)0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dma_free_coherent(struct device *dev, size_t size,
|
|
void *cpu_addr, dma_addr_t dma_handle)
|
|
{
|
|
return dma_free_attrs(dev, size, cpu_addr, dma_handle, ((void *)0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *dma_alloc_noncoherent(struct device *dev, size_t size,
|
|
dma_addr_t *dma_handle, gfp_t gfp)
|
|
{
|
|
struct dma_attrs attrs = { .flags = { [0 ... (((DMA_ATTR_MAX) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))-1] = 0 }, };
|
|
|
|
dma_set_attr(DMA_ATTR_NON_CONSISTENT, &attrs);
|
|
return dma_alloc_attrs(dev, size, dma_handle, gfp, &attrs);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dma_free_noncoherent(struct device *dev, size_t size,
|
|
void *cpu_addr, dma_addr_t dma_handle)
|
|
{
|
|
struct dma_attrs attrs = { .flags = { [0 ... (((DMA_ATTR_MAX) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))-1] = 0 }, };
|
|
|
|
dma_set_attr(DMA_ATTR_NON_CONSISTENT, &attrs);
|
|
dma_free_attrs(dev, size, cpu_addr, dma_handle, &attrs);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
|
|
{
|
|
debug_dma_mapping_error(dev, dma_addr);
|
|
|
|
if (get_dma_ops(dev)->mapping_error)
|
|
return get_dma_ops(dev)->mapping_error(dev, dma_addr);
|
|
|
|
|
|
return dma_addr == (~(dma_addr_t)0x0);
|
|
|
|
|
|
|
|
}
|
|
# 344 "include/asm-generic/dma-mapping-common.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dma_set_mask(struct device *dev, u64 mask)
|
|
{
|
|
struct dma_map_ops *ops = get_dma_ops(dev);
|
|
|
|
if (ops->set_dma_mask)
|
|
return ops->set_dma_mask(dev, mask);
|
|
|
|
if (!dev->dma_mask || !dma_supported(dev, mask))
|
|
return -5;
|
|
*dev->dma_mask = mask;
|
|
return 0;
|
|
}
|
|
# 50 "./arch/arm/include/asm/dma-mapping.h" 2
|
|
# 61 "./arch/arm/include/asm/dma-mapping.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) dma_addr_t pfn_to_dma(struct device *dev, unsigned long pfn)
|
|
{
|
|
if (dev)
|
|
pfn -= dev->dma_pfn_offset;
|
|
return (dma_addr_t)((phys_addr_t)(pfn) << 12);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long dma_to_pfn(struct device *dev, dma_addr_t addr)
|
|
{
|
|
unsigned long pfn = ((unsigned long)((addr) >> 12));
|
|
|
|
if (dev)
|
|
pfn += dev->dma_pfn_offset;
|
|
|
|
return pfn;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *dma_to_virt(struct device *dev, dma_addr_t addr)
|
|
{
|
|
if (dev) {
|
|
unsigned long pfn = dma_to_pfn(dev, addr);
|
|
|
|
return phys_to_virt(((phys_addr_t)(pfn) << 12));
|
|
}
|
|
|
|
return (void *)__phys_to_virt((unsigned long)addr);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) dma_addr_t virt_to_dma(struct device *dev, void *addr)
|
|
{
|
|
if (dev)
|
|
return pfn_to_dma(dev, ((((unsigned long)(addr) - (0xC0000000UL)) >> 12) + (__pv_phys_pfn_offset)));
|
|
|
|
return (dma_addr_t)__virt_to_phys((unsigned long)(addr));
|
|
}
|
|
# 120 "./arch/arm/include/asm/dma-mapping.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long dma_max_pfn(struct device *dev)
|
|
{
|
|
return dma_to_pfn(dev, *dev->dma_mask);
|
|
}
|
|
|
|
|
|
|
|
extern void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
|
|
struct iommu_ops *iommu, bool coherent);
|
|
|
|
|
|
extern void arch_teardown_dma_ops(struct device *dev);
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_device_dma_coherent(struct device *dev)
|
|
{
|
|
return dev->archdata.dma_coherent;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr)
|
|
{
|
|
unsigned int offset = paddr & ~(~((1 << 12) - 1));
|
|
return pfn_to_dma(dev, ((unsigned long)((paddr) >> 12))) + offset;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) phys_addr_t dma_to_phys(struct device *dev, dma_addr_t dev_addr)
|
|
{
|
|
unsigned int offset = dev_addr & ~(~((1 << 12) - 1));
|
|
return ((phys_addr_t)(dma_to_pfn(dev, dev_addr)) << 12) + offset;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
|
|
{
|
|
u64 limit, mask;
|
|
|
|
if (!dev->dma_mask)
|
|
return 0;
|
|
|
|
mask = *dev->dma_mask;
|
|
|
|
limit = (mask + 1) & ~mask;
|
|
if (limit && size > limit)
|
|
return 0;
|
|
|
|
if ((addr | (addr + size - 1)) & ~mask)
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dma_mark_clean(void *addr, size_t size) { }
|
|
|
|
extern int arm_dma_set_mask(struct device *dev, u64 dma_mask);
|
|
# 185 "./arch/arm/include/asm/dma-mapping.h"
|
|
extern void *arm_dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
|
|
gfp_t gfp, struct dma_attrs *attrs);
|
|
# 202 "./arch/arm/include/asm/dma-mapping.h"
|
|
extern void arm_dma_free(struct device *dev, size_t size, void *cpu_addr,
|
|
dma_addr_t handle, struct dma_attrs *attrs);
|
|
# 218 "./arch/arm/include/asm/dma-mapping.h"
|
|
extern int arm_dma_mmap(struct device *dev, struct vm_area_struct *vma,
|
|
void *cpu_addr, dma_addr_t dma_addr, size_t size,
|
|
struct dma_attrs *attrs);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) init_dma_coherent_pool_size(unsigned long size);
|
|
# 253 "./arch/arm/include/asm/dma-mapping.h"
|
|
extern int dmabounce_register_dev(struct device *, unsigned long,
|
|
unsigned long, int (*)(struct device *, dma_addr_t, size_t));
|
|
# 266 "./arch/arm/include/asm/dma-mapping.h"
|
|
extern void dmabounce_unregister_dev(struct device *);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern int arm_dma_map_sg(struct device *, struct scatterlist *, int,
|
|
enum dma_data_direction, struct dma_attrs *attrs);
|
|
extern void arm_dma_unmap_sg(struct device *, struct scatterlist *, int,
|
|
enum dma_data_direction, struct dma_attrs *attrs);
|
|
extern void arm_dma_sync_sg_for_cpu(struct device *, struct scatterlist *, int,
|
|
enum dma_data_direction);
|
|
extern void arm_dma_sync_sg_for_device(struct device *, struct scatterlist *, int,
|
|
enum dma_data_direction);
|
|
extern int arm_dma_get_sgtable(struct device *dev, struct sg_table *sgt,
|
|
void *cpu_addr, dma_addr_t dma_addr, size_t size,
|
|
struct dma_attrs *attrs);
|
|
# 88 "include/linux/dma-mapping.h" 2
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 dma_get_mask(struct device *dev)
|
|
{
|
|
if (dev && dev->dma_mask && *dev->dma_mask)
|
|
return *dev->dma_mask;
|
|
return (((32) == 64) ? ~0ULL : ((1ULL<<(32))-1));
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dma_set_coherent_mask(struct device *dev, u64 mask)
|
|
{
|
|
if (!dma_supported(dev, mask))
|
|
return -5;
|
|
dev->coherent_dma_mask = mask;
|
|
return 0;
|
|
}
|
|
# 117 "include/linux/dma-mapping.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dma_set_mask_and_coherent(struct device *dev, u64 mask)
|
|
{
|
|
int rc = dma_set_mask(dev, mask);
|
|
if (rc == 0)
|
|
dma_set_coherent_mask(dev, mask);
|
|
return rc;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dma_coerce_mask_and_coherent(struct device *dev, u64 mask)
|
|
{
|
|
dev->dma_mask = &dev->coherent_dma_mask;
|
|
return dma_set_mask_and_coherent(dev, mask);
|
|
}
|
|
|
|
extern u64 dma_get_required_mask(struct device *dev);
|
|
# 147 "include/linux/dma-mapping.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int dma_get_max_seg_size(struct device *dev)
|
|
{
|
|
if (dev->dma_parms && dev->dma_parms->max_segment_size)
|
|
return dev->dma_parms->max_segment_size;
|
|
return 0x00010000;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int dma_set_max_seg_size(struct device *dev,
|
|
unsigned int size)
|
|
{
|
|
if (dev->dma_parms) {
|
|
dev->dma_parms->max_segment_size = size;
|
|
return 0;
|
|
}
|
|
return -5;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long dma_get_seg_boundary(struct device *dev)
|
|
{
|
|
if (dev->dma_parms && dev->dma_parms->segment_boundary_mask)
|
|
return dev->dma_parms->segment_boundary_mask;
|
|
return (((32) == 64) ? ~0ULL : ((1ULL<<(32))-1));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dma_set_seg_boundary(struct device *dev, unsigned long mask)
|
|
{
|
|
if (dev->dma_parms) {
|
|
dev->dma_parms->segment_boundary_mask = mask;
|
|
return 0;
|
|
}
|
|
return -5;
|
|
}
|
|
# 187 "include/linux/dma-mapping.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *dma_zalloc_coherent(struct device *dev, size_t size,
|
|
dma_addr_t *dma_handle, gfp_t flag)
|
|
{
|
|
void *ret = dma_alloc_coherent(dev, size, dma_handle,
|
|
flag | (( gfp_t)0x8000u));
|
|
return ret;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dma_get_cache_alignment(void)
|
|
{
|
|
|
|
return (1 << 6);
|
|
|
|
return 1;
|
|
}
|
|
# 235 "include/linux/dma-mapping.h"
|
|
extern void *dmam_alloc_coherent(struct device *dev, size_t size,
|
|
dma_addr_t *dma_handle, gfp_t gfp);
|
|
extern void dmam_free_coherent(struct device *dev, size_t size, void *vaddr,
|
|
dma_addr_t dma_handle);
|
|
extern void *dmam_alloc_noncoherent(struct device *dev, size_t size,
|
|
dma_addr_t *dma_handle, gfp_t gfp);
|
|
extern void dmam_free_noncoherent(struct device *dev, size_t size, void *vaddr,
|
|
dma_addr_t dma_handle);
|
|
|
|
extern int dmam_declare_coherent_memory(struct device *dev,
|
|
phys_addr_t phys_addr,
|
|
dma_addr_t device_addr, size_t size,
|
|
int flags);
|
|
extern void dmam_release_declared_memory(struct device *dev);
|
|
# 278 "include/linux/dma-mapping.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *dma_alloc_writecombine(struct device *dev, size_t size,
|
|
dma_addr_t *dma_addr, gfp_t gfp)
|
|
{
|
|
struct dma_attrs attrs = { .flags = { [0 ... (((DMA_ATTR_MAX) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))-1] = 0 }, };
|
|
dma_set_attr(DMA_ATTR_WRITE_COMBINE, &attrs);
|
|
return dma_alloc_attrs(dev, size, dma_addr, gfp, &attrs);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dma_free_writecombine(struct device *dev, size_t size,
|
|
void *cpu_addr, dma_addr_t dma_addr)
|
|
{
|
|
struct dma_attrs attrs = { .flags = { [0 ... (((DMA_ATTR_MAX) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))-1] = 0 }, };
|
|
dma_set_attr(DMA_ATTR_WRITE_COMBINE, &attrs);
|
|
return dma_free_attrs(dev, size, cpu_addr, dma_addr, &attrs);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dma_mmap_writecombine(struct device *dev,
|
|
struct vm_area_struct *vma,
|
|
void *cpu_addr, dma_addr_t dma_addr,
|
|
size_t size)
|
|
{
|
|
struct dma_attrs attrs = { .flags = { [0 ... (((DMA_ATTR_MAX) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))-1] = 0 }, };
|
|
dma_set_attr(DMA_ATTR_WRITE_COMBINE, &attrs);
|
|
return dma_mmap_attrs(dev, vma, cpu_addr, dma_addr, size, &attrs);
|
|
}
|
|
# 46 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c" 2
|
|
|
|
# 1 "include/linux/slab.h" 1
|
|
# 106 "include/linux/slab.h"
|
|
# 1 "include/linux/kmemleak.h" 1
|
|
# 24 "include/linux/kmemleak.h"
|
|
# 1 "include/linux/slab.h" 1
|
|
# 25 "include/linux/kmemleak.h" 2
|
|
# 63 "include/linux/kmemleak.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemleak_init(void)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemleak_alloc(const void *ptr, size_t size, int min_count,
|
|
gfp_t gfp)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemleak_alloc_recursive(const void *ptr, size_t size,
|
|
int min_count, unsigned long flags,
|
|
gfp_t gfp)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemleak_alloc_percpu(const void *ptr, size_t size,
|
|
gfp_t gfp)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemleak_free(const void *ptr)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemleak_free_part(const void *ptr, size_t size)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemleak_free_recursive(const void *ptr, unsigned long flags)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemleak_free_percpu(const void *ptr)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemleak_update_trace(const void *ptr)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemleak_not_leak(const void *ptr)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemleak_ignore(const void *ptr)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemleak_scan_area(const void *ptr, size_t size, gfp_t gfp)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemleak_erase(void **ptr)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kmemleak_no_scan(const void *ptr)
|
|
{
|
|
}
|
|
# 107 "include/linux/slab.h" 2
|
|
# 1 "include/linux/kasan.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
struct kmem_cache;
|
|
struct page;
|
|
struct vm_struct;
|
|
# 67 "include/linux/kasan.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kasan_unpoison_shadow(const void *address, size_t size) {}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kasan_enable_current(void) {}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kasan_disable_current(void) {}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kasan_alloc_pages(struct page *page, unsigned int order) {}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kasan_free_pages(struct page *page, unsigned int order) {}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kasan_poison_slab(struct page *page) {}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kasan_unpoison_object_data(struct kmem_cache *cache,
|
|
void *object) {}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kasan_poison_object_data(struct kmem_cache *cache,
|
|
void *object) {}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kasan_kmalloc_large(void *ptr, size_t size) {}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kasan_kfree_large(const void *ptr) {}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kasan_kfree(void *ptr) {}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kasan_kmalloc(struct kmem_cache *s, const void *object,
|
|
size_t size) {}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kasan_krealloc(const void *object, size_t new_size) {}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kasan_slab_alloc(struct kmem_cache *s, void *object) {}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kasan_slab_free(struct kmem_cache *s, void *object) {}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int kasan_module_alloc(void *addr, size_t size) { return 0; }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void kasan_free_shadow(const struct vm_struct *vm) {}
|
|
# 108 "include/linux/slab.h" 2
|
|
|
|
struct mem_cgroup;
|
|
|
|
|
|
|
|
void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) kmem_cache_init(void);
|
|
bool slab_is_available(void);
|
|
|
|
struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
|
|
unsigned long,
|
|
void (*)(void *));
|
|
void kmem_cache_destroy(struct kmem_cache *);
|
|
int kmem_cache_shrink(struct kmem_cache *);
|
|
|
|
void memcg_create_kmem_cache(struct mem_cgroup *, struct kmem_cache *);
|
|
void memcg_deactivate_kmem_caches(struct mem_cgroup *);
|
|
void memcg_destroy_kmem_caches(struct mem_cgroup *);
|
|
# 141 "include/linux/slab.h"
|
|
void * __attribute__((warn_unused_result)) __krealloc(const void *, size_t, gfp_t);
|
|
void * __attribute__((warn_unused_result)) krealloc(const void *, size_t, gfp_t);
|
|
void kfree(const void *);
|
|
void kzfree(const void *);
|
|
size_t ksize(const void *);
|
|
# 251 "include/linux/slab.h"
|
|
extern struct kmem_cache *kmalloc_caches[((11 + 12 - 1) <= 25 ? (11 + 12 - 1) : 25) + 1];
|
|
# 264 "include/linux/slab.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) int kmalloc_index(size_t size)
|
|
{
|
|
if (!size)
|
|
return 0;
|
|
|
|
if (size <= (1 << 6))
|
|
return ( __builtin_constant_p((1 << 6)) ? ( ((1 << 6)) < 2 ? 0 : ((1 << 6)) & (1ULL << 63) ? 63 : ((1 << 6)) & (1ULL << 62) ? 62 : ((1 << 6)) & (1ULL << 61) ? 61 : ((1 << 6)) & (1ULL << 60) ? 60 : ((1 << 6)) & (1ULL << 59) ? 59 : ((1 << 6)) & (1ULL << 58) ? 58 : ((1 << 6)) & (1ULL << 57) ? 57 : ((1 << 6)) & (1ULL << 56) ? 56 : ((1 << 6)) & (1ULL << 55) ? 55 : ((1 << 6)) & (1ULL << 54) ? 54 : ((1 << 6)) & (1ULL << 53) ? 53 : ((1 << 6)) & (1ULL << 52) ? 52 : ((1 << 6)) & (1ULL << 51) ? 51 : ((1 << 6)) & (1ULL << 50) ? 50 : ((1 << 6)) & (1ULL << 49) ? 49 : ((1 << 6)) & (1ULL << 48) ? 48 : ((1 << 6)) & (1ULL << 47) ? 47 : ((1 << 6)) & (1ULL << 46) ? 46 : ((1 << 6)) & (1ULL << 45) ? 45 : ((1 << 6)) & (1ULL << 44) ? 44 : ((1 << 6)) & (1ULL << 43) ? 43 : ((1 << 6)) & (1ULL << 42) ? 42 : ((1 << 6)) & (1ULL << 41) ? 41 : ((1 << 6)) & (1ULL << 40) ? 40 : ((1 << 6)) & (1ULL << 39) ? 39 : ((1 << 6)) & (1ULL << 38) ? 38 : ((1 << 6)) & (1ULL << 37) ? 37 : ((1 << 6)) & (1ULL << 36) ? 36 : ((1 << 6)) & (1ULL << 35) ? 35 : ((1 << 6)) & (1ULL << 34) ? 34 : ((1 << 6)) & (1ULL << 33) ? 33 : ((1 << 6)) & (1ULL << 32) ? 32 : ((1 << 6)) & (1ULL << 31) ? 31 : ((1 << 6)) & (1ULL << 30) ? 30 : ((1 << 6)) & (1ULL << 29) ? 29 : ((1 << 6)) & (1ULL << 28) ? 28 : ((1 << 6)) & (1ULL << 27) ? 27 : ((1 << 6)) & (1ULL << 26) ? 26 : ((1 << 6)) & (1ULL << 25) ? 25 : ((1 << 6)) & (1ULL << 24) ? 24 : ((1 << 6)) & (1ULL << 23) ? 23 : ((1 << 6)) & (1ULL << 22) ? 22 : ((1 << 6)) & (1ULL << 21) ? 21 : ((1 << 6)) & (1ULL << 20) ? 20 : ((1 << 6)) & (1ULL << 19) ? 19 : ((1 << 6)) & (1ULL << 18) ? 18 : ((1 << 6)) & (1ULL << 17) ? 17 : ((1 << 6)) & (1ULL << 16) ? 16 : ((1 << 6)) & (1ULL << 15) ? 15 : ((1 << 6)) & (1ULL << 14) ? 14 : ((1 << 6)) & (1ULL << 13) ? 13 : ((1 << 6)) & (1ULL << 12) ? 12 : ((1 << 6)) & (1ULL << 11) ? 11 : ((1 << 6)) & (1ULL << 10) ? 10 : ((1 << 6)) & (1ULL << 9) ? 9 : ((1 << 6)) & (1ULL << 8) ? 8 : ((1 << 6)) & (1ULL << 7) ? 7 : ((1 << 6)) & (1ULL << 6) ? 6 : ((1 << 6)) & (1ULL << 5) ? 5 : ((1 << 6)) & (1ULL << 4) ? 4 : ((1 << 6)) & (1ULL << 3) ? 3 : ((1 << 6)) & (1ULL << 2) ? 2 : 1 ) : (sizeof((1 << 6)) <= 4) ? __ilog2_u32((1 << 6)) : __ilog2_u64((1 << 6)) );
|
|
|
|
if ((1 << 6) <= 32 && size > 64 && size <= 96)
|
|
return 1;
|
|
if ((1 << 6) <= 64 && size > 128 && size <= 192)
|
|
return 2;
|
|
if (size <= 8) return 3;
|
|
if (size <= 16) return 4;
|
|
if (size <= 32) return 5;
|
|
if (size <= 64) return 6;
|
|
if (size <= 128) return 7;
|
|
if (size <= 256) return 8;
|
|
if (size <= 512) return 9;
|
|
if (size <= 1024) return 10;
|
|
if (size <= 2 * 1024) return 11;
|
|
if (size <= 4 * 1024) return 12;
|
|
if (size <= 8 * 1024) return 13;
|
|
if (size <= 16 * 1024) return 14;
|
|
if (size <= 32 * 1024) return 15;
|
|
if (size <= 64 * 1024) return 16;
|
|
if (size <= 128 * 1024) return 17;
|
|
if (size <= 256 * 1024) return 18;
|
|
if (size <= 512 * 1024) return 19;
|
|
if (size <= 1024 * 1024) return 20;
|
|
if (size <= 2 * 1024 * 1024) return 21;
|
|
if (size <= 4 * 1024 * 1024) return 22;
|
|
if (size <= 8 * 1024 * 1024) return 23;
|
|
if (size <= 16 * 1024 * 1024) return 24;
|
|
if (size <= 32 * 1024 * 1024) return 25;
|
|
if (size <= 64 * 1024 * 1024) return 26;
|
|
do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/slab.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "300" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0);
|
|
|
|
|
|
return -1;
|
|
}
|
|
|
|
|
|
void *__kmalloc(size_t size, gfp_t flags) __attribute__((__assume_aligned__((1 << 6))));
|
|
void *kmem_cache_alloc(struct kmem_cache *, gfp_t flags) __attribute__((__assume_aligned__(8)));
|
|
void kmem_cache_free(struct kmem_cache *, void *);
|
|
# 318 "include/linux/slab.h"
|
|
void kmem_cache_free_bulk(struct kmem_cache *, size_t, void **);
|
|
int kmem_cache_alloc_bulk(struct kmem_cache *, gfp_t, size_t, void **);
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void *__kmalloc_node(size_t size, gfp_t flags, int node)
|
|
{
|
|
return __kmalloc(size, flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void *kmem_cache_alloc_node(struct kmem_cache *s, gfp_t flags, int node)
|
|
{
|
|
return kmem_cache_alloc(s, flags);
|
|
}
|
|
# 354 "include/linux/slab.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void *kmem_cache_alloc_trace(struct kmem_cache *s,
|
|
gfp_t flags, size_t size)
|
|
{
|
|
void *ret = kmem_cache_alloc(s, flags);
|
|
|
|
kasan_kmalloc(s, ret, size);
|
|
return ret;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void *
|
|
kmem_cache_alloc_node_trace(struct kmem_cache *s,
|
|
gfp_t gfpflags,
|
|
int node, size_t size)
|
|
{
|
|
void *ret = kmem_cache_alloc_node(s, gfpflags, node);
|
|
|
|
kasan_kmalloc(s, ret, size);
|
|
return ret;
|
|
}
|
|
|
|
|
|
extern void *kmalloc_order(size_t size, gfp_t flags, unsigned int order) __attribute__((__assume_aligned__(((1UL) << 12))));
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void *
|
|
kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order)
|
|
{
|
|
return kmalloc_order(size, flags, order);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void *kmalloc_large(size_t size, gfp_t flags)
|
|
{
|
|
unsigned int order = ( __builtin_constant_p(size) ? ( ((size) == 0UL) ? 32 - 12 : (((size) < (1UL << 12)) ? 0 : ( __builtin_constant_p((size) - 1) ? ( ((size) - 1) < 2 ? 0 : ((size) - 1) & (1ULL << 63) ? 63 : ((size) - 1) & (1ULL << 62) ? 62 : ((size) - 1) & (1ULL << 61) ? 61 : ((size) - 1) & (1ULL << 60) ? 60 : ((size) - 1) & (1ULL << 59) ? 59 : ((size) - 1) & (1ULL << 58) ? 58 : ((size) - 1) & (1ULL << 57) ? 57 : ((size) - 1) & (1ULL << 56) ? 56 : ((size) - 1) & (1ULL << 55) ? 55 : ((size) - 1) & (1ULL << 54) ? 54 : ((size) - 1) & (1ULL << 53) ? 53 : ((size) - 1) & (1ULL << 52) ? 52 : ((size) - 1) & (1ULL << 51) ? 51 : ((size) - 1) & (1ULL << 50) ? 50 : ((size) - 1) & (1ULL << 49) ? 49 : ((size) - 1) & (1ULL << 48) ? 48 : ((size) - 1) & (1ULL << 47) ? 47 : ((size) - 1) & (1ULL << 46) ? 46 : ((size) - 1) & (1ULL << 45) ? 45 : ((size) - 1) & (1ULL << 44) ? 44 : ((size) - 1) & (1ULL << 43) ? 43 : ((size) - 1) & (1ULL << 42) ? 42 : ((size) - 1) & (1ULL << 41) ? 41 : ((size) - 1) & (1ULL << 40) ? 40 : ((size) - 1) & (1ULL << 39) ? 39 : ((size) - 1) & (1ULL << 38) ? 38 : ((size) - 1) & (1ULL << 37) ? 37 : ((size) - 1) & (1ULL << 36) ? 36 : ((size) - 1) & (1ULL << 35) ? 35 : ((size) - 1) & (1ULL << 34) ? 34 : ((size) - 1) & (1ULL << 33) ? 33 : ((size) - 1) & (1ULL << 32) ? 32 : ((size) - 1) & (1ULL << 31) ? 31 : ((size) - 1) & (1ULL << 30) ? 30 : ((size) - 1) & (1ULL << 29) ? 29 : ((size) - 1) & (1ULL << 28) ? 28 : ((size) - 1) & (1ULL << 27) ? 27 : ((size) - 1) & (1ULL << 26) ? 26 : ((size) - 1) & (1ULL << 25) ? 25 : ((size) - 1) & (1ULL << 24) ? 24 : ((size) - 1) & (1ULL << 23) ? 23 : ((size) - 1) & (1ULL << 22) ? 22 : ((size) - 1) & (1ULL << 21) ? 21 : ((size) - 1) & (1ULL << 20) ? 20 : ((size) - 1) & (1ULL << 19) ? 19 : ((size) - 1) & (1ULL << 18) ? 18 : ((size) - 1) & (1ULL << 17) ? 17 : ((size) - 1) & (1ULL << 16) ? 16 : ((size) - 1) & (1ULL << 15) ? 15 : ((size) - 1) & (1ULL << 14) ? 14 : ((size) - 1) & (1ULL << 13) ? 13 : ((size) - 1) & (1ULL << 12) ? 12 : ((size) - 1) & (1ULL << 11) ? 11 : ((size) - 1) & (1ULL << 10) ? 10 : ((size) - 1) & (1ULL << 9) ? 9 : ((size) - 1) & (1ULL << 8) ? 8 : ((size) - 1) & (1ULL << 7) ? 7 : ((size) - 1) & (1ULL << 6) ? 6 : ((size) - 1) & (1ULL << 5) ? 5 : ((size) - 1) & (1ULL << 4) ? 4 : ((size) - 1) & (1ULL << 3) ? 3 : ((size) - 1) & (1ULL << 2) ? 2 : 1 ) : (sizeof((size) - 1) <= 4) ? __ilog2_u32((size) - 1) : __ilog2_u64((size) - 1) ) - 12 + 1) ) : __get_order(size) );
|
|
return kmalloc_order_trace(size, flags, order);
|
|
}
|
|
# 446 "include/linux/slab.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void *kmalloc(size_t size, gfp_t flags)
|
|
{
|
|
if (__builtin_constant_p(size)) {
|
|
if (size > (1UL << ((11 + 12 - 1) <= 25 ? (11 + 12 - 1) : 25)))
|
|
return kmalloc_large(size, flags);
|
|
|
|
if (!(flags & (( gfp_t)0x01u))) {
|
|
int index = kmalloc_index(size);
|
|
|
|
if (!index)
|
|
return ((void *)16);
|
|
|
|
return kmem_cache_alloc_trace(kmalloc_caches[index],
|
|
flags, size);
|
|
}
|
|
|
|
}
|
|
return __kmalloc(size, flags);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) int kmalloc_size(int n)
|
|
{
|
|
|
|
if (n > 2)
|
|
return 1 << n;
|
|
|
|
if (n == 1 && (1 << 6) <= 32)
|
|
return 96;
|
|
|
|
if (n == 2 && (1 << 6) <= 64)
|
|
return 192;
|
|
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void *kmalloc_node(size_t size, gfp_t flags, int node)
|
|
{
|
|
|
|
if (__builtin_constant_p(size) &&
|
|
size <= (1UL << ((11 + 12 - 1) <= 25 ? (11 + 12 - 1) : 25)) && !(flags & (( gfp_t)0x01u))) {
|
|
int i = kmalloc_index(size);
|
|
|
|
if (!i)
|
|
return ((void *)16);
|
|
|
|
return kmem_cache_alloc_node_trace(kmalloc_caches[i],
|
|
flags, node, size);
|
|
}
|
|
|
|
return __kmalloc_node(size, flags, node);
|
|
}
|
|
|
|
struct memcg_cache_array {
|
|
struct callback_head rcu;
|
|
struct kmem_cache *entries[0];
|
|
};
|
|
# 524 "include/linux/slab.h"
|
|
struct memcg_cache_params {
|
|
bool is_root_cache;
|
|
struct list_head list;
|
|
union {
|
|
struct memcg_cache_array *memcg_caches;
|
|
struct {
|
|
struct mem_cgroup *memcg;
|
|
struct kmem_cache *root_cache;
|
|
};
|
|
};
|
|
};
|
|
|
|
int memcg_update_all_caches(int num_memcgs);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *kmalloc_array(size_t n, size_t size, gfp_t flags)
|
|
{
|
|
if (size != 0 && n > (~(size_t)0) / size)
|
|
return ((void *)0);
|
|
return __kmalloc(n * size, flags);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *kcalloc(size_t n, size_t size, gfp_t flags)
|
|
{
|
|
return kmalloc_array(n, size, flags | (( gfp_t)0x8000u));
|
|
}
|
|
# 570 "include/linux/slab.h"
|
|
extern void *__kmalloc_track_caller(size_t, gfp_t, unsigned long);
|
|
# 590 "include/linux/slab.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *kmem_cache_zalloc(struct kmem_cache *k, gfp_t flags)
|
|
{
|
|
return kmem_cache_alloc(k, flags | (( gfp_t)0x8000u));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *kzalloc(size_t size, gfp_t flags)
|
|
{
|
|
return kmalloc(size, flags | (( gfp_t)0x8000u));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *kzalloc_node(size_t size, gfp_t flags, int node)
|
|
{
|
|
return kmalloc_node(size, flags | (( gfp_t)0x8000u), node);
|
|
}
|
|
|
|
unsigned int kmem_cache_size(struct kmem_cache *s);
|
|
void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) kmem_cache_init_late(void);
|
|
# 48 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c" 2
|
|
|
|
# 1 "include/generated/uapi/linux/version.h" 1
|
|
# 50 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c" 2
|
|
# 1 "include/linux/ctype.h" 1
|
|
# 18 "include/linux/ctype.h"
|
|
extern const unsigned char _ctype[];
|
|
# 38 "include/linux/ctype.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned char __tolower(unsigned char c)
|
|
{
|
|
if ((((_ctype[(int)(unsigned char)(c)])&(0x01)) != 0))
|
|
c -= 'A'-'a';
|
|
return c;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned char __toupper(unsigned char c)
|
|
{
|
|
if ((((_ctype[(int)(unsigned char)(c)])&(0x02)) != 0))
|
|
c -= 'a'-'A';
|
|
return c;
|
|
}
|
|
# 59 "include/linux/ctype.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) char _tolower(const char c)
|
|
{
|
|
return c | 0x20;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int isodigit(const char c)
|
|
{
|
|
return c >= '0' && c <= '7';
|
|
}
|
|
# 51 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c" 2
|
|
# 1 "include/linux/ip.h" 1
|
|
# 20 "include/linux/ip.h"
|
|
# 1 "include/linux/skbuff.h" 1
|
|
# 24 "include/linux/skbuff.h"
|
|
# 1 "include/linux/socket.h" 1
|
|
|
|
|
|
|
|
|
|
# 1 "arch/arm/include/generated/asm/socket.h" 1
|
|
# 1 "./include/uapi/asm-generic/socket.h" 1
|
|
|
|
|
|
|
|
# 1 "arch/arm/include/generated/asm/sockios.h" 1
|
|
# 1 "./include/uapi/asm-generic/sockios.h" 1
|
|
# 1 "arch/arm/include/generated/asm/sockios.h" 2
|
|
# 5 "./include/uapi/asm-generic/socket.h" 2
|
|
# 1 "arch/arm/include/generated/asm/socket.h" 2
|
|
# 6 "include/linux/socket.h" 2
|
|
# 1 "./include/uapi/linux/sockios.h" 1
|
|
# 21 "./include/uapi/linux/sockios.h"
|
|
# 1 "arch/arm/include/generated/asm/sockios.h" 1
|
|
# 22 "./include/uapi/linux/sockios.h" 2
|
|
# 7 "include/linux/socket.h" 2
|
|
# 1 "include/linux/uio.h" 1
|
|
# 13 "include/linux/uio.h"
|
|
# 1 "include/uapi/linux/uio.h" 1
|
|
# 16 "include/uapi/linux/uio.h"
|
|
struct iovec
|
|
{
|
|
void *iov_base;
|
|
__kernel_size_t iov_len;
|
|
};
|
|
# 14 "include/linux/uio.h" 2
|
|
|
|
struct page;
|
|
|
|
struct kvec {
|
|
void *iov_base;
|
|
size_t iov_len;
|
|
};
|
|
|
|
enum {
|
|
ITER_IOVEC = 0,
|
|
ITER_KVEC = 2,
|
|
ITER_BVEC = 4,
|
|
};
|
|
|
|
struct iov_iter {
|
|
int type;
|
|
size_t iov_offset;
|
|
size_t count;
|
|
union {
|
|
const struct iovec *iov;
|
|
const struct kvec *kvec;
|
|
const struct bio_vec *bvec;
|
|
};
|
|
unsigned long nr_segs;
|
|
};
|
|
# 47 "include/linux/uio.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) size_t iov_length(const struct iovec *iov, unsigned long nr_segs)
|
|
{
|
|
unsigned long seg;
|
|
size_t ret = 0;
|
|
|
|
for (seg = 0; seg < nr_segs; seg++)
|
|
ret += iov[seg].iov_len;
|
|
return ret;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct iovec iov_iter_iovec(const struct iov_iter *iter)
|
|
{
|
|
return (struct iovec) {
|
|
.iov_base = iter->iov->iov_base + iter->iov_offset,
|
|
.iov_len = ({ typeof(iter->count) _min1 = (iter->count); typeof(iter->iov->iov_len - iter->iov_offset) _min2 = (iter->iov->iov_len - iter->iov_offset); (void) (&_min1 == &_min2); _min1 < _min2 ? _min1 : _min2; })
|
|
,
|
|
};
|
|
}
|
|
# 73 "include/linux/uio.h"
|
|
unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to);
|
|
|
|
size_t iov_iter_copy_from_user_atomic(struct page *page,
|
|
struct iov_iter *i, unsigned long offset, size_t bytes);
|
|
void iov_iter_advance(struct iov_iter *i, size_t bytes);
|
|
int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes);
|
|
|
|
size_t iov_iter_single_seg_count(const struct iov_iter *i);
|
|
size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
|
|
struct iov_iter *i);
|
|
size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes,
|
|
struct iov_iter *i);
|
|
size_t copy_to_iter(void *addr, size_t bytes, struct iov_iter *i);
|
|
size_t copy_from_iter(void *addr, size_t bytes, struct iov_iter *i);
|
|
size_t copy_from_iter_nocache(void *addr, size_t bytes, struct iov_iter *i);
|
|
size_t iov_iter_zero(size_t bytes, struct iov_iter *);
|
|
unsigned long iov_iter_alignment(const struct iov_iter *i);
|
|
void iov_iter_init(struct iov_iter *i, int direction, const struct iovec *iov,
|
|
unsigned long nr_segs, size_t count);
|
|
void iov_iter_kvec(struct iov_iter *i, int direction, const struct kvec *kvec,
|
|
unsigned long nr_segs, size_t count);
|
|
void iov_iter_bvec(struct iov_iter *i, int direction, const struct bio_vec *bvec,
|
|
unsigned long nr_segs, size_t count);
|
|
ssize_t iov_iter_get_pages(struct iov_iter *i, struct page **pages,
|
|
size_t maxsize, unsigned maxpages, size_t *start);
|
|
ssize_t iov_iter_get_pages_alloc(struct iov_iter *i, struct page ***pages,
|
|
size_t maxsize, size_t *start);
|
|
int iov_iter_npages(const struct iov_iter *i, int maxpages);
|
|
|
|
const void *dup_iter(struct iov_iter *new, struct iov_iter *old, gfp_t flags);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) size_t iov_iter_count(const struct iov_iter *i)
|
|
{
|
|
return i->count;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool iter_is_iovec(const struct iov_iter *i)
|
|
{
|
|
return !(i->type & (ITER_BVEC | ITER_KVEC));
|
|
}
|
|
# 128 "include/linux/uio.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void iov_iter_truncate(struct iov_iter *i, u64 count)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (i->count > count)
|
|
i->count = count;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void iov_iter_reexpand(struct iov_iter *i, size_t count)
|
|
{
|
|
i->count = count;
|
|
}
|
|
size_t csum_and_copy_to_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i);
|
|
size_t csum_and_copy_from_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i);
|
|
|
|
int import_iovec(int type, const struct iovec * uvector,
|
|
unsigned nr_segs, unsigned fast_segs,
|
|
struct iovec **iov, struct iov_iter *i);
|
|
# 162 "include/linux/uio.h"
|
|
int import_single_range(int type, void *buf, size_t len,
|
|
struct iovec *iov, struct iov_iter *i);
|
|
# 8 "include/linux/socket.h" 2
|
|
|
|
|
|
# 1 "include/uapi/linux/socket.h" 1
|
|
# 11 "include/uapi/linux/socket.h"
|
|
typedef unsigned short __kernel_sa_family_t;
|
|
|
|
struct __kernel_sockaddr_storage {
|
|
__kernel_sa_family_t ss_family;
|
|
|
|
char __data[128 - sizeof(unsigned short)];
|
|
|
|
|
|
} __attribute__ ((aligned((__alignof__ (struct sockaddr *)))));
|
|
# 11 "include/linux/socket.h" 2
|
|
|
|
struct pid;
|
|
struct cred;
|
|
|
|
|
|
|
|
|
|
|
|
struct seq_file;
|
|
extern void socket_seq_show(struct seq_file *seq);
|
|
|
|
|
|
typedef __kernel_sa_family_t sa_family_t;
|
|
|
|
|
|
|
|
|
|
|
|
struct sockaddr {
|
|
sa_family_t sa_family;
|
|
char sa_data[14];
|
|
};
|
|
|
|
struct linger {
|
|
int l_onoff;
|
|
int l_linger;
|
|
};
|
|
# 47 "include/linux/socket.h"
|
|
struct msghdr {
|
|
void *msg_name;
|
|
int msg_namelen;
|
|
struct iov_iter msg_iter;
|
|
void *msg_control;
|
|
__kernel_size_t msg_controllen;
|
|
unsigned int msg_flags;
|
|
struct kiocb *msg_iocb;
|
|
};
|
|
|
|
struct user_msghdr {
|
|
void *msg_name;
|
|
int msg_namelen;
|
|
struct iovec *msg_iov;
|
|
__kernel_size_t msg_iovlen;
|
|
void *msg_control;
|
|
__kernel_size_t msg_controllen;
|
|
unsigned int msg_flags;
|
|
};
|
|
|
|
|
|
struct mmsghdr {
|
|
struct user_msghdr msg_hdr;
|
|
unsigned int msg_len;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct cmsghdr {
|
|
__kernel_size_t cmsg_len;
|
|
int cmsg_level;
|
|
int cmsg_type;
|
|
};
|
|
# 125 "include/linux/socket.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size,
|
|
struct cmsghdr *__cmsg)
|
|
{
|
|
struct cmsghdr * __ptr;
|
|
|
|
__ptr = (struct cmsghdr*)(((unsigned char *) __cmsg) + ( ((__cmsg->cmsg_len)+sizeof(long)-1) & ~(sizeof(long)-1) ));
|
|
if ((unsigned long)((char*)(__ptr+1) - (char *) __ctl) > __size)
|
|
return (struct cmsghdr *)0;
|
|
|
|
return __ptr;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__cmsg)
|
|
{
|
|
return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) size_t msg_data_left(struct msghdr *msg)
|
|
{
|
|
return iov_iter_count(&msg->msg_iter);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct ucred {
|
|
__u32 pid;
|
|
__u32 uid;
|
|
__u32 gid;
|
|
};
|
|
# 329 "include/linux/socket.h"
|
|
extern int move_addr_to_kernel(void *uaddr, int ulen, struct __kernel_sockaddr_storage *kaddr);
|
|
extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data);
|
|
|
|
struct timespec;
|
|
|
|
|
|
extern long __sys_recvmsg(int fd, struct user_msghdr *msg, unsigned flags);
|
|
extern long __sys_sendmsg(int fd, struct user_msghdr *msg, unsigned flags);
|
|
extern int __sys_recvmmsg(int fd, struct mmsghdr *mmsg, unsigned int vlen,
|
|
unsigned int flags, struct timespec *timeout);
|
|
extern int __sys_sendmmsg(int fd, struct mmsghdr *mmsg,
|
|
unsigned int vlen, unsigned int flags);
|
|
# 25 "include/linux/skbuff.h" 2
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/net.h" 1
|
|
# 22 "include/linux/net.h"
|
|
# 1 "include/linux/random.h" 1
|
|
# 10 "include/linux/random.h"
|
|
# 1 "include/linux/once.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool __do_once_start(bool *done, unsigned long *flags);
|
|
void __do_once_done(bool *done, struct static_key *once_key,
|
|
unsigned long *flags);
|
|
# 11 "include/linux/random.h" 2
|
|
|
|
# 1 "include/uapi/linux/random.h" 1
|
|
# 11 "include/uapi/linux/random.h"
|
|
# 1 "./include/uapi/linux/ioctl.h" 1
|
|
|
|
|
|
|
|
# 1 "arch/arm/include/generated/asm/ioctl.h" 1
|
|
# 1 "include/asm-generic/ioctl.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/asm-generic/ioctl.h" 1
|
|
# 5 "include/asm-generic/ioctl.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
extern unsigned int __invalid_size_argument_for_IOC;
|
|
# 1 "arch/arm/include/generated/asm/ioctl.h" 2
|
|
# 5 "./include/uapi/linux/ioctl.h" 2
|
|
# 12 "include/uapi/linux/random.h" 2
|
|
# 1 "include/linux/irqnr.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/irqnr.h" 1
|
|
# 5 "include/linux/irqnr.h" 2
|
|
|
|
|
|
extern int nr_irqs;
|
|
extern struct irq_desc *irq_to_desc(unsigned int irq);
|
|
unsigned int irq_get_next_irq(unsigned int offset);
|
|
# 13 "include/uapi/linux/random.h" 2
|
|
# 37 "include/uapi/linux/random.h"
|
|
struct rand_pool_info {
|
|
int entropy_count;
|
|
int buf_size;
|
|
__u32 buf[0];
|
|
};
|
|
# 13 "include/linux/random.h" 2
|
|
|
|
struct random_ready_callback {
|
|
struct list_head list;
|
|
void (*func)(struct random_ready_callback *rdy);
|
|
struct module *owner;
|
|
};
|
|
|
|
extern void add_device_randomness(const void *, unsigned int);
|
|
extern void add_input_randomness(unsigned int type, unsigned int code,
|
|
unsigned int value);
|
|
extern void add_interrupt_randomness(int irq, int irq_flags);
|
|
|
|
extern void get_random_bytes(void *buf, int nbytes);
|
|
extern int add_random_ready_callback(struct random_ready_callback *rdy);
|
|
extern void del_random_ready_callback(struct random_ready_callback *rdy);
|
|
extern void get_random_bytes_arch(void *buf, int nbytes);
|
|
void generate_random_uuid(unsigned char uuid_out[16]);
|
|
extern int random_int_secret_init(void);
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int get_random_int(void);
|
|
unsigned long get_random_long(void);
|
|
unsigned long randomize_range(unsigned long start, unsigned long end, unsigned long len);
|
|
|
|
u32 prandom_u32(void);
|
|
void prandom_bytes(void *buf, size_t nbytes);
|
|
void prandom_seed(u32 seed);
|
|
void prandom_reseed_late(void);
|
|
|
|
struct rnd_state {
|
|
__u32 s1, s2, s3, s4;
|
|
};
|
|
|
|
u32 prandom_u32_state(struct rnd_state *state);
|
|
void prandom_bytes_state(struct rnd_state *state, void *buf, size_t nbytes);
|
|
void prandom_seed_full_state(struct rnd_state *pcpu_state);
|
|
# 68 "include/linux/random.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 prandom_u32_max(u32 ep_ro)
|
|
{
|
|
return (u32)(((u64) prandom_u32() * ep_ro) >> 32);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 __seed(u32 x, u32 m)
|
|
{
|
|
return (x < m) ? x + m : x;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void prandom_seed_state(struct rnd_state *state, u64 seed)
|
|
{
|
|
u32 i = (seed >> 32) ^ (seed << 10) ^ seed;
|
|
|
|
state->s1 = __seed(i, 2U);
|
|
state->s2 = __seed(i, 8U);
|
|
state->s3 = __seed(i, 16U);
|
|
state->s4 = __seed(i, 128U);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int arch_get_random_long(unsigned long *v)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int arch_get_random_int(unsigned int *v)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int arch_has_random(void)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int arch_get_random_seed_long(unsigned long *v)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int arch_get_random_seed_int(unsigned int *v)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int arch_has_random_seed(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 next_pseudo_random32(u32 seed)
|
|
{
|
|
return seed * 1664525 + 1013904223;
|
|
}
|
|
# 23 "include/linux/net.h" 2
|
|
|
|
# 1 "include/linux/fcntl.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/fcntl.h" 1
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/uapi/asm/fcntl.h" 1
|
|
# 9 "./arch/arm/include/uapi/asm/fcntl.h"
|
|
# 1 "./include/uapi/asm-generic/fcntl.h" 1
|
|
# 155 "./include/uapi/asm-generic/fcntl.h"
|
|
struct f_owner_ex {
|
|
int type;
|
|
__kernel_pid_t pid;
|
|
};
|
|
# 195 "./include/uapi/asm-generic/fcntl.h"
|
|
struct flock {
|
|
short l_type;
|
|
short l_whence;
|
|
__kernel_off_t l_start;
|
|
__kernel_off_t l_len;
|
|
__kernel_pid_t l_pid;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct flock64 {
|
|
short l_type;
|
|
short l_whence;
|
|
__kernel_loff_t l_start;
|
|
__kernel_loff_t l_len;
|
|
__kernel_pid_t l_pid;
|
|
|
|
};
|
|
# 10 "./arch/arm/include/uapi/asm/fcntl.h" 2
|
|
# 5 "include/uapi/linux/fcntl.h" 2
|
|
# 5 "include/linux/fcntl.h" 2
|
|
# 25 "include/linux/net.h" 2
|
|
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/net.h" 1
|
|
# 22 "include/uapi/linux/net.h"
|
|
# 1 "arch/arm/include/generated/asm/socket.h" 1
|
|
# 23 "include/uapi/linux/net.h" 2
|
|
# 47 "include/uapi/linux/net.h"
|
|
typedef enum {
|
|
SS_FREE = 0,
|
|
SS_UNCONNECTED,
|
|
SS_CONNECTING,
|
|
SS_CONNECTED,
|
|
SS_DISCONNECTING
|
|
} socket_state;
|
|
# 30 "include/linux/net.h" 2
|
|
|
|
struct poll_table_struct;
|
|
struct pipe_inode_info;
|
|
struct inode;
|
|
struct file;
|
|
struct net;
|
|
# 63 "include/linux/net.h"
|
|
enum sock_type {
|
|
SOCK_STREAM = 1,
|
|
SOCK_DGRAM = 2,
|
|
SOCK_RAW = 3,
|
|
SOCK_RDM = 4,
|
|
SOCK_SEQPACKET = 5,
|
|
SOCK_DCCP = 6,
|
|
SOCK_PACKET = 10,
|
|
};
|
|
# 86 "include/linux/net.h"
|
|
enum sock_shutdown_cmd {
|
|
SHUT_RD,
|
|
SHUT_WR,
|
|
SHUT_RDWR,
|
|
};
|
|
|
|
struct socket_wq {
|
|
|
|
wait_queue_head_t wait;
|
|
struct fasync_struct *fasync_list;
|
|
unsigned long flags;
|
|
struct callback_head rcu;
|
|
} __attribute__((__aligned__((1 << 6))));
|
|
# 110 "include/linux/net.h"
|
|
struct socket {
|
|
socket_state state;
|
|
|
|
;
|
|
short type;
|
|
;
|
|
|
|
unsigned long flags;
|
|
|
|
struct socket_wq *wq;
|
|
|
|
struct file *file;
|
|
struct sock *sk;
|
|
const struct proto_ops *ops;
|
|
};
|
|
|
|
struct vm_area_struct;
|
|
struct page;
|
|
struct sockaddr;
|
|
struct msghdr;
|
|
struct module;
|
|
|
|
struct proto_ops {
|
|
int family;
|
|
struct module *owner;
|
|
int (*release) (struct socket *sock);
|
|
int (*bind) (struct socket *sock,
|
|
struct sockaddr *myaddr,
|
|
int sockaddr_len);
|
|
int (*connect) (struct socket *sock,
|
|
struct sockaddr *vaddr,
|
|
int sockaddr_len, int flags);
|
|
int (*socketpair)(struct socket *sock1,
|
|
struct socket *sock2);
|
|
int (*accept) (struct socket *sock,
|
|
struct socket *newsock, int flags);
|
|
int (*getname) (struct socket *sock,
|
|
struct sockaddr *addr,
|
|
int *sockaddr_len, int peer);
|
|
unsigned int (*poll) (struct file *file, struct socket *sock,
|
|
struct poll_table_struct *wait);
|
|
int (*ioctl) (struct socket *sock, unsigned int cmd,
|
|
unsigned long arg);
|
|
|
|
|
|
|
|
|
|
int (*listen) (struct socket *sock, int len);
|
|
int (*shutdown) (struct socket *sock, int flags);
|
|
int (*setsockopt)(struct socket *sock, int level,
|
|
int optname, char *optval, unsigned int optlen);
|
|
int (*getsockopt)(struct socket *sock, int level,
|
|
int optname, char *optval, int *optlen);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int (*sendmsg) (struct socket *sock, struct msghdr *m,
|
|
size_t total_len);
|
|
# 179 "include/linux/net.h"
|
|
int (*recvmsg) (struct socket *sock, struct msghdr *m,
|
|
size_t total_len, int flags);
|
|
int (*mmap) (struct file *file, struct socket *sock,
|
|
struct vm_area_struct * vma);
|
|
ssize_t (*sendpage) (struct socket *sock, struct page *page,
|
|
int offset, size_t size, int flags);
|
|
ssize_t (*splice_read)(struct socket *sock, loff_t *ppos,
|
|
struct pipe_inode_info *pipe, size_t len, unsigned int flags);
|
|
int (*set_peek_off)(struct sock *sk, int val);
|
|
};
|
|
|
|
|
|
|
|
|
|
struct net_proto_family {
|
|
int family;
|
|
int (*create)(struct net *net, struct socket *sock,
|
|
int protocol, int kern);
|
|
struct module *owner;
|
|
};
|
|
|
|
struct iovec;
|
|
struct kvec;
|
|
|
|
enum {
|
|
SOCK_WAKE_IO,
|
|
SOCK_WAKE_WAITD,
|
|
SOCK_WAKE_SPACE,
|
|
SOCK_WAKE_URG,
|
|
};
|
|
|
|
int sock_wake_async(struct socket_wq *sk_wq, int how, int band);
|
|
int sock_register(const struct net_proto_family *fam);
|
|
void sock_unregister(int family);
|
|
int __sock_create(struct net *net, int family, int type, int proto,
|
|
struct socket **res, int kern);
|
|
int sock_create(int family, int type, int proto, struct socket **res);
|
|
int sock_create_kern(struct net *net, int family, int type, int proto, struct socket **res);
|
|
int sock_create_lite(int family, int type, int proto, struct socket **res);
|
|
void sock_release(struct socket *sock);
|
|
int sock_sendmsg(struct socket *sock, struct msghdr *msg);
|
|
int sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
|
|
int flags);
|
|
struct file *sock_alloc_file(struct socket *sock, int flags, const char *dname);
|
|
struct socket *sockfd_lookup(int fd, int *err);
|
|
struct socket *sock_from_file(struct file *file, int *err);
|
|
|
|
int net_ratelimit(void);
|
|
# 271 "include/linux/net.h"
|
|
int kernel_sendmsg(struct socket *sock, struct msghdr *msg, struct kvec *vec,
|
|
size_t num, size_t len);
|
|
int kernel_recvmsg(struct socket *sock, struct msghdr *msg, struct kvec *vec,
|
|
size_t num, size_t len, int flags);
|
|
|
|
int kernel_bind(struct socket *sock, struct sockaddr *addr, int addrlen);
|
|
int kernel_listen(struct socket *sock, int backlog);
|
|
int kernel_accept(struct socket *sock, struct socket **newsock, int flags);
|
|
int kernel_connect(struct socket *sock, struct sockaddr *addr, int addrlen,
|
|
int flags);
|
|
int kernel_getsockname(struct socket *sock, struct sockaddr *addr,
|
|
int *addrlen);
|
|
int kernel_getpeername(struct socket *sock, struct sockaddr *addr,
|
|
int *addrlen);
|
|
int kernel_getsockopt(struct socket *sock, int level, int optname, char *optval,
|
|
int *optlen);
|
|
int kernel_setsockopt(struct socket *sock, int level, int optname, char *optval,
|
|
unsigned int optlen);
|
|
int kernel_sendpage(struct socket *sock, struct page *page, int offset,
|
|
size_t size, int flags);
|
|
int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg);
|
|
int kernel_sock_shutdown(struct socket *sock, enum sock_shutdown_cmd how);
|
|
# 30 "include/linux/skbuff.h" 2
|
|
# 1 "include/linux/textsearch.h" 1
|
|
# 10 "include/linux/textsearch.h"
|
|
struct module;
|
|
|
|
struct ts_config;
|
|
# 22 "include/linux/textsearch.h"
|
|
struct ts_state
|
|
{
|
|
unsigned int offset;
|
|
char cb[40];
|
|
};
|
|
# 38 "include/linux/textsearch.h"
|
|
struct ts_ops
|
|
{
|
|
const char *name;
|
|
struct ts_config * (*init)(const void *, unsigned int, gfp_t, int);
|
|
unsigned int (*find)(struct ts_config *,
|
|
struct ts_state *);
|
|
void (*destroy)(struct ts_config *);
|
|
void * (*get_pattern)(struct ts_config *);
|
|
unsigned int (*get_pattern_len)(struct ts_config *);
|
|
struct module *owner;
|
|
struct list_head list;
|
|
};
|
|
# 58 "include/linux/textsearch.h"
|
|
struct ts_config
|
|
{
|
|
struct ts_ops *ops;
|
|
int flags;
|
|
# 75 "include/linux/textsearch.h"
|
|
unsigned int (*get_next_block)(unsigned int consumed,
|
|
const u8 **dst,
|
|
struct ts_config *conf,
|
|
struct ts_state *state);
|
|
# 88 "include/linux/textsearch.h"
|
|
void (*finish)(struct ts_config *conf,
|
|
struct ts_state *state);
|
|
};
|
|
# 104 "include/linux/textsearch.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int textsearch_next(struct ts_config *conf,
|
|
struct ts_state *state)
|
|
{
|
|
unsigned int ret = conf->ops->find(conf, state);
|
|
|
|
if (conf->finish)
|
|
conf->finish(conf, state);
|
|
|
|
return ret;
|
|
}
|
|
# 123 "include/linux/textsearch.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int textsearch_find(struct ts_config *conf,
|
|
struct ts_state *state)
|
|
{
|
|
state->offset = 0;
|
|
return textsearch_next(conf, state);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *textsearch_get_pattern(struct ts_config *conf)
|
|
{
|
|
return conf->ops->get_pattern(conf);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int textsearch_get_pattern_len(struct ts_config *conf)
|
|
{
|
|
return conf->ops->get_pattern_len(conf);
|
|
}
|
|
|
|
extern int textsearch_register(struct ts_ops *);
|
|
extern int textsearch_unregister(struct ts_ops *);
|
|
extern struct ts_config *textsearch_prepare(const char *, const void *,
|
|
unsigned int, gfp_t, int);
|
|
extern void textsearch_destroy(struct ts_config *conf);
|
|
extern unsigned int textsearch_find_continuous(struct ts_config *,
|
|
struct ts_state *,
|
|
const void *, unsigned int);
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct ts_config *alloc_ts_config(size_t payload,
|
|
gfp_t gfp_mask)
|
|
{
|
|
struct ts_config *conf;
|
|
|
|
conf = kzalloc((((sizeof(*conf)) + 8 -1) & ~(8 -1)) + payload, gfp_mask);
|
|
if (conf == ((void *)0))
|
|
return ERR_PTR(-12);
|
|
|
|
return conf;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *ts_config_priv(struct ts_config *conf)
|
|
{
|
|
return ((u8 *) conf + (((sizeof(struct ts_config)) + 8 -1) & ~(8 -1)));
|
|
}
|
|
# 31 "include/linux/skbuff.h" 2
|
|
# 1 "include/net/checksum.h" 1
|
|
# 25 "include/net/checksum.h"
|
|
# 1 "./arch/arm/include/asm/uaccess.h" 1
|
|
# 16 "./arch/arm/include/asm/uaccess.h"
|
|
# 1 "arch/arm/include/generated/asm/errno.h" 1
|
|
# 17 "./arch/arm/include/asm/uaccess.h" 2
|
|
|
|
# 1 "./arch/arm/include/asm/domain.h" 1
|
|
# 87 "./arch/arm/include/asm/domain.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int get_domain(void)
|
|
{
|
|
unsigned int domain;
|
|
|
|
asm(
|
|
"mrc p15, 0, %0, c3, c0 @ get domain"
|
|
: "=r" (domain)
|
|
: "m" (current_thread_info()->cpu_domain));
|
|
|
|
return domain;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_domain(unsigned val)
|
|
{
|
|
asm volatile(
|
|
"mcr p15, 0, %0, c3, c0 @ set domain"
|
|
: : "r" (val) : "memory");
|
|
__asm__ __volatile__ ("isb " "" : : : "memory");
|
|
}
|
|
# 117 "./arch/arm/include/asm/domain.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void modify_domain(unsigned dom, unsigned type) { }
|
|
# 19 "./arch/arm/include/asm/uaccess.h" 2
|
|
# 45 "./arch/arm/include/asm/uaccess.h"
|
|
struct exception_table_entry
|
|
{
|
|
unsigned long insn, fixup;
|
|
};
|
|
|
|
extern int fixup_exception(struct pt_regs *regs);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int uaccess_save_and_enable(void)
|
|
{
|
|
|
|
unsigned int old_domain = get_domain();
|
|
|
|
|
|
set_domain((old_domain & ~((3) << (2 * (1)))) |
|
|
((1) << (2 * (1))));
|
|
|
|
return old_domain;
|
|
|
|
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void uaccess_restore(unsigned int flags)
|
|
{
|
|
|
|
|
|
set_domain(flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extern int __get_user_bad(void);
|
|
extern int __put_user_bad(void);
|
|
# 99 "./arch/arm/include/asm/uaccess.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_fs(mm_segment_t fs)
|
|
{
|
|
current_thread_info()->addr_limit = fs;
|
|
modify_domain(0, fs ? 1 : 1);
|
|
}
|
|
# 136 "./arch/arm/include/asm/uaccess.h"
|
|
extern int __get_user_1(void *);
|
|
extern int __get_user_2(void *);
|
|
extern int __get_user_4(void *);
|
|
extern int __get_user_32t_8(void *);
|
|
extern int __get_user_8(void *);
|
|
extern int __get_user_64t_1(void *);
|
|
extern int __get_user_64t_2(void *);
|
|
extern int __get_user_64t_4(void *);
|
|
# 236 "./arch/arm/include/asm/uaccess.h"
|
|
extern int __put_user_1(void *, unsigned int);
|
|
extern int __put_user_2(void *, unsigned int);
|
|
extern int __put_user_4(void *, unsigned int);
|
|
extern int __put_user_8(void *, unsigned long long);
|
|
# 493 "./arch/arm/include/asm/uaccess.h"
|
|
extern unsigned long __attribute__((warn_unused_result))
|
|
arm_copy_from_user(void *to, const void *from, unsigned long n);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __attribute__((warn_unused_result))
|
|
__copy_from_user(void *to, const void *from, unsigned long n)
|
|
{
|
|
unsigned int __ua_flags = uaccess_save_and_enable();
|
|
n = arm_copy_from_user(to, from, n);
|
|
uaccess_restore(__ua_flags);
|
|
return n;
|
|
}
|
|
|
|
extern unsigned long __attribute__((warn_unused_result))
|
|
arm_copy_to_user(void *to, const void *from, unsigned long n);
|
|
extern unsigned long __attribute__((warn_unused_result))
|
|
__copy_to_user_std(void *to, const void *from, unsigned long n);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __attribute__((warn_unused_result))
|
|
__copy_to_user(void *to, const void *from, unsigned long n)
|
|
{
|
|
|
|
unsigned int __ua_flags = uaccess_save_and_enable();
|
|
n = arm_copy_to_user(to, from, n);
|
|
uaccess_restore(__ua_flags);
|
|
return n;
|
|
|
|
|
|
|
|
}
|
|
|
|
extern unsigned long __attribute__((warn_unused_result))
|
|
arm_clear_user(void *addr, unsigned long n);
|
|
extern unsigned long __attribute__((warn_unused_result))
|
|
__clear_user_std(void *addr, unsigned long n);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __attribute__((warn_unused_result))
|
|
__clear_user(void *addr, unsigned long n)
|
|
{
|
|
unsigned int __ua_flags = uaccess_save_and_enable();
|
|
n = arm_clear_user(addr, n);
|
|
uaccess_restore(__ua_flags);
|
|
return n;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __attribute__((warn_unused_result)) copy_from_user(void *to, const void *from, unsigned long n)
|
|
{
|
|
if ((({ unsigned long flag, roksum; (void)0; __asm__("adds %1, %2, %3; sbcccs %1, %1, %0; movcc %0, #0" : "=&r" (flag), "=&r" (roksum) : "r" (from), "Ir" (n), "0" (current_thread_info()->addr_limit) : "cc"); flag; }) == 0))
|
|
n = __copy_from_user(to, from, n);
|
|
else
|
|
({ void *__p = (to); size_t __n = n; if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); });
|
|
return n;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __attribute__((warn_unused_result)) copy_to_user(void *to, const void *from, unsigned long n)
|
|
{
|
|
if ((({ unsigned long flag, roksum; (void)0; __asm__("adds %1, %2, %3; sbcccs %1, %1, %0; movcc %0, #0" : "=&r" (flag), "=&r" (roksum) : "r" (to), "Ir" (n), "0" (current_thread_info()->addr_limit) : "cc"); flag; }) == 0))
|
|
n = __copy_to_user(to, from, n);
|
|
return n;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __attribute__((warn_unused_result)) clear_user(void *to, unsigned long n)
|
|
{
|
|
if ((({ unsigned long flag, roksum; (void)0; __asm__("adds %1, %2, %3; sbcccs %1, %1, %0; movcc %0, #0" : "=&r" (flag), "=&r" (roksum) : "r" (to), "Ir" (n), "0" (current_thread_info()->addr_limit) : "cc"); flag; }) == 0))
|
|
n = __clear_user(to, n);
|
|
return n;
|
|
}
|
|
|
|
|
|
extern long strncpy_from_user(char *dest, const char *src, long count);
|
|
|
|
extern __attribute__((warn_unused_result)) long strlen_user(const char *str);
|
|
extern __attribute__((warn_unused_result)) long strnlen_user(const char *str, long n);
|
|
# 26 "include/net/checksum.h" 2
|
|
# 1 "./arch/arm/include/asm/checksum.h" 1
|
|
# 12 "./arch/arm/include/asm/checksum.h"
|
|
# 1 "include/linux/in6.h" 1
|
|
# 23 "include/linux/in6.h"
|
|
# 1 "include/uapi/linux/in6.h" 1
|
|
# 25 "include/uapi/linux/in6.h"
|
|
# 1 "./include/uapi/linux/libc-compat.h" 1
|
|
# 26 "include/uapi/linux/in6.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct in6_addr {
|
|
union {
|
|
__u8 u6_addr8[16];
|
|
|
|
__be16 u6_addr16[8];
|
|
__be32 u6_addr32[4];
|
|
|
|
} in6_u;
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
struct sockaddr_in6 {
|
|
unsigned short int sin6_family;
|
|
__be16 sin6_port;
|
|
__be32 sin6_flowinfo;
|
|
struct in6_addr sin6_addr;
|
|
__u32 sin6_scope_id;
|
|
};
|
|
|
|
|
|
|
|
struct ipv6_mreq {
|
|
|
|
struct in6_addr ipv6mr_multiaddr;
|
|
|
|
|
|
int ipv6mr_ifindex;
|
|
};
|
|
|
|
|
|
|
|
|
|
struct in6_flowlabel_req {
|
|
struct in6_addr flr_dst;
|
|
__be32 flr_label;
|
|
__u8 flr_action;
|
|
__u8 flr_share;
|
|
__u16 flr_flags;
|
|
__u16 flr_expires;
|
|
__u16 flr_linger;
|
|
__u32 __flr_pad;
|
|
|
|
};
|
|
# 24 "include/linux/in6.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
extern const struct in6_addr in6addr_any;
|
|
|
|
extern const struct in6_addr in6addr_loopback;
|
|
|
|
extern const struct in6_addr in6addr_linklocal_allnodes;
|
|
|
|
|
|
extern const struct in6_addr in6addr_linklocal_allrouters;
|
|
|
|
|
|
extern const struct in6_addr in6addr_interfacelocal_allnodes;
|
|
|
|
|
|
extern const struct in6_addr in6addr_interfacelocal_allrouters;
|
|
|
|
|
|
extern const struct in6_addr in6addr_sitelocal_allrouters;
|
|
# 13 "./arch/arm/include/asm/checksum.h" 2
|
|
# 26 "./arch/arm/include/asm/checksum.h"
|
|
__wsum csum_partial(const void *buff, int len, __wsum sum);
|
|
# 36 "./arch/arm/include/asm/checksum.h"
|
|
__wsum
|
|
csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum);
|
|
|
|
__wsum
|
|
csum_partial_copy_from_user(const void *src, void *dst, int len, __wsum sum, int *err_ptr);
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __sum16 csum_fold(__wsum sum)
|
|
{
|
|
__asm__(
|
|
"add %0, %1, %1, ror #16 @ csum_fold"
|
|
: "=r" (sum)
|
|
: "r" (sum)
|
|
: "cc");
|
|
return ( __sum16)(~( u32)sum >> 16);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __sum16
|
|
ip_fast_csum(const void *iph, unsigned int ihl)
|
|
{
|
|
unsigned int tmp1;
|
|
__wsum sum;
|
|
|
|
__asm__ __volatile__(
|
|
"ldr %0, [%1], #4 @ ip_fast_csum \n ldr %3, [%1], #4 \n sub %2, %2, #5 \n adds %0, %0, %3 \n ldr %3, [%1], #4 \n adcs %0, %0, %3 \n ldr %3, [%1], #4 \n1: adcs %0, %0, %3 \n ldr %3, [%1], #4 \n tst %2, #15 @ do this carefully \n subne %2, %2, #1 @ without destroying \n bne 1b @ the carry flag \n adcs %0, %0, %3 \n adc %0, %0, #0"
|
|
# 80 "./arch/arm/include/asm/checksum.h"
|
|
: "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1)
|
|
: "1" (iph), "2" (ihl)
|
|
: "cc", "memory");
|
|
return csum_fold(sum);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __wsum
|
|
csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
|
|
unsigned short proto, __wsum sum)
|
|
{
|
|
u32 lenprot = len | proto << 16;
|
|
if (__builtin_constant_p(sum) && sum == 0) {
|
|
__asm__(
|
|
"adds %0, %1, %2 @ csum_tcpudp_nofold0 \n\t"
|
|
|
|
|
|
|
|
"adcs %0, %0, %3, ror #8 \n\t"
|
|
|
|
"adc %0, %0, #0"
|
|
: "=&r" (sum)
|
|
: "r" (daddr), "r" (saddr), "r" (lenprot)
|
|
: "cc");
|
|
} else {
|
|
__asm__(
|
|
"adds %0, %1, %2 @ csum_tcpudp_nofold \n\t"
|
|
"adcs %0, %0, %3 \n\t"
|
|
|
|
|
|
|
|
"adcs %0, %0, %4, ror #8 \n\t"
|
|
|
|
"adc %0, %0, #0"
|
|
: "=&r"(sum)
|
|
: "r" (sum), "r" (daddr), "r" (saddr), "r" (lenprot)
|
|
: "cc");
|
|
}
|
|
return sum;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __sum16
|
|
csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
|
|
unsigned short proto, __wsum sum)
|
|
{
|
|
return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __sum16
|
|
ip_compute_csum(const void *buff, int len)
|
|
{
|
|
return csum_fold(csum_partial(buff, len, 0));
|
|
}
|
|
|
|
|
|
extern __wsum
|
|
__csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, __be32 len,
|
|
__be32 proto, __wsum sum);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __sum16
|
|
csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, __u32 len,
|
|
unsigned short proto, __wsum sum)
|
|
{
|
|
return csum_fold(__csum_ipv6_magic(saddr, daddr, (( __be32)(__builtin_constant_p((__u32)((len))) ? ((__u32)( (((__u32)((len)) & (__u32)0x000000ffUL) << 24) | (((__u32)((len)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((len)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((len)) & (__u32)0xff000000UL) >> 24))) : __fswab32((len)))),
|
|
(( __be32)(__builtin_constant_p((__u32)((proto))) ? ((__u32)( (((__u32)((proto)) & (__u32)0x000000ffUL) << 24) | (((__u32)((proto)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((proto)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((proto)) & (__u32)0xff000000UL) >> 24))) : __fswab32((proto)))), sum));
|
|
}
|
|
# 27 "include/net/checksum.h" 2
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
__wsum csum_and_copy_from_user (const void *src, void *dst,
|
|
int len, __wsum sum, int *err_ptr)
|
|
{
|
|
if ((({ unsigned long flag, roksum; (void)0; __asm__("adds %1, %2, %3; sbcccs %1, %1, %0; movcc %0, #0" : "=&r" (flag), "=&r" (roksum) : "r" (src), "Ir" (len), "0" (current_thread_info()->addr_limit) : "cc"); flag; }) == 0))
|
|
return csum_partial_copy_from_user(src, dst, len, sum, err_ptr);
|
|
|
|
if (len)
|
|
*err_ptr = -14;
|
|
|
|
return sum;
|
|
}
|
|
|
|
|
|
|
|
static __inline__ __attribute__((always_inline)) __attribute__((no_instrument_function)) __wsum csum_and_copy_to_user
|
|
(const void *src, void *dst, int len, __wsum sum, int *err_ptr)
|
|
{
|
|
sum = csum_partial(src, len, sum);
|
|
|
|
if ((({ unsigned long flag, roksum; (void)0; __asm__("adds %1, %2, %3; sbcccs %1, %1, %0; movcc %0, #0" : "=&r" (flag), "=&r" (roksum) : "r" (dst), "Ir" (len), "0" (current_thread_info()->addr_limit) : "cc"); flag; }) == 0)) {
|
|
if (copy_to_user(dst, src, len) == 0)
|
|
return sum;
|
|
}
|
|
if (len)
|
|
*err_ptr = -14;
|
|
|
|
return ( __wsum)-1;
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __wsum csum_add(__wsum csum, __wsum addend)
|
|
{
|
|
u32 res = ( u32)csum;
|
|
res += ( u32)addend;
|
|
return ( __wsum)(res + (res < ( u32)addend));
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __wsum csum_sub(__wsum csum, __wsum addend)
|
|
{
|
|
return csum_add(csum, ~addend);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __sum16 csum16_add(__sum16 csum, __be16 addend)
|
|
{
|
|
u16 res = ( u16)csum;
|
|
|
|
res += ( u16)addend;
|
|
return ( __sum16)(res + (res < ( u16)addend));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __sum16 csum16_sub(__sum16 csum, __be16 addend)
|
|
{
|
|
return csum16_add(csum, ~addend);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __wsum
|
|
csum_block_add(__wsum csum, __wsum csum2, int offset)
|
|
{
|
|
u32 sum = ( u32)csum2;
|
|
if (offset&1)
|
|
sum = ((sum&0xFF00FF)<<8)+((sum>>8)&0xFF00FF);
|
|
return csum_add(csum, ( __wsum)sum);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __wsum
|
|
csum_block_add_ext(__wsum csum, __wsum csum2, int offset, int len)
|
|
{
|
|
return csum_block_add(csum, csum2, offset);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __wsum
|
|
csum_block_sub(__wsum csum, __wsum csum2, int offset)
|
|
{
|
|
u32 sum = ( u32)csum2;
|
|
if (offset&1)
|
|
sum = ((sum&0xFF00FF)<<8)+((sum>>8)&0xFF00FF);
|
|
return csum_sub(csum, ( __wsum)sum);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __wsum csum_unfold(__sum16 n)
|
|
{
|
|
return ( __wsum)n;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __wsum csum_partial_ext(const void *buff, int len, __wsum sum)
|
|
{
|
|
return csum_partial(buff, len, sum);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void csum_replace4(__sum16 *sum, __be32 from, __be32 to)
|
|
{
|
|
__wsum tmp = csum_sub(~csum_unfold(*sum), ( __wsum)from);
|
|
|
|
*sum = csum_fold(csum_add(tmp, ( __wsum)to));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void csum_replace2(__sum16 *sum, __be16 old, __be16 new)
|
|
{
|
|
*sum = ~csum16_add(csum16_sub(~(*sum), old), new);
|
|
}
|
|
|
|
struct sk_buff;
|
|
void inet_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb,
|
|
__be32 from, __be32 to, bool pseudohdr);
|
|
void inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb,
|
|
const __be32 *from, const __be32 *to,
|
|
bool pseudohdr);
|
|
void inet_proto_csum_replace_by_diff(__sum16 *sum, struct sk_buff *skb,
|
|
__wsum diff, bool pseudohdr);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inet_proto_csum_replace2(__sum16 *sum, struct sk_buff *skb,
|
|
__be16 from, __be16 to,
|
|
bool pseudohdr)
|
|
{
|
|
inet_proto_csum_replace4(sum, skb, ( __be32)from,
|
|
( __be32)to, pseudohdr);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __wsum remcsum_adjust(void *ptr, __wsum csum,
|
|
int start, int offset)
|
|
{
|
|
__sum16 *psum = (__sum16 *)(ptr + offset);
|
|
__wsum delta;
|
|
|
|
|
|
csum = csum_sub(csum, csum_partial(ptr, start, 0));
|
|
|
|
|
|
delta = csum_sub(csum_fold(csum), *psum);
|
|
*psum = csum_fold(csum);
|
|
|
|
return delta;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void remcsum_unadjust(__sum16 *psum, __wsum delta)
|
|
{
|
|
*psum = csum_fold(csum_sub(delta, *psum));
|
|
}
|
|
# 32 "include/linux/skbuff.h" 2
|
|
|
|
|
|
|
|
# 1 "include/linux/netdev_features.h" 1
|
|
# 15 "include/linux/netdev_features.h"
|
|
typedef u64 netdev_features_t;
|
|
|
|
enum {
|
|
NETIF_F_SG_BIT,
|
|
NETIF_F_IP_CSUM_BIT,
|
|
__UNUSED_NETIF_F_1,
|
|
NETIF_F_HW_CSUM_BIT,
|
|
NETIF_F_IPV6_CSUM_BIT,
|
|
NETIF_F_HIGHDMA_BIT,
|
|
NETIF_F_FRAGLIST_BIT,
|
|
NETIF_F_HW_VLAN_CTAG_TX_BIT,
|
|
NETIF_F_HW_VLAN_CTAG_RX_BIT,
|
|
NETIF_F_HW_VLAN_CTAG_FILTER_BIT,
|
|
NETIF_F_VLAN_CHALLENGED_BIT,
|
|
NETIF_F_GSO_BIT,
|
|
NETIF_F_LLTX_BIT,
|
|
|
|
NETIF_F_NETNS_LOCAL_BIT,
|
|
NETIF_F_GRO_BIT,
|
|
NETIF_F_LRO_BIT,
|
|
|
|
NETIF_F_GSO_SHIFT,
|
|
NETIF_F_TSO_BIT
|
|
= NETIF_F_GSO_SHIFT,
|
|
NETIF_F_UFO_BIT,
|
|
NETIF_F_GSO_ROBUST_BIT,
|
|
NETIF_F_TSO_ECN_BIT,
|
|
NETIF_F_TSO6_BIT,
|
|
NETIF_F_FSO_BIT,
|
|
NETIF_F_GSO_GRE_BIT,
|
|
NETIF_F_GSO_GRE_CSUM_BIT,
|
|
NETIF_F_GSO_IPIP_BIT,
|
|
NETIF_F_GSO_SIT_BIT,
|
|
NETIF_F_GSO_UDP_TUNNEL_BIT,
|
|
NETIF_F_GSO_UDP_TUNNEL_CSUM_BIT,
|
|
NETIF_F_GSO_TUNNEL_REMCSUM_BIT,
|
|
NETIF_F_GSO_LAST =
|
|
NETIF_F_GSO_TUNNEL_REMCSUM_BIT,
|
|
|
|
NETIF_F_FCOE_CRC_BIT,
|
|
NETIF_F_SCTP_CSUM_BIT,
|
|
NETIF_F_FCOE_MTU_BIT,
|
|
NETIF_F_NTUPLE_BIT,
|
|
NETIF_F_RXHASH_BIT,
|
|
NETIF_F_RXCSUM_BIT,
|
|
NETIF_F_NOCACHE_COPY_BIT,
|
|
NETIF_F_LOOPBACK_BIT,
|
|
NETIF_F_RXFCS_BIT,
|
|
NETIF_F_RXALL_BIT,
|
|
NETIF_F_HW_VLAN_STAG_TX_BIT,
|
|
NETIF_F_HW_VLAN_STAG_RX_BIT,
|
|
NETIF_F_HW_VLAN_STAG_FILTER_BIT,
|
|
NETIF_F_HW_L2FW_DOFFLOAD_BIT,
|
|
NETIF_F_BUSY_POLL_BIT,
|
|
# 77 "include/linux/netdev_features.h"
|
|
NETDEV_FEATURE_COUNT
|
|
};
|
|
# 36 "include/linux/skbuff.h" 2
|
|
|
|
# 1 "include/net/flow_dissector.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/if_ether.h" 1
|
|
# 140 "include/uapi/linux/if_ether.h"
|
|
struct ethhdr {
|
|
unsigned char h_dest[6];
|
|
unsigned char h_source[6];
|
|
__be16 h_proto;
|
|
} __attribute__((packed));
|
|
# 7 "include/net/flow_dissector.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
struct flow_dissector_key_control {
|
|
u16 thoff;
|
|
u16 addr_type;
|
|
u32 flags;
|
|
};
|
|
# 28 "include/net/flow_dissector.h"
|
|
struct flow_dissector_key_basic {
|
|
__be16 n_proto;
|
|
u8 ip_proto;
|
|
u8 padding;
|
|
};
|
|
|
|
struct flow_dissector_key_tags {
|
|
u32 vlan_id:12,
|
|
flow_label:20;
|
|
};
|
|
|
|
struct flow_dissector_key_keyid {
|
|
__be32 keyid;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct flow_dissector_key_ipv4_addrs {
|
|
|
|
__be32 src;
|
|
__be32 dst;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct flow_dissector_key_ipv6_addrs {
|
|
|
|
struct in6_addr src;
|
|
struct in6_addr dst;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct flow_dissector_key_tipc_addrs {
|
|
__be32 srcnode;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct flow_dissector_key_addrs {
|
|
union {
|
|
struct flow_dissector_key_ipv4_addrs v4addrs;
|
|
struct flow_dissector_key_ipv6_addrs v6addrs;
|
|
struct flow_dissector_key_tipc_addrs tipcaddrs;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct flow_dissector_key_ports {
|
|
union {
|
|
__be32 ports;
|
|
struct {
|
|
__be16 src;
|
|
__be16 dst;
|
|
};
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct flow_dissector_key_eth_addrs {
|
|
|
|
unsigned char dst[6];
|
|
unsigned char src[6];
|
|
};
|
|
|
|
enum flow_dissector_key_id {
|
|
FLOW_DISSECTOR_KEY_CONTROL,
|
|
FLOW_DISSECTOR_KEY_BASIC,
|
|
FLOW_DISSECTOR_KEY_IPV4_ADDRS,
|
|
FLOW_DISSECTOR_KEY_IPV6_ADDRS,
|
|
FLOW_DISSECTOR_KEY_PORTS,
|
|
FLOW_DISSECTOR_KEY_ETH_ADDRS,
|
|
FLOW_DISSECTOR_KEY_TIPC_ADDRS,
|
|
FLOW_DISSECTOR_KEY_VLANID,
|
|
FLOW_DISSECTOR_KEY_FLOW_LABEL,
|
|
FLOW_DISSECTOR_KEY_GRE_KEYID,
|
|
FLOW_DISSECTOR_KEY_MPLS_ENTROPY,
|
|
|
|
FLOW_DISSECTOR_KEY_MAX,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct flow_dissector_key {
|
|
enum flow_dissector_key_id key_id;
|
|
size_t offset;
|
|
|
|
};
|
|
|
|
struct flow_dissector {
|
|
unsigned int used_keys;
|
|
unsigned short int offset[FLOW_DISSECTOR_KEY_MAX];
|
|
};
|
|
|
|
struct flow_keys {
|
|
struct flow_dissector_key_control control;
|
|
|
|
struct flow_dissector_key_basic basic;
|
|
struct flow_dissector_key_tags tags;
|
|
struct flow_dissector_key_keyid keyid;
|
|
struct flow_dissector_key_ports ports;
|
|
struct flow_dissector_key_addrs addrs;
|
|
};
|
|
|
|
|
|
|
|
|
|
__be32 flow_get_u32_src(const struct flow_keys *flow);
|
|
__be32 flow_get_u32_dst(const struct flow_keys *flow);
|
|
|
|
extern struct flow_dissector flow_keys_dissector;
|
|
extern struct flow_dissector flow_keys_buf_dissector;
|
|
# 173 "include/net/flow_dissector.h"
|
|
struct flow_keys_digest {
|
|
u8 data[16];
|
|
};
|
|
|
|
void make_flow_keys_digest(struct flow_keys_digest *digest,
|
|
const struct flow_keys *flow);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool flow_keys_have_l4(struct flow_keys *keys)
|
|
{
|
|
return (keys->ports.ports || keys->tags.flow_label);
|
|
}
|
|
|
|
u32 flow_hash_from_keys(struct flow_keys *keys);
|
|
# 38 "include/linux/skbuff.h" 2
|
|
# 1 "include/linux/splice.h" 1
|
|
# 11 "include/linux/splice.h"
|
|
# 1 "include/linux/pipe_fs_i.h" 1
|
|
# 20 "include/linux/pipe_fs_i.h"
|
|
struct pipe_buffer {
|
|
struct page *page;
|
|
unsigned int offset, len;
|
|
const struct pipe_buf_operations *ops;
|
|
unsigned int flags;
|
|
unsigned long private;
|
|
};
|
|
# 47 "include/linux/pipe_fs_i.h"
|
|
struct pipe_inode_info {
|
|
struct mutex mutex;
|
|
wait_queue_head_t wait;
|
|
unsigned int nrbufs, curbuf, buffers;
|
|
unsigned int readers;
|
|
unsigned int writers;
|
|
unsigned int files;
|
|
unsigned int waiting_writers;
|
|
unsigned int r_counter;
|
|
unsigned int w_counter;
|
|
struct page *tmp_page;
|
|
struct fasync_struct *fasync_readers;
|
|
struct fasync_struct *fasync_writers;
|
|
struct pipe_buffer *bufs;
|
|
struct user_struct *user;
|
|
};
|
|
# 79 "include/linux/pipe_fs_i.h"
|
|
struct pipe_buf_operations {
|
|
|
|
|
|
|
|
|
|
|
|
int can_merge;
|
|
# 94 "include/linux/pipe_fs_i.h"
|
|
int (*confirm)(struct pipe_inode_info *, struct pipe_buffer *);
|
|
|
|
|
|
|
|
|
|
|
|
void (*release)(struct pipe_inode_info *, struct pipe_buffer *);
|
|
# 110 "include/linux/pipe_fs_i.h"
|
|
int (*steal)(struct pipe_inode_info *, struct pipe_buffer *);
|
|
|
|
|
|
|
|
|
|
void (*get)(struct pipe_inode_info *, struct pipe_buffer *);
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void pipe_lock(struct pipe_inode_info *);
|
|
void pipe_unlock(struct pipe_inode_info *);
|
|
void pipe_double_lock(struct pipe_inode_info *, struct pipe_inode_info *);
|
|
|
|
extern unsigned int pipe_max_size, pipe_min_size;
|
|
extern unsigned long pipe_user_pages_hard;
|
|
extern unsigned long pipe_user_pages_soft;
|
|
int pipe_proc_fn(struct ctl_table *, int, void *, size_t *, loff_t *);
|
|
|
|
|
|
|
|
void pipe_wait(struct pipe_inode_info *pipe);
|
|
|
|
struct pipe_inode_info *alloc_pipe_info(void);
|
|
void free_pipe_info(struct pipe_inode_info *);
|
|
|
|
|
|
void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *);
|
|
int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *);
|
|
int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *);
|
|
void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *);
|
|
|
|
extern const struct pipe_buf_operations nosteal_pipe_buf_ops;
|
|
|
|
|
|
long pipe_fcntl(struct file *, unsigned int, unsigned long arg);
|
|
struct pipe_inode_info *get_pipe_info(struct file *file);
|
|
|
|
int create_pipe_files(struct file **, int);
|
|
# 12 "include/linux/splice.h" 2
|
|
# 26 "include/linux/splice.h"
|
|
struct splice_desc {
|
|
size_t total_len;
|
|
unsigned int len;
|
|
unsigned int flags;
|
|
|
|
|
|
|
|
union {
|
|
void *userptr;
|
|
struct file *file;
|
|
void *data;
|
|
} u;
|
|
loff_t pos;
|
|
loff_t *opos;
|
|
size_t num_spliced;
|
|
bool need_wakeup;
|
|
};
|
|
|
|
struct partial_page {
|
|
unsigned int offset;
|
|
unsigned int len;
|
|
unsigned long private;
|
|
};
|
|
|
|
|
|
|
|
|
|
struct splice_pipe_desc {
|
|
struct page **pages;
|
|
struct partial_page *partial;
|
|
int nr_pages;
|
|
unsigned int nr_pages_max;
|
|
unsigned int flags;
|
|
const struct pipe_buf_operations *ops;
|
|
void (*spd_release)(struct splice_pipe_desc *, unsigned int);
|
|
};
|
|
|
|
typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *,
|
|
struct splice_desc *);
|
|
typedef int (splice_direct_actor)(struct pipe_inode_info *,
|
|
struct splice_desc *);
|
|
|
|
extern ssize_t splice_from_pipe(struct pipe_inode_info *, struct file *,
|
|
loff_t *, size_t, unsigned int,
|
|
splice_actor *);
|
|
extern ssize_t __splice_from_pipe(struct pipe_inode_info *,
|
|
struct splice_desc *, splice_actor *);
|
|
extern ssize_t splice_to_pipe(struct pipe_inode_info *,
|
|
struct splice_pipe_desc *);
|
|
extern ssize_t splice_direct_to_actor(struct file *, struct splice_desc *,
|
|
splice_direct_actor *);
|
|
|
|
|
|
|
|
|
|
extern int splice_grow_spd(const struct pipe_inode_info *, struct splice_pipe_desc *);
|
|
extern void splice_shrink_spd(struct splice_pipe_desc *);
|
|
extern void spd_release_page(struct splice_pipe_desc *, unsigned int);
|
|
|
|
extern const struct pipe_buf_operations page_cache_pipe_buf_ops;
|
|
# 39 "include/linux/skbuff.h" 2
|
|
|
|
# 1 "include/net/flow.h" 1
|
|
# 23 "include/net/flow.h"
|
|
struct flowi_tunnel {
|
|
__be64 tun_id;
|
|
};
|
|
|
|
struct flowi_common {
|
|
int flowic_oif;
|
|
int flowic_iif;
|
|
__u32 flowic_mark;
|
|
__u8 flowic_tos;
|
|
__u8 flowic_scope;
|
|
__u8 flowic_proto;
|
|
__u8 flowic_flags;
|
|
|
|
|
|
|
|
|
|
__u32 flowic_secid;
|
|
struct flowi_tunnel flowic_tun_key;
|
|
};
|
|
|
|
union flowi_uli {
|
|
struct {
|
|
__be16 dport;
|
|
__be16 sport;
|
|
} ports;
|
|
|
|
struct {
|
|
__u8 type;
|
|
__u8 code;
|
|
} icmpt;
|
|
|
|
struct {
|
|
__le16 dport;
|
|
__le16 sport;
|
|
} dnports;
|
|
|
|
__be32 spi;
|
|
__be32 gre_key;
|
|
|
|
struct {
|
|
__u8 type;
|
|
} mht;
|
|
};
|
|
|
|
struct flowi4 {
|
|
struct flowi_common __fl_common;
|
|
# 80 "include/net/flow.h"
|
|
__be32 saddr;
|
|
__be32 daddr;
|
|
|
|
union flowi_uli uli;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} __attribute__((__aligned__(32/8)));
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void flowi4_init_output(struct flowi4 *fl4, int oif,
|
|
__u32 mark, __u8 tos, __u8 scope,
|
|
__u8 proto, __u8 flags,
|
|
__be32 daddr, __be32 saddr,
|
|
__be16 dport, __be16 sport)
|
|
{
|
|
fl4->__fl_common.flowic_oif = oif;
|
|
fl4->__fl_common.flowic_iif = 1;
|
|
fl4->__fl_common.flowic_mark = mark;
|
|
fl4->__fl_common.flowic_tos = tos;
|
|
fl4->__fl_common.flowic_scope = scope;
|
|
fl4->__fl_common.flowic_proto = proto;
|
|
fl4->__fl_common.flowic_flags = flags;
|
|
fl4->__fl_common.flowic_secid = 0;
|
|
fl4->__fl_common.flowic_tun_key.tun_id = 0;
|
|
fl4->daddr = daddr;
|
|
fl4->saddr = saddr;
|
|
fl4->uli.ports.dport = dport;
|
|
fl4->uli.ports.sport = sport;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void flowi4_update_output(struct flowi4 *fl4, int oif, __u8 tos,
|
|
__be32 daddr, __be32 saddr)
|
|
{
|
|
fl4->__fl_common.flowic_oif = oif;
|
|
fl4->__fl_common.flowic_tos = tos;
|
|
fl4->daddr = daddr;
|
|
fl4->saddr = saddr;
|
|
}
|
|
|
|
|
|
struct flowi6 {
|
|
struct flowi_common __fl_common;
|
|
# 136 "include/net/flow.h"
|
|
struct in6_addr daddr;
|
|
struct in6_addr saddr;
|
|
__be32 flowlabel;
|
|
union flowi_uli uli;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} __attribute__((__aligned__(32/8)));
|
|
|
|
struct flowidn {
|
|
struct flowi_common __fl_common;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__le16 daddr;
|
|
__le16 saddr;
|
|
union flowi_uli uli;
|
|
|
|
|
|
} __attribute__((__aligned__(32/8)));
|
|
|
|
struct flowi {
|
|
union {
|
|
struct flowi_common __fl_common;
|
|
struct flowi4 ip4;
|
|
struct flowi6 ip6;
|
|
struct flowidn dn;
|
|
} u;
|
|
# 180 "include/net/flow.h"
|
|
} __attribute__((__aligned__(32/8)));
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct flowi *flowi4_to_flowi(struct flowi4 *fl4)
|
|
{
|
|
return ({ const typeof( ((struct flowi *)0)->u.ip4 ) *__mptr = (fl4); (struct flowi *)( (char *)__mptr - __builtin_offsetof(struct flowi, u.ip4) );});
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct flowi *flowi6_to_flowi(struct flowi6 *fl6)
|
|
{
|
|
return ({ const typeof( ((struct flowi *)0)->u.ip6 ) *__mptr = (fl6); (struct flowi *)( (char *)__mptr - __builtin_offsetof(struct flowi, u.ip6) );});
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct flowi *flowidn_to_flowi(struct flowidn *fldn)
|
|
{
|
|
return ({ const typeof( ((struct flowi *)0)->u.dn ) *__mptr = (fldn); (struct flowi *)( (char *)__mptr - __builtin_offsetof(struct flowi, u.dn) );});
|
|
}
|
|
|
|
typedef unsigned long flow_compare_t;
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) size_t flow_key_size(u16 family)
|
|
{
|
|
switch (family) {
|
|
case 2:
|
|
((void)sizeof(char[1 - 2*!!(sizeof(struct flowi4) % sizeof(flow_compare_t))]));
|
|
return sizeof(struct flowi4) / sizeof(flow_compare_t);
|
|
case 10:
|
|
((void)sizeof(char[1 - 2*!!(sizeof(struct flowi6) % sizeof(flow_compare_t))]));
|
|
return sizeof(struct flowi6) / sizeof(flow_compare_t);
|
|
case 12:
|
|
((void)sizeof(char[1 - 2*!!(sizeof(struct flowidn) % sizeof(flow_compare_t))]));
|
|
return sizeof(struct flowidn) / sizeof(flow_compare_t);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
struct net;
|
|
struct sock;
|
|
struct flow_cache_ops;
|
|
|
|
struct flow_cache_object {
|
|
const struct flow_cache_ops *ops;
|
|
};
|
|
|
|
struct flow_cache_ops {
|
|
struct flow_cache_object *(*get)(struct flow_cache_object *);
|
|
int (*check)(struct flow_cache_object *);
|
|
void (*delete)(struct flow_cache_object *);
|
|
};
|
|
|
|
typedef struct flow_cache_object *(*flow_resolve_t)(
|
|
struct net *net, const struct flowi *key, u16 family,
|
|
u8 dir, struct flow_cache_object *oldobj, void *ctx);
|
|
|
|
struct flow_cache_object *flow_cache_lookup(struct net *net,
|
|
const struct flowi *key, u16 family,
|
|
u8 dir, flow_resolve_t resolver,
|
|
void *ctx);
|
|
int flow_cache_init(struct net *net);
|
|
void flow_cache_fini(struct net *net);
|
|
|
|
void flow_cache_flush(struct net *net);
|
|
void flow_cache_flush_deferred(struct net *net);
|
|
extern atomic_t flow_cache_genid;
|
|
|
|
__u32 __get_hash_from_flowi6(const struct flowi6 *fl6, struct flow_keys *keys);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 get_hash_from_flowi6(const struct flowi6 *fl6)
|
|
{
|
|
struct flow_keys keys;
|
|
|
|
return __get_hash_from_flowi6(fl6, &keys);
|
|
}
|
|
|
|
__u32 __get_hash_from_flowi4(const struct flowi4 *fl4, struct flow_keys *keys);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 get_hash_from_flowi4(const struct flowi4 *fl4)
|
|
{
|
|
struct flow_keys keys;
|
|
|
|
return __get_hash_from_flowi4(fl4, &keys);
|
|
}
|
|
# 41 "include/linux/skbuff.h" 2
|
|
# 1 "include/linux/ecnt_skbuff.h" 1
|
|
|
|
|
|
# 1 "include/generated/uapi/linux/version.h" 1
|
|
# 4 "include/linux/ecnt_skbuff.h" 2
|
|
# 28 "include/linux/ecnt_skbuff.h"
|
|
# 1 "include/linux/foe_hook.h" 1
|
|
|
|
|
|
# 1 "include/uapi/linux/foe_hook.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct SkbFoeInfo{
|
|
unsigned short ppe_magic;
|
|
unsigned short ppe_foe_entry;
|
|
unsigned char ppe_ai;
|
|
unsigned char wan_type;
|
|
unsigned short wan_index;
|
|
};
|
|
|
|
struct SmbdSpeedInfo{
|
|
unsigned char smbd_sk;
|
|
unsigned char smbd_speed;
|
|
void *smbd_outDev;
|
|
unsigned char smbd_mac_header[14];
|
|
unsigned char smbd_ip_header[20];
|
|
};
|
|
|
|
struct ShortCutSpeedInfo{
|
|
unsigned char shortcut_sk;
|
|
unsigned char shortcut_speed;
|
|
void * out_dev;
|
|
unsigned char mac_header[14];
|
|
unsigned char ip_header[20];
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
int valid;
|
|
char ifname[16];
|
|
unsigned char smac_add[6];
|
|
unsigned char dmac_add[6];
|
|
unsigned int sessionID;
|
|
unsigned int src_ip;
|
|
unsigned int dst_ip;
|
|
int dns_valid;
|
|
unsigned int pri_dns;
|
|
unsigned int snd_dns;
|
|
}SMUX_Bridge_Info_Data;
|
|
# 4 "include/linux/foe_hook.h" 2
|
|
# 115 "include/linux/foe_hook.h"
|
|
typedef struct {
|
|
char virtual_name[16];
|
|
char dev_name[16];
|
|
char valid;
|
|
}wan_virtualdev_ifname;
|
|
struct port_info {
|
|
unsigned long int tsid:8;
|
|
unsigned long int channel:5;
|
|
unsigned long int nbq:5;
|
|
unsigned long int :1;
|
|
unsigned long int txq:4;
|
|
unsigned long int atm_pppoa:1;
|
|
unsigned long int atm_ipoa:1;
|
|
unsigned long int atm_vc_mux:1;
|
|
unsigned long int eth_macSTagEn:1;
|
|
unsigned long int eth_is_wan:1;
|
|
unsigned long int ds_to_qdma:1;
|
|
unsigned long int ds_need_offload:1;
|
|
unsigned long int force_high_priority_ring:1;
|
|
unsigned long int txq_is_valid:1;
|
|
unsigned long int stag:16;
|
|
unsigned long int magic:16;
|
|
};
|
|
|
|
typedef union {
|
|
|
|
struct {
|
|
# 155 "include/linux/foe_hook.h"
|
|
unsigned int queue : 3 ;
|
|
unsigned int channel : 5 ;
|
|
unsigned int oam : 1 ;
|
|
unsigned int fast : 1 ;
|
|
unsigned int tso : 1;
|
|
unsigned int tco : 1;
|
|
unsigned int uco : 1;
|
|
unsigned int ico : 1;
|
|
unsigned int sp_tag : 16 ;
|
|
unsigned int mic_idx : 1 ;
|
|
unsigned int resv0 : 1 ;
|
|
# 177 "include/linux/foe_hook.h"
|
|
unsigned int act_grp : 11;
|
|
unsigned int resv2 : 3;
|
|
unsigned int hwf : 1;
|
|
unsigned int nboq : 5;
|
|
unsigned int fport : 4;
|
|
unsigned int mtr_g : 7;
|
|
unsigned int no_drop : 1;
|
|
|
|
} raw ;
|
|
# 276 "include/linux/foe_hook.h"
|
|
struct {
|
|
# 286 "include/linux/foe_hook.h"
|
|
unsigned int queue : 3 ;
|
|
unsigned int channel :3 ;
|
|
unsigned int channel_ppe : 8 ;
|
|
unsigned int oam : 1 ;
|
|
unsigned int gem : 16 ;
|
|
unsigned int fport_ppe : 3 ;
|
|
unsigned int mtr : 1 ;
|
|
# 306 "include/linux/foe_hook.h"
|
|
unsigned int vid : 16 ;
|
|
unsigned int tpid : 2 ;
|
|
unsigned int insv : 1 ;
|
|
unsigned int fport : 3 ;
|
|
unsigned int mtr_index : 6 ;
|
|
unsigned int tso : 1 ;
|
|
unsigned int tco : 1 ;
|
|
unsigned int uco : 1 ;
|
|
unsigned int ico : 1 ;
|
|
|
|
} raw1 ;
|
|
|
|
unsigned int word[2] ;
|
|
}FETxMsg_T ;
|
|
# 345 "include/linux/foe_hook.h"
|
|
struct sk_buff;
|
|
struct net_device;
|
|
struct net_device_stats;
|
|
|
|
extern int (*ra_sw_nat_hook_rx_set_l2lu) (struct sk_buff * skb, unsigned int direction, int PpeIndex);
|
|
extern int (*ra_sw_nat_hook_rx) (struct sk_buff * skb);
|
|
extern int (*ra_sw_nat_hook_wifi_tx) (struct sk_buff * skb, unsigned int rx_len);
|
|
extern int (*ra_sw_nat_to_wifi_fast_tx) (struct sk_buff * skb);
|
|
extern int (*ra_sw_nat_to_xsi_fast_tx) (struct sk_buff * skb);
|
|
extern int (*ra_sw_nat_mcst_offload)(struct sk_buff *skb, int *dp);
|
|
extern int (*ra_sw_nat_ds_offload)(struct sk_buff *skb, int *dp);
|
|
extern int (*ra_nat_cirpir_get_start_idx)(void);
|
|
extern int (*ra_sw_nat_hook_update_dp)(int index, int dp);
|
|
extern int (*ra_sw_nat_hook_update_vlan)(int index,int outer_vlan,int inner_vlan);
|
|
extern int (*ra_sw_nat_local_in_tx) (struct sk_buff * skb,unsigned short port);
|
|
extern int (*ra_sw_nat_cds_all_ratelimit_hook) (struct sk_buff* skb);
|
|
|
|
extern int (*ra_sw_nat_hook_save_rxinfo)(struct sk_buff *skb);
|
|
extern int (*ra_sw_nat_hook_restore_rxinfo)(struct sk_buff *skb);
|
|
extern int (*ra_sw_nat_hook_save_txinfo)(struct sk_buff *skb);
|
|
extern int (*ra_sw_nat_hook_restore_txinfo)(struct sk_buff *skb);
|
|
extern int (*ra_sw_nat_hook_save_pptp_txinfo)(struct sk_buff *skb);
|
|
extern int (*ra_sw_nat_hook_restore_pptp_txinfo)(struct sk_buff *skb);
|
|
extern int (*ra_sw_nat_hook_save_gre_txinfo)(struct sk_buff *skb);
|
|
extern int (*ra_sw_nat_hook_restore_gre_txinfo)(struct sk_buff *skb);
|
|
extern int (*ra_sw_nat_hook_is_gre_offload_pkt)(struct sk_buff *skb);
|
|
extern int (*ra_sw_nat_hook_save_vxlan_txinfo)(struct sk_buff *skb);
|
|
extern int (*ra_sw_nat_hook_restore_vxlan_txinfo)(struct sk_buff *skb);
|
|
extern int (*ra_sw_nat_hook_is_vxlan_offload_pkt)(struct sk_buff *skb);
|
|
extern int (*ra_sw_nat_hook_is_hwnat_pkt)(struct sk_buff *skb);
|
|
extern int (*ra_sw_nat_hook_sendto_ppe)(struct sk_buff *skb);
|
|
extern int (*ra_sw_nat_hook_set_l2tp_dev)(struct net_device *dev);
|
|
extern struct net_device* (*ra_sw_nat_hook_read_l2tp_dev)(void);
|
|
extern int (*ra_sw_nat_hook_set_pptp_dev)(struct net_device *dev);
|
|
extern struct net_device* (*ra_sw_nat_hook_read_pptp_dev)(void);
|
|
extern int (*ra_sw_nat_rtsp_offload_restore) (struct sk_buff * skb, int calc_sum);
|
|
extern int (*ra_sw_nat_rtsp_data_handle) (struct sk_buff * skb, char *rb_ptr, unsigned int datalen);
|
|
extern void (*ra_sw_nat_set_wan_acntid_hook) (struct sk_buff *skb, unsigned char wan_index, unsigned char dir);
|
|
extern void (*ra_sw_nat_clear_wan_acntid_hook)(unsigned char wan_index);
|
|
extern void (*ra_sw_nat_get_wan_acntid_counter_hook)(unsigned char wan_index, struct net_device_stats *storage);
|
|
extern void (*ra_sw_nat_set_mac_hook) (struct sk_buff *skb, unsigned char *mac);
|
|
extern void (*ra_sw_nat_set_wan_meterid_hook) (struct sk_buff *skb, unsigned char wan_index);
|
|
extern int (*ra_sw_nat_rtspv6_npt_data_handle) (struct sk_buff * skb);
|
|
|
|
|
|
|
|
|
|
|
|
extern int (*ra_sw_nat_hook_tx) (struct sk_buff * skb, struct port_info * pinfo, int magic);
|
|
|
|
|
|
|
|
extern int (*ra_hit_bind_force_to_cpu) (struct sk_buff * skb);
|
|
extern int (*ra_sw_nat_hook_free) (struct sk_buff * skb);
|
|
extern int (*ra_sw_nat_hook_rxinfo) (struct sk_buff * skb, int magic, char *data, int data_length);
|
|
extern int (*ra_sw_nat_hook_txq) (struct sk_buff * skb, int txq);
|
|
extern int (*ra_sw_nat_hook_magic) (struct sk_buff * skb, int magic);
|
|
extern int (*ra_sw_nat_hook_set_magic) (struct sk_buff * skb, int magic);
|
|
extern int (*ra_sw_nat_hook_xfer) (struct sk_buff *skb, const struct sk_buff *prev_p);
|
|
extern int (*ra_sw_nat_hook_foeentry) (void * inputvalue,int operation);
|
|
extern int (*ra_sw_nat_hook_is_entry_valid) (int foe_entry_idx, int ring_idx);
|
|
extern int (*ra_sw_nat_hook_is_alive_pkt)(unsigned int crsn);
|
|
|
|
extern int (*MT7530LanPortMap2Switch_hook)(int port);
|
|
|
|
|
|
|
|
extern int (*ra_sw_nat_hook_drop_packet) (struct sk_buff * skb);
|
|
extern int (*ra_sw_nat_hook_clean_table) (void);
|
|
extern int (*ra_sw_nat_hook_clean_multicast_entry) (void);
|
|
|
|
|
|
|
|
extern void (*restore_offload_info_hook)(struct sk_buff *skb, struct port_info *pinfo, int magic);
|
|
|
|
|
|
extern int (*ra_sw_nat_hook_cpu_meter)(struct sk_buff* skb,FETxMsg_T* txMsg,struct port_info* pinfo,unsigned char dir,unsigned short mtrIndex);
|
|
extern int (*ra_sw_nat_natv6_fast_handler) (struct sk_buff * skb);
|
|
|
|
extern int (*ra_sw_nat_vxlan_fast_handler) (struct sk_buff * skb);
|
|
|
|
extern int (*ra_sw_nat_npu_offload_vxlan_enable)(void);
|
|
extern int (*ra_sw_nat_npu_store_vxlan_hdr) (struct sk_buff * skb,unsigned int type);
|
|
extern int (*ra_sw_nat_npu_check_vxlan_hdr_list_hook)(void);
|
|
|
|
extern int (*ra_sw_nat_restore_npu_pingpong_info) (struct sk_buff * skb,unsigned short cpu_info);
|
|
|
|
|
|
extern int (*ra_sw_wifi_hook_is_wifi_down) (struct sk_buff * skb, int band);
|
|
extern int (*ra_sw_wifi_hook_wifi_down_handle) (struct net_device *dev);
|
|
extern int (*ra_sw_wifi_hook_wifi_up_handle) (struct net_device *dev);
|
|
# 29 "include/linux/ecnt_skbuff.h" 2
|
|
|
|
|
|
|
|
extern void skbmgr_4k_pool_init(void);
|
|
extern void skbmgr_pool_init(void);
|
|
|
|
extern atomic_t g_used_skb_num;
|
|
extern int g_max_skb_num;
|
|
extern int peak_skb_num;
|
|
# 58 "include/linux/ecnt_skbuff.h"
|
|
extern atomic_t skbmgr_alloc_no;
|
|
extern atomic_t skbmgr_4k_alloc_no;
|
|
# 292 "include/linux/ecnt_skbuff.h"
|
|
extern int itf_start_idx;
|
|
extern int isLANInterface(struct net_device *dev);
|
|
extern int is24GWDSInterface(struct net_device *dev);
|
|
extern int is5GWDSInterface(struct net_device * dev);
|
|
extern int is24GWiFiInterface(struct net_device *dev);
|
|
extern int is5GWiFiInterface(struct net_device *dev);
|
|
extern int is24GAPCLIInterface(struct net_device *dev);
|
|
extern int is5GAPCLIInterface(struct net_device *dev);
|
|
extern int isWiFiInterface(struct net_device *dev);
|
|
extern int isUSBInterface(struct net_device *dev);
|
|
extern int isPONInterface(struct net_device *dev);
|
|
extern int isWANInterface(struct net_device *dev);
|
|
extern int isBridgeInterface(struct net_device *dev);
|
|
extern int isXSIInterface(struct net_device *dev);
|
|
extern int getLANIndex(struct net_device *dev);
|
|
extern int getLANIndexByName(char *pname);
|
|
extern char *lanNamePre(void);
|
|
extern int get24GWifiIndex(struct net_device *dev);
|
|
extern int get5GWifiIndex(struct net_device *dev);
|
|
extern int get24GWDSIndex(struct net_device *dev);
|
|
extern int get5GWDSIndex(struct net_device *dev);
|
|
extern int getUSBIndex(struct net_device *dev);
|
|
extern struct net_device *get24GWifiName(int index);
|
|
# 341 "include/linux/ecnt_skbuff.h"
|
|
struct ecnt_sk_buff {
|
|
|
|
|
|
|
|
unsigned char stag_inserted;
|
|
unsigned int foe_index;
|
|
};
|
|
typedef struct ecnt_sk_buff ecnt_sk_buff_t;
|
|
# 386 "include/linux/ecnt_skbuff.h"
|
|
typedef struct IGMP_HWNATEntry_s
|
|
{
|
|
struct list_head list;
|
|
|
|
struct callback_head rcu;
|
|
|
|
int proto;
|
|
int index;
|
|
unsigned int m_vlan;
|
|
|
|
|
|
unsigned long mask;
|
|
unsigned char wifinum;
|
|
struct net_device* orig_dev;
|
|
unsigned char grp_addr[16];
|
|
unsigned char src_addr[16];
|
|
unsigned int local;
|
|
struct timer_list age_timer;
|
|
unsigned char snoop_off;
|
|
|
|
|
|
|
|
unsigned int ext_port_num;
|
|
struct net_device* ext_port[(4)];
|
|
}IGMP_HWNATEntry_t;
|
|
|
|
typedef struct
|
|
{
|
|
struct list_head list;
|
|
int proto;
|
|
unsigned char grp_addr[16];
|
|
unsigned int ref_cnt;
|
|
}IGMP_LOCALEntry_t;
|
|
|
|
|
|
typedef struct
|
|
{
|
|
struct list_head list;
|
|
int index;
|
|
unsigned long port_mask;
|
|
}multicast_flood_hwentry_t;
|
|
# 42 "include/linux/skbuff.h" 2
|
|
# 158 "include/linux/skbuff.h"
|
|
struct net_device;
|
|
struct scatterlist;
|
|
struct pipe_inode_info;
|
|
struct iov_iter;
|
|
struct napi_struct;
|
|
|
|
|
|
struct nf_conntrack {
|
|
atomic_t use;
|
|
__u16 lVlanId;
|
|
|
|
__u16 foe_index;
|
|
};
|
|
# 203 "include/linux/skbuff.h"
|
|
struct sk_buff_head {
|
|
|
|
struct sk_buff *next;
|
|
struct sk_buff *prev;
|
|
|
|
__u32 qlen;
|
|
spinlock_t lock;
|
|
};
|
|
|
|
struct sk_buff;
|
|
# 226 "include/linux/skbuff.h"
|
|
extern int sysctl_max_skb_frags;
|
|
|
|
typedef struct skb_frag_struct skb_frag_t;
|
|
|
|
struct skb_frag_struct {
|
|
struct {
|
|
struct page *p;
|
|
} page;
|
|
|
|
|
|
|
|
|
|
__u16 page_offset;
|
|
__u16 size;
|
|
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int skb_frag_size(const skb_frag_t *frag)
|
|
{
|
|
return frag->size;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_frag_size_set(skb_frag_t *frag, unsigned int size)
|
|
{
|
|
frag->size = size;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_frag_size_add(skb_frag_t *frag, int delta)
|
|
{
|
|
frag->size += delta;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_frag_size_sub(skb_frag_t *frag, int delta)
|
|
{
|
|
frag->size -= delta;
|
|
}
|
|
# 279 "include/linux/skbuff.h"
|
|
struct skb_shared_hwtstamps {
|
|
ktime_t hwtstamp;
|
|
};
|
|
|
|
|
|
enum {
|
|
|
|
SKBTX_HW_TSTAMP = 1 << 0,
|
|
|
|
|
|
SKBTX_SW_TSTAMP = 1 << 1,
|
|
|
|
|
|
SKBTX_IN_PROGRESS = 1 << 2,
|
|
|
|
|
|
SKBTX_DEV_ZEROCOPY = 1 << 3,
|
|
|
|
|
|
SKBTX_WIFI_STATUS = 1 << 4,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SKBTX_SHARED_FRAG = 1 << 5,
|
|
|
|
|
|
SKBTX_SCHED_TSTAMP = 1 << 6,
|
|
|
|
|
|
SKBTX_ACK_TSTAMP = 1 << 7,
|
|
};
|
|
# 327 "include/linux/skbuff.h"
|
|
struct ubuf_info {
|
|
void (*callback)(struct ubuf_info *, bool zerocopy_success);
|
|
void *ctx;
|
|
unsigned long desc;
|
|
};
|
|
|
|
|
|
|
|
|
|
struct skb_shared_info {
|
|
unsigned char nr_frags;
|
|
__u8 tx_flags;
|
|
unsigned short gso_size;
|
|
|
|
unsigned short gso_segs;
|
|
unsigned short gso_type;
|
|
struct sk_buff *frag_list;
|
|
struct skb_shared_hwtstamps hwtstamps;
|
|
u32 tskey;
|
|
__be32 ip6_frag_id;
|
|
|
|
|
|
|
|
|
|
atomic_t dataref;
|
|
|
|
|
|
|
|
void * destructor_arg;
|
|
|
|
|
|
skb_frag_t frags[(65536/((1UL) << 12) + 1)];
|
|
};
|
|
# 376 "include/linux/skbuff.h"
|
|
enum {
|
|
SKB_FCLONE_UNAVAILABLE,
|
|
SKB_FCLONE_ORIG,
|
|
SKB_FCLONE_CLONE,
|
|
};
|
|
|
|
enum {
|
|
SKB_GSO_TCPV4 = 1 << 0,
|
|
SKB_GSO_UDP = 1 << 1,
|
|
|
|
|
|
SKB_GSO_DODGY = 1 << 2,
|
|
|
|
|
|
SKB_GSO_TCP_ECN = 1 << 3,
|
|
|
|
SKB_GSO_TCPV6 = 1 << 4,
|
|
|
|
SKB_GSO_FCOE = 1 << 5,
|
|
|
|
SKB_GSO_GRE = 1 << 6,
|
|
|
|
SKB_GSO_GRE_CSUM = 1 << 7,
|
|
|
|
SKB_GSO_IPIP = 1 << 8,
|
|
|
|
SKB_GSO_SIT = 1 << 9,
|
|
|
|
SKB_GSO_UDP_TUNNEL = 1 << 10,
|
|
|
|
SKB_GSO_UDP_TUNNEL_CSUM = 1 << 11,
|
|
|
|
SKB_GSO_TUNNEL_REMCSUM = 1 << 12,
|
|
};
|
|
# 418 "include/linux/skbuff.h"
|
|
typedef unsigned char *sk_buff_data_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct skb_mstamp {
|
|
union {
|
|
u64 v64;
|
|
struct {
|
|
u32 stamp_us;
|
|
u32 stamp_jiffies;
|
|
};
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_mstamp_get(struct skb_mstamp *cl)
|
|
{
|
|
u64 val = local_clock();
|
|
|
|
({ unsigned int __r, __b = (1000L); if (!__builtin_constant_p(__b) || __b == 0 || (7 < 4 && (__b & (__b - 1)) != 0)) { __r = ({ register unsigned int __base asm("r4") = __b; register unsigned long long __n asm("r0") = val; register unsigned long long __res asm("r2"); register unsigned int __rem asm("r1"); asm( ".ifnc " "%0" "," "r1" "; " ".ifnc " "%0" "r1" ",fpr11; " ".ifnc " "%0" "r1" ",r11fp; " ".ifnc " "%0" "r1" ",ipr12; " ".ifnc " "%0" "r1" ",r12ip; " ".err; " ".endif; " ".endif; " ".endif; " ".endif; " ".endif\n\t" ".ifnc " "%1" "," "r2" "; " ".ifnc " "%1" "r2" ",fpr11; " ".ifnc " "%1" "r2" ",r11fp; " ".ifnc " "%1" "r2" ",ipr12; " ".ifnc " "%1" "r2" ",r12ip; " ".err; " ".endif; " ".endif; " ".endif; " ".endif; " ".endif\n\t" ".ifnc " "%2" "," "r0" "; " ".ifnc " "%2" "r0" ",fpr11; " ".ifnc " "%2" "r0" ",r11fp; " ".ifnc " "%2" "r0" ",ipr12; " ".ifnc " "%2" "r0" ",r12ip; " ".err; " ".endif; " ".endif; " ".endif; " ".endif; " ".endif\n\t" ".ifnc " "%3" "," "r4" "; " ".ifnc " "%3" "r4" ",fpr11; " ".ifnc " "%3" "r4" ",r11fp; " ".ifnc " "%3" "r4" ",ipr12; " ".ifnc " "%3" "r4" ",r12ip; " ".err; " ".endif; " ".endif; " ".endif; " ".endif; " ".endif\n\t" "bl __do_div64" : "=r" (__rem), "=r" (__res) : "r" (__n), "r" (__base) : "ip", "lr", "cc"); val = __res; __rem; }); } else if ((__b & (__b - 1)) == 0) { __r = val; __r &= (__b - 1); val /= __b; } else { unsigned long long __res, __x, __t, __m, __n = val; unsigned int __c, __p, __z = 0; __r = __n; __p = 1 << ({ unsigned int __left = (__b), __nr = 0; if (__left & 0xffff0000) __nr += 16, __left >>= 16; if (__left & 0x0000ff00) __nr += 8, __left >>= 8; if (__left & 0x000000f0) __nr += 4, __left >>= 4; if (__left & 0x0000000c) __nr += 2, __left >>= 2; if (__left & 0x00000002) __nr += 1; __nr; }); __m = (~0ULL / __b) * __p; __m += (((~0ULL % __b + 1) * __p) + __b - 1) / __b; __x = ~0ULL / __b * __b - 1; __res = (__m & 0xffffffff) * (__x & 0xffffffff); __res >>= 32; __res += (__m & 0xffffffff) * (__x >> 32); __t = __res; __res += (__x & 0xffffffff) * (__m >> 32); __t = (__res < __t) ? (1ULL << 32) : 0; __res = (__res >> 32) + __t; __res += (__m >> 32) * (__x >> 32); __res /= __p; if (~0ULL % (__b / (__b & -__b)) == 0) { __n /= (__b & -__b); __m = ~0ULL / (__b / (__b & -__b)); __p = 1; __c = 1; } else if (__res != __x / __b) { __c = 1; __m = (~0ULL / __b) * __p; __m += ((~0ULL % __b + 1) * __p) / __b; } else { unsigned int __bits = -(__m & -__m); __bits |= __m >> 32; __bits = (~__bits) << 1; if (!__bits) { __p /= (__m & -__m); __m /= (__m & -__m); } else { __p >>= ({ unsigned int __left = (__bits), __nr = 0; if (__left & 0xffff0000) __nr += 16, __left >>= 16; if (__left & 0x0000ff00) __nr += 8, __left >>= 8; if (__left & 0x000000f0) __nr += 4, __left >>= 4; if (__left & 0x0000000c) __nr += 2, __left >>= 2; if (__left & 0x00000002) __nr += 1; __nr; }); __m >>= ({ unsigned int __left = (__bits), __nr = 0; if (__left & 0xffff0000) __nr += 16, __left >>= 16; if (__left & 0x0000ff00) __nr += 8, __left >>= 8; if (__left & 0x000000f0) __nr += 4, __left >>= 4; if (__left & 0x0000000c) __nr += 2, __left >>= 2; if (__left & 0x00000002) __nr += 1; __nr; }); } __c = 0; } if (!__c) { asm ( "umull %Q0, %R0, %Q1, %Q2\n\t" "mov %Q0, #0" : "=&r" (__res) : "r" (__m), "r" (__n) : "cc" ); } else if (!(__m & ((1ULL << 63) | (1ULL << 31)))) { __res = __m; asm ( "umlal %Q0, %R0, %Q1, %Q2\n\t" "mov %Q0, #0" : "+&r" (__res) : "r" (__m), "r" (__n) : "cc" ); } else { asm ( "umull %Q0, %R0, %Q1, %Q2\n\t" "cmn %Q0, %Q1\n\t" "adcs %R0, %R0, %R1\n\t" "adc %Q0, %3, #0" : "=&r" (__res) : "r" (__m), "r" (__n), "r" (__z) : "cc" ); } if (!(__m & ((1ULL << 63) | (1ULL << 31)))) { asm ( "umlal %R0, %Q0, %R1, %Q2\n\t" "umlal %R0, %Q0, %Q1, %R2\n\t" "mov %R0, #0\n\t" "umlal %Q0, %R0, %R1, %R2" : "+&r" (__res) : "r" (__m), "r" (__n) : "cc" ); } else { asm ( "umlal %R0, %Q0, %R2, %Q3\n\t" "umlal %R0, %1, %Q2, %R3\n\t" "mov %R0, #0\n\t" "adds %Q0, %1, %Q0\n\t" "adc %R0, %R0, #0\n\t" "umlal %Q0, %R0, %R2, %R3" : "+&r" (__res), "+&r" (__z) : "r" (__m), "r" (__n) : "cc" ); } __res /= __p; { unsigned int __res0 = __res; unsigned int __b0 = __b; __r -= __res0 * __b0; } val = __res; } __r; });
|
|
cl->stamp_us = (u32)val;
|
|
cl->stamp_jiffies = (u32)jiffies;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 skb_mstamp_us_delta(const struct skb_mstamp *t1,
|
|
const struct skb_mstamp *t0)
|
|
{
|
|
s32 delta_us = t1->stamp_us - t0->stamp_us;
|
|
u32 delta_jiffies = t1->stamp_jiffies - t0->stamp_jiffies;
|
|
|
|
|
|
|
|
|
|
if (delta_us <= 0 ||
|
|
delta_jiffies >= (((int)(~0U>>1)) / (1000000L / 100)))
|
|
|
|
delta_us = jiffies_to_usecs(delta_jiffies);
|
|
|
|
return delta_us;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_mstamp_after(const struct skb_mstamp *t1,
|
|
const struct skb_mstamp *t0)
|
|
{
|
|
s32 diff = t1->stamp_jiffies - t0->stamp_jiffies;
|
|
|
|
if (!diff)
|
|
diff = t1->stamp_us - t0->stamp_us;
|
|
return diff > 0;
|
|
}
|
|
# 550 "include/linux/skbuff.h"
|
|
struct sk_buff {
|
|
union {
|
|
struct {
|
|
|
|
struct sk_buff *next;
|
|
struct sk_buff *prev;
|
|
|
|
union {
|
|
ktime_t tstamp;
|
|
struct skb_mstamp skb_mstamp;
|
|
};
|
|
};
|
|
struct rb_node rbnode;
|
|
};
|
|
struct sock *sk;
|
|
struct net_device *dev;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char cb[48] __attribute__((aligned(8)));
|
|
|
|
unsigned long _skb_refdst;
|
|
void (*destructor)(struct sk_buff *skb);
|
|
|
|
struct sec_path *sp;
|
|
|
|
|
|
struct nf_conntrack *nfct;
|
|
|
|
|
|
|
|
|
|
unsigned int len,
|
|
data_len;
|
|
__u16 mac_len,
|
|
hdr_len;
|
|
|
|
|
|
|
|
|
|
;
|
|
__u16 queue_mapping;
|
|
__u8 cloned:1,
|
|
nohdr:1,
|
|
fclone:2,
|
|
peeked:1,
|
|
head_frag:1,
|
|
xmit_more:1;
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
__u32 headers_start[0];
|
|
# 620 "include/linux/skbuff.h"
|
|
__u8 __pkt_type_offset[0];
|
|
__u8 pkt_type:3;
|
|
__u8 pfmemalloc:1;
|
|
__u8 ignore_df:1;
|
|
__u8 nfctinfo:3;
|
|
|
|
__u8 nf_trace:1;
|
|
__u8 ip_summed:2;
|
|
__u8 ooo_okay:1;
|
|
__u8 l4_hash:1;
|
|
__u8 sw_hash:1;
|
|
__u8 wifi_acked_valid:1;
|
|
__u8 wifi_acked:1;
|
|
|
|
__u8 no_fcs:1;
|
|
|
|
__u8 encapsulation:1;
|
|
__u8 encap_hdr_csum:1;
|
|
__u8 csum_valid:1;
|
|
__u8 csum_complete_sw:1;
|
|
__u8 csum_level:2;
|
|
__u8 csum_bad:1;
|
|
|
|
|
|
__u8 ndisc_nodetype:2;
|
|
|
|
__u8 ipvs_property:1;
|
|
__u8 inner_protocol_type:1;
|
|
__u8 remcsum_offload:1;
|
|
# 658 "include/linux/skbuff.h"
|
|
union {
|
|
__wsum csum;
|
|
struct {
|
|
__u16 csum_start;
|
|
__u16 csum_offset;
|
|
};
|
|
};
|
|
__u32 priority;
|
|
int skb_iif;
|
|
__u32 hash;
|
|
__be16 vlan_proto;
|
|
__u16 vlan_tci;
|
|
|
|
union {
|
|
unsigned int napi_id;
|
|
unsigned int sender_cpu;
|
|
};
|
|
|
|
union {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
__u32 mark;
|
|
__u32 dropcount;
|
|
__u32 reserved_tailroom;
|
|
|
|
__u32 fe_resource_mark;
|
|
|
|
union {
|
|
__be16 inner_protocol;
|
|
__u8 inner_ipproto;
|
|
};
|
|
|
|
__u16 inner_transport_header;
|
|
__u16 inner_network_header;
|
|
__u16 inner_mac_header;
|
|
|
|
__be16 protocol;
|
|
__u16 transport_header;
|
|
__u16 network_header;
|
|
__u16 mac_header;
|
|
|
|
|
|
__u32 headers_end[0];
|
|
|
|
|
|
int (*skb_recycling_callback)(struct sk_buff *skb);
|
|
int skb_recycling_ind;
|
|
|
|
|
|
char foe[8];
|
|
__u8 smac[6];
|
|
|
|
|
|
|
|
__u8 bridge_flag;
|
|
u32 adapterAddr;
|
|
__u8 ipsec_pt_flag;
|
|
union{
|
|
struct{
|
|
__u16 gem_type ;
|
|
__u16 gem_port ;
|
|
};
|
|
|
|
struct{
|
|
__u8 epon_queue ;
|
|
__u8 epon_pbit ;
|
|
__u16 epon_reserved ;
|
|
};
|
|
|
|
__u32 xpon_raw_info ;
|
|
};
|
|
__u32 pon_mark ;
|
|
__u8 v_if ;
|
|
__u32 pon_vlan_flag;
|
|
struct net_device * original_dev;
|
|
|
|
__u32 pon_mac_filter_flag;
|
|
|
|
|
|
__u16 vlan_tags[2];
|
|
|
|
__u32 vlan_tag_flag;
|
|
__u16 pon_vlan_tpid[4];
|
|
__u16 pon_vlan_tci[4];
|
|
__u8 pon_tag_num;
|
|
|
|
__u32 xpon_igmp_flag;
|
|
|
|
|
|
struct net_device *wan_dev;
|
|
|
|
struct net_device *orig_dev;
|
|
|
|
|
|
__u32 portbind_mark;
|
|
# 773 "include/linux/skbuff.h"
|
|
__u8 ppe_info_flag;
|
|
__u16 ppe_magic;
|
|
__u8 ppe_ai;
|
|
__u16 ppe_foe_entry;
|
|
|
|
|
|
|
|
__u16 lan_vlan_tci;
|
|
__u8 lan_vlan_tci_valid;
|
|
|
|
|
|
|
|
__u16 dlf_resv0;
|
|
__u32 dlf_resv1;
|
|
__u8 dlf_resv2;
|
|
|
|
__u8 is_unknown_mul;
|
|
|
|
|
|
|
|
|
|
__u8 macEnque;
|
|
|
|
|
|
int hash_index;
|
|
__u8 sw_nat_flag;
|
|
__u8 foe_tbl_index;
|
|
__u8 igmp_leave_drop_flag;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__u8 tso_mark;
|
|
|
|
__u8 shortcut_on_speed;
|
|
|
|
|
|
|
|
|
|
__u32 mark2;
|
|
ecnt_sk_buff_t ecnt_sk_buff;
|
|
|
|
|
|
void * pAd;
|
|
__u8 rxBlk[150];
|
|
|
|
|
|
__u32 ecnt_asym_mark;
|
|
|
|
sk_buff_data_t tail;
|
|
sk_buff_data_t end;
|
|
unsigned char *head,
|
|
*data;
|
|
unsigned int truesize;
|
|
atomic_t users;
|
|
};
|
|
# 844 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_pfmemalloc(const struct sk_buff *skb)
|
|
{
|
|
return __builtin_expect(!!(skb->pfmemalloc), 0);
|
|
}
|
|
# 862 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dst_entry *skb_dst(const struct sk_buff *skb)
|
|
{
|
|
|
|
|
|
|
|
({ int __ret_warn_on = !!((skb->_skb_refdst & 1UL) && !rcu_read_lock_held() && !rcu_read_lock_bh_held()); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null(
|
|
|
|
"include/linux/skbuff.h"
|
|
# 867 "include/linux/skbuff.h"
|
|
,
|
|
|
|
869
|
|
# 867 "include/linux/skbuff.h"
|
|
); __builtin_expect(!!(__ret_warn_on), 0); })
|
|
|
|
;
|
|
return (struct dst_entry *)(skb->_skb_refdst & ~(1UL));
|
|
}
|
|
# 881 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
|
|
{
|
|
skb->_skb_refdst = (unsigned long)dst;
|
|
}
|
|
# 896 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_dst_set_noref(struct sk_buff *skb, struct dst_entry *dst)
|
|
{
|
|
({ int __ret_warn_on = !!(!rcu_read_lock_held() && !rcu_read_lock_bh_held()); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/skbuff.h", 898); __builtin_expect(!!(__ret_warn_on), 0); });
|
|
skb->_skb_refdst = (unsigned long)dst | 1UL;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_dst_is_noref(const struct sk_buff *skb)
|
|
{
|
|
return (skb->_skb_refdst & 1UL) && skb_dst(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct rtable *skb_rtable(const struct sk_buff *skb)
|
|
{
|
|
return (struct rtable *)skb_dst(skb);
|
|
}
|
|
|
|
void kfree_skb(struct sk_buff *skb);
|
|
void kfree_skb_list(struct sk_buff *segs);
|
|
void skb_tx_error(struct sk_buff *skb);
|
|
void consume_skb(struct sk_buff *skb);
|
|
void __kfree_skb(struct sk_buff *skb);
|
|
extern struct kmem_cache *skbuff_head_cache;
|
|
|
|
void kfree_skb_partial(struct sk_buff *skb, bool head_stolen);
|
|
bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from,
|
|
bool *fragstolen, int *delta_truesize);
|
|
|
|
struct sk_buff *__alloc_skb(unsigned int size, gfp_t priority, int flags,
|
|
int node);
|
|
struct sk_buff *__build_skb(void *data, unsigned int frag_size);
|
|
struct sk_buff *build_skb(void *data, unsigned int frag_size);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *alloc_skb(unsigned int size,
|
|
gfp_t priority)
|
|
{
|
|
return __alloc_skb(size, priority, 0, (-1));
|
|
}
|
|
|
|
struct sk_buff *alloc_skb_with_frags(unsigned long header_len,
|
|
unsigned long data_len,
|
|
int max_page_order,
|
|
int *errcode,
|
|
gfp_t gfp_mask);
|
|
|
|
|
|
struct sk_buff_fclones {
|
|
struct sk_buff skb1;
|
|
|
|
struct sk_buff skb2;
|
|
|
|
atomic_t fclone_ref;
|
|
};
|
|
# 960 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_fclone_busy(const struct sock *sk,
|
|
const struct sk_buff *skb)
|
|
{
|
|
const struct sk_buff_fclones *fclones;
|
|
|
|
fclones = ({ const typeof( ((struct sk_buff_fclones *)0)->skb1 ) *__mptr = (skb); (struct sk_buff_fclones *)( (char *)__mptr - __builtin_offsetof(struct sk_buff_fclones, skb1) );});
|
|
|
|
return skb->fclone == SKB_FCLONE_ORIG &&
|
|
({ union { typeof((&fclones->fclone_ref)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&fclones->fclone_ref)->counter), __u.__c, sizeof((&fclones->fclone_ref)->counter)); else __read_once_size_nocheck(&((&fclones->fclone_ref)->counter), __u.__c, sizeof((&fclones->fclone_ref)->counter)); __u.__val; }) > 1 &&
|
|
fclones->skb2.sk == sk;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *alloc_skb_fclone(unsigned int size,
|
|
gfp_t priority)
|
|
{
|
|
return __alloc_skb(size, priority, 0x01, (-1));
|
|
}
|
|
|
|
struct sk_buff *__alloc_skb_head(gfp_t priority, int node);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *alloc_skb_head(gfp_t priority)
|
|
{
|
|
return __alloc_skb_head(priority, -1);
|
|
}
|
|
|
|
struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src);
|
|
int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask);
|
|
struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t priority);
|
|
struct sk_buff *skb_copy(const struct sk_buff *skb, gfp_t priority);
|
|
struct sk_buff *__pskb_copy_fclone(struct sk_buff *skb, int headroom,
|
|
gfp_t gfp_mask, bool fclone);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *__pskb_copy(struct sk_buff *skb, int headroom,
|
|
gfp_t gfp_mask)
|
|
{
|
|
return __pskb_copy_fclone(skb, headroom, gfp_mask, false);
|
|
}
|
|
|
|
int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail, gfp_t gfp_mask);
|
|
struct sk_buff *skb_realloc_headroom(struct sk_buff *skb,
|
|
unsigned int headroom);
|
|
struct sk_buff *skb_copy_expand(const struct sk_buff *skb, int newheadroom,
|
|
int newtailroom, gfp_t priority);
|
|
int skb_to_sgvec_nomark(struct sk_buff *skb, struct scatterlist *sg,
|
|
int offset, int len);
|
|
int skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset,
|
|
int len);
|
|
int skb_cow_data(struct sk_buff *skb, int tailbits, struct sk_buff **trailer);
|
|
int skb_pad(struct sk_buff *skb, int pad);
|
|
|
|
|
|
int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,
|
|
int getfrag(void *from, char *to, int offset,
|
|
int len, int odd, struct sk_buff *skb),
|
|
void *from, int length);
|
|
|
|
int skb_append_pagefrags(struct sk_buff *skb, struct page *page,
|
|
int offset, size_t size);
|
|
|
|
struct skb_seq_state {
|
|
__u32 lower_offset;
|
|
__u32 upper_offset;
|
|
__u32 frag_idx;
|
|
__u32 stepped_offset;
|
|
struct sk_buff *root_skb;
|
|
struct sk_buff *cur_skb;
|
|
__u8 *frag_data;
|
|
};
|
|
|
|
void skb_prepare_seq_read(struct sk_buff *skb, unsigned int from,
|
|
unsigned int to, struct skb_seq_state *st);
|
|
unsigned int skb_seq_read(unsigned int consumed, const u8 **data,
|
|
struct skb_seq_state *st);
|
|
void skb_abort_seq_read(struct skb_seq_state *st);
|
|
|
|
unsigned int skb_find_text(struct sk_buff *skb, unsigned int from,
|
|
unsigned int to, struct ts_config *config);
|
|
# 1062 "include/linux/skbuff.h"
|
|
enum pkt_hash_types {
|
|
PKT_HASH_TYPE_NONE,
|
|
PKT_HASH_TYPE_L2,
|
|
PKT_HASH_TYPE_L3,
|
|
PKT_HASH_TYPE_L4,
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_clear_hash(struct sk_buff *skb)
|
|
{
|
|
skb->hash = 0;
|
|
skb->sw_hash = 0;
|
|
skb->l4_hash = 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_clear_hash_if_not_l4(struct sk_buff *skb)
|
|
{
|
|
if (!skb->l4_hash)
|
|
skb_clear_hash(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
__skb_set_hash(struct sk_buff *skb, __u32 hash, bool is_sw, bool is_l4)
|
|
{
|
|
skb->l4_hash = is_l4;
|
|
skb->sw_hash = is_sw;
|
|
skb->hash = hash;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
skb_set_hash(struct sk_buff *skb, __u32 hash, enum pkt_hash_types type)
|
|
{
|
|
|
|
__skb_set_hash(skb, hash, false, type == PKT_HASH_TYPE_L4);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
__skb_set_sw_hash(struct sk_buff *skb, __u32 hash, bool is_l4)
|
|
{
|
|
__skb_set_hash(skb, hash, true, is_l4);
|
|
}
|
|
|
|
void __skb_get_hash(struct sk_buff *skb);
|
|
u32 __skb_get_hash_symmetric(struct sk_buff *skb);
|
|
u32 skb_get_poff(const struct sk_buff *skb);
|
|
u32 __skb_get_poff(const struct sk_buff *skb, void *data,
|
|
const struct flow_keys *keys, int hlen);
|
|
__be32 __skb_flow_get_ports(const struct sk_buff *skb, int thoff, u8 ip_proto,
|
|
void *data, int hlen_proto);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __be32 skb_flow_get_ports(const struct sk_buff *skb,
|
|
int thoff, u8 ip_proto)
|
|
{
|
|
return __skb_flow_get_ports(skb, thoff, ip_proto, ((void *)0), 0);
|
|
}
|
|
|
|
void skb_flow_dissector_init(struct flow_dissector *flow_dissector,
|
|
const struct flow_dissector_key *key,
|
|
unsigned int key_count);
|
|
|
|
bool __skb_flow_dissect(const struct sk_buff *skb,
|
|
struct flow_dissector *flow_dissector,
|
|
void *target_container,
|
|
void *data, __be16 proto, int nhoff, int hlen,
|
|
unsigned int flags);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_flow_dissect(const struct sk_buff *skb,
|
|
struct flow_dissector *flow_dissector,
|
|
void *target_container, unsigned int flags)
|
|
{
|
|
return __skb_flow_dissect(skb, flow_dissector, target_container,
|
|
((void *)0), 0, 0, 0, flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_flow_dissect_flow_keys(const struct sk_buff *skb,
|
|
struct flow_keys *flow,
|
|
unsigned int flags)
|
|
{
|
|
({ void *__p = (flow); size_t __n = sizeof(*flow); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); });
|
|
return __skb_flow_dissect(skb, &flow_keys_dissector, flow,
|
|
((void *)0), 0, 0, 0, flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_flow_dissect_flow_keys_buf(struct flow_keys *flow,
|
|
void *data, __be16 proto,
|
|
int nhoff, int hlen,
|
|
unsigned int flags)
|
|
{
|
|
({ void *__p = (flow); size_t __n = sizeof(*flow); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); });
|
|
return __skb_flow_dissect(((void *)0), &flow_keys_buf_dissector, flow,
|
|
data, proto, nhoff, hlen, flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 skb_get_hash(struct sk_buff *skb)
|
|
{
|
|
if (!skb->l4_hash && !skb->sw_hash)
|
|
__skb_get_hash(skb);
|
|
|
|
return skb->hash;
|
|
}
|
|
|
|
__u32 __skb_get_hash_flowi6(struct sk_buff *skb, const struct flowi6 *fl6);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 skb_get_hash_flowi6(struct sk_buff *skb, const struct flowi6 *fl6)
|
|
{
|
|
if (!skb->l4_hash && !skb->sw_hash) {
|
|
struct flow_keys keys;
|
|
__u32 hash = __get_hash_from_flowi6(fl6, &keys);
|
|
|
|
__skb_set_sw_hash(skb, hash, flow_keys_have_l4(&keys));
|
|
}
|
|
|
|
return skb->hash;
|
|
}
|
|
|
|
__u32 __skb_get_hash_flowi4(struct sk_buff *skb, const struct flowi4 *fl);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 skb_get_hash_flowi4(struct sk_buff *skb, const struct flowi4 *fl4)
|
|
{
|
|
if (!skb->l4_hash && !skb->sw_hash) {
|
|
struct flow_keys keys;
|
|
__u32 hash = __get_hash_from_flowi4(fl4, &keys);
|
|
|
|
__skb_set_sw_hash(skb, hash, flow_keys_have_l4(&keys));
|
|
}
|
|
|
|
return skb->hash;
|
|
}
|
|
|
|
__u32 skb_get_hash_perturb(const struct sk_buff *skb, u32 perturb);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 skb_get_hash_raw(const struct sk_buff *skb)
|
|
{
|
|
return skb->hash;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_copy_hash(struct sk_buff *to, const struct sk_buff *from)
|
|
{
|
|
to->hash = from->hash;
|
|
to->sw_hash = from->sw_hash;
|
|
to->l4_hash = from->l4_hash;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_sender_cpu_clear(struct sk_buff *skb)
|
|
{
|
|
}
|
|
# 1219 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned char *skb_end_pointer(const struct sk_buff *skb)
|
|
{
|
|
return skb->end;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int skb_end_offset(const struct sk_buff *skb)
|
|
{
|
|
return skb->end - skb->head;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct skb_shared_hwtstamps *skb_hwtstamps(struct sk_buff *skb)
|
|
{
|
|
return &((struct skb_shared_info *)(skb_end_pointer(skb)))->hwtstamps;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_queue_empty(const struct sk_buff_head *list)
|
|
{
|
|
return list->next == (const struct sk_buff *) list;
|
|
}
|
|
# 1256 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_queue_is_last(const struct sk_buff_head *list,
|
|
const struct sk_buff *skb)
|
|
{
|
|
return skb->next == (const struct sk_buff *) list;
|
|
}
|
|
# 1269 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_queue_is_first(const struct sk_buff_head *list,
|
|
const struct sk_buff *skb)
|
|
{
|
|
return skb->prev == (const struct sk_buff *) list;
|
|
}
|
|
# 1283 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *skb_queue_next(const struct sk_buff_head *list,
|
|
const struct sk_buff *skb)
|
|
{
|
|
|
|
|
|
|
|
do { if (__builtin_expect(!!(skb_queue_is_last(list, skb)), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/skbuff.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "1289" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
return skb->next;
|
|
}
|
|
# 1301 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *skb_queue_prev(const struct sk_buff_head *list,
|
|
const struct sk_buff *skb)
|
|
{
|
|
|
|
|
|
|
|
do { if (__builtin_expect(!!(skb_queue_is_first(list, skb)), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/skbuff.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "1307" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
return skb->prev;
|
|
}
|
|
# 1318 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *skb_get(struct sk_buff *skb)
|
|
{
|
|
atomic_add(1, &skb->users);
|
|
return skb;
|
|
}
|
|
# 1337 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_cloned(const struct sk_buff *skb)
|
|
{
|
|
return skb->cloned &&
|
|
(({ union { typeof((&((struct skb_shared_info *)(skb_end_pointer(skb)))->dataref)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&((struct skb_shared_info *)(skb_end_pointer(skb)))->dataref)->counter), __u.__c, sizeof((&((struct skb_shared_info *)(skb_end_pointer(skb)))->dataref)->counter)); else __read_once_size_nocheck(&((&((struct skb_shared_info *)(skb_end_pointer(skb)))->dataref)->counter), __u.__c, sizeof((&((struct skb_shared_info *)(skb_end_pointer(skb)))->dataref)->counter)); __u.__val; }) & ((1 << 16) - 1)) != 1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_unclone(struct sk_buff *skb, gfp_t pri)
|
|
{
|
|
do { if (gfpflags_allow_blocking(pri)) do { do { } while (0); } while (0); } while (0);
|
|
|
|
if (skb_cloned(skb))
|
|
return pskb_expand_head(skb, 0, 0, pri);
|
|
|
|
return 0;
|
|
}
|
|
# 1360 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_header_cloned(const struct sk_buff *skb)
|
|
{
|
|
int dataref;
|
|
|
|
if (!skb->cloned)
|
|
return 0;
|
|
|
|
dataref = ({ union { typeof((&((struct skb_shared_info *)(skb_end_pointer(skb)))->dataref)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&((struct skb_shared_info *)(skb_end_pointer(skb)))->dataref)->counter), __u.__c, sizeof((&((struct skb_shared_info *)(skb_end_pointer(skb)))->dataref)->counter)); else __read_once_size_nocheck(&((&((struct skb_shared_info *)(skb_end_pointer(skb)))->dataref)->counter), __u.__c, sizeof((&((struct skb_shared_info *)(skb_end_pointer(skb)))->dataref)->counter)); __u.__val; });
|
|
dataref = (dataref & ((1 << 16) - 1)) - (dataref >> 16);
|
|
return dataref != 1;
|
|
}
|
|
# 1381 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_header_release(struct sk_buff *skb)
|
|
{
|
|
do { if (__builtin_expect(!!(skb->nohdr), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/skbuff.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "1383" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
skb->nohdr = 1;
|
|
atomic_add(1 << 16, &((struct skb_shared_info *)(skb_end_pointer(skb)))->dataref);
|
|
}
|
|
# 1395 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_header_release(struct sk_buff *skb)
|
|
{
|
|
skb->nohdr = 1;
|
|
({ union { typeof(((&((struct skb_shared_info *)(skb_end_pointer(skb)))->dataref)->counter)) __val; char __c[1]; } __u = { .__val = ( typeof(((&((struct skb_shared_info *)(skb_end_pointer(skb)))->dataref)->counter))) ((1 + (1 << 16))) }; __write_once_size(&(((&((struct skb_shared_info *)(skb_end_pointer(skb)))->dataref)->counter)), __u.__c, sizeof(((&((struct skb_shared_info *)(skb_end_pointer(skb)))->dataref)->counter))); __u.__val; });
|
|
}
|
|
# 1409 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_shared(const struct sk_buff *skb)
|
|
{
|
|
return ({ union { typeof((&skb->users)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&skb->users)->counter), __u.__c, sizeof((&skb->users)->counter)); else __read_once_size_nocheck(&((&skb->users)->counter), __u.__c, sizeof((&skb->users)->counter)); __u.__val; }) != 1;
|
|
}
|
|
# 1427 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *skb_share_check(struct sk_buff *skb, gfp_t pri)
|
|
{
|
|
do { if (gfpflags_allow_blocking(pri)) do { do { } while (0); } while (0); } while (0);
|
|
if (skb_shared(skb)) {
|
|
struct sk_buff *nskb = skb_clone(skb, pri);
|
|
|
|
if (__builtin_expect(!!(nskb), 1))
|
|
consume_skb(skb);
|
|
else
|
|
kfree_skb(skb);
|
|
skb = nskb;
|
|
}
|
|
return skb;
|
|
}
|
|
# 1462 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *skb_unshare(struct sk_buff *skb,
|
|
gfp_t pri)
|
|
{
|
|
do { if (gfpflags_allow_blocking(pri)) do { do { } while (0); } while (0); } while (0);
|
|
if (skb_cloned(skb)) {
|
|
struct sk_buff *nskb = skb_copy(skb, pri);
|
|
|
|
|
|
if (__builtin_expect(!!(nskb), 1))
|
|
consume_skb(skb);
|
|
else
|
|
kfree_skb(skb);
|
|
skb = nskb;
|
|
}
|
|
return skb;
|
|
}
|
|
# 1492 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *skb_peek(const struct sk_buff_head *list_)
|
|
{
|
|
struct sk_buff *skb = list_->next;
|
|
|
|
if (skb == (struct sk_buff *)list_)
|
|
skb = ((void *)0);
|
|
return skb;
|
|
}
|
|
# 1510 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *skb_peek_next(struct sk_buff *skb,
|
|
const struct sk_buff_head *list_)
|
|
{
|
|
struct sk_buff *next = skb->next;
|
|
|
|
if (next == (struct sk_buff *)list_)
|
|
next = ((void *)0);
|
|
return next;
|
|
}
|
|
# 1533 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *skb_peek_tail(const struct sk_buff_head *list_)
|
|
{
|
|
struct sk_buff *skb = list_->prev;
|
|
|
|
if (skb == (struct sk_buff *)list_)
|
|
skb = ((void *)0);
|
|
return skb;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 skb_queue_len(const struct sk_buff_head *list_)
|
|
{
|
|
return list_->qlen;
|
|
}
|
|
# 1564 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_queue_head_init(struct sk_buff_head *list)
|
|
{
|
|
list->prev = list->next = (struct sk_buff *)list;
|
|
list->qlen = 0;
|
|
}
|
|
# 1578 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_queue_head_init(struct sk_buff_head *list)
|
|
{
|
|
do { spinlock_check(&list->lock); do { *(&(&list->lock)->rlock) = (raw_spinlock_t) { .raw_lock = { { 0 } }, }; } while (0); } while (0);
|
|
__skb_queue_head_init(list);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_queue_head_init_class(struct sk_buff_head *list,
|
|
struct lock_class_key *class)
|
|
{
|
|
skb_queue_head_init(list);
|
|
do { (void)(class); } while (0);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void skb_insert(struct sk_buff *old, struct sk_buff *newsk,
|
|
struct sk_buff_head *list);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_insert(struct sk_buff *newsk,
|
|
struct sk_buff *prev, struct sk_buff *next,
|
|
struct sk_buff_head *list)
|
|
{
|
|
newsk->next = next;
|
|
newsk->prev = prev;
|
|
next->prev = prev->next = newsk;
|
|
list->qlen++;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_queue_splice(const struct sk_buff_head *list,
|
|
struct sk_buff *prev,
|
|
struct sk_buff *next)
|
|
{
|
|
struct sk_buff *first = list->next;
|
|
struct sk_buff *last = list->prev;
|
|
|
|
first->prev = prev;
|
|
prev->next = first;
|
|
|
|
last->next = next;
|
|
next->prev = last;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_queue_splice(const struct sk_buff_head *list,
|
|
struct sk_buff_head *head)
|
|
{
|
|
if (!skb_queue_empty(list)) {
|
|
__skb_queue_splice(list, (struct sk_buff *) head, head->next);
|
|
head->qlen += list->qlen;
|
|
}
|
|
}
|
|
# 1644 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_queue_splice_init(struct sk_buff_head *list,
|
|
struct sk_buff_head *head)
|
|
{
|
|
if (!skb_queue_empty(list)) {
|
|
__skb_queue_splice(list, (struct sk_buff *) head, head->next);
|
|
head->qlen += list->qlen;
|
|
__skb_queue_head_init(list);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_queue_splice_tail(const struct sk_buff_head *list,
|
|
struct sk_buff_head *head)
|
|
{
|
|
if (!skb_queue_empty(list)) {
|
|
__skb_queue_splice(list, head->prev, (struct sk_buff *) head);
|
|
head->qlen += list->qlen;
|
|
}
|
|
}
|
|
# 1676 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_queue_splice_tail_init(struct sk_buff_head *list,
|
|
struct sk_buff_head *head)
|
|
{
|
|
if (!skb_queue_empty(list)) {
|
|
__skb_queue_splice(list, head->prev, (struct sk_buff *) head);
|
|
head->qlen += list->qlen;
|
|
__skb_queue_head_init(list);
|
|
}
|
|
}
|
|
# 1697 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_queue_after(struct sk_buff_head *list,
|
|
struct sk_buff *prev,
|
|
struct sk_buff *newsk)
|
|
{
|
|
__skb_insert(newsk, prev, prev->next, list);
|
|
}
|
|
|
|
void skb_append(struct sk_buff *old, struct sk_buff *newsk,
|
|
struct sk_buff_head *list);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_queue_before(struct sk_buff_head *list,
|
|
struct sk_buff *next,
|
|
struct sk_buff *newsk)
|
|
{
|
|
__skb_insert(newsk, next->prev, next, list);
|
|
}
|
|
# 1724 "include/linux/skbuff.h"
|
|
void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_queue_head(struct sk_buff_head *list,
|
|
struct sk_buff *newsk)
|
|
{
|
|
__skb_queue_after(list, (struct sk_buff *)list, newsk);
|
|
}
|
|
# 1741 "include/linux/skbuff.h"
|
|
void skb_queue_tail(struct sk_buff_head *list, struct sk_buff *newsk);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_queue_tail(struct sk_buff_head *list,
|
|
struct sk_buff *newsk)
|
|
{
|
|
__skb_queue_before(list, (struct sk_buff *)list, newsk);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void skb_unlink(struct sk_buff *skb, struct sk_buff_head *list);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *list)
|
|
{
|
|
struct sk_buff *next, *prev;
|
|
|
|
list->qlen--;
|
|
next = skb->next;
|
|
prev = skb->prev;
|
|
skb->next = skb->prev = ((void *)0);
|
|
next->prev = prev;
|
|
prev->next = next;
|
|
}
|
|
# 1773 "include/linux/skbuff.h"
|
|
struct sk_buff *skb_dequeue(struct sk_buff_head *list);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *__skb_dequeue(struct sk_buff_head *list)
|
|
{
|
|
struct sk_buff *skb = skb_peek(list);
|
|
if (skb)
|
|
__skb_unlink(skb, list);
|
|
return skb;
|
|
}
|
|
# 1790 "include/linux/skbuff.h"
|
|
struct sk_buff *skb_dequeue_tail(struct sk_buff_head *list);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *__skb_dequeue_tail(struct sk_buff_head *list)
|
|
{
|
|
struct sk_buff *skb = skb_peek_tail(list);
|
|
if (skb)
|
|
__skb_unlink(skb, list);
|
|
return skb;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_is_nonlinear(const struct sk_buff *skb)
|
|
{
|
|
return skb->data_len;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int skb_headlen(const struct sk_buff *skb)
|
|
{
|
|
return skb->len - skb->data_len;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_pagelen(const struct sk_buff *skb)
|
|
{
|
|
int i, len = 0;
|
|
|
|
for (i = (int)((struct skb_shared_info *)(skb_end_pointer(skb)))->nr_frags - 1; i >= 0; i--)
|
|
len += skb_frag_size(&((struct skb_shared_info *)(skb_end_pointer(skb)))->frags[i]);
|
|
return len + skb_headlen(skb);
|
|
}
|
|
# 1832 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_fill_page_desc(struct sk_buff *skb, int i,
|
|
struct page *page, int off, int size)
|
|
{
|
|
skb_frag_t *frag = &((struct skb_shared_info *)(skb_end_pointer(skb)))->frags[i];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
frag->page.p = page;
|
|
frag->page_offset = off;
|
|
skb_frag_size_set(frag, size);
|
|
|
|
page = compound_head(page);
|
|
if (page_is_pfmemalloc(page))
|
|
skb->pfmemalloc = true;
|
|
}
|
|
# 1865 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_fill_page_desc(struct sk_buff *skb, int i,
|
|
struct page *page, int off, int size)
|
|
{
|
|
__skb_fill_page_desc(skb, i, page, off, size);
|
|
((struct skb_shared_info *)(skb_end_pointer(skb)))->nr_frags = i + 1;
|
|
}
|
|
|
|
void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, int off,
|
|
int size, unsigned int truesize);
|
|
|
|
void skb_coalesce_rx_frag(struct sk_buff *skb, int i, int size,
|
|
unsigned int truesize);
|
|
# 1900 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned char *skb_tail_pointer(const struct sk_buff *skb)
|
|
{
|
|
return skb->tail;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_reset_tail_pointer(struct sk_buff *skb)
|
|
{
|
|
skb->tail = skb->data;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_set_tail_pointer(struct sk_buff *skb, const int offset)
|
|
{
|
|
skb->tail = skb->data + offset;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned char *pskb_put(struct sk_buff *skb, struct sk_buff *tail, int len);
|
|
unsigned char *skb_put(struct sk_buff *skb, unsigned int len);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned char *__skb_put(struct sk_buff *skb, unsigned int len)
|
|
{
|
|
unsigned char *tmp = skb_tail_pointer(skb);
|
|
do { if (__builtin_expect(!!(skb_is_nonlinear(skb)), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/skbuff.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "1925" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
skb->tail += len;
|
|
skb->len += len;
|
|
return tmp;
|
|
}
|
|
|
|
unsigned char *skb_push(struct sk_buff *skb, unsigned int len);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned char *__skb_push(struct sk_buff *skb, unsigned int len)
|
|
{
|
|
skb->data -= len;
|
|
skb->len += len;
|
|
return skb->data;
|
|
}
|
|
|
|
unsigned char *skb_pull(struct sk_buff *skb, unsigned int len);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned char *__skb_pull(struct sk_buff *skb, unsigned int len)
|
|
{
|
|
skb->len -= len;
|
|
do { if (__builtin_expect(!!(skb->len < skb->data_len), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/skbuff.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "1943" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
return skb->data += len;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned char *skb_pull_inline(struct sk_buff *skb, unsigned int len)
|
|
{
|
|
return __builtin_expect(!!(len > skb->len), 0) ? ((void *)0) : __skb_pull(skb, len);
|
|
}
|
|
|
|
unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned char *__pskb_pull(struct sk_buff *skb, unsigned int len)
|
|
{
|
|
if (len > skb_headlen(skb) &&
|
|
!__pskb_pull_tail(skb, len - skb_headlen(skb)))
|
|
return ((void *)0);
|
|
skb->len -= len;
|
|
return skb->data += len;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned char *pskb_pull(struct sk_buff *skb, unsigned int len)
|
|
{
|
|
return __builtin_expect(!!(len > skb->len), 0) ? ((void *)0) : __pskb_pull(skb, len);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pskb_may_pull(struct sk_buff *skb, unsigned int len)
|
|
{
|
|
if (__builtin_expect(!!(len <= skb_headlen(skb)), 1))
|
|
return 1;
|
|
if (__builtin_expect(!!(len > skb->len), 0))
|
|
return 0;
|
|
return __pskb_pull_tail(skb, len - skb_headlen(skb)) != ((void *)0);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int skb_headroom(const struct sk_buff *skb)
|
|
{
|
|
return skb->data - skb->head;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_tailroom(const struct sk_buff *skb)
|
|
{
|
|
return skb_is_nonlinear(skb) ? 0 : skb->end - skb->tail;
|
|
}
|
|
# 2006 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_availroom(const struct sk_buff *skb)
|
|
{
|
|
if (skb_is_nonlinear(skb))
|
|
return 0;
|
|
|
|
return skb->end - skb->tail - skb->reserved_tailroom;
|
|
}
|
|
# 2022 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_reserve(struct sk_buff *skb, int len)
|
|
{
|
|
skb->data += len;
|
|
skb->tail += len;
|
|
}
|
|
# 2040 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_tailroom_reserve(struct sk_buff *skb, unsigned int mtu,
|
|
unsigned int needed_tailroom)
|
|
{
|
|
do { if (__builtin_expect(!!(skb_is_nonlinear(skb)), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/skbuff.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "2043" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
if (mtu < skb_tailroom(skb) - needed_tailroom)
|
|
|
|
skb->reserved_tailroom = skb_tailroom(skb) - mtu;
|
|
else
|
|
|
|
skb->reserved_tailroom = needed_tailroom;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_set_inner_protocol(struct sk_buff *skb,
|
|
__be16 protocol)
|
|
{
|
|
skb->inner_protocol = protocol;
|
|
skb->inner_protocol_type = 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_set_inner_ipproto(struct sk_buff *skb,
|
|
__u8 ipproto)
|
|
{
|
|
skb->inner_ipproto = ipproto;
|
|
skb->inner_protocol_type = 1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_reset_inner_headers(struct sk_buff *skb)
|
|
{
|
|
skb->inner_mac_header = skb->mac_header;
|
|
skb->inner_network_header = skb->network_header;
|
|
skb->inner_transport_header = skb->transport_header;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_reset_mac_len(struct sk_buff *skb)
|
|
{
|
|
skb->mac_len = skb->network_header - skb->mac_header;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned char *skb_inner_transport_header(const struct sk_buff
|
|
*skb)
|
|
{
|
|
return skb->head + skb->inner_transport_header;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_reset_inner_transport_header(struct sk_buff *skb)
|
|
{
|
|
skb->inner_transport_header = skb->data - skb->head;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_set_inner_transport_header(struct sk_buff *skb,
|
|
const int offset)
|
|
{
|
|
skb_reset_inner_transport_header(skb);
|
|
skb->inner_transport_header += offset;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned char *skb_inner_network_header(const struct sk_buff *skb)
|
|
{
|
|
return skb->head + skb->inner_network_header;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_reset_inner_network_header(struct sk_buff *skb)
|
|
{
|
|
skb->inner_network_header = skb->data - skb->head;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_set_inner_network_header(struct sk_buff *skb,
|
|
const int offset)
|
|
{
|
|
skb_reset_inner_network_header(skb);
|
|
skb->inner_network_header += offset;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned char *skb_inner_mac_header(const struct sk_buff *skb)
|
|
{
|
|
return skb->head + skb->inner_mac_header;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_reset_inner_mac_header(struct sk_buff *skb)
|
|
{
|
|
skb->inner_mac_header = skb->data - skb->head;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_set_inner_mac_header(struct sk_buff *skb,
|
|
const int offset)
|
|
{
|
|
skb_reset_inner_mac_header(skb);
|
|
skb->inner_mac_header += offset;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_transport_header_was_set(const struct sk_buff *skb)
|
|
{
|
|
return skb->transport_header != (typeof(skb->transport_header))~0U;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned char *skb_transport_header(const struct sk_buff *skb)
|
|
{
|
|
return skb->head + skb->transport_header;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_reset_transport_header(struct sk_buff *skb)
|
|
{
|
|
skb->transport_header = skb->data - skb->head;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_set_transport_header(struct sk_buff *skb,
|
|
const int offset)
|
|
{
|
|
skb_reset_transport_header(skb);
|
|
skb->transport_header += offset;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned char *skb_network_header(const struct sk_buff *skb)
|
|
{
|
|
return skb->head + skb->network_header;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_reset_network_header(struct sk_buff *skb)
|
|
{
|
|
skb->network_header = skb->data - skb->head;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_set_network_header(struct sk_buff *skb, const int offset)
|
|
{
|
|
skb_reset_network_header(skb);
|
|
skb->network_header += offset;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned char *skb_mac_header(const struct sk_buff *skb)
|
|
{
|
|
return skb->head + skb->mac_header;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_mac_header_was_set(const struct sk_buff *skb)
|
|
{
|
|
return skb->mac_header != (typeof(skb->mac_header))~0U;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_reset_mac_header(struct sk_buff *skb)
|
|
{
|
|
skb->mac_header = skb->data - skb->head;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_set_mac_header(struct sk_buff *skb, const int offset)
|
|
{
|
|
skb_reset_mac_header(skb);
|
|
skb->mac_header += offset;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_pop_mac_header(struct sk_buff *skb)
|
|
{
|
|
skb->mac_header = skb->network_header;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_probe_transport_header(struct sk_buff *skb,
|
|
const int offset_hint)
|
|
{
|
|
struct flow_keys keys;
|
|
|
|
if (skb_transport_header_was_set(skb))
|
|
return;
|
|
else if (skb_flow_dissect_flow_keys(skb, &keys, 0))
|
|
skb_set_transport_header(skb, keys.control.thoff);
|
|
else
|
|
skb_set_transport_header(skb, offset_hint);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_mac_header_rebuild(struct sk_buff *skb)
|
|
{
|
|
if (skb_mac_header_was_set(skb)) {
|
|
const unsigned char *old_mac = skb_mac_header(skb);
|
|
|
|
skb_set_mac_header(skb, -skb->mac_len);
|
|
memmove(skb_mac_header(skb), old_mac, skb->mac_len);
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_checksum_start_offset(const struct sk_buff *skb)
|
|
{
|
|
return skb->csum_start - skb_headroom(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_transport_offset(const struct sk_buff *skb)
|
|
{
|
|
return skb_transport_header(skb) - skb->data;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 skb_network_header_len(const struct sk_buff *skb)
|
|
{
|
|
return skb->transport_header - skb->network_header;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 skb_inner_network_header_len(const struct sk_buff *skb)
|
|
{
|
|
return skb->inner_transport_header - skb->inner_network_header;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_network_offset(const struct sk_buff *skb)
|
|
{
|
|
return skb_network_header(skb) - skb->data;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_inner_network_offset(const struct sk_buff *skb)
|
|
{
|
|
return skb_inner_network_header(skb) - skb->data;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pskb_network_may_pull(struct sk_buff *skb, unsigned int len)
|
|
{
|
|
return pskb_may_pull(skb, skb_network_offset(skb) + len);
|
|
}
|
|
# 2302 "include/linux/skbuff.h"
|
|
int ___pskb_trim(struct sk_buff *skb, unsigned int len);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_trim(struct sk_buff *skb, unsigned int len)
|
|
{
|
|
if (__builtin_expect(!!(skb_is_nonlinear(skb)), 0)) {
|
|
({ int __ret_warn_on = !!(1); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/skbuff.h", 2307); __builtin_expect(!!(__ret_warn_on), 0); });
|
|
return;
|
|
}
|
|
skb->len = len;
|
|
skb_set_tail_pointer(skb, len);
|
|
}
|
|
|
|
void skb_trim(struct sk_buff *skb, unsigned int len);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __pskb_trim(struct sk_buff *skb, unsigned int len)
|
|
{
|
|
if (skb->data_len)
|
|
return ___pskb_trim(skb, len);
|
|
__skb_trim(skb, len);
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pskb_trim(struct sk_buff *skb, unsigned int len)
|
|
{
|
|
return (len < skb->len) ? __pskb_trim(skb, len) : 0;
|
|
}
|
|
# 2338 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pskb_trim_unique(struct sk_buff *skb, unsigned int len)
|
|
{
|
|
int err = pskb_trim(skb, len);
|
|
do { if (__builtin_expect(!!(err), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/skbuff.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "2341" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
}
|
|
# 2352 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_orphan(struct sk_buff *skb)
|
|
{
|
|
if (skb->destructor) {
|
|
skb->destructor(skb);
|
|
skb->destructor = ((void *)0);
|
|
skb->sk = ((void *)0);
|
|
} else {
|
|
do { if (__builtin_expect(!!(skb->sk), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/skbuff.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "2359" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
}
|
|
}
|
|
# 2372 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_orphan_frags(struct sk_buff *skb, gfp_t gfp_mask)
|
|
{
|
|
if (__builtin_expect(!!(!(((struct skb_shared_info *)(skb_end_pointer(skb)))->tx_flags & SKBTX_DEV_ZEROCOPY)), 1))
|
|
return 0;
|
|
return skb_copy_ubufs(skb, gfp_mask);
|
|
}
|
|
# 2387 "include/linux/skbuff.h"
|
|
void skb_queue_purge(struct sk_buff_head *list);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_queue_purge(struct sk_buff_head *list)
|
|
{
|
|
struct sk_buff *skb;
|
|
while ((skb = __skb_dequeue(list)) != ((void *)0))
|
|
kfree_skb(skb);
|
|
}
|
|
|
|
void *netdev_alloc_frag(unsigned int fragsz);
|
|
|
|
struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int length,
|
|
gfp_t gfp_mask);
|
|
# 2413 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *netdev_alloc_skb(struct net_device *dev,
|
|
unsigned int length)
|
|
{
|
|
return __netdev_alloc_skb(dev, length, ((( gfp_t)0x20u)|(( gfp_t)0x80000u)|(( gfp_t)0x2000000u)));
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *__dev_alloc_skb(unsigned int length,
|
|
gfp_t gfp_mask)
|
|
{
|
|
return __netdev_alloc_skb(((void *)0), length, gfp_mask);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *dev_alloc_skb(unsigned int length)
|
|
{
|
|
return netdev_alloc_skb(((void *)0), length);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev,
|
|
unsigned int length, gfp_t gfp)
|
|
{
|
|
struct sk_buff *skb = __netdev_alloc_skb(dev, length + 2, gfp);
|
|
|
|
if (2 && skb)
|
|
skb_reserve(skb, 2);
|
|
return skb;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
|
|
unsigned int length)
|
|
{
|
|
return __netdev_alloc_skb_ip_align(dev, length, ((( gfp_t)0x20u)|(( gfp_t)0x80000u)|(( gfp_t)0x2000000u)));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_free_frag(void *addr)
|
|
{
|
|
__free_page_frag(addr);
|
|
}
|
|
|
|
void *napi_alloc_frag(unsigned int fragsz);
|
|
struct sk_buff *__napi_alloc_skb(struct napi_struct *napi,
|
|
unsigned int length, gfp_t gfp_mask);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *napi_alloc_skb(struct napi_struct *napi,
|
|
unsigned int length)
|
|
{
|
|
return __napi_alloc_skb(napi, length, ((( gfp_t)0x20u)|(( gfp_t)0x80000u)|(( gfp_t)0x2000000u)));
|
|
}
|
|
# 2472 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *__dev_alloc_pages(gfp_t gfp_mask,
|
|
unsigned int order)
|
|
{
|
|
# 2483 "include/linux/skbuff.h"
|
|
gfp_mask |= (( gfp_t)0x100u) | (( gfp_t)0x4000u) | (( gfp_t)0x2000u);
|
|
|
|
return alloc_pages_node((-1), gfp_mask, order);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *dev_alloc_pages(unsigned int order)
|
|
{
|
|
return __dev_alloc_pages(((( gfp_t)0x20u)|(( gfp_t)0x80000u)|(( gfp_t)0x2000000u)), order);
|
|
}
|
|
# 2501 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *__dev_alloc_page(gfp_t gfp_mask)
|
|
{
|
|
return __dev_alloc_pages(gfp_mask, 0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *dev_alloc_page(void)
|
|
{
|
|
return __dev_alloc_page(((( gfp_t)0x20u)|(( gfp_t)0x80000u)|(( gfp_t)0x2000000u)));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_propagate_pfmemalloc(struct page *page,
|
|
struct sk_buff *skb)
|
|
{
|
|
if (page_is_pfmemalloc(page))
|
|
skb->pfmemalloc = true;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page *skb_frag_page(const skb_frag_t *frag)
|
|
{
|
|
return frag->page.p;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_frag_ref(skb_frag_t *frag)
|
|
{
|
|
get_page(skb_frag_page(frag));
|
|
}
|
|
# 2552 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_frag_ref(struct sk_buff *skb, int f)
|
|
{
|
|
__skb_frag_ref(&((struct skb_shared_info *)(skb_end_pointer(skb)))->frags[f]);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_frag_unref(skb_frag_t *frag)
|
|
{
|
|
put_page(skb_frag_page(frag));
|
|
}
|
|
# 2575 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_frag_unref(struct sk_buff *skb, int f)
|
|
{
|
|
__skb_frag_unref(&((struct skb_shared_info *)(skb_end_pointer(skb)))->frags[f]);
|
|
}
|
|
# 2587 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *skb_frag_address(const skb_frag_t *frag)
|
|
{
|
|
return page_address(skb_frag_page(frag)) + frag->page_offset;
|
|
}
|
|
# 2599 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *skb_frag_address_safe(const skb_frag_t *frag)
|
|
{
|
|
void *ptr = page_address(skb_frag_page(frag));
|
|
if (__builtin_expect(!!(!ptr), 0))
|
|
return ((void *)0);
|
|
|
|
return ptr + frag->page_offset;
|
|
}
|
|
# 2615 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_frag_set_page(skb_frag_t *frag, struct page *page)
|
|
{
|
|
frag->page.p = page;
|
|
}
|
|
# 2628 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_frag_set_page(struct sk_buff *skb, int f,
|
|
struct page *page)
|
|
{
|
|
__skb_frag_set_page(&((struct skb_shared_info *)(skb_end_pointer(skb)))->frags[f], page);
|
|
}
|
|
|
|
bool skb_page_frag_refill(unsigned int sz, struct page_frag *pfrag, gfp_t prio);
|
|
# 2647 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) dma_addr_t skb_frag_dma_map(struct device *dev,
|
|
const skb_frag_t *frag,
|
|
size_t offset, size_t size,
|
|
enum dma_data_direction dir)
|
|
{
|
|
return dma_map_page(dev, skb_frag_page(frag),
|
|
frag->page_offset + offset, size, dir);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *pskb_copy(struct sk_buff *skb,
|
|
gfp_t gfp_mask)
|
|
{
|
|
return __pskb_copy(skb, skb_headroom(skb), gfp_mask);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *pskb_copy_for_clone(struct sk_buff *skb,
|
|
gfp_t gfp_mask)
|
|
{
|
|
return __pskb_copy_fclone(skb, skb_headroom(skb), gfp_mask, true);
|
|
}
|
|
# 2678 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_clone_writable(const struct sk_buff *skb, unsigned int len)
|
|
{
|
|
return !skb_header_cloned(skb) &&
|
|
skb_headroom(skb) + len <= skb->hdr_len;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_try_make_writable(struct sk_buff *skb,
|
|
unsigned int write_len)
|
|
{
|
|
return skb_cloned(skb) && !skb_clone_writable(skb, write_len) &&
|
|
pskb_expand_head(skb, 0, 0, ((( gfp_t)0x20u)|(( gfp_t)0x80000u)|(( gfp_t)0x2000000u)));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __skb_cow(struct sk_buff *skb, unsigned int headroom,
|
|
int cloned)
|
|
{
|
|
int delta = 0;
|
|
|
|
if (headroom > skb_headroom(skb))
|
|
delta = headroom - skb_headroom(skb);
|
|
|
|
if (delta || cloned)
|
|
return pskb_expand_head(skb, ((((delta)) + ((typeof((delta)))((({ typeof(32) _max1 = (32); typeof((1 << 6)) _max2 = ((1 << 6)); (void) (&_max1 == &_max2); _max1 > _max2 ? _max1 : _max2; }))) - 1)) & ~((typeof((delta)))((({ typeof(32) _max1 = (32); typeof((1 << 6)) _max2 = ((1 << 6)); (void) (&_max1 == &_max2); _max1 > _max2 ? _max1 : _max2; }))) - 1)), 0,
|
|
((( gfp_t)0x20u)|(( gfp_t)0x80000u)|(( gfp_t)0x2000000u)));
|
|
return 0;
|
|
}
|
|
# 2717 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_cow(struct sk_buff *skb, unsigned int headroom)
|
|
{
|
|
return __skb_cow(skb, headroom, skb_cloned(skb));
|
|
}
|
|
# 2732 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_cow_head(struct sk_buff *skb, unsigned int headroom)
|
|
{
|
|
return __skb_cow(skb, headroom, skb_header_cloned(skb));
|
|
}
|
|
# 2747 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_padto(struct sk_buff *skb, unsigned int len)
|
|
{
|
|
unsigned int size = skb->len;
|
|
if (__builtin_expect(!!(size >= len), 1))
|
|
return 0;
|
|
return skb_pad(skb, len - size);
|
|
}
|
|
# 2765 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_put_padto(struct sk_buff *skb, unsigned int len)
|
|
{
|
|
unsigned int size = skb->len;
|
|
|
|
if (__builtin_expect(!!(size < len), 0)) {
|
|
len -= size;
|
|
if (skb_pad(skb, len))
|
|
return -12;
|
|
__skb_put(skb, len);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_add_data(struct sk_buff *skb,
|
|
struct iov_iter *from, int copy)
|
|
{
|
|
const int off = skb->len;
|
|
|
|
if (skb->ip_summed == 0) {
|
|
__wsum csum = 0;
|
|
if (csum_and_copy_from_iter(skb_put(skb, copy), copy,
|
|
&csum, from) == copy) {
|
|
skb->csum = csum_block_add(skb->csum, csum, off);
|
|
return 0;
|
|
}
|
|
} else if (copy_from_iter(skb_put(skb, copy), copy, from) == copy)
|
|
return 0;
|
|
|
|
__skb_trim(skb, off);
|
|
return -14;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_can_coalesce(struct sk_buff *skb, int i,
|
|
const struct page *page, int off)
|
|
{
|
|
if (i) {
|
|
const struct skb_frag_struct *frag = &((struct skb_shared_info *)(skb_end_pointer(skb)))->frags[i - 1];
|
|
|
|
return page == skb_frag_page(frag) &&
|
|
off == frag->page_offset + skb_frag_size(frag);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __skb_linearize(struct sk_buff *skb)
|
|
{
|
|
return __pskb_pull_tail(skb, skb->data_len) ? 0 : -12;
|
|
}
|
|
# 2821 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_linearize(struct sk_buff *skb)
|
|
{
|
|
return skb_is_nonlinear(skb) ? __skb_linearize(skb) : 0;
|
|
}
|
|
# 2833 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_has_shared_frag(const struct sk_buff *skb)
|
|
{
|
|
return skb_is_nonlinear(skb) &&
|
|
((struct skb_shared_info *)(skb_end_pointer(skb)))->tx_flags & SKBTX_SHARED_FRAG;
|
|
}
|
|
# 2846 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_linearize_cow(struct sk_buff *skb)
|
|
{
|
|
return skb_is_nonlinear(skb) || skb_cloned(skb) ?
|
|
__skb_linearize(skb) : 0;
|
|
}
|
|
# 2863 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_postpull_rcsum(struct sk_buff *skb,
|
|
const void *start, unsigned int len)
|
|
{
|
|
if (skb->ip_summed == 2)
|
|
skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0));
|
|
else if (skb->ip_summed == 3 &&
|
|
skb_checksum_start_offset(skb) < 0)
|
|
skb->ip_summed = 0;
|
|
}
|
|
|
|
unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_postpush_rcsum(struct sk_buff *skb,
|
|
const void *start, unsigned int len)
|
|
{
|
|
# 2888 "include/linux/skbuff.h"
|
|
if (skb->ip_summed == 2)
|
|
skb->csum = csum_partial(start, len, skb->csum);
|
|
}
|
|
# 2903 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned char *skb_push_rcsum(struct sk_buff *skb,
|
|
unsigned int len)
|
|
{
|
|
skb_push(skb, len);
|
|
skb_postpush_rcsum(skb, skb->data, len);
|
|
return skb->data;
|
|
}
|
|
# 2920 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len)
|
|
{
|
|
if (__builtin_expect(!!(len >= skb->len), 1))
|
|
return 0;
|
|
if (skb->ip_summed == 2)
|
|
skb->ip_summed = 0;
|
|
return __pskb_trim(skb, len);
|
|
}
|
|
# 2963 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_has_frag_list(const struct sk_buff *skb)
|
|
{
|
|
return ((struct skb_shared_info *)(skb_end_pointer(skb)))->frag_list != ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_frag_list_init(struct sk_buff *skb)
|
|
{
|
|
((struct skb_shared_info *)(skb_end_pointer(skb)))->frag_list = ((void *)0);
|
|
}
|
|
|
|
|
|
|
|
|
|
struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags,
|
|
int *peeked, int *off, int *err);
|
|
struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock,
|
|
int *err);
|
|
unsigned int datagram_poll(struct file *file, struct socket *sock,
|
|
struct poll_table_struct *wait);
|
|
int skb_copy_datagram_iter(const struct sk_buff *from, int offset,
|
|
struct iov_iter *to, int size);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_copy_datagram_msg(const struct sk_buff *from, int offset,
|
|
struct msghdr *msg, int size)
|
|
{
|
|
return skb_copy_datagram_iter(from, offset, &msg->msg_iter, size);
|
|
}
|
|
int skb_copy_and_csum_datagram_msg(struct sk_buff *skb, int hlen,
|
|
struct msghdr *msg);
|
|
int skb_copy_datagram_from_iter(struct sk_buff *skb, int offset,
|
|
struct iov_iter *from, int len);
|
|
int zerocopy_sg_from_iter(struct sk_buff *skb, struct iov_iter *frm);
|
|
void skb_free_datagram(struct sock *sk, struct sk_buff *skb);
|
|
void skb_free_datagram_locked(struct sock *sk, struct sk_buff *skb);
|
|
int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, unsigned int flags);
|
|
int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len);
|
|
int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len);
|
|
__wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset, u8 *to,
|
|
int len, __wsum csum);
|
|
ssize_t skb_socket_splice(struct sock *sk,
|
|
struct pipe_inode_info *pipe,
|
|
struct splice_pipe_desc *spd);
|
|
int skb_splice_bits(struct sk_buff *skb, struct sock *sk, unsigned int offset,
|
|
struct pipe_inode_info *pipe, unsigned int len,
|
|
unsigned int flags,
|
|
ssize_t (*splice_cb)(struct sock *,
|
|
struct pipe_inode_info *,
|
|
struct splice_pipe_desc *));
|
|
void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to);
|
|
unsigned int skb_zerocopy_headlen(const struct sk_buff *from);
|
|
int skb_zerocopy(struct sk_buff *to, struct sk_buff *from,
|
|
int len, int hlen);
|
|
void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len);
|
|
int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen);
|
|
void skb_scrub_packet(struct sk_buff *skb, bool xnet);
|
|
unsigned int skb_gso_transport_seglen(const struct sk_buff *skb);
|
|
struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features);
|
|
struct sk_buff *skb_vlan_untag(struct sk_buff *skb);
|
|
int skb_ensure_writable(struct sk_buff *skb, int write_len);
|
|
int skb_vlan_pop(struct sk_buff *skb);
|
|
int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int memcpy_from_msg(void *data, struct msghdr *msg, int len)
|
|
{
|
|
return copy_from_iter(data, len, &msg->msg_iter) == len ? 0 : -14;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int memcpy_to_msg(struct msghdr *msg, void *data, int len)
|
|
{
|
|
return copy_to_iter(data, len, &msg->msg_iter) == len ? 0 : -14;
|
|
}
|
|
|
|
struct skb_checksum_ops {
|
|
__wsum (*update)(const void *mem, int len, __wsum wsum);
|
|
__wsum (*combine)(__wsum csum, __wsum csum2, int offset, int len);
|
|
};
|
|
|
|
__wsum __skb_checksum(const struct sk_buff *skb, int offset, int len,
|
|
__wsum csum, const struct skb_checksum_ops *ops);
|
|
__wsum skb_checksum(const struct sk_buff *skb, int offset, int len,
|
|
__wsum csum);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void * __attribute__((warn_unused_result))
|
|
__skb_header_pointer(const struct sk_buff *skb, int offset,
|
|
int len, void *data, int hlen, void *buffer)
|
|
{
|
|
if (hlen - offset >= len)
|
|
return data + offset;
|
|
|
|
if (!skb ||
|
|
skb_copy_bits(skb, offset, buffer, len) < 0)
|
|
return ((void *)0);
|
|
|
|
return buffer;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void * __attribute__((warn_unused_result))
|
|
skb_header_pointer(const struct sk_buff *skb, int offset, int len, void *buffer)
|
|
{
|
|
return __skb_header_pointer(skb, offset, len, skb->data,
|
|
skb_headlen(skb), buffer);
|
|
}
|
|
# 3075 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_needs_linearize(struct sk_buff *skb,
|
|
netdev_features_t features)
|
|
{
|
|
return skb_is_nonlinear(skb) &&
|
|
((skb_has_frag_list(skb) && !(features & ((netdev_features_t)1 << (NETIF_F_FRAGLIST_BIT)))) ||
|
|
(((struct skb_shared_info *)(skb_end_pointer(skb)))->nr_frags && !(features & ((netdev_features_t)1 << (NETIF_F_SG_BIT)))));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_copy_from_linear_data(const struct sk_buff *skb,
|
|
void *to,
|
|
const unsigned int len)
|
|
{
|
|
memcpy(to, skb->data, len);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_copy_from_linear_data_offset(const struct sk_buff *skb,
|
|
const int offset, void *to,
|
|
const unsigned int len)
|
|
{
|
|
memcpy(to, skb->data + offset, len);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_copy_to_linear_data(struct sk_buff *skb,
|
|
const void *from,
|
|
const unsigned int len)
|
|
{
|
|
memcpy(skb->data, from, len);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_copy_to_linear_data_offset(struct sk_buff *skb,
|
|
const int offset,
|
|
const void *from,
|
|
const unsigned int len)
|
|
{
|
|
memcpy(skb->data + offset, from, len);
|
|
}
|
|
|
|
void skb_init(void);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t skb_get_ktime(const struct sk_buff *skb)
|
|
{
|
|
return skb->tstamp;
|
|
}
|
|
# 3128 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_get_timestamp(const struct sk_buff *skb,
|
|
struct timeval *stamp)
|
|
{
|
|
*stamp = ns_to_timeval((skb->tstamp).tv64);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_get_timestampns(const struct sk_buff *skb,
|
|
struct timespec *stamp)
|
|
{
|
|
*stamp = ns_to_timespec((skb->tstamp).tv64);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __net_timestamp(struct sk_buff *skb)
|
|
{
|
|
skb->tstamp = ktime_get_real();
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t net_timedelta(ktime_t t)
|
|
{
|
|
return ({ (ktime_t){ .tv64 = (ktime_get_real()).tv64 - (t).tv64 }; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ktime_t net_invalid_timestamp(void)
|
|
{
|
|
return ktime_set(0, 0);
|
|
}
|
|
|
|
struct sk_buff *skb_clone_sk(struct sk_buff *skb);
|
|
# 3164 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_clone_tx_timestamp(struct sk_buff *skb)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_defer_rx_timestamp(struct sk_buff *skb)
|
|
{
|
|
return false;
|
|
}
|
|
# 3187 "include/linux/skbuff.h"
|
|
void skb_complete_tx_timestamp(struct sk_buff *skb,
|
|
struct skb_shared_hwtstamps *hwtstamps);
|
|
|
|
void __skb_tstamp_tx(struct sk_buff *orig_skb,
|
|
struct skb_shared_hwtstamps *hwtstamps,
|
|
struct sock *sk, int tstype);
|
|
# 3205 "include/linux/skbuff.h"
|
|
void skb_tstamp_tx(struct sk_buff *orig_skb,
|
|
struct skb_shared_hwtstamps *hwtstamps);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sw_tx_timestamp(struct sk_buff *skb)
|
|
{
|
|
if (((struct skb_shared_info *)(skb_end_pointer(skb)))->tx_flags & SKBTX_SW_TSTAMP &&
|
|
!(((struct skb_shared_info *)(skb_end_pointer(skb)))->tx_flags & SKBTX_IN_PROGRESS))
|
|
skb_tstamp_tx(skb, ((void *)0));
|
|
}
|
|
# 3227 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_tx_timestamp(struct sk_buff *skb)
|
|
{
|
|
skb_clone_tx_timestamp(skb);
|
|
sw_tx_timestamp(skb);
|
|
}
|
|
# 3240 "include/linux/skbuff.h"
|
|
void skb_complete_wifi_ack(struct sk_buff *skb, bool acked);
|
|
|
|
__sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len);
|
|
__sum16 __skb_checksum_complete(struct sk_buff *skb);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_csum_unnecessary(const struct sk_buff *skb)
|
|
{
|
|
return ((skb->ip_summed == 1) ||
|
|
skb->csum_valid ||
|
|
(skb->ip_summed == 3 &&
|
|
skb_checksum_start_offset(skb) >= 0));
|
|
}
|
|
# 3269 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __sum16 skb_checksum_complete(struct sk_buff *skb)
|
|
{
|
|
return skb_csum_unnecessary(skb) ?
|
|
0 : __skb_checksum_complete(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_decr_checksum_unnecessary(struct sk_buff *skb)
|
|
{
|
|
if (skb->ip_summed == 1) {
|
|
if (skb->csum_level == 0)
|
|
skb->ip_summed = 0;
|
|
else
|
|
skb->csum_level--;
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_incr_checksum_unnecessary(struct sk_buff *skb)
|
|
{
|
|
if (skb->ip_summed == 1) {
|
|
if (skb->csum_level < 3)
|
|
skb->csum_level++;
|
|
} else if (skb->ip_summed == 0) {
|
|
skb->ip_summed = 1;
|
|
skb->csum_level = 0;
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_mark_checksum_bad(struct sk_buff *skb)
|
|
{
|
|
# 3306 "include/linux/skbuff.h"
|
|
if (skb->ip_summed == 0 ||
|
|
skb->ip_summed == 1)
|
|
skb->csum_bad = 1;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __skb_checksum_validate_needed(struct sk_buff *skb,
|
|
bool zero_okay,
|
|
__sum16 check)
|
|
{
|
|
if (skb_csum_unnecessary(skb) || (zero_okay && !check)) {
|
|
skb->csum_valid = 1;
|
|
__skb_decr_checksum_unnecessary(skb);
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
# 3340 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_checksum_complete_unset(struct sk_buff *skb)
|
|
{
|
|
if (skb->ip_summed == 2)
|
|
skb->ip_summed = 0;
|
|
}
|
|
# 3355 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __sum16 __skb_checksum_validate_complete(struct sk_buff *skb,
|
|
bool complete,
|
|
__wsum psum)
|
|
{
|
|
if (skb->ip_summed == 2) {
|
|
if (!csum_fold(csum_add(psum, skb->csum))) {
|
|
skb->csum_valid = 1;
|
|
return 0;
|
|
}
|
|
} else if (skb->csum_bad) {
|
|
|
|
return ( __sum16)1;
|
|
}
|
|
|
|
skb->csum = psum;
|
|
|
|
if (complete || skb->len <= 76) {
|
|
__sum16 csum;
|
|
|
|
csum = __skb_checksum_complete(skb);
|
|
skb->csum_valid = !csum;
|
|
return csum;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __wsum null_compute_pseudo(struct sk_buff *skb, int proto)
|
|
{
|
|
return 0;
|
|
}
|
|
# 3424 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __skb_checksum_convert_check(struct sk_buff *skb)
|
|
{
|
|
return (skb->ip_summed == 0 &&
|
|
skb->csum_valid && !skb->csum_bad);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_checksum_convert(struct sk_buff *skb,
|
|
__sum16 check, __wsum pseudo)
|
|
{
|
|
skb->csum = ~pseudo;
|
|
skb->ip_summed = 2;
|
|
}
|
|
# 3444 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_remcsum_adjust_partial(struct sk_buff *skb, void *ptr,
|
|
u16 start, u16 offset)
|
|
{
|
|
skb->ip_summed = 3;
|
|
skb->csum_start = ((unsigned char *)ptr + start) - skb->head;
|
|
skb->csum_offset = offset - start;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_remcsum_process(struct sk_buff *skb, void *ptr,
|
|
int start, int offset, bool nopartial)
|
|
{
|
|
__wsum delta;
|
|
|
|
if (!nopartial) {
|
|
skb_remcsum_adjust_partial(skb, ptr, start, offset);
|
|
return;
|
|
}
|
|
|
|
if (__builtin_expect(!!(skb->ip_summed != 2), 0)) {
|
|
__skb_checksum_complete(skb);
|
|
skb_postpull_rcsum(skb, skb->data, ptr - (void *)skb->data);
|
|
}
|
|
|
|
delta = remcsum_adjust(ptr, skb->csum, start, offset);
|
|
|
|
|
|
skb->csum = csum_add(skb->csum, delta);
|
|
}
|
|
|
|
|
|
void nf_conntrack_destroy(struct nf_conntrack *nfct);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void nf_conntrack_put(struct nf_conntrack *nfct)
|
|
{
|
|
if (nfct && (({ typeof(atomic_sub_return_relaxed(1, &nfct->use)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_sub_return_relaxed(1, &nfct->use); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) == 0))
|
|
nf_conntrack_destroy(nfct);
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void nf_conntrack_get(struct nf_conntrack *nfct)
|
|
{
|
|
if (nfct)
|
|
atomic_add(1, &nfct->use);
|
|
}
|
|
# 3503 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void nf_reset(struct sk_buff *skb)
|
|
{
|
|
|
|
nf_conntrack_put(skb->nfct);
|
|
skb->nfct = ((void *)0);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void nf_reset_trace(struct sk_buff *skb)
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ipvs_reset(struct sk_buff *skb)
|
|
{
|
|
|
|
|
|
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ecnt_nf_copy(struct sk_buff *dst, const struct sk_buff *src,
|
|
bool copy)
|
|
{
|
|
|
|
if (ra_sw_nat_hook_xfer)
|
|
ra_sw_nat_hook_xfer(dst, src);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dst->portbind_mark = src->portbind_mark;
|
|
|
|
|
|
dst->orig_dev = src->orig_dev;
|
|
# 3553 "include/linux/skbuff.h"
|
|
dst->vlan_tags[0] = src->vlan_tags[0];
|
|
dst->vlan_tags[1] = src->vlan_tags[1];
|
|
dst->vlan_tag_flag = src->vlan_tag_flag;
|
|
|
|
|
|
dst->pon_vlan_tpid[0] = src->pon_vlan_tpid[0];
|
|
dst->pon_vlan_tpid[1] = src->pon_vlan_tpid[1];
|
|
dst->pon_vlan_tpid[2] = src->pon_vlan_tpid[2];
|
|
dst->pon_vlan_tpid[3] = src->pon_vlan_tpid[3];
|
|
|
|
dst->pon_vlan_tci[0] = src->pon_vlan_tci[0];
|
|
dst->pon_vlan_tci[1] = src->pon_vlan_tci[1];
|
|
dst->pon_vlan_tci[2] = src->pon_vlan_tci[2];
|
|
dst->pon_vlan_tci[3] = src->pon_vlan_tci[3];
|
|
|
|
dst->pon_tag_num = src->pon_tag_num;
|
|
dst->pon_vlan_flag = src->pon_vlan_flag;
|
|
|
|
dst->original_dev = src->original_dev;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dst->pon_mac_filter_flag = src->pon_mac_filter_flag;
|
|
|
|
|
|
dst->ppe_info_flag = src->ppe_info_flag;
|
|
dst->ppe_magic = src->ppe_magic;
|
|
dst->ppe_ai = src->ppe_ai;
|
|
dst->ppe_foe_entry = src->ppe_foe_entry;
|
|
|
|
|
|
dst->xpon_raw_info = src->xpon_raw_info;
|
|
dst->pon_mark = src->pon_mark;
|
|
dst->v_if = src->v_if;
|
|
# 3598 "include/linux/skbuff.h"
|
|
dst->lan_vlan_tci = src->lan_vlan_tci;
|
|
dst->lan_vlan_tci_valid = src->lan_vlan_tci_valid;
|
|
|
|
|
|
|
|
|
|
|
|
dst->bridge_flag = src->bridge_flag;
|
|
|
|
|
|
dst->dlf_resv0 = src->dlf_resv0;
|
|
dst->dlf_resv1 = src->dlf_resv1;
|
|
dst->dlf_resv2 = src->dlf_resv2;
|
|
|
|
|
|
dst->tso_mark = src->tso_mark;
|
|
|
|
dst->mark2 = src->mark2;
|
|
|
|
dst->is_unknown_mul = src->is_unknown_mul;
|
|
dst->adapterAddr = src->adapterAddr;
|
|
dst->ipsec_pt_flag = src->ipsec_pt_flag;
|
|
dst->hash_index = src->hash_index;
|
|
dst->sw_nat_flag = src->sw_nat_flag;
|
|
dst->foe_tbl_index = src->foe_tbl_index;
|
|
dst->igmp_leave_drop_flag = src->igmp_leave_drop_flag;
|
|
memcpy(&dst->ecnt_sk_buff, &src->ecnt_sk_buff, sizeof(ecnt_sk_buff_t));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __nf_copy(struct sk_buff *dst, const struct sk_buff *src,
|
|
bool copy)
|
|
{
|
|
|
|
dst->nfct = src->nfct;
|
|
nf_conntrack_get(src->nfct);
|
|
if (copy)
|
|
dst->nfctinfo = src->nfctinfo;
|
|
# 3649 "include/linux/skbuff.h"
|
|
ecnt_nf_copy(dst,src,copy);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void nf_copy(struct sk_buff *dst, const struct sk_buff *src)
|
|
{
|
|
|
|
nf_conntrack_put(dst->nfct);
|
|
|
|
|
|
|
|
|
|
__nf_copy(dst, src, true);
|
|
}
|
|
# 3674 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_copy_secmark(struct sk_buff *to, const struct sk_buff *from)
|
|
{ }
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_init_secmark(struct sk_buff *skb)
|
|
{ }
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_irq_freeable(const struct sk_buff *skb)
|
|
{
|
|
return !skb->destructor &&
|
|
|
|
!skb->sp &&
|
|
|
|
|
|
!skb->nfct &&
|
|
|
|
!skb->_skb_refdst &&
|
|
!skb_has_frag_list(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping)
|
|
{
|
|
skb->queue_mapping = queue_mapping;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u16 skb_get_queue_mapping(const struct sk_buff *skb)
|
|
{
|
|
return skb->queue_mapping;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_buff *from)
|
|
{
|
|
to->queue_mapping = from->queue_mapping;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_record_rx_queue(struct sk_buff *skb, u16 rx_queue)
|
|
{
|
|
skb->queue_mapping = rx_queue + 1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u16 skb_get_rx_queue(const struct sk_buff *skb)
|
|
{
|
|
return skb->queue_mapping - 1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_rx_queue_recorded(const struct sk_buff *skb)
|
|
{
|
|
return skb->queue_mapping != 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sec_path *skb_sec_path(struct sk_buff *skb)
|
|
{
|
|
|
|
return skb->sp;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct skb_gso_cb {
|
|
int mac_offset;
|
|
int encap_level;
|
|
__u16 csum_start;
|
|
};
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_tnl_header_len(const struct sk_buff *inner_skb)
|
|
{
|
|
return (skb_mac_header(inner_skb) - inner_skb->head) -
|
|
((struct skb_gso_cb *)((inner_skb)->cb + 32))->mac_offset;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int gso_pskb_expand_head(struct sk_buff *skb, int extra)
|
|
{
|
|
int new_headroom, headroom;
|
|
int ret;
|
|
|
|
headroom = skb_headroom(skb);
|
|
ret = pskb_expand_head(skb, extra, 0, ((( gfp_t)0x20u)|(( gfp_t)0x80000u)|(( gfp_t)0x2000000u)));
|
|
if (ret)
|
|
return ret;
|
|
|
|
new_headroom = skb_headroom(skb);
|
|
((struct skb_gso_cb *)((skb)->cb + 32))->mac_offset += (new_headroom - headroom);
|
|
return 0;
|
|
}
|
|
# 3776 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __sum16 gso_make_checksum(struct sk_buff *skb, __wsum res)
|
|
{
|
|
int plen = ((struct skb_gso_cb *)((skb)->cb + 32))->csum_start - skb_headroom(skb) -
|
|
skb_transport_offset(skb);
|
|
__wsum partial;
|
|
|
|
partial = csum_partial(skb_transport_header(skb), plen, skb->csum);
|
|
skb->csum = res;
|
|
((struct skb_gso_cb *)((skb)->cb + 32))->csum_start -= plen;
|
|
|
|
return csum_fold(partial);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_is_gso(const struct sk_buff *skb)
|
|
{
|
|
return ((struct skb_shared_info *)(skb_end_pointer(skb)))->gso_size;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_is_gso_v6(const struct sk_buff *skb)
|
|
{
|
|
return ((struct skb_shared_info *)(skb_end_pointer(skb)))->gso_type & SKB_GSO_TCPV6;
|
|
}
|
|
|
|
void __skb_warn_lro_forwarding(const struct sk_buff *skb);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_warn_if_lro(const struct sk_buff *skb)
|
|
{
|
|
|
|
|
|
const struct skb_shared_info *shinfo = ((struct skb_shared_info *)(skb_end_pointer(skb)));
|
|
|
|
if (skb_is_nonlinear(skb) && shinfo->gso_size != 0 &&
|
|
__builtin_expect(!!(shinfo->gso_type == 0), 0)) {
|
|
__skb_warn_lro_forwarding(skb);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_forward_csum(struct sk_buff *skb)
|
|
{
|
|
|
|
if (skb->ip_summed == 2)
|
|
skb->ip_summed = 0;
|
|
}
|
|
# 3831 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_checksum_none_assert(const struct sk_buff *skb)
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off);
|
|
|
|
int skb_checksum_setup(struct sk_buff *skb, bool recalculate);
|
|
struct sk_buff *skb_checksum_trimmed(struct sk_buff *skb,
|
|
unsigned int transport_len,
|
|
__sum16(*skb_chkf)(struct sk_buff *skb));
|
|
# 3854 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_head_is_locked(const struct sk_buff *skb)
|
|
{
|
|
return !skb->head_frag || skb_cloned(skb);
|
|
}
|
|
# 3869 "include/linux/skbuff.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int skb_gso_network_seglen(const struct sk_buff *skb)
|
|
{
|
|
unsigned int hdr_len = skb_transport_header(skb) -
|
|
skb_network_header(skb);
|
|
return hdr_len + skb_gso_transport_seglen(skb);
|
|
}
|
|
# 3889 "include/linux/skbuff.h"
|
|
struct sk_buff *skbmgr_alloc_skb2k(void);
|
|
int skbmgr_recycling_callback(struct sk_buff *skb);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *skbmgr_dev_alloc_skb2k(void)
|
|
{
|
|
struct sk_buff *skb = skbmgr_alloc_skb2k();
|
|
if (__builtin_expect(!!(skb), 1))
|
|
skb_reserve(skb, ({ typeof(32) _max1 = (32); typeof((1 << 6)) _max2 = ((1 << 6)); (void) (&_max1 == &_max2); _max1 > _max2 ? _max1 : _max2; }));
|
|
return skb;
|
|
}
|
|
# 3916 "include/linux/skbuff.h"
|
|
struct sk_buff *skbmgr_alloc_skb4k(void);
|
|
|
|
int skbmgr_4k_recycling_callback(struct sk_buff *skb);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *skbmgr_dev_alloc_skb4k(void)
|
|
{
|
|
struct sk_buff *skb = skbmgr_alloc_skb4k();
|
|
if (__builtin_expect(!!(skb), 1))
|
|
skb_reserve(skb, ({ typeof(32) _max1 = (32); typeof((1 << 6)) _max2 = ((1 << 6)); (void) (&_max1 == &_max2); _max1 > _max2 ? _max1 : _max2; }));
|
|
return skb;
|
|
}
|
|
# 21 "include/linux/ip.h" 2
|
|
# 1 "include/uapi/linux/ip.h" 1
|
|
# 85 "include/uapi/linux/ip.h"
|
|
struct iphdr {
|
|
|
|
__u8 ihl:4,
|
|
version:4;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__u8 tos;
|
|
__be16 tot_len;
|
|
__be16 id;
|
|
__be16 frag_off;
|
|
__u8 ttl;
|
|
__u8 protocol;
|
|
__sum16 check;
|
|
__be32 saddr;
|
|
__be32 daddr;
|
|
|
|
};
|
|
|
|
|
|
struct ip_auth_hdr {
|
|
__u8 nexthdr;
|
|
__u8 hdrlen;
|
|
__be16 reserved;
|
|
__be32 spi;
|
|
__be32 seq_no;
|
|
__u8 auth_data[0];
|
|
};
|
|
|
|
struct ip_esp_hdr {
|
|
__be32 spi;
|
|
__be32 seq_no;
|
|
__u8 enc_data[0];
|
|
};
|
|
|
|
struct ip_comp_hdr {
|
|
__u8 nexthdr;
|
|
__u8 flags;
|
|
__be16 cpi;
|
|
};
|
|
|
|
struct ip_beet_phdr {
|
|
__u8 nexthdr;
|
|
__u8 hdrlen;
|
|
__u8 padlen;
|
|
__u8 reserved;
|
|
};
|
|
|
|
|
|
enum
|
|
{
|
|
IPV4_DEVCONF_FORWARDING=1,
|
|
IPV4_DEVCONF_MC_FORWARDING,
|
|
IPV4_DEVCONF_PROXY_ARP,
|
|
IPV4_DEVCONF_ACCEPT_REDIRECTS,
|
|
IPV4_DEVCONF_SECURE_REDIRECTS,
|
|
IPV4_DEVCONF_SEND_REDIRECTS,
|
|
IPV4_DEVCONF_SHARED_MEDIA,
|
|
IPV4_DEVCONF_RP_FILTER,
|
|
IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE,
|
|
IPV4_DEVCONF_BOOTP_RELAY,
|
|
IPV4_DEVCONF_LOG_MARTIANS,
|
|
IPV4_DEVCONF_TAG,
|
|
IPV4_DEVCONF_ARPFILTER,
|
|
IPV4_DEVCONF_MEDIUM_ID,
|
|
IPV4_DEVCONF_NOXFRM,
|
|
IPV4_DEVCONF_NOPOLICY,
|
|
IPV4_DEVCONF_FORCE_IGMP_VERSION,
|
|
IPV4_DEVCONF_ARP_ANNOUNCE,
|
|
IPV4_DEVCONF_ARP_IGNORE,
|
|
IPV4_DEVCONF_PROMOTE_SECONDARIES,
|
|
IPV4_DEVCONF_ARP_ACCEPT,
|
|
IPV4_DEVCONF_ARP_NOTIFY,
|
|
IPV4_DEVCONF_ACCEPT_LOCAL,
|
|
IPV4_DEVCONF_SRC_VMARK,
|
|
IPV4_DEVCONF_PROXY_ARP_PVLAN,
|
|
IPV4_DEVCONF_ROUTE_LOCALNET,
|
|
IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL,
|
|
IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL,
|
|
IPV4_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN,
|
|
__IPV4_DEVCONF_MAX
|
|
};
|
|
# 22 "include/linux/ip.h" 2
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct iphdr *ip_hdr(const struct sk_buff *skb)
|
|
{
|
|
return (struct iphdr *)skb_network_header(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct iphdr *inner_ip_hdr(const struct sk_buff *skb)
|
|
{
|
|
return (struct iphdr *)skb_inner_network_header(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct iphdr *ipip_hdr(const struct sk_buff *skb)
|
|
{
|
|
return (struct iphdr *)skb_transport_header(skb);
|
|
}
|
|
# 52 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c" 2
|
|
# 1 "include/linux/ipv6.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/ipv6.h" 1
|
|
# 20 "include/uapi/linux/ipv6.h"
|
|
struct in6_pktinfo {
|
|
struct in6_addr ipi6_addr;
|
|
int ipi6_ifindex;
|
|
};
|
|
|
|
|
|
|
|
struct ip6_mtuinfo {
|
|
struct sockaddr_in6 ip6m_addr;
|
|
__u32 ip6m_mtu;
|
|
};
|
|
|
|
|
|
struct in6_ifreq {
|
|
struct in6_addr ifr6_addr;
|
|
__u32 ifr6_prefixlen;
|
|
int ifr6_ifindex;
|
|
};
|
|
# 46 "include/uapi/linux/ipv6.h"
|
|
struct ipv6_rt_hdr {
|
|
__u8 nexthdr;
|
|
__u8 hdrlen;
|
|
__u8 type;
|
|
__u8 segments_left;
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
struct ipv6_opt_hdr {
|
|
__u8 nexthdr;
|
|
__u8 hdrlen;
|
|
|
|
|
|
|
|
} __attribute__((packed));
|
|
# 77 "include/uapi/linux/ipv6.h"
|
|
struct rt0_hdr {
|
|
struct ipv6_rt_hdr rt_hdr;
|
|
__u32 reserved;
|
|
struct in6_addr addr[0];
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct rt2_hdr {
|
|
struct ipv6_rt_hdr rt_hdr;
|
|
__u32 reserved;
|
|
struct in6_addr addr;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct ipv6_destopt_hao {
|
|
__u8 type;
|
|
__u8 length;
|
|
struct in6_addr addr;
|
|
} __attribute__((packed));
|
|
# 114 "include/uapi/linux/ipv6.h"
|
|
struct ipv6hdr {
|
|
|
|
__u8 priority:4,
|
|
version:4;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__u8 flow_lbl[3];
|
|
|
|
__be16 payload_len;
|
|
__u8 nexthdr;
|
|
__u8 hop_limit;
|
|
|
|
struct in6_addr saddr;
|
|
struct in6_addr daddr;
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
DEVCONF_FORWARDING = 0,
|
|
DEVCONF_HOPLIMIT,
|
|
DEVCONF_MTU6,
|
|
DEVCONF_ACCEPT_RA,
|
|
DEVCONF_ACCEPT_REDIRECTS,
|
|
DEVCONF_AUTOCONF,
|
|
DEVCONF_DAD_TRANSMITS,
|
|
DEVCONF_RTR_SOLICITS,
|
|
DEVCONF_RTR_SOLICIT_INTERVAL,
|
|
DEVCONF_RTR_SOLICIT_DELAY,
|
|
DEVCONF_USE_TEMPADDR,
|
|
DEVCONF_TEMP_VALID_LFT,
|
|
DEVCONF_TEMP_PREFERED_LFT,
|
|
DEVCONF_REGEN_MAX_RETRY,
|
|
DEVCONF_MAX_DESYNC_FACTOR,
|
|
DEVCONF_MAX_ADDRESSES,
|
|
DEVCONF_FORCE_MLD_VERSION,
|
|
DEVCONF_ACCEPT_RA_DEFRTR,
|
|
DEVCONF_ACCEPT_RA_PINFO,
|
|
DEVCONF_ACCEPT_RA_RTR_PREF,
|
|
DEVCONF_RTR_PROBE_INTERVAL,
|
|
DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN,
|
|
DEVCONF_PROXY_NDP,
|
|
DEVCONF_OPTIMISTIC_DAD,
|
|
DEVCONF_ACCEPT_SOURCE_ROUTE,
|
|
DEVCONF_MC_FORWARDING,
|
|
DEVCONF_DISABLE_IPV6,
|
|
DEVCONF_ACCEPT_DAD,
|
|
DEVCONF_FORCE_TLLAO,
|
|
DEVCONF_NDISC_NOTIFY,
|
|
DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL,
|
|
DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL,
|
|
DEVCONF_SUPPRESS_FRAG_NDISC,
|
|
DEVCONF_ACCEPT_RA_FROM_LOCAL,
|
|
DEVCONF_USE_OPTIMISTIC,
|
|
DEVCONF_ACCEPT_RA_MTU,
|
|
DEVCONF_STABLE_SECRET,
|
|
DEVCONF_USE_OIF_ADDRS_ONLY,
|
|
DEVCONF_ACCEPT_RA_MIN_HOP_LIMIT,
|
|
DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN,
|
|
DEVCONF_MAX
|
|
};
|
|
# 5 "include/linux/ipv6.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct ipv6_devconf {
|
|
__s32 forwarding;
|
|
__s32 hop_limit;
|
|
__s32 mtu6;
|
|
__s32 accept_ra;
|
|
__s32 accept_redirects;
|
|
__s32 autoconf;
|
|
__s32 dad_transmits;
|
|
__s32 rtr_solicits;
|
|
__s32 rtr_solicit_interval;
|
|
__s32 rtr_solicit_delay;
|
|
__s32 force_mld_version;
|
|
__s32 mldv1_unsolicited_report_interval;
|
|
__s32 mldv2_unsolicited_report_interval;
|
|
__s32 use_tempaddr;
|
|
__s32 temp_valid_lft;
|
|
__s32 temp_prefered_lft;
|
|
__s32 regen_max_retry;
|
|
__s32 max_desync_factor;
|
|
__s32 max_addresses;
|
|
__s32 accept_ra_defrtr;
|
|
__s32 accept_ra_min_hop_limit;
|
|
__s32 accept_ra_pinfo;
|
|
__s32 ignore_routes_with_linkdown;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__s32 proxy_ndp;
|
|
__s32 accept_source_route;
|
|
__s32 accept_ra_from_local;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__s32 disable_ipv6;
|
|
__s32 accept_dad;
|
|
__s32 force_tllao;
|
|
__s32 ndisc_notify;
|
|
__s32 suppress_frag_ndisc;
|
|
__s32 accept_ra_mtu;
|
|
struct ipv6_stable_secret {
|
|
bool initialized;
|
|
struct in6_addr secret;
|
|
} stable_secret;
|
|
__s32 use_oif_addrs_only;
|
|
|
|
char slaac_addr[64];
|
|
|
|
|
|
__s32 child_prefix_orign;
|
|
char child_prefix[64];
|
|
char parent_pd_prefix[64];
|
|
char slaac_prefix[64];
|
|
|
|
|
|
__s32 sendrs;
|
|
|
|
void *sysctl;
|
|
};
|
|
|
|
struct ipv6_params {
|
|
__s32 disable_ipv6;
|
|
__s32 autoconf;
|
|
};
|
|
extern struct ipv6_params ipv6_defaults;
|
|
# 1 "include/linux/icmpv6.h" 1
|
|
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/icmpv6.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct icmp6hdr {
|
|
|
|
__u8 icmp6_type;
|
|
__u8 icmp6_code;
|
|
__sum16 icmp6_cksum;
|
|
|
|
|
|
union {
|
|
__be32 un_data32[1];
|
|
__be16 un_data16[2];
|
|
__u8 un_data8[4];
|
|
|
|
struct icmpv6_echo {
|
|
__be16 identifier;
|
|
__be16 sequence;
|
|
} u_echo;
|
|
|
|
struct icmpv6_nd_advt {
|
|
|
|
__u32 reserved:5,
|
|
override:1,
|
|
solicited:1,
|
|
router:1,
|
|
reserved2:24;
|
|
# 39 "include/uapi/linux/icmpv6.h"
|
|
} u_nd_advt;
|
|
|
|
struct icmpv6_nd_ra {
|
|
__u8 hop_limit;
|
|
|
|
__u8 reserved:3,
|
|
router_pref:2,
|
|
home_agent:1,
|
|
other:1,
|
|
managed:1;
|
|
# 59 "include/uapi/linux/icmpv6.h"
|
|
__be16 rt_lifetime;
|
|
} u_nd_ra;
|
|
|
|
} icmp6_dataun;
|
|
# 79 "include/uapi/linux/icmpv6.h"
|
|
};
|
|
# 149 "include/uapi/linux/icmpv6.h"
|
|
struct icmp6_filter {
|
|
__u32 data[8];
|
|
};
|
|
# 6 "include/linux/icmpv6.h" 2
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct icmp6hdr *icmp6_hdr(const struct sk_buff *skb)
|
|
{
|
|
return (struct icmp6hdr *)skb_transport_header(skb);
|
|
}
|
|
|
|
# 1 "include/linux/netdevice.h" 1
|
|
# 30 "include/linux/netdevice.h"
|
|
# 1 "include/linux/delay.h" 1
|
|
# 12 "include/linux/delay.h"
|
|
extern unsigned long loops_per_jiffy;
|
|
|
|
# 1 "./arch/arm/include/asm/delay.h" 1
|
|
# 10 "./arch/arm/include/asm/delay.h"
|
|
# 1 "arch/arm/include/generated/asm/param.h" 1
|
|
# 11 "./arch/arm/include/asm/delay.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct delay_timer {
|
|
unsigned long (*read_current_timer)(void);
|
|
unsigned long freq;
|
|
};
|
|
|
|
extern struct arm_delay_ops {
|
|
void (*delay)(unsigned long);
|
|
void (*const_udelay)(unsigned long);
|
|
void (*udelay)(unsigned long);
|
|
unsigned long ticks_per_jiffy;
|
|
} arm_delay_ops;
|
|
# 39 "./arch/arm/include/asm/delay.h"
|
|
extern void __bad_udelay(void);
|
|
# 61 "./arch/arm/include/asm/delay.h"
|
|
extern void __loop_delay(unsigned long loops);
|
|
extern void __loop_udelay(unsigned long usecs);
|
|
extern void __loop_const_udelay(unsigned long);
|
|
|
|
|
|
|
|
extern void register_current_timer_delay(const struct delay_timer *timer);
|
|
# 15 "include/linux/delay.h" 2
|
|
# 37 "include/linux/delay.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ndelay(unsigned long x)
|
|
{
|
|
(__builtin_constant_p((((x) + (1000) - 1) / (1000))) ? (((((x) + (1000) - 1) / (1000))) > (2 * 1000) ? __bad_udelay() : arm_delay_ops.const_udelay(((((x) + (1000) - 1) / (1000))) * (((2199023UL) * 100) >> 11))) : arm_delay_ops.udelay((((x) + (1000) - 1) / (1000))));
|
|
}
|
|
|
|
|
|
|
|
extern unsigned long lpj_fine;
|
|
void calibrate_delay(void);
|
|
void msleep(unsigned int msecs);
|
|
unsigned long msleep_interruptible(unsigned int msecs);
|
|
void usleep_range(unsigned long min, unsigned long max);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ssleep(unsigned int seconds)
|
|
{
|
|
msleep(seconds * 1000);
|
|
}
|
|
# 31 "include/linux/netdevice.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/dmaengine.h" 1
|
|
# 34 "include/linux/dmaengine.h"
|
|
typedef s32 dma_cookie_t;
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dma_submit_error(dma_cookie_t cookie)
|
|
{
|
|
return cookie < 0 ? cookie : 0;
|
|
}
|
|
# 49 "include/linux/dmaengine.h"
|
|
enum dma_status {
|
|
DMA_COMPLETE,
|
|
DMA_IN_PROGRESS,
|
|
DMA_PAUSED,
|
|
DMA_ERROR,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum dma_transaction_type {
|
|
DMA_MEMCPY,
|
|
DMA_XOR,
|
|
DMA_PQ,
|
|
DMA_XOR_VAL,
|
|
DMA_PQ_VAL,
|
|
DMA_MEMSET,
|
|
DMA_MEMSET_SG,
|
|
DMA_INTERRUPT,
|
|
DMA_SG,
|
|
DMA_PRIVATE,
|
|
DMA_ASYNC_TX,
|
|
DMA_SLAVE,
|
|
DMA_CYCLIC,
|
|
DMA_INTERLEAVE,
|
|
|
|
DMA_TX_TYPE_END,
|
|
};
|
|
# 88 "include/linux/dmaengine.h"
|
|
enum dma_transfer_direction {
|
|
DMA_MEM_TO_MEM,
|
|
DMA_MEM_TO_DEV,
|
|
DMA_DEV_TO_MEM,
|
|
DMA_DEV_TO_DEV,
|
|
DMA_TRANS_NONE,
|
|
};
|
|
# 134 "include/linux/dmaengine.h"
|
|
struct data_chunk {
|
|
size_t size;
|
|
size_t icg;
|
|
size_t dst_icg;
|
|
size_t src_icg;
|
|
};
|
|
# 159 "include/linux/dmaengine.h"
|
|
struct dma_interleaved_template {
|
|
dma_addr_t src_start;
|
|
dma_addr_t dst_start;
|
|
enum dma_transfer_direction dir;
|
|
bool src_inc;
|
|
bool dst_inc;
|
|
bool src_sgl;
|
|
bool dst_sgl;
|
|
size_t numf;
|
|
size_t frame_size;
|
|
struct data_chunk sgl[0];
|
|
};
|
|
# 190 "include/linux/dmaengine.h"
|
|
enum dma_ctrl_flags {
|
|
DMA_PREP_INTERRUPT = (1 << 0),
|
|
DMA_CTRL_ACK = (1 << 1),
|
|
DMA_PREP_PQ_DISABLE_P = (1 << 2),
|
|
DMA_PREP_PQ_DISABLE_Q = (1 << 3),
|
|
DMA_PREP_CONTINUE = (1 << 4),
|
|
DMA_PREP_FENCE = (1 << 5),
|
|
DMA_CTRL_REUSE = (1 << 6),
|
|
};
|
|
|
|
|
|
|
|
|
|
enum sum_check_bits {
|
|
SUM_CHECK_P = 0,
|
|
SUM_CHECK_Q = 1,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum sum_check_flags {
|
|
SUM_CHECK_P_RESULT = (1 << SUM_CHECK_P),
|
|
SUM_CHECK_Q_RESULT = (1 << SUM_CHECK_Q),
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct { unsigned long bits[(((DMA_TX_TYPE_END) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))]; } dma_cap_mask_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct dma_chan_percpu {
|
|
|
|
unsigned long memcpy_count;
|
|
unsigned long bytes_transferred;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct dma_router {
|
|
struct device *dev;
|
|
void (*route_free)(struct device *dev, void *route_data);
|
|
};
|
|
# 262 "include/linux/dmaengine.h"
|
|
struct dma_chan {
|
|
struct dma_device *device;
|
|
dma_cookie_t cookie;
|
|
dma_cookie_t completed_cookie;
|
|
|
|
|
|
int chan_id;
|
|
struct dma_chan_dev *dev;
|
|
|
|
struct list_head device_node;
|
|
struct dma_chan_percpu *local;
|
|
int client_count;
|
|
int table_count;
|
|
|
|
|
|
struct dma_router *router;
|
|
void *route_data;
|
|
|
|
void *private;
|
|
};
|
|
# 290 "include/linux/dmaengine.h"
|
|
struct dma_chan_dev {
|
|
struct dma_chan *chan;
|
|
struct device device;
|
|
int dev_id;
|
|
atomic_t *idr_ref;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum dma_slave_buswidth {
|
|
DMA_SLAVE_BUSWIDTH_UNDEFINED = 0,
|
|
DMA_SLAVE_BUSWIDTH_1_BYTE = 1,
|
|
DMA_SLAVE_BUSWIDTH_2_BYTES = 2,
|
|
DMA_SLAVE_BUSWIDTH_3_BYTES = 3,
|
|
DMA_SLAVE_BUSWIDTH_4_BYTES = 4,
|
|
DMA_SLAVE_BUSWIDTH_8_BYTES = 8,
|
|
DMA_SLAVE_BUSWIDTH_16_BYTES = 16,
|
|
DMA_SLAVE_BUSWIDTH_32_BYTES = 32,
|
|
DMA_SLAVE_BUSWIDTH_64_BYTES = 64,
|
|
};
|
|
# 358 "include/linux/dmaengine.h"
|
|
struct dma_slave_config {
|
|
enum dma_transfer_direction direction;
|
|
dma_addr_t src_addr;
|
|
dma_addr_t dst_addr;
|
|
enum dma_slave_buswidth src_addr_width;
|
|
enum dma_slave_buswidth dst_addr_width;
|
|
u32 src_maxburst;
|
|
u32 dst_maxburst;
|
|
bool device_fc;
|
|
unsigned int slave_id;
|
|
};
|
|
# 390 "include/linux/dmaengine.h"
|
|
enum dma_residue_granularity {
|
|
DMA_RESIDUE_GRANULARITY_DESCRIPTOR = 0,
|
|
DMA_RESIDUE_GRANULARITY_SEGMENT = 1,
|
|
DMA_RESIDUE_GRANULARITY_BURST = 2,
|
|
};
|
|
# 410 "include/linux/dmaengine.h"
|
|
struct dma_slave_caps {
|
|
u32 src_addr_widths;
|
|
u32 dst_addr_widths;
|
|
u32 directions;
|
|
bool cmd_pause;
|
|
bool cmd_terminate;
|
|
enum dma_residue_granularity residue_granularity;
|
|
bool descriptor_reuse;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const char *dma_chan_name(struct dma_chan *chan)
|
|
{
|
|
return dev_name(&chan->dev->device);
|
|
}
|
|
|
|
void dma_chan_cleanup(struct kref *kref);
|
|
# 438 "include/linux/dmaengine.h"
|
|
typedef bool (*dma_filter_fn)(struct dma_chan *chan, void *filter_param);
|
|
|
|
typedef void (*dma_async_tx_callback)(void *dma_async_param);
|
|
|
|
struct dmaengine_unmap_data {
|
|
u8 map_cnt;
|
|
u8 to_cnt;
|
|
u8 from_cnt;
|
|
u8 bidi_cnt;
|
|
struct device *dev;
|
|
struct kref kref;
|
|
size_t len;
|
|
dma_addr_t addr[0];
|
|
};
|
|
# 471 "include/linux/dmaengine.h"
|
|
struct dma_async_tx_descriptor {
|
|
dma_cookie_t cookie;
|
|
enum dma_ctrl_flags flags;
|
|
dma_addr_t phys;
|
|
struct dma_chan *chan;
|
|
dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx);
|
|
int (*desc_free)(struct dma_async_tx_descriptor *tx);
|
|
dma_async_tx_callback callback;
|
|
void *callback_param;
|
|
struct dmaengine_unmap_data *unmap;
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dma_set_unmap(struct dma_async_tx_descriptor *tx,
|
|
struct dmaengine_unmap_data *unmap)
|
|
{
|
|
kref_get(&unmap->kref);
|
|
tx->unmap = unmap;
|
|
}
|
|
|
|
struct dmaengine_unmap_data *
|
|
dmaengine_get_unmap_data(struct device *dev, int nr, gfp_t flags);
|
|
void dmaengine_unmap_put(struct dmaengine_unmap_data *unmap);
|
|
# 514 "include/linux/dmaengine.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dma_descriptor_unmap(struct dma_async_tx_descriptor *tx)
|
|
{
|
|
if (tx->unmap) {
|
|
dmaengine_unmap_put(tx->unmap);
|
|
tx->unmap = ((void *)0);
|
|
}
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void txd_lock(struct dma_async_tx_descriptor *txd)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void txd_unlock(struct dma_async_tx_descriptor *txd)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void txd_chain(struct dma_async_tx_descriptor *txd, struct dma_async_tx_descriptor *next)
|
|
{
|
|
do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/dmaengine.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "531" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0);
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void txd_clear_parent(struct dma_async_tx_descriptor *txd)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void txd_clear_next(struct dma_async_tx_descriptor *txd)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dma_async_tx_descriptor *txd_next(struct dma_async_tx_descriptor *txd)
|
|
{
|
|
return ((void *)0);
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dma_async_tx_descriptor *txd_parent(struct dma_async_tx_descriptor *txd)
|
|
{
|
|
return ((void *)0);
|
|
}
|
|
# 589 "include/linux/dmaengine.h"
|
|
struct dma_tx_state {
|
|
dma_cookie_t last;
|
|
dma_cookie_t used;
|
|
u32 residue;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum dmaengine_alignment {
|
|
DMAENGINE_ALIGN_1_BYTE = 0,
|
|
DMAENGINE_ALIGN_2_BYTES = 1,
|
|
DMAENGINE_ALIGN_4_BYTES = 2,
|
|
DMAENGINE_ALIGN_8_BYTES = 3,
|
|
DMAENGINE_ALIGN_16_BYTES = 4,
|
|
DMAENGINE_ALIGN_32_BYTES = 5,
|
|
DMAENGINE_ALIGN_64_BYTES = 6,
|
|
};
|
|
# 663 "include/linux/dmaengine.h"
|
|
struct dma_device {
|
|
|
|
unsigned int chancnt;
|
|
unsigned int privatecnt;
|
|
struct list_head channels;
|
|
struct list_head global_node;
|
|
dma_cap_mask_t cap_mask;
|
|
unsigned short max_xor;
|
|
unsigned short max_pq;
|
|
enum dmaengine_alignment copy_align;
|
|
enum dmaengine_alignment xor_align;
|
|
enum dmaengine_alignment pq_align;
|
|
enum dmaengine_alignment fill_align;
|
|
|
|
|
|
int dev_id;
|
|
struct device *dev;
|
|
|
|
u32 src_addr_widths;
|
|
u32 dst_addr_widths;
|
|
u32 directions;
|
|
enum dma_residue_granularity residue_granularity;
|
|
|
|
int (*device_alloc_chan_resources)(struct dma_chan *chan);
|
|
void (*device_free_chan_resources)(struct dma_chan *chan);
|
|
|
|
struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)(
|
|
struct dma_chan *chan, dma_addr_t dst, dma_addr_t src,
|
|
size_t len, unsigned long flags);
|
|
struct dma_async_tx_descriptor *(*device_prep_dma_xor)(
|
|
struct dma_chan *chan, dma_addr_t dst, dma_addr_t *src,
|
|
unsigned int src_cnt, size_t len, unsigned long flags);
|
|
struct dma_async_tx_descriptor *(*device_prep_dma_xor_val)(
|
|
struct dma_chan *chan, dma_addr_t *src, unsigned int src_cnt,
|
|
size_t len, enum sum_check_flags *result, unsigned long flags);
|
|
struct dma_async_tx_descriptor *(*device_prep_dma_pq)(
|
|
struct dma_chan *chan, dma_addr_t *dst, dma_addr_t *src,
|
|
unsigned int src_cnt, const unsigned char *scf,
|
|
size_t len, unsigned long flags);
|
|
struct dma_async_tx_descriptor *(*device_prep_dma_pq_val)(
|
|
struct dma_chan *chan, dma_addr_t *pq, dma_addr_t *src,
|
|
unsigned int src_cnt, const unsigned char *scf, size_t len,
|
|
enum sum_check_flags *pqres, unsigned long flags);
|
|
struct dma_async_tx_descriptor *(*device_prep_dma_memset)(
|
|
struct dma_chan *chan, dma_addr_t dest, int value, size_t len,
|
|
unsigned long flags);
|
|
struct dma_async_tx_descriptor *(*device_prep_dma_memset_sg)(
|
|
struct dma_chan *chan, struct scatterlist *sg,
|
|
unsigned int nents, int value, unsigned long flags);
|
|
struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)(
|
|
struct dma_chan *chan, unsigned long flags);
|
|
struct dma_async_tx_descriptor *(*device_prep_dma_sg)(
|
|
struct dma_chan *chan,
|
|
struct scatterlist *dst_sg, unsigned int dst_nents,
|
|
struct scatterlist *src_sg, unsigned int src_nents,
|
|
unsigned long flags);
|
|
|
|
struct dma_async_tx_descriptor *(*device_prep_slave_sg)(
|
|
struct dma_chan *chan, struct scatterlist *sgl,
|
|
unsigned int sg_len, enum dma_transfer_direction direction,
|
|
unsigned long flags, void *context);
|
|
struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)(
|
|
struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
|
|
size_t period_len, enum dma_transfer_direction direction,
|
|
unsigned long flags);
|
|
struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)(
|
|
struct dma_chan *chan, struct dma_interleaved_template *xt,
|
|
unsigned long flags);
|
|
struct dma_async_tx_descriptor *(*device_prep_dma_imm_data)(
|
|
struct dma_chan *chan, dma_addr_t dst, u64 data,
|
|
unsigned long flags);
|
|
|
|
int (*device_config)(struct dma_chan *chan,
|
|
struct dma_slave_config *config);
|
|
int (*device_pause)(struct dma_chan *chan);
|
|
int (*device_resume)(struct dma_chan *chan);
|
|
int (*device_terminate_all)(struct dma_chan *chan);
|
|
|
|
enum dma_status (*device_tx_status)(struct dma_chan *chan,
|
|
dma_cookie_t cookie,
|
|
struct dma_tx_state *txstate);
|
|
void (*device_issue_pending)(struct dma_chan *chan);
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dmaengine_slave_config(struct dma_chan *chan,
|
|
struct dma_slave_config *config)
|
|
{
|
|
if (chan->device->device_config)
|
|
return chan->device->device_config(chan, config);
|
|
|
|
return -38;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_slave_direction(enum dma_transfer_direction direction)
|
|
{
|
|
return (direction == DMA_MEM_TO_DEV) || (direction == DMA_DEV_TO_MEM);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dma_async_tx_descriptor *dmaengine_prep_slave_single(
|
|
struct dma_chan *chan, dma_addr_t buf, size_t len,
|
|
enum dma_transfer_direction dir, unsigned long flags)
|
|
{
|
|
struct scatterlist sg;
|
|
sg_init_table(&sg, 1);
|
|
((&sg)->dma_address) = buf;
|
|
((&sg)->dma_length) = len;
|
|
|
|
return chan->device->device_prep_slave_sg(chan, &sg, 1,
|
|
dir, flags, ((void *)0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dma_async_tx_descriptor *dmaengine_prep_slave_sg(
|
|
struct dma_chan *chan, struct scatterlist *sgl, unsigned int sg_len,
|
|
enum dma_transfer_direction dir, unsigned long flags)
|
|
{
|
|
return chan->device->device_prep_slave_sg(chan, sgl, sg_len,
|
|
dir, flags, ((void *)0));
|
|
}
|
|
# 794 "include/linux/dmaengine.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dma_async_tx_descriptor *dmaengine_prep_dma_cyclic(
|
|
struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
|
|
size_t period_len, enum dma_transfer_direction dir,
|
|
unsigned long flags)
|
|
{
|
|
return chan->device->device_prep_dma_cyclic(chan, buf_addr, buf_len,
|
|
period_len, dir, flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dma_async_tx_descriptor *dmaengine_prep_interleaved_dma(
|
|
struct dma_chan *chan, struct dma_interleaved_template *xt,
|
|
unsigned long flags)
|
|
{
|
|
return chan->device->device_prep_interleaved_dma(chan, xt, flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dma_async_tx_descriptor *dmaengine_prep_dma_memset(
|
|
struct dma_chan *chan, dma_addr_t dest, int value, size_t len,
|
|
unsigned long flags)
|
|
{
|
|
if (!chan || !chan->device)
|
|
return ((void *)0);
|
|
|
|
return chan->device->device_prep_dma_memset(chan, dest, value,
|
|
len, flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dma_async_tx_descriptor *dmaengine_prep_dma_sg(
|
|
struct dma_chan *chan,
|
|
struct scatterlist *dst_sg, unsigned int dst_nents,
|
|
struct scatterlist *src_sg, unsigned int src_nents,
|
|
unsigned long flags)
|
|
{
|
|
return chan->device->device_prep_dma_sg(chan, dst_sg, dst_nents,
|
|
src_sg, src_nents, flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dmaengine_terminate_all(struct dma_chan *chan)
|
|
{
|
|
if (chan->device->device_terminate_all)
|
|
return chan->device->device_terminate_all(chan);
|
|
|
|
return -38;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dmaengine_pause(struct dma_chan *chan)
|
|
{
|
|
if (chan->device->device_pause)
|
|
return chan->device->device_pause(chan);
|
|
|
|
return -38;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dmaengine_resume(struct dma_chan *chan)
|
|
{
|
|
if (chan->device->device_resume)
|
|
return chan->device->device_resume(chan);
|
|
|
|
return -38;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) enum dma_status dmaengine_tx_status(struct dma_chan *chan,
|
|
dma_cookie_t cookie, struct dma_tx_state *state)
|
|
{
|
|
return chan->device->device_tx_status(chan, cookie, state);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) dma_cookie_t dmaengine_submit(struct dma_async_tx_descriptor *desc)
|
|
{
|
|
return desc->tx_submit(desc);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dmaengine_check_align(enum dmaengine_alignment align,
|
|
size_t off1, size_t off2, size_t len)
|
|
{
|
|
size_t mask;
|
|
|
|
if (!align)
|
|
return true;
|
|
mask = (1 << align) - 1;
|
|
if (mask & (off1 | off2 | len))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_dma_copy_aligned(struct dma_device *dev, size_t off1,
|
|
size_t off2, size_t len)
|
|
{
|
|
return dmaengine_check_align(dev->copy_align, off1, off2, len);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_dma_xor_aligned(struct dma_device *dev, size_t off1,
|
|
size_t off2, size_t len)
|
|
{
|
|
return dmaengine_check_align(dev->xor_align, off1, off2, len);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_dma_pq_aligned(struct dma_device *dev, size_t off1,
|
|
size_t off2, size_t len)
|
|
{
|
|
return dmaengine_check_align(dev->pq_align, off1, off2, len);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_dma_fill_aligned(struct dma_device *dev, size_t off1,
|
|
size_t off2, size_t len)
|
|
{
|
|
return dmaengine_check_align(dev->fill_align, off1, off2, len);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
dma_set_maxpq(struct dma_device *dma, int maxpq, int has_pq_continue)
|
|
{
|
|
dma->max_pq = maxpq;
|
|
if (has_pq_continue)
|
|
dma->max_pq |= (1 << 15);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dmaf_continue(enum dma_ctrl_flags flags)
|
|
{
|
|
return (flags & DMA_PREP_CONTINUE) == DMA_PREP_CONTINUE;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dmaf_p_disabled_continue(enum dma_ctrl_flags flags)
|
|
{
|
|
enum dma_ctrl_flags mask = DMA_PREP_CONTINUE | DMA_PREP_PQ_DISABLE_P;
|
|
|
|
return (flags & mask) == mask;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dma_dev_has_pq_continue(struct dma_device *dma)
|
|
{
|
|
return (dma->max_pq & (1 << 15)) == (1 << 15);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned short dma_dev_to_maxpq(struct dma_device *dma)
|
|
{
|
|
return dma->max_pq & ~(1 << 15);
|
|
}
|
|
# 946 "include/linux/dmaengine.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dma_maxpq(struct dma_device *dma, enum dma_ctrl_flags flags)
|
|
{
|
|
if (dma_dev_has_pq_continue(dma) || !dmaf_continue(flags))
|
|
return dma_dev_to_maxpq(dma);
|
|
else if (dmaf_p_disabled_continue(flags))
|
|
return dma_dev_to_maxpq(dma) - 1;
|
|
else if (dmaf_continue(flags))
|
|
return dma_dev_to_maxpq(dma) - 3;
|
|
do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/dmaengine.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "954" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) size_t dmaengine_get_icg(bool inc, bool sgl, size_t icg,
|
|
size_t dir_icg)
|
|
{
|
|
if (inc) {
|
|
if (dir_icg)
|
|
return dir_icg;
|
|
else if (sgl)
|
|
return icg;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) size_t dmaengine_get_dst_icg(struct dma_interleaved_template *xt,
|
|
struct data_chunk *chunk)
|
|
{
|
|
return dmaengine_get_icg(xt->dst_inc, xt->dst_sgl,
|
|
chunk->icg, chunk->dst_icg);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) size_t dmaengine_get_src_icg(struct dma_interleaved_template *xt,
|
|
struct data_chunk *chunk)
|
|
{
|
|
return dmaengine_get_icg(xt->src_inc, xt->src_sgl,
|
|
chunk->icg, chunk->src_icg);
|
|
}
|
|
|
|
|
|
|
|
|
|
void dmaengine_get(void);
|
|
void dmaengine_put(void);
|
|
# 1007 "include/linux/dmaengine.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void async_dmaengine_get(void)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void async_dmaengine_put(void)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dma_chan *
|
|
async_dma_find_channel(enum dma_transaction_type type)
|
|
{
|
|
return ((void *)0);
|
|
}
|
|
|
|
void dma_async_tx_descriptor_init(struct dma_async_tx_descriptor *tx,
|
|
struct dma_chan *chan);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void async_tx_ack(struct dma_async_tx_descriptor *tx)
|
|
{
|
|
tx->flags |= DMA_CTRL_ACK;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void async_tx_clear_ack(struct dma_async_tx_descriptor *tx)
|
|
{
|
|
tx->flags &= ~DMA_CTRL_ACK;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool async_tx_test_ack(struct dma_async_tx_descriptor *tx)
|
|
{
|
|
return (tx->flags & DMA_CTRL_ACK) == DMA_CTRL_ACK;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
__dma_cap_set(enum dma_transaction_type tx_type, dma_cap_mask_t *dstp)
|
|
{
|
|
_set_bit(tx_type,dstp->bits);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
__dma_cap_clear(enum dma_transaction_type tx_type, dma_cap_mask_t *dstp)
|
|
{
|
|
_clear_bit(tx_type,dstp->bits);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __dma_cap_zero(dma_cap_mask_t *dstp)
|
|
{
|
|
bitmap_zero(dstp->bits, DMA_TX_TYPE_END);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
__dma_has_cap(enum dma_transaction_type tx_type, dma_cap_mask_t *srcp)
|
|
{
|
|
return test_bit(tx_type, srcp->bits);
|
|
}
|
|
# 1074 "include/linux/dmaengine.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dma_async_issue_pending(struct dma_chan *chan)
|
|
{
|
|
chan->device->device_issue_pending(chan);
|
|
}
|
|
# 1090 "include/linux/dmaengine.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) enum dma_status dma_async_is_tx_complete(struct dma_chan *chan,
|
|
dma_cookie_t cookie, dma_cookie_t *last, dma_cookie_t *used)
|
|
{
|
|
struct dma_tx_state state;
|
|
enum dma_status status;
|
|
|
|
status = chan->device->device_tx_status(chan, cookie, &state);
|
|
if (last)
|
|
*last = state.last;
|
|
if (used)
|
|
*used = state.used;
|
|
return status;
|
|
}
|
|
# 1113 "include/linux/dmaengine.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) enum dma_status dma_async_is_complete(dma_cookie_t cookie,
|
|
dma_cookie_t last_complete, dma_cookie_t last_used)
|
|
{
|
|
if (last_complete <= last_used) {
|
|
if ((cookie <= last_complete) || (cookie > last_used))
|
|
return DMA_COMPLETE;
|
|
} else {
|
|
if ((cookie <= last_complete) && (cookie > last_used))
|
|
return DMA_COMPLETE;
|
|
}
|
|
return DMA_IN_PROGRESS;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
dma_set_tx_state(struct dma_tx_state *st, dma_cookie_t last, dma_cookie_t used, u32 residue)
|
|
{
|
|
if (st) {
|
|
st->last = last;
|
|
st->used = used;
|
|
st->residue = residue;
|
|
}
|
|
}
|
|
|
|
|
|
struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type);
|
|
enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie);
|
|
enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
|
|
void dma_issue_pending_all(void);
|
|
struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
|
|
dma_filter_fn fn, void *fn_param);
|
|
struct dma_chan *dma_request_slave_channel_reason(struct device *dev,
|
|
const char *name);
|
|
struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name);
|
|
void dma_release_channel(struct dma_chan *chan);
|
|
int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps);
|
|
# 1189 "include/linux/dmaengine.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dmaengine_desc_set_reuse(struct dma_async_tx_descriptor *tx)
|
|
{
|
|
struct dma_slave_caps caps;
|
|
|
|
dma_get_slave_caps(tx->chan, &caps);
|
|
|
|
if (caps.descriptor_reuse) {
|
|
tx->flags |= DMA_CTRL_REUSE;
|
|
return 0;
|
|
} else {
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dmaengine_desc_clear_reuse(struct dma_async_tx_descriptor *tx)
|
|
{
|
|
tx->flags &= ~DMA_CTRL_REUSE;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dmaengine_desc_test_reuse(struct dma_async_tx_descriptor *tx)
|
|
{
|
|
return (tx->flags & DMA_CTRL_REUSE) == DMA_CTRL_REUSE;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dmaengine_desc_free(struct dma_async_tx_descriptor *desc)
|
|
{
|
|
|
|
if (dmaengine_desc_test_reuse(desc))
|
|
return desc->desc_free(desc);
|
|
else
|
|
return -1;
|
|
}
|
|
|
|
|
|
|
|
int dma_async_device_register(struct dma_device *device);
|
|
void dma_async_device_unregister(struct dma_device *device);
|
|
void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
|
|
struct dma_chan *dma_get_slave_channel(struct dma_chan *chan);
|
|
struct dma_chan *dma_get_any_slave_channel(struct dma_device *device);
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dma_chan
|
|
*__dma_request_slave_channel_compat(const dma_cap_mask_t *mask,
|
|
dma_filter_fn fn, void *fn_param,
|
|
struct device *dev, const char *name)
|
|
{
|
|
struct dma_chan *chan;
|
|
|
|
chan = dma_request_slave_channel(dev, name);
|
|
if (chan)
|
|
return chan;
|
|
|
|
if (!fn || !fn_param)
|
|
return ((void *)0);
|
|
|
|
return __dma_request_channel(mask, fn, fn_param);
|
|
}
|
|
# 39 "include/linux/netdevice.h" 2
|
|
|
|
# 1 "include/linux/dynamic_queue_limits.h" 1
|
|
# 40 "include/linux/dynamic_queue_limits.h"
|
|
struct dql {
|
|
|
|
unsigned int num_queued;
|
|
unsigned int adj_limit;
|
|
unsigned int last_obj_cnt;
|
|
|
|
|
|
|
|
unsigned int limit __attribute__((__aligned__((1 << 6))));
|
|
unsigned int num_completed;
|
|
|
|
unsigned int prev_ovlimit;
|
|
unsigned int prev_num_queued;
|
|
unsigned int prev_last_obj_cnt;
|
|
|
|
unsigned int lowest_slack;
|
|
unsigned long slack_start_time;
|
|
|
|
|
|
unsigned int max_limit;
|
|
unsigned int min_limit;
|
|
unsigned int slack_hold_time;
|
|
};
|
|
# 72 "include/linux/dynamic_queue_limits.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dql_queued(struct dql *dql, unsigned int count)
|
|
{
|
|
do { if (__builtin_expect(!!(count > ((~0U) / 16)), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/dynamic_queue_limits.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "74" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
|
|
dql->last_obj_cnt = count;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__asm__ __volatile__("": : :"memory");
|
|
|
|
dql->num_queued += count;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dql_avail(const struct dql *dql)
|
|
{
|
|
return (*({ __attribute__((unused)) typeof(dql->adj_limit) __var = ( typeof(dql->adj_limit)) 0; (volatile typeof(dql->adj_limit) *)&(dql->adj_limit); })) - (*({ __attribute__((unused)) typeof(dql->num_queued) __var = ( typeof(dql->num_queued)) 0; (volatile typeof(dql->num_queued) *)&(dql->num_queued); }));
|
|
}
|
|
|
|
|
|
void dql_completed(struct dql *dql, unsigned int count);
|
|
|
|
|
|
void dql_reset(struct dql *dql);
|
|
|
|
|
|
int dql_init(struct dql *dql, unsigned hold_time);
|
|
# 41 "include/linux/netdevice.h" 2
|
|
|
|
# 1 "include/linux/ethtool.h" 1
|
|
# 15 "include/linux/ethtool.h"
|
|
# 1 "include/linux/compat.h" 1
|
|
# 16 "include/linux/ethtool.h" 2
|
|
# 1 "include/uapi/linux/ethtool.h" 1
|
|
# 17 "include/uapi/linux/ethtool.h"
|
|
# 1 "include/linux/if_ether.h" 1
|
|
# 26 "include/linux/if_ether.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct ethhdr *eth_hdr(const struct sk_buff *skb)
|
|
{
|
|
return (struct ethhdr *)skb_mac_header(skb);
|
|
}
|
|
|
|
int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr);
|
|
|
|
extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len);
|
|
# 18 "include/uapi/linux/ethtool.h" 2
|
|
# 93 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_cmd {
|
|
__u32 cmd;
|
|
__u32 supported;
|
|
__u32 advertising;
|
|
__u16 speed;
|
|
__u8 duplex;
|
|
__u8 port;
|
|
__u8 phy_address;
|
|
__u8 transceiver;
|
|
__u8 autoneg;
|
|
__u8 mdio_support;
|
|
__u32 maxtxpkt;
|
|
__u32 maxrxpkt;
|
|
__u16 speed_hi;
|
|
__u8 eth_tp_mdix;
|
|
__u8 eth_tp_mdix_ctrl;
|
|
__u32 lp_advertising;
|
|
__u32 reserved[2];
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
|
|
__u32 speed)
|
|
{
|
|
|
|
ep->speed = (__u16)speed;
|
|
ep->speed_hi = (__u16)(speed >> 16);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
|
|
{
|
|
return (ep->speed_hi << 16) | ep->speed;
|
|
}
|
|
# 175 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_drvinfo {
|
|
__u32 cmd;
|
|
char driver[32];
|
|
char version[32];
|
|
char fw_version[32];
|
|
char bus_info[32];
|
|
char erom_version[32];
|
|
char reserved2[12];
|
|
__u32 n_priv_flags;
|
|
__u32 n_stats;
|
|
__u32 testinfo_len;
|
|
__u32 eedump_len;
|
|
__u32 regdump_len;
|
|
};
|
|
# 201 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_wolinfo {
|
|
__u32 cmd;
|
|
__u32 supported;
|
|
__u32 wolopts;
|
|
__u8 sopass[6];
|
|
};
|
|
|
|
|
|
struct ethtool_value {
|
|
__u32 cmd;
|
|
__u32 data;
|
|
};
|
|
|
|
enum tunable_id {
|
|
ETHTOOL_ID_UNSPEC,
|
|
ETHTOOL_RX_COPYBREAK,
|
|
ETHTOOL_TX_COPYBREAK,
|
|
|
|
|
|
|
|
|
|
__ETHTOOL_TUNABLE_COUNT,
|
|
};
|
|
|
|
enum tunable_type_id {
|
|
ETHTOOL_TUNABLE_UNSPEC,
|
|
ETHTOOL_TUNABLE_U8,
|
|
ETHTOOL_TUNABLE_U16,
|
|
ETHTOOL_TUNABLE_U32,
|
|
ETHTOOL_TUNABLE_U64,
|
|
ETHTOOL_TUNABLE_STRING,
|
|
ETHTOOL_TUNABLE_S8,
|
|
ETHTOOL_TUNABLE_S16,
|
|
ETHTOOL_TUNABLE_S32,
|
|
ETHTOOL_TUNABLE_S64,
|
|
};
|
|
|
|
struct ethtool_tunable {
|
|
__u32 cmd;
|
|
__u32 id;
|
|
__u32 type_id;
|
|
__u32 len;
|
|
void *data[0];
|
|
};
|
|
# 261 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_regs {
|
|
__u32 cmd;
|
|
__u32 version;
|
|
__u32 len;
|
|
__u8 data[0];
|
|
};
|
|
# 286 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_eeprom {
|
|
__u32 cmd;
|
|
__u32 magic;
|
|
__u32 offset;
|
|
__u32 len;
|
|
__u8 data[0];
|
|
};
|
|
# 311 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_eee {
|
|
__u32 cmd;
|
|
__u32 supported;
|
|
__u32 advertised;
|
|
__u32 lp_advertised;
|
|
__u32 eee_active;
|
|
__u32 eee_enabled;
|
|
__u32 tx_lpi_enabled;
|
|
__u32 tx_lpi_timer;
|
|
__u32 reserved[2];
|
|
};
|
|
# 333 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_modinfo {
|
|
__u32 cmd;
|
|
__u32 type;
|
|
__u32 eeprom_len;
|
|
__u32 reserved[8];
|
|
};
|
|
# 413 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_coalesce {
|
|
__u32 cmd;
|
|
__u32 rx_coalesce_usecs;
|
|
__u32 rx_max_coalesced_frames;
|
|
__u32 rx_coalesce_usecs_irq;
|
|
__u32 rx_max_coalesced_frames_irq;
|
|
__u32 tx_coalesce_usecs;
|
|
__u32 tx_max_coalesced_frames;
|
|
__u32 tx_coalesce_usecs_irq;
|
|
__u32 tx_max_coalesced_frames_irq;
|
|
__u32 stats_block_coalesce_usecs;
|
|
__u32 use_adaptive_rx_coalesce;
|
|
__u32 use_adaptive_tx_coalesce;
|
|
__u32 pkt_rate_low;
|
|
__u32 rx_coalesce_usecs_low;
|
|
__u32 rx_max_coalesced_frames_low;
|
|
__u32 tx_coalesce_usecs_low;
|
|
__u32 tx_max_coalesced_frames_low;
|
|
__u32 pkt_rate_high;
|
|
__u32 rx_coalesce_usecs_high;
|
|
__u32 rx_max_coalesced_frames_high;
|
|
__u32 tx_coalesce_usecs_high;
|
|
__u32 tx_max_coalesced_frames_high;
|
|
__u32 rate_sample_interval;
|
|
};
|
|
# 464 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_ringparam {
|
|
__u32 cmd;
|
|
__u32 rx_max_pending;
|
|
__u32 rx_mini_max_pending;
|
|
__u32 rx_jumbo_max_pending;
|
|
__u32 tx_max_pending;
|
|
__u32 rx_pending;
|
|
__u32 rx_mini_pending;
|
|
__u32 rx_jumbo_pending;
|
|
__u32 tx_pending;
|
|
};
|
|
# 492 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_channels {
|
|
__u32 cmd;
|
|
__u32 max_rx;
|
|
__u32 max_tx;
|
|
__u32 max_other;
|
|
__u32 max_combined;
|
|
__u32 rx_count;
|
|
__u32 tx_count;
|
|
__u32 other_count;
|
|
__u32 combined_count;
|
|
};
|
|
# 526 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_pauseparam {
|
|
__u32 cmd;
|
|
__u32 autoneg;
|
|
__u32 rx_pause;
|
|
__u32 tx_pause;
|
|
};
|
|
# 546 "include/uapi/linux/ethtool.h"
|
|
enum ethtool_stringset {
|
|
ETH_SS_TEST = 0,
|
|
ETH_SS_STATS,
|
|
ETH_SS_PRIV_FLAGS,
|
|
ETH_SS_NTUPLE_FILTERS,
|
|
ETH_SS_FEATURES,
|
|
ETH_SS_RSS_HASH_FUNCS,
|
|
ETH_SS_TUNABLES,
|
|
};
|
|
# 568 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_gstrings {
|
|
__u32 cmd;
|
|
__u32 string_set;
|
|
__u32 len;
|
|
__u8 data[0];
|
|
};
|
|
# 592 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_sset_info {
|
|
__u32 cmd;
|
|
__u32 reserved;
|
|
__u64 sset_mask;
|
|
__u32 data[0];
|
|
};
|
|
# 609 "include/uapi/linux/ethtool.h"
|
|
enum ethtool_test_flags {
|
|
ETH_TEST_FL_OFFLINE = (1 << 0),
|
|
ETH_TEST_FL_FAILED = (1 << 1),
|
|
ETH_TEST_FL_EXTERNAL_LB = (1 << 2),
|
|
ETH_TEST_FL_EXTERNAL_LB_DONE = (1 << 3),
|
|
};
|
|
# 630 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_test {
|
|
__u32 cmd;
|
|
__u32 flags;
|
|
__u32 reserved;
|
|
__u32 len;
|
|
__u64 data[0];
|
|
};
|
|
# 649 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_stats {
|
|
__u32 cmd;
|
|
__u32 n_stats;
|
|
__u64 data[0];
|
|
};
|
|
# 666 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_perm_addr {
|
|
__u32 cmd;
|
|
__u32 size;
|
|
__u8 data[0];
|
|
};
|
|
# 681 "include/uapi/linux/ethtool.h"
|
|
enum ethtool_flags {
|
|
ETH_FLAG_TXVLAN = (1 << 7),
|
|
ETH_FLAG_RXVLAN = (1 << 8),
|
|
ETH_FLAG_LRO = (1 << 15),
|
|
ETH_FLAG_NTUPLE = (1 << 27),
|
|
ETH_FLAG_RXHASH = (1 << 28),
|
|
};
|
|
# 705 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_tcpip4_spec {
|
|
__be32 ip4src;
|
|
__be32 ip4dst;
|
|
__be16 psrc;
|
|
__be16 pdst;
|
|
__u8 tos;
|
|
};
|
|
# 722 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_ah_espip4_spec {
|
|
__be32 ip4src;
|
|
__be32 ip4dst;
|
|
__be32 spi;
|
|
__u8 tos;
|
|
};
|
|
# 740 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_usrip4_spec {
|
|
__be32 ip4src;
|
|
__be32 ip4dst;
|
|
__be32 l4_4_bytes;
|
|
__u8 tos;
|
|
__u8 ip_ver;
|
|
__u8 proto;
|
|
};
|
|
|
|
union ethtool_flow_union {
|
|
struct ethtool_tcpip4_spec tcp_ip4_spec;
|
|
struct ethtool_tcpip4_spec udp_ip4_spec;
|
|
struct ethtool_tcpip4_spec sctp_ip4_spec;
|
|
struct ethtool_ah_espip4_spec ah_ip4_spec;
|
|
struct ethtool_ah_espip4_spec esp_ip4_spec;
|
|
struct ethtool_usrip4_spec usr_ip4_spec;
|
|
struct ethhdr ether_spec;
|
|
__u8 hdata[52];
|
|
};
|
|
# 771 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_flow_ext {
|
|
__u8 padding[2];
|
|
unsigned char h_dest[6];
|
|
__be16 vlan_etype;
|
|
__be16 vlan_tci;
|
|
__be32 data[2];
|
|
};
|
|
# 795 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_rx_flow_spec {
|
|
__u32 flow_type;
|
|
union ethtool_flow_union h_u;
|
|
struct ethtool_flow_ext h_ext;
|
|
union ethtool_flow_union m_u;
|
|
struct ethtool_flow_ext m_ext;
|
|
__u64 ring_cookie;
|
|
__u32 location;
|
|
};
|
|
# 819 "include/uapi/linux/ethtool.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u64 ethtool_get_flow_spec_ring(__u64 ring_cookie)
|
|
{
|
|
return 0x00000000FFFFFFFFLL & ring_cookie;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u64 ethtool_get_flow_spec_ring_vf(__u64 ring_cookie)
|
|
{
|
|
return (0x000000FF00000000LL & ring_cookie) >>
|
|
32;
|
|
};
|
|
# 882 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_rxnfc {
|
|
__u32 cmd;
|
|
__u32 flow_type;
|
|
__u64 data;
|
|
struct ethtool_rx_flow_spec fs;
|
|
__u32 rule_cnt;
|
|
__u32 rule_locs[0];
|
|
};
|
|
# 905 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_rxfh_indir {
|
|
__u32 cmd;
|
|
__u32 size;
|
|
__u32 ring_index[0];
|
|
};
|
|
# 935 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_rxfh {
|
|
__u32 cmd;
|
|
__u32 rss_context;
|
|
__u32 indir_size;
|
|
__u32 key_size;
|
|
__u8 hfunc;
|
|
__u8 rsvd8[3];
|
|
__u32 rsvd32;
|
|
__u32 rss_config[0];
|
|
};
|
|
# 963 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_rx_ntuple_flow_spec {
|
|
__u32 flow_type;
|
|
union {
|
|
struct ethtool_tcpip4_spec tcp_ip4_spec;
|
|
struct ethtool_tcpip4_spec udp_ip4_spec;
|
|
struct ethtool_tcpip4_spec sctp_ip4_spec;
|
|
struct ethtool_ah_espip4_spec ah_ip4_spec;
|
|
struct ethtool_ah_espip4_spec esp_ip4_spec;
|
|
struct ethtool_usrip4_spec usr_ip4_spec;
|
|
struct ethhdr ether_spec;
|
|
__u8 hdata[72];
|
|
} h_u, m_u;
|
|
|
|
__u16 vlan_tag;
|
|
__u16 vlan_tag_mask;
|
|
__u64 data;
|
|
__u64 data_mask;
|
|
|
|
__s32 action;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct ethtool_rx_ntuple {
|
|
__u32 cmd;
|
|
struct ethtool_rx_ntuple_flow_spec fs;
|
|
};
|
|
|
|
|
|
enum ethtool_flash_op_type {
|
|
ETHTOOL_FLASH_ALL_REGIONS = 0,
|
|
};
|
|
|
|
|
|
struct ethtool_flash {
|
|
__u32 cmd;
|
|
__u32 region;
|
|
char data[128];
|
|
};
|
|
# 1022 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_dump {
|
|
__u32 cmd;
|
|
__u32 version;
|
|
__u32 flag;
|
|
__u32 len;
|
|
__u8 data[0];
|
|
};
|
|
# 1041 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_get_features_block {
|
|
__u32 available;
|
|
__u32 requested;
|
|
__u32 active;
|
|
__u32 never_changed;
|
|
};
|
|
# 1056 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_gfeatures {
|
|
__u32 cmd;
|
|
__u32 size;
|
|
struct ethtool_get_features_block features[0];
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct ethtool_set_features_block {
|
|
__u32 valid;
|
|
__u32 requested;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct ethtool_sfeatures {
|
|
__u32 cmd;
|
|
__u32 size;
|
|
struct ethtool_set_features_block features[0];
|
|
};
|
|
# 1102 "include/uapi/linux/ethtool.h"
|
|
struct ethtool_ts_info {
|
|
__u32 cmd;
|
|
__u32 so_timestamping;
|
|
__s32 phc_index;
|
|
__u32 tx_types;
|
|
__u32 tx_reserved[3];
|
|
__u32 rx_filters;
|
|
__u32 rx_reserved[3];
|
|
};
|
|
# 1137 "include/uapi/linux/ethtool.h"
|
|
enum ethtool_sfeatures_retval_bits {
|
|
ETHTOOL_F_UNSUPPORTED__BIT,
|
|
ETHTOOL_F_WISH__BIT,
|
|
ETHTOOL_F_COMPAT__BIT,
|
|
};
|
|
# 1418 "include/uapi/linux/ethtool.h"
|
|
enum ethtool_reset_flags {
|
|
|
|
|
|
|
|
|
|
|
|
ETH_RESET_MGMT = 1 << 0,
|
|
ETH_RESET_IRQ = 1 << 1,
|
|
ETH_RESET_DMA = 1 << 2,
|
|
ETH_RESET_FILTER = 1 << 3,
|
|
ETH_RESET_OFFLOAD = 1 << 4,
|
|
ETH_RESET_MAC = 1 << 5,
|
|
ETH_RESET_PHY = 1 << 6,
|
|
ETH_RESET_RAM = 1 << 7,
|
|
|
|
|
|
ETH_RESET_DEDICATED = 0x0000ffff,
|
|
|
|
ETH_RESET_ALL = 0xffffffff,
|
|
|
|
};
|
|
# 17 "include/linux/ethtool.h" 2
|
|
# 43 "include/linux/ethtool.h"
|
|
extern int __ethtool_get_settings(struct net_device *dev,
|
|
struct ethtool_cmd *cmd);
|
|
# 55 "include/linux/ethtool.h"
|
|
enum ethtool_phys_id_state {
|
|
ETHTOOL_ID_INACTIVE,
|
|
ETHTOOL_ID_ACTIVE,
|
|
ETHTOOL_ID_ON,
|
|
ETHTOOL_ID_OFF
|
|
};
|
|
|
|
enum {
|
|
ETH_RSS_HASH_TOP_BIT,
|
|
ETH_RSS_HASH_XOR_BIT,
|
|
|
|
|
|
|
|
|
|
|
|
ETH_RSS_HASH_FUNCS_COUNT
|
|
};
|
|
# 82 "include/linux/ethtool.h"
|
|
struct net_device;
|
|
|
|
|
|
u32 ethtool_op_get_link(struct net_device *dev);
|
|
int ethtool_op_get_ts_info(struct net_device *dev, struct ethtool_ts_info *eti);
|
|
# 95 "include/linux/ethtool.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
|
|
{
|
|
return index % n_rx_rings;
|
|
}
|
|
# 217 "include/linux/ethtool.h"
|
|
struct ethtool_ops {
|
|
int (*get_settings)(struct net_device *, struct ethtool_cmd *);
|
|
int (*set_settings)(struct net_device *, struct ethtool_cmd *);
|
|
void (*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *);
|
|
int (*get_regs_len)(struct net_device *);
|
|
void (*get_regs)(struct net_device *, struct ethtool_regs *, void *);
|
|
void (*get_wol)(struct net_device *, struct ethtool_wolinfo *);
|
|
int (*set_wol)(struct net_device *, struct ethtool_wolinfo *);
|
|
u32 (*get_msglevel)(struct net_device *);
|
|
void (*set_msglevel)(struct net_device *, u32);
|
|
int (*nway_reset)(struct net_device *);
|
|
u32 (*get_link)(struct net_device *);
|
|
int (*get_eeprom_len)(struct net_device *);
|
|
int (*get_eeprom)(struct net_device *,
|
|
struct ethtool_eeprom *, u8 *);
|
|
int (*set_eeprom)(struct net_device *,
|
|
struct ethtool_eeprom *, u8 *);
|
|
int (*get_coalesce)(struct net_device *, struct ethtool_coalesce *);
|
|
int (*set_coalesce)(struct net_device *, struct ethtool_coalesce *);
|
|
void (*get_ringparam)(struct net_device *,
|
|
struct ethtool_ringparam *);
|
|
int (*set_ringparam)(struct net_device *,
|
|
struct ethtool_ringparam *);
|
|
void (*get_pauseparam)(struct net_device *,
|
|
struct ethtool_pauseparam*);
|
|
int (*set_pauseparam)(struct net_device *,
|
|
struct ethtool_pauseparam*);
|
|
void (*self_test)(struct net_device *, struct ethtool_test *, u64 *);
|
|
void (*get_strings)(struct net_device *, u32 stringset, u8 *);
|
|
int (*set_phys_id)(struct net_device *, enum ethtool_phys_id_state);
|
|
void (*get_ethtool_stats)(struct net_device *,
|
|
struct ethtool_stats *, u64 *);
|
|
int (*begin)(struct net_device *);
|
|
void (*complete)(struct net_device *);
|
|
u32 (*get_priv_flags)(struct net_device *);
|
|
int (*set_priv_flags)(struct net_device *, u32);
|
|
int (*get_sset_count)(struct net_device *, int);
|
|
int (*get_rxnfc)(struct net_device *,
|
|
struct ethtool_rxnfc *, u32 *rule_locs);
|
|
int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);
|
|
int (*flash_device)(struct net_device *, struct ethtool_flash *);
|
|
int (*reset)(struct net_device *, u32 *);
|
|
u32 (*get_rxfh_key_size)(struct net_device *);
|
|
u32 (*get_rxfh_indir_size)(struct net_device *);
|
|
int (*get_rxfh)(struct net_device *, u32 *indir, u8 *key,
|
|
u8 *hfunc);
|
|
int (*set_rxfh)(struct net_device *, const u32 *indir,
|
|
const u8 *key, const u8 hfunc);
|
|
void (*get_channels)(struct net_device *, struct ethtool_channels *);
|
|
int (*set_channels)(struct net_device *, struct ethtool_channels *);
|
|
int (*get_dump_flag)(struct net_device *, struct ethtool_dump *);
|
|
int (*get_dump_data)(struct net_device *,
|
|
struct ethtool_dump *, void *);
|
|
int (*set_dump)(struct net_device *, struct ethtool_dump *);
|
|
int (*get_ts_info)(struct net_device *, struct ethtool_ts_info *);
|
|
int (*get_module_info)(struct net_device *,
|
|
struct ethtool_modinfo *);
|
|
int (*get_module_eeprom)(struct net_device *,
|
|
struct ethtool_eeprom *, u8 *);
|
|
int (*get_eee)(struct net_device *, struct ethtool_eee *);
|
|
int (*set_eee)(struct net_device *, struct ethtool_eee *);
|
|
int (*get_tunable)(struct net_device *,
|
|
const struct ethtool_tunable *, void *);
|
|
int (*set_tunable)(struct net_device *,
|
|
const struct ethtool_tunable *, const void *);
|
|
|
|
|
|
};
|
|
# 43 "include/linux/netdevice.h" 2
|
|
# 1 "include/net/net_namespace.h" 1
|
|
# 13 "include/net/net_namespace.h"
|
|
# 1 "include/net/netns/core.h" 1
|
|
|
|
|
|
|
|
struct ctl_table_header;
|
|
struct prot_inuse;
|
|
|
|
struct netns_core {
|
|
|
|
struct ctl_table_header *sysctl_hdr;
|
|
|
|
int sysctl_somaxconn;
|
|
|
|
struct prot_inuse *inuse;
|
|
};
|
|
# 14 "include/net/net_namespace.h" 2
|
|
# 1 "include/net/netns/mib.h" 1
|
|
|
|
|
|
|
|
# 1 "include/net/snmp.h" 1
|
|
# 23 "include/net/snmp.h"
|
|
# 1 "./include/uapi/linux/snmp.h" 1
|
|
# 18 "./include/uapi/linux/snmp.h"
|
|
enum
|
|
{
|
|
IPSTATS_MIB_NUM = 0,
|
|
|
|
IPSTATS_MIB_INPKTS,
|
|
IPSTATS_MIB_INOCTETS,
|
|
IPSTATS_MIB_INDELIVERS,
|
|
IPSTATS_MIB_OUTFORWDATAGRAMS,
|
|
IPSTATS_MIB_OUTPKTS,
|
|
IPSTATS_MIB_OUTOCTETS,
|
|
|
|
IPSTATS_MIB_INHDRERRORS,
|
|
IPSTATS_MIB_INTOOBIGERRORS,
|
|
IPSTATS_MIB_INNOROUTES,
|
|
IPSTATS_MIB_INADDRERRORS,
|
|
IPSTATS_MIB_INUNKNOWNPROTOS,
|
|
IPSTATS_MIB_INTRUNCATEDPKTS,
|
|
IPSTATS_MIB_INDISCARDS,
|
|
IPSTATS_MIB_OUTDISCARDS,
|
|
IPSTATS_MIB_OUTNOROUTES,
|
|
IPSTATS_MIB_REASMTIMEOUT,
|
|
IPSTATS_MIB_REASMREQDS,
|
|
IPSTATS_MIB_REASMOKS,
|
|
IPSTATS_MIB_REASMFAILS,
|
|
IPSTATS_MIB_FRAGOKS,
|
|
IPSTATS_MIB_FRAGFAILS,
|
|
IPSTATS_MIB_FRAGCREATES,
|
|
IPSTATS_MIB_INMCASTPKTS,
|
|
IPSTATS_MIB_OUTMCASTPKTS,
|
|
IPSTATS_MIB_INBCASTPKTS,
|
|
IPSTATS_MIB_OUTBCASTPKTS,
|
|
IPSTATS_MIB_INMCASTOCTETS,
|
|
IPSTATS_MIB_OUTMCASTOCTETS,
|
|
IPSTATS_MIB_INBCASTOCTETS,
|
|
IPSTATS_MIB_OUTBCASTOCTETS,
|
|
IPSTATS_MIB_CSUMERRORS,
|
|
IPSTATS_MIB_NOECTPKTS,
|
|
IPSTATS_MIB_ECT1PKTS,
|
|
IPSTATS_MIB_ECT0PKTS,
|
|
IPSTATS_MIB_CEPKTS,
|
|
__IPSTATS_MIB_MAX
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum
|
|
{
|
|
ICMP_MIB_NUM = 0,
|
|
ICMP_MIB_INMSGS,
|
|
ICMP_MIB_INERRORS,
|
|
ICMP_MIB_INDESTUNREACHS,
|
|
ICMP_MIB_INTIMEEXCDS,
|
|
ICMP_MIB_INPARMPROBS,
|
|
ICMP_MIB_INSRCQUENCHS,
|
|
ICMP_MIB_INREDIRECTS,
|
|
ICMP_MIB_INECHOS,
|
|
ICMP_MIB_INECHOREPS,
|
|
ICMP_MIB_INTIMESTAMPS,
|
|
ICMP_MIB_INTIMESTAMPREPS,
|
|
ICMP_MIB_INADDRMASKS,
|
|
ICMP_MIB_INADDRMASKREPS,
|
|
ICMP_MIB_OUTMSGS,
|
|
ICMP_MIB_OUTERRORS,
|
|
ICMP_MIB_OUTDESTUNREACHS,
|
|
ICMP_MIB_OUTTIMEEXCDS,
|
|
ICMP_MIB_OUTPARMPROBS,
|
|
ICMP_MIB_OUTSRCQUENCHS,
|
|
ICMP_MIB_OUTREDIRECTS,
|
|
ICMP_MIB_OUTECHOS,
|
|
ICMP_MIB_OUTECHOREPS,
|
|
ICMP_MIB_OUTTIMESTAMPS,
|
|
ICMP_MIB_OUTTIMESTAMPREPS,
|
|
ICMP_MIB_OUTADDRMASKS,
|
|
ICMP_MIB_OUTADDRMASKREPS,
|
|
ICMP_MIB_CSUMERRORS,
|
|
__ICMP_MIB_MAX
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum
|
|
{
|
|
ICMP6_MIB_NUM = 0,
|
|
ICMP6_MIB_INMSGS,
|
|
ICMP6_MIB_INERRORS,
|
|
ICMP6_MIB_OUTMSGS,
|
|
ICMP6_MIB_OUTERRORS,
|
|
ICMP6_MIB_CSUMERRORS,
|
|
__ICMP6_MIB_MAX
|
|
};
|
|
# 123 "./include/uapi/linux/snmp.h"
|
|
enum
|
|
{
|
|
TCP_MIB_NUM = 0,
|
|
TCP_MIB_RTOALGORITHM,
|
|
TCP_MIB_RTOMIN,
|
|
TCP_MIB_RTOMAX,
|
|
TCP_MIB_MAXCONN,
|
|
TCP_MIB_ACTIVEOPENS,
|
|
TCP_MIB_PASSIVEOPENS,
|
|
TCP_MIB_ATTEMPTFAILS,
|
|
TCP_MIB_ESTABRESETS,
|
|
TCP_MIB_CURRESTAB,
|
|
TCP_MIB_INSEGS,
|
|
TCP_MIB_OUTSEGS,
|
|
TCP_MIB_RETRANSSEGS,
|
|
TCP_MIB_INERRS,
|
|
TCP_MIB_OUTRSTS,
|
|
TCP_MIB_CSUMERRORS,
|
|
__TCP_MIB_MAX
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum
|
|
{
|
|
UDP_MIB_NUM = 0,
|
|
UDP_MIB_INDATAGRAMS,
|
|
UDP_MIB_NOPORTS,
|
|
UDP_MIB_INERRORS,
|
|
UDP_MIB_OUTDATAGRAMS,
|
|
UDP_MIB_RCVBUFERRORS,
|
|
UDP_MIB_SNDBUFERRORS,
|
|
UDP_MIB_CSUMERRORS,
|
|
UDP_MIB_IGNOREDMULTI,
|
|
__UDP_MIB_MAX
|
|
};
|
|
|
|
|
|
enum
|
|
{
|
|
LINUX_MIB_NUM = 0,
|
|
LINUX_MIB_SYNCOOKIESSENT,
|
|
LINUX_MIB_SYNCOOKIESRECV,
|
|
LINUX_MIB_SYNCOOKIESFAILED,
|
|
LINUX_MIB_EMBRYONICRSTS,
|
|
LINUX_MIB_PRUNECALLED,
|
|
LINUX_MIB_RCVPRUNED,
|
|
LINUX_MIB_OFOPRUNED,
|
|
LINUX_MIB_OUTOFWINDOWICMPS,
|
|
LINUX_MIB_LOCKDROPPEDICMPS,
|
|
LINUX_MIB_ARPFILTER,
|
|
LINUX_MIB_TIMEWAITED,
|
|
LINUX_MIB_TIMEWAITRECYCLED,
|
|
LINUX_MIB_TIMEWAITKILLED,
|
|
LINUX_MIB_PAWSPASSIVEREJECTED,
|
|
LINUX_MIB_PAWSACTIVEREJECTED,
|
|
LINUX_MIB_PAWSESTABREJECTED,
|
|
LINUX_MIB_DELAYEDACKS,
|
|
LINUX_MIB_DELAYEDACKLOCKED,
|
|
LINUX_MIB_DELAYEDACKLOST,
|
|
LINUX_MIB_LISTENOVERFLOWS,
|
|
LINUX_MIB_LISTENDROPS,
|
|
LINUX_MIB_TCPPREQUEUED,
|
|
LINUX_MIB_TCPDIRECTCOPYFROMBACKLOG,
|
|
LINUX_MIB_TCPDIRECTCOPYFROMPREQUEUE,
|
|
LINUX_MIB_TCPPREQUEUEDROPPED,
|
|
LINUX_MIB_TCPHPHITS,
|
|
LINUX_MIB_TCPHPHITSTOUSER,
|
|
LINUX_MIB_TCPPUREACKS,
|
|
LINUX_MIB_TCPHPACKS,
|
|
LINUX_MIB_TCPRENORECOVERY,
|
|
LINUX_MIB_TCPSACKRECOVERY,
|
|
LINUX_MIB_TCPSACKRENEGING,
|
|
LINUX_MIB_TCPFACKREORDER,
|
|
LINUX_MIB_TCPSACKREORDER,
|
|
LINUX_MIB_TCPRENOREORDER,
|
|
LINUX_MIB_TCPTSREORDER,
|
|
LINUX_MIB_TCPFULLUNDO,
|
|
LINUX_MIB_TCPPARTIALUNDO,
|
|
LINUX_MIB_TCPDSACKUNDO,
|
|
LINUX_MIB_TCPLOSSUNDO,
|
|
LINUX_MIB_TCPLOSTRETRANSMIT,
|
|
LINUX_MIB_TCPRENOFAILURES,
|
|
LINUX_MIB_TCPSACKFAILURES,
|
|
LINUX_MIB_TCPLOSSFAILURES,
|
|
LINUX_MIB_TCPFASTRETRANS,
|
|
LINUX_MIB_TCPFORWARDRETRANS,
|
|
LINUX_MIB_TCPSLOWSTARTRETRANS,
|
|
LINUX_MIB_TCPTIMEOUTS,
|
|
LINUX_MIB_TCPLOSSPROBES,
|
|
LINUX_MIB_TCPLOSSPROBERECOVERY,
|
|
LINUX_MIB_TCPRENORECOVERYFAIL,
|
|
LINUX_MIB_TCPSACKRECOVERYFAIL,
|
|
LINUX_MIB_TCPSCHEDULERFAILED,
|
|
LINUX_MIB_TCPRCVCOLLAPSED,
|
|
LINUX_MIB_TCPDSACKOLDSENT,
|
|
LINUX_MIB_TCPDSACKOFOSENT,
|
|
LINUX_MIB_TCPDSACKRECV,
|
|
LINUX_MIB_TCPDSACKOFORECV,
|
|
LINUX_MIB_TCPABORTONDATA,
|
|
LINUX_MIB_TCPABORTONCLOSE,
|
|
LINUX_MIB_TCPABORTONMEMORY,
|
|
LINUX_MIB_TCPABORTONTIMEOUT,
|
|
LINUX_MIB_TCPABORTONLINGER,
|
|
LINUX_MIB_TCPABORTFAILED,
|
|
LINUX_MIB_TCPMEMORYPRESSURES,
|
|
LINUX_MIB_TCPSACKDISCARD,
|
|
LINUX_MIB_TCPDSACKIGNOREDOLD,
|
|
LINUX_MIB_TCPDSACKIGNOREDNOUNDO,
|
|
LINUX_MIB_TCPSPURIOUSRTOS,
|
|
LINUX_MIB_TCPMD5NOTFOUND,
|
|
LINUX_MIB_TCPMD5UNEXPECTED,
|
|
LINUX_MIB_SACKSHIFTED,
|
|
LINUX_MIB_SACKMERGED,
|
|
LINUX_MIB_SACKSHIFTFALLBACK,
|
|
LINUX_MIB_TCPBACKLOGDROP,
|
|
LINUX_MIB_TCPMINTTLDROP,
|
|
LINUX_MIB_TCPDEFERACCEPTDROP,
|
|
LINUX_MIB_IPRPFILTER,
|
|
LINUX_MIB_TCPTIMEWAITOVERFLOW,
|
|
LINUX_MIB_TCPREQQFULLDOCOOKIES,
|
|
LINUX_MIB_TCPREQQFULLDROP,
|
|
LINUX_MIB_TCPRETRANSFAIL,
|
|
LINUX_MIB_TCPRCVCOALESCE,
|
|
LINUX_MIB_TCPOFOQUEUE,
|
|
LINUX_MIB_TCPOFODROP,
|
|
LINUX_MIB_TCPOFOMERGE,
|
|
LINUX_MIB_TCPCHALLENGEACK,
|
|
LINUX_MIB_TCPSYNCHALLENGE,
|
|
LINUX_MIB_TCPFASTOPENACTIVE,
|
|
LINUX_MIB_TCPFASTOPENACTIVEFAIL,
|
|
LINUX_MIB_TCPFASTOPENPASSIVE,
|
|
LINUX_MIB_TCPFASTOPENPASSIVEFAIL,
|
|
LINUX_MIB_TCPFASTOPENLISTENOVERFLOW,
|
|
LINUX_MIB_TCPFASTOPENCOOKIEREQD,
|
|
LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES,
|
|
LINUX_MIB_BUSYPOLLRXPACKETS,
|
|
LINUX_MIB_TCPAUTOCORKING,
|
|
LINUX_MIB_TCPFROMZEROWINDOWADV,
|
|
LINUX_MIB_TCPTOZEROWINDOWADV,
|
|
LINUX_MIB_TCPWANTZEROWINDOWADV,
|
|
LINUX_MIB_TCPSYNRETRANS,
|
|
LINUX_MIB_TCPORIGDATASENT,
|
|
LINUX_MIB_TCPHYSTARTTRAINDETECT,
|
|
LINUX_MIB_TCPHYSTARTTRAINCWND,
|
|
LINUX_MIB_TCPHYSTARTDELAYDETECT,
|
|
LINUX_MIB_TCPHYSTARTDELAYCWND,
|
|
LINUX_MIB_TCPACKSKIPPEDSYNRECV,
|
|
LINUX_MIB_TCPACKSKIPPEDPAWS,
|
|
LINUX_MIB_TCPACKSKIPPEDSEQ,
|
|
LINUX_MIB_TCPACKSKIPPEDFINWAIT2,
|
|
LINUX_MIB_TCPACKSKIPPEDTIMEWAIT,
|
|
LINUX_MIB_TCPACKSKIPPEDCHALLENGE,
|
|
LINUX_MIB_TCPWINPROBE,
|
|
LINUX_MIB_TCPKEEPALIVE,
|
|
LINUX_MIB_TCPMTUPFAIL,
|
|
LINUX_MIB_TCPMTUPSUCCESS,
|
|
__LINUX_MIB_MAX
|
|
};
|
|
|
|
|
|
enum
|
|
{
|
|
LINUX_MIB_XFRMNUM = 0,
|
|
LINUX_MIB_XFRMINERROR,
|
|
LINUX_MIB_XFRMINBUFFERERROR,
|
|
LINUX_MIB_XFRMINHDRERROR,
|
|
LINUX_MIB_XFRMINNOSTATES,
|
|
LINUX_MIB_XFRMINSTATEPROTOERROR,
|
|
LINUX_MIB_XFRMINSTATEMODEERROR,
|
|
LINUX_MIB_XFRMINSTATESEQERROR,
|
|
LINUX_MIB_XFRMINSTATEEXPIRED,
|
|
LINUX_MIB_XFRMINSTATEMISMATCH,
|
|
LINUX_MIB_XFRMINSTATEINVALID,
|
|
LINUX_MIB_XFRMINTMPLMISMATCH,
|
|
LINUX_MIB_XFRMINNOPOLS,
|
|
LINUX_MIB_XFRMINPOLBLOCK,
|
|
LINUX_MIB_XFRMINPOLERROR,
|
|
LINUX_MIB_XFRMOUTERROR,
|
|
LINUX_MIB_XFRMOUTBUNDLEGENERROR,
|
|
LINUX_MIB_XFRMOUTBUNDLECHECKERROR,
|
|
LINUX_MIB_XFRMOUTNOSTATES,
|
|
LINUX_MIB_XFRMOUTSTATEPROTOERROR,
|
|
LINUX_MIB_XFRMOUTSTATEMODEERROR,
|
|
LINUX_MIB_XFRMOUTSTATESEQERROR,
|
|
LINUX_MIB_XFRMOUTSTATEEXPIRED,
|
|
LINUX_MIB_XFRMOUTPOLBLOCK,
|
|
LINUX_MIB_XFRMOUTPOLDEAD,
|
|
LINUX_MIB_XFRMOUTPOLERROR,
|
|
LINUX_MIB_XFRMFWDHDRERROR,
|
|
LINUX_MIB_XFRMOUTSTATEINVALID,
|
|
LINUX_MIB_XFRMACQUIREERROR,
|
|
__LINUX_MIB_XFRMMAX
|
|
};
|
|
# 24 "include/net/snmp.h" 2
|
|
# 34 "include/net/snmp.h"
|
|
struct snmp_mib {
|
|
const char *name;
|
|
int entry;
|
|
};
|
|
# 52 "include/net/snmp.h"
|
|
# 1 "include/linux/u64_stats_sync.h" 1
|
|
# 64 "include/linux/u64_stats_sync.h"
|
|
struct u64_stats_sync {
|
|
|
|
seqcount_t seq;
|
|
|
|
};
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void u64_stats_init(struct u64_stats_sync *syncp)
|
|
{
|
|
|
|
__seqcount_init(&syncp->seq, ((void *)0), ((void *)0));
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void u64_stats_update_begin(struct u64_stats_sync *syncp)
|
|
{
|
|
|
|
write_seqcount_begin(&syncp->seq);
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void u64_stats_update_end(struct u64_stats_sync *syncp)
|
|
{
|
|
|
|
write_seqcount_end(&syncp->seq);
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int u64_stats_fetch_begin(const struct u64_stats_sync *syncp)
|
|
{
|
|
|
|
return read_seqcount_begin(&syncp->seq);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool u64_stats_fetch_retry(const struct u64_stats_sync *syncp,
|
|
unsigned int start)
|
|
{
|
|
|
|
return read_seqcount_retry(&syncp->seq, start);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int u64_stats_fetch_begin_irq(const struct u64_stats_sync *syncp)
|
|
{
|
|
|
|
return read_seqcount_begin(&syncp->seq);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool u64_stats_fetch_retry_irq(const struct u64_stats_sync *syncp,
|
|
unsigned int start)
|
|
{
|
|
|
|
return read_seqcount_retry(&syncp->seq, start);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
# 53 "include/net/snmp.h" 2
|
|
|
|
|
|
|
|
struct ipstats_mib {
|
|
|
|
u64 mibs[__IPSTATS_MIB_MAX];
|
|
struct u64_stats_sync syncp;
|
|
};
|
|
|
|
|
|
|
|
struct icmp_mib {
|
|
unsigned long mibs[__ICMP_MIB_MAX];
|
|
};
|
|
|
|
|
|
struct icmpmsg_mib {
|
|
atomic_long_t mibs[512];
|
|
};
|
|
|
|
|
|
|
|
|
|
struct icmpv6_mib {
|
|
unsigned long mibs[__ICMP6_MIB_MAX];
|
|
};
|
|
|
|
struct icmpv6_mib_device {
|
|
atomic_long_t mibs[__ICMP6_MIB_MAX];
|
|
};
|
|
|
|
|
|
|
|
struct icmpv6msg_mib {
|
|
atomic_long_t mibs[512];
|
|
};
|
|
|
|
struct icmpv6msg_mib_device {
|
|
atomic_long_t mibs[512];
|
|
};
|
|
|
|
|
|
|
|
|
|
struct tcp_mib {
|
|
unsigned long mibs[__TCP_MIB_MAX];
|
|
};
|
|
|
|
|
|
|
|
struct udp_mib {
|
|
unsigned long mibs[__UDP_MIB_MAX];
|
|
};
|
|
|
|
|
|
|
|
struct linux_mib {
|
|
unsigned long mibs[__LINUX_MIB_MAX];
|
|
};
|
|
|
|
|
|
|
|
struct linux_xfrm_mib {
|
|
unsigned long mibs[__LINUX_MIB_XFRMMAX];
|
|
};
|
|
# 5 "include/net/netns/mib.h" 2
|
|
|
|
struct netns_mib {
|
|
__typeof__(struct tcp_mib) *tcp_statistics;
|
|
__typeof__(struct ipstats_mib) *ip_statistics;
|
|
__typeof__(struct linux_mib) *net_statistics;
|
|
__typeof__(struct udp_mib) *udp_statistics;
|
|
__typeof__(struct udp_mib) *udplite_statistics;
|
|
__typeof__(struct icmp_mib) *icmp_statistics;
|
|
__typeof__(struct icmpmsg_mib) *icmpmsg_statistics;
|
|
|
|
|
|
struct proc_dir_entry *proc_net_devsnmp6;
|
|
__typeof__(struct udp_mib) *udp_stats_in6;
|
|
__typeof__(struct udp_mib) *udplite_stats_in6;
|
|
__typeof__(struct ipstats_mib) *ipv6_statistics;
|
|
__typeof__(struct icmpv6_mib) *icmpv6_statistics;
|
|
__typeof__(struct icmpv6msg_mib) *icmpv6msg_statistics;
|
|
|
|
|
|
|
|
|
|
};
|
|
# 15 "include/net/net_namespace.h" 2
|
|
# 1 "include/net/netns/unix.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct ctl_table_header;
|
|
struct netns_unix {
|
|
int sysctl_max_dgram_qlen;
|
|
struct ctl_table_header *ctl;
|
|
};
|
|
# 16 "include/net/net_namespace.h" 2
|
|
# 1 "include/net/netns/packet.h" 1
|
|
# 10 "include/net/netns/packet.h"
|
|
struct netns_packet {
|
|
struct mutex sklist_lock;
|
|
struct hlist_head sklist;
|
|
};
|
|
# 17 "include/net/net_namespace.h" 2
|
|
# 1 "include/net/netns/ipv4.h" 1
|
|
# 9 "include/net/netns/ipv4.h"
|
|
# 1 "include/net/inet_frag.h" 1
|
|
|
|
|
|
|
|
struct netns_frags {
|
|
|
|
atomic_t mem __attribute__((__aligned__((1 << 6))));
|
|
|
|
int timeout;
|
|
int high_thresh;
|
|
int low_thresh;
|
|
};
|
|
# 20 "include/net/inet_frag.h"
|
|
enum {
|
|
INET_FRAG_FIRST_IN = (1UL << (0)),
|
|
INET_FRAG_LAST_IN = (1UL << (1)),
|
|
INET_FRAG_COMPLETE = (1UL << (2)),
|
|
};
|
|
# 43 "include/net/inet_frag.h"
|
|
struct inet_frag_queue {
|
|
spinlock_t lock;
|
|
struct timer_list timer;
|
|
struct hlist_node list;
|
|
atomic_t refcnt;
|
|
struct sk_buff *fragments;
|
|
struct sk_buff *fragments_tail;
|
|
ktime_t stamp;
|
|
int len;
|
|
int meat;
|
|
__u8 flags;
|
|
u16 max_size;
|
|
struct netns_frags *net;
|
|
struct hlist_node list_evictor;
|
|
};
|
|
# 68 "include/net/inet_frag.h"
|
|
struct inet_frag_bucket {
|
|
struct hlist_head chain;
|
|
spinlock_t chain_lock;
|
|
};
|
|
|
|
struct inet_frags {
|
|
struct inet_frag_bucket hash[1024];
|
|
|
|
struct work_struct frags_work;
|
|
unsigned int next_bucket;
|
|
unsigned long last_rebuild_jiffies;
|
|
bool rebuild;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
u32 rnd;
|
|
seqlock_t rnd_seqlock;
|
|
int qsize;
|
|
|
|
unsigned int (*hashfn)(const struct inet_frag_queue *);
|
|
bool (*match)(const struct inet_frag_queue *q,
|
|
const void *arg);
|
|
void (*constructor)(struct inet_frag_queue *q,
|
|
const void *arg);
|
|
void (*destructor)(struct inet_frag_queue *);
|
|
void (*skb_free)(struct sk_buff *);
|
|
void (*frag_expire)(unsigned long data);
|
|
struct kmem_cache *frags_cachep;
|
|
const char *frags_cache_name;
|
|
};
|
|
|
|
int inet_frags_init(struct inet_frags *);
|
|
void inet_frags_fini(struct inet_frags *);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inet_frags_init_net(struct netns_frags *nf)
|
|
{
|
|
({ union { typeof(((&nf->mem)->counter)) __val; char __c[1]; } __u = { .__val = ( typeof(((&nf->mem)->counter))) ((0)) }; __write_once_size(&(((&nf->mem)->counter)), __u.__c, sizeof(((&nf->mem)->counter))); __u.__val; });
|
|
}
|
|
void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f);
|
|
|
|
void inet_frag_kill(struct inet_frag_queue *q, struct inet_frags *f);
|
|
void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f);
|
|
struct inet_frag_queue *inet_frag_find(struct netns_frags *nf,
|
|
struct inet_frags *f, void *key, unsigned int hash);
|
|
|
|
void inet_frag_maybe_warn_overflow(struct inet_frag_queue *q,
|
|
const char *prefix);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f)
|
|
{
|
|
if ((({ typeof(atomic_sub_return_relaxed(1, &q->refcnt)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_sub_return_relaxed(1, &q->refcnt); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) == 0))
|
|
inet_frag_destroy(q, f);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool inet_frag_evicting(struct inet_frag_queue *q)
|
|
{
|
|
return !hlist_unhashed(&q->list_evictor);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int frag_mem_limit(struct netns_frags *nf)
|
|
{
|
|
return ({ union { typeof((&nf->mem)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&nf->mem)->counter), __u.__c, sizeof((&nf->mem)->counter)); else __read_once_size_nocheck(&((&nf->mem)->counter), __u.__c, sizeof((&nf->mem)->counter)); __u.__val; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sub_frag_mem_limit(struct netns_frags *nf, int i)
|
|
{
|
|
atomic_sub(i, &nf->mem);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void add_frag_mem_limit(struct netns_frags *nf, int i)
|
|
{
|
|
atomic_add(i, &nf->mem);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sum_frag_mem_limit(struct netns_frags *nf)
|
|
{
|
|
return ({ union { typeof((&nf->mem)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&nf->mem)->counter), __u.__c, sizeof((&nf->mem)->counter)); else __read_once_size_nocheck(&((&nf->mem)->counter), __u.__c, sizeof((&nf->mem)->counter)); __u.__val; });
|
|
}
|
|
# 162 "include/net/inet_frag.h"
|
|
extern const u8 ip_frag_ecn_table[16];
|
|
# 10 "include/net/netns/ipv4.h" 2
|
|
|
|
|
|
struct tcpm_hash_bucket;
|
|
struct ctl_table_header;
|
|
struct ipv4_devconf;
|
|
struct fib_rules_ops;
|
|
struct hlist_head;
|
|
struct fib_table;
|
|
struct sock;
|
|
struct local_ports {
|
|
seqlock_t lock;
|
|
int range[2];
|
|
bool warned;
|
|
};
|
|
|
|
struct ping_group_range {
|
|
seqlock_t lock;
|
|
kgid_t range[2];
|
|
};
|
|
|
|
struct netns_ipv4 {
|
|
|
|
struct ctl_table_header *forw_hdr;
|
|
struct ctl_table_header *frags_hdr;
|
|
struct ctl_table_header *ipv4_hdr;
|
|
struct ctl_table_header *route_hdr;
|
|
struct ctl_table_header *xfrm4_hdr;
|
|
|
|
struct ipv4_devconf *devconf_all;
|
|
struct ipv4_devconf *devconf_dflt;
|
|
|
|
struct fib_rules_ops *rules_ops;
|
|
bool fib_has_custom_rules;
|
|
struct fib_table *fib_local;
|
|
struct fib_table *fib_main;
|
|
struct fib_table *fib_default;
|
|
|
|
|
|
|
|
|
|
struct hlist_head *fib_table_hash;
|
|
bool fib_offload_disabled;
|
|
struct sock *fibnl;
|
|
|
|
struct sock * *icmp_sk;
|
|
struct sock *mc_autojoin_sk;
|
|
|
|
struct inet_peer_base *peers;
|
|
struct sock * *tcp_sk;
|
|
struct netns_frags frags;
|
|
|
|
struct xt_table *iptable_filter;
|
|
struct xt_table *iptable_mangle;
|
|
struct xt_table *iptable_raw;
|
|
struct xt_table *arptable_filter;
|
|
|
|
struct xt_table *iptable_security;
|
|
|
|
struct xt_table *nat_table;
|
|
|
|
|
|
int sysctl_icmp_echo_ignore_all;
|
|
int sysctl_icmp_echo_ignore_broadcasts;
|
|
int sysctl_icmp_ignore_bogus_error_responses;
|
|
int sysctl_icmp_ratelimit;
|
|
int sysctl_icmp_ratemask;
|
|
int sysctl_icmp_errors_use_inbound_ifaddr;
|
|
|
|
struct local_ports ip_local_ports;
|
|
|
|
int sysctl_tcp_ecn;
|
|
int sysctl_tcp_ecn_fallback;
|
|
|
|
int sysctl_ip_no_pmtu_disc;
|
|
int sysctl_ip_fwd_use_pmtu;
|
|
int sysctl_ip_nonlocal_bind;
|
|
|
|
int sysctl_fwmark_reflect;
|
|
int sysctl_tcp_fwmark_accept;
|
|
int sysctl_tcp_mtu_probing;
|
|
int sysctl_tcp_base_mss;
|
|
int sysctl_tcp_probe_threshold;
|
|
u32 sysctl_tcp_probe_interval;
|
|
|
|
struct ping_group_range ping_group_range;
|
|
|
|
atomic_t dev_addr_genid;
|
|
|
|
|
|
unsigned long *sysctl_local_reserved_ports;
|
|
|
|
|
|
|
|
|
|
struct mr_table *mrt;
|
|
|
|
|
|
|
|
|
|
|
|
atomic_t rt_genid;
|
|
};
|
|
# 18 "include/net/net_namespace.h" 2
|
|
# 1 "include/net/netns/ipv6.h" 1
|
|
# 9 "include/net/netns/ipv6.h"
|
|
# 1 "include/net/dst_ops.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct dst_entry;
|
|
struct kmem_cachep;
|
|
struct net_device;
|
|
struct sk_buff;
|
|
struct sock;
|
|
struct net;
|
|
|
|
struct dst_ops {
|
|
unsigned short family;
|
|
unsigned int gc_thresh;
|
|
|
|
int (*gc)(struct dst_ops *ops);
|
|
struct dst_entry * (*check)(struct dst_entry *, __u32 cookie);
|
|
unsigned int (*default_advmss)(const struct dst_entry *);
|
|
unsigned int (*mtu)(const struct dst_entry *);
|
|
u32 * (*cow_metrics)(struct dst_entry *, unsigned long);
|
|
void (*destroy)(struct dst_entry *);
|
|
void (*ifdown)(struct dst_entry *,
|
|
struct net_device *dev, int how);
|
|
struct dst_entry * (*negative_advice)(struct dst_entry *);
|
|
void (*link_failure)(struct sk_buff *);
|
|
void (*update_pmtu)(struct dst_entry *dst, struct sock *sk,
|
|
struct sk_buff *skb, u32 mtu);
|
|
void (*redirect)(struct dst_entry *dst, struct sock *sk,
|
|
struct sk_buff *skb);
|
|
int (*local_out)(struct net *net, struct sock *sk, struct sk_buff *skb);
|
|
struct neighbour * (*neigh_lookup)(const struct dst_entry *dst,
|
|
struct sk_buff *skb,
|
|
const void *daddr);
|
|
|
|
struct kmem_cache *kmem_cachep;
|
|
|
|
struct percpu_counter pcpuc_entries __attribute__((__aligned__((1 << 6))));
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dst_entries_get_fast(struct dst_ops *dst)
|
|
{
|
|
return percpu_counter_read_positive(&dst->pcpuc_entries);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dst_entries_get_slow(struct dst_ops *dst)
|
|
{
|
|
int res;
|
|
|
|
local_bh_disable();
|
|
res = percpu_counter_sum_positive(&dst->pcpuc_entries);
|
|
local_bh_enable();
|
|
return res;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dst_entries_add(struct dst_ops *dst, int val)
|
|
{
|
|
local_bh_disable();
|
|
percpu_counter_add(&dst->pcpuc_entries, val);
|
|
local_bh_enable();
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dst_entries_init(struct dst_ops *dst)
|
|
{
|
|
return ({ static struct lock_class_key __key; __percpu_counter_init(&dst->pcpuc_entries, 0, ((( gfp_t)(0x400000u|0x2000000u)) | (( gfp_t)0x40u) | (( gfp_t)0x80u)), &__key); });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dst_entries_destroy(struct dst_ops *dst)
|
|
{
|
|
percpu_counter_destroy(&dst->pcpuc_entries);
|
|
}
|
|
# 10 "include/net/netns/ipv6.h" 2
|
|
|
|
struct ctl_table_header;
|
|
|
|
struct netns_sysctl_ipv6 {
|
|
|
|
struct ctl_table_header *hdr;
|
|
struct ctl_table_header *route_hdr;
|
|
struct ctl_table_header *icmp_hdr;
|
|
struct ctl_table_header *frags_hdr;
|
|
struct ctl_table_header *xfrm6_hdr;
|
|
|
|
int bindv6only;
|
|
int flush_delay;
|
|
int ip6_rt_max_size;
|
|
int ip6_rt_gc_min_interval;
|
|
int ip6_rt_gc_timeout;
|
|
int ip6_rt_gc_interval;
|
|
int ip6_rt_gc_elasticity;
|
|
int ip6_rt_mtu_expires;
|
|
int ip6_rt_min_advmss;
|
|
int flowlabel_consistency;
|
|
int auto_flowlabels;
|
|
int icmpv6_time;
|
|
int anycast_src_echo_reply;
|
|
int ip_nonlocal_bind;
|
|
int fwmark_reflect;
|
|
int idgen_retries;
|
|
int idgen_delay;
|
|
int flowlabel_state_ranges;
|
|
};
|
|
|
|
struct netns_ipv6 {
|
|
struct netns_sysctl_ipv6 sysctl;
|
|
struct ipv6_devconf *devconf_all;
|
|
struct ipv6_devconf *devconf_dflt;
|
|
struct inet_peer_base *peers;
|
|
struct netns_frags frags;
|
|
|
|
struct xt_table *ip6table_filter;
|
|
struct xt_table *ip6table_mangle;
|
|
struct xt_table *ip6table_raw;
|
|
|
|
struct xt_table *ip6table_security;
|
|
|
|
struct xt_table *ip6table_nat;
|
|
|
|
struct rt6_info *ip6_null_entry;
|
|
struct rt6_statistics *rt6_stats;
|
|
struct timer_list ip6_fib_timer;
|
|
struct hlist_head *fib_table_hash;
|
|
struct fib6_table *fib6_main_tbl;
|
|
struct dst_ops ip6_dst_ops;
|
|
unsigned int ip6_rt_gc_expire;
|
|
unsigned long ip6_rt_last_gc;
|
|
|
|
struct rt6_info *ip6_prohibit_entry;
|
|
struct rt6_info *ip6_blk_hole_entry;
|
|
struct fib6_table *fib6_local_tbl;
|
|
struct fib_rules_ops *fib6_rules_ops;
|
|
|
|
struct sock **icmp_sk;
|
|
struct sock *ndisc_sk;
|
|
struct sock *tcp_sk;
|
|
struct sock *igmp_sk;
|
|
struct sock *mc_autojoin_sk;
|
|
# 83 "include/net/netns/ipv6.h"
|
|
atomic_t dev_addr_genid;
|
|
atomic_t fib6_sernum;
|
|
};
|
|
|
|
|
|
struct netns_nf_frag {
|
|
struct netns_sysctl_ipv6 sysctl;
|
|
struct netns_frags frags;
|
|
};
|
|
# 19 "include/net/net_namespace.h" 2
|
|
# 1 "include/net/netns/ieee802154_6lowpan.h" 1
|
|
# 10 "include/net/netns/ieee802154_6lowpan.h"
|
|
struct netns_sysctl_lowpan {
|
|
|
|
struct ctl_table_header *frags_hdr;
|
|
|
|
};
|
|
|
|
struct netns_ieee802154_lowpan {
|
|
struct netns_sysctl_lowpan sysctl;
|
|
struct netns_frags frags;
|
|
};
|
|
# 20 "include/net/net_namespace.h" 2
|
|
# 1 "include/net/netns/sctp.h" 1
|
|
|
|
|
|
|
|
struct sock;
|
|
struct proc_dir_entry;
|
|
struct sctp_mib;
|
|
struct ctl_table_header;
|
|
|
|
struct netns_sctp {
|
|
__typeof__(struct sctp_mib) *sctp_statistics;
|
|
|
|
|
|
struct proc_dir_entry *proc_net_sctp;
|
|
|
|
|
|
struct ctl_table_header *sysctl_header;
|
|
|
|
|
|
|
|
|
|
|
|
struct sock *ctl_sock;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct list_head local_addr_list;
|
|
struct list_head addr_waitq;
|
|
struct timer_list addr_wq_timer;
|
|
struct list_head auto_asconf_splist;
|
|
|
|
spinlock_t addr_wq_lock;
|
|
|
|
|
|
spinlock_t local_addr_lock;
|
|
# 50 "include/net/netns/sctp.h"
|
|
unsigned int rto_initial;
|
|
unsigned int rto_min;
|
|
unsigned int rto_max;
|
|
|
|
|
|
|
|
|
|
int rto_alpha;
|
|
int rto_beta;
|
|
|
|
|
|
int max_burst;
|
|
|
|
|
|
int cookie_preserve_enable;
|
|
|
|
|
|
char *sctp_hmac_alg;
|
|
|
|
|
|
unsigned int valid_cookie_life;
|
|
|
|
|
|
unsigned int sack_timeout;
|
|
|
|
|
|
unsigned int hb_interval;
|
|
|
|
|
|
|
|
|
|
|
|
int max_retrans_association;
|
|
int max_retrans_path;
|
|
int max_retrans_init;
|
|
|
|
|
|
|
|
|
|
int pf_retrans;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int sndbuf_policy;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int rcvbuf_policy;
|
|
|
|
int default_auto_asconf;
|
|
|
|
|
|
int addip_enable;
|
|
int addip_noauth;
|
|
|
|
|
|
int prsctp_enable;
|
|
|
|
|
|
int auth_enable;
|
|
# 124 "include/net/netns/sctp.h"
|
|
int scope_policy;
|
|
|
|
|
|
|
|
|
|
int rwnd_upd_shift;
|
|
|
|
|
|
unsigned long max_autoclose;
|
|
};
|
|
# 21 "include/net/net_namespace.h" 2
|
|
# 1 "include/net/netns/dccp.h" 1
|
|
|
|
|
|
|
|
struct sock;
|
|
|
|
struct netns_dccp {
|
|
struct sock *v4_ctl_sk;
|
|
struct sock *v6_ctl_sk;
|
|
};
|
|
# 22 "include/net/net_namespace.h" 2
|
|
# 1 "include/net/netns/netfilter.h" 1
|
|
|
|
|
|
|
|
# 1 "include/linux/netfilter_defs.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/netfilter.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/in.h" 1
|
|
# 23 "include/linux/in.h"
|
|
# 1 "include/uapi/linux/in.h" 1
|
|
# 24 "include/uapi/linux/in.h"
|
|
# 1 "./include/uapi/linux/ecnt_in.h" 1
|
|
|
|
|
|
|
|
# 1 "include/generated/uapi/linux/version.h" 1
|
|
# 5 "./include/uapi/linux/ecnt_in.h" 2
|
|
# 25 "include/uapi/linux/in.h" 2
|
|
|
|
|
|
|
|
enum {
|
|
IPPROTO_IP = 0,
|
|
|
|
IPPROTO_ICMP = 1,
|
|
|
|
IPPROTO_IGMP = 2,
|
|
|
|
IPPROTO_IPIP = 4,
|
|
|
|
IPPROTO_TCP = 6,
|
|
|
|
IPPROTO_EGP = 8,
|
|
|
|
IPPROTO_PUP = 12,
|
|
|
|
IPPROTO_UDP = 17,
|
|
|
|
IPPROTO_IDP = 22,
|
|
|
|
IPPROTO_TP = 29,
|
|
|
|
IPPROTO_DCCP = 33,
|
|
|
|
IPPROTO_IPV6 = 41,
|
|
|
|
IPPROTO_RSVP = 46,
|
|
|
|
IPPROTO_GRE = 47,
|
|
|
|
IPPROTO_ESP = 50,
|
|
|
|
IPPROTO_AH = 51,
|
|
|
|
IPPROTO_MTP = 92,
|
|
|
|
IPPROTO_BEETPH = 94,
|
|
|
|
IPPROTO_ENCAP = 98,
|
|
|
|
IPPROTO_PIM = 103,
|
|
|
|
IPPROTO_COMP = 108,
|
|
|
|
IPPROTO_SCTP = 132,
|
|
|
|
IPPROTO_UDPLITE = 136,
|
|
|
|
IPPROTO_MPLS = 137,
|
|
|
|
IPPROTO_RAW = 255,
|
|
|
|
IPPROTO_MAX
|
|
};
|
|
|
|
|
|
|
|
|
|
struct in_addr {
|
|
__be32 s_addr;
|
|
};
|
|
# 173 "include/uapi/linux/in.h"
|
|
struct ip_mreq {
|
|
struct in_addr imr_multiaddr;
|
|
struct in_addr imr_interface;
|
|
};
|
|
|
|
struct ip_mreqn {
|
|
struct in_addr imr_multiaddr;
|
|
struct in_addr imr_address;
|
|
int imr_ifindex;
|
|
};
|
|
|
|
struct ip_mreq_source {
|
|
__be32 imr_multiaddr;
|
|
__be32 imr_interface;
|
|
__be32 imr_sourceaddr;
|
|
};
|
|
|
|
struct ip_msfilter {
|
|
__be32 imsf_multiaddr;
|
|
__be32 imsf_interface;
|
|
__u32 imsf_fmode;
|
|
__u32 imsf_numsrc;
|
|
__be32 imsf_slist[1];
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct group_req {
|
|
__u32 gr_interface;
|
|
struct __kernel_sockaddr_storage gr_group;
|
|
};
|
|
|
|
struct group_source_req {
|
|
__u32 gsr_interface;
|
|
struct __kernel_sockaddr_storage gsr_group;
|
|
struct __kernel_sockaddr_storage gsr_source;
|
|
};
|
|
|
|
struct group_filter {
|
|
__u32 gf_interface;
|
|
struct __kernel_sockaddr_storage gf_group;
|
|
__u32 gf_fmode;
|
|
__u32 gf_numsrc;
|
|
struct __kernel_sockaddr_storage gf_slist[1];
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct in_pktinfo {
|
|
int ipi_ifindex;
|
|
struct in_addr ipi_spec_dst;
|
|
struct in_addr ipi_addr;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct sockaddr_in {
|
|
__kernel_sa_family_t sin_family;
|
|
__be16 sin_port;
|
|
struct in_addr sin_addr;
|
|
|
|
|
|
unsigned char __pad[16 - sizeof(short int) -
|
|
sizeof(unsigned short int) - sizeof(struct in_addr)];
|
|
};
|
|
# 24 "include/linux/in.h" 2
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int proto_ports_offset(int proto)
|
|
{
|
|
switch (proto) {
|
|
case IPPROTO_TCP:
|
|
case IPPROTO_UDP:
|
|
case IPPROTO_DCCP:
|
|
case IPPROTO_ESP:
|
|
case IPPROTO_SCTP:
|
|
case IPPROTO_UDPLITE:
|
|
return 0;
|
|
case IPPROTO_AH:
|
|
return 4;
|
|
default:
|
|
return -22;
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ipv4_is_loopback(__be32 addr)
|
|
{
|
|
return (addr & (( __be32)(__builtin_constant_p((__u32)((0xff000000))) ? ((__u32)( (((__u32)((0xff000000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xff000000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xff000000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xff000000)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xff000000))))) == (( __be32)(__builtin_constant_p((__u32)((0x7f000000))) ? ((__u32)( (((__u32)((0x7f000000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x7f000000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x7f000000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x7f000000)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x7f000000))));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ipv4_is_multicast(__be32 addr)
|
|
{
|
|
return (addr & (( __be32)(__builtin_constant_p((__u32)((0xf0000000))) ? ((__u32)( (((__u32)((0xf0000000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xf0000000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xf0000000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xf0000000)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xf0000000))))) == (( __be32)(__builtin_constant_p((__u32)((0xe0000000))) ? ((__u32)( (((__u32)((0xe0000000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xe0000000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xe0000000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xe0000000)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xe0000000))));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ipv4_is_local_multicast(__be32 addr)
|
|
{
|
|
return (addr & (( __be32)(__builtin_constant_p((__u32)((0xffffff00))) ? ((__u32)( (((__u32)((0xffffff00)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xffffff00)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xffffff00)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xffffff00)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xffffff00))))) == (( __be32)(__builtin_constant_p((__u32)((0xe0000000))) ? ((__u32)( (((__u32)((0xe0000000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xe0000000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xe0000000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xe0000000)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xe0000000))));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ipv4_is_lbcast(__be32 addr)
|
|
{
|
|
|
|
return addr == (( __be32)(__builtin_constant_p((__u32)((((unsigned long int) 0xffffffff)))) ? ((__u32)( (((__u32)((((unsigned long int) 0xffffffff))) & (__u32)0x000000ffUL) << 24) | (((__u32)((((unsigned long int) 0xffffffff))) & (__u32)0x0000ff00UL) << 8) | (((__u32)((((unsigned long int) 0xffffffff))) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((((unsigned long int) 0xffffffff))) & (__u32)0xff000000UL) >> 24))) : __fswab32((((unsigned long int) 0xffffffff)))));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ipv4_is_zeronet(__be32 addr)
|
|
{
|
|
return (addr & (( __be32)(__builtin_constant_p((__u32)((0xff000000))) ? ((__u32)( (((__u32)((0xff000000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xff000000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xff000000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xff000000)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xff000000))))) == (( __be32)(__builtin_constant_p((__u32)((0x00000000))) ? ((__u32)( (((__u32)((0x00000000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x00000000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x00000000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x00000000)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x00000000))));
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ipv4_is_private_10(__be32 addr)
|
|
{
|
|
return (addr & (( __be32)(__builtin_constant_p((__u32)((0xff000000))) ? ((__u32)( (((__u32)((0xff000000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xff000000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xff000000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xff000000)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xff000000))))) == (( __be32)(__builtin_constant_p((__u32)((0x0a000000))) ? ((__u32)( (((__u32)((0x0a000000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x0a000000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x0a000000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x0a000000)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x0a000000))));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ipv4_is_private_172(__be32 addr)
|
|
{
|
|
return (addr & (( __be32)(__builtin_constant_p((__u32)((0xfff00000))) ? ((__u32)( (((__u32)((0xfff00000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xfff00000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xfff00000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xfff00000)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xfff00000))))) == (( __be32)(__builtin_constant_p((__u32)((0xac100000))) ? ((__u32)( (((__u32)((0xac100000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xac100000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xac100000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xac100000)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xac100000))));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ipv4_is_private_192(__be32 addr)
|
|
{
|
|
return (addr & (( __be32)(__builtin_constant_p((__u32)((0xffff0000))) ? ((__u32)( (((__u32)((0xffff0000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xffff0000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xffff0000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xffff0000)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xffff0000))))) == (( __be32)(__builtin_constant_p((__u32)((0xc0a80000))) ? ((__u32)( (((__u32)((0xc0a80000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xc0a80000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xc0a80000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xc0a80000)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xc0a80000))));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ipv4_is_linklocal_169(__be32 addr)
|
|
{
|
|
return (addr & (( __be32)(__builtin_constant_p((__u32)((0xffff0000))) ? ((__u32)( (((__u32)((0xffff0000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xffff0000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xffff0000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xffff0000)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xffff0000))))) == (( __be32)(__builtin_constant_p((__u32)((0xa9fe0000))) ? ((__u32)( (((__u32)((0xa9fe0000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xa9fe0000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xa9fe0000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xa9fe0000)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xa9fe0000))));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ipv4_is_anycast_6to4(__be32 addr)
|
|
{
|
|
return (addr & (( __be32)(__builtin_constant_p((__u32)((0xffffff00))) ? ((__u32)( (((__u32)((0xffffff00)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xffffff00)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xffffff00)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xffffff00)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xffffff00))))) == (( __be32)(__builtin_constant_p((__u32)((0xc0586300))) ? ((__u32)( (((__u32)((0xc0586300)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xc0586300)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xc0586300)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xc0586300)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xc0586300))));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ipv4_is_test_192(__be32 addr)
|
|
{
|
|
return (addr & (( __be32)(__builtin_constant_p((__u32)((0xffffff00))) ? ((__u32)( (((__u32)((0xffffff00)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xffffff00)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xffffff00)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xffffff00)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xffffff00))))) == (( __be32)(__builtin_constant_p((__u32)((0xc0000200))) ? ((__u32)( (((__u32)((0xc0000200)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xc0000200)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xc0000200)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xc0000200)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xc0000200))));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ipv4_is_test_198(__be32 addr)
|
|
{
|
|
return (addr & (( __be32)(__builtin_constant_p((__u32)((0xfffe0000))) ? ((__u32)( (((__u32)((0xfffe0000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xfffe0000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xfffe0000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xfffe0000)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xfffe0000))))) == (( __be32)(__builtin_constant_p((__u32)((0xc6120000))) ? ((__u32)( (((__u32)((0xc6120000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xc6120000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xc6120000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xc6120000)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xc6120000))));
|
|
}
|
|
# 8 "include/uapi/linux/netfilter.h" 2
|
|
# 46 "include/uapi/linux/netfilter.h"
|
|
enum nf_inet_hooks {
|
|
NF_INET_PRE_ROUTING,
|
|
NF_INET_LOCAL_IN,
|
|
NF_INET_FORWARD,
|
|
NF_INET_LOCAL_OUT,
|
|
NF_INET_POST_ROUTING,
|
|
NF_INET_NUMHOOKS
|
|
};
|
|
|
|
enum nf_dev_hooks {
|
|
NF_NETDEV_INGRESS,
|
|
NF_NETDEV_NUMHOOKS
|
|
};
|
|
|
|
enum {
|
|
NFPROTO_UNSPEC = 0,
|
|
NFPROTO_INET = 1,
|
|
NFPROTO_IPV4 = 2,
|
|
NFPROTO_ARP = 3,
|
|
NFPROTO_NETDEV = 5,
|
|
NFPROTO_BRIDGE = 7,
|
|
NFPROTO_IPV6 = 10,
|
|
NFPROTO_DECNET = 12,
|
|
NFPROTO_NUMPROTO,
|
|
};
|
|
|
|
union nf_inet_addr {
|
|
__u32 all[4];
|
|
__be32 ip;
|
|
__be32 ip6[4];
|
|
struct in_addr in;
|
|
struct in6_addr in6;
|
|
};
|
|
# 5 "include/linux/netfilter_defs.h" 2
|
|
# 5 "include/net/netns/netfilter.h" 2
|
|
|
|
struct proc_dir_entry;
|
|
struct nf_logger;
|
|
struct nf_queue_handler;
|
|
|
|
struct netns_nf {
|
|
|
|
struct proc_dir_entry *proc_netfilter;
|
|
|
|
const struct nf_queue_handler *queue_handler;
|
|
const struct nf_logger *nf_loggers[NFPROTO_NUMPROTO];
|
|
|
|
struct ctl_table_header *nf_log_dir_header;
|
|
|
|
struct list_head hooks[NFPROTO_NUMPROTO][8];
|
|
};
|
|
# 23 "include/net/net_namespace.h" 2
|
|
# 1 "include/net/netns/x_tables.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct ebt_table;
|
|
|
|
struct netns_xt {
|
|
struct list_head tables[NFPROTO_NUMPROTO];
|
|
bool notrack_deprecated_warning;
|
|
bool clusterip_deprecated_warning;
|
|
|
|
|
|
struct ebt_table *broute_table;
|
|
struct ebt_table *frame_filter;
|
|
struct ebt_table *frame_nat;
|
|
|
|
};
|
|
# 24 "include/net/net_namespace.h" 2
|
|
|
|
# 1 "include/net/netns/conntrack.h" 1
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/list_nulls.h" 1
|
|
# 20 "include/linux/list_nulls.h"
|
|
struct hlist_nulls_head {
|
|
struct hlist_nulls_node *first;
|
|
};
|
|
|
|
struct hlist_nulls_node {
|
|
struct hlist_nulls_node *next, **pprev;
|
|
};
|
|
# 37 "include/linux/list_nulls.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_a_nulls(const struct hlist_nulls_node *ptr)
|
|
{
|
|
return ((unsigned long)ptr & 1);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long get_nulls_value(const struct hlist_nulls_node *ptr)
|
|
{
|
|
return ((unsigned long)ptr) >> 1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hlist_nulls_unhashed(const struct hlist_nulls_node *h)
|
|
{
|
|
return !h->pprev;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hlist_nulls_empty(const struct hlist_nulls_head *h)
|
|
{
|
|
return is_a_nulls(h->first);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_nulls_add_head(struct hlist_nulls_node *n,
|
|
struct hlist_nulls_head *h)
|
|
{
|
|
struct hlist_nulls_node *first = h->first;
|
|
|
|
n->next = first;
|
|
n->pprev = &h->first;
|
|
h->first = n;
|
|
if (!is_a_nulls(first))
|
|
first->pprev = &n->next;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __hlist_nulls_del(struct hlist_nulls_node *n)
|
|
{
|
|
struct hlist_nulls_node *next = n->next;
|
|
struct hlist_nulls_node **pprev = n->pprev;
|
|
|
|
({ union { typeof(*pprev) __val; char __c[1]; } __u = { .__val = ( typeof(*pprev)) (next) }; __write_once_size(&(*pprev), __u.__c, sizeof(*pprev)); __u.__val; });
|
|
if (!is_a_nulls(next))
|
|
next->pprev = pprev;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_nulls_del(struct hlist_nulls_node *n)
|
|
{
|
|
__hlist_nulls_del(n);
|
|
n->pprev = ((void *) 0x200 + 0);
|
|
}
|
|
# 6 "include/net/netns/conntrack.h" 2
|
|
|
|
|
|
# 1 "include/linux/netfilter/nf_conntrack_tcp.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/netfilter/nf_conntrack_tcp.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum tcp_conntrack {
|
|
TCP_CONNTRACK_NONE,
|
|
TCP_CONNTRACK_SYN_SENT,
|
|
TCP_CONNTRACK_SYN_RECV,
|
|
TCP_CONNTRACK_ESTABLISHED,
|
|
TCP_CONNTRACK_FIN_WAIT,
|
|
TCP_CONNTRACK_CLOSE_WAIT,
|
|
TCP_CONNTRACK_LAST_ACK,
|
|
TCP_CONNTRACK_TIME_WAIT,
|
|
TCP_CONNTRACK_CLOSE,
|
|
TCP_CONNTRACK_LISTEN,
|
|
|
|
TCP_CONNTRACK_MAX,
|
|
TCP_CONNTRACK_IGNORE,
|
|
TCP_CONNTRACK_RETRANS,
|
|
TCP_CONNTRACK_UNACK,
|
|
TCP_CONNTRACK_TIMEOUT_MAX
|
|
};
|
|
# 48 "include/uapi/linux/netfilter/nf_conntrack_tcp.h"
|
|
struct nf_ct_tcp_flags {
|
|
__u8 flags;
|
|
__u8 mask;
|
|
};
|
|
# 5 "include/linux/netfilter/nf_conntrack_tcp.h" 2
|
|
|
|
|
|
struct ip_ct_tcp_state {
|
|
u_int32_t td_end;
|
|
u_int32_t td_maxend;
|
|
u_int32_t td_maxwin;
|
|
u_int32_t td_maxack;
|
|
u_int8_t td_scale;
|
|
u_int8_t flags;
|
|
};
|
|
|
|
struct ip_ct_tcp {
|
|
struct ip_ct_tcp_state seen[2];
|
|
u_int8_t state;
|
|
|
|
u_int8_t last_dir;
|
|
u_int8_t retrans;
|
|
u_int8_t last_index;
|
|
u_int32_t last_seq;
|
|
u_int32_t last_ack;
|
|
u_int32_t last_end;
|
|
u_int16_t last_win;
|
|
|
|
u_int8_t last_wscale;
|
|
u_int8_t last_flags;
|
|
};
|
|
# 9 "include/net/netns/conntrack.h" 2
|
|
|
|
|
|
struct ctl_table_header;
|
|
struct nf_conntrack_ecache;
|
|
|
|
struct nf_proto_net {
|
|
|
|
struct ctl_table_header *ctl_table_header;
|
|
struct ctl_table *ctl_table;
|
|
|
|
struct ctl_table_header *ctl_compat_header;
|
|
struct ctl_table *ctl_compat_table;
|
|
|
|
|
|
unsigned int users;
|
|
};
|
|
|
|
struct nf_generic_net {
|
|
struct nf_proto_net pn;
|
|
unsigned int timeout;
|
|
};
|
|
|
|
struct nf_tcp_net {
|
|
struct nf_proto_net pn;
|
|
unsigned int timeouts[TCP_CONNTRACK_TIMEOUT_MAX];
|
|
unsigned int tcp_loose;
|
|
unsigned int tcp_be_liberal;
|
|
unsigned int tcp_max_retrans;
|
|
};
|
|
|
|
enum udp_conntrack {
|
|
UDP_CT_UNREPLIED,
|
|
UDP_CT_REPLIED,
|
|
UDP_CT_MAX
|
|
};
|
|
|
|
struct nf_udp_net {
|
|
struct nf_proto_net pn;
|
|
unsigned int timeouts[UDP_CT_MAX];
|
|
};
|
|
|
|
struct nf_icmp_net {
|
|
struct nf_proto_net pn;
|
|
unsigned int timeout;
|
|
};
|
|
|
|
struct nf_ip_net {
|
|
struct nf_generic_net generic;
|
|
struct nf_tcp_net tcp;
|
|
struct nf_udp_net udp;
|
|
struct nf_icmp_net icmp;
|
|
struct nf_icmp_net icmpv6;
|
|
|
|
struct ctl_table_header *ctl_table_header;
|
|
struct ctl_table *ctl_table;
|
|
|
|
};
|
|
|
|
struct ct_pcpu {
|
|
spinlock_t lock;
|
|
struct hlist_nulls_head unconfirmed;
|
|
struct hlist_nulls_head dying;
|
|
};
|
|
|
|
struct netns_ct {
|
|
atomic_t count;
|
|
unsigned int expect_count;
|
|
|
|
struct delayed_work ecache_dwork;
|
|
bool ecache_dwork_pending;
|
|
|
|
|
|
struct ctl_table_header *sysctl_header;
|
|
struct ctl_table_header *acct_sysctl_header;
|
|
struct ctl_table_header *tstamp_sysctl_header;
|
|
struct ctl_table_header *event_sysctl_header;
|
|
struct ctl_table_header *helper_sysctl_header;
|
|
|
|
char *slabname;
|
|
unsigned int sysctl_log_invalid;
|
|
int sysctl_events;
|
|
int sysctl_acct;
|
|
int sysctl_auto_assign_helper;
|
|
bool auto_assign_helper_warned;
|
|
int sysctl_tstamp;
|
|
int sysctl_checksum;
|
|
|
|
unsigned int htable_size;
|
|
seqcount_t generation;
|
|
struct kmem_cache *nf_conntrack_cachep;
|
|
struct hlist_nulls_head *hash;
|
|
struct hlist_head *expect_hash;
|
|
struct ct_pcpu *pcpu_lists;
|
|
struct ip_conntrack_stat *stat;
|
|
struct nf_ct_event_notifier *nf_conntrack_event_cb;
|
|
struct nf_exp_event_notifier *nf_expect_event_cb;
|
|
struct nf_ip_net nf_ct_proto;
|
|
|
|
|
|
|
|
|
|
|
|
struct hlist_head *nat_bysource;
|
|
unsigned int nat_htable_size;
|
|
|
|
};
|
|
# 26 "include/net/net_namespace.h" 2
|
|
|
|
# 1 "include/net/netns/nftables.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
struct nft_af_info;
|
|
|
|
struct netns_nftables {
|
|
struct list_head af_info;
|
|
struct list_head commit_list;
|
|
struct nft_af_info *ipv4;
|
|
struct nft_af_info *ipv6;
|
|
struct nft_af_info *inet;
|
|
struct nft_af_info *arp;
|
|
struct nft_af_info *bridge;
|
|
struct nft_af_info *netdev;
|
|
unsigned int base_seq;
|
|
u8 gencursor;
|
|
};
|
|
# 28 "include/net/net_namespace.h" 2
|
|
# 1 "include/net/netns/xfrm.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "./include/uapi/linux/xfrm.h" 1
|
|
# 14 "./include/uapi/linux/xfrm.h"
|
|
typedef union {
|
|
__be32 a4;
|
|
__be32 a6[4];
|
|
struct in6_addr in6;
|
|
} xfrm_address_t;
|
|
|
|
|
|
|
|
|
|
|
|
struct xfrm_id {
|
|
xfrm_address_t daddr;
|
|
__be32 spi;
|
|
__u8 proto;
|
|
};
|
|
|
|
struct xfrm_sec_ctx {
|
|
__u8 ctx_doi;
|
|
__u8 ctx_alg;
|
|
__u16 ctx_len;
|
|
__u32 ctx_sid;
|
|
char ctx_str[0];
|
|
};
|
|
# 48 "./include/uapi/linux/xfrm.h"
|
|
struct xfrm_selector {
|
|
xfrm_address_t daddr;
|
|
xfrm_address_t saddr;
|
|
__be16 dport;
|
|
__be16 dport_mask;
|
|
__be16 sport;
|
|
__be16 sport_mask;
|
|
__u16 family;
|
|
__u8 prefixlen_d;
|
|
__u8 prefixlen_s;
|
|
__u8 proto;
|
|
int ifindex;
|
|
__kernel_uid32_t user;
|
|
};
|
|
|
|
|
|
|
|
struct xfrm_lifetime_cfg {
|
|
__u64 soft_byte_limit;
|
|
__u64 hard_byte_limit;
|
|
__u64 soft_packet_limit;
|
|
__u64 hard_packet_limit;
|
|
__u64 soft_add_expires_seconds;
|
|
__u64 hard_add_expires_seconds;
|
|
__u64 soft_use_expires_seconds;
|
|
__u64 hard_use_expires_seconds;
|
|
};
|
|
|
|
struct xfrm_lifetime_cur {
|
|
__u64 bytes;
|
|
__u64 packets;
|
|
__u64 add_time;
|
|
__u64 use_time;
|
|
};
|
|
|
|
struct xfrm_replay_state {
|
|
__u32 oseq;
|
|
__u32 seq;
|
|
__u32 bitmap;
|
|
};
|
|
|
|
|
|
|
|
struct xfrm_replay_state_esn {
|
|
unsigned int bmp_len;
|
|
__u32 oseq;
|
|
__u32 seq;
|
|
__u32 oseq_hi;
|
|
__u32 seq_hi;
|
|
__u32 replay_window;
|
|
__u32 bmp[0];
|
|
};
|
|
|
|
struct xfrm_algo {
|
|
char alg_name[64];
|
|
unsigned int alg_key_len;
|
|
char alg_key[0];
|
|
};
|
|
|
|
struct xfrm_algo_auth {
|
|
char alg_name[64];
|
|
unsigned int alg_key_len;
|
|
unsigned int alg_trunc_len;
|
|
char alg_key[0];
|
|
};
|
|
|
|
struct xfrm_algo_aead {
|
|
char alg_name[64];
|
|
unsigned int alg_key_len;
|
|
unsigned int alg_icv_len;
|
|
char alg_key[0];
|
|
};
|
|
|
|
struct xfrm_stats {
|
|
__u32 replay_window;
|
|
__u32 replay;
|
|
__u32 integrity_failed;
|
|
};
|
|
|
|
enum {
|
|
XFRM_POLICY_TYPE_MAIN = 0,
|
|
XFRM_POLICY_TYPE_SUB = 1,
|
|
XFRM_POLICY_TYPE_MAX = 2,
|
|
XFRM_POLICY_TYPE_ANY = 255
|
|
};
|
|
|
|
enum {
|
|
XFRM_POLICY_IN = 0,
|
|
XFRM_POLICY_OUT = 1,
|
|
XFRM_POLICY_FWD = 2,
|
|
XFRM_POLICY_MASK = 3,
|
|
XFRM_POLICY_MAX = 3
|
|
};
|
|
|
|
enum {
|
|
XFRM_SHARE_ANY,
|
|
XFRM_SHARE_SESSION,
|
|
XFRM_SHARE_USER,
|
|
XFRM_SHARE_UNIQUE
|
|
};
|
|
# 157 "./include/uapi/linux/xfrm.h"
|
|
enum {
|
|
XFRM_MSG_BASE = 0x10,
|
|
|
|
XFRM_MSG_NEWSA = 0x10,
|
|
|
|
XFRM_MSG_DELSA,
|
|
|
|
XFRM_MSG_GETSA,
|
|
|
|
|
|
XFRM_MSG_NEWPOLICY,
|
|
|
|
XFRM_MSG_DELPOLICY,
|
|
|
|
XFRM_MSG_GETPOLICY,
|
|
|
|
|
|
XFRM_MSG_ALLOCSPI,
|
|
|
|
XFRM_MSG_ACQUIRE,
|
|
|
|
XFRM_MSG_EXPIRE,
|
|
|
|
|
|
XFRM_MSG_UPDPOLICY,
|
|
|
|
XFRM_MSG_UPDSA,
|
|
|
|
|
|
XFRM_MSG_POLEXPIRE,
|
|
|
|
|
|
XFRM_MSG_FLUSHSA,
|
|
|
|
XFRM_MSG_FLUSHPOLICY,
|
|
|
|
|
|
XFRM_MSG_NEWAE,
|
|
|
|
XFRM_MSG_GETAE,
|
|
|
|
|
|
XFRM_MSG_REPORT,
|
|
|
|
|
|
XFRM_MSG_MIGRATE,
|
|
|
|
|
|
XFRM_MSG_NEWSADINFO,
|
|
|
|
XFRM_MSG_GETSADINFO,
|
|
|
|
|
|
XFRM_MSG_NEWSPDINFO,
|
|
|
|
XFRM_MSG_GETSPDINFO,
|
|
|
|
|
|
XFRM_MSG_MAPPING,
|
|
|
|
__XFRM_MSG_MAX
|
|
};
|
|
# 227 "./include/uapi/linux/xfrm.h"
|
|
struct xfrm_user_sec_ctx {
|
|
__u16 len;
|
|
__u16 exttype;
|
|
__u8 ctx_alg;
|
|
__u8 ctx_doi;
|
|
__u16 ctx_len;
|
|
};
|
|
|
|
struct xfrm_user_tmpl {
|
|
struct xfrm_id id;
|
|
__u16 family;
|
|
xfrm_address_t saddr;
|
|
__u32 reqid;
|
|
__u8 mode;
|
|
__u8 share;
|
|
__u8 optional;
|
|
__u32 aalgos;
|
|
__u32 ealgos;
|
|
__u32 calgos;
|
|
};
|
|
|
|
struct xfrm_encap_tmpl {
|
|
__u16 encap_type;
|
|
__be16 encap_sport;
|
|
__be16 encap_dport;
|
|
xfrm_address_t encap_oa;
|
|
};
|
|
|
|
|
|
enum xfrm_ae_ftype_t {
|
|
XFRM_AE_UNSPEC,
|
|
XFRM_AE_RTHR=1,
|
|
XFRM_AE_RVAL=2,
|
|
XFRM_AE_LVAL=4,
|
|
XFRM_AE_ETHR=8,
|
|
XFRM_AE_CR=16,
|
|
XFRM_AE_CE=32,
|
|
XFRM_AE_CU=64,
|
|
__XFRM_AE_MAX
|
|
|
|
|
|
};
|
|
|
|
struct xfrm_userpolicy_type {
|
|
__u8 type;
|
|
__u16 reserved1;
|
|
__u8 reserved2;
|
|
};
|
|
|
|
|
|
enum xfrm_attr_type_t {
|
|
XFRMA_UNSPEC,
|
|
XFRMA_ALG_AUTH,
|
|
XFRMA_ALG_CRYPT,
|
|
XFRMA_ALG_COMP,
|
|
XFRMA_ENCAP,
|
|
XFRMA_TMPL,
|
|
XFRMA_SA,
|
|
XFRMA_POLICY,
|
|
XFRMA_SEC_CTX,
|
|
XFRMA_LTIME_VAL,
|
|
XFRMA_REPLAY_VAL,
|
|
XFRMA_REPLAY_THRESH,
|
|
XFRMA_ETIMER_THRESH,
|
|
XFRMA_SRCADDR,
|
|
XFRMA_COADDR,
|
|
XFRMA_LASTUSED,
|
|
XFRMA_POLICY_TYPE,
|
|
XFRMA_MIGRATE,
|
|
XFRMA_ALG_AEAD,
|
|
XFRMA_KMADDRESS,
|
|
XFRMA_ALG_AUTH_TRUNC,
|
|
XFRMA_MARK,
|
|
XFRMA_TFCPAD,
|
|
XFRMA_REPLAY_ESN_VAL,
|
|
XFRMA_SA_EXTRA_FLAGS,
|
|
XFRMA_PROTO,
|
|
XFRMA_ADDRESS_FILTER,
|
|
__XFRMA_MAX
|
|
|
|
|
|
};
|
|
|
|
struct xfrm_mark {
|
|
__u32 v;
|
|
__u32 m;
|
|
};
|
|
|
|
enum xfrm_sadattr_type_t {
|
|
XFRMA_SAD_UNSPEC,
|
|
XFRMA_SAD_CNT,
|
|
XFRMA_SAD_HINFO,
|
|
__XFRMA_SAD_MAX
|
|
|
|
|
|
};
|
|
|
|
struct xfrmu_sadhinfo {
|
|
__u32 sadhcnt;
|
|
__u32 sadhmcnt;
|
|
};
|
|
|
|
enum xfrm_spdattr_type_t {
|
|
XFRMA_SPD_UNSPEC,
|
|
XFRMA_SPD_INFO,
|
|
XFRMA_SPD_HINFO,
|
|
XFRMA_SPD_IPV4_HTHRESH,
|
|
XFRMA_SPD_IPV6_HTHRESH,
|
|
__XFRMA_SPD_MAX
|
|
|
|
|
|
};
|
|
|
|
struct xfrmu_spdinfo {
|
|
__u32 incnt;
|
|
__u32 outcnt;
|
|
__u32 fwdcnt;
|
|
__u32 inscnt;
|
|
__u32 outscnt;
|
|
__u32 fwdscnt;
|
|
};
|
|
|
|
struct xfrmu_spdhinfo {
|
|
__u32 spdhcnt;
|
|
__u32 spdhmcnt;
|
|
};
|
|
|
|
struct xfrmu_spdhthresh {
|
|
__u8 lbits;
|
|
__u8 rbits;
|
|
};
|
|
|
|
struct xfrm_usersa_info {
|
|
struct xfrm_selector sel;
|
|
struct xfrm_id id;
|
|
xfrm_address_t saddr;
|
|
struct xfrm_lifetime_cfg lft;
|
|
struct xfrm_lifetime_cur curlft;
|
|
struct xfrm_stats stats;
|
|
__u32 seq;
|
|
__u32 reqid;
|
|
__u16 family;
|
|
__u8 mode;
|
|
__u8 replay_window;
|
|
__u8 flags;
|
|
# 380 "./include/uapi/linux/xfrm.h"
|
|
};
|
|
|
|
|
|
|
|
struct xfrm_usersa_id {
|
|
xfrm_address_t daddr;
|
|
__be32 spi;
|
|
__u16 family;
|
|
__u8 proto;
|
|
};
|
|
|
|
struct xfrm_aevent_id {
|
|
struct xfrm_usersa_id sa_id;
|
|
xfrm_address_t saddr;
|
|
__u32 flags;
|
|
__u32 reqid;
|
|
};
|
|
|
|
struct xfrm_userspi_info {
|
|
struct xfrm_usersa_info info;
|
|
__u32 min;
|
|
__u32 max;
|
|
};
|
|
|
|
struct xfrm_userpolicy_info {
|
|
struct xfrm_selector sel;
|
|
struct xfrm_lifetime_cfg lft;
|
|
struct xfrm_lifetime_cur curlft;
|
|
__u32 priority;
|
|
__u32 index;
|
|
__u8 dir;
|
|
__u8 action;
|
|
|
|
|
|
__u8 flags;
|
|
|
|
|
|
|
|
__u8 share;
|
|
};
|
|
|
|
struct xfrm_userpolicy_id {
|
|
struct xfrm_selector sel;
|
|
__u32 index;
|
|
__u8 dir;
|
|
};
|
|
|
|
struct xfrm_user_acquire {
|
|
struct xfrm_id id;
|
|
xfrm_address_t saddr;
|
|
struct xfrm_selector sel;
|
|
struct xfrm_userpolicy_info policy;
|
|
__u32 aalgos;
|
|
__u32 ealgos;
|
|
__u32 calgos;
|
|
__u32 seq;
|
|
};
|
|
|
|
struct xfrm_user_expire {
|
|
struct xfrm_usersa_info state;
|
|
__u8 hard;
|
|
};
|
|
|
|
struct xfrm_user_polexpire {
|
|
struct xfrm_userpolicy_info pol;
|
|
__u8 hard;
|
|
};
|
|
|
|
struct xfrm_usersa_flush {
|
|
__u8 proto;
|
|
};
|
|
|
|
struct xfrm_user_report {
|
|
__u8 proto;
|
|
struct xfrm_selector sel;
|
|
};
|
|
|
|
|
|
|
|
struct xfrm_user_kmaddress {
|
|
xfrm_address_t local;
|
|
xfrm_address_t remote;
|
|
__u32 reserved;
|
|
__u16 family;
|
|
};
|
|
|
|
struct xfrm_user_migrate {
|
|
xfrm_address_t old_daddr;
|
|
xfrm_address_t old_saddr;
|
|
xfrm_address_t new_daddr;
|
|
xfrm_address_t new_saddr;
|
|
__u8 proto;
|
|
__u8 mode;
|
|
__u16 reserved;
|
|
__u32 reqid;
|
|
__u16 old_family;
|
|
__u16 new_family;
|
|
};
|
|
|
|
struct xfrm_user_mapping {
|
|
struct xfrm_usersa_id id;
|
|
__u32 reqid;
|
|
xfrm_address_t old_saddr;
|
|
xfrm_address_t new_saddr;
|
|
__be16 old_sport;
|
|
__be16 new_sport;
|
|
};
|
|
|
|
struct xfrm_address_filter {
|
|
xfrm_address_t saddr;
|
|
xfrm_address_t daddr;
|
|
__u16 family;
|
|
__u8 splen;
|
|
__u8 dplen;
|
|
};
|
|
# 505 "./include/uapi/linux/xfrm.h"
|
|
enum xfrm_nlgroups {
|
|
XFRMNLGRP_NONE,
|
|
|
|
XFRMNLGRP_ACQUIRE,
|
|
|
|
XFRMNLGRP_EXPIRE,
|
|
|
|
XFRMNLGRP_SA,
|
|
|
|
XFRMNLGRP_POLICY,
|
|
|
|
XFRMNLGRP_AEVENTS,
|
|
|
|
XFRMNLGRP_REPORT,
|
|
|
|
XFRMNLGRP_MIGRATE,
|
|
|
|
XFRMNLGRP_MAPPING,
|
|
|
|
__XFRMNLGRP_MAX
|
|
};
|
|
# 8 "include/net/netns/xfrm.h" 2
|
|
|
|
# 1 "include/net/flowcache.h" 1
|
|
|
|
|
|
|
|
# 1 "include/linux/interrupt.h" 1
|
|
# 10 "include/linux/interrupt.h"
|
|
# 1 "include/linux/irqreturn.h" 1
|
|
# 10 "include/linux/irqreturn.h"
|
|
enum irqreturn {
|
|
IRQ_NONE = (0 << 0),
|
|
IRQ_HANDLED = (1 << 0),
|
|
IRQ_WAKE_THREAD = (1 << 1),
|
|
};
|
|
|
|
typedef enum irqreturn irqreturn_t;
|
|
# 11 "include/linux/interrupt.h" 2
|
|
|
|
# 1 "include/linux/hardirq.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/ftrace_irq.h" 1
|
|
# 9 "include/linux/ftrace_irq.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ftrace_nmi_enter(void) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ftrace_nmi_exit(void) { }
|
|
# 7 "include/linux/hardirq.h" 2
|
|
# 1 "include/linux/vtime.h" 1
|
|
|
|
|
|
|
|
# 1 "include/linux/context_tracking_state.h" 1
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/static_key.h" 1
|
|
# 6 "include/linux/context_tracking_state.h" 2
|
|
|
|
struct context_tracking {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool active;
|
|
int recursion;
|
|
enum ctx_state {
|
|
CONTEXT_DISABLED = -1,
|
|
CONTEXT_KERNEL = 0,
|
|
CONTEXT_USER,
|
|
CONTEXT_GUEST,
|
|
} state;
|
|
};
|
|
# 43 "include/linux/context_tracking_state.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool context_tracking_in_user(void) { return false; }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool context_tracking_active(void) { return false; }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool context_tracking_is_enabled(void) { return false; }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool context_tracking_cpu_is_enabled(void) { return false; }
|
|
# 5 "include/linux/vtime.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
struct task_struct;
|
|
# 32 "include/linux/vtime.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool vtime_accounting_enabled(void) { return false; }
|
|
# 69 "include/linux/vtime.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void vtime_task_switch(struct task_struct *prev) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void vtime_account_system(struct task_struct *tsk) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void vtime_account_user(struct task_struct *tsk) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void vtime_account_irq_enter(struct task_struct *tsk) { }
|
|
# 95 "include/linux/vtime.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void vtime_account_irq_exit(struct task_struct *tsk)
|
|
{
|
|
|
|
vtime_account_system(tsk);
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void vtime_user_enter(struct task_struct *tsk) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void vtime_user_exit(struct task_struct *tsk) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void vtime_guest_enter(struct task_struct *tsk) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void vtime_guest_exit(struct task_struct *tsk) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void vtime_init_idle(struct task_struct *tsk, int cpu) { }
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void irqtime_account_irq(struct task_struct *tsk) { }
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void account_irq_enter_time(struct task_struct *tsk)
|
|
{
|
|
vtime_account_irq_enter(tsk);
|
|
irqtime_account_irq(tsk);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void account_irq_exit_time(struct task_struct *tsk)
|
|
{
|
|
vtime_account_irq_exit(tsk);
|
|
irqtime_account_irq(tsk);
|
|
}
|
|
# 8 "include/linux/hardirq.h" 2
|
|
# 1 "./arch/arm/include/asm/hardirq.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/irq.h" 1
|
|
|
|
|
|
|
|
# 1 "include/generated/uapi/linux/version.h" 1
|
|
# 5 "./arch/arm/include/asm/irq.h" 2
|
|
# 26 "./arch/arm/include/asm/irq.h"
|
|
struct irqaction;
|
|
struct pt_regs;
|
|
extern void migrate_irqs(void);
|
|
|
|
extern void asm_do_IRQ(unsigned int, struct pt_regs *);
|
|
void handle_IRQ(unsigned int, struct pt_regs *);
|
|
void init_IRQ(void);
|
|
|
|
|
|
extern void (*handle_arch_irq)(struct pt_regs *);
|
|
extern void set_handle_irq(void (*handle_irq)(struct pt_regs *));
|
|
|
|
|
|
|
|
extern void arch_trigger_all_cpu_backtrace(bool);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nr_legacy_irqs(void)
|
|
{
|
|
return 64;
|
|
}
|
|
# 7 "./arch/arm/include/asm/hardirq.h" 2
|
|
|
|
|
|
|
|
typedef struct {
|
|
unsigned int __softirq_pending;
|
|
|
|
unsigned int ipi_irqs[8];
|
|
|
|
} __attribute__((__aligned__((1 << 6)))) irq_cpustat_t;
|
|
|
|
# 1 "include/linux/irq_cpustat.h" 1
|
|
# 20 "include/linux/irq_cpustat.h"
|
|
extern irq_cpustat_t irq_stat[];
|
|
# 18 "./arch/arm/include/asm/hardirq.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
u64 smp_irq_stat_cpu(unsigned int cpu);
|
|
# 9 "include/linux/hardirq.h" 2
|
|
|
|
|
|
extern void synchronize_irq(unsigned int irq);
|
|
extern bool synchronize_hardirq(unsigned int irq);
|
|
# 25 "include/linux/hardirq.h"
|
|
extern void rcu_nmi_enter(void);
|
|
extern void rcu_nmi_exit(void);
|
|
# 45 "include/linux/hardirq.h"
|
|
extern void irq_enter(void);
|
|
# 60 "include/linux/hardirq.h"
|
|
extern void irq_exit(void);
|
|
# 13 "include/linux/interrupt.h" 2
|
|
# 87 "include/linux/interrupt.h"
|
|
enum {
|
|
IRQC_IS_HARDIRQ = 0,
|
|
IRQC_IS_NESTED,
|
|
};
|
|
|
|
typedef irqreturn_t (*irq_handler_t)(int, void *);
|
|
# 110 "include/linux/interrupt.h"
|
|
struct irqaction {
|
|
irq_handler_t handler;
|
|
void *dev_id;
|
|
void *percpu_dev_id;
|
|
struct irqaction *next;
|
|
irq_handler_t thread_fn;
|
|
struct task_struct *thread;
|
|
struct irqaction *secondary;
|
|
unsigned int irq;
|
|
unsigned int flags;
|
|
unsigned long thread_flags;
|
|
unsigned long thread_mask;
|
|
const char *name;
|
|
struct proc_dir_entry *dir;
|
|
} __attribute__((__aligned__(1 << (6))));
|
|
|
|
extern irqreturn_t no_action(int cpl, void *dev_id);
|
|
|
|
extern int __attribute__((warn_unused_result))
|
|
request_threaded_irq(unsigned int irq, irq_handler_t handler,
|
|
irq_handler_t thread_fn,
|
|
unsigned long flags, const char *name, void *dev);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result))
|
|
request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags,
|
|
const char *name, void *dev)
|
|
{
|
|
return request_threaded_irq(irq, handler, ((void *)0), flags, name, dev);
|
|
}
|
|
|
|
extern int __attribute__((warn_unused_result))
|
|
request_any_context_irq(unsigned int irq, irq_handler_t handler,
|
|
unsigned long flags, const char *name, void *dev_id);
|
|
|
|
extern int __attribute__((warn_unused_result))
|
|
request_percpu_irq(unsigned int irq, irq_handler_t handler,
|
|
const char *devname, void *percpu_dev_id);
|
|
|
|
extern void free_irq(unsigned int, void *);
|
|
extern void free_percpu_irq(unsigned int, void *);
|
|
|
|
struct device;
|
|
|
|
extern int __attribute__((warn_unused_result))
|
|
devm_request_threaded_irq(struct device *dev, unsigned int irq,
|
|
irq_handler_t handler, irq_handler_t thread_fn,
|
|
unsigned long irqflags, const char *devname,
|
|
void *dev_id);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __attribute__((warn_unused_result))
|
|
devm_request_irq(struct device *dev, unsigned int irq, irq_handler_t handler,
|
|
unsigned long irqflags, const char *devname, void *dev_id)
|
|
{
|
|
return devm_request_threaded_irq(dev, irq, handler, ((void *)0), irqflags,
|
|
devname, dev_id);
|
|
}
|
|
|
|
extern int __attribute__((warn_unused_result))
|
|
devm_request_any_context_irq(struct device *dev, unsigned int irq,
|
|
irq_handler_t handler, unsigned long irqflags,
|
|
const char *devname, void *dev_id);
|
|
|
|
extern void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id);
|
|
# 192 "include/linux/interrupt.h"
|
|
extern void disable_irq_nosync(unsigned int irq);
|
|
extern bool disable_hardirq(unsigned int irq);
|
|
extern void disable_irq(unsigned int irq);
|
|
extern void disable_percpu_irq(unsigned int irq);
|
|
extern void enable_irq(unsigned int irq);
|
|
extern void enable_percpu_irq(unsigned int irq, unsigned int type);
|
|
extern void irq_wake_thread(unsigned int irq, void *dev_id);
|
|
|
|
|
|
extern void suspend_device_irqs(void);
|
|
extern void resume_device_irqs(void);
|
|
# 216 "include/linux/interrupt.h"
|
|
struct irq_affinity_notify {
|
|
unsigned int irq;
|
|
struct kref kref;
|
|
struct work_struct work;
|
|
void (*notify)(struct irq_affinity_notify *, const cpumask_t *mask);
|
|
void (*release)(struct kref *ref);
|
|
};
|
|
|
|
|
|
|
|
extern cpumask_var_t irq_default_affinity;
|
|
|
|
|
|
extern int __irq_set_affinity(unsigned int irq, const struct cpumask *cpumask,
|
|
bool force);
|
|
# 239 "include/linux/interrupt.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
irq_set_affinity(unsigned int irq, const struct cpumask *cpumask)
|
|
{
|
|
return __irq_set_affinity(irq, cpumask, false);
|
|
}
|
|
# 256 "include/linux/interrupt.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
irq_force_affinity(unsigned int irq, const struct cpumask *cpumask)
|
|
{
|
|
return __irq_set_affinity(irq, cpumask, true);
|
|
}
|
|
|
|
extern int irq_can_set_affinity(unsigned int irq);
|
|
extern int irq_select_affinity(unsigned int irq);
|
|
|
|
extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m);
|
|
|
|
extern int
|
|
irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify);
|
|
# 313 "include/linux/interrupt.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void disable_irq_nosync_lockdep(unsigned int irq)
|
|
{
|
|
disable_irq_nosync(irq);
|
|
|
|
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void disable_irq_nosync_lockdep_irqsave(unsigned int irq, unsigned long *flags)
|
|
{
|
|
disable_irq_nosync(irq);
|
|
|
|
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void disable_irq_lockdep(unsigned int irq)
|
|
{
|
|
disable_irq(irq);
|
|
|
|
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void enable_irq_lockdep(unsigned int irq)
|
|
{
|
|
|
|
|
|
|
|
enable_irq(irq);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void enable_irq_lockdep_irqrestore(unsigned int irq, unsigned long *flags)
|
|
{
|
|
|
|
|
|
|
|
enable_irq(irq);
|
|
}
|
|
|
|
|
|
extern int irq_set_irq_wake(unsigned int irq, unsigned int on);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int enable_irq_wake(unsigned int irq)
|
|
{
|
|
return irq_set_irq_wake(irq, 1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int disable_irq_wake(unsigned int irq)
|
|
{
|
|
return irq_set_irq_wake(irq, 0);
|
|
}
|
|
|
|
|
|
|
|
|
|
enum irqchip_irq_state {
|
|
IRQCHIP_STATE_PENDING,
|
|
IRQCHIP_STATE_ACTIVE,
|
|
IRQCHIP_STATE_MASKED,
|
|
IRQCHIP_STATE_LINE_LEVEL,
|
|
};
|
|
|
|
extern int irq_get_irqchip_state(unsigned int irq, enum irqchip_irq_state which,
|
|
bool *state);
|
|
extern int irq_set_irqchip_state(unsigned int irq, enum irqchip_irq_state which,
|
|
bool state);
|
|
|
|
|
|
extern bool force_irqthreads;
|
|
# 408 "include/linux/interrupt.h"
|
|
enum
|
|
{
|
|
HI_SOFTIRQ=0,
|
|
TIMER_SOFTIRQ,
|
|
NET_TX_SOFTIRQ,
|
|
NET_RX_SOFTIRQ,
|
|
BLOCK_SOFTIRQ,
|
|
BLOCK_IOPOLL_SOFTIRQ,
|
|
TASKLET_SOFTIRQ,
|
|
SCHED_SOFTIRQ,
|
|
HRTIMER_SOFTIRQ,
|
|
|
|
RCU_SOFTIRQ,
|
|
|
|
NR_SOFTIRQS
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern const char * const softirq_to_name[NR_SOFTIRQS];
|
|
|
|
|
|
|
|
|
|
|
|
struct softirq_action
|
|
{
|
|
void (*action)(struct softirq_action *);
|
|
};
|
|
|
|
void do_softirq(void);
|
|
void __do_softirq(void);
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void do_softirq_own_stack(void)
|
|
{
|
|
__do_softirq();
|
|
}
|
|
|
|
|
|
extern void open_softirq(int nr, void (*action)(struct softirq_action *));
|
|
extern void softirq_init(void);
|
|
extern void __raise_softirq_irqoff(unsigned int nr);
|
|
|
|
extern void raise_softirq_irqoff(unsigned int nr);
|
|
extern void raise_softirq(unsigned int nr);
|
|
|
|
extern __attribute__((section(".data..percpu" ""))) __typeof__(struct task_struct *) ksoftirqd;
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct task_struct *this_cpu_ksoftirqd(void)
|
|
{
|
|
return ({ typeof(ksoftirqd) pscr_ret__; do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); switch(sizeof(ksoftirqd)) { case 1: pscr_ret__ = ({ typeof(ksoftirqd) __ret; if ((sizeof(ksoftirqd) == sizeof(char) || sizeof(ksoftirqd) == sizeof(short) || sizeof(ksoftirqd) == sizeof(int) || sizeof(ksoftirqd) == sizeof(long))) __ret = ({ typeof(ksoftirqd) __ret; __asm__ __volatile__("": : :"memory"); __ret = ({ union { typeof(*({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); })) __val; char __c[1]; } __u; if (1) __read_once_size(&(*({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); })), __u.__c, sizeof(*({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); }))); else __read_once_size_nocheck(&(*({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); })), __u.__c, sizeof(*({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); }))); __u.__val; }); __asm__ __volatile__("": : :"memory"); __ret; }); else __ret = ({ typeof(ksoftirqd) __ret; unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); __ret = *({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); }); do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); __ret; }); __ret; }); break; case 2: pscr_ret__ = ({ typeof(ksoftirqd) __ret; if ((sizeof(ksoftirqd) == sizeof(char) || sizeof(ksoftirqd) == sizeof(short) || sizeof(ksoftirqd) == sizeof(int) || sizeof(ksoftirqd) == sizeof(long))) __ret = ({ typeof(ksoftirqd) __ret; __asm__ __volatile__("": : :"memory"); __ret = ({ union { typeof(*({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); })) __val; char __c[1]; } __u; if (1) __read_once_size(&(*({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); })), __u.__c, sizeof(*({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); }))); else __read_once_size_nocheck(&(*({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); })), __u.__c, sizeof(*({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); }))); __u.__val; }); __asm__ __volatile__("": : :"memory"); __ret; }); else __ret = ({ typeof(ksoftirqd) __ret; unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); __ret = *({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); }); do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); __ret; }); __ret; }); break; case 4: pscr_ret__ = ({ typeof(ksoftirqd) __ret; if ((sizeof(ksoftirqd) == sizeof(char) || sizeof(ksoftirqd) == sizeof(short) || sizeof(ksoftirqd) == sizeof(int) || sizeof(ksoftirqd) == sizeof(long))) __ret = ({ typeof(ksoftirqd) __ret; __asm__ __volatile__("": : :"memory"); __ret = ({ union { typeof(*({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); })) __val; char __c[1]; } __u; if (1) __read_once_size(&(*({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); })), __u.__c, sizeof(*({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); }))); else __read_once_size_nocheck(&(*({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); })), __u.__c, sizeof(*({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); }))); __u.__val; }); __asm__ __volatile__("": : :"memory"); __ret; }); else __ret = ({ typeof(ksoftirqd) __ret; unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); __ret = *({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); }); do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); __ret; }); __ret; }); break; case 8: pscr_ret__ = ({ typeof(ksoftirqd) __ret; if ((sizeof(ksoftirqd) == sizeof(char) || sizeof(ksoftirqd) == sizeof(short) || sizeof(ksoftirqd) == sizeof(int) || sizeof(ksoftirqd) == sizeof(long))) __ret = ({ typeof(ksoftirqd) __ret; __asm__ __volatile__("": : :"memory"); __ret = ({ union { typeof(*({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); })) __val; char __c[1]; } __u; if (1) __read_once_size(&(*({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); })), __u.__c, sizeof(*({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); }))); else __read_once_size_nocheck(&(*({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); })), __u.__c, sizeof(*({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); }))); __u.__val; }); __asm__ __volatile__("": : :"memory"); __ret; }); else __ret = ({ typeof(ksoftirqd) __ret; unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); __ret = *({ do { const void *__vpp_verify = (typeof((&(ksoftirqd)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))); (typeof((typeof(*(&(ksoftirqd))) *)(&(ksoftirqd)))) (__ptr + ((__my_cpu_offset()))); }); }); do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); __ret; }); __ret; }); break; default: __bad_size_call_parameter(); break; } pscr_ret__; });
|
|
}
|
|
# 487 "include/linux/interrupt.h"
|
|
struct tasklet_struct
|
|
{
|
|
struct tasklet_struct *next;
|
|
unsigned long state;
|
|
atomic_t count;
|
|
void (*func)(unsigned long);
|
|
unsigned long data;
|
|
};
|
|
# 503 "include/linux/interrupt.h"
|
|
enum
|
|
{
|
|
TASKLET_STATE_SCHED,
|
|
TASKLET_STATE_RUN
|
|
};
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int tasklet_trylock(struct tasklet_struct *t)
|
|
{
|
|
return !_test_and_set_bit(TASKLET_STATE_RUN,&(t)->state);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tasklet_unlock(struct tasklet_struct *t)
|
|
{
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
_clear_bit(TASKLET_STATE_RUN,&(t)->state);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tasklet_unlock_wait(struct tasklet_struct *t)
|
|
{
|
|
while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { __asm__ __volatile__("": : :"memory"); }
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern void __tasklet_schedule(struct tasklet_struct *t);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tasklet_schedule(struct tasklet_struct *t)
|
|
{
|
|
if (!_test_and_set_bit(TASKLET_STATE_SCHED,&t->state))
|
|
__tasklet_schedule(t);
|
|
}
|
|
|
|
extern void __tasklet_hi_schedule(struct tasklet_struct *t);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tasklet_hi_schedule(struct tasklet_struct *t)
|
|
{
|
|
if (!_test_and_set_bit(TASKLET_STATE_SCHED,&t->state))
|
|
__tasklet_hi_schedule(t);
|
|
}
|
|
|
|
extern void __tasklet_hi_schedule_first(struct tasklet_struct *t);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tasklet_hi_schedule_first(struct tasklet_struct *t)
|
|
{
|
|
if (!_test_and_set_bit(TASKLET_STATE_SCHED,&t->state))
|
|
__tasklet_hi_schedule_first(t);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tasklet_disable_nosync(struct tasklet_struct *t)
|
|
{
|
|
atomic_add(1, &t->count);
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tasklet_disable(struct tasklet_struct *t)
|
|
{
|
|
tasklet_disable_nosync(t);
|
|
tasklet_unlock_wait(t);
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tasklet_enable(struct tasklet_struct *t)
|
|
{
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
atomic_sub(1, &t->count);
|
|
}
|
|
|
|
extern void tasklet_kill(struct tasklet_struct *t);
|
|
extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu);
|
|
extern void tasklet_init(struct tasklet_struct *t,
|
|
void (*func)(unsigned long), unsigned long data);
|
|
|
|
struct tasklet_hrtimer {
|
|
struct hrtimer timer;
|
|
struct tasklet_struct tasklet;
|
|
enum hrtimer_restart (*function)(struct hrtimer *);
|
|
};
|
|
|
|
extern void
|
|
tasklet_hrtimer_init(struct tasklet_hrtimer *ttimer,
|
|
enum hrtimer_restart (*function)(struct hrtimer *),
|
|
clockid_t which_clock, enum hrtimer_mode mode);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
void tasklet_hrtimer_start(struct tasklet_hrtimer *ttimer, ktime_t time,
|
|
const enum hrtimer_mode mode)
|
|
{
|
|
hrtimer_start(&ttimer->timer, time, mode);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
void tasklet_hrtimer_cancel(struct tasklet_hrtimer *ttimer)
|
|
{
|
|
hrtimer_cancel(&ttimer->timer);
|
|
tasklet_kill(&ttimer->tasklet);
|
|
}
|
|
# 653 "include/linux/interrupt.h"
|
|
extern unsigned long probe_irq_on(void);
|
|
extern int probe_irq_off(unsigned long);
|
|
extern unsigned int probe_irq_mask(unsigned long);
|
|
|
|
|
|
|
|
|
|
extern void init_irq_proc(void);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct seq_file;
|
|
int show_interrupts(struct seq_file *p, void *v);
|
|
int arch_show_interrupts(struct seq_file *p, int prec);
|
|
|
|
extern int early_irq_init(void);
|
|
extern int arch_probe_nr_irqs(void);
|
|
extern int arch_early_irq_init(void);
|
|
# 5 "include/net/flowcache.h" 2
|
|
|
|
|
|
|
|
|
|
struct flow_cache_percpu {
|
|
struct hlist_head *hash_table;
|
|
int hash_count;
|
|
u32 hash_rnd;
|
|
int hash_rnd_recalc;
|
|
struct tasklet_struct flush_tasklet;
|
|
};
|
|
|
|
struct flow_cache {
|
|
u32 hash_shift;
|
|
struct flow_cache_percpu *percpu;
|
|
struct notifier_block hotcpu_notifier;
|
|
int low_watermark;
|
|
int high_watermark;
|
|
struct timer_list rnd_timer;
|
|
};
|
|
# 10 "include/net/netns/xfrm.h" 2
|
|
|
|
struct ctl_table_header;
|
|
|
|
struct xfrm_policy_hash {
|
|
struct hlist_head *table;
|
|
unsigned int hmask;
|
|
u8 dbits4;
|
|
u8 sbits4;
|
|
u8 dbits6;
|
|
u8 sbits6;
|
|
};
|
|
|
|
struct xfrm_policy_hthresh {
|
|
struct work_struct work;
|
|
seqlock_t lock;
|
|
u8 lbits4;
|
|
u8 rbits4;
|
|
u8 lbits6;
|
|
u8 rbits6;
|
|
};
|
|
|
|
struct netns_xfrm {
|
|
struct list_head state_all;
|
|
# 41 "include/net/netns/xfrm.h"
|
|
struct hlist_head *state_bydst;
|
|
struct hlist_head *state_bysrc;
|
|
struct hlist_head *state_byspi;
|
|
unsigned int state_hmask;
|
|
unsigned int state_num;
|
|
struct work_struct state_hash_work;
|
|
struct hlist_head state_gc_list;
|
|
struct work_struct state_gc_work;
|
|
|
|
struct list_head policy_all;
|
|
struct hlist_head *policy_byidx;
|
|
unsigned int policy_idx_hmask;
|
|
struct hlist_head policy_inexact[XFRM_POLICY_MAX];
|
|
struct xfrm_policy_hash policy_bydst[XFRM_POLICY_MAX];
|
|
unsigned int policy_count[XFRM_POLICY_MAX * 2];
|
|
struct work_struct policy_hash_work;
|
|
struct xfrm_policy_hthresh policy_hthresh;
|
|
|
|
|
|
struct sock *nlsk;
|
|
struct sock *nlsk_stash;
|
|
|
|
u32 sysctl_aevent_etime;
|
|
u32 sysctl_aevent_rseqth;
|
|
int sysctl_larval_drop;
|
|
u32 sysctl_acq_expires;
|
|
|
|
struct ctl_table_header *sysctl_hdr;
|
|
|
|
|
|
struct dst_ops xfrm4_dst_ops;
|
|
|
|
struct dst_ops xfrm6_dst_ops;
|
|
|
|
spinlock_t xfrm_state_lock;
|
|
rwlock_t xfrm_policy_lock;
|
|
struct mutex xfrm_cfg_mutex;
|
|
|
|
|
|
struct flow_cache flow_cache_global;
|
|
atomic_t flow_cache_genid;
|
|
struct list_head flow_cache_gc_list;
|
|
spinlock_t flow_cache_gc_lock;
|
|
struct work_struct flow_cache_gc_work;
|
|
struct work_struct flow_cache_flush_work;
|
|
struct mutex flow_flush_sem;
|
|
};
|
|
# 29 "include/net/net_namespace.h" 2
|
|
# 1 "include/net/netns/mpls.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct mpls_route;
|
|
struct ctl_table_header;
|
|
|
|
struct netns_mpls {
|
|
size_t platform_labels;
|
|
struct mpls_route * *platform_label;
|
|
struct ctl_table_header *ctl;
|
|
};
|
|
# 30 "include/net/net_namespace.h" 2
|
|
# 1 "include/linux/ns_common.h" 1
|
|
|
|
|
|
|
|
struct proc_ns_operations;
|
|
|
|
struct ns_common {
|
|
atomic_long_t stashed;
|
|
const struct proc_ns_operations *ops;
|
|
unsigned int inum;
|
|
};
|
|
# 31 "include/net/net_namespace.h" 2
|
|
|
|
|
|
|
|
struct user_namespace;
|
|
struct proc_dir_entry;
|
|
struct net_device;
|
|
struct sock;
|
|
struct ctl_table_header;
|
|
struct net_generic;
|
|
struct sock;
|
|
struct netns_ipvs;
|
|
|
|
|
|
|
|
|
|
|
|
struct net {
|
|
atomic_t passive;
|
|
|
|
|
|
atomic_t count;
|
|
|
|
|
|
spinlock_t rules_mod_lock;
|
|
|
|
atomic64_t cookie_gen;
|
|
|
|
struct list_head list;
|
|
struct list_head cleanup_list;
|
|
struct list_head exit_list;
|
|
|
|
struct user_namespace *user_ns;
|
|
spinlock_t nsid_lock;
|
|
struct idr netns_ids;
|
|
|
|
struct ns_common ns;
|
|
|
|
struct proc_dir_entry *proc_net;
|
|
struct proc_dir_entry *proc_net_stat;
|
|
|
|
|
|
struct ctl_table_set sysctls;
|
|
|
|
|
|
struct sock *rtnl;
|
|
struct sock *genl_sock;
|
|
|
|
struct list_head dev_base_head;
|
|
struct hlist_head *dev_name_head;
|
|
struct hlist_head *dev_index_head;
|
|
unsigned int dev_base_seq;
|
|
int ifindex;
|
|
unsigned int dev_unreg_count;
|
|
|
|
|
|
struct list_head rules_ops;
|
|
|
|
|
|
struct net_device *loopback_dev;
|
|
struct netns_core core;
|
|
struct netns_mib mib;
|
|
struct netns_packet packet;
|
|
struct netns_unix unx;
|
|
struct netns_ipv4 ipv4;
|
|
|
|
struct netns_ipv6 ipv6;
|
|
# 108 "include/net/net_namespace.h"
|
|
struct netns_nf nf;
|
|
struct netns_xt xt;
|
|
|
|
struct netns_ct ct;
|
|
|
|
|
|
|
|
|
|
|
|
struct netns_nf_frag nf_frag;
|
|
|
|
struct sock *nfnl;
|
|
struct sock *nfnl_stash;
|
|
|
|
|
|
|
|
|
|
|
|
struct sk_buff_head wext_nlevents;
|
|
|
|
struct net_generic *gen;
|
|
|
|
|
|
|
|
struct netns_xfrm xfrm;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct sock *diag_nlsk;
|
|
atomic_t fnhe_genid;
|
|
};
|
|
|
|
# 1 "include/linux/seq_file_net.h" 1
|
|
|
|
|
|
|
|
# 1 "include/linux/seq_file.h" 1
|
|
# 10 "include/linux/seq_file.h"
|
|
# 1 "include/linux/fs.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/kdev_t.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/kdev_t.h" 1
|
|
# 5 "include/linux/kdev_t.h" 2
|
|
# 23 "include/linux/kdev_t.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool old_valid_dev(dev_t dev)
|
|
{
|
|
return ((unsigned int) ((dev) >> 20)) < 256 && ((unsigned int) ((dev) & ((1U << 20) - 1))) < 256;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u16 old_encode_dev(dev_t dev)
|
|
{
|
|
return (((unsigned int) ((dev) >> 20)) << 8) | ((unsigned int) ((dev) & ((1U << 20) - 1)));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) dev_t old_decode_dev(u16 val)
|
|
{
|
|
return ((((val >> 8) & 255) << 20) | (val & 255));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool new_valid_dev(dev_t dev)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 new_encode_dev(dev_t dev)
|
|
{
|
|
unsigned major = ((unsigned int) ((dev) >> 20));
|
|
unsigned minor = ((unsigned int) ((dev) & ((1U << 20) - 1)));
|
|
return (minor & 0xff) | (major << 8) | ((minor & ~0xff) << 12);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) dev_t new_decode_dev(u32 dev)
|
|
{
|
|
unsigned major = (dev & 0xfff00) >> 8;
|
|
unsigned minor = (dev & 0xff) | ((dev >> 12) & 0xfff00);
|
|
return (((major) << 20) | (minor));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 huge_encode_dev(dev_t dev)
|
|
{
|
|
return new_encode_dev(dev);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) dev_t huge_decode_dev(u64 dev)
|
|
{
|
|
return new_decode_dev(dev);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sysv_valid_dev(dev_t dev)
|
|
{
|
|
return ((unsigned int) ((dev) >> 20)) < (1<<14) && ((unsigned int) ((dev) & ((1U << 20) - 1))) < (1<<18);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 sysv_encode_dev(dev_t dev)
|
|
{
|
|
return ((unsigned int) ((dev) & ((1U << 20) - 1))) | (((unsigned int) ((dev) >> 20)) << 18);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned sysv_major(u32 dev)
|
|
{
|
|
return (dev >> 18) & 0x3fff;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned sysv_minor(u32 dev)
|
|
{
|
|
return dev & 0x3ffff;
|
|
}
|
|
# 7 "include/linux/fs.h" 2
|
|
# 1 "include/linux/dcache.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/rculist_bl.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/list_bl.h" 1
|
|
# 33 "include/linux/list_bl.h"
|
|
struct hlist_bl_head {
|
|
struct hlist_bl_node *first;
|
|
};
|
|
|
|
struct hlist_bl_node {
|
|
struct hlist_bl_node *next, **pprev;
|
|
};
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void INIT_HLIST_BL_NODE(struct hlist_bl_node *h)
|
|
{
|
|
h->next = ((void *)0);
|
|
h->pprev = ((void *)0);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hlist_bl_unhashed(const struct hlist_bl_node *h)
|
|
{
|
|
return !h->pprev;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct hlist_bl_node *hlist_bl_first(struct hlist_bl_head *h)
|
|
{
|
|
return (struct hlist_bl_node *)
|
|
((unsigned long)h->first & ~1UL);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_set_first(struct hlist_bl_head *h,
|
|
struct hlist_bl_node *n)
|
|
{
|
|
;
|
|
|
|
;
|
|
h->first = (struct hlist_bl_node *)((unsigned long)n | 1UL);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int hlist_bl_empty(const struct hlist_bl_head *h)
|
|
{
|
|
return !((unsigned long)h->first & ~1UL);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_add_head(struct hlist_bl_node *n,
|
|
struct hlist_bl_head *h)
|
|
{
|
|
struct hlist_bl_node *first = hlist_bl_first(h);
|
|
|
|
n->next = first;
|
|
if (first)
|
|
first->pprev = &n->next;
|
|
n->pprev = &h->first;
|
|
hlist_bl_set_first(h, n);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __hlist_bl_del(struct hlist_bl_node *n)
|
|
{
|
|
struct hlist_bl_node *next = n->next;
|
|
struct hlist_bl_node **pprev = n->pprev;
|
|
|
|
;
|
|
|
|
|
|
({ union { typeof(*pprev) __val; char __c[1]; } __u = { .__val = ( typeof(*pprev)) ((struct hlist_bl_node *) ((unsigned long)next | ((unsigned long)*pprev & 1UL))) }; __write_once_size(&(*pprev), __u.__c, sizeof(*pprev)); __u.__val; })
|
|
|
|
|
|
;
|
|
if (next)
|
|
next->pprev = pprev;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_del(struct hlist_bl_node *n)
|
|
{
|
|
__hlist_bl_del(n);
|
|
n->next = ((void *) 0x100 + 0);
|
|
n->pprev = ((void *) 0x200 + 0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_del_init(struct hlist_bl_node *n)
|
|
{
|
|
if (!hlist_bl_unhashed(n)) {
|
|
__hlist_bl_del(n);
|
|
INIT_HLIST_BL_NODE(n);
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_lock(struct hlist_bl_head *b)
|
|
{
|
|
bit_spin_lock(0, (unsigned long *)b);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_unlock(struct hlist_bl_head *b)
|
|
{
|
|
__bit_spin_unlock(0, (unsigned long *)b);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool hlist_bl_is_locked(struct hlist_bl_head *b)
|
|
{
|
|
return bit_spin_is_locked(0, (unsigned long *)b);
|
|
}
|
|
# 8 "include/linux/rculist_bl.h" 2
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_set_first_rcu(struct hlist_bl_head *h,
|
|
struct hlist_bl_node *n)
|
|
{
|
|
;
|
|
|
|
;
|
|
do { do { bool __cond = !((sizeof(*&h->first) == sizeof(char) || sizeof(*&h->first) == sizeof(short) || sizeof(*&h->first) == sizeof(int) || sizeof(*&h->first) == sizeof(long))); extern void __compiletime_assert_17(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_17(); do { } while (0); } while (0); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); ({ union { typeof(*&h->first) __val; char __c[1]; } __u = { .__val = ( typeof(*&h->first)) ((typeof(*((struct hlist_bl_node *)((unsigned long)n | 1UL))) *)((struct hlist_bl_node *)((unsigned long)n | 1UL))) }; __write_once_size(&(*&h->first), __u.__c, sizeof(*&h->first)); __u.__val; }); } while (0)
|
|
;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct hlist_bl_node *hlist_bl_first_rcu(struct hlist_bl_head *h)
|
|
{
|
|
return (struct hlist_bl_node *)
|
|
((unsigned long)({ typeof(*(h->first)) *________p1 = (typeof(*(h->first)) *)({ typeof((h->first)) _________p1 = ({ union { typeof((h->first)) __val; char __c[1]; } __u; if (1) __read_once_size(&((h->first)), __u.__c, sizeof((h->first))); else __read_once_size_nocheck(&((h->first)), __u.__c, sizeof((h->first))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(h->first)) *)(________p1)); }) & ~1UL);
|
|
}
|
|
# 46 "include/linux/rculist_bl.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_del_init_rcu(struct hlist_bl_node *n)
|
|
{
|
|
if (!hlist_bl_unhashed(n)) {
|
|
__hlist_bl_del(n);
|
|
n->pprev = ((void *)0);
|
|
}
|
|
}
|
|
# 73 "include/linux/rculist_bl.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_del_rcu(struct hlist_bl_node *n)
|
|
{
|
|
__hlist_bl_del(n);
|
|
n->pprev = ((void *) 0x200 + 0);
|
|
}
|
|
# 98 "include/linux/rculist_bl.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_bl_add_head_rcu(struct hlist_bl_node *n,
|
|
struct hlist_bl_head *h)
|
|
{
|
|
struct hlist_bl_node *first;
|
|
|
|
|
|
first = hlist_bl_first(h);
|
|
|
|
n->next = first;
|
|
if (first)
|
|
first->pprev = &n->next;
|
|
n->pprev = &h->first;
|
|
|
|
|
|
hlist_bl_set_first_rcu(h, n);
|
|
}
|
|
# 8 "include/linux/dcache.h" 2
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/lockref.h" 1
|
|
# 24 "include/linux/lockref.h"
|
|
struct lockref {
|
|
union {
|
|
|
|
__u64 __attribute__((aligned(8))) lock_count;
|
|
|
|
struct {
|
|
spinlock_t lock;
|
|
int count;
|
|
};
|
|
};
|
|
};
|
|
|
|
extern void lockref_get(struct lockref *);
|
|
extern int lockref_put_return(struct lockref *);
|
|
extern int lockref_get_not_zero(struct lockref *);
|
|
extern int lockref_get_or_lock(struct lockref *);
|
|
extern int lockref_put_or_lock(struct lockref *);
|
|
|
|
extern void lockref_mark_dead(struct lockref *);
|
|
extern int lockref_get_not_dead(struct lockref *);
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __lockref_is_dead(const struct lockref *l)
|
|
{
|
|
return ((int)l->count < 0);
|
|
}
|
|
# 13 "include/linux/dcache.h" 2
|
|
|
|
struct path;
|
|
struct vfsmount;
|
|
# 44 "include/linux/dcache.h"
|
|
struct qstr {
|
|
union {
|
|
struct {
|
|
u32 hash; u32 len;;
|
|
};
|
|
u64 hash_len;
|
|
};
|
|
const unsigned char *name;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct dentry_stat_t {
|
|
long nr_dentry;
|
|
long nr_unused;
|
|
long age_limit;
|
|
long want_pages;
|
|
long dummy[2];
|
|
};
|
|
extern struct dentry_stat_t dentry_stat;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
|
|
partial_name_hash(unsigned long c, unsigned long prevhash)
|
|
{
|
|
return (prevhash + (c << 4) + (c >> 4)) * 11;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long end_name_hash(unsigned long hash)
|
|
{
|
|
return (unsigned int) hash;
|
|
}
|
|
|
|
|
|
extern unsigned int full_name_hash(const unsigned char *, unsigned int);
|
|
# 108 "include/linux/dcache.h"
|
|
struct dentry {
|
|
|
|
unsigned int d_flags;
|
|
seqcount_t d_seq;
|
|
struct hlist_bl_node d_hash;
|
|
struct dentry *d_parent;
|
|
struct qstr d_name;
|
|
struct inode *d_inode;
|
|
|
|
unsigned char d_iname[36];
|
|
|
|
|
|
struct lockref d_lockref;
|
|
const struct dentry_operations *d_op;
|
|
struct super_block *d_sb;
|
|
unsigned long d_time;
|
|
void *d_fsdata;
|
|
|
|
struct list_head d_lru;
|
|
struct list_head d_child;
|
|
struct list_head d_subdirs;
|
|
|
|
|
|
|
|
union {
|
|
struct hlist_node d_alias;
|
|
struct callback_head d_rcu;
|
|
} d_u;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum dentry_d_lock_class
|
|
{
|
|
DENTRY_D_LOCK_NORMAL,
|
|
DENTRY_D_LOCK_NESTED
|
|
};
|
|
|
|
struct dentry_operations {
|
|
int (*d_revalidate)(struct dentry *, unsigned int);
|
|
int (*d_weak_revalidate)(struct dentry *, unsigned int);
|
|
int (*d_hash)(const struct dentry *, struct qstr *);
|
|
int (*d_compare)(const struct dentry *, const struct dentry *,
|
|
unsigned int, const char *, const struct qstr *);
|
|
int (*d_delete)(const struct dentry *);
|
|
void (*d_release)(struct dentry *);
|
|
void (*d_prune)(struct dentry *);
|
|
void (*d_iput)(struct dentry *, struct inode *);
|
|
char *(*d_dname)(struct dentry *, char *, int);
|
|
struct vfsmount *(*d_automount)(struct path *);
|
|
int (*d_manage)(struct dentry *, bool);
|
|
struct inode *(*d_select_inode)(struct dentry *, unsigned);
|
|
struct dentry *(*d_real)(struct dentry *, struct inode *);
|
|
} __attribute__((__aligned__((1 << 6))));
|
|
# 233 "include/linux/dcache.h"
|
|
extern seqlock_t rename_lock;
|
|
|
|
|
|
|
|
|
|
extern void d_instantiate(struct dentry *, struct inode *);
|
|
extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *);
|
|
extern int d_instantiate_no_diralias(struct dentry *, struct inode *);
|
|
extern void __d_drop(struct dentry *dentry);
|
|
extern void d_drop(struct dentry *dentry);
|
|
extern void d_delete(struct dentry *);
|
|
extern void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op);
|
|
|
|
|
|
extern struct dentry * d_alloc(struct dentry *, const struct qstr *);
|
|
extern struct dentry * d_alloc_pseudo(struct super_block *, const struct qstr *);
|
|
extern struct dentry * d_splice_alias(struct inode *, struct dentry *);
|
|
extern struct dentry * d_add_ci(struct dentry *, struct inode *, struct qstr *);
|
|
extern struct dentry *d_find_any_alias(struct inode *inode);
|
|
extern struct dentry * d_obtain_alias(struct inode *);
|
|
extern struct dentry * d_obtain_root(struct inode *);
|
|
extern void shrink_dcache_sb(struct super_block *);
|
|
extern void shrink_dcache_parent(struct dentry *);
|
|
extern void shrink_dcache_for_umount(struct super_block *);
|
|
extern void d_invalidate(struct dentry *);
|
|
|
|
|
|
extern struct dentry * d_make_root(struct inode *);
|
|
|
|
|
|
extern void d_genocide(struct dentry *);
|
|
|
|
extern void d_tmpfile(struct dentry *, struct inode *);
|
|
|
|
extern struct dentry *d_find_alias(struct inode *);
|
|
extern void d_prune_aliases(struct inode *);
|
|
|
|
|
|
extern int have_submounts(struct dentry *);
|
|
|
|
|
|
|
|
|
|
extern void d_rehash(struct dentry *);
|
|
# 287 "include/linux/dcache.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void d_add(struct dentry *entry, struct inode *inode)
|
|
{
|
|
d_instantiate(entry, inode);
|
|
d_rehash(entry);
|
|
}
|
|
# 301 "include/linux/dcache.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dentry *d_add_unique(struct dentry *entry, struct inode *inode)
|
|
{
|
|
struct dentry *res;
|
|
|
|
res = d_instantiate_unique(entry, inode);
|
|
d_rehash(res != ((void *)0) ? res : entry);
|
|
return res;
|
|
}
|
|
|
|
extern void dentry_update_name_case(struct dentry *, struct qstr *);
|
|
|
|
|
|
extern void d_move(struct dentry *, struct dentry *);
|
|
extern void d_exchange(struct dentry *, struct dentry *);
|
|
extern struct dentry *d_ancestor(struct dentry *, struct dentry *);
|
|
|
|
|
|
extern struct dentry *d_lookup(const struct dentry *, const struct qstr *);
|
|
extern struct dentry *d_hash_and_lookup(struct dentry *, struct qstr *);
|
|
extern struct dentry *__d_lookup(const struct dentry *, const struct qstr *);
|
|
extern struct dentry *__d_lookup_rcu(const struct dentry *parent,
|
|
const struct qstr *name, unsigned *seq);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned d_count(const struct dentry *dentry)
|
|
{
|
|
return dentry->d_lockref.count;
|
|
}
|
|
|
|
|
|
|
|
|
|
extern __attribute__((format(printf, 4, 5)))
|
|
char *dynamic_dname(struct dentry *, char *, int, const char *, ...);
|
|
extern char *simple_dname(struct dentry *, char *, int);
|
|
|
|
extern char *__d_path(const struct path *, const struct path *, char *, int);
|
|
extern char *d_absolute_path(const struct path *, char *, int);
|
|
extern char *d_path(const struct path *, char *, int);
|
|
extern char *dentry_path_raw(struct dentry *, char *, int);
|
|
extern char *dentry_path(struct dentry *, char *, int);
|
|
# 352 "include/linux/dcache.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dentry *dget_dlock(struct dentry *dentry)
|
|
{
|
|
if (dentry)
|
|
dentry->d_lockref.count++;
|
|
return dentry;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dentry *dget(struct dentry *dentry)
|
|
{
|
|
if (dentry)
|
|
lockref_get(&dentry->d_lockref);
|
|
return dentry;
|
|
}
|
|
|
|
extern struct dentry *dget_parent(struct dentry *dentry);
|
|
# 375 "include/linux/dcache.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int d_unhashed(const struct dentry *dentry)
|
|
{
|
|
return hlist_bl_unhashed(&dentry->d_hash);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int d_unlinked(const struct dentry *dentry)
|
|
{
|
|
return d_unhashed(dentry) && !((dentry) == (dentry)->d_parent);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cant_mount(const struct dentry *dentry)
|
|
{
|
|
return (dentry->d_flags & 0x00000100);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dont_mount(struct dentry *dentry)
|
|
{
|
|
spin_lock(&dentry->d_lockref.lock);
|
|
dentry->d_flags |= 0x00000100;
|
|
spin_unlock(&dentry->d_lockref.lock);
|
|
}
|
|
|
|
extern void dput(struct dentry *);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_managed(const struct dentry *dentry)
|
|
{
|
|
return dentry->d_flags & (0x00010000|0x00020000|0x00040000);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_mountpoint(const struct dentry *dentry)
|
|
{
|
|
return dentry->d_flags & 0x00010000;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned __d_entry_type(const struct dentry *dentry)
|
|
{
|
|
return dentry->d_flags & 0x00700000;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_miss(const struct dentry *dentry)
|
|
{
|
|
return __d_entry_type(dentry) == 0x00000000;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_whiteout(const struct dentry *dentry)
|
|
{
|
|
return __d_entry_type(dentry) == 0x00100000;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_can_lookup(const struct dentry *dentry)
|
|
{
|
|
return __d_entry_type(dentry) == 0x00200000;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_autodir(const struct dentry *dentry)
|
|
{
|
|
return __d_entry_type(dentry) == 0x00300000;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_dir(const struct dentry *dentry)
|
|
{
|
|
return d_can_lookup(dentry) || d_is_autodir(dentry);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_symlink(const struct dentry *dentry)
|
|
{
|
|
return __d_entry_type(dentry) == 0x00600000;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_reg(const struct dentry *dentry)
|
|
{
|
|
return __d_entry_type(dentry) == 0x00400000;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_special(const struct dentry *dentry)
|
|
{
|
|
return __d_entry_type(dentry) == 0x00500000;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_file(const struct dentry *dentry)
|
|
{
|
|
return d_is_reg(dentry) || d_is_special(dentry);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_negative(const struct dentry *dentry)
|
|
{
|
|
|
|
return d_is_miss(dentry);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_positive(const struct dentry *dentry)
|
|
{
|
|
return !d_is_negative(dentry);
|
|
}
|
|
# 488 "include/linux/dcache.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_really_is_negative(const struct dentry *dentry)
|
|
{
|
|
return dentry->d_inode == ((void *)0);
|
|
}
|
|
# 506 "include/linux/dcache.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_really_is_positive(const struct dentry *dentry)
|
|
{
|
|
return dentry->d_inode != ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int simple_positive(struct dentry *dentry)
|
|
{
|
|
return d_really_is_positive(dentry) && !d_unhashed(dentry);
|
|
}
|
|
|
|
extern void d_set_fallthru(struct dentry *dentry);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool d_is_fallthru(const struct dentry *dentry)
|
|
{
|
|
return dentry->d_flags & 0x01000000;
|
|
}
|
|
|
|
|
|
extern int sysctl_vfs_cache_pressure;
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long vfs_pressure_ratio(unsigned long val)
|
|
{
|
|
return ( { typeof(val) quot = (val) / (100); typeof(val) rem = (val) % (100); (quot * (sysctl_vfs_cache_pressure)) + ((rem * (sysctl_vfs_cache_pressure)) / (100)); } );
|
|
}
|
|
# 538 "include/linux/dcache.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct inode *d_inode(const struct dentry *dentry)
|
|
{
|
|
return dentry->d_inode;
|
|
}
|
|
# 550 "include/linux/dcache.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct inode *d_inode_rcu(const struct dentry *dentry)
|
|
{
|
|
return (*({ __attribute__((unused)) typeof(dentry->d_inode) __var = ( typeof(dentry->d_inode)) 0; (volatile typeof(dentry->d_inode) *)&(dentry->d_inode); }));
|
|
}
|
|
# 565 "include/linux/dcache.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct inode *d_backing_inode(const struct dentry *upper)
|
|
{
|
|
struct inode *inode = upper->d_inode;
|
|
|
|
return inode;
|
|
}
|
|
# 582 "include/linux/dcache.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dentry *d_backing_dentry(struct dentry *upper)
|
|
{
|
|
return upper;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dentry *d_real(struct dentry *dentry)
|
|
{
|
|
if (__builtin_expect(!!(dentry->d_flags & 0x08000000), 0))
|
|
return dentry->d_op->d_real(dentry, ((void *)0));
|
|
else
|
|
return dentry;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct inode *vfs_select_inode(struct dentry *dentry,
|
|
unsigned open_flags)
|
|
{
|
|
struct inode *inode = d_inode(dentry);
|
|
|
|
if (inode && __builtin_expect(!!(dentry->d_flags & 0x02000000), 0))
|
|
inode = dentry->d_op->d_select_inode(dentry, open_flags);
|
|
|
|
return inode;
|
|
}
|
|
# 613 "include/linux/dcache.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct inode *d_real_inode(struct dentry *dentry)
|
|
{
|
|
return d_backing_inode(d_real(dentry));
|
|
}
|
|
|
|
struct name_snapshot {
|
|
const char *name;
|
|
char inline_name[36];
|
|
};
|
|
void take_dentry_name_snapshot(struct name_snapshot *, struct dentry *);
|
|
void release_dentry_name_snapshot(struct name_snapshot *);
|
|
# 8 "include/linux/fs.h" 2
|
|
# 1 "include/linux/path.h" 1
|
|
|
|
|
|
|
|
struct dentry;
|
|
struct vfsmount;
|
|
|
|
struct path {
|
|
struct vfsmount *mnt;
|
|
struct dentry *dentry;
|
|
};
|
|
|
|
extern void path_get(const struct path *);
|
|
extern void path_put(const struct path *);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int path_equal(const struct path *path1, const struct path *path2)
|
|
{
|
|
return path1->mnt == path2->mnt && path1->dentry == path2->dentry;
|
|
}
|
|
# 9 "include/linux/fs.h" 2
|
|
|
|
|
|
|
|
# 1 "include/linux/list_lru.h" 1
|
|
# 14 "include/linux/list_lru.h"
|
|
struct mem_cgroup;
|
|
|
|
|
|
enum lru_status {
|
|
LRU_REMOVED,
|
|
LRU_REMOVED_RETRY,
|
|
|
|
LRU_ROTATE,
|
|
LRU_SKIP,
|
|
LRU_RETRY,
|
|
|
|
};
|
|
|
|
struct list_lru_one {
|
|
struct list_head list;
|
|
|
|
long nr_items;
|
|
};
|
|
|
|
struct list_lru_memcg {
|
|
|
|
struct list_lru_one *lru[0];
|
|
};
|
|
|
|
struct list_lru_node {
|
|
|
|
spinlock_t lock;
|
|
|
|
struct list_lru_one lru;
|
|
|
|
|
|
|
|
|
|
long nr_items;
|
|
} __attribute__((__aligned__((1 << 6))));
|
|
|
|
struct list_lru {
|
|
struct list_lru_node *node;
|
|
|
|
|
|
|
|
};
|
|
|
|
void list_lru_destroy(struct list_lru *lru);
|
|
int __list_lru_init(struct list_lru *lru, bool memcg_aware,
|
|
struct lock_class_key *key);
|
|
|
|
|
|
|
|
|
|
|
|
int memcg_update_all_list_lrus(int num_memcgs);
|
|
void memcg_drain_all_list_lrus(int src_idx, int dst_idx);
|
|
# 84 "include/linux/list_lru.h"
|
|
bool list_lru_add(struct list_lru *lru, struct list_head *item);
|
|
# 97 "include/linux/list_lru.h"
|
|
bool list_lru_del(struct list_lru *lru, struct list_head *item);
|
|
# 109 "include/linux/list_lru.h"
|
|
unsigned long list_lru_count_one(struct list_lru *lru,
|
|
int nid, struct mem_cgroup *memcg);
|
|
unsigned long list_lru_count_node(struct list_lru *lru, int nid);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long list_lru_shrink_count(struct list_lru *lru,
|
|
struct shrink_control *sc)
|
|
{
|
|
return list_lru_count_one(lru, sc->nid, sc->memcg);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long list_lru_count(struct list_lru *lru)
|
|
{
|
|
long count = 0;
|
|
int nid;
|
|
|
|
for ( (nid) = 0; (nid) == 0; (nid) = 1)
|
|
count += list_lru_count_node(lru, nid);
|
|
|
|
return count;
|
|
}
|
|
|
|
void list_lru_isolate(struct list_lru_one *list, struct list_head *item);
|
|
void list_lru_isolate_move(struct list_lru_one *list, struct list_head *item,
|
|
struct list_head *head);
|
|
|
|
typedef enum lru_status (*list_lru_walk_cb)(struct list_head *item,
|
|
struct list_lru_one *list, spinlock_t *lock, void *cb_arg);
|
|
# 159 "include/linux/list_lru.h"
|
|
unsigned long list_lru_walk_one(struct list_lru *lru,
|
|
int nid, struct mem_cgroup *memcg,
|
|
list_lru_walk_cb isolate, void *cb_arg,
|
|
unsigned long *nr_to_walk);
|
|
unsigned long list_lru_walk_node(struct list_lru *lru, int nid,
|
|
list_lru_walk_cb isolate, void *cb_arg,
|
|
unsigned long *nr_to_walk);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
|
|
list_lru_shrink_walk(struct list_lru *lru, struct shrink_control *sc,
|
|
list_lru_walk_cb isolate, void *cb_arg)
|
|
{
|
|
return list_lru_walk_one(lru, sc->nid, sc->memcg, isolate, cb_arg,
|
|
&sc->nr_to_scan);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
|
|
list_lru_walk(struct list_lru *lru, list_lru_walk_cb isolate,
|
|
void *cb_arg, unsigned long nr_to_walk)
|
|
{
|
|
long isolated = 0;
|
|
int nid;
|
|
|
|
for ( (nid) = 0; (nid) == 0; (nid) = 1) {
|
|
isolated += list_lru_walk_node(lru, nid, isolate,
|
|
cb_arg, &nr_to_walk);
|
|
if (nr_to_walk <= 0)
|
|
break;
|
|
}
|
|
return isolated;
|
|
}
|
|
# 13 "include/linux/fs.h" 2
|
|
|
|
# 1 "include/linux/radix-tree.h" 1
|
|
# 54 "include/linux/radix-tree.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int radix_tree_is_indirect_ptr(void *ptr)
|
|
{
|
|
return (int)((unsigned long)ptr & 1);
|
|
}
|
|
# 87 "include/linux/radix-tree.h"
|
|
struct radix_tree_node {
|
|
unsigned int path;
|
|
unsigned int count;
|
|
union {
|
|
struct {
|
|
|
|
struct radix_tree_node *parent;
|
|
|
|
void *private_data;
|
|
};
|
|
|
|
struct callback_head callback_head;
|
|
};
|
|
|
|
struct list_head private_list;
|
|
void *slots[(1UL << (0 ? 4 : 6))];
|
|
unsigned long tags[3][(((1UL << (0 ? 4 : 6)) + 32 - 1) / 32)];
|
|
};
|
|
|
|
|
|
struct radix_tree_root {
|
|
unsigned int height;
|
|
gfp_t gfp_mask;
|
|
struct radix_tree_node *rnode;
|
|
};
|
|
# 194 "include/linux/radix-tree.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *radix_tree_deref_slot(void **pslot)
|
|
{
|
|
return ({ typeof(*(*pslot)) *________p1 = (typeof(*(*pslot)) *)({ typeof((*pslot)) _________p1 = ({ union { typeof((*pslot)) __val; char __c[1]; } __u; if (1) __read_once_size(&((*pslot)), __u.__c, sizeof((*pslot))); else __read_once_size_nocheck(&((*pslot)), __u.__c, sizeof((*pslot))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(*pslot)) *)(________p1)); });
|
|
}
|
|
# 209 "include/linux/radix-tree.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *radix_tree_deref_slot_protected(void **pslot,
|
|
spinlock_t *treelock)
|
|
{
|
|
return ({ do { } while (0); ; ((typeof(*(*pslot)) *)((*pslot))); });
|
|
}
|
|
# 222 "include/linux/radix-tree.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int radix_tree_deref_retry(void *arg)
|
|
{
|
|
return __builtin_expect(!!((unsigned long)arg & 1), 0);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int radix_tree_exceptional_entry(void *arg)
|
|
{
|
|
|
|
return (unsigned long)arg & 2;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int radix_tree_exception(void *arg)
|
|
{
|
|
return __builtin_expect(!!((unsigned long)arg & (1 | 2)), 0)
|
|
;
|
|
}
|
|
# 257 "include/linux/radix-tree.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void radix_tree_replace_slot(void **pslot, void *item)
|
|
{
|
|
do { if (__builtin_expect(!!(radix_tree_is_indirect_ptr(item)), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/radix-tree.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "259" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
do { do { bool __cond = !((sizeof(*&*pslot) == sizeof(char) || sizeof(*&*pslot) == sizeof(short) || sizeof(*&*pslot) == sizeof(int) || sizeof(*&*pslot) == sizeof(long))); extern void __compiletime_assert_260(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_260(); do { } while (0); } while (0); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); ({ union { typeof(*&*pslot) __val; char __c[1]; } __u = { .__val = ( typeof(*&*pslot)) ((typeof(*(item)) *)(item)) }; __write_once_size(&(*&*pslot), __u.__c, sizeof(*&*pslot)); __u.__val; }); } while (0);
|
|
}
|
|
|
|
int __radix_tree_create(struct radix_tree_root *root, unsigned long index,
|
|
struct radix_tree_node **nodep, void ***slotp);
|
|
int radix_tree_insert(struct radix_tree_root *, unsigned long, void *);
|
|
void *__radix_tree_lookup(struct radix_tree_root *root, unsigned long index,
|
|
struct radix_tree_node **nodep, void ***slotp);
|
|
void *radix_tree_lookup(struct radix_tree_root *, unsigned long);
|
|
void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long);
|
|
bool __radix_tree_delete_node(struct radix_tree_root *root,
|
|
struct radix_tree_node *node);
|
|
void *radix_tree_delete_item(struct radix_tree_root *, unsigned long, void *);
|
|
void *radix_tree_delete(struct radix_tree_root *, unsigned long);
|
|
unsigned int
|
|
radix_tree_gang_lookup(struct radix_tree_root *root, void **results,
|
|
unsigned long first_index, unsigned int max_items);
|
|
unsigned int radix_tree_gang_lookup_slot(struct radix_tree_root *root,
|
|
void ***results, unsigned long *indices,
|
|
unsigned long first_index, unsigned int max_items);
|
|
int radix_tree_preload(gfp_t gfp_mask);
|
|
int radix_tree_maybe_preload(gfp_t gfp_mask);
|
|
void radix_tree_init(void);
|
|
void *radix_tree_tag_set(struct radix_tree_root *root,
|
|
unsigned long index, unsigned int tag);
|
|
void *radix_tree_tag_clear(struct radix_tree_root *root,
|
|
unsigned long index, unsigned int tag);
|
|
int radix_tree_tag_get(struct radix_tree_root *root,
|
|
unsigned long index, unsigned int tag);
|
|
unsigned int
|
|
radix_tree_gang_lookup_tag(struct radix_tree_root *root, void **results,
|
|
unsigned long first_index, unsigned int max_items,
|
|
unsigned int tag);
|
|
unsigned int
|
|
radix_tree_gang_lookup_tag_slot(struct radix_tree_root *root, void ***results,
|
|
unsigned long first_index, unsigned int max_items,
|
|
unsigned int tag);
|
|
unsigned long radix_tree_range_tag_if_tagged(struct radix_tree_root *root,
|
|
unsigned long *first_indexp, unsigned long last_index,
|
|
unsigned long nr_to_tag,
|
|
unsigned int fromtag, unsigned int totag);
|
|
int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag);
|
|
unsigned long radix_tree_locate_item(struct radix_tree_root *root, void *item);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void radix_tree_preload_end(void)
|
|
{
|
|
__asm__ __volatile__("": : :"memory");
|
|
}
|
|
# 323 "include/linux/radix-tree.h"
|
|
struct radix_tree_iter {
|
|
unsigned long index;
|
|
unsigned long next_index;
|
|
unsigned long tags;
|
|
};
|
|
# 340 "include/linux/radix-tree.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void **
|
|
radix_tree_iter_init(struct radix_tree_iter *iter, unsigned long start)
|
|
{
|
|
# 351 "include/linux/radix-tree.h"
|
|
iter->index = 0;
|
|
iter->next_index = start;
|
|
return ((void *)0);
|
|
}
|
|
# 369 "include/linux/radix-tree.h"
|
|
void **radix_tree_next_chunk(struct radix_tree_root *root,
|
|
struct radix_tree_iter *iter, unsigned flags);
|
|
# 381 "include/linux/radix-tree.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((warn_unused_result))
|
|
void **radix_tree_iter_retry(struct radix_tree_iter *iter)
|
|
{
|
|
iter->next_index = iter->index;
|
|
return ((void *)0);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) long
|
|
radix_tree_chunk_size(struct radix_tree_iter *iter)
|
|
{
|
|
return iter->next_index - iter->index;
|
|
}
|
|
# 411 "include/linux/radix-tree.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void **
|
|
radix_tree_next_slot(void **slot, struct radix_tree_iter *iter, unsigned flags)
|
|
{
|
|
if (flags & 0x0100) {
|
|
iter->tags >>= 1;
|
|
if (__builtin_expect(!!(iter->tags & 1ul), 1)) {
|
|
iter->index++;
|
|
return slot + 1;
|
|
}
|
|
if (!(flags & 0x0200) && __builtin_expect(!!(iter->tags), 1)) {
|
|
unsigned offset = __ffs(iter->tags);
|
|
|
|
iter->tags >>= offset;
|
|
iter->index += offset + 1;
|
|
return slot + offset + 1;
|
|
}
|
|
} else {
|
|
long size = radix_tree_chunk_size(iter);
|
|
|
|
while (--size > 0) {
|
|
slot++;
|
|
iter->index++;
|
|
if (__builtin_expect(!!(*slot), 1))
|
|
return slot;
|
|
if (flags & 0x0200) {
|
|
|
|
iter->next_index = 0;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
return ((void *)0);
|
|
}
|
|
# 15 "include/linux/fs.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/semaphore.h" 1
|
|
# 16 "include/linux/semaphore.h"
|
|
struct semaphore {
|
|
raw_spinlock_t lock;
|
|
unsigned int count;
|
|
struct list_head wait_list;
|
|
};
|
|
# 35 "include/linux/semaphore.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sema_init(struct semaphore *sem, int val)
|
|
{
|
|
static struct lock_class_key __key;
|
|
*sem = (struct semaphore) { .lock = (raw_spinlock_t) { .raw_lock = { { 0 } }, }, .count = val, .wait_list = { &((*sem).wait_list), &((*sem).wait_list) }, };
|
|
do { (void)("semaphore->lock"); (void)(&__key); } while (0);
|
|
}
|
|
|
|
extern void down(struct semaphore *sem);
|
|
extern int __attribute__((warn_unused_result)) down_interruptible(struct semaphore *sem);
|
|
extern int __attribute__((warn_unused_result)) down_killable(struct semaphore *sem);
|
|
extern int __attribute__((warn_unused_result)) down_trylock(struct semaphore *sem);
|
|
extern int __attribute__((warn_unused_result)) down_timeout(struct semaphore *sem, long jiffies);
|
|
extern void up(struct semaphore *sem);
|
|
# 23 "include/linux/fs.h" 2
|
|
# 1 "./include/uapi/linux/fiemap.h" 1
|
|
# 16 "./include/uapi/linux/fiemap.h"
|
|
struct fiemap_extent {
|
|
__u64 fe_logical;
|
|
|
|
__u64 fe_physical;
|
|
|
|
__u64 fe_length;
|
|
__u64 fe_reserved64[2];
|
|
__u32 fe_flags;
|
|
__u32 fe_reserved[3];
|
|
};
|
|
|
|
struct fiemap {
|
|
__u64 fm_start;
|
|
|
|
__u64 fm_length;
|
|
|
|
__u32 fm_flags;
|
|
__u32 fm_mapped_extents;
|
|
__u32 fm_extent_count;
|
|
__u32 fm_reserved;
|
|
struct fiemap_extent fm_extents[0];
|
|
};
|
|
# 24 "include/linux/fs.h" 2
|
|
|
|
|
|
|
|
# 1 "include/linux/migrate_mode.h" 1
|
|
# 10 "include/linux/migrate_mode.h"
|
|
enum migrate_mode {
|
|
MIGRATE_ASYNC,
|
|
MIGRATE_SYNC_LIGHT,
|
|
MIGRATE_SYNC,
|
|
};
|
|
# 28 "include/linux/fs.h" 2
|
|
# 36 "include/linux/fs.h"
|
|
# 1 "include/uapi/linux/fs.h" 1
|
|
# 42 "include/uapi/linux/fs.h"
|
|
struct fstrim_range {
|
|
__u64 start;
|
|
__u64 len;
|
|
__u64 minlen;
|
|
};
|
|
|
|
|
|
struct files_stat_struct {
|
|
unsigned long nr_files;
|
|
unsigned long nr_free_files;
|
|
unsigned long max_files;
|
|
};
|
|
|
|
struct inodes_stat_t {
|
|
long nr_inodes;
|
|
long nr_unused;
|
|
long dummy[5];
|
|
};
|
|
# 37 "include/linux/fs.h" 2
|
|
|
|
struct backing_dev_info;
|
|
struct bdi_writeback;
|
|
struct export_operations;
|
|
struct hd_geometry;
|
|
struct iovec;
|
|
struct kiocb;
|
|
struct kobject;
|
|
struct pipe_inode_info;
|
|
struct poll_table_struct;
|
|
struct kstatfs;
|
|
struct vm_area_struct;
|
|
struct vfsmount;
|
|
struct cred;
|
|
struct swap_info_struct;
|
|
struct seq_file;
|
|
struct workqueue_struct;
|
|
struct iov_iter;
|
|
|
|
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) inode_init(void);
|
|
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) inode_init_early(void);
|
|
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) files_init(void);
|
|
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) files_maxfiles_init(void);
|
|
|
|
extern struct files_stat_struct files_stat;
|
|
extern unsigned long get_max_files(void);
|
|
extern int sysctl_nr_open;
|
|
extern struct inodes_stat_t inodes_stat;
|
|
extern int leases_enable, lease_break_time;
|
|
extern int sysctl_protected_symlinks;
|
|
extern int sysctl_protected_hardlinks;
|
|
|
|
struct buffer_head;
|
|
typedef int (get_block_t)(struct inode *inode, sector_t iblock,
|
|
struct buffer_head *bh_result, int create);
|
|
typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
|
|
ssize_t bytes, void *private);
|
|
typedef void (dax_iodone_t)(struct buffer_head *bh_map, int uptodate);
|
|
# 247 "include/linux/fs.h"
|
|
struct iattr {
|
|
unsigned int ia_valid;
|
|
umode_t ia_mode;
|
|
kuid_t ia_uid;
|
|
kgid_t ia_gid;
|
|
loff_t ia_size;
|
|
struct timespec ia_atime;
|
|
struct timespec ia_mtime;
|
|
struct timespec ia_ctime;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct file *ia_file;
|
|
};
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/quota.h" 1
|
|
# 42 "include/linux/quota.h"
|
|
# 1 "./include/uapi/linux/dqblk_xfs.h" 1
|
|
# 51 "./include/uapi/linux/dqblk_xfs.h"
|
|
typedef struct fs_disk_quota {
|
|
__s8 d_version;
|
|
__s8 d_flags;
|
|
__u16 d_fieldmask;
|
|
__u32 d_id;
|
|
__u64 d_blk_hardlimit;
|
|
__u64 d_blk_softlimit;
|
|
__u64 d_ino_hardlimit;
|
|
__u64 d_ino_softlimit;
|
|
__u64 d_bcount;
|
|
__u64 d_icount;
|
|
__s32 d_itimer;
|
|
|
|
__s32 d_btimer;
|
|
__u16 d_iwarns;
|
|
__u16 d_bwarns;
|
|
__s32 d_padding2;
|
|
__u64 d_rtb_hardlimit;
|
|
__u64 d_rtb_softlimit;
|
|
__u64 d_rtbcount;
|
|
__s32 d_rtbtimer;
|
|
__u16 d_rtbwarns;
|
|
__s16 d_padding3;
|
|
char d_padding4[8];
|
|
} fs_disk_quota_t;
|
|
# 147 "./include/uapi/linux/dqblk_xfs.h"
|
|
typedef struct fs_qfilestat {
|
|
__u64 qfs_ino;
|
|
__u64 qfs_nblks;
|
|
__u32 qfs_nextents;
|
|
} fs_qfilestat_t;
|
|
|
|
typedef struct fs_quota_stat {
|
|
__s8 qs_version;
|
|
__u16 qs_flags;
|
|
__s8 qs_pad;
|
|
fs_qfilestat_t qs_uquota;
|
|
fs_qfilestat_t qs_gquota;
|
|
__u32 qs_incoredqs;
|
|
__s32 qs_btimelimit;
|
|
__s32 qs_itimelimit;
|
|
__s32 qs_rtbtimelimit;
|
|
__u16 qs_bwarnlimit;
|
|
__u16 qs_iwarnlimit;
|
|
} fs_quota_stat_t;
|
|
# 190 "./include/uapi/linux/dqblk_xfs.h"
|
|
struct fs_qfilestatv {
|
|
__u64 qfs_ino;
|
|
__u64 qfs_nblks;
|
|
__u32 qfs_nextents;
|
|
__u32 qfs_pad;
|
|
};
|
|
|
|
struct fs_quota_statv {
|
|
__s8 qs_version;
|
|
__u8 qs_pad1;
|
|
__u16 qs_flags;
|
|
__u32 qs_incoredqs;
|
|
struct fs_qfilestatv qs_uquota;
|
|
struct fs_qfilestatv qs_gquota;
|
|
struct fs_qfilestatv qs_pquota;
|
|
__s32 qs_btimelimit;
|
|
__s32 qs_itimelimit;
|
|
__s32 qs_rtbtimelimit;
|
|
__u16 qs_bwarnlimit;
|
|
__u16 qs_iwarnlimit;
|
|
__u64 qs_pad2[8];
|
|
};
|
|
# 43 "include/linux/quota.h" 2
|
|
# 1 "include/linux/dqblk_v1.h" 1
|
|
# 44 "include/linux/quota.h" 2
|
|
# 1 "include/linux/dqblk_v2.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/dqblk_qtree.h" 1
|
|
# 17 "include/linux/dqblk_qtree.h"
|
|
struct dquot;
|
|
|
|
|
|
struct qtree_fmt_operations {
|
|
void (*mem2disk_dqblk)(void *disk, struct dquot *dquot);
|
|
void (*disk2mem_dqblk)(struct dquot *dquot, void *disk);
|
|
int (*is_id)(void *disk, struct dquot *dquot);
|
|
};
|
|
|
|
|
|
struct qtree_mem_dqinfo {
|
|
struct super_block *dqi_sb;
|
|
int dqi_type;
|
|
unsigned int dqi_blocks;
|
|
unsigned int dqi_free_blk;
|
|
unsigned int dqi_free_entry;
|
|
unsigned int dqi_blocksize_bits;
|
|
unsigned int dqi_entry_size;
|
|
unsigned int dqi_usable_bs;
|
|
unsigned int dqi_qtree_depth;
|
|
struct qtree_fmt_operations *dqi_ops;
|
|
};
|
|
|
|
int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
|
|
int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
|
|
int qtree_delete_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
|
|
int qtree_release_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
|
|
int qtree_entry_unused(struct qtree_mem_dqinfo *info, char *disk);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int qtree_depth(struct qtree_mem_dqinfo *info)
|
|
{
|
|
unsigned int epb = info->dqi_usable_bs >> 2;
|
|
unsigned long long entries = epb;
|
|
int i;
|
|
|
|
for (i = 1; entries < (1ULL << 32); i++)
|
|
entries *= epb;
|
|
return i;
|
|
}
|
|
# 9 "include/linux/dqblk_v2.h" 2
|
|
# 45 "include/linux/quota.h" 2
|
|
|
|
|
|
|
|
# 1 "include/linux/projid.h" 1
|
|
# 16 "include/linux/projid.h"
|
|
struct user_namespace;
|
|
extern struct user_namespace init_user_ns;
|
|
|
|
typedef __kernel_uid32_t projid_t;
|
|
|
|
typedef struct {
|
|
projid_t val;
|
|
} kprojid_t;
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) projid_t __kprojid_val(kprojid_t projid)
|
|
{
|
|
return projid.val;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool projid_eq(kprojid_t left, kprojid_t right)
|
|
{
|
|
return __kprojid_val(left) == __kprojid_val(right);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool projid_lt(kprojid_t left, kprojid_t right)
|
|
{
|
|
return __kprojid_val(left) < __kprojid_val(right);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool projid_valid(kprojid_t projid)
|
|
{
|
|
return !projid_eq(projid, (kprojid_t){ -1 });
|
|
}
|
|
|
|
|
|
|
|
extern kprojid_t make_kprojid(struct user_namespace *from, projid_t projid);
|
|
|
|
extern projid_t from_kprojid(struct user_namespace *to, kprojid_t projid);
|
|
extern projid_t from_kprojid_munged(struct user_namespace *to, kprojid_t projid);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool kprojid_has_mapping(struct user_namespace *ns, kprojid_t projid)
|
|
{
|
|
return from_kprojid(ns, projid) != (projid_t)-1;
|
|
}
|
|
# 49 "include/linux/quota.h" 2
|
|
# 1 "include/uapi/linux/quota.h" 1
|
|
# 90 "include/uapi/linux/quota.h"
|
|
enum {
|
|
QIF_BLIMITS_B = 0,
|
|
QIF_SPACE_B,
|
|
QIF_ILIMITS_B,
|
|
QIF_INODES_B,
|
|
QIF_BTIME_B,
|
|
QIF_ITIME_B,
|
|
};
|
|
# 110 "include/uapi/linux/quota.h"
|
|
struct if_dqblk {
|
|
__u64 dqb_bhardlimit;
|
|
__u64 dqb_bsoftlimit;
|
|
__u64 dqb_curspace;
|
|
__u64 dqb_ihardlimit;
|
|
__u64 dqb_isoftlimit;
|
|
__u64 dqb_curinodes;
|
|
__u64 dqb_btime;
|
|
__u64 dqb_itime;
|
|
__u32 dqb_valid;
|
|
};
|
|
# 131 "include/uapi/linux/quota.h"
|
|
enum {
|
|
DQF_ROOT_SQUASH_B = 0,
|
|
DQF_SYS_FILE_B = 16,
|
|
|
|
DQF_PRIVATE
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct if_dqinfo {
|
|
__u64 dqi_bgrace;
|
|
__u64 dqi_igrace;
|
|
__u32 dqi_flags;
|
|
__u32 dqi_valid;
|
|
};
|
|
# 165 "include/uapi/linux/quota.h"
|
|
enum {
|
|
QUOTA_NL_C_UNSPEC,
|
|
QUOTA_NL_C_WARNING,
|
|
__QUOTA_NL_C_MAX,
|
|
};
|
|
|
|
|
|
enum {
|
|
QUOTA_NL_A_UNSPEC,
|
|
QUOTA_NL_A_QTYPE,
|
|
QUOTA_NL_A_EXCESS_ID,
|
|
QUOTA_NL_A_WARNING,
|
|
QUOTA_NL_A_DEV_MAJOR,
|
|
QUOTA_NL_A_DEV_MINOR,
|
|
QUOTA_NL_A_CAUSED_ID,
|
|
__QUOTA_NL_A_MAX,
|
|
};
|
|
# 50 "include/linux/quota.h" 2
|
|
|
|
|
|
|
|
|
|
enum quota_type {
|
|
USRQUOTA = 0,
|
|
GRPQUOTA = 1,
|
|
PRJQUOTA = 2,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef __kernel_uid32_t qid_t;
|
|
typedef long long qsize_t;
|
|
|
|
struct kqid {
|
|
union {
|
|
kuid_t uid;
|
|
kgid_t gid;
|
|
kprojid_t projid;
|
|
};
|
|
enum quota_type type;
|
|
};
|
|
|
|
extern bool qid_eq(struct kqid left, struct kqid right);
|
|
extern bool qid_lt(struct kqid left, struct kqid right);
|
|
extern qid_t from_kqid(struct user_namespace *to, struct kqid qid);
|
|
extern qid_t from_kqid_munged(struct user_namespace *to, struct kqid qid);
|
|
extern bool qid_valid(struct kqid qid);
|
|
# 97 "include/linux/quota.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kqid make_kqid(struct user_namespace *from,
|
|
enum quota_type type, qid_t qid)
|
|
{
|
|
struct kqid kqid;
|
|
|
|
kqid.type = type;
|
|
switch (type) {
|
|
case USRQUOTA:
|
|
kqid.uid = make_kuid(from, qid);
|
|
break;
|
|
case GRPQUOTA:
|
|
kqid.gid = make_kgid(from, qid);
|
|
break;
|
|
case PRJQUOTA:
|
|
kqid.projid = make_kprojid(from, qid);
|
|
break;
|
|
default:
|
|
do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/quota.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "114" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0);
|
|
}
|
|
return kqid;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kqid make_kqid_invalid(enum quota_type type)
|
|
{
|
|
struct kqid kqid;
|
|
|
|
kqid.type = type;
|
|
switch (type) {
|
|
case USRQUOTA:
|
|
kqid.uid = (kuid_t){ -1 };
|
|
break;
|
|
case GRPQUOTA:
|
|
kqid.gid = (kgid_t){ -1 };
|
|
break;
|
|
case PRJQUOTA:
|
|
kqid.projid = (kprojid_t){ -1 };
|
|
break;
|
|
default:
|
|
do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/quota.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "141" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0);
|
|
}
|
|
return kqid;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kqid make_kqid_uid(kuid_t uid)
|
|
{
|
|
struct kqid kqid;
|
|
kqid.type = USRQUOTA;
|
|
kqid.uid = uid;
|
|
return kqid;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kqid make_kqid_gid(kgid_t gid)
|
|
{
|
|
struct kqid kqid;
|
|
kqid.type = GRPQUOTA;
|
|
kqid.gid = gid;
|
|
return kqid;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kqid make_kqid_projid(kprojid_t projid)
|
|
{
|
|
struct kqid kqid;
|
|
kqid.type = PRJQUOTA;
|
|
kqid.projid = projid;
|
|
return kqid;
|
|
}
|
|
|
|
|
|
extern spinlock_t dq_data_lock;
|
|
# 195 "include/linux/quota.h"
|
|
struct mem_dqblk {
|
|
qsize_t dqb_bhardlimit;
|
|
qsize_t dqb_bsoftlimit;
|
|
qsize_t dqb_curspace;
|
|
qsize_t dqb_rsvspace;
|
|
qsize_t dqb_ihardlimit;
|
|
qsize_t dqb_isoftlimit;
|
|
qsize_t dqb_curinodes;
|
|
time_t dqb_btime;
|
|
time_t dqb_itime;
|
|
};
|
|
|
|
|
|
|
|
|
|
struct quota_format_type;
|
|
|
|
struct mem_dqinfo {
|
|
struct quota_format_type *dqi_format;
|
|
int dqi_fmt_id;
|
|
|
|
struct list_head dqi_dirty_list;
|
|
unsigned long dqi_flags;
|
|
unsigned int dqi_bgrace;
|
|
unsigned int dqi_igrace;
|
|
qsize_t dqi_max_spc_limit;
|
|
qsize_t dqi_max_ino_limit;
|
|
void *dqi_priv;
|
|
};
|
|
|
|
struct super_block;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
DQF_INFO_DIRTY_B = DQF_PRIVATE,
|
|
};
|
|
|
|
|
|
extern void mark_info_dirty(struct super_block *sb, int type);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int info_dirty(struct mem_dqinfo *info)
|
|
{
|
|
return test_bit(DQF_INFO_DIRTY_B, &info->dqi_flags);
|
|
}
|
|
|
|
enum {
|
|
DQST_LOOKUPS,
|
|
DQST_DROPS,
|
|
DQST_READS,
|
|
DQST_WRITES,
|
|
DQST_CACHE_HITS,
|
|
DQST_ALLOC_DQUOTS,
|
|
DQST_FREE_DQUOTS,
|
|
DQST_SYNCS,
|
|
_DQST_DQSTAT_LAST
|
|
};
|
|
|
|
struct dqstats {
|
|
int stat[_DQST_DQSTAT_LAST];
|
|
struct percpu_counter counter[_DQST_DQSTAT_LAST];
|
|
};
|
|
|
|
extern struct dqstats *dqstats_pcpu;
|
|
extern struct dqstats dqstats;
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dqstats_inc(unsigned int type)
|
|
{
|
|
percpu_counter_inc(&dqstats.counter[type]);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dqstats_dec(unsigned int type)
|
|
{
|
|
percpu_counter_dec(&dqstats.counter[type]);
|
|
}
|
|
# 285 "include/linux/quota.h"
|
|
struct dquot {
|
|
struct hlist_node dq_hash;
|
|
struct list_head dq_inuse;
|
|
struct list_head dq_free;
|
|
struct list_head dq_dirty;
|
|
struct mutex dq_lock;
|
|
atomic_t dq_count;
|
|
wait_queue_head_t dq_wait_unused;
|
|
struct super_block *dq_sb;
|
|
struct kqid dq_id;
|
|
loff_t dq_off;
|
|
unsigned long dq_flags;
|
|
struct mem_dqblk dq_dqb;
|
|
};
|
|
|
|
|
|
struct quota_format_ops {
|
|
int (*check_quota_file)(struct super_block *sb, int type);
|
|
int (*read_file_info)(struct super_block *sb, int type);
|
|
int (*write_file_info)(struct super_block *sb, int type);
|
|
int (*free_file_info)(struct super_block *sb, int type);
|
|
int (*read_dqblk)(struct dquot *dquot);
|
|
int (*commit_dqblk)(struct dquot *dquot);
|
|
int (*release_dqblk)(struct dquot *dquot);
|
|
};
|
|
|
|
|
|
struct dquot_operations {
|
|
int (*write_dquot) (struct dquot *);
|
|
struct dquot *(*alloc_dquot)(struct super_block *, int);
|
|
void (*destroy_dquot)(struct dquot *);
|
|
int (*acquire_dquot) (struct dquot *);
|
|
int (*release_dquot) (struct dquot *);
|
|
int (*mark_dirty) (struct dquot *);
|
|
int (*write_info) (struct super_block *, int);
|
|
|
|
|
|
qsize_t *(*get_reserved_space) (struct inode *);
|
|
int (*get_projid) (struct inode *, kprojid_t *);
|
|
};
|
|
|
|
struct path;
|
|
|
|
|
|
struct qc_dqblk {
|
|
int d_fieldmask;
|
|
u64 d_spc_hardlimit;
|
|
u64 d_spc_softlimit;
|
|
u64 d_ino_hardlimit;
|
|
u64 d_ino_softlimit;
|
|
u64 d_space;
|
|
u64 d_ino_count;
|
|
s64 d_ino_timer;
|
|
|
|
s64 d_spc_timer;
|
|
int d_ino_warns;
|
|
int d_spc_warns;
|
|
u64 d_rt_spc_hardlimit;
|
|
u64 d_rt_spc_softlimit;
|
|
u64 d_rt_space;
|
|
s64 d_rt_spc_timer;
|
|
int d_rt_spc_warns;
|
|
};
|
|
# 381 "include/linux/quota.h"
|
|
struct qc_type_state {
|
|
unsigned int flags;
|
|
unsigned int spc_timelimit;
|
|
|
|
unsigned int ino_timelimit;
|
|
unsigned int rt_spc_timelimit;
|
|
unsigned int spc_warnlimit;
|
|
unsigned int ino_warnlimit;
|
|
unsigned int rt_spc_warnlimit;
|
|
unsigned long long ino;
|
|
blkcnt_t blocks;
|
|
blkcnt_t nextents;
|
|
};
|
|
|
|
struct qc_state {
|
|
unsigned int s_incoredqs;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct qc_type_state s_state[3];
|
|
};
|
|
|
|
|
|
struct qc_info {
|
|
int i_fieldmask;
|
|
unsigned int i_flags;
|
|
unsigned int i_spc_timelimit;
|
|
|
|
unsigned int i_ino_timelimit;
|
|
unsigned int i_rt_spc_timelimit;
|
|
unsigned int i_spc_warnlimit;
|
|
unsigned int i_ino_warnlimit;
|
|
unsigned int i_rt_spc_warnlimit;
|
|
};
|
|
|
|
|
|
struct quotactl_ops {
|
|
int (*quota_on)(struct super_block *, int, int, struct path *);
|
|
int (*quota_off)(struct super_block *, int);
|
|
int (*quota_enable)(struct super_block *, unsigned int);
|
|
int (*quota_disable)(struct super_block *, unsigned int);
|
|
int (*quota_sync)(struct super_block *, int);
|
|
int (*set_info)(struct super_block *, int, struct qc_info *);
|
|
int (*get_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *);
|
|
int (*set_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *);
|
|
int (*get_state)(struct super_block *, struct qc_state *);
|
|
int (*rm_xquota)(struct super_block *, unsigned int);
|
|
};
|
|
|
|
struct quota_format_type {
|
|
int qf_fmt_id;
|
|
const struct quota_format_ops *qf_ops;
|
|
struct module *qf_owner;
|
|
struct quota_format_type *qf_next;
|
|
};
|
|
# 453 "include/linux/quota.h"
|
|
enum {
|
|
_DQUOT_USAGE_ENABLED = 0,
|
|
_DQUOT_LIMITS_ENABLED,
|
|
_DQUOT_SUSPENDED,
|
|
|
|
|
|
_DQUOT_STATE_FLAGS
|
|
};
|
|
# 477 "include/linux/quota.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int dquot_state_flag(unsigned int flags, int type)
|
|
{
|
|
return flags << type;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int dquot_generic_flag(unsigned int flags, int type)
|
|
{
|
|
return (flags >> type) & ((1 << _DQUOT_USAGE_ENABLED * 3) | (1 << _DQUOT_LIMITS_ENABLED * 3) | (1 << _DQUOT_SUSPENDED * 3));
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) unsigned dquot_state_types(unsigned flags, unsigned flag)
|
|
{
|
|
((void)sizeof(char[1 - 2*!!((flag) == 0 || (((flag) & ((flag) - 1)) != 0))]));
|
|
return (flags / flag) & ((1 << 3) - 1);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void quota_send_warning(struct kqid qid, dev_t dev,
|
|
const char warntype)
|
|
{
|
|
return;
|
|
}
|
|
|
|
|
|
struct quota_info {
|
|
unsigned int flags;
|
|
struct mutex dqio_mutex;
|
|
struct mutex dqonoff_mutex;
|
|
struct inode *files[3];
|
|
struct mem_dqinfo info[3];
|
|
const struct quota_format_ops *ops[3];
|
|
};
|
|
|
|
int register_quota_format(struct quota_format_type *fmt);
|
|
void unregister_quota_format(struct quota_format_type *fmt);
|
|
|
|
struct quota_module_name {
|
|
int qm_fmt_id;
|
|
char *qm_mod_name;
|
|
};
|
|
# 269 "include/linux/fs.h" 2
|
|
# 302 "include/linux/fs.h"
|
|
enum positive_aop_returns {
|
|
AOP_WRITEPAGE_ACTIVATE = 0x80000,
|
|
AOP_TRUNCATED_PAGE = 0x80001,
|
|
};
|
|
# 316 "include/linux/fs.h"
|
|
struct page;
|
|
struct address_space;
|
|
struct writeback_control;
|
|
|
|
|
|
|
|
|
|
|
|
struct kiocb {
|
|
struct file *ki_filp;
|
|
loff_t ki_pos;
|
|
void (*ki_complete)(struct kiocb *iocb, long ret, long ret2);
|
|
void *private;
|
|
int ki_flags;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_sync_kiocb(struct kiocb *kiocb)
|
|
{
|
|
return kiocb->ki_complete == ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int iocb_flags(struct file *file);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_sync_kiocb(struct kiocb *kiocb, struct file *filp)
|
|
{
|
|
*kiocb = (struct kiocb) {
|
|
.ki_filp = filp,
|
|
.ki_flags = iocb_flags(filp),
|
|
};
|
|
}
|
|
# 356 "include/linux/fs.h"
|
|
typedef struct {
|
|
size_t written;
|
|
size_t count;
|
|
union {
|
|
char *buf;
|
|
void *data;
|
|
} arg;
|
|
int error;
|
|
} read_descriptor_t;
|
|
|
|
typedef int (*read_actor_t)(read_descriptor_t *, struct page *,
|
|
unsigned long, unsigned long);
|
|
|
|
struct address_space_operations {
|
|
int (*writepage)(struct page *page, struct writeback_control *wbc);
|
|
int (*readpage)(struct file *, struct page *);
|
|
|
|
|
|
int (*writepages)(struct address_space *, struct writeback_control *);
|
|
|
|
|
|
int (*set_page_dirty)(struct page *page);
|
|
|
|
int (*readpages)(struct file *filp, struct address_space *mapping,
|
|
struct list_head *pages, unsigned nr_pages);
|
|
|
|
int (*write_begin)(struct file *, struct address_space *mapping,
|
|
loff_t pos, unsigned len, unsigned flags,
|
|
struct page **pagep, void **fsdata);
|
|
int (*write_end)(struct file *, struct address_space *mapping,
|
|
loff_t pos, unsigned len, unsigned copied,
|
|
struct page *page, void *fsdata);
|
|
|
|
|
|
sector_t (*bmap)(struct address_space *, sector_t);
|
|
void (*invalidatepage) (struct page *, unsigned int, unsigned int);
|
|
int (*releasepage) (struct page *, gfp_t);
|
|
void (*freepage)(struct page *);
|
|
ssize_t (*direct_IO)(struct kiocb *, struct iov_iter *iter, loff_t offset);
|
|
|
|
|
|
|
|
|
|
int (*migratepage) (struct address_space *,
|
|
struct page *, struct page *, enum migrate_mode);
|
|
int (*launder_page) (struct page *);
|
|
int (*is_partially_uptodate) (struct page *, unsigned long,
|
|
unsigned long);
|
|
void (*is_dirty_writeback) (struct page *, bool *, bool *);
|
|
int (*error_remove_page)(struct address_space *, struct page *);
|
|
|
|
|
|
int (*swap_activate)(struct swap_info_struct *sis, struct file *file,
|
|
sector_t *span);
|
|
void (*swap_deactivate)(struct file *file);
|
|
};
|
|
|
|
extern const struct address_space_operations empty_aops;
|
|
|
|
|
|
|
|
|
|
|
|
int pagecache_write_begin(struct file *, struct address_space *mapping,
|
|
loff_t pos, unsigned len, unsigned flags,
|
|
struct page **pagep, void **fsdata);
|
|
|
|
int pagecache_write_end(struct file *, struct address_space *mapping,
|
|
loff_t pos, unsigned len, unsigned copied,
|
|
struct page *page, void *fsdata);
|
|
|
|
struct address_space {
|
|
struct inode *host;
|
|
struct radix_tree_root page_tree;
|
|
spinlock_t tree_lock;
|
|
atomic_t i_mmap_writable;
|
|
struct rb_root i_mmap;
|
|
struct rw_semaphore i_mmap_rwsem;
|
|
|
|
unsigned long nrpages;
|
|
unsigned long nrshadows;
|
|
unsigned long writeback_index;
|
|
const struct address_space_operations *a_ops;
|
|
unsigned long flags;
|
|
spinlock_t private_lock;
|
|
struct list_head private_list;
|
|
void *private_data;
|
|
} __attribute__((aligned(sizeof(long))));
|
|
|
|
|
|
|
|
|
|
|
|
struct request_queue;
|
|
|
|
struct block_device {
|
|
dev_t bd_dev;
|
|
int bd_openers;
|
|
struct inode * bd_inode;
|
|
struct super_block * bd_super;
|
|
struct mutex bd_mutex;
|
|
struct list_head bd_inodes;
|
|
void * bd_claiming;
|
|
void * bd_holder;
|
|
int bd_holders;
|
|
bool bd_write_holder;
|
|
|
|
struct list_head bd_holder_disks;
|
|
|
|
struct block_device * bd_contains;
|
|
unsigned bd_block_size;
|
|
struct hd_struct * bd_part;
|
|
|
|
unsigned bd_part_count;
|
|
int bd_invalidated;
|
|
struct gendisk * bd_disk;
|
|
struct request_queue * bd_queue;
|
|
struct list_head bd_list;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long bd_private;
|
|
|
|
|
|
int bd_fsfreeze_count;
|
|
|
|
struct mutex bd_fsfreeze_mutex;
|
|
};
|
|
# 496 "include/linux/fs.h"
|
|
int mapping_tagged(struct address_space *mapping, int tag);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_mmap_lock_write(struct address_space *mapping)
|
|
{
|
|
down_write(&mapping->i_mmap_rwsem);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_mmap_unlock_write(struct address_space *mapping)
|
|
{
|
|
up_write(&mapping->i_mmap_rwsem);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_mmap_lock_read(struct address_space *mapping)
|
|
{
|
|
down_read(&mapping->i_mmap_rwsem);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_mmap_unlock_read(struct address_space *mapping)
|
|
{
|
|
up_read(&mapping->i_mmap_rwsem);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mapping_mapped(struct address_space *mapping)
|
|
{
|
|
return !((&mapping->i_mmap)->rb_node == ((void *)0));
|
|
}
|
|
# 535 "include/linux/fs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mapping_writably_mapped(struct address_space *mapping)
|
|
{
|
|
return ({ union { typeof((&mapping->i_mmap_writable)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&mapping->i_mmap_writable)->counter), __u.__c, sizeof((&mapping->i_mmap_writable)->counter)); else __read_once_size_nocheck(&((&mapping->i_mmap_writable)->counter), __u.__c, sizeof((&mapping->i_mmap_writable)->counter)); __u.__val; }) > 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mapping_map_writable(struct address_space *mapping)
|
|
{
|
|
return atomic_inc_unless_negative(&mapping->i_mmap_writable) ?
|
|
0 : -1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mapping_unmap_writable(struct address_space *mapping)
|
|
{
|
|
atomic_sub(1, &mapping->i_mmap_writable);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mapping_deny_writable(struct address_space *mapping)
|
|
{
|
|
return atomic_dec_unless_positive(&mapping->i_mmap_writable) ?
|
|
0 : -16;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mapping_allow_writable(struct address_space *mapping)
|
|
{
|
|
atomic_add(1, &mapping->i_mmap_writable);
|
|
}
|
|
# 573 "include/linux/fs.h"
|
|
struct posix_acl;
|
|
# 585 "include/linux/fs.h"
|
|
struct inode {
|
|
umode_t i_mode;
|
|
unsigned short i_opflags;
|
|
kuid_t i_uid;
|
|
kgid_t i_gid;
|
|
unsigned int i_flags;
|
|
|
|
|
|
struct posix_acl *i_acl;
|
|
struct posix_acl *i_default_acl;
|
|
|
|
|
|
const struct inode_operations *i_op;
|
|
struct super_block *i_sb;
|
|
struct address_space *i_mapping;
|
|
|
|
|
|
void *i_security;
|
|
|
|
|
|
|
|
unsigned long i_ino;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
union {
|
|
const unsigned int i_nlink;
|
|
unsigned int __i_nlink;
|
|
};
|
|
dev_t i_rdev;
|
|
loff_t i_size;
|
|
struct timespec i_atime;
|
|
struct timespec i_mtime;
|
|
struct timespec i_ctime;
|
|
spinlock_t i_lock;
|
|
unsigned short i_bytes;
|
|
unsigned int i_blkbits;
|
|
blkcnt_t i_blocks;
|
|
|
|
|
|
seqcount_t i_size_seqcount;
|
|
|
|
|
|
|
|
unsigned long i_state;
|
|
struct mutex i_mutex;
|
|
|
|
unsigned long dirtied_when;
|
|
unsigned long dirtied_time_when;
|
|
|
|
struct hlist_node i_hash;
|
|
struct list_head i_io_list;
|
|
# 649 "include/linux/fs.h"
|
|
struct list_head i_lru;
|
|
struct list_head i_sb_list;
|
|
union {
|
|
struct hlist_head i_dentry;
|
|
struct callback_head i_rcu;
|
|
};
|
|
u64 i_version;
|
|
atomic_t i_count;
|
|
atomic_t i_dio_count;
|
|
atomic_t i_writecount;
|
|
|
|
|
|
|
|
const struct file_operations *i_fop;
|
|
struct file_lock_context *i_flctx;
|
|
struct address_space i_data;
|
|
struct list_head i_devices;
|
|
union {
|
|
struct pipe_inode_info *i_pipe;
|
|
struct block_device *i_bdev;
|
|
struct cdev *i_cdev;
|
|
char *i_link;
|
|
};
|
|
|
|
__u32 i_generation;
|
|
|
|
|
|
__u32 i_fsnotify_mask;
|
|
struct hlist_head i_fsnotify_marks;
|
|
|
|
|
|
void *i_private;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int i_blocksize(const struct inode *node)
|
|
{
|
|
return (1 << node->i_blkbits);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int inode_unhashed(struct inode *inode)
|
|
{
|
|
return hlist_unhashed(&inode->i_hash);
|
|
}
|
|
# 709 "include/linux/fs.h"
|
|
enum inode_i_mutex_lock_class
|
|
{
|
|
I_MUTEX_NORMAL,
|
|
I_MUTEX_PARENT,
|
|
I_MUTEX_CHILD,
|
|
I_MUTEX_XATTR,
|
|
I_MUTEX_NONDIR2,
|
|
I_MUTEX_PARENT2,
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inode_lock(struct inode *inode)
|
|
{
|
|
mutex_lock(&inode->i_mutex);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inode_unlock(struct inode *inode)
|
|
{
|
|
mutex_unlock(&inode->i_mutex);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int inode_trylock(struct inode *inode)
|
|
{
|
|
return mutex_trylock(&inode->i_mutex);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int inode_is_locked(struct inode *inode)
|
|
{
|
|
return mutex_is_locked(&inode->i_mutex);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inode_lock_nested(struct inode *inode, unsigned subclass)
|
|
{
|
|
mutex_lock(&inode->i_mutex);
|
|
}
|
|
|
|
void lock_two_nondirectories(struct inode *, struct inode*);
|
|
void unlock_two_nondirectories(struct inode *, struct inode*);
|
|
# 757 "include/linux/fs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) loff_t i_size_read(const struct inode *inode)
|
|
{
|
|
|
|
loff_t i_size;
|
|
unsigned int seq;
|
|
|
|
do {
|
|
seq = read_seqcount_begin(&inode->i_size_seqcount);
|
|
i_size = inode->i_size;
|
|
} while (read_seqcount_retry(&inode->i_size_seqcount, seq));
|
|
return i_size;
|
|
# 778 "include/linux/fs.h"
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_size_write(struct inode *inode, loff_t i_size)
|
|
{
|
|
|
|
__asm__ __volatile__("": : :"memory");
|
|
write_seqcount_begin(&inode->i_size_seqcount);
|
|
inode->i_size = i_size;
|
|
write_seqcount_end(&inode->i_size_seqcount);
|
|
__asm__ __volatile__("": : :"memory");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) uid_t i_uid_read(const struct inode *inode)
|
|
{
|
|
return from_kuid(&init_user_ns, inode->i_uid);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) gid_t i_gid_read(const struct inode *inode)
|
|
{
|
|
return from_kgid(&init_user_ns, inode->i_gid);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_uid_write(struct inode *inode, uid_t uid)
|
|
{
|
|
inode->i_uid = make_kuid(&init_user_ns, uid);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_gid_write(struct inode *inode, gid_t gid)
|
|
{
|
|
inode->i_gid = make_kgid(&init_user_ns, gid);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned iminor(const struct inode *inode)
|
|
{
|
|
return ((unsigned int) ((inode->i_rdev) & ((1U << 20) - 1)));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned imajor(const struct inode *inode)
|
|
{
|
|
return ((unsigned int) ((inode->i_rdev) >> 20));
|
|
}
|
|
|
|
extern struct block_device *I_BDEV(struct inode *inode);
|
|
|
|
struct fown_struct {
|
|
rwlock_t lock;
|
|
struct pid *pid;
|
|
enum pid_type pid_type;
|
|
kuid_t uid, euid;
|
|
int signum;
|
|
};
|
|
|
|
|
|
|
|
|
|
struct file_ra_state {
|
|
unsigned long start;
|
|
unsigned int size;
|
|
unsigned int async_size;
|
|
|
|
|
|
unsigned int ra_pages;
|
|
unsigned int mmap_miss;
|
|
loff_t prev_pos;
|
|
};
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ra_has_index(struct file_ra_state *ra, unsigned long index)
|
|
{
|
|
return (index >= ra->start &&
|
|
index < ra->start + ra->size);
|
|
}
|
|
|
|
struct file {
|
|
union {
|
|
struct llist_node fu_llist;
|
|
struct callback_head fu_rcuhead;
|
|
} f_u;
|
|
struct path f_path;
|
|
|
|
struct inode *f_inode;
|
|
const struct file_operations *f_op;
|
|
|
|
|
|
|
|
|
|
|
|
spinlock_t f_lock;
|
|
atomic_long_t f_count;
|
|
unsigned int f_flags;
|
|
fmode_t f_mode;
|
|
struct mutex f_pos_lock;
|
|
loff_t f_pos;
|
|
struct fown_struct f_owner;
|
|
const struct cred *f_cred;
|
|
struct file_ra_state f_ra;
|
|
|
|
u64 f_version;
|
|
|
|
void *f_security;
|
|
|
|
|
|
void *private_data;
|
|
|
|
|
|
|
|
struct list_head f_ep_links;
|
|
struct list_head f_tfile_llink;
|
|
|
|
struct address_space *f_mapping;
|
|
} __attribute__((aligned(4)));
|
|
|
|
struct file_handle {
|
|
__u32 handle_bytes;
|
|
int handle_type;
|
|
|
|
unsigned char f_handle[0];
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct file *get_file(struct file *f)
|
|
{
|
|
atomic_long_inc(&f->f_count);
|
|
return f;
|
|
}
|
|
# 955 "include/linux/fs.h"
|
|
typedef void *fl_owner_t;
|
|
|
|
struct file_lock;
|
|
|
|
struct file_lock_operations {
|
|
void (*fl_copy_lock)(struct file_lock *, struct file_lock *);
|
|
void (*fl_release_private)(struct file_lock *);
|
|
};
|
|
|
|
struct lock_manager_operations {
|
|
int (*lm_compare_owner)(struct file_lock *, struct file_lock *);
|
|
unsigned long (*lm_owner_key)(struct file_lock *);
|
|
fl_owner_t (*lm_get_owner)(fl_owner_t);
|
|
void (*lm_put_owner)(fl_owner_t);
|
|
void (*lm_notify)(struct file_lock *);
|
|
int (*lm_grant)(struct file_lock *, int);
|
|
bool (*lm_break)(struct file_lock *);
|
|
int (*lm_change)(struct file_lock *, int, struct list_head *);
|
|
void (*lm_setup)(struct file_lock *, void **);
|
|
};
|
|
|
|
struct lock_manager {
|
|
struct list_head list;
|
|
|
|
|
|
|
|
|
|
bool block_opens;
|
|
};
|
|
|
|
struct net;
|
|
void locks_start_grace(struct net *, struct lock_manager *);
|
|
void locks_end_grace(struct lock_manager *);
|
|
int locks_in_grace(struct net *);
|
|
int opens_in_grace(struct net *);
|
|
|
|
|
|
# 1 "include/linux/nfs_fs_i.h" 1
|
|
|
|
|
|
|
|
struct nlm_lockowner;
|
|
|
|
|
|
|
|
|
|
struct nfs_lock_info {
|
|
u32 state;
|
|
struct nlm_lockowner *owner;
|
|
struct list_head list;
|
|
};
|
|
|
|
struct nfs4_lock_state;
|
|
struct nfs4_lock_info {
|
|
struct nfs4_lock_state *owner;
|
|
};
|
|
# 993 "include/linux/fs.h" 2
|
|
# 1011 "include/linux/fs.h"
|
|
struct file_lock {
|
|
struct file_lock *fl_next;
|
|
struct list_head fl_list;
|
|
struct hlist_node fl_link;
|
|
struct list_head fl_block;
|
|
fl_owner_t fl_owner;
|
|
unsigned int fl_flags;
|
|
unsigned char fl_type;
|
|
unsigned int fl_pid;
|
|
int fl_link_cpu;
|
|
struct pid *fl_nspid;
|
|
wait_queue_head_t fl_wait;
|
|
struct file *fl_file;
|
|
loff_t fl_start;
|
|
loff_t fl_end;
|
|
|
|
struct fasync_struct * fl_fasync;
|
|
|
|
unsigned long fl_break_time;
|
|
unsigned long fl_downgrade_time;
|
|
|
|
const struct file_lock_operations *fl_ops;
|
|
const struct lock_manager_operations *fl_lmops;
|
|
union {
|
|
struct nfs_lock_info nfs_fl;
|
|
struct nfs4_lock_info nfs4_fl;
|
|
struct {
|
|
struct list_head link;
|
|
int state;
|
|
} afs;
|
|
} fl_u;
|
|
};
|
|
|
|
struct file_lock_context {
|
|
spinlock_t flc_lock;
|
|
struct list_head flc_flock;
|
|
struct list_head flc_posix;
|
|
struct list_head flc_lease;
|
|
};
|
|
# 1060 "include/linux/fs.h"
|
|
extern void send_sigio(struct fown_struct *fown, int fd, int band);
|
|
|
|
|
|
extern int fcntl_getlk(struct file *, unsigned int, struct flock *);
|
|
extern int fcntl_setlk(unsigned int, struct file *, unsigned int,
|
|
struct flock *);
|
|
|
|
|
|
extern int fcntl_getlk64(struct file *, unsigned int, struct flock64 *);
|
|
extern int fcntl_setlk64(unsigned int, struct file *, unsigned int,
|
|
struct flock64 *);
|
|
|
|
|
|
extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
|
|
extern int fcntl_getlease(struct file *filp);
|
|
|
|
|
|
void locks_free_lock_context(struct file_lock_context *ctx);
|
|
void locks_free_lock(struct file_lock *fl);
|
|
extern void locks_init_lock(struct file_lock *);
|
|
extern struct file_lock * locks_alloc_lock(void);
|
|
extern void locks_copy_lock(struct file_lock *, struct file_lock *);
|
|
extern void locks_copy_conflock(struct file_lock *, struct file_lock *);
|
|
extern void locks_remove_posix(struct file *, fl_owner_t);
|
|
extern void locks_remove_file(struct file *);
|
|
extern void locks_release_private(struct file_lock *);
|
|
extern void posix_test_lock(struct file *, struct file_lock *);
|
|
extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *);
|
|
extern int posix_unblock_lock(struct file_lock *);
|
|
extern int vfs_test_lock(struct file *, struct file_lock *);
|
|
extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *);
|
|
extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);
|
|
extern int locks_lock_inode_wait(struct inode *inode, struct file_lock *fl);
|
|
extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type);
|
|
extern void lease_get_mtime(struct inode *, struct timespec *time);
|
|
extern int generic_setlease(struct file *, long, struct file_lock **, void **priv);
|
|
extern int vfs_setlease(struct file *, long, struct file_lock **, void **);
|
|
extern int lease_modify(struct file_lock *, int, struct list_head *);
|
|
struct files_struct;
|
|
extern void show_fd_locks(struct seq_file *f,
|
|
struct file *filp, struct files_struct *files);
|
|
# 1237 "include/linux/fs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct inode *file_inode(const struct file *f)
|
|
{
|
|
return f->f_inode;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dentry *file_dentry(const struct file *file)
|
|
{
|
|
struct dentry *dentry = file->f_path.dentry;
|
|
|
|
if (__builtin_expect(!!(dentry->d_flags & 0x08000000), 0))
|
|
return dentry->d_op->d_real(dentry, file_inode(file));
|
|
else
|
|
return dentry;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int locks_lock_file_wait(struct file *filp, struct file_lock *fl)
|
|
{
|
|
return locks_lock_inode_wait(file_inode(filp), fl);
|
|
}
|
|
|
|
struct fasync_struct {
|
|
spinlock_t fa_lock;
|
|
int magic;
|
|
int fa_fd;
|
|
struct fasync_struct *fa_next;
|
|
struct file *fa_file;
|
|
struct callback_head fa_rcu;
|
|
};
|
|
|
|
|
|
|
|
|
|
extern int fasync_helper(int, struct file *, int, struct fasync_struct **);
|
|
extern struct fasync_struct *fasync_insert_entry(int, struct file *, struct fasync_struct **, struct fasync_struct *);
|
|
extern int fasync_remove_entry(struct file *, struct fasync_struct **);
|
|
extern struct fasync_struct *fasync_alloc(void);
|
|
extern void fasync_free(struct fasync_struct *);
|
|
|
|
|
|
extern void kill_fasync(struct fasync_struct **, int, int);
|
|
|
|
extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
|
|
extern void f_setown(struct file *filp, unsigned long arg, int force);
|
|
extern void f_delown(struct file *filp);
|
|
extern pid_t f_getown(struct file *filp);
|
|
extern int send_sigurg(struct fown_struct *fown);
|
|
|
|
struct mm_struct;
|
|
# 1302 "include/linux/fs.h"
|
|
enum {
|
|
SB_UNFROZEN = 0,
|
|
SB_FREEZE_WRITE = 1,
|
|
SB_FREEZE_PAGEFAULT = 2,
|
|
SB_FREEZE_FS = 3,
|
|
|
|
SB_FREEZE_COMPLETE = 4,
|
|
};
|
|
|
|
|
|
|
|
struct sb_writers {
|
|
int frozen;
|
|
wait_queue_head_t wait_unfrozen;
|
|
struct percpu_rw_semaphore rw_sem[(SB_FREEZE_COMPLETE - 1)];
|
|
};
|
|
|
|
struct super_block {
|
|
struct list_head s_list;
|
|
dev_t s_dev;
|
|
unsigned char s_blocksize_bits;
|
|
unsigned long s_blocksize;
|
|
loff_t s_maxbytes;
|
|
struct file_system_type *s_type;
|
|
const struct super_operations *s_op;
|
|
const struct dquot_operations *dq_op;
|
|
const struct quotactl_ops *s_qcop;
|
|
const struct export_operations *s_export_op;
|
|
unsigned long s_flags;
|
|
unsigned long s_iflags;
|
|
unsigned long s_magic;
|
|
struct dentry *s_root;
|
|
struct rw_semaphore s_umount;
|
|
int s_count;
|
|
atomic_t s_active;
|
|
|
|
void *s_security;
|
|
|
|
const struct xattr_handler **s_xattr;
|
|
|
|
struct hlist_bl_head s_anon;
|
|
struct list_head s_mounts;
|
|
struct block_device *s_bdev;
|
|
struct backing_dev_info *s_bdi;
|
|
struct mtd_info *s_mtd;
|
|
struct hlist_node s_instances;
|
|
unsigned int s_quota_types;
|
|
struct quota_info s_dquot;
|
|
|
|
struct sb_writers s_writers;
|
|
|
|
char s_id[32];
|
|
u8 s_uuid[16];
|
|
|
|
void *s_fs_info;
|
|
unsigned int s_max_links;
|
|
fmode_t s_mode;
|
|
|
|
|
|
|
|
u32 s_time_gran;
|
|
|
|
|
|
|
|
|
|
|
|
struct mutex s_vfs_rename_mutex;
|
|
|
|
|
|
|
|
|
|
|
|
char *s_subtype;
|
|
|
|
|
|
|
|
|
|
|
|
char *s_options;
|
|
const struct dentry_operations *s_d_op;
|
|
|
|
|
|
|
|
|
|
int cleancache_poolid;
|
|
|
|
struct shrinker s_shrink;
|
|
|
|
|
|
atomic_long_t s_remove_count;
|
|
|
|
|
|
int s_readonly_remount;
|
|
|
|
|
|
struct workqueue_struct *s_dio_done_wq;
|
|
struct hlist_head s_pins;
|
|
|
|
|
|
|
|
|
|
|
|
struct list_lru s_dentry_lru __attribute__((__aligned__((1 << 6))));
|
|
struct list_lru s_inode_lru __attribute__((__aligned__((1 << 6))));
|
|
struct callback_head rcu;
|
|
struct work_struct destroy_work;
|
|
|
|
struct mutex s_sync_lock;
|
|
|
|
|
|
|
|
|
|
int s_stack_depth;
|
|
|
|
|
|
spinlock_t s_inode_list_lock __attribute__((__aligned__((1 << 6))));
|
|
struct list_head s_inodes;
|
|
};
|
|
|
|
extern struct timespec current_fs_time(struct super_block *sb);
|
|
|
|
|
|
|
|
|
|
|
|
void __sb_end_write(struct super_block *sb, int level);
|
|
int __sb_start_write(struct super_block *sb, int level, bool wait);
|
|
# 1442 "include/linux/fs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sb_end_write(struct super_block *sb)
|
|
{
|
|
__sb_end_write(sb, SB_FREEZE_WRITE);
|
|
}
|
|
# 1454 "include/linux/fs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sb_end_pagefault(struct super_block *sb)
|
|
{
|
|
__sb_end_write(sb, SB_FREEZE_PAGEFAULT);
|
|
}
|
|
# 1466 "include/linux/fs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sb_end_intwrite(struct super_block *sb)
|
|
{
|
|
__sb_end_write(sb, SB_FREEZE_FS);
|
|
}
|
|
# 1490 "include/linux/fs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sb_start_write(struct super_block *sb)
|
|
{
|
|
__sb_start_write(sb, SB_FREEZE_WRITE, true);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sb_start_write_trylock(struct super_block *sb)
|
|
{
|
|
return __sb_start_write(sb, SB_FREEZE_WRITE, false);
|
|
}
|
|
# 1519 "include/linux/fs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sb_start_pagefault(struct super_block *sb)
|
|
{
|
|
__sb_start_write(sb, SB_FREEZE_PAGEFAULT, true);
|
|
}
|
|
# 1537 "include/linux/fs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sb_start_intwrite(struct super_block *sb)
|
|
{
|
|
__sb_start_write(sb, SB_FREEZE_FS, true);
|
|
}
|
|
|
|
|
|
extern bool inode_owner_or_capable(const struct inode *inode);
|
|
|
|
|
|
|
|
|
|
extern int vfs_create(struct inode *, struct dentry *, umode_t, bool);
|
|
extern int vfs_mkdir(struct inode *, struct dentry *, umode_t);
|
|
extern int vfs_mknod(struct inode *, struct dentry *, umode_t, dev_t);
|
|
extern int vfs_symlink(struct inode *, struct dentry *, const char *);
|
|
extern int vfs_link(struct dentry *, struct inode *, struct dentry *, struct inode **);
|
|
extern int vfs_rmdir(struct inode *, struct dentry *);
|
|
extern int vfs_unlink(struct inode *, struct dentry *, struct inode **);
|
|
extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *, struct inode **, unsigned int);
|
|
extern int vfs_whiteout(struct inode *, struct dentry *);
|
|
|
|
|
|
|
|
|
|
extern void dentry_unhash(struct dentry *dentry);
|
|
|
|
|
|
|
|
|
|
extern void inode_init_owner(struct inode *inode, const struct inode *dir,
|
|
umode_t mode);
|
|
|
|
|
|
|
|
struct fiemap_extent_info {
|
|
unsigned int fi_flags;
|
|
unsigned int fi_extents_mapped;
|
|
unsigned int fi_extents_max;
|
|
struct fiemap_extent *fi_extents_start;
|
|
|
|
};
|
|
int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical,
|
|
u64 phys, u64 len, u32 flags);
|
|
int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags);
|
|
# 1604 "include/linux/fs.h"
|
|
struct dir_context;
|
|
typedef int (*filldir_t)(struct dir_context *, const char *, int, loff_t, u64,
|
|
unsigned);
|
|
|
|
struct dir_context {
|
|
const filldir_t actor;
|
|
loff_t pos;
|
|
};
|
|
|
|
struct block_device_operations;
|
|
# 1641 "include/linux/fs.h"
|
|
struct iov_iter;
|
|
|
|
struct file_operations {
|
|
struct module *owner;
|
|
loff_t (*llseek) (struct file *, loff_t, int);
|
|
ssize_t (*read) (struct file *, char *, size_t, loff_t *);
|
|
ssize_t (*write) (struct file *, const char *, size_t, loff_t *);
|
|
ssize_t (*read_iter) (struct kiocb *, struct iov_iter *);
|
|
ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
|
|
int (*iterate) (struct file *, struct dir_context *);
|
|
unsigned int (*poll) (struct file *, struct poll_table_struct *);
|
|
long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
|
|
long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
|
|
int (*mmap) (struct file *, struct vm_area_struct *);
|
|
int (*open) (struct inode *, struct file *);
|
|
int (*flush) (struct file *, fl_owner_t id);
|
|
int (*release) (struct inode *, struct file *);
|
|
int (*fsync) (struct file *, loff_t, loff_t, int datasync);
|
|
int (*aio_fsync) (struct kiocb *, int datasync);
|
|
int (*fasync) (int, struct file *, int);
|
|
int (*lock) (struct file *, int, struct file_lock *);
|
|
ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
|
|
unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
|
|
int (*check_flags)(int);
|
|
int (*flock) (struct file *, int, struct file_lock *);
|
|
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
|
|
ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
|
|
int (*setlease)(struct file *, long, struct file_lock **, void **);
|
|
long (*fallocate)(struct file *file, int mode, loff_t offset,
|
|
loff_t len);
|
|
void (*show_fdinfo)(struct seq_file *m, struct file *f);
|
|
|
|
|
|
|
|
};
|
|
|
|
struct inode_operations {
|
|
struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
|
|
const char * (*follow_link) (struct dentry *, void **);
|
|
int (*permission) (struct inode *, int);
|
|
struct posix_acl * (*get_acl)(struct inode *, int);
|
|
|
|
int (*readlink) (struct dentry *, char *,int);
|
|
void (*put_link) (struct inode *, void *);
|
|
|
|
int (*create) (struct inode *,struct dentry *, umode_t, bool);
|
|
int (*link) (struct dentry *,struct inode *,struct dentry *);
|
|
int (*unlink) (struct inode *,struct dentry *);
|
|
int (*symlink) (struct inode *,struct dentry *,const char *);
|
|
int (*mkdir) (struct inode *,struct dentry *,umode_t);
|
|
int (*rmdir) (struct inode *,struct dentry *);
|
|
int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t);
|
|
int (*rename) (struct inode *, struct dentry *,
|
|
struct inode *, struct dentry *);
|
|
int (*rename2) (struct inode *, struct dentry *,
|
|
struct inode *, struct dentry *, unsigned int);
|
|
int (*setattr) (struct dentry *, struct iattr *);
|
|
int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);
|
|
int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
|
|
ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
|
|
ssize_t (*listxattr) (struct dentry *, char *, size_t);
|
|
int (*removexattr) (struct dentry *, const char *);
|
|
int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start,
|
|
u64 len);
|
|
int (*update_time)(struct inode *, struct timespec *, int);
|
|
int (*atomic_open)(struct inode *, struct dentry *,
|
|
struct file *, unsigned open_flag,
|
|
umode_t create_mode, int *opened);
|
|
int (*tmpfile) (struct inode *, struct dentry *, umode_t);
|
|
int (*set_acl)(struct inode *, struct posix_acl *, int);
|
|
} __attribute__((__aligned__((1 << 6))));
|
|
|
|
ssize_t rw_copy_check_uvector(int type, const struct iovec * uvector,
|
|
unsigned long nr_segs, unsigned long fast_segs,
|
|
struct iovec *fast_pointer,
|
|
struct iovec **ret_pointer);
|
|
|
|
extern ssize_t __vfs_read(struct file *, char *, size_t, loff_t *);
|
|
extern ssize_t __vfs_write(struct file *, const char *, size_t, loff_t *);
|
|
extern ssize_t vfs_read(struct file *, char *, size_t, loff_t *);
|
|
extern ssize_t vfs_write(struct file *, const char *, size_t, loff_t *);
|
|
extern ssize_t vfs_readv(struct file *, const struct iovec *,
|
|
unsigned long, loff_t *);
|
|
extern ssize_t vfs_writev(struct file *, const struct iovec *,
|
|
unsigned long, loff_t *);
|
|
|
|
struct super_operations {
|
|
struct inode *(*alloc_inode)(struct super_block *sb);
|
|
void (*destroy_inode)(struct inode *);
|
|
|
|
void (*dirty_inode) (struct inode *, int flags);
|
|
int (*write_inode) (struct inode *, struct writeback_control *wbc);
|
|
int (*drop_inode) (struct inode *);
|
|
void (*evict_inode) (struct inode *);
|
|
void (*put_super) (struct super_block *);
|
|
int (*sync_fs)(struct super_block *sb, int wait);
|
|
int (*freeze_super) (struct super_block *);
|
|
int (*freeze_fs) (struct super_block *);
|
|
int (*thaw_super) (struct super_block *);
|
|
int (*unfreeze_fs) (struct super_block *);
|
|
int (*statfs) (struct dentry *, struct kstatfs *);
|
|
int (*remount_fs) (struct super_block *, int *, char *);
|
|
void (*umount_begin) (struct super_block *);
|
|
|
|
int (*show_options)(struct seq_file *, struct dentry *);
|
|
int (*show_devname)(struct seq_file *, struct dentry *);
|
|
int (*show_path)(struct seq_file *, struct dentry *);
|
|
int (*show_stats)(struct seq_file *, struct dentry *);
|
|
|
|
|
|
|
|
|
|
|
|
int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t);
|
|
long (*nr_cached_objects)(struct super_block *,
|
|
struct shrink_control *);
|
|
long (*free_cached_objects)(struct super_block *,
|
|
struct shrink_control *);
|
|
};
|
|
# 1904 "include/linux/fs.h"
|
|
extern void __mark_inode_dirty(struct inode *, int);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mark_inode_dirty(struct inode *inode)
|
|
{
|
|
__mark_inode_dirty(inode, ((1 << 0) | (1 << 1) | (1 << 2)));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mark_inode_dirty_sync(struct inode *inode)
|
|
{
|
|
__mark_inode_dirty(inode, (1 << 0));
|
|
}
|
|
|
|
extern void inc_nlink(struct inode *inode);
|
|
extern void drop_nlink(struct inode *inode);
|
|
extern void clear_nlink(struct inode *inode);
|
|
extern void set_nlink(struct inode *inode, unsigned int nlink);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inode_inc_link_count(struct inode *inode)
|
|
{
|
|
inc_nlink(inode);
|
|
mark_inode_dirty(inode);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inode_dec_link_count(struct inode *inode)
|
|
{
|
|
drop_nlink(inode);
|
|
mark_inode_dirty(inode);
|
|
}
|
|
# 1940 "include/linux/fs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inode_inc_iversion(struct inode *inode)
|
|
{
|
|
spin_lock(&inode->i_lock);
|
|
inode->i_version++;
|
|
spin_unlock(&inode->i_lock);
|
|
}
|
|
|
|
enum file_time_flags {
|
|
S_ATIME = 1,
|
|
S_MTIME = 2,
|
|
S_CTIME = 4,
|
|
S_VERSION = 8,
|
|
};
|
|
|
|
extern bool atime_needs_update(const struct path *, struct inode *);
|
|
extern void touch_atime(const struct path *);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void file_accessed(struct file *file)
|
|
{
|
|
if (!(file->f_flags & 01000000))
|
|
touch_atime(&file->f_path);
|
|
}
|
|
|
|
int sync_inode(struct inode *inode, struct writeback_control *wbc);
|
|
int sync_inode_metadata(struct inode *inode, int wait);
|
|
|
|
struct file_system_type {
|
|
const char *name;
|
|
int fs_flags;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct dentry *(*mount) (struct file_system_type *, int,
|
|
const char *, void *);
|
|
void (*kill_sb) (struct super_block *);
|
|
struct module *owner;
|
|
struct file_system_type * next;
|
|
struct hlist_head fs_supers;
|
|
|
|
struct lock_class_key s_lock_key;
|
|
struct lock_class_key s_umount_key;
|
|
struct lock_class_key s_vfs_rename_key;
|
|
struct lock_class_key s_writers_key[(SB_FREEZE_COMPLETE - 1)];
|
|
|
|
struct lock_class_key i_lock_key;
|
|
struct lock_class_key i_mutex_key;
|
|
struct lock_class_key i_mutex_dir_key;
|
|
};
|
|
|
|
|
|
|
|
extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags,
|
|
void *data, int (*fill_super)(struct super_block *, void *, int));
|
|
extern struct dentry *mount_bdev(struct file_system_type *fs_type,
|
|
int flags, const char *dev_name, void *data,
|
|
int (*fill_super)(struct super_block *, void *, int));
|
|
extern struct dentry *mount_single(struct file_system_type *fs_type,
|
|
int flags, void *data,
|
|
int (*fill_super)(struct super_block *, void *, int));
|
|
extern struct dentry *mount_nodev(struct file_system_type *fs_type,
|
|
int flags, void *data,
|
|
int (*fill_super)(struct super_block *, void *, int));
|
|
extern struct dentry *mount_subtree(struct vfsmount *mnt, const char *path);
|
|
void generic_shutdown_super(struct super_block *sb);
|
|
void kill_block_super(struct super_block *sb);
|
|
void kill_anon_super(struct super_block *sb);
|
|
void kill_litter_super(struct super_block *sb);
|
|
void deactivate_super(struct super_block *sb);
|
|
void deactivate_locked_super(struct super_block *sb);
|
|
int set_anon_super(struct super_block *s, void *data);
|
|
int get_anon_bdev(dev_t *);
|
|
void free_anon_bdev(dev_t);
|
|
struct super_block *sget(struct file_system_type *type,
|
|
int (*test)(struct super_block *,void *),
|
|
int (*set)(struct super_block *,void *),
|
|
int flags, void *data);
|
|
extern struct dentry *mount_pseudo(struct file_system_type *, char *,
|
|
const struct super_operations *ops,
|
|
const struct dentry_operations *dops,
|
|
unsigned long);
|
|
# 2041 "include/linux/fs.h"
|
|
extern int register_filesystem(struct file_system_type *);
|
|
extern int unregister_filesystem(struct file_system_type *);
|
|
extern struct vfsmount *kern_mount_data(struct file_system_type *, void *data);
|
|
|
|
extern void kern_unmount(struct vfsmount *mnt);
|
|
extern int may_umount_tree(struct vfsmount *);
|
|
extern int may_umount(struct vfsmount *);
|
|
extern long do_mount(const char *, const char *,
|
|
const char *, unsigned long, void *);
|
|
extern struct vfsmount *collect_mounts(struct path *);
|
|
extern void drop_collected_mounts(struct vfsmount *);
|
|
extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *,
|
|
struct vfsmount *);
|
|
extern int vfs_statfs(struct path *, struct kstatfs *);
|
|
extern int user_statfs(const char *, struct kstatfs *);
|
|
extern int fd_statfs(int, struct kstatfs *);
|
|
extern int vfs_ustat(dev_t, struct kstatfs *);
|
|
extern int freeze_super(struct super_block *super);
|
|
extern int thaw_super(struct super_block *super);
|
|
extern bool our_mnt(struct vfsmount *mnt);
|
|
|
|
extern int current_umask(void);
|
|
|
|
extern void ihold(struct inode * inode);
|
|
extern void iput(struct inode *);
|
|
extern int generic_update_time(struct inode *, struct timespec *, int);
|
|
|
|
|
|
extern struct kobject *fs_kobj;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern int locks_mandatory_locked(struct file *);
|
|
extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __mandatory_lock(struct inode *ino)
|
|
{
|
|
return (ino->i_mode & (0002000 | 00010)) == 0002000;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mandatory_lock(struct inode *ino)
|
|
{
|
|
return ((ino)->i_sb->s_flags & (64)) && __mandatory_lock(ino);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int locks_verify_locked(struct file *file)
|
|
{
|
|
if (mandatory_lock(file_inode(file)))
|
|
return locks_mandatory_locked(file);
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int locks_verify_truncate(struct inode *inode,
|
|
struct file *filp,
|
|
loff_t size)
|
|
{
|
|
if (inode->i_flctx && mandatory_lock(inode))
|
|
return locks_mandatory_area(
|
|
2, inode, filp,
|
|
size < inode->i_size ? size : inode->i_size,
|
|
(size < inode->i_size ? inode->i_size - size
|
|
: size - inode->i_size)
|
|
);
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int break_lease(struct inode *inode, unsigned int mode)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease))
|
|
return __break_lease(inode, mode, 32);
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int break_deleg(struct inode *inode, unsigned int mode)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease))
|
|
return __break_lease(inode, mode, 4);
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int try_break_deleg(struct inode *inode, struct inode **delegated_inode)
|
|
{
|
|
int ret;
|
|
|
|
ret = break_deleg(inode, 00000001|00004000);
|
|
if (ret == -11 && delegated_inode) {
|
|
*delegated_inode = inode;
|
|
ihold(inode);
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int break_deleg_wait(struct inode **delegated_inode)
|
|
{
|
|
int ret;
|
|
|
|
ret = break_deleg(*delegated_inode, 00000001);
|
|
iput(*delegated_inode);
|
|
*delegated_inode = ((void *)0);
|
|
return ret;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int break_layout(struct inode *inode, bool wait)
|
|
{
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease))
|
|
return __break_lease(inode,
|
|
wait ? 00000001 : 00000001 | 00004000,
|
|
2048);
|
|
return 0;
|
|
}
|
|
# 2244 "include/linux/fs.h"
|
|
struct audit_names;
|
|
struct filename {
|
|
const char *name;
|
|
const char *uptr;
|
|
struct audit_names *aname;
|
|
int refcnt;
|
|
const char iname[];
|
|
};
|
|
|
|
extern long vfs_truncate(struct path *, loff_t);
|
|
extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs,
|
|
struct file *filp);
|
|
extern int vfs_fallocate(struct file *file, int mode, loff_t offset,
|
|
loff_t len);
|
|
extern long do_sys_open(int dfd, const char *filename, int flags,
|
|
umode_t mode);
|
|
extern struct file *file_open_name(struct filename *, int, umode_t);
|
|
extern struct file *filp_open(const char *, int, umode_t);
|
|
extern struct file *file_open_root(struct dentry *, struct vfsmount *,
|
|
const char *, int, umode_t);
|
|
extern struct file * dentry_open(const struct path *, int, const struct cred *);
|
|
extern int filp_close(struct file *, fl_owner_t id);
|
|
|
|
extern struct filename *getname_flags(const char *, int, int *);
|
|
extern struct filename *getname(const char *);
|
|
extern struct filename *getname_kernel(const char *);
|
|
extern void putname(struct filename *name);
|
|
|
|
enum {
|
|
FILE_CREATED = 1,
|
|
FILE_OPENED = 2
|
|
};
|
|
extern int finish_open(struct file *file, struct dentry *dentry,
|
|
int (*open)(struct inode *, struct file *),
|
|
int *opened);
|
|
extern int finish_no_open(struct file *file, struct dentry *dentry);
|
|
|
|
|
|
|
|
extern int ioctl_preallocate(struct file *filp, void *argp);
|
|
|
|
|
|
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) vfs_caches_init_early(void);
|
|
extern void __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) vfs_caches_init(void);
|
|
|
|
extern struct kmem_cache *names_cachep;
|
|
|
|
|
|
|
|
|
|
|
|
extern int register_blkdev(unsigned int, const char *);
|
|
extern void unregister_blkdev(unsigned int, const char *);
|
|
extern struct block_device *bdget(dev_t);
|
|
extern struct block_device *bdgrab(struct block_device *bdev);
|
|
extern void bd_set_size(struct block_device *, loff_t size);
|
|
extern void bd_forget(struct inode *inode);
|
|
extern void bdput(struct block_device *);
|
|
extern void invalidate_bdev(struct block_device *);
|
|
extern void iterate_bdevs(void (*)(struct block_device *, void *), void *);
|
|
extern int sync_blockdev(struct block_device *bdev);
|
|
extern void kill_bdev(struct block_device *);
|
|
extern struct super_block *freeze_bdev(struct block_device *);
|
|
extern void emergency_thaw_all(void);
|
|
extern int thaw_bdev(struct block_device *bdev, struct super_block *sb);
|
|
extern int fsync_bdev(struct block_device *);
|
|
|
|
extern struct super_block *blockdev_superblock;
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sb_is_blkdev_sb(struct super_block *sb)
|
|
{
|
|
return sb == blockdev_superblock;
|
|
}
|
|
# 2342 "include/linux/fs.h"
|
|
extern int sync_filesystem(struct super_block *);
|
|
extern const struct file_operations def_blk_fops;
|
|
extern const struct file_operations def_chr_fops;
|
|
|
|
extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
|
|
extern int blkdev_ioctl(struct block_device *, fmode_t, unsigned, unsigned long);
|
|
extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
|
|
extern int blkdev_get(struct block_device *bdev, fmode_t mode, void *holder);
|
|
extern struct block_device *blkdev_get_by_path(const char *path, fmode_t mode,
|
|
void *holder);
|
|
extern struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode,
|
|
void *holder);
|
|
extern void blkdev_put(struct block_device *bdev, fmode_t mode);
|
|
extern int __blkdev_reread_part(struct block_device *bdev);
|
|
extern int blkdev_reread_part(struct block_device *bdev);
|
|
|
|
|
|
extern int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk);
|
|
extern void bd_unlink_disk_holder(struct block_device *bdev,
|
|
struct gendisk *disk);
|
|
# 2377 "include/linux/fs.h"
|
|
extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *);
|
|
extern int register_chrdev_region(dev_t, unsigned, const char *);
|
|
extern int __register_chrdev(unsigned int major, unsigned int baseminor,
|
|
unsigned int count, const char *name,
|
|
const struct file_operations *fops);
|
|
extern void __unregister_chrdev(unsigned int major, unsigned int baseminor,
|
|
unsigned int count, const char *name);
|
|
extern void unregister_chrdev_region(dev_t, unsigned);
|
|
extern void chrdev_show(struct seq_file *,off_t);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int register_chrdev(unsigned int major, const char *name,
|
|
const struct file_operations *fops)
|
|
{
|
|
return __register_chrdev(major, 0, 256, name, fops);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void unregister_chrdev(unsigned int major, const char *name)
|
|
{
|
|
__unregister_chrdev(major, 0, 256, name);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern const char *__bdevname(dev_t, char *buffer);
|
|
extern const char *bdevname(struct block_device *bdev, char *buffer);
|
|
extern struct block_device *lookup_bdev(const char *);
|
|
extern void blkdev_show(struct seq_file *,off_t);
|
|
|
|
|
|
|
|
|
|
|
|
extern void init_special_inode(struct inode *, umode_t, dev_t);
|
|
|
|
|
|
extern void make_bad_inode(struct inode *);
|
|
extern int is_bad_inode(struct inode *);
|
|
# 2430 "include/linux/fs.h"
|
|
extern void check_disk_size_change(struct gendisk *disk,
|
|
struct block_device *bdev);
|
|
extern int revalidate_disk(struct gendisk *);
|
|
extern int check_disk_change(struct block_device *);
|
|
extern int __invalidate_device(struct block_device *, bool);
|
|
extern int invalidate_partition(struct gendisk *, int);
|
|
|
|
unsigned long invalidate_mapping_pages(struct address_space *mapping,
|
|
unsigned long start, unsigned long end);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void invalidate_remote_inode(struct inode *inode)
|
|
{
|
|
if ((((inode->i_mode) & 00170000) == 0100000) || (((inode->i_mode) & 00170000) == 0040000) ||
|
|
(((inode->i_mode) & 00170000) == 0120000))
|
|
invalidate_mapping_pages(inode->i_mapping, 0, -1);
|
|
}
|
|
extern int invalidate_inode_pages2(struct address_space *mapping);
|
|
extern int invalidate_inode_pages2_range(struct address_space *mapping,
|
|
unsigned long start, unsigned long end);
|
|
extern int write_inode_now(struct inode *, int);
|
|
extern int filemap_fdatawrite(struct address_space *);
|
|
extern int filemap_flush(struct address_space *);
|
|
extern int filemap_fdatawait(struct address_space *);
|
|
extern void filemap_fdatawait_keep_errors(struct address_space *);
|
|
extern int filemap_fdatawait_range(struct address_space *, loff_t lstart,
|
|
loff_t lend);
|
|
extern int filemap_write_and_wait(struct address_space *mapping);
|
|
extern int filemap_write_and_wait_range(struct address_space *mapping,
|
|
loff_t lstart, loff_t lend);
|
|
extern int __filemap_fdatawrite_range(struct address_space *mapping,
|
|
loff_t start, loff_t end, int sync_mode);
|
|
extern int filemap_fdatawrite_range(struct address_space *mapping,
|
|
loff_t start, loff_t end);
|
|
|
|
extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end,
|
|
int datasync);
|
|
extern int vfs_fsync(struct file *file, int datasync);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int generic_write_sync(struct file *file, loff_t pos, loff_t count)
|
|
{
|
|
if (!(file->f_flags & 00010000) && !(((file->f_mapping->host)->i_sb->s_flags & (16)) || ((file->f_mapping->host)->i_flags & 1)))
|
|
return 0;
|
|
return vfs_fsync_range(file, pos, pos + count - 1,
|
|
(file->f_flags & 04000000) ? 0 : 1);
|
|
}
|
|
extern void emergency_sync(void);
|
|
extern void emergency_remount(void);
|
|
|
|
extern sector_t bmap(struct inode *, sector_t);
|
|
|
|
extern int notify_change(struct dentry *, struct iattr *, struct inode **);
|
|
extern int inode_permission(struct inode *, int);
|
|
extern int __inode_permission(struct inode *, int);
|
|
extern int generic_permission(struct inode *, int);
|
|
extern int __check_sticky(struct inode *dir, struct inode *inode);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool execute_ok(struct inode *inode)
|
|
{
|
|
return (inode->i_mode & (00100|00010|00001)) || (((inode->i_mode) & 00170000) == 0040000);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void file_start_write(struct file *file)
|
|
{
|
|
if (!(((file_inode(file)->i_mode) & 00170000) == 0100000))
|
|
return;
|
|
__sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, true);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool file_start_write_trylock(struct file *file)
|
|
{
|
|
if (!(((file_inode(file)->i_mode) & 00170000) == 0100000))
|
|
return true;
|
|
return __sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, false);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void file_end_write(struct file *file)
|
|
{
|
|
if (!(((file_inode(file)->i_mode) & 00170000) == 0100000))
|
|
return;
|
|
__sb_end_write(file_inode(file)->i_sb, SB_FREEZE_WRITE);
|
|
}
|
|
# 2527 "include/linux/fs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int get_write_access(struct inode *inode)
|
|
{
|
|
return atomic_inc_unless_negative(&inode->i_writecount) ? 0 : -26;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int deny_write_access(struct file *file)
|
|
{
|
|
struct inode *inode = file_inode(file);
|
|
return atomic_dec_unless_positive(&inode->i_writecount) ? 0 : -26;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_write_access(struct inode * inode)
|
|
{
|
|
atomic_sub(1, &inode->i_writecount);
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void allow_write_access(struct file *file)
|
|
{
|
|
if (file)
|
|
atomic_add(1, &file_inode(file)->i_writecount);
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool inode_is_open_for_write(const struct inode *inode)
|
|
{
|
|
return ({ union { typeof((&inode->i_writecount)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&inode->i_writecount)->counter), __u.__c, sizeof((&inode->i_writecount)->counter)); else __read_once_size_nocheck(&((&inode->i_writecount)->counter), __u.__c, sizeof((&inode->i_writecount)->counter)); __u.__val; }) > 0;
|
|
}
|
|
# 2561 "include/linux/fs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_readcount_dec(struct inode *inode)
|
|
{
|
|
return;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void i_readcount_inc(struct inode *inode)
|
|
{
|
|
return;
|
|
}
|
|
|
|
extern int do_pipe_flags(int *, int);
|
|
|
|
extern int kernel_read(struct file *, loff_t, char *, unsigned long);
|
|
extern ssize_t kernel_write(struct file *, const char *, size_t, loff_t);
|
|
extern ssize_t __kernel_write(struct file *, const char *, size_t, loff_t *);
|
|
extern struct file * open_exec(const char *);
|
|
|
|
|
|
extern int is_subdir(struct dentry *, struct dentry *);
|
|
extern int path_is_under(struct path *, struct path *);
|
|
|
|
extern char *file_path(struct file *, char *, int);
|
|
|
|
|
|
|
|
|
|
extern loff_t default_llseek(struct file *file, loff_t offset, int whence);
|
|
|
|
extern loff_t vfs_llseek(struct file *file, loff_t offset, int whence);
|
|
|
|
extern int inode_init_always(struct super_block *, struct inode *);
|
|
extern void inode_init_once(struct inode *);
|
|
extern void address_space_init_once(struct address_space *mapping);
|
|
extern struct inode * igrab(struct inode *);
|
|
extern ino_t iunique(struct super_block *, ino_t);
|
|
extern int inode_needs_sync(struct inode *inode);
|
|
extern int generic_delete_inode(struct inode *inode);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int generic_drop_inode(struct inode *inode)
|
|
{
|
|
return !inode->i_nlink || inode_unhashed(inode);
|
|
}
|
|
|
|
extern struct inode *ilookup5_nowait(struct super_block *sb,
|
|
unsigned long hashval, int (*test)(struct inode *, void *),
|
|
void *data);
|
|
extern struct inode *ilookup5(struct super_block *sb, unsigned long hashval,
|
|
int (*test)(struct inode *, void *), void *data);
|
|
extern struct inode *ilookup(struct super_block *sb, unsigned long ino);
|
|
|
|
extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *);
|
|
extern struct inode * iget_locked(struct super_block *, unsigned long);
|
|
extern struct inode *find_inode_nowait(struct super_block *,
|
|
unsigned long,
|
|
int (*match)(struct inode *,
|
|
unsigned long, void *),
|
|
void *data);
|
|
extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *);
|
|
extern int insert_inode_locked(struct inode *);
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void lockdep_annotate_inode_mutex_key(struct inode *inode) { };
|
|
|
|
extern void unlock_new_inode(struct inode *);
|
|
extern unsigned int get_next_ino(void);
|
|
|
|
extern void __iget(struct inode * inode);
|
|
extern void iget_failed(struct inode *);
|
|
extern void clear_inode(struct inode *);
|
|
extern void __destroy_inode(struct inode *);
|
|
extern struct inode *new_inode_pseudo(struct super_block *sb);
|
|
extern struct inode *new_inode(struct super_block *sb);
|
|
extern void free_inode_nonrcu(struct inode *inode);
|
|
extern int should_remove_suid(struct dentry *);
|
|
extern int file_remove_privs(struct file *);
|
|
extern int dentry_needs_remove_privs(struct dentry *dentry);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int file_needs_remove_privs(struct file *file)
|
|
{
|
|
return dentry_needs_remove_privs(file->f_path.dentry);
|
|
}
|
|
|
|
extern void __insert_inode_hash(struct inode *, unsigned long hashval);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void insert_inode_hash(struct inode *inode)
|
|
{
|
|
__insert_inode_hash(inode, inode->i_ino);
|
|
}
|
|
|
|
extern void __remove_inode_hash(struct inode *);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void remove_inode_hash(struct inode *inode)
|
|
{
|
|
if (!inode_unhashed(inode) && !hlist_fake(&inode->i_hash))
|
|
__remove_inode_hash(inode);
|
|
}
|
|
|
|
extern void inode_sb_list_add(struct inode *inode);
|
|
|
|
|
|
extern blk_qc_t submit_bio(int, struct bio *);
|
|
extern int bdev_read_only(struct block_device *);
|
|
|
|
extern int set_blocksize(struct block_device *, int);
|
|
extern int sb_set_blocksize(struct super_block *, int);
|
|
extern int sb_min_blocksize(struct super_block *, int);
|
|
|
|
extern int generic_file_mmap(struct file *, struct vm_area_struct *);
|
|
extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
|
|
extern ssize_t generic_write_checks(struct kiocb *, struct iov_iter *);
|
|
extern ssize_t generic_file_read_iter(struct kiocb *, struct iov_iter *);
|
|
extern ssize_t __generic_file_write_iter(struct kiocb *, struct iov_iter *);
|
|
extern ssize_t generic_file_write_iter(struct kiocb *, struct iov_iter *);
|
|
extern ssize_t generic_file_direct_write(struct kiocb *, struct iov_iter *, loff_t);
|
|
extern ssize_t generic_perform_write(struct file *, struct iov_iter *, loff_t);
|
|
|
|
ssize_t vfs_iter_read(struct file *file, struct iov_iter *iter, loff_t *ppos);
|
|
ssize_t vfs_iter_write(struct file *file, struct iov_iter *iter, loff_t *ppos);
|
|
|
|
|
|
extern ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to);
|
|
extern ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from);
|
|
extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end,
|
|
int datasync);
|
|
extern void block_sync_page(struct page *page);
|
|
|
|
|
|
extern ssize_t generic_file_splice_read(struct file *, loff_t *,
|
|
struct pipe_inode_info *, size_t, unsigned int);
|
|
extern ssize_t default_file_splice_read(struct file *, loff_t *,
|
|
struct pipe_inode_info *, size_t, unsigned int);
|
|
extern ssize_t iter_file_splice_write(struct pipe_inode_info *,
|
|
struct file *, loff_t *, size_t, unsigned int);
|
|
extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe,
|
|
struct file *out, loff_t *, size_t len, unsigned int flags);
|
|
extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
|
|
loff_t *opos, size_t len, unsigned int flags);
|
|
|
|
|
|
extern void
|
|
file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
|
|
extern loff_t noop_llseek(struct file *file, loff_t offset, int whence);
|
|
extern loff_t no_llseek(struct file *file, loff_t offset, int whence);
|
|
extern loff_t vfs_setpos(struct file *file, loff_t offset, loff_t maxsize);
|
|
extern loff_t generic_file_llseek(struct file *file, loff_t offset, int whence);
|
|
extern loff_t generic_file_llseek_size(struct file *file, loff_t offset,
|
|
int whence, loff_t maxsize, loff_t eof);
|
|
extern loff_t fixed_size_llseek(struct file *file, loff_t offset,
|
|
int whence, loff_t size);
|
|
extern int generic_file_open(struct inode * inode, struct file * filp);
|
|
extern int nonseekable_open(struct inode * inode, struct file * filp);
|
|
|
|
|
|
typedef void (dio_submit_t)(int rw, struct bio *bio, struct inode *inode,
|
|
loff_t file_offset);
|
|
|
|
enum {
|
|
|
|
DIO_LOCKING = 0x01,
|
|
|
|
|
|
DIO_SKIP_HOLES = 0x02,
|
|
|
|
|
|
DIO_ASYNC_EXTEND = 0x04,
|
|
|
|
|
|
DIO_SKIP_DIO_COUNT = 0x08,
|
|
};
|
|
|
|
void dio_end_io(struct bio *bio, int error);
|
|
|
|
ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
|
|
struct block_device *bdev, struct iov_iter *iter,
|
|
loff_t offset, get_block_t get_block,
|
|
dio_iodone_t end_io, dio_submit_t submit_io,
|
|
int flags);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ssize_t blockdev_direct_IO(struct kiocb *iocb,
|
|
struct inode *inode,
|
|
struct iov_iter *iter, loff_t offset,
|
|
get_block_t get_block)
|
|
{
|
|
return __blockdev_direct_IO(iocb, inode, inode->i_sb->s_bdev, iter,
|
|
offset, get_block, ((void *)0), ((void *)0),
|
|
DIO_LOCKING | DIO_SKIP_HOLES);
|
|
}
|
|
|
|
|
|
void inode_dio_wait(struct inode *inode);
|
|
# 2755 "include/linux/fs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inode_dio_begin(struct inode *inode)
|
|
{
|
|
atomic_add(1, &inode->i_dio_count);
|
|
}
|
|
# 2767 "include/linux/fs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inode_dio_end(struct inode *inode)
|
|
{
|
|
if ((({ typeof(atomic_sub_return_relaxed(1, &inode->i_dio_count)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_sub_return_relaxed(1, &inode->i_dio_count); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) == 0))
|
|
wake_up_bit(&inode->i_state, 9);
|
|
}
|
|
|
|
extern void inode_set_flags(struct inode *inode, unsigned int flags,
|
|
unsigned int mask);
|
|
|
|
extern const struct file_operations generic_ro_fops;
|
|
|
|
|
|
|
|
extern int readlink_copy(char *, int, const char *);
|
|
extern int page_readlink(struct dentry *, char *, int);
|
|
extern const char *page_follow_link_light(struct dentry *, void **);
|
|
extern void page_put_link(struct inode *, void *);
|
|
extern int __page_symlink(struct inode *inode, const char *symname, int len,
|
|
int nofs);
|
|
extern int page_symlink(struct inode *inode, const char *symname, int len);
|
|
extern const struct inode_operations page_symlink_inode_operations;
|
|
extern void kfree_put_link(struct inode *, void *);
|
|
extern void free_page_put_link(struct inode *, void *);
|
|
extern int generic_readlink(struct dentry *, char *, int);
|
|
extern void generic_fillattr(struct inode *, struct kstat *);
|
|
int vfs_getattr_nosec(struct path *path, struct kstat *stat);
|
|
extern int vfs_getattr(struct path *, struct kstat *);
|
|
void __inode_add_bytes(struct inode *inode, loff_t bytes);
|
|
void inode_add_bytes(struct inode *inode, loff_t bytes);
|
|
void __inode_sub_bytes(struct inode *inode, loff_t bytes);
|
|
void inode_sub_bytes(struct inode *inode, loff_t bytes);
|
|
loff_t inode_get_bytes(struct inode *inode);
|
|
void inode_set_bytes(struct inode *inode, loff_t bytes);
|
|
const char *simple_follow_link(struct dentry *, void **);
|
|
extern const struct inode_operations simple_symlink_inode_operations;
|
|
|
|
extern int iterate_dir(struct file *, struct dir_context *);
|
|
|
|
extern int vfs_stat(const char *, struct kstat *);
|
|
extern int vfs_lstat(const char *, struct kstat *);
|
|
extern int vfs_fstat(unsigned int, struct kstat *);
|
|
extern int vfs_fstatat(int , const char *, struct kstat *, int);
|
|
|
|
extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
|
|
unsigned long arg);
|
|
extern int __generic_block_fiemap(struct inode *inode,
|
|
struct fiemap_extent_info *fieinfo,
|
|
loff_t start, loff_t len,
|
|
get_block_t *get_block);
|
|
extern int generic_block_fiemap(struct inode *inode,
|
|
struct fiemap_extent_info *fieinfo, u64 start,
|
|
u64 len, get_block_t *get_block);
|
|
|
|
extern void get_filesystem(struct file_system_type *fs);
|
|
extern void put_filesystem(struct file_system_type *fs);
|
|
extern struct file_system_type *get_fs_type(const char *name);
|
|
extern struct super_block *get_super(struct block_device *);
|
|
extern struct super_block *get_super_thawed(struct block_device *);
|
|
extern struct super_block *get_active_super(struct block_device *bdev);
|
|
extern void drop_super(struct super_block *sb);
|
|
extern void iterate_supers(void (*)(struct super_block *, void *), void *);
|
|
extern void iterate_supers_type(struct file_system_type *,
|
|
void (*)(struct super_block *, void *), void *);
|
|
|
|
extern int dcache_dir_open(struct inode *, struct file *);
|
|
extern int dcache_dir_close(struct inode *, struct file *);
|
|
extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
|
|
extern int dcache_readdir(struct file *, struct dir_context *);
|
|
extern int simple_setattr(struct dentry *, struct iattr *);
|
|
extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *);
|
|
extern int simple_statfs(struct dentry *, struct kstatfs *);
|
|
extern int simple_open(struct inode *inode, struct file *file);
|
|
extern int simple_link(struct dentry *, struct inode *, struct dentry *);
|
|
extern int simple_unlink(struct inode *, struct dentry *);
|
|
extern int simple_rmdir(struct inode *, struct dentry *);
|
|
extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
|
|
extern int noop_fsync(struct file *, loff_t, loff_t, int);
|
|
extern int simple_empty(struct dentry *);
|
|
extern int simple_readpage(struct file *file, struct page *page);
|
|
extern int simple_write_begin(struct file *file, struct address_space *mapping,
|
|
loff_t pos, unsigned len, unsigned flags,
|
|
struct page **pagep, void **fsdata);
|
|
extern int simple_write_end(struct file *file, struct address_space *mapping,
|
|
loff_t pos, unsigned len, unsigned copied,
|
|
struct page *page, void *fsdata);
|
|
extern int always_delete_dentry(const struct dentry *);
|
|
extern struct inode *alloc_anon_inode(struct super_block *);
|
|
extern int simple_nosetlease(struct file *, long, struct file_lock **, void **);
|
|
extern const struct dentry_operations simple_dentry_operations;
|
|
|
|
extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags);
|
|
extern ssize_t generic_read_dir(struct file *, char *, size_t, loff_t *);
|
|
extern const struct file_operations simple_dir_operations;
|
|
extern const struct inode_operations simple_dir_inode_operations;
|
|
extern void make_empty_dir_inode(struct inode *inode);
|
|
extern bool is_empty_dir_inode(struct inode *inode);
|
|
struct tree_descr { char *name; const struct file_operations *ops; int mode; };
|
|
struct dentry *d_alloc_name(struct dentry *, const char *);
|
|
extern int simple_fill_super(struct super_block *, unsigned long, struct tree_descr *);
|
|
extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count);
|
|
extern void simple_release_fs(struct vfsmount **mount, int *count);
|
|
|
|
extern ssize_t simple_read_from_buffer(void *to, size_t count,
|
|
loff_t *ppos, const void *from, size_t available);
|
|
extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos,
|
|
const void *from, size_t count);
|
|
|
|
extern int __generic_file_fsync(struct file *, loff_t, loff_t, int);
|
|
extern int generic_file_fsync(struct file *, loff_t, loff_t, int);
|
|
|
|
extern int generic_check_addressable(unsigned, u64);
|
|
|
|
|
|
extern int buffer_migrate_page(struct address_space *,
|
|
struct page *, struct page *,
|
|
enum migrate_mode);
|
|
|
|
|
|
|
|
|
|
extern int inode_change_ok(const struct inode *, struct iattr *);
|
|
extern int inode_newsize_ok(const struct inode *, loff_t offset);
|
|
extern void setattr_copy(struct inode *inode, const struct iattr *attr);
|
|
|
|
extern int file_update_time(struct file *file);
|
|
|
|
extern int generic_show_options(struct seq_file *m, struct dentry *root);
|
|
extern void save_mount_options(struct super_block *sb, char *options);
|
|
extern void replace_mount_options(struct super_block *sb, char *options);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool io_is_direct(struct file *filp)
|
|
{
|
|
return (filp->f_flags & 0200000) || ((file_inode(filp))->i_flags & 0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int iocb_flags(struct file *file)
|
|
{
|
|
int res = 0;
|
|
if (file->f_flags & 00002000)
|
|
res |= (1 << 1);
|
|
if (io_is_direct(file))
|
|
res |= (1 << 2);
|
|
return res;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ino_t parent_ino(struct dentry *dentry)
|
|
{
|
|
ino_t res;
|
|
|
|
|
|
|
|
|
|
|
|
spin_lock(&dentry->d_lockref.lock);
|
|
res = dentry->d_parent->d_inode->i_ino;
|
|
spin_unlock(&dentry->d_lockref.lock);
|
|
return res;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct simple_transaction_argresp {
|
|
ssize_t size;
|
|
char data[0];
|
|
};
|
|
|
|
|
|
|
|
char *simple_transaction_get(struct file *file, const char *buf,
|
|
size_t size);
|
|
ssize_t simple_transaction_read(struct file *file, char *buf,
|
|
size_t size, loff_t *pos);
|
|
int simple_transaction_release(struct inode *inode, struct file *file);
|
|
|
|
void simple_transaction_set(struct file *file, size_t n);
|
|
# 2978 "include/linux/fs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((format(printf, 1, 2)))
|
|
void __simple_attr_check_format(const char *fmt, ...)
|
|
{
|
|
|
|
}
|
|
|
|
int simple_attr_open(struct inode *inode, struct file *file,
|
|
int (*get)(void *, u64 *), int (*set)(void *, u64),
|
|
const char *fmt);
|
|
int simple_attr_release(struct inode *inode, struct file *file);
|
|
ssize_t simple_attr_read(struct file *file, char *buf,
|
|
size_t len, loff_t *ppos);
|
|
ssize_t simple_attr_write(struct file *file, const char *buf,
|
|
size_t len, loff_t *ppos);
|
|
|
|
struct ctl_table;
|
|
int proc_nr_files(struct ctl_table *table, int write,
|
|
void *buffer, size_t *lenp, loff_t *ppos);
|
|
int proc_nr_dentry(struct ctl_table *table, int write,
|
|
void *buffer, size_t *lenp, loff_t *ppos);
|
|
int proc_nr_inodes(struct ctl_table *table, int write,
|
|
void *buffer, size_t *lenp, loff_t *ppos);
|
|
int __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) get_filesystem_list(char *buf);
|
|
# 3009 "include/linux/fs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_sxid(umode_t mode)
|
|
{
|
|
return (mode & 0004000) || ((mode & 0002000) && (mode & 00010));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int check_sticky(struct inode *dir, struct inode *inode)
|
|
{
|
|
if (!(dir->i_mode & 0001000))
|
|
return 0;
|
|
|
|
return __check_sticky(dir, inode);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inode_has_no_xattr(struct inode *inode)
|
|
{
|
|
if (!is_sxid(inode->i_mode) && (inode->i_sb->s_flags & (1<<28)))
|
|
inode->i_flags |= 4096;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_root_inode(struct inode *inode)
|
|
{
|
|
return inode == inode->i_sb->s_root->d_inode;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dir_emit(struct dir_context *ctx,
|
|
const char *name, int namelen,
|
|
u64 ino, unsigned type)
|
|
{
|
|
return ctx->actor(ctx, name, namelen, ctx->pos, ino, type) == 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dir_emit_dot(struct file *file, struct dir_context *ctx)
|
|
{
|
|
return ctx->actor(ctx, ".", 1, ctx->pos,
|
|
file->f_path.dentry->d_inode->i_ino, 4) == 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dir_emit_dotdot(struct file *file, struct dir_context *ctx)
|
|
{
|
|
return ctx->actor(ctx, "..", 2, ctx->pos,
|
|
parent_ino(file->f_path.dentry), 4) == 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dir_emit_dots(struct file *file, struct dir_context *ctx)
|
|
{
|
|
if (ctx->pos == 0) {
|
|
if (!dir_emit_dot(file, ctx))
|
|
return false;
|
|
ctx->pos = 1;
|
|
}
|
|
if (ctx->pos == 1) {
|
|
if (!dir_emit_dotdot(file, ctx))
|
|
return false;
|
|
ctx->pos = 2;
|
|
}
|
|
return true;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dir_relax(struct inode *inode)
|
|
{
|
|
inode_unlock(inode);
|
|
inode_lock(inode);
|
|
return !((inode)->i_flags & 16);
|
|
}
|
|
|
|
extern bool path_noexec(const struct path *path);
|
|
extern void inode_nohighmem(struct inode *inode);
|
|
# 11 "include/linux/seq_file.h" 2
|
|
|
|
|
|
struct seq_operations;
|
|
|
|
struct seq_file {
|
|
char *buf;
|
|
size_t size;
|
|
size_t from;
|
|
size_t count;
|
|
size_t pad_until;
|
|
loff_t index;
|
|
loff_t read_pos;
|
|
u64 version;
|
|
struct mutex lock;
|
|
const struct seq_operations *op;
|
|
int poll_event;
|
|
const struct file *file;
|
|
void *private;
|
|
};
|
|
|
|
struct seq_operations {
|
|
void * (*start) (struct seq_file *m, loff_t *pos);
|
|
void (*stop) (struct seq_file *m, void *v);
|
|
void * (*next) (struct seq_file *m, void *v, loff_t *pos);
|
|
int (*show) (struct seq_file *m, void *v);
|
|
};
|
|
# 50 "include/linux/seq_file.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool seq_has_overflowed(struct seq_file *m)
|
|
{
|
|
return m->count == m->size;
|
|
}
|
|
# 63 "include/linux/seq_file.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) size_t seq_get_buf(struct seq_file *m, char **bufp)
|
|
{
|
|
do { if (__builtin_expect(!!(m->count > m->size), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/seq_file.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "65" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
if (m->count < m->size)
|
|
*bufp = m->buf + m->count;
|
|
else
|
|
*bufp = ((void *)0);
|
|
|
|
return m->size - m->count;
|
|
}
|
|
# 83 "include/linux/seq_file.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void seq_commit(struct seq_file *m, int num)
|
|
{
|
|
if (num < 0) {
|
|
m->count = m->size;
|
|
} else {
|
|
do { if (__builtin_expect(!!(m->count + num > m->size), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/seq_file.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "88" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
m->count += num;
|
|
}
|
|
}
|
|
# 101 "include/linux/seq_file.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void seq_setwidth(struct seq_file *m, size_t size)
|
|
{
|
|
m->pad_until = m->count + size;
|
|
}
|
|
void seq_pad(struct seq_file *m, char c);
|
|
|
|
char *mangle_path(char *s, const char *p, const char *esc);
|
|
int seq_open(struct file *, const struct seq_operations *);
|
|
ssize_t seq_read(struct file *, char *, size_t, loff_t *);
|
|
loff_t seq_lseek(struct file *, loff_t, int);
|
|
int seq_release(struct inode *, struct file *);
|
|
int seq_write(struct seq_file *seq, const void *data, size_t len);
|
|
|
|
__attribute__((format(printf, 2, 0)))
|
|
void seq_vprintf(struct seq_file *m, const char *fmt, va_list args);
|
|
__attribute__((format(printf, 2, 3)))
|
|
void seq_printf(struct seq_file *m, const char *fmt, ...);
|
|
void seq_putc(struct seq_file *m, char c);
|
|
void seq_puts(struct seq_file *m, const char *s);
|
|
void seq_put_decimal_ull(struct seq_file *m, char delimiter,
|
|
unsigned long long num);
|
|
void seq_put_decimal_ll(struct seq_file *m, char delimiter, long long num);
|
|
void seq_escape(struct seq_file *m, const char *s, const char *esc);
|
|
|
|
void seq_hex_dump(struct seq_file *m, const char *prefix_str, int prefix_type,
|
|
int rowsize, int groupsize, const void *buf, size_t len,
|
|
bool ascii);
|
|
|
|
int seq_path(struct seq_file *, const struct path *, const char *);
|
|
int seq_file_path(struct seq_file *, struct file *, const char *);
|
|
int seq_dentry(struct seq_file *, struct dentry *, const char *);
|
|
int seq_path_root(struct seq_file *m, const struct path *path,
|
|
const struct path *root, const char *esc);
|
|
|
|
int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
|
|
int single_open_size(struct file *, int (*)(struct seq_file *, void *), void *, size_t);
|
|
int single_release(struct inode *, struct file *);
|
|
void *__seq_open_private(struct file *, const struct seq_operations *, int);
|
|
int seq_open_private(struct file *, const struct seq_operations *, int);
|
|
int seq_release_private(struct inode *, struct file *);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct user_namespace *seq_user_ns(struct seq_file *seq)
|
|
{
|
|
|
|
return seq->file->f_cred->user_ns;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void seq_show_option(struct seq_file *m, const char *name,
|
|
const char *value)
|
|
{
|
|
seq_putc(m, ',');
|
|
seq_escape(m, name, ",= \t\n\\");
|
|
if (value) {
|
|
seq_putc(m, '=');
|
|
seq_escape(m, value, ", \t\n\\");
|
|
}
|
|
}
|
|
# 192 "include/linux/seq_file.h"
|
|
extern struct list_head *seq_list_start(struct list_head *head,
|
|
loff_t pos);
|
|
extern struct list_head *seq_list_start_head(struct list_head *head,
|
|
loff_t pos);
|
|
extern struct list_head *seq_list_next(void *v, struct list_head *head,
|
|
loff_t *ppos);
|
|
|
|
|
|
|
|
|
|
|
|
extern struct hlist_node *seq_hlist_start(struct hlist_head *head,
|
|
loff_t pos);
|
|
extern struct hlist_node *seq_hlist_start_head(struct hlist_head *head,
|
|
loff_t pos);
|
|
extern struct hlist_node *seq_hlist_next(void *v, struct hlist_head *head,
|
|
loff_t *ppos);
|
|
|
|
extern struct hlist_node *seq_hlist_start_rcu(struct hlist_head *head,
|
|
loff_t pos);
|
|
extern struct hlist_node *seq_hlist_start_head_rcu(struct hlist_head *head,
|
|
loff_t pos);
|
|
extern struct hlist_node *seq_hlist_next_rcu(void *v,
|
|
struct hlist_head *head,
|
|
loff_t *ppos);
|
|
|
|
|
|
extern struct hlist_node *seq_hlist_start_percpu(struct hlist_head *head, int *cpu, loff_t pos);
|
|
|
|
extern struct hlist_node *seq_hlist_next_percpu(void *v, struct hlist_head *head, int *cpu, loff_t *pos);
|
|
# 5 "include/linux/seq_file_net.h" 2
|
|
|
|
struct net;
|
|
extern struct net init_net;
|
|
|
|
struct seq_net_private {
|
|
|
|
struct net *net;
|
|
|
|
};
|
|
|
|
int seq_open_net(struct inode *, struct file *,
|
|
const struct seq_operations *, int);
|
|
int single_open_net(struct inode *, struct file *file,
|
|
int (*show)(struct seq_file *, void *));
|
|
int seq_release_net(struct inode *, struct file *);
|
|
int single_release_net(struct inode *, struct file *);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct net *seq_file_net(struct seq_file *seq)
|
|
{
|
|
|
|
return ((struct seq_net_private *)seq->private)->net;
|
|
|
|
|
|
|
|
}
|
|
# 145 "include/net/net_namespace.h" 2
|
|
|
|
|
|
extern struct net init_net;
|
|
|
|
|
|
struct net *copy_net_ns(unsigned long flags, struct user_namespace *user_ns,
|
|
struct net *old_net);
|
|
# 166 "include/net/net_namespace.h"
|
|
extern struct list_head net_namespace_list;
|
|
|
|
struct net *get_net_ns_by_pid(pid_t pid);
|
|
struct net *get_net_ns_by_fd(int pid);
|
|
|
|
|
|
void ipx_register_sysctl(void);
|
|
void ipx_unregister_sysctl(void);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void __put_net(struct net *net);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct net *get_net(struct net *net)
|
|
{
|
|
atomic_add(1, &net->count);
|
|
return net;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct net *maybe_get_net(struct net *net)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
if (!atomic_add_unless((&net->count), 1, 0))
|
|
net = ((void *)0);
|
|
return net;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_net(struct net *net)
|
|
{
|
|
if ((({ typeof(atomic_sub_return_relaxed(1, &net->count)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_sub_return_relaxed(1, &net->count); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) == 0))
|
|
__put_net(net);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
int net_eq(const struct net *net1, const struct net *net2)
|
|
{
|
|
return net1 == net2;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int check_net(const struct net *net)
|
|
{
|
|
return ({ union { typeof((&net->count)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&net->count)->counter), __u.__c, sizeof((&net->count)->counter)); else __read_once_size_nocheck(&((&net->count)->counter), __u.__c, sizeof((&net->count)->counter)); __u.__val; }) != 0;
|
|
}
|
|
|
|
void net_drop_ns(void *);
|
|
# 250 "include/net/net_namespace.h"
|
|
typedef struct {
|
|
|
|
struct net *net;
|
|
|
|
} possible_net_t;
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void write_pnet(possible_net_t *pnet, struct net *net)
|
|
{
|
|
|
|
pnet->net = net;
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct net *read_pnet(const possible_net_t *pnet)
|
|
{
|
|
|
|
return pnet->net;
|
|
|
|
|
|
|
|
}
|
|
# 290 "include/net/net_namespace.h"
|
|
int peernet2id_alloc(struct net *net, struct net *peer);
|
|
int peernet2id(struct net *net, struct net *peer);
|
|
bool peernet_has_id(struct net *net, struct net *peer);
|
|
struct net *get_net_ns_by_id(struct net *net, int id);
|
|
|
|
struct pernet_operations {
|
|
struct list_head list;
|
|
int (*init)(struct net *net);
|
|
void (*exit)(struct net *net);
|
|
void (*exit_batch)(struct list_head *net_exit_list);
|
|
int *id;
|
|
size_t size;
|
|
};
|
|
# 323 "include/net/net_namespace.h"
|
|
int register_pernet_subsys(struct pernet_operations *);
|
|
void unregister_pernet_subsys(struct pernet_operations *);
|
|
int register_pernet_device(struct pernet_operations *);
|
|
void unregister_pernet_device(struct pernet_operations *);
|
|
|
|
struct ctl_table;
|
|
struct ctl_table_header;
|
|
|
|
|
|
int net_sysctl_init(void);
|
|
struct ctl_table_header *register_net_sysctl(struct net *net, const char *path,
|
|
struct ctl_table *table);
|
|
void unregister_net_sysctl_table(struct ctl_table_header *header);
|
|
# 348 "include/net/net_namespace.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rt_genid_ipv4(struct net *net)
|
|
{
|
|
return ({ union { typeof((&net->ipv4.rt_genid)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&net->ipv4.rt_genid)->counter), __u.__c, sizeof((&net->ipv4.rt_genid)->counter)); else __read_once_size_nocheck(&((&net->ipv4.rt_genid)->counter), __u.__c, sizeof((&net->ipv4.rt_genid)->counter)); __u.__val; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rt_genid_bump_ipv4(struct net *net)
|
|
{
|
|
atomic_add(1, &net->ipv4.rt_genid);
|
|
}
|
|
|
|
extern void (*__fib6_flush_trees)(struct net *net);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rt_genid_bump_ipv6(struct net *net)
|
|
{
|
|
if (__fib6_flush_trees)
|
|
__fib6_flush_trees(net);
|
|
}
|
|
# 374 "include/net/net_namespace.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rt_genid_bump_all(struct net *net)
|
|
{
|
|
rt_genid_bump_ipv4(net);
|
|
rt_genid_bump_ipv6(net);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fnhe_genid(struct net *net)
|
|
{
|
|
return ({ union { typeof((&net->fnhe_genid)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&net->fnhe_genid)->counter), __u.__c, sizeof((&net->fnhe_genid)->counter)); else __read_once_size_nocheck(&((&net->fnhe_genid)->counter), __u.__c, sizeof((&net->fnhe_genid)->counter)); __u.__val; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void fnhe_genid_bump(struct net *net)
|
|
{
|
|
atomic_add(1, &net->fnhe_genid);
|
|
}
|
|
# 44 "include/linux/netdevice.h" 2
|
|
# 1 "include/net/dsa.h" 1
|
|
# 18 "include/net/dsa.h"
|
|
# 1 "include/linux/of.h" 1
|
|
# 22 "include/linux/of.h"
|
|
# 1 "include/linux/mod_devicetable.h" 1
|
|
# 12 "include/linux/mod_devicetable.h"
|
|
# 1 "include/linux/uuid.h" 1
|
|
# 23 "include/linux/uuid.h"
|
|
# 1 "include/uapi/linux/uuid.h" 1
|
|
# 27 "include/uapi/linux/uuid.h"
|
|
typedef struct {
|
|
__u8 b[16];
|
|
} uuid_le;
|
|
|
|
typedef struct {
|
|
__u8 b[16];
|
|
} uuid_be;
|
|
# 24 "include/linux/uuid.h" 2
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int uuid_le_cmp(const uuid_le u1, const uuid_le u2)
|
|
{
|
|
return memcmp(&u1, &u2, sizeof(uuid_le));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int uuid_be_cmp(const uuid_be u1, const uuid_be u2)
|
|
{
|
|
return memcmp(&u1, &u2, sizeof(uuid_be));
|
|
}
|
|
|
|
extern void uuid_le_gen(uuid_le *u);
|
|
extern void uuid_be_gen(uuid_be *u);
|
|
# 13 "include/linux/mod_devicetable.h" 2
|
|
typedef unsigned long kernel_ulong_t;
|
|
|
|
|
|
|
|
|
|
struct pci_device_id {
|
|
__u32 vendor, device;
|
|
__u32 subvendor, subdevice;
|
|
__u32 class, class_mask;
|
|
kernel_ulong_t driver_data;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct ieee1394_device_id {
|
|
__u32 match_flags;
|
|
__u32 vendor_id;
|
|
__u32 model_id;
|
|
__u32 specifier_id;
|
|
__u32 version;
|
|
kernel_ulong_t driver_data;
|
|
};
|
|
# 101 "include/linux/mod_devicetable.h"
|
|
struct usb_device_id {
|
|
|
|
__u16 match_flags;
|
|
|
|
|
|
__u16 idVendor;
|
|
__u16 idProduct;
|
|
__u16 bcdDevice_lo;
|
|
__u16 bcdDevice_hi;
|
|
|
|
|
|
__u8 bDeviceClass;
|
|
__u8 bDeviceSubClass;
|
|
__u8 bDeviceProtocol;
|
|
|
|
|
|
__u8 bInterfaceClass;
|
|
__u8 bInterfaceSubClass;
|
|
__u8 bInterfaceProtocol;
|
|
|
|
|
|
__u8 bInterfaceNumber;
|
|
|
|
|
|
kernel_ulong_t driver_info
|
|
__attribute__((aligned(sizeof(kernel_ulong_t))));
|
|
};
|
|
# 146 "include/linux/mod_devicetable.h"
|
|
struct hid_device_id {
|
|
__u16 bus;
|
|
__u16 group;
|
|
__u32 vendor;
|
|
__u32 product;
|
|
kernel_ulong_t driver_data;
|
|
};
|
|
|
|
|
|
struct ccw_device_id {
|
|
__u16 match_flags;
|
|
|
|
__u16 cu_type;
|
|
__u16 dev_type;
|
|
__u8 cu_model;
|
|
__u8 dev_model;
|
|
|
|
kernel_ulong_t driver_info;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct ap_device_id {
|
|
__u16 match_flags;
|
|
__u8 dev_type;
|
|
kernel_ulong_t driver_info;
|
|
};
|
|
|
|
|
|
|
|
|
|
struct css_device_id {
|
|
__u8 match_flags;
|
|
__u8 type;
|
|
kernel_ulong_t driver_data;
|
|
};
|
|
|
|
|
|
|
|
struct acpi_device_id {
|
|
__u8 id[9];
|
|
kernel_ulong_t driver_data;
|
|
__u32 cls;
|
|
__u32 cls_msk;
|
|
};
|
|
|
|
|
|
|
|
|
|
struct pnp_device_id {
|
|
__u8 id[8];
|
|
kernel_ulong_t driver_data;
|
|
};
|
|
|
|
struct pnp_card_device_id {
|
|
__u8 id[8];
|
|
kernel_ulong_t driver_data;
|
|
struct {
|
|
__u8 id[8];
|
|
} devs[8];
|
|
};
|
|
|
|
|
|
|
|
|
|
struct serio_device_id {
|
|
__u8 type;
|
|
__u8 extra;
|
|
__u8 id;
|
|
__u8 proto;
|
|
};
|
|
|
|
struct hda_device_id {
|
|
__u32 vendor_id;
|
|
__u32 rev_id;
|
|
__u8 api_version;
|
|
const char *name;
|
|
unsigned long driver_data;
|
|
};
|
|
|
|
|
|
|
|
|
|
struct of_device_id {
|
|
char name[32];
|
|
char type[32];
|
|
char compatible[128];
|
|
const void *data;
|
|
};
|
|
|
|
|
|
struct vio_device_id {
|
|
char type[32];
|
|
char compat[32];
|
|
};
|
|
|
|
|
|
|
|
struct pcmcia_device_id {
|
|
__u16 match_flags;
|
|
|
|
__u16 manf_id;
|
|
__u16 card_id;
|
|
|
|
__u8 func_id;
|
|
|
|
|
|
__u8 function;
|
|
|
|
|
|
__u8 device_no;
|
|
|
|
__u32 prod_id_hash[4];
|
|
|
|
|
|
const char * prod_id[4];
|
|
|
|
|
|
kernel_ulong_t driver_info;
|
|
char * cisfile;
|
|
};
|
|
# 311 "include/linux/mod_devicetable.h"
|
|
struct input_device_id {
|
|
|
|
kernel_ulong_t flags;
|
|
|
|
__u16 bustype;
|
|
__u16 vendor;
|
|
__u16 product;
|
|
__u16 version;
|
|
|
|
kernel_ulong_t evbit[0x1f / 32 + 1];
|
|
kernel_ulong_t keybit[0x2ff / 32 + 1];
|
|
kernel_ulong_t relbit[0x0f / 32 + 1];
|
|
kernel_ulong_t absbit[0x3f / 32 + 1];
|
|
kernel_ulong_t mscbit[0x07 / 32 + 1];
|
|
kernel_ulong_t ledbit[0x0f / 32 + 1];
|
|
kernel_ulong_t sndbit[0x07 / 32 + 1];
|
|
kernel_ulong_t ffbit[0x7f / 32 + 1];
|
|
kernel_ulong_t swbit[0x0f / 32 + 1];
|
|
|
|
kernel_ulong_t driver_info;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct eisa_device_id {
|
|
char sig[8];
|
|
kernel_ulong_t driver_data;
|
|
};
|
|
|
|
|
|
|
|
struct parisc_device_id {
|
|
__u8 hw_type;
|
|
__u8 hversion_rev;
|
|
__u16 hversion;
|
|
__u32 sversion;
|
|
};
|
|
# 361 "include/linux/mod_devicetable.h"
|
|
struct sdio_device_id {
|
|
__u8 class;
|
|
__u16 vendor;
|
|
__u16 device;
|
|
kernel_ulong_t driver_data;
|
|
};
|
|
|
|
|
|
struct ssb_device_id {
|
|
__u16 vendor;
|
|
__u16 coreid;
|
|
__u8 revision;
|
|
__u8 __pad;
|
|
} __attribute__((packed, aligned(2)));
|
|
# 383 "include/linux/mod_devicetable.h"
|
|
struct bcma_device_id {
|
|
__u16 manuf;
|
|
__u16 id;
|
|
__u8 rev;
|
|
__u8 class;
|
|
} __attribute__((packed,aligned(2)));
|
|
# 397 "include/linux/mod_devicetable.h"
|
|
struct virtio_device_id {
|
|
__u32 device;
|
|
__u32 vendor;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct hv_vmbus_device_id {
|
|
__u8 guid[16];
|
|
kernel_ulong_t driver_data;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct rpmsg_device_id {
|
|
char name[32];
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct i2c_device_id {
|
|
char name[20];
|
|
kernel_ulong_t driver_data;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct spi_device_id {
|
|
char name[32];
|
|
kernel_ulong_t driver_data;
|
|
};
|
|
|
|
|
|
|
|
|
|
struct spmi_device_id {
|
|
char name[32];
|
|
kernel_ulong_t driver_data;
|
|
};
|
|
|
|
|
|
enum dmi_field {
|
|
DMI_NONE,
|
|
DMI_BIOS_VENDOR,
|
|
DMI_BIOS_VERSION,
|
|
DMI_BIOS_DATE,
|
|
DMI_SYS_VENDOR,
|
|
DMI_PRODUCT_NAME,
|
|
DMI_PRODUCT_VERSION,
|
|
DMI_PRODUCT_SERIAL,
|
|
DMI_PRODUCT_UUID,
|
|
DMI_BOARD_VENDOR,
|
|
DMI_BOARD_NAME,
|
|
DMI_BOARD_VERSION,
|
|
DMI_BOARD_SERIAL,
|
|
DMI_BOARD_ASSET_TAG,
|
|
DMI_CHASSIS_VENDOR,
|
|
DMI_CHASSIS_TYPE,
|
|
DMI_CHASSIS_VERSION,
|
|
DMI_CHASSIS_SERIAL,
|
|
DMI_CHASSIS_ASSET_TAG,
|
|
DMI_STRING_MAX,
|
|
};
|
|
|
|
struct dmi_strmatch {
|
|
unsigned char slot:7;
|
|
unsigned char exact_match:1;
|
|
char substr[79];
|
|
};
|
|
|
|
struct dmi_system_id {
|
|
int (*callback)(const struct dmi_system_id *);
|
|
const char *ident;
|
|
struct dmi_strmatch matches[4];
|
|
void *driver_data;
|
|
};
|
|
# 498 "include/linux/mod_devicetable.h"
|
|
struct platform_device_id {
|
|
char name[20];
|
|
kernel_ulong_t driver_data;
|
|
};
|
|
# 524 "include/linux/mod_devicetable.h"
|
|
struct mdio_device_id {
|
|
__u32 phy_id;
|
|
__u32 phy_id_mask;
|
|
};
|
|
|
|
struct zorro_device_id {
|
|
__u32 id;
|
|
kernel_ulong_t driver_data;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct isapnp_device_id {
|
|
unsigned short card_vendor, card_device;
|
|
unsigned short vendor, function;
|
|
kernel_ulong_t driver_data;
|
|
};
|
|
# 553 "include/linux/mod_devicetable.h"
|
|
struct amba_id {
|
|
unsigned int id;
|
|
unsigned int mask;
|
|
void *data;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct mips_cdmm_device_id {
|
|
__u8 type;
|
|
};
|
|
# 577 "include/linux/mod_devicetable.h"
|
|
struct x86_cpu_id {
|
|
__u16 vendor;
|
|
__u16 family;
|
|
__u16 model;
|
|
__u16 feature;
|
|
kernel_ulong_t driver_data;
|
|
};
|
|
# 598 "include/linux/mod_devicetable.h"
|
|
struct cpu_feature {
|
|
__u16 feature;
|
|
};
|
|
|
|
|
|
|
|
struct ipack_device_id {
|
|
__u8 format;
|
|
__u32 vendor;
|
|
__u32 device;
|
|
};
|
|
# 623 "include/linux/mod_devicetable.h"
|
|
struct mei_cl_device_id {
|
|
char name[32];
|
|
uuid_le uuid;
|
|
__u8 version;
|
|
kernel_ulong_t driver_info;
|
|
};
|
|
# 644 "include/linux/mod_devicetable.h"
|
|
struct rio_device_id {
|
|
__u16 did, vid;
|
|
__u16 asm_did, asm_vid;
|
|
};
|
|
|
|
struct mcb_device_id {
|
|
__u16 device;
|
|
kernel_ulong_t driver_data;
|
|
};
|
|
|
|
struct ulpi_device_id {
|
|
__u16 vendor;
|
|
__u16 product;
|
|
kernel_ulong_t driver_data;
|
|
};
|
|
# 23 "include/linux/of.h" 2
|
|
|
|
|
|
|
|
# 1 "include/linux/property.h" 1
|
|
# 16 "include/linux/property.h"
|
|
# 1 "include/linux/fwnode.h" 1
|
|
# 15 "include/linux/fwnode.h"
|
|
enum fwnode_type {
|
|
FWNODE_INVALID = 0,
|
|
FWNODE_OF,
|
|
FWNODE_ACPI,
|
|
FWNODE_ACPI_DATA,
|
|
FWNODE_PDATA,
|
|
FWNODE_IRQCHIP,
|
|
};
|
|
|
|
struct fwnode_handle {
|
|
enum fwnode_type type;
|
|
struct fwnode_handle *secondary;
|
|
};
|
|
# 17 "include/linux/property.h" 2
|
|
|
|
|
|
struct device;
|
|
|
|
enum dev_prop_type {
|
|
DEV_PROP_U8,
|
|
DEV_PROP_U16,
|
|
DEV_PROP_U32,
|
|
DEV_PROP_U64,
|
|
DEV_PROP_STRING,
|
|
DEV_PROP_MAX,
|
|
};
|
|
|
|
enum dev_dma_attr {
|
|
DEV_DMA_NOT_SUPPORTED,
|
|
DEV_DMA_NON_COHERENT,
|
|
DEV_DMA_COHERENT,
|
|
};
|
|
|
|
bool device_property_present(struct device *dev, const char *propname);
|
|
int device_property_read_u8_array(struct device *dev, const char *propname,
|
|
u8 *val, size_t nval);
|
|
int device_property_read_u16_array(struct device *dev, const char *propname,
|
|
u16 *val, size_t nval);
|
|
int device_property_read_u32_array(struct device *dev, const char *propname,
|
|
u32 *val, size_t nval);
|
|
int device_property_read_u64_array(struct device *dev, const char *propname,
|
|
u64 *val, size_t nval);
|
|
int device_property_read_string_array(struct device *dev, const char *propname,
|
|
const char **val, size_t nval);
|
|
int device_property_read_string(struct device *dev, const char *propname,
|
|
const char **val);
|
|
int device_property_match_string(struct device *dev,
|
|
const char *propname, const char *string);
|
|
|
|
bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname);
|
|
int fwnode_property_read_u8_array(struct fwnode_handle *fwnode,
|
|
const char *propname, u8 *val,
|
|
size_t nval);
|
|
int fwnode_property_read_u16_array(struct fwnode_handle *fwnode,
|
|
const char *propname, u16 *val,
|
|
size_t nval);
|
|
int fwnode_property_read_u32_array(struct fwnode_handle *fwnode,
|
|
const char *propname, u32 *val,
|
|
size_t nval);
|
|
int fwnode_property_read_u64_array(struct fwnode_handle *fwnode,
|
|
const char *propname, u64 *val,
|
|
size_t nval);
|
|
int fwnode_property_read_string_array(struct fwnode_handle *fwnode,
|
|
const char *propname, const char **val,
|
|
size_t nval);
|
|
int fwnode_property_read_string(struct fwnode_handle *fwnode,
|
|
const char *propname, const char **val);
|
|
int fwnode_property_match_string(struct fwnode_handle *fwnode,
|
|
const char *propname, const char *string);
|
|
|
|
struct fwnode_handle *device_get_next_child_node(struct device *dev,
|
|
struct fwnode_handle *child);
|
|
|
|
|
|
|
|
|
|
|
|
void fwnode_handle_put(struct fwnode_handle *fwnode);
|
|
|
|
unsigned int device_get_child_node_count(struct device *dev);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool device_property_read_bool(struct device *dev,
|
|
const char *propname)
|
|
{
|
|
return device_property_present(dev, propname);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_property_read_u8(struct device *dev,
|
|
const char *propname, u8 *val)
|
|
{
|
|
return device_property_read_u8_array(dev, propname, val, 1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_property_read_u16(struct device *dev,
|
|
const char *propname, u16 *val)
|
|
{
|
|
return device_property_read_u16_array(dev, propname, val, 1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_property_read_u32(struct device *dev,
|
|
const char *propname, u32 *val)
|
|
{
|
|
return device_property_read_u32_array(dev, propname, val, 1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int device_property_read_u64(struct device *dev,
|
|
const char *propname, u64 *val)
|
|
{
|
|
return device_property_read_u64_array(dev, propname, val, 1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool fwnode_property_read_bool(struct fwnode_handle *fwnode,
|
|
const char *propname)
|
|
{
|
|
return fwnode_property_present(fwnode, propname);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fwnode_property_read_u8(struct fwnode_handle *fwnode,
|
|
const char *propname, u8 *val)
|
|
{
|
|
return fwnode_property_read_u8_array(fwnode, propname, val, 1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fwnode_property_read_u16(struct fwnode_handle *fwnode,
|
|
const char *propname, u16 *val)
|
|
{
|
|
return fwnode_property_read_u16_array(fwnode, propname, val, 1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fwnode_property_read_u32(struct fwnode_handle *fwnode,
|
|
const char *propname, u32 *val)
|
|
{
|
|
return fwnode_property_read_u32_array(fwnode, propname, val, 1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fwnode_property_read_u64(struct fwnode_handle *fwnode,
|
|
const char *propname, u64 *val)
|
|
{
|
|
return fwnode_property_read_u64_array(fwnode, propname, val, 1);
|
|
}
|
|
# 151 "include/linux/property.h"
|
|
struct property_entry {
|
|
const char *name;
|
|
enum dev_prop_type type;
|
|
size_t nval;
|
|
union {
|
|
void *raw_data;
|
|
u8 *u8_data;
|
|
u16 *u16_data;
|
|
u32 *u32_data;
|
|
u64 *u64_data;
|
|
const char **str;
|
|
} value;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct property_set {
|
|
struct fwnode_handle fwnode;
|
|
struct property_entry *properties;
|
|
};
|
|
|
|
void device_add_property_set(struct device *dev, struct property_set *pset);
|
|
|
|
bool device_dma_supported(struct device *dev);
|
|
|
|
enum dev_dma_attr device_get_dma_attr(struct device *dev);
|
|
|
|
int device_get_phy_mode(struct device *dev);
|
|
|
|
void *device_get_mac_address(struct device *dev, char *addr, int alen);
|
|
# 27 "include/linux/of.h" 2
|
|
|
|
|
|
|
|
# 1 "arch/arm/include/generated/asm/errno.h" 1
|
|
# 31 "include/linux/of.h" 2
|
|
|
|
typedef u32 phandle;
|
|
typedef u32 ihandle;
|
|
|
|
struct property {
|
|
char *name;
|
|
int length;
|
|
void *value;
|
|
struct property *next;
|
|
unsigned long _flags;
|
|
unsigned int unique_id;
|
|
struct bin_attribute attr;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct device_node {
|
|
const char *name;
|
|
const char *type;
|
|
phandle phandle;
|
|
const char *full_name;
|
|
struct fwnode_handle fwnode;
|
|
|
|
struct property *properties;
|
|
struct property *deadprops;
|
|
struct device_node *parent;
|
|
struct device_node *child;
|
|
struct device_node *sibling;
|
|
struct kobject kobj;
|
|
unsigned long _flags;
|
|
void *data;
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
struct of_phandle_args {
|
|
struct device_node *np;
|
|
int args_count;
|
|
uint32_t args[16];
|
|
};
|
|
|
|
struct of_reconfig_data {
|
|
struct device_node *dn;
|
|
struct property *prop;
|
|
struct property *old_prop;
|
|
};
|
|
|
|
|
|
extern struct kobj_type of_node_ktype;
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void of_node_init(struct device_node *node)
|
|
{
|
|
kobject_init(&node->kobj, &of_node_ktype);
|
|
node->fwnode.type = FWNODE_OF;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_node_is_initialized(struct device_node *node)
|
|
{
|
|
return node && node->kobj.state_initialized;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_node_is_attached(struct device_node *node)
|
|
{
|
|
return node && node->kobj.state_in_sysfs;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct device_node *of_node_get(struct device_node *node)
|
|
{
|
|
return node;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void of_node_put(struct device_node *node) { }
|
|
|
|
|
|
|
|
extern struct device_node *of_root;
|
|
extern struct device_node *of_chosen;
|
|
extern struct device_node *of_aliases;
|
|
extern struct device_node *of_stdout;
|
|
extern raw_spinlock_t devtree_lock;
|
|
# 132 "include/linux/of.h"
|
|
void of_core_init(void);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_of_node(struct fwnode_handle *fwnode)
|
|
{
|
|
return fwnode && fwnode->type == FWNODE_OF;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct device_node *to_of_node(struct fwnode_handle *fwnode)
|
|
{
|
|
return is_of_node(fwnode) ?
|
|
({ const typeof( ((struct device_node *)0)->fwnode ) *__mptr = (fwnode); (struct device_node *)( (char *)__mptr - __builtin_offsetof(struct device_node, fwnode) );}) : ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool of_have_populated_dt(void)
|
|
{
|
|
return of_root != ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool of_node_is_root(const struct device_node *node)
|
|
{
|
|
return node && (node->parent == ((void *)0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_node_check_flag(struct device_node *n, unsigned long flag)
|
|
{
|
|
return test_bit(flag, &n->_flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_node_test_and_set_flag(struct device_node *n,
|
|
unsigned long flag)
|
|
{
|
|
return _test_and_set_bit(flag,&n->_flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void of_node_set_flag(struct device_node *n, unsigned long flag)
|
|
{
|
|
_set_bit(flag,&n->_flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void of_node_clear_flag(struct device_node *n, unsigned long flag)
|
|
{
|
|
_clear_bit(flag,&n->_flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_check_flag(struct property *p, unsigned long flag)
|
|
{
|
|
return test_bit(flag, &p->_flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void of_property_set_flag(struct property *p, unsigned long flag)
|
|
{
|
|
_set_bit(flag,&p->_flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void of_property_clear_flag(struct property *p, unsigned long flag)
|
|
{
|
|
_clear_bit(flag,&p->_flags);
|
|
}
|
|
|
|
extern struct device_node *__of_find_all_nodes(struct device_node *prev);
|
|
extern struct device_node *of_find_all_nodes(struct device_node *prev);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 of_read_number(const __be32 *cell, int size)
|
|
{
|
|
u64 r = 0;
|
|
while (size--)
|
|
r = (r << 32) | (__builtin_constant_p((__u32)(( __u32)(__be32)(*(cell++)))) ? ((__u32)( (((__u32)(( __u32)(__be32)(*(cell++))) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__be32)(*(cell++))) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__be32)(*(cell++))) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__be32)(*(cell++))) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__be32)(*(cell++))));
|
|
return r;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long of_read_ulong(const __be32 *cell, int size)
|
|
{
|
|
|
|
return of_read_number(cell, size);
|
|
}
|
|
# 234 "include/linux/of.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const char *of_node_full_name(const struct device_node *np)
|
|
{
|
|
return np ? np->full_name : "<no-node>";
|
|
}
|
|
|
|
|
|
|
|
|
|
extern struct device_node *of_find_node_by_name(struct device_node *from,
|
|
const char *name);
|
|
extern struct device_node *of_find_node_by_type(struct device_node *from,
|
|
const char *type);
|
|
extern struct device_node *of_find_compatible_node(struct device_node *from,
|
|
const char *type, const char *compat);
|
|
extern struct device_node *of_find_matching_node_and_match(
|
|
struct device_node *from,
|
|
const struct of_device_id *matches,
|
|
const struct of_device_id **match);
|
|
|
|
extern struct device_node *of_find_node_opts_by_path(const char *path,
|
|
const char **opts);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct device_node *of_find_node_by_path(const char *path)
|
|
{
|
|
return of_find_node_opts_by_path(path, ((void *)0));
|
|
}
|
|
|
|
extern struct device_node *of_find_node_by_phandle(phandle handle);
|
|
extern struct device_node *of_get_parent(const struct device_node *node);
|
|
extern struct device_node *of_get_next_parent(struct device_node *node);
|
|
extern struct device_node *of_get_next_child(const struct device_node *node,
|
|
struct device_node *prev);
|
|
extern struct device_node *of_get_next_available_child(
|
|
const struct device_node *node, struct device_node *prev);
|
|
|
|
extern struct device_node *of_get_child_by_name(const struct device_node *node,
|
|
const char *name);
|
|
|
|
|
|
extern struct device_node *of_find_next_cache_node(const struct device_node *);
|
|
extern struct device_node *of_find_node_with_property(
|
|
struct device_node *from, const char *prop_name);
|
|
|
|
extern struct property *of_find_property(const struct device_node *np,
|
|
const char *name,
|
|
int *lenp);
|
|
extern int of_property_count_elems_of_size(const struct device_node *np,
|
|
const char *propname, int elem_size);
|
|
extern int of_property_read_u32_index(const struct device_node *np,
|
|
const char *propname,
|
|
u32 index, u32 *out_value);
|
|
extern int of_property_read_u8_array(const struct device_node *np,
|
|
const char *propname, u8 *out_values, size_t sz);
|
|
extern int of_property_read_u16_array(const struct device_node *np,
|
|
const char *propname, u16 *out_values, size_t sz);
|
|
extern int of_property_read_u32_array(const struct device_node *np,
|
|
const char *propname,
|
|
u32 *out_values,
|
|
size_t sz);
|
|
extern int of_property_read_u64(const struct device_node *np,
|
|
const char *propname, u64 *out_value);
|
|
extern int of_property_read_u64_array(const struct device_node *np,
|
|
const char *propname,
|
|
u64 *out_values,
|
|
size_t sz);
|
|
|
|
extern int of_property_read_string(struct device_node *np,
|
|
const char *propname,
|
|
const char **out_string);
|
|
extern int of_property_match_string(struct device_node *np,
|
|
const char *propname,
|
|
const char *string);
|
|
extern int of_property_read_string_helper(struct device_node *np,
|
|
const char *propname,
|
|
const char **out_strs, size_t sz, int index);
|
|
extern int of_device_is_compatible(const struct device_node *device,
|
|
const char *);
|
|
extern bool of_device_is_available(const struct device_node *device);
|
|
extern bool of_device_is_big_endian(const struct device_node *device);
|
|
extern const void *of_get_property(const struct device_node *node,
|
|
const char *name,
|
|
int *lenp);
|
|
extern struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);
|
|
|
|
|
|
|
|
extern int of_n_addr_cells(struct device_node *np);
|
|
extern int of_n_size_cells(struct device_node *np);
|
|
extern const struct of_device_id *of_match_node(
|
|
const struct of_device_id *matches, const struct device_node *node);
|
|
extern int of_modalias_node(struct device_node *node, char *modalias, int len);
|
|
extern void of_print_phandle_args(const char *msg, const struct of_phandle_args *args);
|
|
extern struct device_node *of_parse_phandle(const struct device_node *np,
|
|
const char *phandle_name,
|
|
int index);
|
|
extern int of_parse_phandle_with_args(const struct device_node *np,
|
|
const char *list_name, const char *cells_name, int index,
|
|
struct of_phandle_args *out_args);
|
|
extern int of_parse_phandle_with_fixed_args(const struct device_node *np,
|
|
const char *list_name, int cells_count, int index,
|
|
struct of_phandle_args *out_args);
|
|
extern int of_count_phandle_with_args(const struct device_node *np,
|
|
const char *list_name, const char *cells_name);
|
|
|
|
extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align));
|
|
extern int of_alias_get_id(struct device_node *np, const char *stem);
|
|
extern int of_alias_get_highest_id(const char *stem);
|
|
|
|
extern int of_machine_is_compatible(const char *compat);
|
|
|
|
extern int of_add_property(struct device_node *np, struct property *prop);
|
|
extern int of_remove_property(struct device_node *np, struct property *prop);
|
|
extern int of_update_property(struct device_node *np, struct property *newprop);
|
|
# 354 "include/linux/of.h"
|
|
extern int of_attach_node(struct device_node *);
|
|
extern int of_detach_node(struct device_node *);
|
|
# 367 "include/linux/of.h"
|
|
const __be32 *of_prop_next_u32(struct property *prop, const __be32 *cur,
|
|
u32 *pu);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const char *of_prop_next_string(struct property *prop, const char *cur);
|
|
|
|
bool of_console_check(struct device_node *dn, char *name, int index);
|
|
# 682 "include/linux/of.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_node_to_nid(struct device_node *device)
|
|
{
|
|
return (-1);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct device_node *of_find_matching_node(
|
|
struct device_node *from,
|
|
const struct of_device_id *matches)
|
|
{
|
|
return of_find_matching_node_and_match(from, matches, ((void *)0));
|
|
}
|
|
# 706 "include/linux/of.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_count_u8_elems(const struct device_node *np,
|
|
const char *propname)
|
|
{
|
|
return of_property_count_elems_of_size(np, propname, sizeof(u8));
|
|
}
|
|
# 723 "include/linux/of.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_count_u16_elems(const struct device_node *np,
|
|
const char *propname)
|
|
{
|
|
return of_property_count_elems_of_size(np, propname, sizeof(u16));
|
|
}
|
|
# 740 "include/linux/of.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_count_u32_elems(const struct device_node *np,
|
|
const char *propname)
|
|
{
|
|
return of_property_count_elems_of_size(np, propname, sizeof(u32));
|
|
}
|
|
# 757 "include/linux/of.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_count_u64_elems(const struct device_node *np,
|
|
const char *propname)
|
|
{
|
|
return of_property_count_elems_of_size(np, propname, sizeof(u64));
|
|
}
|
|
# 776 "include/linux/of.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_read_string_array(struct device_node *np,
|
|
const char *propname, const char **out_strs,
|
|
size_t sz)
|
|
{
|
|
return of_property_read_string_helper(np, propname, out_strs, sz, 0);
|
|
}
|
|
# 795 "include/linux/of.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_count_strings(struct device_node *np,
|
|
const char *propname)
|
|
{
|
|
return of_property_read_string_helper(np, propname, ((void *)0), 0, 0);
|
|
}
|
|
# 819 "include/linux/of.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_read_string_index(struct device_node *np,
|
|
const char *propname,
|
|
int index, const char **output)
|
|
{
|
|
int rc = of_property_read_string_helper(np, propname, output, 1, index);
|
|
return rc < 0 ? rc : 0;
|
|
}
|
|
# 835 "include/linux/of.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool of_property_read_bool(const struct device_node *np,
|
|
const char *propname)
|
|
{
|
|
struct property *prop = of_find_property(np, propname, ((void *)0));
|
|
|
|
return prop ? true : false;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_read_u8(const struct device_node *np,
|
|
const char *propname,
|
|
u8 *out_value)
|
|
{
|
|
return of_property_read_u8_array(np, propname, out_value, 1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_read_u16(const struct device_node *np,
|
|
const char *propname,
|
|
u16 *out_value)
|
|
{
|
|
return of_property_read_u16_array(np, propname, out_value, 1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_read_u32(const struct device_node *np,
|
|
const char *propname,
|
|
u32 *out_value)
|
|
{
|
|
return of_property_read_u32_array(np, propname, out_value, 1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_property_read_s32(const struct device_node *np,
|
|
const char *propname,
|
|
s32 *out_value)
|
|
{
|
|
return of_property_read_u32(np, propname, (u32*) out_value);
|
|
}
|
|
# 910 "include/linux/of.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_get_child_count(const struct device_node *np)
|
|
{
|
|
struct device_node *child;
|
|
int num = 0;
|
|
|
|
for (child = of_get_next_child(np, ((void *)0)); child != ((void *)0); child = of_get_next_child(np, child))
|
|
num++;
|
|
|
|
return num;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_get_available_child_count(const struct device_node *np)
|
|
{
|
|
struct device_node *child;
|
|
int num = 0;
|
|
|
|
for (child = of_get_next_available_child(np, ((void *)0)); child != ((void *)0); child = of_get_next_available_child(np, child))
|
|
num++;
|
|
|
|
return num;
|
|
}
|
|
# 946 "include/linux/of.h"
|
|
typedef int (*of_init_fn_2)(struct device_node *, struct device_node *);
|
|
typedef void (*of_init_fn_1)(struct device_node *);
|
|
# 968 "include/linux/of.h"
|
|
struct of_changeset_entry {
|
|
struct list_head node;
|
|
unsigned long action;
|
|
struct device_node *np;
|
|
struct property *prop;
|
|
struct property *old_prop;
|
|
};
|
|
# 986 "include/linux/of.h"
|
|
struct of_changeset {
|
|
struct list_head entries;
|
|
};
|
|
|
|
enum of_reconfig_change {
|
|
OF_RECONFIG_NO_CHANGE = 0,
|
|
OF_RECONFIG_CHANGE_ADD,
|
|
OF_RECONFIG_CHANGE_REMOVE,
|
|
};
|
|
# 1041 "include/linux/of.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_reconfig_notifier_register(struct notifier_block *nb)
|
|
{
|
|
return -22;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_reconfig_notifier_unregister(struct notifier_block *nb)
|
|
{
|
|
return -22;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_reconfig_notify(unsigned long action,
|
|
struct of_reconfig_data *arg)
|
|
{
|
|
return -22;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_reconfig_get_state_change(unsigned long action,
|
|
struct of_reconfig_data *arg)
|
|
{
|
|
return -22;
|
|
}
|
|
|
|
|
|
|
|
extern int of_resolve_phandles(struct device_node *tree);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool of_device_is_system_power_controller(const struct device_node *np)
|
|
{
|
|
return of_property_read_bool(np, "system-power-controller");
|
|
}
|
|
# 1088 "include/linux/of.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_overlay_create(struct device_node *tree)
|
|
{
|
|
return -524;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_overlay_destroy(int id)
|
|
{
|
|
return -524;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_overlay_destroy_all(void)
|
|
{
|
|
return -524;
|
|
}
|
|
# 19 "include/net/dsa.h" 2
|
|
# 1 "include/linux/phy.h" 1
|
|
# 21 "include/linux/phy.h"
|
|
# 1 "include/linux/mii.h" 1
|
|
# 11 "include/linux/mii.h"
|
|
# 1 "./include/uapi/linux/if.h" 1
|
|
# 31 "./include/uapi/linux/if.h"
|
|
# 1 "./include/uapi/linux/hdlc/ioctl.h" 1
|
|
# 39 "./include/uapi/linux/hdlc/ioctl.h"
|
|
typedef struct {
|
|
unsigned int clock_rate;
|
|
unsigned int clock_type;
|
|
unsigned short loopback;
|
|
} sync_serial_settings;
|
|
|
|
typedef struct {
|
|
unsigned int clock_rate;
|
|
unsigned int clock_type;
|
|
unsigned short loopback;
|
|
unsigned int slot_map;
|
|
} te1_settings;
|
|
|
|
typedef struct {
|
|
unsigned short encoding;
|
|
unsigned short parity;
|
|
} raw_hdlc_proto;
|
|
|
|
typedef struct {
|
|
unsigned int t391;
|
|
unsigned int t392;
|
|
unsigned int n391;
|
|
unsigned int n392;
|
|
unsigned int n393;
|
|
unsigned short lmi;
|
|
unsigned short dce;
|
|
} fr_proto;
|
|
|
|
typedef struct {
|
|
unsigned int dlci;
|
|
} fr_proto_pvc;
|
|
|
|
typedef struct {
|
|
unsigned int dlci;
|
|
char master[16];
|
|
}fr_proto_pvc_info;
|
|
|
|
typedef struct {
|
|
unsigned int interval;
|
|
unsigned int timeout;
|
|
} cisco_proto;
|
|
# 32 "./include/uapi/linux/if.h" 2
|
|
# 76 "./include/uapi/linux/if.h"
|
|
enum net_device_flags {
|
|
|
|
|
|
IFF_UP = 1<<0,
|
|
IFF_BROADCAST = 1<<1,
|
|
IFF_DEBUG = 1<<2,
|
|
IFF_LOOPBACK = 1<<3,
|
|
IFF_POINTOPOINT = 1<<4,
|
|
IFF_NOTRAILERS = 1<<5,
|
|
IFF_RUNNING = 1<<6,
|
|
IFF_NOARP = 1<<7,
|
|
IFF_PROMISC = 1<<8,
|
|
IFF_ALLMULTI = 1<<9,
|
|
IFF_MASTER = 1<<10,
|
|
IFF_SLAVE = 1<<11,
|
|
IFF_MULTICAST = 1<<12,
|
|
IFF_PORTSEL = 1<<13,
|
|
IFF_AUTOMEDIA = 1<<14,
|
|
IFF_DYNAMIC = 1<<15,
|
|
|
|
|
|
IFF_LOWER_UP = 1<<16,
|
|
IFF_DORMANT = 1<<17,
|
|
IFF_ECHO = 1<<18,
|
|
|
|
};
|
|
# 165 "./include/uapi/linux/if.h"
|
|
enum {
|
|
IF_OPER_UNKNOWN,
|
|
IF_OPER_NOTPRESENT,
|
|
IF_OPER_DOWN,
|
|
IF_OPER_LOWERLAYERDOWN,
|
|
IF_OPER_TESTING,
|
|
IF_OPER_DORMANT,
|
|
IF_OPER_UP,
|
|
};
|
|
|
|
|
|
enum {
|
|
IF_LINK_MODE_DEFAULT,
|
|
IF_LINK_MODE_DORMANT,
|
|
};
|
|
# 193 "./include/uapi/linux/if.h"
|
|
struct ifmap {
|
|
unsigned long mem_start;
|
|
unsigned long mem_end;
|
|
unsigned short base_addr;
|
|
unsigned char irq;
|
|
unsigned char dma;
|
|
unsigned char port;
|
|
|
|
};
|
|
|
|
|
|
struct if_settings {
|
|
unsigned int type;
|
|
unsigned int size;
|
|
union {
|
|
|
|
raw_hdlc_proto *raw_hdlc;
|
|
cisco_proto *cisco;
|
|
fr_proto *fr;
|
|
fr_proto_pvc *fr_pvc;
|
|
fr_proto_pvc_info *fr_pvc_info;
|
|
|
|
|
|
sync_serial_settings *sync;
|
|
te1_settings *te1;
|
|
} ifs_ifsu;
|
|
};
|
|
# 230 "./include/uapi/linux/if.h"
|
|
struct ifreq {
|
|
|
|
union
|
|
{
|
|
char ifrn_name[16];
|
|
} ifr_ifrn;
|
|
|
|
union {
|
|
struct sockaddr ifru_addr;
|
|
struct sockaddr ifru_dstaddr;
|
|
struct sockaddr ifru_broadaddr;
|
|
struct sockaddr ifru_netmask;
|
|
struct sockaddr ifru_hwaddr;
|
|
short ifru_flags;
|
|
int ifru_ivalue;
|
|
int ifru_mtu;
|
|
struct ifmap ifru_map;
|
|
char ifru_slave[16];
|
|
char ifru_newname[16];
|
|
void * ifru_data;
|
|
struct if_settings ifru_settings;
|
|
} ifr_ifru;
|
|
};
|
|
# 282 "./include/uapi/linux/if.h"
|
|
struct ifconf {
|
|
int ifc_len;
|
|
union {
|
|
char *ifcu_buf;
|
|
struct ifreq *ifcu_req;
|
|
} ifc_ifcu;
|
|
};
|
|
# 12 "include/linux/mii.h" 2
|
|
# 1 "include/uapi/linux/mii.h" 1
|
|
# 154 "include/uapi/linux/mii.h"
|
|
struct mii_ioctl_data {
|
|
__u16 phy_id;
|
|
__u16 reg_num;
|
|
__u16 val_in;
|
|
__u16 val_out;
|
|
};
|
|
# 13 "include/linux/mii.h" 2
|
|
|
|
struct ethtool_cmd;
|
|
|
|
struct mii_if_info {
|
|
int phy_id;
|
|
int advertising;
|
|
int phy_id_mask;
|
|
int reg_num_mask;
|
|
|
|
unsigned int full_duplex : 1;
|
|
unsigned int force_media : 1;
|
|
unsigned int supports_gmii : 1;
|
|
|
|
struct net_device *dev;
|
|
int (*mdio_read) (struct net_device *dev, int phy_id, int location);
|
|
void (*mdio_write) (struct net_device *dev, int phy_id, int location, int val);
|
|
};
|
|
|
|
extern int mii_link_ok (struct mii_if_info *mii);
|
|
extern int mii_nway_restart (struct mii_if_info *mii);
|
|
extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd);
|
|
extern int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd);
|
|
extern int mii_check_gmii_support(struct mii_if_info *mii);
|
|
extern void mii_check_link (struct mii_if_info *mii);
|
|
extern unsigned int mii_check_media (struct mii_if_info *mii,
|
|
unsigned int ok_to_print,
|
|
unsigned int init_media);
|
|
extern int generic_mii_ioctl(struct mii_if_info *mii_if,
|
|
struct mii_ioctl_data *mii_data, int cmd,
|
|
unsigned int *duplex_changed);
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct mii_ioctl_data *if_mii(struct ifreq *rq)
|
|
{
|
|
return (struct mii_ioctl_data *) &rq->ifr_ifru;
|
|
}
|
|
# 64 "include/linux/mii.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int mii_nway_result (unsigned int negotiated)
|
|
{
|
|
unsigned int ret;
|
|
|
|
if (negotiated & 0x0100)
|
|
ret = 0x0100;
|
|
else if (negotiated & 0x0200)
|
|
ret = 0x0200;
|
|
else if (negotiated & 0x0080)
|
|
ret = 0x0080;
|
|
else if (negotiated & 0x0040)
|
|
ret = 0x0040;
|
|
else
|
|
ret = 0x0020;
|
|
|
|
return ret;
|
|
}
|
|
# 91 "include/linux/mii.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int mii_duplex (unsigned int duplex_lock,
|
|
unsigned int negotiated)
|
|
{
|
|
if (duplex_lock)
|
|
return 1;
|
|
if (mii_nway_result(negotiated) & (0x0040 | 0x0100))
|
|
return 1;
|
|
return 0;
|
|
}
|
|
# 109 "include/linux/mii.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 ethtool_adv_to_mii_adv_t(u32 ethadv)
|
|
{
|
|
u32 result = 0;
|
|
|
|
if (ethadv & (1 << 0))
|
|
result |= 0x0020;
|
|
if (ethadv & (1 << 1))
|
|
result |= 0x0040;
|
|
if (ethadv & (1 << 2))
|
|
result |= 0x0080;
|
|
if (ethadv & (1 << 3))
|
|
result |= 0x0100;
|
|
if (ethadv & (1 << 13))
|
|
result |= 0x0400;
|
|
if (ethadv & (1 << 14))
|
|
result |= 0x0800;
|
|
|
|
return result;
|
|
}
|
|
# 136 "include/linux/mii.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 mii_adv_to_ethtool_adv_t(u32 adv)
|
|
{
|
|
u32 result = 0;
|
|
|
|
if (adv & 0x0020)
|
|
result |= (1 << 0);
|
|
if (adv & 0x0040)
|
|
result |= (1 << 1);
|
|
if (adv & 0x0080)
|
|
result |= (1 << 2);
|
|
if (adv & 0x0100)
|
|
result |= (1 << 3);
|
|
if (adv & 0x0400)
|
|
result |= (1 << 13);
|
|
if (adv & 0x0800)
|
|
result |= (1 << 14);
|
|
|
|
return result;
|
|
}
|
|
# 164 "include/linux/mii.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 ethtool_adv_to_mii_ctrl1000_t(u32 ethadv)
|
|
{
|
|
u32 result = 0;
|
|
|
|
if (ethadv & (1 << 4))
|
|
result |= 0x0100;
|
|
if (ethadv & (1 << 5))
|
|
result |= 0x0200;
|
|
|
|
return result;
|
|
}
|
|
# 184 "include/linux/mii.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 mii_ctrl1000_to_ethtool_adv_t(u32 adv)
|
|
{
|
|
u32 result = 0;
|
|
|
|
if (adv & 0x0100)
|
|
result |= (1 << 4);
|
|
if (adv & 0x0200)
|
|
result |= (1 << 5);
|
|
|
|
return result;
|
|
}
|
|
# 204 "include/linux/mii.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 mii_lpa_to_ethtool_lpa_t(u32 lpa)
|
|
{
|
|
u32 result = 0;
|
|
|
|
if (lpa & 0x4000)
|
|
result |= (1 << 6);
|
|
|
|
return result | mii_adv_to_ethtool_adv_t(lpa);
|
|
}
|
|
# 222 "include/linux/mii.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 mii_stat1000_to_ethtool_lpa_t(u32 lpa)
|
|
{
|
|
u32 result = 0;
|
|
|
|
if (lpa & 0x0400)
|
|
result |= (1 << 4);
|
|
if (lpa & 0x0800)
|
|
result |= (1 << 5);
|
|
|
|
return result;
|
|
}
|
|
# 242 "include/linux/mii.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 ethtool_adv_to_mii_adv_x(u32 ethadv)
|
|
{
|
|
u32 result = 0;
|
|
|
|
if (ethadv & (1 << 4))
|
|
result |= 0x0040;
|
|
if (ethadv & (1 << 5))
|
|
result |= 0x0020;
|
|
if (ethadv & (1 << 13))
|
|
result |= 0x0080;
|
|
if (ethadv & (1 << 14))
|
|
result |= 0x0100;
|
|
|
|
return result;
|
|
}
|
|
# 266 "include/linux/mii.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 mii_adv_to_ethtool_adv_x(u32 adv)
|
|
{
|
|
u32 result = 0;
|
|
|
|
if (adv & 0x0040)
|
|
result |= (1 << 4);
|
|
if (adv & 0x0020)
|
|
result |= (1 << 5);
|
|
if (adv & 0x0080)
|
|
result |= (1 << 13);
|
|
if (adv & 0x0100)
|
|
result |= (1 << 14);
|
|
|
|
return result;
|
|
}
|
|
# 290 "include/linux/mii.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 mii_lpa_to_ethtool_lpa_x(u32 lpa)
|
|
{
|
|
u32 result = 0;
|
|
|
|
if (lpa & 0x4000)
|
|
result |= (1 << 6);
|
|
|
|
return result | mii_adv_to_ethtool_adv_x(lpa);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u16 mii_advertise_flowctrl(int cap)
|
|
{
|
|
u16 adv = 0;
|
|
|
|
if (cap & 0x02)
|
|
adv = 0x0400 | 0x0800;
|
|
if (cap & 0x01)
|
|
adv ^= 0x0800;
|
|
|
|
return adv;
|
|
}
|
|
# 323 "include/linux/mii.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u8 mii_resolve_flowctrl_fdx(u16 lcladv, u16 rmtadv)
|
|
{
|
|
u8 cap = 0;
|
|
|
|
if (lcladv & rmtadv & 0x0400) {
|
|
cap = 0x01 | 0x02;
|
|
} else if (lcladv & rmtadv & 0x0800) {
|
|
if (lcladv & 0x0400)
|
|
cap = 0x02;
|
|
else if (rmtadv & 0x0400)
|
|
cap = 0x01;
|
|
}
|
|
|
|
return cap;
|
|
}
|
|
# 22 "include/linux/phy.h" 2
|
|
# 63 "include/linux/phy.h"
|
|
typedef enum {
|
|
PHY_INTERFACE_MODE_NA,
|
|
PHY_INTERFACE_MODE_MII,
|
|
PHY_INTERFACE_MODE_GMII,
|
|
PHY_INTERFACE_MODE_SGMII,
|
|
PHY_INTERFACE_MODE_TBI,
|
|
PHY_INTERFACE_MODE_REVMII,
|
|
PHY_INTERFACE_MODE_RMII,
|
|
PHY_INTERFACE_MODE_RGMII,
|
|
PHY_INTERFACE_MODE_RGMII_ID,
|
|
PHY_INTERFACE_MODE_RGMII_RXID,
|
|
PHY_INTERFACE_MODE_RGMII_TXID,
|
|
PHY_INTERFACE_MODE_RTBI,
|
|
PHY_INTERFACE_MODE_SMII,
|
|
PHY_INTERFACE_MODE_XGMII,
|
|
PHY_INTERFACE_MODE_MOCA,
|
|
PHY_INTERFACE_MODE_QSGMII,
|
|
PHY_INTERFACE_MODE_MAX,
|
|
} phy_interface_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const char *phy_modes(phy_interface_t interface)
|
|
{
|
|
switch (interface) {
|
|
case PHY_INTERFACE_MODE_NA:
|
|
return "";
|
|
case PHY_INTERFACE_MODE_MII:
|
|
return "mii";
|
|
case PHY_INTERFACE_MODE_GMII:
|
|
return "gmii";
|
|
case PHY_INTERFACE_MODE_SGMII:
|
|
return "sgmii";
|
|
case PHY_INTERFACE_MODE_TBI:
|
|
return "tbi";
|
|
case PHY_INTERFACE_MODE_REVMII:
|
|
return "rev-mii";
|
|
case PHY_INTERFACE_MODE_RMII:
|
|
return "rmii";
|
|
case PHY_INTERFACE_MODE_RGMII:
|
|
return "rgmii";
|
|
case PHY_INTERFACE_MODE_RGMII_ID:
|
|
return "rgmii-id";
|
|
case PHY_INTERFACE_MODE_RGMII_RXID:
|
|
return "rgmii-rxid";
|
|
case PHY_INTERFACE_MODE_RGMII_TXID:
|
|
return "rgmii-txid";
|
|
case PHY_INTERFACE_MODE_RTBI:
|
|
return "rtbi";
|
|
case PHY_INTERFACE_MODE_SMII:
|
|
return "smii";
|
|
case PHY_INTERFACE_MODE_XGMII:
|
|
return "xgmii";
|
|
case PHY_INTERFACE_MODE_MOCA:
|
|
return "moca";
|
|
case PHY_INTERFACE_MODE_QSGMII:
|
|
return "qsgmii";
|
|
default:
|
|
return "unknown";
|
|
}
|
|
}
|
|
# 145 "include/linux/phy.h"
|
|
struct device;
|
|
struct sk_buff;
|
|
|
|
|
|
|
|
|
|
|
|
struct mii_bus {
|
|
struct module *owner;
|
|
const char *name;
|
|
char id[61];
|
|
void *priv;
|
|
int (*read)(struct mii_bus *bus, int phy_id, int regnum);
|
|
int (*write)(struct mii_bus *bus, int phy_id, int regnum, u16 val);
|
|
int (*reset)(struct mii_bus *bus);
|
|
|
|
|
|
|
|
|
|
|
|
struct mutex mdio_lock;
|
|
|
|
struct device *parent;
|
|
enum {
|
|
MDIOBUS_ALLOCATED = 1,
|
|
MDIOBUS_REGISTERED,
|
|
MDIOBUS_UNREGISTERED,
|
|
MDIOBUS_RELEASED,
|
|
} state;
|
|
struct device dev;
|
|
|
|
|
|
struct phy_device *phy_map[32];
|
|
|
|
|
|
u32 phy_mask;
|
|
|
|
|
|
u32 phy_ignore_ta_mask;
|
|
|
|
|
|
|
|
|
|
|
|
int *irq;
|
|
};
|
|
|
|
|
|
struct mii_bus *mdiobus_alloc_size(size_t);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct mii_bus *mdiobus_alloc(void)
|
|
{
|
|
return mdiobus_alloc_size(0);
|
|
}
|
|
|
|
int __mdiobus_register(struct mii_bus *bus, struct module *owner);
|
|
|
|
void mdiobus_unregister(struct mii_bus *bus);
|
|
void mdiobus_free(struct mii_bus *bus);
|
|
struct mii_bus *devm_mdiobus_alloc_size(struct device *dev, int sizeof_priv);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct mii_bus *devm_mdiobus_alloc(struct device *dev)
|
|
{
|
|
return devm_mdiobus_alloc_size(dev, 0);
|
|
}
|
|
|
|
void devm_mdiobus_free(struct device *dev, struct mii_bus *bus);
|
|
struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr);
|
|
int mdiobus_read(struct mii_bus *bus, int addr, u32 regnum);
|
|
int mdiobus_read_nested(struct mii_bus *bus, int addr, u32 regnum);
|
|
int mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val);
|
|
int mdiobus_write_nested(struct mii_bus *bus, int addr, u32 regnum, u16 val);
|
|
# 300 "include/linux/phy.h"
|
|
enum phy_state {
|
|
PHY_DOWN = 0,
|
|
PHY_STARTING,
|
|
PHY_READY,
|
|
PHY_PENDING,
|
|
PHY_UP,
|
|
PHY_AN,
|
|
PHY_RUNNING,
|
|
PHY_NOLINK,
|
|
PHY_FORCING,
|
|
PHY_CHANGELINK,
|
|
PHY_HALTED,
|
|
PHY_RESUMING
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct phy_c45_device_ids {
|
|
u32 devices_in_package;
|
|
u32 device_ids[8];
|
|
};
|
|
# 359 "include/linux/phy.h"
|
|
struct phy_device {
|
|
|
|
|
|
struct phy_driver *drv;
|
|
|
|
struct mii_bus *bus;
|
|
|
|
struct device dev;
|
|
|
|
u32 phy_id;
|
|
|
|
struct phy_c45_device_ids c45_ids;
|
|
bool is_c45;
|
|
bool is_internal;
|
|
bool is_pseudo_fixed_link;
|
|
bool has_fixups;
|
|
bool suspended;
|
|
|
|
enum phy_state state;
|
|
|
|
u32 dev_flags;
|
|
|
|
phy_interface_t interface;
|
|
|
|
|
|
int addr;
|
|
|
|
|
|
|
|
|
|
|
|
int speed;
|
|
int duplex;
|
|
int pause;
|
|
int asym_pause;
|
|
|
|
|
|
int link;
|
|
|
|
|
|
u32 interrupts;
|
|
|
|
|
|
|
|
u32 supported;
|
|
u32 advertising;
|
|
u32 lp_advertising;
|
|
|
|
int autoneg;
|
|
|
|
int link_timeout;
|
|
|
|
|
|
|
|
|
|
|
|
int irq;
|
|
|
|
|
|
|
|
void *priv;
|
|
|
|
|
|
struct work_struct phy_queue;
|
|
struct delayed_work state_queue;
|
|
atomic_t irq_disable;
|
|
|
|
struct mutex lock;
|
|
|
|
struct net_device *attached_dev;
|
|
|
|
u8 mdix;
|
|
|
|
void (*adjust_link)(struct net_device *dev);
|
|
};
|
|
# 457 "include/linux/phy.h"
|
|
struct phy_driver {
|
|
u32 phy_id;
|
|
char *name;
|
|
unsigned int phy_id_mask;
|
|
u32 features;
|
|
u32 flags;
|
|
const void *driver_data;
|
|
|
|
|
|
|
|
|
|
int (*soft_reset)(struct phy_device *phydev);
|
|
|
|
|
|
|
|
|
|
|
|
int (*config_init)(struct phy_device *phydev);
|
|
|
|
|
|
|
|
|
|
|
|
int (*probe)(struct phy_device *phydev);
|
|
|
|
|
|
int (*suspend)(struct phy_device *phydev);
|
|
int (*resume)(struct phy_device *phydev);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int (*config_aneg)(struct phy_device *phydev);
|
|
|
|
|
|
int (*aneg_done)(struct phy_device *phydev);
|
|
|
|
|
|
int (*read_status)(struct phy_device *phydev);
|
|
|
|
|
|
int (*ack_interrupt)(struct phy_device *phydev);
|
|
|
|
|
|
int (*config_intr)(struct phy_device *phydev);
|
|
|
|
|
|
|
|
|
|
|
|
int (*did_interrupt)(struct phy_device *phydev);
|
|
|
|
|
|
void (*remove)(struct phy_device *phydev);
|
|
|
|
|
|
|
|
|
|
|
|
int (*match_phy_device)(struct phy_device *phydev);
|
|
|
|
|
|
int (*ts_info)(struct phy_device *phydev, struct ethtool_ts_info *ti);
|
|
|
|
|
|
int (*hwtstamp)(struct phy_device *phydev, struct ifreq *ifr);
|
|
# 534 "include/linux/phy.h"
|
|
bool (*rxtstamp)(struct phy_device *dev, struct sk_buff *skb, int type);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void (*txtstamp)(struct phy_device *dev, struct sk_buff *skb, int type);
|
|
|
|
|
|
|
|
|
|
int (*set_wol)(struct phy_device *dev, struct ethtool_wolinfo *wol);
|
|
|
|
|
|
void (*get_wol)(struct phy_device *dev, struct ethtool_wolinfo *wol);
|
|
# 559 "include/linux/phy.h"
|
|
void (*link_change_notify)(struct phy_device *dev);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int (*read_mmd_indirect)(struct phy_device *dev, int ptrad,
|
|
int devnum, int regnum);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void (*write_mmd_indirect)(struct phy_device *dev, int ptrad,
|
|
int devnum, int regnum, u32 val);
|
|
|
|
|
|
|
|
int (*module_info)(struct phy_device *dev,
|
|
struct ethtool_modinfo *modinfo);
|
|
|
|
|
|
int (*module_eeprom)(struct phy_device *dev,
|
|
struct ethtool_eeprom *ee, u8 *data);
|
|
|
|
struct device_driver driver;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct phy_fixup {
|
|
struct list_head list;
|
|
char bus_id[61 + 3];
|
|
u32 phy_uid;
|
|
u32 phy_uid_mask;
|
|
int (*run)(struct phy_device *phydev);
|
|
};
|
|
# 613 "include/linux/phy.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int phy_read_mmd(struct phy_device *phydev, int devad, u32 regnum)
|
|
{
|
|
if (!phydev->is_c45)
|
|
return -95;
|
|
|
|
return mdiobus_read(phydev->bus, phydev->addr,
|
|
(1<<30) | (devad << 16) | (regnum & 0xffff));
|
|
}
|
|
# 632 "include/linux/phy.h"
|
|
int phy_read_mmd_indirect(struct phy_device *phydev, int prtad,
|
|
int devad, int addr);
|
|
# 644 "include/linux/phy.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int phy_read(struct phy_device *phydev, u32 regnum)
|
|
{
|
|
return mdiobus_read(phydev->bus, phydev->addr, regnum);
|
|
}
|
|
# 659 "include/linux/phy.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int phy_write(struct phy_device *phydev, u32 regnum, u16 val)
|
|
{
|
|
return mdiobus_write(phydev->bus, phydev->addr, regnum, val);
|
|
}
|
|
# 671 "include/linux/phy.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool phy_interrupt_is_valid(struct phy_device *phydev)
|
|
{
|
|
return phydev->irq != -1 && phydev->irq != -2;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool phy_is_internal(struct phy_device *phydev)
|
|
{
|
|
return phydev->is_internal;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool phy_interface_mode_is_rgmii(phy_interface_t mode)
|
|
{
|
|
return mode >= PHY_INTERFACE_MODE_RGMII &&
|
|
mode <= PHY_INTERFACE_MODE_RGMII_TXID;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool phy_interface_is_rgmii(struct phy_device *phydev)
|
|
{
|
|
return phydev->interface >= PHY_INTERFACE_MODE_RGMII &&
|
|
phydev->interface <= PHY_INTERFACE_MODE_RGMII_TXID;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool phy_is_pseudo_fixed_link(struct phy_device *phydev)
|
|
{
|
|
return phydev->is_pseudo_fixed_link;
|
|
}
|
|
# 727 "include/linux/phy.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int phy_write_mmd(struct phy_device *phydev, int devad,
|
|
u32 regnum, u16 val)
|
|
{
|
|
if (!phydev->is_c45)
|
|
return -95;
|
|
|
|
regnum = (1<<30) | ((devad & 0x1f) << 16) | (regnum & 0xffff);
|
|
|
|
return mdiobus_write(phydev->bus, phydev->addr, regnum, val);
|
|
}
|
|
# 749 "include/linux/phy.h"
|
|
void phy_write_mmd_indirect(struct phy_device *phydev, int prtad,
|
|
int devad, int addr, u32 data);
|
|
|
|
struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id,
|
|
bool is_c45,
|
|
struct phy_c45_device_ids *c45_ids);
|
|
struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45);
|
|
int phy_device_register(struct phy_device *phy);
|
|
void phy_device_remove(struct phy_device *phydev);
|
|
int phy_init_hw(struct phy_device *phydev);
|
|
int phy_suspend(struct phy_device *phydev);
|
|
int phy_resume(struct phy_device *phydev);
|
|
struct phy_device *phy_attach(struct net_device *dev, const char *bus_id,
|
|
phy_interface_t interface);
|
|
struct phy_device *phy_find_first(struct mii_bus *bus);
|
|
int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
|
|
u32 flags, phy_interface_t interface);
|
|
int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,
|
|
void (*handler)(struct net_device *),
|
|
phy_interface_t interface);
|
|
struct phy_device *phy_connect(struct net_device *dev, const char *bus_id,
|
|
void (*handler)(struct net_device *),
|
|
phy_interface_t interface);
|
|
void phy_disconnect(struct phy_device *phydev);
|
|
void phy_detach(struct phy_device *phydev);
|
|
void phy_start(struct phy_device *phydev);
|
|
void phy_stop(struct phy_device *phydev);
|
|
int phy_start_aneg(struct phy_device *phydev);
|
|
|
|
int phy_stop_interrupts(struct phy_device *phydev);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int phy_read_status(struct phy_device *phydev)
|
|
{
|
|
return phydev->drv->read_status(phydev);
|
|
}
|
|
|
|
int genphy_config_init(struct phy_device *phydev);
|
|
int genphy_setup_forced(struct phy_device *phydev);
|
|
int genphy_restart_aneg(struct phy_device *phydev);
|
|
int genphy_config_aneg(struct phy_device *phydev);
|
|
int genphy_aneg_done(struct phy_device *phydev);
|
|
int genphy_update_link(struct phy_device *phydev);
|
|
int genphy_read_status(struct phy_device *phydev);
|
|
int genphy_suspend(struct phy_device *phydev);
|
|
int genphy_resume(struct phy_device *phydev);
|
|
int genphy_soft_reset(struct phy_device *phydev);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int genphy_no_soft_reset(struct phy_device *phydev)
|
|
{
|
|
return 0;
|
|
}
|
|
void phy_driver_unregister(struct phy_driver *drv);
|
|
void phy_drivers_unregister(struct phy_driver *drv, int n);
|
|
int phy_driver_register(struct phy_driver *new_driver);
|
|
int phy_drivers_register(struct phy_driver *new_driver, int n);
|
|
void phy_state_machine(struct work_struct *work);
|
|
void phy_change(struct work_struct *work);
|
|
void phy_mac_interrupt(struct phy_device *phydev, int new_link);
|
|
void phy_start_machine(struct phy_device *phydev);
|
|
void phy_stop_machine(struct phy_device *phydev);
|
|
int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
|
|
int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
|
|
int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd);
|
|
int phy_start_interrupts(struct phy_device *phydev);
|
|
void phy_print_status(struct phy_device *phydev);
|
|
void phy_device_free(struct phy_device *phydev);
|
|
int phy_set_max_speed(struct phy_device *phydev, u32 max_speed);
|
|
|
|
int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,
|
|
int (*run)(struct phy_device *));
|
|
int phy_register_fixup_for_id(const char *bus_id,
|
|
int (*run)(struct phy_device *));
|
|
int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
|
|
int (*run)(struct phy_device *));
|
|
|
|
int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable);
|
|
int phy_get_eee_err(struct phy_device *phydev);
|
|
int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data);
|
|
int phy_ethtool_get_eee(struct phy_device *phydev, struct ethtool_eee *data);
|
|
int phy_ethtool_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol);
|
|
void phy_ethtool_get_wol(struct phy_device *phydev,
|
|
struct ethtool_wolinfo *wol);
|
|
|
|
int __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) mdio_bus_init(void);
|
|
void mdio_bus_exit(void);
|
|
|
|
extern struct bus_type mdio_bus_type;
|
|
# 20 "include/net/dsa.h" 2
|
|
# 1 "include/linux/phy_fixed.h" 1
|
|
|
|
|
|
|
|
struct fixed_phy_status {
|
|
int link;
|
|
int speed;
|
|
int duplex;
|
|
int pause;
|
|
int asym_pause;
|
|
};
|
|
|
|
struct device_node;
|
|
# 30 "include/linux/phy_fixed.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fixed_phy_add(unsigned int irq, int phy_id,
|
|
struct fixed_phy_status *status,
|
|
int link_gpio)
|
|
{
|
|
return -19;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct phy_device *fixed_phy_register(unsigned int irq,
|
|
struct fixed_phy_status *status,
|
|
int gpio_link,
|
|
struct device_node *np)
|
|
{
|
|
return ERR_PTR(-19);
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fixed_phy_del(int phy_addr)
|
|
{
|
|
return -19;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fixed_phy_set_link_update(struct phy_device *phydev,
|
|
int (*link_update)(struct net_device *,
|
|
struct fixed_phy_status *))
|
|
{
|
|
return -19;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fixed_phy_update_state(struct phy_device *phydev,
|
|
const struct fixed_phy_status *status,
|
|
const struct fixed_phy_status *changed)
|
|
{
|
|
return -19;
|
|
}
|
|
# 21 "include/net/dsa.h" 2
|
|
|
|
|
|
enum dsa_tag_protocol {
|
|
DSA_TAG_PROTO_NONE = 0,
|
|
DSA_TAG_PROTO_DSA,
|
|
DSA_TAG_PROTO_TRAILER,
|
|
DSA_TAG_PROTO_EDSA,
|
|
DSA_TAG_PROTO_BRCM,
|
|
};
|
|
|
|
|
|
|
|
|
|
struct dsa_chip_data {
|
|
|
|
|
|
|
|
struct device *host_dev;
|
|
int sw_addr;
|
|
|
|
|
|
int eeprom_len;
|
|
|
|
|
|
|
|
|
|
|
|
struct device_node *of_node;
|
|
# 57 "include/net/dsa.h"
|
|
char *port_names[12];
|
|
struct device_node *port_dn[12];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
s8 *rtable;
|
|
};
|
|
|
|
struct dsa_platform_data {
|
|
|
|
|
|
|
|
|
|
struct device *netdev;
|
|
struct net_device *of_netdev;
|
|
|
|
|
|
|
|
|
|
|
|
int nr_chips;
|
|
struct dsa_chip_data *chip;
|
|
};
|
|
|
|
struct packet_type;
|
|
|
|
struct dsa_switch_tree {
|
|
|
|
|
|
|
|
|
|
struct dsa_platform_data *pd;
|
|
|
|
|
|
|
|
|
|
|
|
struct net_device *master_netdev;
|
|
int (*rcv)(struct sk_buff *skb,
|
|
struct net_device *dev,
|
|
struct packet_type *pt,
|
|
struct net_device *orig_dev);
|
|
enum dsa_tag_protocol tag_protocol;
|
|
|
|
|
|
|
|
|
|
s8 cpu_switch;
|
|
s8 cpu_port;
|
|
|
|
|
|
|
|
|
|
int link_poll_needed;
|
|
struct work_struct link_poll_work;
|
|
struct timer_list link_poll_timer;
|
|
|
|
|
|
|
|
|
|
struct dsa_switch *ds[4];
|
|
};
|
|
|
|
struct dsa_switch {
|
|
|
|
|
|
|
|
struct dsa_switch_tree *dst;
|
|
int index;
|
|
|
|
|
|
|
|
|
|
enum dsa_tag_protocol tag_protocol;
|
|
|
|
|
|
|
|
|
|
struct dsa_chip_data *pd;
|
|
|
|
|
|
|
|
|
|
struct dsa_switch_driver *drv;
|
|
|
|
|
|
|
|
|
|
struct device *master_dev;
|
|
# 162 "include/net/dsa.h"
|
|
u32 dsa_port_mask;
|
|
u32 phys_port_mask;
|
|
u32 phys_mii_mask;
|
|
struct mii_bus *slave_mii_bus;
|
|
struct net_device *ports[12];
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dsa_is_cpu_port(struct dsa_switch *ds, int p)
|
|
{
|
|
return !!(ds->index == ds->dst->cpu_switch && p == ds->dst->cpu_port);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dsa_is_dsa_port(struct dsa_switch *ds, int p)
|
|
{
|
|
return !!((ds->dsa_port_mask) & (1 << p));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dsa_is_port_initialized(struct dsa_switch *ds, int p)
|
|
{
|
|
return ds->phys_port_mask & (1 << p) && ds->ports[p];
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u8 dsa_upstream_port(struct dsa_switch *ds)
|
|
{
|
|
struct dsa_switch_tree *dst = ds->dst;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (dst->cpu_switch == ds->index)
|
|
return dst->cpu_port;
|
|
else
|
|
return ds->pd->rtable[dst->cpu_switch];
|
|
}
|
|
|
|
struct switchdev_trans;
|
|
struct switchdev_obj;
|
|
struct switchdev_obj_port_fdb;
|
|
struct switchdev_obj_port_vlan;
|
|
|
|
struct dsa_switch_driver {
|
|
struct list_head list;
|
|
|
|
enum dsa_tag_protocol tag_protocol;
|
|
int priv_size;
|
|
|
|
|
|
|
|
|
|
char *(*probe)(struct device *host_dev, int sw_addr);
|
|
int (*setup)(struct dsa_switch *ds);
|
|
int (*set_addr)(struct dsa_switch *ds, u8 *addr);
|
|
u32 (*get_phy_flags)(struct dsa_switch *ds, int port);
|
|
|
|
|
|
|
|
|
|
int (*phy_read)(struct dsa_switch *ds, int port, int regnum);
|
|
int (*phy_write)(struct dsa_switch *ds, int port,
|
|
int regnum, u16 val);
|
|
|
|
|
|
|
|
|
|
void (*poll_link)(struct dsa_switch *ds);
|
|
|
|
|
|
|
|
|
|
void (*adjust_link)(struct dsa_switch *ds, int port,
|
|
struct phy_device *phydev);
|
|
void (*fixed_link_update)(struct dsa_switch *ds, int port,
|
|
struct fixed_phy_status *st);
|
|
|
|
|
|
|
|
|
|
void (*get_strings)(struct dsa_switch *ds, int port, uint8_t *data);
|
|
void (*get_ethtool_stats)(struct dsa_switch *ds,
|
|
int port, uint64_t *data);
|
|
int (*get_sset_count)(struct dsa_switch *ds);
|
|
|
|
|
|
|
|
|
|
void (*get_wol)(struct dsa_switch *ds, int port,
|
|
struct ethtool_wolinfo *w);
|
|
int (*set_wol)(struct dsa_switch *ds, int port,
|
|
struct ethtool_wolinfo *w);
|
|
|
|
|
|
|
|
|
|
int (*suspend)(struct dsa_switch *ds);
|
|
int (*resume)(struct dsa_switch *ds);
|
|
|
|
|
|
|
|
|
|
int (*port_enable)(struct dsa_switch *ds, int port,
|
|
struct phy_device *phy);
|
|
void (*port_disable)(struct dsa_switch *ds, int port,
|
|
struct phy_device *phy);
|
|
|
|
|
|
|
|
|
|
int (*set_eee)(struct dsa_switch *ds, int port,
|
|
struct phy_device *phydev,
|
|
struct ethtool_eee *e);
|
|
int (*get_eee)(struct dsa_switch *ds, int port,
|
|
struct ethtool_eee *e);
|
|
# 287 "include/net/dsa.h"
|
|
int (*get_eeprom_len)(struct dsa_switch *ds);
|
|
int (*get_eeprom)(struct dsa_switch *ds,
|
|
struct ethtool_eeprom *eeprom, u8 *data);
|
|
int (*set_eeprom)(struct dsa_switch *ds,
|
|
struct ethtool_eeprom *eeprom, u8 *data);
|
|
|
|
|
|
|
|
|
|
int (*get_regs_len)(struct dsa_switch *ds, int port);
|
|
void (*get_regs)(struct dsa_switch *ds, int port,
|
|
struct ethtool_regs *regs, void *p);
|
|
|
|
|
|
|
|
|
|
int (*port_join_bridge)(struct dsa_switch *ds, int port,
|
|
u32 br_port_mask);
|
|
int (*port_leave_bridge)(struct dsa_switch *ds, int port,
|
|
u32 br_port_mask);
|
|
int (*port_stp_update)(struct dsa_switch *ds, int port,
|
|
u8 state);
|
|
|
|
|
|
|
|
|
|
int (*port_vlan_prepare)(struct dsa_switch *ds, int port,
|
|
const struct switchdev_obj_port_vlan *vlan,
|
|
struct switchdev_trans *trans);
|
|
int (*port_vlan_add)(struct dsa_switch *ds, int port,
|
|
const struct switchdev_obj_port_vlan *vlan,
|
|
struct switchdev_trans *trans);
|
|
int (*port_vlan_del)(struct dsa_switch *ds, int port,
|
|
const struct switchdev_obj_port_vlan *vlan);
|
|
int (*port_pvid_get)(struct dsa_switch *ds, int port, u16 *pvid);
|
|
int (*vlan_getnext)(struct dsa_switch *ds, u16 *vid,
|
|
unsigned long *ports, unsigned long *untagged);
|
|
|
|
|
|
|
|
|
|
int (*port_fdb_prepare)(struct dsa_switch *ds, int port,
|
|
const struct switchdev_obj_port_fdb *fdb,
|
|
struct switchdev_trans *trans);
|
|
int (*port_fdb_add)(struct dsa_switch *ds, int port,
|
|
const struct switchdev_obj_port_fdb *fdb,
|
|
struct switchdev_trans *trans);
|
|
int (*port_fdb_del)(struct dsa_switch *ds, int port,
|
|
const struct switchdev_obj_port_fdb *fdb);
|
|
int (*port_fdb_dump)(struct dsa_switch *ds, int port,
|
|
struct switchdev_obj_port_fdb *fdb,
|
|
int (*cb)(struct switchdev_obj *obj));
|
|
};
|
|
|
|
void register_switch_driver(struct dsa_switch_driver *type);
|
|
void unregister_switch_driver(struct dsa_switch_driver *type);
|
|
struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *ds_to_priv(struct dsa_switch *ds)
|
|
{
|
|
return (void *)(ds + 1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dsa_uses_tagged_protocol(struct dsa_switch_tree *dst)
|
|
{
|
|
return dst->rcv != ((void *)0);
|
|
}
|
|
# 45 "include/linux/netdevice.h" 2
|
|
|
|
|
|
|
|
# 1 "include/net/netprio_cgroup.h" 1
|
|
# 17 "include/net/netprio_cgroup.h"
|
|
# 1 "include/linux/cgroup.h" 1
|
|
# 15 "include/linux/cgroup.h"
|
|
# 1 "./include/uapi/linux/cgroupstats.h" 1
|
|
# 19 "./include/uapi/linux/cgroupstats.h"
|
|
# 1 "./include/uapi/linux/taskstats.h" 1
|
|
# 40 "./include/uapi/linux/taskstats.h"
|
|
struct taskstats {
|
|
|
|
|
|
|
|
|
|
|
|
__u16 version;
|
|
__u32 ac_exitcode;
|
|
|
|
|
|
|
|
|
|
__u8 ac_flag;
|
|
__u8 ac_nice;
|
|
# 71 "./include/uapi/linux/taskstats.h"
|
|
__u64 cpu_count __attribute__((aligned(8)));
|
|
__u64 cpu_delay_total;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__u64 blkio_count;
|
|
__u64 blkio_delay_total;
|
|
|
|
|
|
__u64 swapin_count;
|
|
__u64 swapin_delay_total;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__u64 cpu_run_real_total;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__u64 cpu_run_virtual_total;
|
|
|
|
|
|
|
|
|
|
char ac_comm[32];
|
|
__u8 ac_sched __attribute__((aligned(8)));
|
|
|
|
__u8 ac_pad[3];
|
|
__u32 ac_uid __attribute__((aligned(8)));
|
|
|
|
__u32 ac_gid;
|
|
__u32 ac_pid;
|
|
__u32 ac_ppid;
|
|
__u32 ac_btime;
|
|
__u64 ac_etime __attribute__((aligned(8)));
|
|
|
|
__u64 ac_utime;
|
|
__u64 ac_stime;
|
|
__u64 ac_minflt;
|
|
__u64 ac_majflt;
|
|
# 130 "./include/uapi/linux/taskstats.h"
|
|
__u64 coremem;
|
|
|
|
|
|
|
|
__u64 virtmem;
|
|
|
|
|
|
|
|
|
|
__u64 hiwater_rss;
|
|
__u64 hiwater_vm;
|
|
|
|
|
|
__u64 read_char;
|
|
__u64 write_char;
|
|
__u64 read_syscalls;
|
|
__u64 write_syscalls;
|
|
|
|
|
|
|
|
|
|
__u64 read_bytes;
|
|
__u64 write_bytes;
|
|
__u64 cancelled_write_bytes;
|
|
|
|
__u64 nvcsw;
|
|
__u64 nivcsw;
|
|
|
|
|
|
__u64 ac_utimescaled;
|
|
__u64 ac_stimescaled;
|
|
__u64 cpu_scaled_run_real_total;
|
|
|
|
|
|
__u64 freepages_count;
|
|
__u64 freepages_delay_total;
|
|
};
|
|
# 175 "./include/uapi/linux/taskstats.h"
|
|
enum {
|
|
TASKSTATS_CMD_UNSPEC = 0,
|
|
TASKSTATS_CMD_GET,
|
|
TASKSTATS_CMD_NEW,
|
|
__TASKSTATS_CMD_MAX,
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
TASKSTATS_TYPE_UNSPEC = 0,
|
|
TASKSTATS_TYPE_PID,
|
|
TASKSTATS_TYPE_TGID,
|
|
TASKSTATS_TYPE_STATS,
|
|
TASKSTATS_TYPE_AGGR_PID,
|
|
TASKSTATS_TYPE_AGGR_TGID,
|
|
TASKSTATS_TYPE_NULL,
|
|
__TASKSTATS_TYPE_MAX,
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
TASKSTATS_CMD_ATTR_UNSPEC = 0,
|
|
TASKSTATS_CMD_ATTR_PID,
|
|
TASKSTATS_CMD_ATTR_TGID,
|
|
TASKSTATS_CMD_ATTR_REGISTER_CPUMASK,
|
|
TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK,
|
|
__TASKSTATS_CMD_ATTR_MAX,
|
|
};
|
|
# 20 "./include/uapi/linux/cgroupstats.h" 2
|
|
# 31 "./include/uapi/linux/cgroupstats.h"
|
|
struct cgroupstats {
|
|
__u64 nr_sleeping;
|
|
__u64 nr_running;
|
|
__u64 nr_stopped;
|
|
__u64 nr_uninterruptible;
|
|
|
|
__u64 nr_io_wait;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
CGROUPSTATS_CMD_UNSPEC = __TASKSTATS_CMD_MAX,
|
|
CGROUPSTATS_CMD_GET,
|
|
CGROUPSTATS_CMD_NEW,
|
|
__CGROUPSTATS_CMD_MAX,
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
CGROUPSTATS_TYPE_UNSPEC = 0,
|
|
CGROUPSTATS_TYPE_CGROUP_STATS,
|
|
__CGROUPSTATS_TYPE_MAX,
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
CGROUPSTATS_CMD_ATTR_UNSPEC = 0,
|
|
CGROUPSTATS_CMD_ATTR_FD,
|
|
__CGROUPSTATS_CMD_ATTR_MAX,
|
|
};
|
|
# 16 "include/linux/cgroup.h" 2
|
|
# 35 "include/linux/cgroup.h"
|
|
struct css_task_iter {
|
|
struct cgroup_subsys *ss;
|
|
|
|
struct list_head *cset_pos;
|
|
struct list_head *cset_head;
|
|
|
|
struct list_head *task_pos;
|
|
struct list_head *tasks_head;
|
|
struct list_head *mg_tasks_head;
|
|
|
|
struct css_set *cur_cset;
|
|
struct task_struct *cur_task;
|
|
struct list_head iters_node;
|
|
};
|
|
|
|
extern struct cgroup_root cgrp_dfl_root;
|
|
extern struct css_set init_css_set;
|
|
|
|
|
|
# 1 "include/linux/cgroup_subsys.h" 1
|
|
# 18 "include/linux/cgroup_subsys.h"
|
|
extern struct cgroup_subsys cpuset_cgrp_subsys;
|
|
|
|
|
|
|
|
extern struct cgroup_subsys cpu_cgrp_subsys;
|
|
|
|
|
|
|
|
extern struct cgroup_subsys cpuacct_cgrp_subsys;
|
|
# 38 "include/linux/cgroup_subsys.h"
|
|
extern struct cgroup_subsys devices_cgrp_subsys;
|
|
|
|
|
|
|
|
extern struct cgroup_subsys freezer_cgrp_subsys;
|
|
# 64 "include/linux/cgroup_subsys.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern struct cgroup_subsys debug_cgrp_subsys;
|
|
# 55 "include/linux/cgroup.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/cgroup_subsys.h" 1
|
|
# 18 "include/linux/cgroup_subsys.h"
|
|
extern struct static_key_true cpuset_cgrp_subsys_enabled_key; extern struct static_key_true cpuset_cgrp_subsys_on_dfl_key;
|
|
|
|
|
|
|
|
extern struct static_key_true cpu_cgrp_subsys_enabled_key; extern struct static_key_true cpu_cgrp_subsys_on_dfl_key;
|
|
|
|
|
|
|
|
extern struct static_key_true cpuacct_cgrp_subsys_enabled_key; extern struct static_key_true cpuacct_cgrp_subsys_on_dfl_key;
|
|
# 38 "include/linux/cgroup_subsys.h"
|
|
extern struct static_key_true devices_cgrp_subsys_enabled_key; extern struct static_key_true devices_cgrp_subsys_on_dfl_key;
|
|
|
|
|
|
|
|
extern struct static_key_true freezer_cgrp_subsys_enabled_key; extern struct static_key_true freezer_cgrp_subsys_on_dfl_key;
|
|
# 64 "include/linux/cgroup_subsys.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern struct static_key_true debug_cgrp_subsys_enabled_key; extern struct static_key_true debug_cgrp_subsys_on_dfl_key;
|
|
# 61 "include/linux/cgroup.h" 2
|
|
# 77 "include/linux/cgroup.h"
|
|
bool css_has_online_children(struct cgroup_subsys_state *css);
|
|
struct cgroup_subsys_state *css_from_id(int id, struct cgroup_subsys *ss);
|
|
struct cgroup_subsys_state *cgroup_get_e_css(struct cgroup *cgroup,
|
|
struct cgroup_subsys *ss);
|
|
struct cgroup_subsys_state *css_tryget_online_from_dir(struct dentry *dentry,
|
|
struct cgroup_subsys *ss);
|
|
|
|
bool cgroup_is_descendant(struct cgroup *cgrp, struct cgroup *ancestor);
|
|
int cgroup_attach_task_all(struct task_struct *from, struct task_struct *);
|
|
int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from);
|
|
|
|
int cgroup_add_dfl_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
|
|
int cgroup_add_legacy_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
|
|
int cgroup_rm_cftypes(struct cftype *cfts);
|
|
void cgroup_file_notify(struct cgroup_file *cfile);
|
|
|
|
char *task_cgroup_path(struct task_struct *task, char *buf, size_t buflen);
|
|
int cgroupstats_build(struct cgroupstats *stats, struct dentry *dentry);
|
|
int proc_cgroup_show(struct seq_file *m, struct pid_namespace *ns,
|
|
struct pid *pid, struct task_struct *tsk);
|
|
|
|
void cgroup_fork(struct task_struct *p);
|
|
extern int cgroup_can_fork(struct task_struct *p,
|
|
void *ss_priv[(CGROUP_CANFORK_END - CGROUP_CANFORK_START)]);
|
|
extern void cgroup_cancel_fork(struct task_struct *p,
|
|
void *ss_priv[(CGROUP_CANFORK_END - CGROUP_CANFORK_START)]);
|
|
extern void cgroup_post_fork(struct task_struct *p,
|
|
void *old_ss_priv[(CGROUP_CANFORK_END - CGROUP_CANFORK_START)]);
|
|
void cgroup_exit(struct task_struct *p);
|
|
void cgroup_free(struct task_struct *p);
|
|
|
|
int cgroup_init_early(void);
|
|
int cgroup_init(void);
|
|
|
|
|
|
|
|
|
|
|
|
struct cgroup_subsys_state *css_next_child(struct cgroup_subsys_state *pos,
|
|
struct cgroup_subsys_state *parent);
|
|
struct cgroup_subsys_state *css_next_descendant_pre(struct cgroup_subsys_state *pos,
|
|
struct cgroup_subsys_state *css);
|
|
struct cgroup_subsys_state *css_rightmost_descendant(struct cgroup_subsys_state *pos);
|
|
struct cgroup_subsys_state *css_next_descendant_post(struct cgroup_subsys_state *pos,
|
|
struct cgroup_subsys_state *css);
|
|
|
|
struct task_struct *cgroup_taskset_first(struct cgroup_taskset *tset,
|
|
struct cgroup_subsys_state **dst_cssp);
|
|
struct task_struct *cgroup_taskset_next(struct cgroup_taskset *tset,
|
|
struct cgroup_subsys_state **dst_cssp);
|
|
|
|
void css_task_iter_start(struct cgroup_subsys_state *css,
|
|
struct css_task_iter *it);
|
|
struct task_struct *css_task_iter_next(struct css_task_iter *it);
|
|
void css_task_iter_end(struct css_task_iter *it);
|
|
# 288 "include/linux/cgroup.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void css_get(struct cgroup_subsys_state *css)
|
|
{
|
|
if (!(css->flags & CSS_NO_REF))
|
|
percpu_ref_get(&css->refcnt);
|
|
}
|
|
# 301 "include/linux/cgroup.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void css_get_many(struct cgroup_subsys_state *css, unsigned int n)
|
|
{
|
|
if (!(css->flags & CSS_NO_REF))
|
|
percpu_ref_get_many(&css->refcnt, n);
|
|
}
|
|
# 318 "include/linux/cgroup.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool css_tryget(struct cgroup_subsys_state *css)
|
|
{
|
|
if (!(css->flags & CSS_NO_REF))
|
|
return percpu_ref_tryget(&css->refcnt);
|
|
return true;
|
|
}
|
|
# 335 "include/linux/cgroup.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool css_tryget_online(struct cgroup_subsys_state *css)
|
|
{
|
|
if (!(css->flags & CSS_NO_REF))
|
|
return percpu_ref_tryget_live(&css->refcnt);
|
|
return true;
|
|
}
|
|
# 357 "include/linux/cgroup.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool css_is_dying(struct cgroup_subsys_state *css)
|
|
{
|
|
return !(css->flags & CSS_NO_REF) && percpu_ref_is_dying(&css->refcnt);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void css_put(struct cgroup_subsys_state *css)
|
|
{
|
|
if (!(css->flags & CSS_NO_REF))
|
|
percpu_ref_put(&css->refcnt);
|
|
}
|
|
# 381 "include/linux/cgroup.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void css_put_many(struct cgroup_subsys_state *css, unsigned int n)
|
|
{
|
|
if (!(css->flags & CSS_NO_REF))
|
|
percpu_ref_put_many(&css->refcnt, n);
|
|
}
|
|
# 431 "include/linux/cgroup.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct css_set *task_css_set(struct task_struct *task)
|
|
{
|
|
return ({ typeof(*((task)->cgroups)) *________p1 = (typeof(*((task)->cgroups)) *)({ typeof(((task)->cgroups)) _________p1 = ({ union { typeof(((task)->cgroups)) __val; char __c[1]; } __u; if (1) __read_once_size(&(((task)->cgroups)), __u.__c, sizeof(((task)->cgroups))); else __read_once_size_nocheck(&(((task)->cgroups)), __u.__c, sizeof(((task)->cgroups))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*((task)->cgroups)) *)(________p1)); });
|
|
}
|
|
# 443 "include/linux/cgroup.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct cgroup_subsys_state *task_css(struct task_struct *task,
|
|
int subsys_id)
|
|
{
|
|
return ({ typeof(*(((task))->cgroups)) *________p1 = (typeof(*(((task))->cgroups)) *)({ typeof((((task))->cgroups)) _________p1 = ({ union { typeof((((task))->cgroups)) __val; char __c[1]; } __u; if (1) __read_once_size(&((((task))->cgroups)), __u.__c, sizeof((((task))->cgroups))); else __read_once_size_nocheck(&((((task))->cgroups)), __u.__c, sizeof((((task))->cgroups))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(((task))->cgroups)) *)(________p1)); })->subsys[(subsys_id)];
|
|
}
|
|
# 458 "include/linux/cgroup.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct cgroup_subsys_state *
|
|
task_get_css(struct task_struct *task, int subsys_id)
|
|
{
|
|
struct cgroup_subsys_state *css;
|
|
|
|
rcu_read_lock();
|
|
while (true) {
|
|
css = task_css(task, subsys_id);
|
|
if (__builtin_expect(!!(css_tryget_online(css)), 1))
|
|
break;
|
|
__asm__ __volatile__("": : :"memory");
|
|
}
|
|
rcu_read_unlock();
|
|
return css;
|
|
}
|
|
# 482 "include/linux/cgroup.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool task_css_is_root(struct task_struct *task, int subsys_id)
|
|
{
|
|
return ({ typeof(*(((task))->cgroups)) *________p1 = (typeof(*(((task))->cgroups)) *)({ typeof((((task))->cgroups)) _________p1 = ({ union { typeof((((task))->cgroups)) __val; char __c[1]; } __u; if (1) __read_once_size(&((((task))->cgroups)), __u.__c, sizeof((((task))->cgroups))); else __read_once_size_nocheck(&((((task))->cgroups)), __u.__c, sizeof((((task))->cgroups))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(((task))->cgroups)) *)(________p1)); })->subsys[(subsys_id)] ==
|
|
init_css_set.subsys[subsys_id];
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct cgroup *task_cgroup(struct task_struct *task,
|
|
int subsys_id)
|
|
{
|
|
return task_css(task, subsys_id)->cgroup;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool cgroup_is_populated(struct cgroup *cgrp)
|
|
{
|
|
return cgrp->populated_cnt;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) ino_t cgroup_ino(struct cgroup *cgrp)
|
|
{
|
|
return cgrp->kn->ino;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct cftype *of_cft(struct kernfs_open_file *of)
|
|
{
|
|
return of->kn->priv;
|
|
}
|
|
|
|
struct cgroup_subsys_state *of_css(struct kernfs_open_file *of);
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct cftype *seq_cft(struct seq_file *seq)
|
|
{
|
|
return of_cft(seq->private);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct cgroup_subsys_state *seq_css(struct seq_file *seq)
|
|
{
|
|
return of_css(seq->private);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int cgroup_name(struct cgroup *cgrp, char *buf, size_t buflen)
|
|
{
|
|
return kernfs_name(cgrp->kn, buf, buflen);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) char * __attribute__((warn_unused_result)) cgroup_path(struct cgroup *cgrp, char *buf,
|
|
size_t buflen)
|
|
{
|
|
return kernfs_path(cgrp->kn, buf, buflen);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pr_cont_cgroup_name(struct cgroup *cgrp)
|
|
{
|
|
pr_cont_kernfs_name(cgrp->kn);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pr_cont_cgroup_path(struct cgroup *cgrp)
|
|
{
|
|
pr_cont_kernfs_path(cgrp->kn);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cgroup_init_kthreadd(void)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
(current_thread_info()->task)->no_cgroup_migration = 1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cgroup_kthread_ready(void)
|
|
{
|
|
|
|
|
|
|
|
|
|
(current_thread_info()->task)->no_cgroup_migration = 0;
|
|
}
|
|
# 18 "include/net/netprio_cgroup.h" 2
|
|
# 42 "include/net/netprio_cgroup.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 task_netprioidx(struct task_struct *p)
|
|
{
|
|
return 0;
|
|
}
|
|
# 49 "include/linux/netdevice.h" 2
|
|
|
|
|
|
# 1 "./include/uapi/linux/neighbour.h" 1
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/netlink.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/net/scm.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/security.h" 1
|
|
# 32 "include/linux/security.h"
|
|
struct linux_binprm;
|
|
struct cred;
|
|
struct rlimit;
|
|
struct siginfo;
|
|
struct sem_array;
|
|
struct sembuf;
|
|
struct kern_ipc_perm;
|
|
struct audit_context;
|
|
struct super_block;
|
|
struct inode;
|
|
struct dentry;
|
|
struct file;
|
|
struct vfsmount;
|
|
struct path;
|
|
struct qstr;
|
|
struct iattr;
|
|
struct fown_struct;
|
|
struct file_operations;
|
|
struct shmid_kernel;
|
|
struct msg_msg;
|
|
struct msg_queue;
|
|
struct xattr;
|
|
struct xfrm_sec_ctx;
|
|
struct mm_struct;
|
|
# 64 "include/linux/security.h"
|
|
struct ctl_table;
|
|
struct audit_krule;
|
|
struct user_namespace;
|
|
struct timezone;
|
|
|
|
|
|
extern int cap_capable(const struct cred *cred, struct user_namespace *ns,
|
|
int cap, int audit);
|
|
extern int cap_settime(const struct timespec *ts, const struct timezone *tz);
|
|
extern int cap_ptrace_access_check(struct task_struct *child, unsigned int mode);
|
|
extern int cap_ptrace_traceme(struct task_struct *parent);
|
|
extern int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted);
|
|
extern int cap_capset(struct cred *new, const struct cred *old,
|
|
const kernel_cap_t *effective,
|
|
const kernel_cap_t *inheritable,
|
|
const kernel_cap_t *permitted);
|
|
extern int cap_bprm_set_creds(struct linux_binprm *bprm);
|
|
extern int cap_bprm_secureexec(struct linux_binprm *bprm);
|
|
extern int cap_inode_setxattr(struct dentry *dentry, const char *name,
|
|
const void *value, size_t size, int flags);
|
|
extern int cap_inode_removexattr(struct dentry *dentry, const char *name);
|
|
extern int cap_inode_need_killpriv(struct dentry *dentry);
|
|
extern int cap_inode_killpriv(struct dentry *dentry);
|
|
extern int cap_mmap_addr(unsigned long addr);
|
|
extern int cap_mmap_file(struct file *file, unsigned long reqprot,
|
|
unsigned long prot, unsigned long flags);
|
|
extern int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags);
|
|
extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3,
|
|
unsigned long arg4, unsigned long arg5);
|
|
extern int cap_task_setscheduler(struct task_struct *p);
|
|
extern int cap_task_setioprio(struct task_struct *p, int ioprio);
|
|
extern int cap_task_setnice(struct task_struct *p, int nice);
|
|
extern int cap_vm_enough_memory(struct mm_struct *mm, long pages);
|
|
|
|
struct msghdr;
|
|
struct sk_buff;
|
|
struct sock;
|
|
struct sockaddr;
|
|
struct socket;
|
|
struct flowi;
|
|
struct dst_entry;
|
|
struct xfrm_selector;
|
|
struct xfrm_policy;
|
|
struct xfrm_state;
|
|
struct xfrm_user_sec_ctx;
|
|
struct seq_file;
|
|
|
|
|
|
extern unsigned long mmap_min_addr;
|
|
extern unsigned long dac_mmap_min_addr;
|
|
# 135 "include/linux/security.h"
|
|
struct sched_param;
|
|
struct request_sock;
|
|
# 145 "include/linux/security.h"
|
|
extern int mmap_min_addr_handler(struct ctl_table *table, int write,
|
|
void *buffer, size_t *lenp, loff_t *ppos);
|
|
|
|
|
|
|
|
typedef int (*initxattrs) (struct inode *inode,
|
|
const struct xattr *xattr_array, void *fs_data);
|
|
|
|
|
|
|
|
struct security_mnt_opts {
|
|
char **mnt_opts;
|
|
int *mnt_opts_flags;
|
|
int num_mnt_opts;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void security_init_mnt_opts(struct security_mnt_opts *opts)
|
|
{
|
|
opts->mnt_opts = ((void *)0);
|
|
opts->mnt_opts_flags = ((void *)0);
|
|
opts->num_mnt_opts = 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void security_free_mnt_opts(struct security_mnt_opts *opts)
|
|
{
|
|
int i;
|
|
if (opts->mnt_opts)
|
|
for (i = 0; i < opts->num_mnt_opts; i++)
|
|
kfree(opts->mnt_opts[i]);
|
|
kfree(opts->mnt_opts);
|
|
opts->mnt_opts = ((void *)0);
|
|
kfree(opts->mnt_opts_flags);
|
|
opts->mnt_opts_flags = ((void *)0);
|
|
opts->num_mnt_opts = 0;
|
|
}
|
|
|
|
|
|
extern int security_init(void);
|
|
|
|
|
|
int security_binder_set_context_mgr(struct task_struct *mgr);
|
|
int security_binder_transaction(struct task_struct *from,
|
|
struct task_struct *to);
|
|
int security_binder_transfer_binder(struct task_struct *from,
|
|
struct task_struct *to);
|
|
int security_binder_transfer_file(struct task_struct *from,
|
|
struct task_struct *to, struct file *file);
|
|
int security_ptrace_access_check(struct task_struct *child, unsigned int mode);
|
|
int security_ptrace_traceme(struct task_struct *parent);
|
|
int security_capget(struct task_struct *target,
|
|
kernel_cap_t *effective,
|
|
kernel_cap_t *inheritable,
|
|
kernel_cap_t *permitted);
|
|
int security_capset(struct cred *new, const struct cred *old,
|
|
const kernel_cap_t *effective,
|
|
const kernel_cap_t *inheritable,
|
|
const kernel_cap_t *permitted);
|
|
int security_capable(const struct cred *cred, struct user_namespace *ns,
|
|
int cap);
|
|
int security_capable_noaudit(const struct cred *cred, struct user_namespace *ns,
|
|
int cap);
|
|
int security_quotactl(int cmds, int type, int id, struct super_block *sb);
|
|
int security_quota_on(struct dentry *dentry);
|
|
int security_syslog(int type);
|
|
int security_settime(const struct timespec *ts, const struct timezone *tz);
|
|
int security_vm_enough_memory_mm(struct mm_struct *mm, long pages);
|
|
int security_bprm_set_creds(struct linux_binprm *bprm);
|
|
int security_bprm_check(struct linux_binprm *bprm);
|
|
void security_bprm_committing_creds(struct linux_binprm *bprm);
|
|
void security_bprm_committed_creds(struct linux_binprm *bprm);
|
|
int security_bprm_secureexec(struct linux_binprm *bprm);
|
|
int security_sb_alloc(struct super_block *sb);
|
|
void security_sb_free(struct super_block *sb);
|
|
int security_sb_copy_data(char *orig, char *copy);
|
|
int security_sb_remount(struct super_block *sb, void *data);
|
|
int security_sb_kern_mount(struct super_block *sb, int flags, void *data);
|
|
int security_sb_show_options(struct seq_file *m, struct super_block *sb);
|
|
int security_sb_statfs(struct dentry *dentry);
|
|
int security_sb_mount(const char *dev_name, struct path *path,
|
|
const char *type, unsigned long flags, void *data);
|
|
int security_sb_umount(struct vfsmount *mnt, int flags);
|
|
int security_sb_pivotroot(struct path *old_path, struct path *new_path);
|
|
int security_sb_set_mnt_opts(struct super_block *sb,
|
|
struct security_mnt_opts *opts,
|
|
unsigned long kern_flags,
|
|
unsigned long *set_kern_flags);
|
|
int security_sb_clone_mnt_opts(const struct super_block *oldsb,
|
|
struct super_block *newsb);
|
|
int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts);
|
|
int security_dentry_init_security(struct dentry *dentry, int mode,
|
|
struct qstr *name, void **ctx,
|
|
u32 *ctxlen);
|
|
|
|
int security_inode_alloc(struct inode *inode);
|
|
void security_inode_free(struct inode *inode);
|
|
int security_inode_init_security(struct inode *inode, struct inode *dir,
|
|
const struct qstr *qstr,
|
|
initxattrs initxattrs, void *fs_data);
|
|
int security_old_inode_init_security(struct inode *inode, struct inode *dir,
|
|
const struct qstr *qstr, const char **name,
|
|
void **value, size_t *len);
|
|
int security_inode_create(struct inode *dir, struct dentry *dentry, umode_t mode);
|
|
int security_inode_link(struct dentry *old_dentry, struct inode *dir,
|
|
struct dentry *new_dentry);
|
|
int security_inode_unlink(struct inode *dir, struct dentry *dentry);
|
|
int security_inode_symlink(struct inode *dir, struct dentry *dentry,
|
|
const char *old_name);
|
|
int security_inode_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode);
|
|
int security_inode_rmdir(struct inode *dir, struct dentry *dentry);
|
|
int security_inode_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev);
|
|
int security_inode_rename(struct inode *old_dir, struct dentry *old_dentry,
|
|
struct inode *new_dir, struct dentry *new_dentry,
|
|
unsigned int flags);
|
|
int security_inode_readlink(struct dentry *dentry);
|
|
int security_inode_follow_link(struct dentry *dentry, struct inode *inode,
|
|
bool rcu);
|
|
int security_inode_permission(struct inode *inode, int mask);
|
|
int security_inode_setattr(struct dentry *dentry, struct iattr *attr);
|
|
int security_inode_getattr(const struct path *path);
|
|
int security_inode_setxattr(struct dentry *dentry, const char *name,
|
|
const void *value, size_t size, int flags);
|
|
void security_inode_post_setxattr(struct dentry *dentry, const char *name,
|
|
const void *value, size_t size, int flags);
|
|
int security_inode_getxattr(struct dentry *dentry, const char *name);
|
|
int security_inode_listxattr(struct dentry *dentry);
|
|
int security_inode_removexattr(struct dentry *dentry, const char *name);
|
|
int security_inode_need_killpriv(struct dentry *dentry);
|
|
int security_inode_killpriv(struct dentry *dentry);
|
|
int security_inode_getsecurity(const struct inode *inode, const char *name, void **buffer, bool alloc);
|
|
int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags);
|
|
int security_inode_listsecurity(struct inode *inode, char *buffer, size_t buffer_size);
|
|
void security_inode_getsecid(const struct inode *inode, u32 *secid);
|
|
int security_file_permission(struct file *file, int mask);
|
|
int security_file_alloc(struct file *file);
|
|
void security_file_free(struct file *file);
|
|
int security_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
|
|
int security_mmap_file(struct file *file, unsigned long prot,
|
|
unsigned long flags);
|
|
int security_mmap_addr(unsigned long addr);
|
|
int security_file_mprotect(struct vm_area_struct *vma, unsigned long reqprot,
|
|
unsigned long prot);
|
|
int security_file_lock(struct file *file, unsigned int cmd);
|
|
int security_file_fcntl(struct file *file, unsigned int cmd, unsigned long arg);
|
|
void security_file_set_fowner(struct file *file);
|
|
int security_file_send_sigiotask(struct task_struct *tsk,
|
|
struct fown_struct *fown, int sig);
|
|
int security_file_receive(struct file *file);
|
|
int security_file_open(struct file *file, const struct cred *cred);
|
|
int security_task_create(unsigned long clone_flags);
|
|
void security_task_free(struct task_struct *task);
|
|
int security_cred_alloc_blank(struct cred *cred, gfp_t gfp);
|
|
void security_cred_free(struct cred *cred);
|
|
int security_prepare_creds(struct cred *new, const struct cred *old, gfp_t gfp);
|
|
void security_transfer_creds(struct cred *new, const struct cred *old);
|
|
int security_kernel_act_as(struct cred *new, u32 secid);
|
|
int security_kernel_create_files_as(struct cred *new, struct inode *inode);
|
|
int security_kernel_fw_from_file(struct file *file, char *buf, size_t size);
|
|
int security_kernel_module_request(char *kmod_name);
|
|
int security_kernel_module_from_file(struct file *file);
|
|
int security_task_fix_setuid(struct cred *new, const struct cred *old,
|
|
int flags);
|
|
int security_task_setpgid(struct task_struct *p, pid_t pgid);
|
|
int security_task_getpgid(struct task_struct *p);
|
|
int security_task_getsid(struct task_struct *p);
|
|
void security_task_getsecid(struct task_struct *p, u32 *secid);
|
|
int security_task_setnice(struct task_struct *p, int nice);
|
|
int security_task_setioprio(struct task_struct *p, int ioprio);
|
|
int security_task_getioprio(struct task_struct *p);
|
|
int security_task_setrlimit(struct task_struct *p, unsigned int resource,
|
|
struct rlimit *new_rlim);
|
|
int security_task_setscheduler(struct task_struct *p);
|
|
int security_task_getscheduler(struct task_struct *p);
|
|
int security_task_movememory(struct task_struct *p);
|
|
int security_task_kill(struct task_struct *p, struct siginfo *info,
|
|
int sig, u32 secid);
|
|
int security_task_wait(struct task_struct *p);
|
|
int security_task_prctl(int option, unsigned long arg2, unsigned long arg3,
|
|
unsigned long arg4, unsigned long arg5);
|
|
void security_task_to_inode(struct task_struct *p, struct inode *inode);
|
|
int security_ipc_permission(struct kern_ipc_perm *ipcp, short flag);
|
|
void security_ipc_getsecid(struct kern_ipc_perm *ipcp, u32 *secid);
|
|
int security_msg_msg_alloc(struct msg_msg *msg);
|
|
void security_msg_msg_free(struct msg_msg *msg);
|
|
int security_msg_queue_alloc(struct msg_queue *msq);
|
|
void security_msg_queue_free(struct msg_queue *msq);
|
|
int security_msg_queue_associate(struct msg_queue *msq, int msqflg);
|
|
int security_msg_queue_msgctl(struct msg_queue *msq, int cmd);
|
|
int security_msg_queue_msgsnd(struct msg_queue *msq,
|
|
struct msg_msg *msg, int msqflg);
|
|
int security_msg_queue_msgrcv(struct msg_queue *msq, struct msg_msg *msg,
|
|
struct task_struct *target, long type, int mode);
|
|
int security_shm_alloc(struct shmid_kernel *shp);
|
|
void security_shm_free(struct shmid_kernel *shp);
|
|
int security_shm_associate(struct shmid_kernel *shp, int shmflg);
|
|
int security_shm_shmctl(struct shmid_kernel *shp, int cmd);
|
|
int security_shm_shmat(struct shmid_kernel *shp, char *shmaddr, int shmflg);
|
|
int security_sem_alloc(struct sem_array *sma);
|
|
void security_sem_free(struct sem_array *sma);
|
|
int security_sem_associate(struct sem_array *sma, int semflg);
|
|
int security_sem_semctl(struct sem_array *sma, int cmd);
|
|
int security_sem_semop(struct sem_array *sma, struct sembuf *sops,
|
|
unsigned nsops, int alter);
|
|
void security_d_instantiate(struct dentry *dentry, struct inode *inode);
|
|
int security_getprocattr(struct task_struct *p, char *name, char **value);
|
|
int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size);
|
|
int security_netlink_send(struct sock *sk, struct sk_buff *skb);
|
|
int security_ismaclabel(const char *name);
|
|
int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen);
|
|
int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid);
|
|
void security_release_secctx(char *secdata, u32 seclen);
|
|
|
|
int security_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen);
|
|
int security_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen);
|
|
int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen);
|
|
# 1156 "include/linux/security.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_unix_stream_connect(struct sock *sock,
|
|
struct sock *other,
|
|
struct sock *newsk)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_unix_may_send(struct socket *sock,
|
|
struct socket *other)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_socket_create(int family, int type,
|
|
int protocol, int kern)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_socket_post_create(struct socket *sock,
|
|
int family,
|
|
int type,
|
|
int protocol, int kern)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_socket_bind(struct socket *sock,
|
|
struct sockaddr *address,
|
|
int addrlen)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_socket_connect(struct socket *sock,
|
|
struct sockaddr *address,
|
|
int addrlen)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_socket_listen(struct socket *sock, int backlog)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_socket_accept(struct socket *sock,
|
|
struct socket *newsock)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_socket_sendmsg(struct socket *sock,
|
|
struct msghdr *msg, int size)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_socket_recvmsg(struct socket *sock,
|
|
struct msghdr *msg, int size,
|
|
int flags)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_socket_getsockname(struct socket *sock)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_socket_getpeername(struct socket *sock)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_socket_getsockopt(struct socket *sock,
|
|
int level, int optname)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_socket_setsockopt(struct socket *sock,
|
|
int level, int optname)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_socket_shutdown(struct socket *sock, int how)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_sock_rcv_skb(struct sock *sk,
|
|
struct sk_buff *skb)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_socket_getpeersec_stream(struct socket *sock, char *optval,
|
|
int *optlen, unsigned len)
|
|
{
|
|
return -92;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid)
|
|
{
|
|
return -92;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_sk_alloc(struct sock *sk, int family, gfp_t priority)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void security_sk_free(struct sock *sk)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void security_sk_clone(const struct sock *sk, struct sock *newsk)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void security_sk_classify_flow(struct sock *sk, struct flowi *fl)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void security_req_classify_flow(const struct request_sock *req, struct flowi *fl)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void security_sock_graft(struct sock *sk, struct socket *parent)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_inet_conn_request(struct sock *sk,
|
|
struct sk_buff *skb, struct request_sock *req)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void security_inet_csk_clone(struct sock *newsk,
|
|
const struct request_sock *req)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void security_inet_conn_established(struct sock *sk,
|
|
struct sk_buff *skb)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_secmark_relabel_packet(u32 secid)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void security_secmark_refcount_inc(void)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void security_secmark_refcount_dec(void)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_tun_dev_alloc_security(void **security)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void security_tun_dev_free_security(void *security)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_tun_dev_create(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_tun_dev_attach_queue(void *security)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_tun_dev_attach(struct sock *sk, void *security)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_tun_dev_open(void *security)
|
|
{
|
|
return 0;
|
|
}
|
|
# 1369 "include/linux/security.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp,
|
|
struct xfrm_user_sec_ctx *sec_ctx,
|
|
gfp_t gfp)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_xfrm_policy_clone(struct xfrm_sec_ctx *old, struct xfrm_sec_ctx **new_ctxp)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void security_xfrm_policy_free(struct xfrm_sec_ctx *ctx)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_xfrm_policy_delete(struct xfrm_sec_ctx *ctx)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_xfrm_state_alloc(struct xfrm_state *x,
|
|
struct xfrm_user_sec_ctx *sec_ctx)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_xfrm_state_alloc_acquire(struct xfrm_state *x,
|
|
struct xfrm_sec_ctx *polsec, u32 secid)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void security_xfrm_state_free(struct xfrm_state *x)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_xfrm_state_delete(struct xfrm_state *x)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_xfrm_policy_lookup(struct xfrm_sec_ctx *ctx, u32 fl_secid, u8 dir)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_xfrm_state_pol_flow_match(struct xfrm_state *x,
|
|
struct xfrm_policy *xp, const struct flowi *fl)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void security_skb_classify_flow(struct sk_buff *skb, struct flowi *fl)
|
|
{
|
|
}
|
|
# 1451 "include/linux/security.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_path_unlink(struct path *dir, struct dentry *dentry)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_path_mkdir(struct path *dir, struct dentry *dentry,
|
|
umode_t mode)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_path_rmdir(struct path *dir, struct dentry *dentry)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_path_mknod(struct path *dir, struct dentry *dentry,
|
|
umode_t mode, unsigned int dev)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_path_truncate(struct path *path)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_path_symlink(struct path *dir, struct dentry *dentry,
|
|
const char *old_name)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_path_link(struct dentry *old_dentry,
|
|
struct path *new_dir,
|
|
struct dentry *new_dentry)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_path_rename(struct path *old_dir,
|
|
struct dentry *old_dentry,
|
|
struct path *new_dir,
|
|
struct dentry *new_dentry,
|
|
unsigned int flags)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_path_chmod(struct path *path, umode_t mode)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_path_chown(struct path *path, kuid_t uid, kgid_t gid)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int security_path_chroot(struct path *path)
|
|
{
|
|
return 0;
|
|
}
|
|
# 1589 "include/linux/security.h"
|
|
extern struct dentry *securityfs_create_file(const char *name, umode_t mode,
|
|
struct dentry *parent, void *data,
|
|
const struct file_operations *fops);
|
|
extern struct dentry *securityfs_create_dir(const char *name, struct dentry *parent);
|
|
extern void securityfs_remove(struct dentry *dentry);
|
|
# 1619 "include/linux/security.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) char *alloc_secdata(void)
|
|
{
|
|
return (char *)get_zeroed_page(((( gfp_t)(0x400000u|0x2000000u)) | (( gfp_t)0x40u) | (( gfp_t)0x80u)));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void free_secdata(void *secdata)
|
|
{
|
|
free_pages(((unsigned long)secdata), 0);
|
|
}
|
|
# 7 "include/net/scm.h" 2
|
|
|
|
# 1 "include/linux/nsproxy.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct mnt_namespace;
|
|
struct uts_namespace;
|
|
struct ipc_namespace;
|
|
struct pid_namespace;
|
|
struct fs_struct;
|
|
# 29 "include/linux/nsproxy.h"
|
|
struct nsproxy {
|
|
atomic_t count;
|
|
struct uts_namespace *uts_ns;
|
|
struct ipc_namespace *ipc_ns;
|
|
struct mnt_namespace *mnt_ns;
|
|
struct pid_namespace *pid_ns_for_children;
|
|
struct net *net_ns;
|
|
};
|
|
extern struct nsproxy init_nsproxy;
|
|
# 65 "include/linux/nsproxy.h"
|
|
int copy_namespaces(unsigned long flags, struct task_struct *tsk);
|
|
void exit_task_namespaces(struct task_struct *tsk);
|
|
void switch_task_namespaces(struct task_struct *tsk, struct nsproxy *new);
|
|
void free_nsproxy(struct nsproxy *ns);
|
|
int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **,
|
|
struct cred *, struct fs_struct *);
|
|
int __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) nsproxy_cache_init(void);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_nsproxy(struct nsproxy *ns)
|
|
{
|
|
if ((({ typeof(atomic_sub_return_relaxed(1, &ns->count)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_sub_return_relaxed(1, &ns->count); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) == 0)) {
|
|
free_nsproxy(ns);
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void get_nsproxy(struct nsproxy *ns)
|
|
{
|
|
atomic_add(1, &ns->count);
|
|
}
|
|
# 9 "include/net/scm.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct scm_creds {
|
|
u32 pid;
|
|
kuid_t uid;
|
|
kgid_t gid;
|
|
};
|
|
|
|
struct scm_fp_list {
|
|
short count;
|
|
short max;
|
|
struct user_struct *user;
|
|
struct file *fp[253];
|
|
};
|
|
|
|
struct scm_cookie {
|
|
struct pid *pid;
|
|
struct scm_fp_list *fp;
|
|
struct scm_creds creds;
|
|
|
|
|
|
|
|
};
|
|
|
|
void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm);
|
|
void scm_detach_fds_compat(struct msghdr *msg, struct scm_cookie *scm);
|
|
int __scm_send(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm);
|
|
void __scm_destroy(struct scm_cookie *scm);
|
|
struct scm_fp_list *scm_fp_dup(struct scm_fp_list *fpl);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static __inline__ __attribute__((always_inline)) __attribute__((no_instrument_function)) void unix_get_peersec_dgram(struct socket *sock, struct scm_cookie *scm)
|
|
{ }
|
|
|
|
|
|
static __inline__ __attribute__((always_inline)) __attribute__((no_instrument_function)) void scm_set_cred(struct scm_cookie *scm,
|
|
struct pid *pid, kuid_t uid, kgid_t gid)
|
|
{
|
|
scm->pid = get_pid(pid);
|
|
scm->creds.pid = pid_vnr(pid);
|
|
scm->creds.uid = uid;
|
|
scm->creds.gid = gid;
|
|
}
|
|
|
|
static __inline__ __attribute__((always_inline)) __attribute__((no_instrument_function)) void scm_destroy_cred(struct scm_cookie *scm)
|
|
{
|
|
put_pid(scm->pid);
|
|
scm->pid = ((void *)0);
|
|
}
|
|
|
|
static __inline__ __attribute__((always_inline)) __attribute__((no_instrument_function)) void scm_destroy(struct scm_cookie *scm)
|
|
{
|
|
scm_destroy_cred(scm);
|
|
if (scm->fp)
|
|
__scm_destroy(scm);
|
|
}
|
|
|
|
static __inline__ __attribute__((always_inline)) __attribute__((no_instrument_function)) int scm_send(struct socket *sock, struct msghdr *msg,
|
|
struct scm_cookie *scm, bool forcecreds)
|
|
{
|
|
({ void *__p = (scm); size_t __n = sizeof(*scm); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); });
|
|
scm->creds.uid = (kuid_t){ -1 };
|
|
scm->creds.gid = (kgid_t){ -1 };
|
|
if (forcecreds)
|
|
scm_set_cred(scm, task_tgid((current_thread_info()->task)), (({ ({ do { } while (0); ; ((typeof(*((current_thread_info()->task)->cred)) *)(((current_thread_info()->task)->cred))); })->uid; })), (({ ({ do { } while (0); ; ((typeof(*((current_thread_info()->task)->cred)) *)(((current_thread_info()->task)->cred))); })->gid; })));
|
|
unix_get_peersec_dgram(sock, scm);
|
|
if (msg->msg_controllen <= 0)
|
|
return 0;
|
|
return __scm_send(sock, msg, scm);
|
|
}
|
|
# 106 "include/net/scm.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void scm_passec(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm)
|
|
{ }
|
|
|
|
|
|
static __inline__ __attribute__((always_inline)) __attribute__((no_instrument_function)) void scm_recv(struct socket *sock, struct msghdr *msg,
|
|
struct scm_cookie *scm, int flags)
|
|
{
|
|
if (!msg->msg_control) {
|
|
if (test_bit(3, &sock->flags) || scm->fp)
|
|
msg->msg_flags |= 8;
|
|
scm_destroy(scm);
|
|
return;
|
|
}
|
|
|
|
if (test_bit(3, &sock->flags)) {
|
|
struct user_namespace *current_ns = (({ ({ do { } while (0); ; ((typeof(*((current_thread_info()->task)->cred)) *)(((current_thread_info()->task)->cred))); })->user_ns; }));
|
|
struct ucred ucreds = {
|
|
.pid = scm->creds.pid,
|
|
.uid = from_kuid_munged(current_ns, scm->creds.uid),
|
|
.gid = from_kgid_munged(current_ns, scm->creds.gid),
|
|
};
|
|
put_cmsg(msg, 1, 0x02, sizeof(ucreds), &ucreds);
|
|
}
|
|
|
|
scm_destroy_cred(scm);
|
|
|
|
scm_passec(sock, msg, scm);
|
|
|
|
if (!scm->fp)
|
|
return;
|
|
|
|
scm_detach_fds(msg, scm);
|
|
}
|
|
# 9 "include/linux/netlink.h" 2
|
|
# 1 "include/uapi/linux/netlink.h" 1
|
|
# 51 "include/uapi/linux/netlink.h"
|
|
struct sockaddr_nl {
|
|
__kernel_sa_family_t nl_family;
|
|
unsigned short nl_pad;
|
|
__u32 nl_pid;
|
|
__u32 nl_groups;
|
|
};
|
|
|
|
struct nlmsghdr {
|
|
__u32 nlmsg_len;
|
|
__u16 nlmsg_type;
|
|
__u16 nlmsg_flags;
|
|
__u32 nlmsg_seq;
|
|
__u32 nlmsg_pid;
|
|
};
|
|
# 116 "include/uapi/linux/netlink.h"
|
|
struct nlmsgerr {
|
|
int error;
|
|
struct nlmsghdr msg;
|
|
};
|
|
# 134 "include/uapi/linux/netlink.h"
|
|
struct nl_pktinfo {
|
|
__u32 group;
|
|
};
|
|
|
|
struct nl_mmap_req {
|
|
unsigned int nm_block_size;
|
|
unsigned int nm_block_nr;
|
|
unsigned int nm_frame_size;
|
|
unsigned int nm_frame_nr;
|
|
};
|
|
|
|
struct nl_mmap_hdr {
|
|
unsigned int nm_status;
|
|
unsigned int nm_len;
|
|
__u32 nm_group;
|
|
|
|
__u32 nm_pid;
|
|
__u32 nm_uid;
|
|
__u32 nm_gid;
|
|
};
|
|
# 171 "include/uapi/linux/netlink.h"
|
|
enum {
|
|
NETLINK_UNCONNECTED = 0,
|
|
NETLINK_CONNECTED,
|
|
};
|
|
# 185 "include/uapi/linux/netlink.h"
|
|
struct nlattr {
|
|
__u16 nla_len;
|
|
__u16 nla_type;
|
|
};
|
|
# 10 "include/linux/netlink.h" 2
|
|
|
|
struct net;
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct nlmsghdr *nlmsg_hdr(const struct sk_buff *skb)
|
|
{
|
|
return (struct nlmsghdr *)skb->data;
|
|
}
|
|
|
|
enum netlink_skb_flags {
|
|
NETLINK_SKB_MMAPED = 0x1,
|
|
NETLINK_SKB_TX = 0x2,
|
|
NETLINK_SKB_DELIVERED = 0x4,
|
|
NETLINK_SKB_DST = 0x8,
|
|
};
|
|
|
|
struct netlink_skb_parms {
|
|
struct scm_creds creds;
|
|
__u32 portid;
|
|
__u32 dst_group;
|
|
__u32 flags;
|
|
struct sock *sk;
|
|
bool nsid_is_set;
|
|
int nsid;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
extern void netlink_table_grab(void);
|
|
extern void netlink_table_ungrab(void);
|
|
|
|
|
|
|
|
|
|
|
|
struct netlink_kernel_cfg {
|
|
unsigned int groups;
|
|
unsigned int flags;
|
|
void (*input)(struct sk_buff *skb);
|
|
struct mutex *cb_mutex;
|
|
int (*bind)(struct net *net, int group);
|
|
void (*unbind)(struct net *net, int group);
|
|
bool (*compare)(struct net *net, struct sock *sk);
|
|
};
|
|
|
|
extern struct sock *__netlink_kernel_create(struct net *net, int unit,
|
|
struct module *module,
|
|
struct netlink_kernel_cfg *cfg);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sock *
|
|
netlink_kernel_create(struct net *net, int unit, struct netlink_kernel_cfg *cfg)
|
|
{
|
|
return __netlink_kernel_create(net, unit, (&__this_module), cfg);
|
|
}
|
|
|
|
extern void netlink_kernel_release(struct sock *sk);
|
|
extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups);
|
|
extern int netlink_change_ngroups(struct sock *sk, unsigned int groups);
|
|
extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group);
|
|
extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err);
|
|
extern int netlink_has_listeners(struct sock *sk, unsigned int group);
|
|
|
|
extern struct sk_buff *__netlink_alloc_skb(struct sock *ssk, unsigned int size,
|
|
unsigned int ldiff, u32 dst_portid,
|
|
gfp_t gfp_mask);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *
|
|
netlink_alloc_skb(struct sock *ssk, unsigned int size, u32 dst_portid,
|
|
gfp_t gfp_mask)
|
|
{
|
|
return __netlink_alloc_skb(ssk, size, 0, dst_portid, gfp_mask);
|
|
}
|
|
|
|
extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 portid, int nonblock);
|
|
extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 portid,
|
|
__u32 group, gfp_t allocation);
|
|
extern int netlink_broadcast_filtered(struct sock *ssk, struct sk_buff *skb,
|
|
__u32 portid, __u32 group, gfp_t allocation,
|
|
int (*filter)(struct sock *dsk, struct sk_buff *skb, void *data),
|
|
void *filter_data);
|
|
extern int netlink_set_err(struct sock *ssk, __u32 portid, __u32 group, int code);
|
|
extern int netlink_register_notifier(struct notifier_block *nb);
|
|
extern int netlink_unregister_notifier(struct notifier_block *nb);
|
|
|
|
|
|
struct sock *netlink_getsockbyfilp(struct file *filp);
|
|
int netlink_attachskb(struct sock *sk, struct sk_buff *skb,
|
|
long *timeo, struct sock *ssk);
|
|
void netlink_detachskb(struct sock *sk, struct sk_buff *skb);
|
|
int netlink_sendskb(struct sock *sk, struct sk_buff *skb);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *
|
|
netlink_skb_clone(struct sk_buff *skb, gfp_t gfp_mask)
|
|
{
|
|
struct sk_buff *nskb;
|
|
|
|
nskb = skb_clone(skb, gfp_mask);
|
|
if (!nskb)
|
|
return ((void *)0);
|
|
|
|
|
|
if (is_vmalloc_addr(skb->head))
|
|
nskb->destructor = skb->destructor;
|
|
|
|
return nskb;
|
|
}
|
|
# 131 "include/linux/netlink.h"
|
|
struct netlink_callback {
|
|
struct sk_buff *skb;
|
|
const struct nlmsghdr *nlh;
|
|
int (*start)(struct netlink_callback *);
|
|
int (*dump)(struct sk_buff * skb,
|
|
struct netlink_callback *cb);
|
|
int (*done)(struct netlink_callback *cb);
|
|
void *data;
|
|
|
|
struct module *module;
|
|
u16 family;
|
|
u16 min_dump_alloc;
|
|
unsigned int prev_seq, seq;
|
|
long args[6];
|
|
};
|
|
|
|
struct netlink_notify {
|
|
struct net *net;
|
|
u32 portid;
|
|
int protocol;
|
|
};
|
|
|
|
struct nlmsghdr *
|
|
__nlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, int type, int len, int flags);
|
|
|
|
struct netlink_dump_control {
|
|
int (*start)(struct netlink_callback *);
|
|
int (*dump)(struct sk_buff *skb, struct netlink_callback *);
|
|
int (*done)(struct netlink_callback *);
|
|
void *data;
|
|
struct module *module;
|
|
u16 min_dump_alloc;
|
|
};
|
|
|
|
extern int __netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
|
|
const struct nlmsghdr *nlh,
|
|
struct netlink_dump_control *control);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
|
|
const struct nlmsghdr *nlh,
|
|
struct netlink_dump_control *control)
|
|
{
|
|
if (!control->module)
|
|
control->module = (&__this_module);
|
|
|
|
return __netlink_dump_start(ssk, skb, nlh, control);
|
|
}
|
|
|
|
struct netlink_tap {
|
|
struct net_device *dev;
|
|
struct module *module;
|
|
struct list_head list;
|
|
};
|
|
|
|
extern int netlink_add_tap(struct netlink_tap *nt);
|
|
extern int netlink_remove_tap(struct netlink_tap *nt);
|
|
|
|
bool __netlink_ns_capable(const struct netlink_skb_parms *nsp,
|
|
struct user_namespace *ns, int cap);
|
|
bool netlink_ns_capable(const struct sk_buff *skb,
|
|
struct user_namespace *ns, int cap);
|
|
bool netlink_capable(const struct sk_buff *skb, int cap);
|
|
bool netlink_net_capable(const struct sk_buff *skb, int cap);
|
|
# 6 "./include/uapi/linux/neighbour.h" 2
|
|
|
|
struct ndmsg {
|
|
__u8 ndm_family;
|
|
__u8 ndm_pad1;
|
|
__u16 ndm_pad2;
|
|
__s32 ndm_ifindex;
|
|
__u16 ndm_state;
|
|
__u8 ndm_flags;
|
|
__u8 ndm_type;
|
|
};
|
|
|
|
enum {
|
|
NDA_UNSPEC,
|
|
NDA_DST,
|
|
NDA_LLADDR,
|
|
NDA_CACHEINFO,
|
|
NDA_PROBES,
|
|
NDA_VLAN,
|
|
NDA_PORT,
|
|
NDA_VNI,
|
|
NDA_IFINDEX,
|
|
NDA_MASTER,
|
|
NDA_LINK_NETNSID,
|
|
__NDA_MAX
|
|
};
|
|
# 66 "./include/uapi/linux/neighbour.h"
|
|
struct nda_cacheinfo {
|
|
__u32 ndm_confirmed;
|
|
__u32 ndm_used;
|
|
__u32 ndm_updated;
|
|
__u32 ndm_refcnt;
|
|
};
|
|
# 98 "./include/uapi/linux/neighbour.h"
|
|
struct ndt_stats {
|
|
__u64 ndts_allocs;
|
|
__u64 ndts_destroys;
|
|
__u64 ndts_hash_grows;
|
|
__u64 ndts_res_failed;
|
|
__u64 ndts_lookups;
|
|
__u64 ndts_hits;
|
|
__u64 ndts_rcv_probes_mcast;
|
|
__u64 ndts_rcv_probes_ucast;
|
|
__u64 ndts_periodic_gc_runs;
|
|
__u64 ndts_forced_gc_runs;
|
|
__u64 ndts_table_fulls;
|
|
};
|
|
|
|
enum {
|
|
NDTPA_UNSPEC,
|
|
NDTPA_IFINDEX,
|
|
NDTPA_REFCNT,
|
|
NDTPA_REACHABLE_TIME,
|
|
NDTPA_BASE_REACHABLE_TIME,
|
|
NDTPA_RETRANS_TIME,
|
|
NDTPA_GC_STALETIME,
|
|
NDTPA_DELAY_PROBE_TIME,
|
|
NDTPA_QUEUE_LEN,
|
|
NDTPA_APP_PROBES,
|
|
NDTPA_UCAST_PROBES,
|
|
NDTPA_MCAST_PROBES,
|
|
NDTPA_ANYCAST_DELAY,
|
|
NDTPA_PROXY_DELAY,
|
|
NDTPA_PROXY_QLEN,
|
|
NDTPA_LOCKTIME,
|
|
NDTPA_QUEUE_LENBYTES,
|
|
NDTPA_MCAST_REPROBES,
|
|
__NDTPA_MAX
|
|
};
|
|
|
|
|
|
struct ndtmsg {
|
|
__u8 ndtm_family;
|
|
__u8 ndtm_pad1;
|
|
__u16 ndtm_pad2;
|
|
};
|
|
|
|
struct ndt_config {
|
|
__u16 ndtc_key_len;
|
|
__u16 ndtc_entry_size;
|
|
__u32 ndtc_entries;
|
|
__u32 ndtc_last_flush;
|
|
__u32 ndtc_last_rand;
|
|
__u32 ndtc_hash_rnd;
|
|
__u32 ndtc_hash_mask;
|
|
__u32 ndtc_hash_chain_gc;
|
|
__u32 ndtc_proxy_qlen;
|
|
};
|
|
|
|
enum {
|
|
NDTA_UNSPEC,
|
|
NDTA_NAME,
|
|
NDTA_THRESH1,
|
|
NDTA_THRESH2,
|
|
NDTA_THRESH3,
|
|
NDTA_CONFIG,
|
|
NDTA_PARMS,
|
|
NDTA_STATS,
|
|
NDTA_GC_INTERVAL,
|
|
__NDTA_MAX
|
|
};
|
|
# 52 "include/linux/netdevice.h" 2
|
|
# 1 "include/uapi/linux/netdevice.h" 1
|
|
# 30 "include/uapi/linux/netdevice.h"
|
|
# 1 "./include/uapi/linux/if_packet.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
struct sockaddr_pkt {
|
|
unsigned short spkt_family;
|
|
unsigned char spkt_device[14];
|
|
__be16 spkt_protocol;
|
|
};
|
|
|
|
struct sockaddr_ll {
|
|
unsigned short sll_family;
|
|
__be16 sll_protocol;
|
|
int sll_ifindex;
|
|
unsigned short sll_hatype;
|
|
unsigned char sll_pkttype;
|
|
unsigned char sll_halen;
|
|
unsigned char sll_addr[8];
|
|
};
|
|
# 75 "./include/uapi/linux/if_packet.h"
|
|
struct tpacket_stats {
|
|
unsigned int tp_packets;
|
|
unsigned int tp_drops;
|
|
};
|
|
|
|
struct tpacket_stats_v3 {
|
|
unsigned int tp_packets;
|
|
unsigned int tp_drops;
|
|
unsigned int tp_freeze_q_cnt;
|
|
};
|
|
# 93 "./include/uapi/linux/if_packet.h"
|
|
struct tpacket_rollover_stats {
|
|
__u64 tp_all;
|
|
__u64 tp_huge;
|
|
__u64 tp_failed;
|
|
};
|
|
|
|
|
|
|
|
union tpacket_stats_u {
|
|
struct tpacket_stats stats1;
|
|
struct tpacket_stats_v3 stats3;
|
|
};
|
|
|
|
struct tpacket_auxdata {
|
|
__u32 tp_status;
|
|
__u32 tp_len;
|
|
__u32 tp_snaplen;
|
|
__u16 tp_mac;
|
|
__u16 tp_net;
|
|
__u16 tp_vlan_tci;
|
|
__u16 tp_vlan_tpid;
|
|
};
|
|
# 141 "./include/uapi/linux/if_packet.h"
|
|
struct tpacket_hdr {
|
|
unsigned long tp_status;
|
|
unsigned int tp_len;
|
|
unsigned int tp_snaplen;
|
|
unsigned short tp_mac;
|
|
unsigned short tp_net;
|
|
unsigned int tp_sec;
|
|
unsigned int tp_usec;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct tpacket2_hdr {
|
|
__u32 tp_status;
|
|
__u32 tp_len;
|
|
__u32 tp_snaplen;
|
|
__u16 tp_mac;
|
|
__u16 tp_net;
|
|
__u32 tp_sec;
|
|
__u32 tp_nsec;
|
|
__u16 tp_vlan_tci;
|
|
__u16 tp_vlan_tpid;
|
|
__u8 tp_padding[4];
|
|
};
|
|
|
|
struct tpacket_hdr_variant1 {
|
|
__u32 tp_rxhash;
|
|
__u32 tp_vlan_tci;
|
|
__u16 tp_vlan_tpid;
|
|
__u16 tp_padding;
|
|
};
|
|
|
|
struct tpacket3_hdr {
|
|
__u32 tp_next_offset;
|
|
__u32 tp_sec;
|
|
__u32 tp_nsec;
|
|
__u32 tp_snaplen;
|
|
__u32 tp_len;
|
|
__u32 tp_status;
|
|
__u16 tp_mac;
|
|
__u16 tp_net;
|
|
|
|
union {
|
|
struct tpacket_hdr_variant1 hv1;
|
|
};
|
|
__u8 tp_padding[8];
|
|
};
|
|
|
|
struct tpacket_bd_ts {
|
|
unsigned int ts_sec;
|
|
union {
|
|
unsigned int ts_usec;
|
|
unsigned int ts_nsec;
|
|
};
|
|
};
|
|
|
|
struct tpacket_hdr_v1 {
|
|
__u32 block_status;
|
|
__u32 num_pkts;
|
|
__u32 offset_to_first_pkt;
|
|
|
|
|
|
|
|
|
|
__u32 blk_len;
|
|
# 221 "./include/uapi/linux/if_packet.h"
|
|
__u64 seq_num;
|
|
# 249 "./include/uapi/linux/if_packet.h"
|
|
struct tpacket_bd_ts ts_first_pkt, ts_last_pkt;
|
|
};
|
|
|
|
union tpacket_bd_header_u {
|
|
struct tpacket_hdr_v1 bh1;
|
|
};
|
|
|
|
struct tpacket_block_desc {
|
|
__u32 version;
|
|
__u32 offset_to_priv;
|
|
union tpacket_bd_header_u hdr;
|
|
};
|
|
|
|
|
|
|
|
|
|
enum tpacket_versions {
|
|
TPACKET_V1,
|
|
TPACKET_V2,
|
|
TPACKET_V3
|
|
};
|
|
# 284 "./include/uapi/linux/if_packet.h"
|
|
struct tpacket_req {
|
|
unsigned int tp_block_size;
|
|
unsigned int tp_block_nr;
|
|
unsigned int tp_frame_size;
|
|
unsigned int tp_frame_nr;
|
|
};
|
|
|
|
struct tpacket_req3 {
|
|
unsigned int tp_block_size;
|
|
unsigned int tp_block_nr;
|
|
unsigned int tp_frame_size;
|
|
unsigned int tp_frame_nr;
|
|
unsigned int tp_retire_blk_tov;
|
|
unsigned int tp_sizeof_priv;
|
|
unsigned int tp_feature_req_word;
|
|
};
|
|
|
|
union tpacket_req_u {
|
|
struct tpacket_req req;
|
|
struct tpacket_req3 req3;
|
|
};
|
|
|
|
struct packet_mreq {
|
|
int mr_ifindex;
|
|
unsigned short mr_type;
|
|
unsigned short mr_alen;
|
|
unsigned char mr_address[8];
|
|
};
|
|
# 31 "include/uapi/linux/netdevice.h" 2
|
|
# 1 "include/linux/if_link.h" 1
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/if_link.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct rtnl_link_stats {
|
|
__u32 rx_packets;
|
|
__u32 tx_packets;
|
|
__u32 rx_bytes;
|
|
__u32 tx_bytes;
|
|
__u32 rx_errors;
|
|
__u32 tx_errors;
|
|
__u32 rx_dropped;
|
|
__u32 tx_dropped;
|
|
__u32 multicast;
|
|
__u32 collisions;
|
|
|
|
|
|
__u32 rx_length_errors;
|
|
__u32 rx_over_errors;
|
|
__u32 rx_crc_errors;
|
|
__u32 rx_frame_errors;
|
|
__u32 rx_fifo_errors;
|
|
__u32 rx_missed_errors;
|
|
|
|
|
|
__u32 tx_aborted_errors;
|
|
__u32 tx_carrier_errors;
|
|
__u32 tx_fifo_errors;
|
|
__u32 tx_heartbeat_errors;
|
|
__u32 tx_window_errors;
|
|
|
|
|
|
__u32 rx_compressed;
|
|
__u32 tx_compressed;
|
|
};
|
|
|
|
|
|
struct rtnl_link_stats64 {
|
|
__u64 rx_packets;
|
|
__u64 tx_packets;
|
|
__u64 rx_bytes;
|
|
__u64 tx_bytes;
|
|
__u64 rx_errors;
|
|
__u64 tx_errors;
|
|
__u64 rx_dropped;
|
|
__u64 tx_dropped;
|
|
__u64 multicast;
|
|
__u64 collisions;
|
|
|
|
|
|
__u64 rx_length_errors;
|
|
__u64 rx_over_errors;
|
|
__u64 rx_crc_errors;
|
|
__u64 rx_frame_errors;
|
|
__u64 rx_fifo_errors;
|
|
__u64 rx_missed_errors;
|
|
|
|
|
|
__u64 tx_aborted_errors;
|
|
__u64 tx_carrier_errors;
|
|
__u64 tx_fifo_errors;
|
|
__u64 tx_heartbeat_errors;
|
|
__u64 tx_window_errors;
|
|
|
|
|
|
__u64 rx_compressed;
|
|
__u64 tx_compressed;
|
|
};
|
|
|
|
|
|
struct rtnl_link_ifmap {
|
|
__u64 mem_start;
|
|
__u64 mem_end;
|
|
__u64 base_addr;
|
|
__u16 irq;
|
|
__u8 dma;
|
|
__u8 port;
|
|
};
|
|
# 101 "include/uapi/linux/if_link.h"
|
|
enum {
|
|
IFLA_UNSPEC,
|
|
IFLA_ADDRESS,
|
|
IFLA_BROADCAST,
|
|
IFLA_IFNAME,
|
|
IFLA_MTU,
|
|
IFLA_LINK,
|
|
IFLA_QDISC,
|
|
IFLA_STATS,
|
|
IFLA_COST,
|
|
|
|
IFLA_PRIORITY,
|
|
|
|
IFLA_MASTER,
|
|
|
|
IFLA_WIRELESS,
|
|
|
|
IFLA_PROTINFO,
|
|
|
|
IFLA_TXQLEN,
|
|
|
|
IFLA_MAP,
|
|
|
|
IFLA_WEIGHT,
|
|
|
|
IFLA_OPERSTATE,
|
|
IFLA_LINKMODE,
|
|
IFLA_LINKINFO,
|
|
|
|
IFLA_NET_NS_PID,
|
|
IFLA_IFALIAS,
|
|
IFLA_NUM_VF,
|
|
IFLA_VFINFO_LIST,
|
|
IFLA_STATS64,
|
|
IFLA_VF_PORTS,
|
|
IFLA_PORT_SELF,
|
|
IFLA_AF_SPEC,
|
|
IFLA_GROUP,
|
|
IFLA_NET_NS_FD,
|
|
IFLA_EXT_MASK,
|
|
IFLA_PROMISCUITY,
|
|
|
|
IFLA_NUM_TX_QUEUES,
|
|
IFLA_NUM_RX_QUEUES,
|
|
IFLA_CARRIER,
|
|
IFLA_PHYS_PORT_ID,
|
|
IFLA_CARRIER_CHANGES,
|
|
IFLA_PHYS_SWITCH_ID,
|
|
IFLA_LINK_NETNSID,
|
|
IFLA_PHYS_PORT_NAME,
|
|
IFLA_PROTO_DOWN,
|
|
__IFLA_MAX
|
|
};
|
|
# 164 "include/uapi/linux/if_link.h"
|
|
enum {
|
|
IFLA_INET_UNSPEC,
|
|
IFLA_INET_CONF,
|
|
__IFLA_INET_MAX,
|
|
};
|
|
# 202 "include/uapi/linux/if_link.h"
|
|
enum {
|
|
IFLA_INET6_UNSPEC,
|
|
IFLA_INET6_FLAGS,
|
|
IFLA_INET6_CONF,
|
|
IFLA_INET6_STATS,
|
|
IFLA_INET6_MCAST,
|
|
IFLA_INET6_CACHEINFO,
|
|
IFLA_INET6_ICMP6STATS,
|
|
IFLA_INET6_TOKEN,
|
|
IFLA_INET6_ADDR_GEN_MODE,
|
|
__IFLA_INET6_MAX
|
|
};
|
|
|
|
|
|
|
|
enum in6_addr_gen_mode {
|
|
IN6_ADDR_GEN_MODE_EUI64,
|
|
IN6_ADDR_GEN_MODE_NONE,
|
|
IN6_ADDR_GEN_MODE_STABLE_PRIVACY,
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
IFLA_BR_UNSPEC,
|
|
IFLA_BR_FORWARD_DELAY,
|
|
IFLA_BR_HELLO_TIME,
|
|
IFLA_BR_MAX_AGE,
|
|
IFLA_BR_AGEING_TIME,
|
|
IFLA_BR_STP_STATE,
|
|
IFLA_BR_PRIORITY,
|
|
IFLA_BR_VLAN_FILTERING,
|
|
IFLA_BR_VLAN_PROTOCOL,
|
|
IFLA_BR_GROUP_FWD_MASK,
|
|
IFLA_BR_ROOT_ID,
|
|
IFLA_BR_BRIDGE_ID,
|
|
IFLA_BR_ROOT_PORT,
|
|
IFLA_BR_ROOT_PATH_COST,
|
|
IFLA_BR_TOPOLOGY_CHANGE,
|
|
IFLA_BR_TOPOLOGY_CHANGE_DETECTED,
|
|
IFLA_BR_HELLO_TIMER,
|
|
IFLA_BR_TCN_TIMER,
|
|
IFLA_BR_TOPOLOGY_CHANGE_TIMER,
|
|
IFLA_BR_GC_TIMER,
|
|
IFLA_BR_GROUP_ADDR,
|
|
IFLA_BR_FDB_FLUSH,
|
|
IFLA_BR_MCAST_ROUTER,
|
|
IFLA_BR_MCAST_SNOOPING,
|
|
IFLA_BR_MCAST_QUERY_USE_IFADDR,
|
|
IFLA_BR_MCAST_QUERIER,
|
|
IFLA_BR_MCAST_HASH_ELASTICITY,
|
|
IFLA_BR_MCAST_HASH_MAX,
|
|
IFLA_BR_MCAST_LAST_MEMBER_CNT,
|
|
IFLA_BR_MCAST_STARTUP_QUERY_CNT,
|
|
IFLA_BR_MCAST_LAST_MEMBER_INTVL,
|
|
IFLA_BR_MCAST_MEMBERSHIP_INTVL,
|
|
IFLA_BR_MCAST_QUERIER_INTVL,
|
|
IFLA_BR_MCAST_QUERY_INTVL,
|
|
IFLA_BR_MCAST_QUERY_RESPONSE_INTVL,
|
|
IFLA_BR_MCAST_STARTUP_QUERY_INTVL,
|
|
IFLA_BR_NF_CALL_IPTABLES,
|
|
IFLA_BR_NF_CALL_IP6TABLES,
|
|
IFLA_BR_NF_CALL_ARPTABLES,
|
|
IFLA_BR_VLAN_DEFAULT_PVID,
|
|
__IFLA_BR_MAX,
|
|
};
|
|
|
|
|
|
|
|
struct ifla_bridge_id {
|
|
__u8 prio[2];
|
|
__u8 addr[6];
|
|
};
|
|
|
|
enum {
|
|
BRIDGE_MODE_UNSPEC,
|
|
BRIDGE_MODE_HAIRPIN,
|
|
};
|
|
|
|
enum {
|
|
IFLA_BRPORT_UNSPEC,
|
|
IFLA_BRPORT_STATE,
|
|
IFLA_BRPORT_PRIORITY,
|
|
IFLA_BRPORT_COST,
|
|
IFLA_BRPORT_MODE,
|
|
IFLA_BRPORT_GUARD,
|
|
IFLA_BRPORT_PROTECT,
|
|
IFLA_BRPORT_FAST_LEAVE,
|
|
IFLA_BRPORT_LEARNING,
|
|
IFLA_BRPORT_UNICAST_FLOOD,
|
|
IFLA_BRPORT_PROXYARP,
|
|
IFLA_BRPORT_LEARNING_SYNC,
|
|
IFLA_BRPORT_PROXYARP_WIFI,
|
|
IFLA_BRPORT_ROOT_ID,
|
|
IFLA_BRPORT_BRIDGE_ID,
|
|
IFLA_BRPORT_DESIGNATED_PORT,
|
|
IFLA_BRPORT_DESIGNATED_COST,
|
|
IFLA_BRPORT_ID,
|
|
IFLA_BRPORT_NO,
|
|
IFLA_BRPORT_TOPOLOGY_CHANGE_ACK,
|
|
IFLA_BRPORT_CONFIG_PENDING,
|
|
IFLA_BRPORT_MESSAGE_AGE_TIMER,
|
|
IFLA_BRPORT_FORWARD_DELAY_TIMER,
|
|
IFLA_BRPORT_HOLD_TIMER,
|
|
IFLA_BRPORT_FLUSH,
|
|
IFLA_BRPORT_MULTICAST_ROUTER,
|
|
__IFLA_BRPORT_MAX
|
|
};
|
|
|
|
|
|
struct ifla_cacheinfo {
|
|
__u32 max_reasm_len;
|
|
__u32 tstamp;
|
|
__u32 reachable_time;
|
|
__u32 retrans_time;
|
|
};
|
|
|
|
enum {
|
|
IFLA_INFO_UNSPEC,
|
|
IFLA_INFO_KIND,
|
|
IFLA_INFO_DATA,
|
|
IFLA_INFO_XSTATS,
|
|
IFLA_INFO_SLAVE_KIND,
|
|
IFLA_INFO_SLAVE_DATA,
|
|
__IFLA_INFO_MAX,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
IFLA_VLAN_UNSPEC,
|
|
IFLA_VLAN_ID,
|
|
IFLA_VLAN_FLAGS,
|
|
IFLA_VLAN_EGRESS_QOS,
|
|
IFLA_VLAN_INGRESS_QOS,
|
|
IFLA_VLAN_PROTOCOL,
|
|
__IFLA_VLAN_MAX,
|
|
};
|
|
|
|
|
|
|
|
struct ifla_vlan_flags {
|
|
__u32 flags;
|
|
__u32 mask;
|
|
};
|
|
|
|
enum {
|
|
IFLA_VLAN_QOS_UNSPEC,
|
|
IFLA_VLAN_QOS_MAPPING,
|
|
__IFLA_VLAN_QOS_MAX
|
|
};
|
|
|
|
|
|
|
|
struct ifla_vlan_qos_mapping {
|
|
__u32 from;
|
|
__u32 to;
|
|
};
|
|
|
|
|
|
enum {
|
|
IFLA_MACVLAN_UNSPEC,
|
|
IFLA_MACVLAN_MODE,
|
|
IFLA_MACVLAN_FLAGS,
|
|
IFLA_MACVLAN_MACADDR_MODE,
|
|
IFLA_MACVLAN_MACADDR,
|
|
IFLA_MACVLAN_MACADDR_DATA,
|
|
IFLA_MACVLAN_MACADDR_COUNT,
|
|
__IFLA_MACVLAN_MAX,
|
|
};
|
|
|
|
|
|
|
|
enum macvlan_mode {
|
|
MACVLAN_MODE_PRIVATE = 1,
|
|
MACVLAN_MODE_VEPA = 2,
|
|
MACVLAN_MODE_BRIDGE = 4,
|
|
MACVLAN_MODE_PASSTHRU = 8,
|
|
MACVLAN_MODE_SOURCE = 16,
|
|
};
|
|
|
|
enum macvlan_macaddr_mode {
|
|
MACVLAN_MACADDR_ADD,
|
|
MACVLAN_MACADDR_DEL,
|
|
MACVLAN_MACADDR_FLUSH,
|
|
MACVLAN_MACADDR_SET,
|
|
};
|
|
|
|
|
|
|
|
|
|
enum {
|
|
IFLA_VRF_UNSPEC,
|
|
IFLA_VRF_TABLE,
|
|
__IFLA_VRF_MAX
|
|
};
|
|
|
|
|
|
|
|
|
|
enum {
|
|
IFLA_IPVLAN_UNSPEC,
|
|
IFLA_IPVLAN_MODE,
|
|
__IFLA_IPVLAN_MAX
|
|
};
|
|
|
|
|
|
|
|
enum ipvlan_mode {
|
|
IPVLAN_MODE_L2 = 0,
|
|
IPVLAN_MODE_L3,
|
|
IPVLAN_MODE_MAX
|
|
};
|
|
|
|
|
|
enum {
|
|
IFLA_VXLAN_UNSPEC,
|
|
IFLA_VXLAN_ID,
|
|
IFLA_VXLAN_GROUP,
|
|
IFLA_VXLAN_LINK,
|
|
IFLA_VXLAN_LOCAL,
|
|
IFLA_VXLAN_TTL,
|
|
IFLA_VXLAN_TOS,
|
|
IFLA_VXLAN_LEARNING,
|
|
IFLA_VXLAN_AGEING,
|
|
IFLA_VXLAN_LIMIT,
|
|
IFLA_VXLAN_PORT_RANGE,
|
|
IFLA_VXLAN_PROXY,
|
|
IFLA_VXLAN_RSC,
|
|
IFLA_VXLAN_L2MISS,
|
|
IFLA_VXLAN_L3MISS,
|
|
IFLA_VXLAN_PORT,
|
|
IFLA_VXLAN_GROUP6,
|
|
IFLA_VXLAN_LOCAL6,
|
|
IFLA_VXLAN_UDP_CSUM,
|
|
IFLA_VXLAN_UDP_ZERO_CSUM6_TX,
|
|
IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
|
|
IFLA_VXLAN_REMCSUM_TX,
|
|
IFLA_VXLAN_REMCSUM_RX,
|
|
IFLA_VXLAN_GBP,
|
|
IFLA_VXLAN_REMCSUM_NOPARTIAL,
|
|
IFLA_VXLAN_COLLECT_METADATA,
|
|
__IFLA_VXLAN_MAX
|
|
};
|
|
|
|
|
|
struct ifla_vxlan_port_range {
|
|
__be16 low;
|
|
__be16 high;
|
|
};
|
|
|
|
|
|
enum {
|
|
IFLA_GENEVE_UNSPEC,
|
|
IFLA_GENEVE_ID,
|
|
IFLA_GENEVE_REMOTE,
|
|
IFLA_GENEVE_TTL,
|
|
IFLA_GENEVE_TOS,
|
|
IFLA_GENEVE_PORT,
|
|
IFLA_GENEVE_COLLECT_METADATA,
|
|
IFLA_GENEVE_REMOTE6,
|
|
__IFLA_GENEVE_MAX
|
|
};
|
|
|
|
|
|
|
|
|
|
enum {
|
|
IFLA_BOND_UNSPEC,
|
|
IFLA_BOND_MODE,
|
|
IFLA_BOND_ACTIVE_SLAVE,
|
|
IFLA_BOND_MIIMON,
|
|
IFLA_BOND_UPDELAY,
|
|
IFLA_BOND_DOWNDELAY,
|
|
IFLA_BOND_USE_CARRIER,
|
|
IFLA_BOND_ARP_INTERVAL,
|
|
IFLA_BOND_ARP_IP_TARGET,
|
|
IFLA_BOND_ARP_VALIDATE,
|
|
IFLA_BOND_ARP_ALL_TARGETS,
|
|
IFLA_BOND_PRIMARY,
|
|
IFLA_BOND_PRIMARY_RESELECT,
|
|
IFLA_BOND_FAIL_OVER_MAC,
|
|
IFLA_BOND_XMIT_HASH_POLICY,
|
|
IFLA_BOND_RESEND_IGMP,
|
|
IFLA_BOND_NUM_PEER_NOTIF,
|
|
IFLA_BOND_ALL_SLAVES_ACTIVE,
|
|
IFLA_BOND_MIN_LINKS,
|
|
IFLA_BOND_LP_INTERVAL,
|
|
IFLA_BOND_PACKETS_PER_SLAVE,
|
|
IFLA_BOND_AD_LACP_RATE,
|
|
IFLA_BOND_AD_SELECT,
|
|
IFLA_BOND_AD_INFO,
|
|
IFLA_BOND_AD_ACTOR_SYS_PRIO,
|
|
IFLA_BOND_AD_USER_PORT_KEY,
|
|
IFLA_BOND_AD_ACTOR_SYSTEM,
|
|
IFLA_BOND_TLB_DYNAMIC_LB,
|
|
__IFLA_BOND_MAX,
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
IFLA_BOND_AD_INFO_UNSPEC,
|
|
IFLA_BOND_AD_INFO_AGGREGATOR,
|
|
IFLA_BOND_AD_INFO_NUM_PORTS,
|
|
IFLA_BOND_AD_INFO_ACTOR_KEY,
|
|
IFLA_BOND_AD_INFO_PARTNER_KEY,
|
|
IFLA_BOND_AD_INFO_PARTNER_MAC,
|
|
__IFLA_BOND_AD_INFO_MAX,
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
IFLA_BOND_SLAVE_UNSPEC,
|
|
IFLA_BOND_SLAVE_STATE,
|
|
IFLA_BOND_SLAVE_MII_STATUS,
|
|
IFLA_BOND_SLAVE_LINK_FAILURE_COUNT,
|
|
IFLA_BOND_SLAVE_PERM_HWADDR,
|
|
IFLA_BOND_SLAVE_QUEUE_ID,
|
|
IFLA_BOND_SLAVE_AD_AGGREGATOR_ID,
|
|
IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE,
|
|
IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE,
|
|
__IFLA_BOND_SLAVE_MAX,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
IFLA_VF_INFO_UNSPEC,
|
|
IFLA_VF_INFO,
|
|
__IFLA_VF_INFO_MAX,
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
IFLA_VF_UNSPEC,
|
|
IFLA_VF_MAC,
|
|
IFLA_VF_VLAN,
|
|
IFLA_VF_TX_RATE,
|
|
IFLA_VF_SPOOFCHK,
|
|
IFLA_VF_LINK_STATE,
|
|
IFLA_VF_RATE,
|
|
IFLA_VF_RSS_QUERY_EN,
|
|
|
|
|
|
IFLA_VF_STATS,
|
|
IFLA_VF_TRUST,
|
|
__IFLA_VF_MAX,
|
|
};
|
|
|
|
|
|
|
|
struct ifla_vf_mac {
|
|
__u32 vf;
|
|
__u8 mac[32];
|
|
};
|
|
|
|
struct ifla_vf_vlan {
|
|
__u32 vf;
|
|
__u32 vlan;
|
|
__u32 qos;
|
|
};
|
|
|
|
struct ifla_vf_tx_rate {
|
|
__u32 vf;
|
|
__u32 rate;
|
|
};
|
|
|
|
struct ifla_vf_rate {
|
|
__u32 vf;
|
|
__u32 min_tx_rate;
|
|
__u32 max_tx_rate;
|
|
};
|
|
|
|
struct ifla_vf_spoofchk {
|
|
__u32 vf;
|
|
__u32 setting;
|
|
};
|
|
|
|
enum {
|
|
IFLA_VF_LINK_STATE_AUTO,
|
|
IFLA_VF_LINK_STATE_ENABLE,
|
|
IFLA_VF_LINK_STATE_DISABLE,
|
|
__IFLA_VF_LINK_STATE_MAX,
|
|
};
|
|
|
|
struct ifla_vf_link_state {
|
|
__u32 vf;
|
|
__u32 link_state;
|
|
};
|
|
|
|
struct ifla_vf_rss_query_en {
|
|
__u32 vf;
|
|
__u32 setting;
|
|
};
|
|
|
|
enum {
|
|
IFLA_VF_STATS_RX_PACKETS,
|
|
IFLA_VF_STATS_TX_PACKETS,
|
|
IFLA_VF_STATS_RX_BYTES,
|
|
IFLA_VF_STATS_TX_BYTES,
|
|
IFLA_VF_STATS_BROADCAST,
|
|
IFLA_VF_STATS_MULTICAST,
|
|
__IFLA_VF_STATS_MAX,
|
|
};
|
|
|
|
|
|
|
|
struct ifla_vf_trust {
|
|
__u32 vf;
|
|
__u32 setting;
|
|
};
|
|
# 636 "include/uapi/linux/if_link.h"
|
|
enum {
|
|
IFLA_VF_PORT_UNSPEC,
|
|
IFLA_VF_PORT,
|
|
__IFLA_VF_PORT_MAX,
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
IFLA_PORT_UNSPEC,
|
|
IFLA_PORT_VF,
|
|
IFLA_PORT_PROFILE,
|
|
IFLA_PORT_VSI_TYPE,
|
|
IFLA_PORT_INSTANCE_UUID,
|
|
IFLA_PORT_HOST_UUID,
|
|
IFLA_PORT_REQUEST,
|
|
IFLA_PORT_RESPONSE,
|
|
__IFLA_PORT_MAX,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
PORT_REQUEST_PREASSOCIATE = 0,
|
|
PORT_REQUEST_PREASSOCIATE_RR,
|
|
PORT_REQUEST_ASSOCIATE,
|
|
PORT_REQUEST_DISASSOCIATE,
|
|
};
|
|
|
|
enum {
|
|
PORT_VDP_RESPONSE_SUCCESS = 0,
|
|
PORT_VDP_RESPONSE_INVALID_FORMAT,
|
|
PORT_VDP_RESPONSE_INSUFFICIENT_RESOURCES,
|
|
PORT_VDP_RESPONSE_UNUSED_VTID,
|
|
PORT_VDP_RESPONSE_VTID_VIOLATION,
|
|
PORT_VDP_RESPONSE_VTID_VERSION_VIOALTION,
|
|
PORT_VDP_RESPONSE_OUT_OF_SYNC,
|
|
|
|
PORT_PROFILE_RESPONSE_SUCCESS = 0x100,
|
|
PORT_PROFILE_RESPONSE_INPROGRESS,
|
|
PORT_PROFILE_RESPONSE_INVALID,
|
|
PORT_PROFILE_RESPONSE_BADSTATE,
|
|
PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES,
|
|
PORT_PROFILE_RESPONSE_ERROR,
|
|
};
|
|
|
|
struct ifla_port_vsi {
|
|
__u8 vsi_mgr_id;
|
|
__u8 vsi_type_id[3];
|
|
__u8 vsi_type_version;
|
|
__u8 pad[3];
|
|
};
|
|
|
|
|
|
|
|
|
|
enum {
|
|
IFLA_IPOIB_UNSPEC,
|
|
IFLA_IPOIB_PKEY,
|
|
IFLA_IPOIB_MODE,
|
|
IFLA_IPOIB_UMCAST,
|
|
__IFLA_IPOIB_MAX
|
|
};
|
|
|
|
enum {
|
|
IPOIB_MODE_DATAGRAM = 0,
|
|
IPOIB_MODE_CONNECTED = 1,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
IFLA_HSR_UNSPEC,
|
|
IFLA_HSR_SLAVE1,
|
|
IFLA_HSR_SLAVE2,
|
|
IFLA_HSR_MULTICAST_SPEC,
|
|
IFLA_HSR_SUPERVISION_ADDR,
|
|
IFLA_HSR_SEQ_NR,
|
|
__IFLA_HSR_MAX,
|
|
};
|
|
# 5 "include/linux/if_link.h" 2
|
|
|
|
|
|
|
|
struct ifla_vf_stats {
|
|
__u64 rx_packets;
|
|
__u64 tx_packets;
|
|
__u64 rx_bytes;
|
|
__u64 tx_bytes;
|
|
__u64 broadcast;
|
|
__u64 multicast;
|
|
};
|
|
|
|
struct ifla_vf_info {
|
|
__u32 vf;
|
|
__u8 mac[32];
|
|
__u32 vlan;
|
|
__u32 qos;
|
|
__u32 spoofchk;
|
|
__u32 linkstate;
|
|
__u32 min_tx_rate;
|
|
__u32 max_tx_rate;
|
|
__u32 rss_query_en;
|
|
__u32 trusted;
|
|
};
|
|
# 32 "include/uapi/linux/netdevice.h" 2
|
|
# 48 "include/uapi/linux/netdevice.h"
|
|
enum {
|
|
IF_PORT_UNKNOWN = 0,
|
|
IF_PORT_10BASE2,
|
|
IF_PORT_10BASET,
|
|
IF_PORT_AUI,
|
|
IF_PORT_100BASET,
|
|
IF_PORT_100BASETX,
|
|
IF_PORT_100BASEFX
|
|
};
|
|
# 53 "include/linux/netdevice.h" 2
|
|
# 1 "include/uapi/linux/if_bonding.h" 1
|
|
# 97 "include/uapi/linux/if_bonding.h"
|
|
typedef struct ifbond {
|
|
__s32 bond_mode;
|
|
__s32 num_slaves;
|
|
__s32 miimon;
|
|
} ifbond;
|
|
|
|
typedef struct ifslave {
|
|
__s32 slave_id;
|
|
char slave_name[16];
|
|
__s8 link;
|
|
__s8 state;
|
|
__u32 link_failure_count;
|
|
} ifslave;
|
|
|
|
struct ad_info {
|
|
__u16 aggregator_id;
|
|
__u16 ports;
|
|
__u16 actor_key;
|
|
__u16 partner_key;
|
|
__u8 partner_system[6];
|
|
};
|
|
# 54 "include/linux/netdevice.h" 2
|
|
|
|
struct netpoll_info;
|
|
struct device;
|
|
struct phy_device;
|
|
|
|
struct wireless_dev;
|
|
|
|
struct wpan_dev;
|
|
struct mpls_dev;
|
|
|
|
void netdev_set_default_ethtool_ops(struct net_device *dev,
|
|
const struct ethtool_ops *ops);
|
|
# 104 "include/linux/netdevice.h"
|
|
enum netdev_tx {
|
|
__NETDEV_TX_MIN = (-((int)(~0U>>1)) - 1),
|
|
NETDEV_TX_OK = 0x00,
|
|
NETDEV_TX_BUSY = 0x10,
|
|
NETDEV_TX_LOCKED = 0x20,
|
|
};
|
|
typedef enum netdev_tx netdev_tx_t;
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dev_xmit_complete(int rc)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (__builtin_expect(!!(rc < 0x0f), 1))
|
|
return true;
|
|
|
|
return false;
|
|
}
|
|
# 157 "include/linux/netdevice.h"
|
|
struct net_device_stats {
|
|
unsigned long rx_packets;
|
|
unsigned long tx_packets;
|
|
unsigned long rx_bytes;
|
|
unsigned long tx_bytes;
|
|
unsigned long rx_errors;
|
|
unsigned long tx_errors;
|
|
unsigned long rx_dropped;
|
|
unsigned long tx_dropped;
|
|
unsigned long multicast;
|
|
unsigned long collisions;
|
|
unsigned long rx_length_errors;
|
|
unsigned long rx_over_errors;
|
|
unsigned long rx_crc_errors;
|
|
unsigned long rx_frame_errors;
|
|
unsigned long rx_fifo_errors;
|
|
unsigned long rx_missed_errors;
|
|
unsigned long tx_aborted_errors;
|
|
unsigned long tx_carrier_errors;
|
|
unsigned long tx_fifo_errors;
|
|
unsigned long tx_heartbeat_errors;
|
|
unsigned long tx_window_errors;
|
|
unsigned long rx_compressed;
|
|
unsigned long tx_compressed;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/linux/static_key.h" 1
|
|
# 189 "include/linux/netdevice.h" 2
|
|
extern struct static_key rps_needed;
|
|
|
|
|
|
struct neighbour;
|
|
struct neigh_parms;
|
|
struct sk_buff;
|
|
|
|
struct netdev_hw_addr {
|
|
struct list_head list;
|
|
unsigned char addr[32];
|
|
unsigned char type;
|
|
|
|
|
|
|
|
|
|
|
|
bool global_use;
|
|
int sync_cnt;
|
|
int refcount;
|
|
int synced;
|
|
struct callback_head callback_head;
|
|
};
|
|
|
|
struct netdev_hw_addr_list {
|
|
struct list_head list;
|
|
int count;
|
|
};
|
|
# 232 "include/linux/netdevice.h"
|
|
struct hh_cache {
|
|
u16 hh_len;
|
|
u16 __pad;
|
|
seqlock_t hh_lock;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long hh_data[(((96)+(16 -1))&~(16 - 1)) / sizeof(long)];
|
|
};
|
|
# 259 "include/linux/netdevice.h"
|
|
struct header_ops {
|
|
int (*create) (struct sk_buff *skb, struct net_device *dev,
|
|
unsigned short type, const void *daddr,
|
|
const void *saddr, unsigned int len);
|
|
int (*parse)(const struct sk_buff *skb, unsigned char *haddr);
|
|
int (*cache)(const struct neighbour *neigh, struct hh_cache *hh, __be16 type);
|
|
void (*cache_update)(struct hh_cache *hh,
|
|
const struct net_device *dev,
|
|
const unsigned char *haddr);
|
|
bool (*validate)(const char *ll_header, unsigned int len);
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum netdev_state_t {
|
|
__LINK_STATE_START,
|
|
__LINK_STATE_PRESENT,
|
|
__LINK_STATE_NOCARRIER,
|
|
__LINK_STATE_LINKWATCH_PENDING,
|
|
__LINK_STATE_DORMANT,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct netdev_boot_setup {
|
|
char name[16];
|
|
struct ifmap map;
|
|
};
|
|
|
|
|
|
int __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) netdev_boot_setup(char *str);
|
|
|
|
|
|
|
|
|
|
struct napi_struct {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct list_head poll_list;
|
|
|
|
unsigned long state;
|
|
int weight;
|
|
unsigned int gro_count;
|
|
int (*poll)(struct napi_struct *, int);
|
|
|
|
|
|
|
|
|
|
struct net_device *dev;
|
|
struct sk_buff *gro_list;
|
|
struct sk_buff *skb;
|
|
struct hrtimer timer;
|
|
struct list_head dev_list;
|
|
struct hlist_node napi_hash_node;
|
|
unsigned int napi_id;
|
|
};
|
|
|
|
enum {
|
|
NAPI_STATE_SCHED,
|
|
NAPI_STATE_DISABLE,
|
|
NAPI_STATE_NPSVC,
|
|
NAPI_STATE_HASHED,
|
|
};
|
|
|
|
enum gro_result {
|
|
GRO_MERGED,
|
|
GRO_MERGED_FREE,
|
|
GRO_HELD,
|
|
GRO_NORMAL,
|
|
GRO_DROP,
|
|
};
|
|
typedef enum gro_result gro_result_t;
|
|
# 383 "include/linux/netdevice.h"
|
|
enum rx_handler_result {
|
|
RX_HANDLER_CONSUMED,
|
|
RX_HANDLER_ANOTHER,
|
|
RX_HANDLER_EXACT,
|
|
RX_HANDLER_PASS,
|
|
};
|
|
typedef enum rx_handler_result rx_handler_result_t;
|
|
typedef rx_handler_result_t rx_handler_func_t(struct sk_buff **pskb);
|
|
|
|
void __napi_schedule(struct napi_struct *n);
|
|
void __napi_schedule_irqoff(struct napi_struct *n);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool napi_disable_pending(struct napi_struct *n)
|
|
{
|
|
return test_bit(NAPI_STATE_DISABLE, &n->state);
|
|
}
|
|
# 409 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool napi_schedule_prep(struct napi_struct *n)
|
|
{
|
|
return !napi_disable_pending(n) &&
|
|
!_test_and_set_bit(NAPI_STATE_SCHED,&n->state);
|
|
}
|
|
# 422 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void napi_schedule(struct napi_struct *n)
|
|
{
|
|
if (napi_schedule_prep(n))
|
|
__napi_schedule(n);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void napi_schedule_irqoff(struct napi_struct *n)
|
|
{
|
|
if (napi_schedule_prep(n))
|
|
__napi_schedule_irqoff(n);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool napi_reschedule(struct napi_struct *napi)
|
|
{
|
|
if (napi_schedule_prep(napi)) {
|
|
__napi_schedule(napi);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
void __napi_complete(struct napi_struct *n);
|
|
void napi_complete_done(struct napi_struct *n, int work_done);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void napi_complete(struct napi_struct *n)
|
|
{
|
|
return napi_complete_done(n, 0);
|
|
}
|
|
# 471 "include/linux/netdevice.h"
|
|
struct napi_struct *napi_by_id(unsigned int napi_id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void napi_hash_add(struct napi_struct *napi);
|
|
# 488 "include/linux/netdevice.h"
|
|
void napi_hash_del(struct napi_struct *napi);
|
|
# 497 "include/linux/netdevice.h"
|
|
void napi_disable(struct napi_struct *n);
|
|
# 506 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void napi_enable(struct napi_struct *n)
|
|
{
|
|
do { if (__builtin_expect(!!(!test_bit(NAPI_STATE_SCHED, &n->state)), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/netdevice.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "508" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
_clear_bit(NAPI_STATE_SCHED,&n->state);
|
|
_clear_bit(NAPI_STATE_NPSVC,&n->state);
|
|
}
|
|
# 522 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void napi_synchronize(const struct napi_struct *n)
|
|
{
|
|
if ((1 || 0))
|
|
while (test_bit(NAPI_STATE_SCHED, &n->state))
|
|
msleep(1);
|
|
else
|
|
__asm__ __volatile__("": : :"memory");
|
|
}
|
|
|
|
enum netdev_queue_state_t {
|
|
__QUEUE_STATE_DRV_XOFF,
|
|
__QUEUE_STATE_STACK_XOFF,
|
|
__QUEUE_STATE_FROZEN,
|
|
};
|
|
# 557 "include/linux/netdevice.h"
|
|
struct netdev_queue {
|
|
|
|
|
|
|
|
struct net_device *dev;
|
|
struct Qdisc *qdisc;
|
|
struct Qdisc *qdisc_sleeping;
|
|
|
|
struct kobject kobj;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spinlock_t _xmit_lock __attribute__((__aligned__((1 << 6))));
|
|
int xmit_lock_owner;
|
|
|
|
|
|
|
|
unsigned long trans_start;
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long trans_timeout;
|
|
|
|
unsigned long state;
|
|
|
|
|
|
struct dql dql;
|
|
|
|
unsigned long tx_maxrate;
|
|
} __attribute__((__aligned__((1 << 6))));
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int netdev_queue_numa_node_read(const struct netdev_queue *q)
|
|
{
|
|
|
|
|
|
|
|
return (-1);
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netdev_queue_numa_node_write(struct netdev_queue *q, int node)
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct rps_map {
|
|
unsigned int len;
|
|
struct callback_head rcu;
|
|
u16 cpus[0];
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct rps_dev_flow {
|
|
u16 cpu;
|
|
u16 filter;
|
|
unsigned int last_qtail;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct rps_dev_flow_table {
|
|
unsigned int mask;
|
|
struct callback_head rcu;
|
|
struct rps_dev_flow flows[0];
|
|
};
|
|
# 655 "include/linux/netdevice.h"
|
|
struct rps_sock_flow_table {
|
|
u32 mask;
|
|
|
|
u32 ents[0] __attribute__((__aligned__((1 << 6))));
|
|
};
|
|
|
|
|
|
|
|
|
|
extern u32 rps_cpu_mask;
|
|
extern struct rps_sock_flow_table *rps_sock_flow_table;
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void rps_record_sock_flow(struct rps_sock_flow_table *table,
|
|
u32 hash)
|
|
{
|
|
if (table && hash) {
|
|
unsigned int index = hash & table->mask;
|
|
u32 val = hash & ~rps_cpu_mask;
|
|
|
|
|
|
val |= (current_thread_info()->cpu);
|
|
|
|
if (table->ents[index] != val)
|
|
table->ents[index] = val;
|
|
}
|
|
}
|
|
|
|
|
|
bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id,
|
|
u16 filter_id);
|
|
|
|
|
|
|
|
|
|
struct netdev_rx_queue {
|
|
|
|
struct rps_map *rps_map;
|
|
struct rps_dev_flow_table *rps_flow_table;
|
|
|
|
struct kobject kobj;
|
|
struct net_device *dev;
|
|
} __attribute__((__aligned__((1 << 6))));
|
|
|
|
|
|
|
|
|
|
struct rx_queue_attribute {
|
|
struct attribute attr;
|
|
ssize_t (*show)(struct netdev_rx_queue *queue,
|
|
struct rx_queue_attribute *attr, char *buf);
|
|
ssize_t (*store)(struct netdev_rx_queue *queue,
|
|
struct rx_queue_attribute *attr, const char *buf, size_t len);
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct xps_map {
|
|
unsigned int len;
|
|
unsigned int alloc_len;
|
|
struct callback_head rcu;
|
|
u16 queues[0];
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct xps_dev_maps {
|
|
struct callback_head rcu;
|
|
struct xps_map *cpu_map[0];
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct netdev_tc_txq {
|
|
u16 count;
|
|
u16 offset;
|
|
};
|
|
# 765 "include/linux/netdevice.h"
|
|
struct netdev_phys_item_id {
|
|
unsigned char id[32];
|
|
unsigned char id_len;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netdev_phys_item_id_same(struct netdev_phys_item_id *a,
|
|
struct netdev_phys_item_id *b)
|
|
{
|
|
return a->id_len == b->id_len &&
|
|
memcmp(a->id, b->id, a->id_len) == 0;
|
|
}
|
|
|
|
typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
|
|
struct sk_buff *skb);
|
|
# 1064 "include/linux/netdevice.h"
|
|
struct net_device_ops {
|
|
int (*ndo_init)(struct net_device *dev);
|
|
void (*ndo_uninit)(struct net_device *dev);
|
|
int (*ndo_open)(struct net_device *dev);
|
|
int (*ndo_stop)(struct net_device *dev);
|
|
netdev_tx_t (*ndo_start_xmit) (struct sk_buff *skb,
|
|
struct net_device *dev);
|
|
u16 (*ndo_select_queue)(struct net_device *dev,
|
|
struct sk_buff *skb,
|
|
void *accel_priv,
|
|
select_queue_fallback_t fallback);
|
|
void (*ndo_change_rx_flags)(struct net_device *dev,
|
|
int flags);
|
|
void (*ndo_set_rx_mode)(struct net_device *dev);
|
|
int (*ndo_set_mac_address)(struct net_device *dev,
|
|
void *addr);
|
|
int (*ndo_validate_addr)(struct net_device *dev);
|
|
int (*ndo_do_ioctl)(struct net_device *dev,
|
|
struct ifreq *ifr, int cmd);
|
|
int (*ndo_set_config)(struct net_device *dev,
|
|
struct ifmap *map);
|
|
int (*ndo_change_mtu)(struct net_device *dev,
|
|
int new_mtu);
|
|
int (*ndo_neigh_setup)(struct net_device *dev,
|
|
struct neigh_parms *);
|
|
void (*ndo_tx_timeout) (struct net_device *dev);
|
|
|
|
struct rtnl_link_stats64* (*ndo_get_stats64)(struct net_device *dev,
|
|
struct rtnl_link_stats64 *storage);
|
|
struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
|
|
|
|
int (*ndo_vlan_rx_add_vid)(struct net_device *dev,
|
|
__be16 proto, u16 vid);
|
|
int (*ndo_vlan_rx_kill_vid)(struct net_device *dev,
|
|
__be16 proto, u16 vid);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int (*ndo_busy_poll)(struct napi_struct *dev);
|
|
|
|
int (*ndo_set_vf_mac)(struct net_device *dev,
|
|
int queue, u8 *mac);
|
|
int (*ndo_set_vf_vlan)(struct net_device *dev,
|
|
int queue, u16 vlan, u8 qos);
|
|
int (*ndo_set_vf_rate)(struct net_device *dev,
|
|
int vf, int min_tx_rate,
|
|
int max_tx_rate);
|
|
int (*ndo_set_vf_spoofchk)(struct net_device *dev,
|
|
int vf, bool setting);
|
|
int (*ndo_set_vf_trust)(struct net_device *dev,
|
|
int vf, bool setting);
|
|
int (*ndo_get_vf_config)(struct net_device *dev,
|
|
int vf,
|
|
struct ifla_vf_info *ivf);
|
|
int (*ndo_set_vf_link_state)(struct net_device *dev,
|
|
int vf, int link_state);
|
|
int (*ndo_get_vf_stats)(struct net_device *dev,
|
|
int vf,
|
|
struct ifla_vf_stats
|
|
*vf_stats);
|
|
int (*ndo_set_vf_port)(struct net_device *dev,
|
|
int vf,
|
|
struct nlattr *port[]);
|
|
int (*ndo_get_vf_port)(struct net_device *dev,
|
|
int vf, struct sk_buff *skb);
|
|
int (*ndo_set_vf_rss_query_en)(
|
|
struct net_device *dev,
|
|
int vf, bool setting);
|
|
int (*ndo_setup_tc)(struct net_device *dev, u8 tc);
|
|
# 1162 "include/linux/netdevice.h"
|
|
int (*ndo_rx_flow_steer)(struct net_device *dev,
|
|
const struct sk_buff *skb,
|
|
u16 rxq_index,
|
|
u32 flow_id);
|
|
|
|
int (*ndo_add_slave)(struct net_device *dev,
|
|
struct net_device *slave_dev);
|
|
int (*ndo_del_slave)(struct net_device *dev,
|
|
struct net_device *slave_dev);
|
|
netdev_features_t (*ndo_fix_features)(struct net_device *dev,
|
|
netdev_features_t features);
|
|
int (*ndo_set_features)(struct net_device *dev,
|
|
netdev_features_t features);
|
|
int (*ndo_neigh_construct)(struct neighbour *n);
|
|
void (*ndo_neigh_destroy)(struct neighbour *n);
|
|
|
|
int (*ndo_fdb_add)(struct ndmsg *ndm,
|
|
struct nlattr *tb[],
|
|
struct net_device *dev,
|
|
const unsigned char *addr,
|
|
u16 vid,
|
|
u16 flags);
|
|
int (*ndo_fdb_del)(struct ndmsg *ndm,
|
|
struct nlattr *tb[],
|
|
struct net_device *dev,
|
|
const unsigned char *addr,
|
|
u16 vid);
|
|
int (*ndo_fdb_dump)(struct sk_buff *skb,
|
|
struct netlink_callback *cb,
|
|
struct net_device *dev,
|
|
struct net_device *filter_dev,
|
|
int idx);
|
|
|
|
int (*ndo_bridge_setlink)(struct net_device *dev,
|
|
struct nlmsghdr *nlh,
|
|
u16 flags);
|
|
int (*ndo_bridge_getlink)(struct sk_buff *skb,
|
|
u32 pid, u32 seq,
|
|
struct net_device *dev,
|
|
u32 filter_mask,
|
|
int nlflags);
|
|
int (*ndo_bridge_dellink)(struct net_device *dev,
|
|
struct nlmsghdr *nlh,
|
|
u16 flags);
|
|
int (*ndo_change_carrier)(struct net_device *dev,
|
|
bool new_carrier);
|
|
int (*ndo_get_phys_port_id)(struct net_device *dev,
|
|
struct netdev_phys_item_id *ppid);
|
|
int (*ndo_get_phys_port_name)(struct net_device *dev,
|
|
char *name, size_t len);
|
|
void (*ndo_add_vxlan_port)(struct net_device *dev,
|
|
sa_family_t sa_family,
|
|
__be16 port);
|
|
void (*ndo_del_vxlan_port)(struct net_device *dev,
|
|
sa_family_t sa_family,
|
|
__be16 port);
|
|
|
|
void* (*ndo_dfwd_add_station)(struct net_device *pdev,
|
|
struct net_device *dev);
|
|
void (*ndo_dfwd_del_station)(struct net_device *pdev,
|
|
void *priv);
|
|
|
|
netdev_tx_t (*ndo_dfwd_start_xmit) (struct sk_buff *skb,
|
|
struct net_device *dev,
|
|
void *priv);
|
|
int (*ndo_get_lock_subclass)(struct net_device *dev);
|
|
netdev_features_t (*ndo_features_check) (struct sk_buff *skb,
|
|
struct net_device *dev,
|
|
netdev_features_t features);
|
|
int (*ndo_set_tx_maxrate)(struct net_device *dev,
|
|
int queue_index,
|
|
u32 maxrate);
|
|
int (*ndo_get_iflink)(const struct net_device *dev);
|
|
int (*ndo_change_proto_down)(struct net_device *dev,
|
|
bool proto_down);
|
|
int (*ndo_fill_metadata_dst)(struct net_device *dev,
|
|
struct sk_buff *skb);
|
|
};
|
|
# 1275 "include/linux/netdevice.h"
|
|
enum netdev_priv_flags {
|
|
IFF_802_1Q_VLAN = 1<<0,
|
|
IFF_EBRIDGE = 1<<1,
|
|
IFF_BONDING = 1<<2,
|
|
IFF_ISATAP = 1<<3,
|
|
IFF_WAN_HDLC = 1<<4,
|
|
IFF_XMIT_DST_RELEASE = 1<<5,
|
|
IFF_DONT_BRIDGE = 1<<6,
|
|
IFF_DISABLE_NETPOLL = 1<<7,
|
|
IFF_MACVLAN_PORT = 1<<8,
|
|
IFF_BRIDGE_PORT = 1<<9,
|
|
IFF_OVS_DATAPATH = 1<<10,
|
|
IFF_TX_SKB_SHARING = 1<<11,
|
|
IFF_UNICAST_FLT = 1<<12,
|
|
IFF_TEAM_PORT = 1<<13,
|
|
IFF_SUPP_NOFCS = 1<<14,
|
|
IFF_LIVE_ADDR_CHANGE = 1<<15,
|
|
IFF_MACVLAN = 1<<16,
|
|
IFF_XMIT_DST_RELEASE_PERM = 1<<17,
|
|
IFF_IPVLAN_MASTER = 1<<18,
|
|
IFF_IPVLAN_SLAVE = 1<<19,
|
|
IFF_L3MDEV_MASTER = 1<<20,
|
|
IFF_NO_QUEUE = 1<<21,
|
|
IFF_OPENVSWITCH = 1<<22,
|
|
IFF_L3MDEV_SLAVE = 1<<23,
|
|
IFF_RSMUX = 1<<24,
|
|
IFF_OSMUX = 1<<25,
|
|
};
|
|
# 1541 "include/linux/netdevice.h"
|
|
struct net_device {
|
|
char name[16];
|
|
struct hlist_node name_hlist;
|
|
char *ifalias;
|
|
|
|
|
|
|
|
|
|
unsigned long mem_end;
|
|
unsigned long mem_start;
|
|
unsigned long base_addr;
|
|
int irq;
|
|
|
|
atomic_t carrier_changes;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long state;
|
|
|
|
struct list_head dev_list;
|
|
struct list_head napi_list;
|
|
struct list_head unreg_list;
|
|
struct list_head close_list;
|
|
struct list_head ptype_all;
|
|
struct list_head ptype_specific;
|
|
|
|
struct {
|
|
struct list_head upper;
|
|
struct list_head lower;
|
|
} adj_list;
|
|
|
|
struct {
|
|
struct list_head upper;
|
|
struct list_head lower;
|
|
} all_adj_list;
|
|
|
|
netdev_features_t features;
|
|
netdev_features_t hw_features;
|
|
netdev_features_t wanted_features;
|
|
netdev_features_t vlan_features;
|
|
netdev_features_t hw_enc_features;
|
|
netdev_features_t mpls_features;
|
|
|
|
int ifindex;
|
|
int group;
|
|
|
|
struct net_device_stats stats;
|
|
|
|
atomic_long_t rx_dropped;
|
|
atomic_long_t tx_dropped;
|
|
|
|
|
|
const struct iw_handler_def * wireless_handlers;
|
|
struct iw_public_data * wireless_data;
|
|
|
|
const struct net_device_ops *netdev_ops;
|
|
const struct ethtool_ops *ethtool_ops;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const struct header_ops *header_ops;
|
|
|
|
unsigned int flags;
|
|
unsigned int priv_flags;
|
|
|
|
unsigned short gflags;
|
|
unsigned short padded;
|
|
|
|
unsigned char operstate;
|
|
unsigned char link_mode;
|
|
|
|
unsigned char if_port;
|
|
unsigned char dma;
|
|
|
|
unsigned int mtu;
|
|
unsigned short type;
|
|
unsigned short hard_header_len;
|
|
unsigned short min_header_len;
|
|
|
|
unsigned short needed_headroom;
|
|
unsigned short needed_tailroom;
|
|
|
|
|
|
unsigned char perm_addr[32];
|
|
unsigned char addr_assign_type;
|
|
unsigned char addr_len;
|
|
unsigned short neigh_priv_len;
|
|
unsigned short dev_id;
|
|
unsigned short dev_port;
|
|
spinlock_t addr_list_lock;
|
|
unsigned char name_assign_type;
|
|
bool uc_promisc;
|
|
struct netdev_hw_addr_list uc;
|
|
struct netdev_hw_addr_list mc;
|
|
struct netdev_hw_addr_list dev_addrs;
|
|
|
|
|
|
struct kset *queues_kset;
|
|
|
|
unsigned int promiscuity;
|
|
unsigned int allmulti;
|
|
|
|
|
|
|
|
|
|
|
|
struct vlan_info *vlan_info;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void *atalk_ptr;
|
|
struct in_device *ip_ptr;
|
|
struct dn_dev *dn_ptr;
|
|
struct inet6_dev *ip6_ptr;
|
|
void *ax25_ptr;
|
|
struct wireless_dev *ieee80211_ptr;
|
|
struct wpan_dev *ieee802154_ptr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long last_rx;
|
|
|
|
|
|
unsigned char *dev_addr;
|
|
|
|
|
|
|
|
struct netdev_rx_queue *_rx;
|
|
|
|
unsigned int num_rx_queues;
|
|
unsigned int real_num_rx_queues;
|
|
|
|
|
|
|
|
unsigned long gro_flush_timeout;
|
|
rx_handler_func_t *rx_handler;
|
|
void *rx_handler_data;
|
|
|
|
|
|
|
|
|
|
struct netdev_queue *ingress_queue;
|
|
|
|
|
|
|
|
|
|
unsigned char broadcast[32];
|
|
|
|
struct cpu_rmap *rx_cpu_rmap;
|
|
|
|
struct hlist_node index_hlist;
|
|
|
|
|
|
|
|
|
|
struct netdev_queue *_tx __attribute__((__aligned__((1 << 6))));
|
|
unsigned int num_tx_queues;
|
|
unsigned int real_num_tx_queues;
|
|
struct Qdisc *qdisc;
|
|
unsigned long tx_queue_len;
|
|
spinlock_t tx_global_lock;
|
|
int watchdog_timeo;
|
|
|
|
|
|
struct xps_dev_maps *xps_maps;
|
|
# 1734 "include/linux/netdevice.h"
|
|
unsigned long trans_start;
|
|
|
|
struct timer_list watchdog_timer;
|
|
|
|
int *pcpu_refcnt;
|
|
struct list_head todo_list;
|
|
|
|
struct list_head link_watch_list;
|
|
|
|
enum { NETREG_UNINITIALIZED=0,
|
|
NETREG_REGISTERED,
|
|
NETREG_UNREGISTERING,
|
|
NETREG_UNREGISTERED,
|
|
NETREG_RELEASED,
|
|
NETREG_DUMMY,
|
|
} reg_state:8;
|
|
|
|
bool dismantle;
|
|
|
|
enum {
|
|
RTNL_LINK_INITIALIZED,
|
|
RTNL_LINK_INITIALIZING,
|
|
} rtnl_link_state:16;
|
|
|
|
void (*destructor)(struct net_device *dev);
|
|
|
|
|
|
|
|
|
|
|
|
possible_net_t nd_net;
|
|
|
|
|
|
union {
|
|
void *ml_priv;
|
|
struct pcpu_lstats *lstats;
|
|
struct pcpu_sw_netstats *tstats;
|
|
struct pcpu_dstats *dstats;
|
|
struct pcpu_vstats *vstats;
|
|
};
|
|
|
|
struct garp_port *garp_port;
|
|
struct mrp_port *mrp_port;
|
|
|
|
struct device dev;
|
|
const struct attribute_group *sysfs_groups[4];
|
|
const struct attribute_group *sysfs_rx_queue_group;
|
|
|
|
const struct rtnl_link_ops *rtnl_link_ops;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int gso_max_size;
|
|
|
|
u16 gso_max_segs;
|
|
u16 gso_min_segs;
|
|
|
|
|
|
|
|
u8 num_tc;
|
|
struct netdev_tc_txq tc_to_txq[16];
|
|
u8 prio_tc_map[15 + 1];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct phy_device *phydev;
|
|
struct lock_class_key *qdisc_tx_busylock;
|
|
bool proto_down;
|
|
u8 vlan_mode;
|
|
u16 tci;
|
|
u16 multicast_tci;
|
|
u8 ipversion;
|
|
struct list_head ext_mvlan_list;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
u32 bind_group[2];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int bind_index;
|
|
# 1840 "include/linux/netdevice.h"
|
|
u8 bind_type;
|
|
# 1854 "include/linux/netdevice.h"
|
|
int ppp_flags;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
int netdev_get_prio_tc_map(const struct net_device *dev, u32 prio)
|
|
{
|
|
return dev->prio_tc_map[prio & 15];
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
int netdev_set_prio_tc_map(struct net_device *dev, u8 prio, u8 tc)
|
|
{
|
|
if (tc >= dev->num_tc)
|
|
return -22;
|
|
|
|
dev->prio_tc_map[prio & 15] = tc & 15;
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
void netdev_reset_tc(struct net_device *dev)
|
|
{
|
|
dev->num_tc = 0;
|
|
({ void *__p = (dev->tc_to_txq); size_t __n = sizeof(dev->tc_to_txq); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); });
|
|
({ void *__p = (dev->prio_tc_map); size_t __n = sizeof(dev->prio_tc_map); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
int netdev_set_tc_queue(struct net_device *dev, u8 tc, u16 count, u16 offset)
|
|
{
|
|
if (tc >= dev->num_tc)
|
|
return -22;
|
|
|
|
dev->tc_to_txq[tc].count = count;
|
|
dev->tc_to_txq[tc].offset = offset;
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
int netdev_set_num_tc(struct net_device *dev, u8 num_tc)
|
|
{
|
|
if (num_tc > 16)
|
|
return -22;
|
|
|
|
dev->num_tc = num_tc;
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
int netdev_get_num_tc(struct net_device *dev)
|
|
{
|
|
return dev->num_tc;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
struct netdev_queue *netdev_get_tx_queue(const struct net_device *dev,
|
|
unsigned int index)
|
|
{
|
|
return &dev->_tx[index];
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct netdev_queue *skb_get_tx_queue(const struct net_device *dev,
|
|
const struct sk_buff *skb)
|
|
{
|
|
return netdev_get_tx_queue(dev, skb_get_queue_mapping(skb));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netdev_for_each_tx_queue(struct net_device *dev,
|
|
void (*f)(struct net_device *,
|
|
struct netdev_queue *,
|
|
void *),
|
|
void *arg)
|
|
{
|
|
unsigned int i;
|
|
|
|
for (i = 0; i < dev->num_tx_queues; i++)
|
|
f(dev, &dev->_tx[i], arg);
|
|
}
|
|
|
|
struct netdev_queue *netdev_pick_tx(struct net_device *dev,
|
|
struct sk_buff *skb,
|
|
void *accel_priv);
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
struct net *dev_net(const struct net_device *dev)
|
|
{
|
|
return read_pnet(&dev->nd_net);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
void dev_net_set(struct net_device *dev, struct net *net)
|
|
{
|
|
write_pnet(&dev->nd_net, net);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netdev_uses_dsa(struct net_device *dev)
|
|
{
|
|
|
|
|
|
|
|
|
|
return false;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *netdev_priv(const struct net_device *dev)
|
|
{
|
|
return (char *)dev + ((((sizeof(struct net_device))) + ((typeof((sizeof(struct net_device))))((32)) - 1)) & ~((typeof((sizeof(struct net_device))))((32)) - 1));
|
|
}
|
|
# 2002 "include/linux/netdevice.h"
|
|
void netif_napi_add(struct net_device *dev, struct napi_struct *napi,
|
|
int (*poll)(struct napi_struct *, int), int weight);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void netif_napi_del(struct napi_struct *napi);
|
|
|
|
struct napi_gro_cb {
|
|
|
|
void *frag0;
|
|
|
|
|
|
unsigned int frag0_len;
|
|
|
|
|
|
int data_offset;
|
|
|
|
|
|
u16 flush;
|
|
|
|
|
|
u16 flush_id;
|
|
|
|
|
|
u16 count;
|
|
|
|
|
|
u16 gro_remcsum_start;
|
|
|
|
|
|
unsigned long age;
|
|
|
|
|
|
u16 proto;
|
|
|
|
|
|
u8 same_flow:1;
|
|
|
|
|
|
u8 encap_mark:1;
|
|
|
|
|
|
u8 csum_valid:1;
|
|
|
|
|
|
u8 csum_cnt:3;
|
|
|
|
|
|
u8 free:2;
|
|
|
|
|
|
|
|
|
|
u8 is_ipv6:1;
|
|
|
|
|
|
u8 recursion_counter:4;
|
|
|
|
|
|
|
|
|
|
__wsum csum;
|
|
|
|
|
|
struct sk_buff *last;
|
|
};
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int gro_recursion_inc_test(struct sk_buff *skb)
|
|
{
|
|
return ++((struct napi_gro_cb *)(skb)->cb)->recursion_counter == 15;
|
|
}
|
|
|
|
typedef struct sk_buff **(*gro_receive_t)(struct sk_buff **, struct sk_buff *);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff **call_gro_receive(gro_receive_t cb,
|
|
struct sk_buff **head,
|
|
struct sk_buff *skb)
|
|
{
|
|
if (__builtin_expect(!!(gro_recursion_inc_test(skb)), 0)) {
|
|
((struct napi_gro_cb *)(skb)->cb)->flush |= 1;
|
|
return ((void *)0);
|
|
}
|
|
|
|
return cb(head, skb);
|
|
}
|
|
|
|
struct packet_type {
|
|
__be16 type;
|
|
struct net_device *dev;
|
|
int (*func) (struct sk_buff *,
|
|
struct net_device *,
|
|
struct packet_type *,
|
|
struct net_device *);
|
|
bool (*id_match)(struct packet_type *ptype,
|
|
struct sock *sk);
|
|
void *af_packet_priv;
|
|
struct list_head list;
|
|
};
|
|
|
|
struct offload_callbacks {
|
|
struct sk_buff *(*gso_segment)(struct sk_buff *skb,
|
|
netdev_features_t features);
|
|
struct sk_buff **(*gro_receive)(struct sk_buff **head,
|
|
struct sk_buff *skb);
|
|
int (*gro_complete)(struct sk_buff *skb, int nhoff);
|
|
};
|
|
|
|
struct packet_offload {
|
|
__be16 type;
|
|
u16 priority;
|
|
struct offload_callbacks callbacks;
|
|
struct list_head list;
|
|
};
|
|
|
|
struct udp_offload;
|
|
|
|
struct udp_offload_callbacks {
|
|
struct sk_buff **(*gro_receive)(struct sk_buff **head,
|
|
struct sk_buff *skb,
|
|
struct udp_offload *uoff);
|
|
int (*gro_complete)(struct sk_buff *skb,
|
|
int nhoff,
|
|
struct udp_offload *uoff);
|
|
};
|
|
|
|
struct udp_offload {
|
|
__be16 port;
|
|
u8 ipproto;
|
|
struct udp_offload_callbacks callbacks;
|
|
};
|
|
|
|
typedef struct sk_buff **(*gro_receive_udp_t)(struct sk_buff **,
|
|
struct sk_buff *,
|
|
struct udp_offload *);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff **call_gro_receive_udp(gro_receive_udp_t cb,
|
|
struct sk_buff **head,
|
|
struct sk_buff *skb,
|
|
struct udp_offload *uoff)
|
|
{
|
|
if (__builtin_expect(!!(gro_recursion_inc_test(skb)), 0)) {
|
|
((struct napi_gro_cb *)(skb)->cb)->flush |= 1;
|
|
return ((void *)0);
|
|
}
|
|
|
|
return cb(head, skb, uoff);
|
|
}
|
|
|
|
|
|
struct pcpu_sw_netstats {
|
|
u64 rx_packets;
|
|
u64 rx_bytes;
|
|
u64 tx_packets;
|
|
u64 tx_bytes;
|
|
struct u64_stats_sync syncp;
|
|
};
|
|
# 2222 "include/linux/netdevice.h"
|
|
int register_netdevice_notifier(struct notifier_block *nb);
|
|
int unregister_netdevice_notifier(struct notifier_block *nb);
|
|
|
|
struct netdev_notifier_info {
|
|
struct net_device *dev;
|
|
};
|
|
|
|
struct netdev_notifier_change_info {
|
|
struct netdev_notifier_info info;
|
|
unsigned int flags_changed;
|
|
};
|
|
|
|
struct netdev_notifier_changeupper_info {
|
|
struct netdev_notifier_info info;
|
|
struct net_device *upper_dev;
|
|
bool master;
|
|
bool linking;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netdev_notifier_info_init(struct netdev_notifier_info *info,
|
|
struct net_device *dev)
|
|
{
|
|
info->dev = dev;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct net_device *
|
|
netdev_notifier_info_to_dev(const struct netdev_notifier_info *info)
|
|
{
|
|
return info->dev;
|
|
}
|
|
|
|
int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
|
|
|
|
|
|
extern rwlock_t dev_base_lock;
|
|
# 2275 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct net_device *next_net_device(struct net_device *dev)
|
|
{
|
|
struct list_head *lh;
|
|
struct net *net;
|
|
|
|
net = dev_net(dev);
|
|
lh = dev->dev_list.next;
|
|
return lh == &net->dev_base_head ? ((void *)0) : ({ const typeof( ((struct net_device *)0)->dev_list ) *__mptr = (lh); (struct net_device *)( (char *)__mptr - __builtin_offsetof(struct net_device, dev_list) );});
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct net_device *next_net_device_rcu(struct net_device *dev)
|
|
{
|
|
struct list_head *lh;
|
|
struct net *net;
|
|
|
|
net = dev_net(dev);
|
|
lh = ({ typeof(*((*((struct list_head **)(&(&dev->dev_list)->next))))) *________p1 = (typeof(*((*((struct list_head **)(&(&dev->dev_list)->next))))) *)({ typeof(((*((struct list_head **)(&(&dev->dev_list)->next))))) _________p1 = ({ union { typeof(((*((struct list_head **)(&(&dev->dev_list)->next))))) __val; char __c[1]; } __u; if (1) __read_once_size(&(((*((struct list_head **)(&(&dev->dev_list)->next))))), __u.__c, sizeof(((*((struct list_head **)(&(&dev->dev_list)->next)))))); else __read_once_size_nocheck(&(((*((struct list_head **)(&(&dev->dev_list)->next))))), __u.__c, sizeof(((*((struct list_head **)(&(&dev->dev_list)->next)))))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*((*((struct list_head **)(&(&dev->dev_list)->next))))) *)(________p1)); });
|
|
return lh == &net->dev_base_head ? ((void *)0) : ({ const typeof( ((struct net_device *)0)->dev_list ) *__mptr = (lh); (struct net_device *)( (char *)__mptr - __builtin_offsetof(struct net_device, dev_list) );});
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct net_device *first_net_device(struct net *net)
|
|
{
|
|
return list_empty(&net->dev_base_head) ? ((void *)0) :
|
|
({ const typeof( ((struct net_device *)0)->dev_list ) *__mptr = (net->dev_base_head.next); (struct net_device *)( (char *)__mptr - __builtin_offsetof(struct net_device, dev_list) );});
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct net_device *first_net_device_rcu(struct net *net)
|
|
{
|
|
struct list_head *lh = ({ typeof(*((*((struct list_head **)(&(&net->dev_base_head)->next))))) *________p1 = (typeof(*((*((struct list_head **)(&(&net->dev_base_head)->next))))) *)({ typeof(((*((struct list_head **)(&(&net->dev_base_head)->next))))) _________p1 = ({ union { typeof(((*((struct list_head **)(&(&net->dev_base_head)->next))))) __val; char __c[1]; } __u; if (1) __read_once_size(&(((*((struct list_head **)(&(&net->dev_base_head)->next))))), __u.__c, sizeof(((*((struct list_head **)(&(&net->dev_base_head)->next)))))); else __read_once_size_nocheck(&(((*((struct list_head **)(&(&net->dev_base_head)->next))))), __u.__c, sizeof(((*((struct list_head **)(&(&net->dev_base_head)->next)))))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*((*((struct list_head **)(&(&net->dev_base_head)->next))))) *)(________p1)); });
|
|
|
|
return lh == &net->dev_base_head ? ((void *)0) : ({ const typeof( ((struct net_device *)0)->dev_list ) *__mptr = (lh); (struct net_device *)( (char *)__mptr - __builtin_offsetof(struct net_device, dev_list) );});
|
|
}
|
|
|
|
int netdev_boot_setup_check(struct net_device *dev);
|
|
unsigned long netdev_boot_base(const char *prefix, int unit);
|
|
struct net_device *dev_getbyhwaddr_rcu(struct net *net, unsigned short type,
|
|
const char *hwaddr);
|
|
struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type);
|
|
struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short type);
|
|
void dev_add_pack(struct packet_type *pt);
|
|
void dev_remove_pack(struct packet_type *pt);
|
|
void __dev_remove_pack(struct packet_type *pt);
|
|
void dev_add_offload(struct packet_offload *po);
|
|
void dev_remove_offload(struct packet_offload *po);
|
|
|
|
int dev_get_iflink(const struct net_device *dev);
|
|
int dev_fill_metadata_dst(struct net_device *dev, struct sk_buff *skb);
|
|
struct net_device *__dev_get_by_flags(struct net *net, unsigned short flags,
|
|
unsigned short mask);
|
|
struct net_device *dev_get_by_name(struct net *net, const char *name);
|
|
struct net_device *dev_get_by_name_rcu(struct net *net, const char *name);
|
|
struct net_device *__dev_get_by_name(struct net *net, const char *name);
|
|
int dev_alloc_name(struct net_device *dev, const char *name);
|
|
int dev_open(struct net_device *dev);
|
|
int dev_close(struct net_device *dev);
|
|
int dev_close_many(struct list_head *head, bool unlink);
|
|
void dev_disable_lro(struct net_device *dev);
|
|
int dev_loopback_xmit(struct net *net, struct sock *sk, struct sk_buff *newskb);
|
|
int dev_queue_xmit(struct sk_buff *skb);
|
|
int dev_queue_xmit_accel(struct sk_buff *skb, void *accel_priv);
|
|
int register_netdevice(struct net_device *dev);
|
|
void unregister_netdevice_queue(struct net_device *dev, struct list_head *head);
|
|
void unregister_netdevice_many(struct list_head *head);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void unregister_netdevice(struct net_device *dev)
|
|
{
|
|
unregister_netdevice_queue(dev, ((void *)0));
|
|
}
|
|
|
|
int netdev_refcnt_read(const struct net_device *dev);
|
|
void free_netdev(struct net_device *dev);
|
|
void netdev_freemem(struct net_device *dev);
|
|
void synchronize_net(void);
|
|
int init_dummy_netdev(struct net_device *dev);
|
|
|
|
extern __attribute__((section(".data..percpu" ""))) __typeof__(int) xmit_recursion;
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dev_recursion_level(void)
|
|
{
|
|
return ({ typeof(xmit_recursion) pscr_ret__; do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); switch(sizeof(xmit_recursion)) { case 1: pscr_ret__ = ({ typeof(xmit_recursion) __ret; if ((sizeof(xmit_recursion) == sizeof(char) || sizeof(xmit_recursion) == sizeof(short) || sizeof(xmit_recursion) == sizeof(int) || sizeof(xmit_recursion) == sizeof(long))) __ret = ({ typeof(xmit_recursion) __ret; __asm__ __volatile__("": : :"memory"); __ret = ({ union { typeof(*({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); })) __val; char __c[1]; } __u; if (1) __read_once_size(&(*({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); })), __u.__c, sizeof(*({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); }))); else __read_once_size_nocheck(&(*({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); })), __u.__c, sizeof(*({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); }))); __u.__val; }); __asm__ __volatile__("": : :"memory"); __ret; }); else __ret = ({ typeof(xmit_recursion) __ret; unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); __ret = *({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); }); do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); __ret; }); __ret; }); break; case 2: pscr_ret__ = ({ typeof(xmit_recursion) __ret; if ((sizeof(xmit_recursion) == sizeof(char) || sizeof(xmit_recursion) == sizeof(short) || sizeof(xmit_recursion) == sizeof(int) || sizeof(xmit_recursion) == sizeof(long))) __ret = ({ typeof(xmit_recursion) __ret; __asm__ __volatile__("": : :"memory"); __ret = ({ union { typeof(*({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); })) __val; char __c[1]; } __u; if (1) __read_once_size(&(*({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); })), __u.__c, sizeof(*({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); }))); else __read_once_size_nocheck(&(*({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); })), __u.__c, sizeof(*({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); }))); __u.__val; }); __asm__ __volatile__("": : :"memory"); __ret; }); else __ret = ({ typeof(xmit_recursion) __ret; unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); __ret = *({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); }); do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); __ret; }); __ret; }); break; case 4: pscr_ret__ = ({ typeof(xmit_recursion) __ret; if ((sizeof(xmit_recursion) == sizeof(char) || sizeof(xmit_recursion) == sizeof(short) || sizeof(xmit_recursion) == sizeof(int) || sizeof(xmit_recursion) == sizeof(long))) __ret = ({ typeof(xmit_recursion) __ret; __asm__ __volatile__("": : :"memory"); __ret = ({ union { typeof(*({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); })) __val; char __c[1]; } __u; if (1) __read_once_size(&(*({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); })), __u.__c, sizeof(*({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); }))); else __read_once_size_nocheck(&(*({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); })), __u.__c, sizeof(*({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); }))); __u.__val; }); __asm__ __volatile__("": : :"memory"); __ret; }); else __ret = ({ typeof(xmit_recursion) __ret; unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); __ret = *({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); }); do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); __ret; }); __ret; }); break; case 8: pscr_ret__ = ({ typeof(xmit_recursion) __ret; if ((sizeof(xmit_recursion) == sizeof(char) || sizeof(xmit_recursion) == sizeof(short) || sizeof(xmit_recursion) == sizeof(int) || sizeof(xmit_recursion) == sizeof(long))) __ret = ({ typeof(xmit_recursion) __ret; __asm__ __volatile__("": : :"memory"); __ret = ({ union { typeof(*({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); })) __val; char __c[1]; } __u; if (1) __read_once_size(&(*({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); })), __u.__c, sizeof(*({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); }))); else __read_once_size_nocheck(&(*({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); })), __u.__c, sizeof(*({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); }))); __u.__val; }); __asm__ __volatile__("": : :"memory"); __ret; }); else __ret = ({ typeof(xmit_recursion) __ret; unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); __ret = *({ do { const void *__vpp_verify = (typeof((&(xmit_recursion)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))); (typeof((typeof(*(&(xmit_recursion))) *)(&(xmit_recursion)))) (__ptr + ((__my_cpu_offset()))); }); }); do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); __ret; }); __ret; }); break; default: __bad_size_call_parameter(); break; } pscr_ret__; });
|
|
}
|
|
|
|
struct net_device *dev_get_by_index(struct net *net, int ifindex);
|
|
struct net_device *__dev_get_by_index(struct net *net, int ifindex);
|
|
struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex);
|
|
int netdev_get_name(struct net *net, char *name, int ifindex);
|
|
int dev_restart(struct net_device *dev);
|
|
int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int skb_gro_offset(const struct sk_buff *skb)
|
|
{
|
|
return ((struct napi_gro_cb *)(skb)->cb)->data_offset;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int skb_gro_len(const struct sk_buff *skb)
|
|
{
|
|
return skb->len - ((struct napi_gro_cb *)(skb)->cb)->data_offset;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_gro_pull(struct sk_buff *skb, unsigned int len)
|
|
{
|
|
((struct napi_gro_cb *)(skb)->cb)->data_offset += len;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *skb_gro_header_fast(struct sk_buff *skb,
|
|
unsigned int offset)
|
|
{
|
|
return ((struct napi_gro_cb *)(skb)->cb)->frag0 + offset;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_gro_header_hard(struct sk_buff *skb, unsigned int hlen)
|
|
{
|
|
return ((struct napi_gro_cb *)(skb)->cb)->frag0_len < hlen;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_gro_frag0_invalidate(struct sk_buff *skb)
|
|
{
|
|
((struct napi_gro_cb *)(skb)->cb)->frag0 = ((void *)0);
|
|
((struct napi_gro_cb *)(skb)->cb)->frag0_len = 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen,
|
|
unsigned int offset)
|
|
{
|
|
if (!pskb_may_pull(skb, hlen))
|
|
return ((void *)0);
|
|
|
|
skb_gro_frag0_invalidate(skb);
|
|
return skb->data + offset;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *skb_gro_network_header(struct sk_buff *skb)
|
|
{
|
|
return (((struct napi_gro_cb *)(skb)->cb)->frag0 ?: skb->data) +
|
|
skb_network_offset(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_gro_postpull_rcsum(struct sk_buff *skb,
|
|
const void *start, unsigned int len)
|
|
{
|
|
if (((struct napi_gro_cb *)(skb)->cb)->csum_valid)
|
|
((struct napi_gro_cb *)(skb)->cb)->csum = csum_sub(((struct napi_gro_cb *)(skb)->cb)->csum,
|
|
csum_partial(start, len, 0));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__sum16 __skb_gro_checksum_complete(struct sk_buff *skb);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_at_gro_remcsum_start(struct sk_buff *skb)
|
|
{
|
|
return (((struct napi_gro_cb *)(skb)->cb)->gro_remcsum_start == skb_gro_offset(skb));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __skb_gro_checksum_validate_needed(struct sk_buff *skb,
|
|
bool zero_okay,
|
|
__sum16 check)
|
|
{
|
|
return ((skb->ip_summed != 3 ||
|
|
skb_checksum_start_offset(skb) <
|
|
skb_gro_offset(skb)) &&
|
|
!skb_at_gro_remcsum_start(skb) &&
|
|
((struct napi_gro_cb *)(skb)->cb)->csum_cnt == 0 &&
|
|
(!zero_okay || check));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __sum16 __skb_gro_checksum_validate_complete(struct sk_buff *skb,
|
|
__wsum psum)
|
|
{
|
|
if (((struct napi_gro_cb *)(skb)->cb)->csum_valid &&
|
|
!csum_fold(csum_add(psum, ((struct napi_gro_cb *)(skb)->cb)->csum)))
|
|
return 0;
|
|
|
|
((struct napi_gro_cb *)(skb)->cb)->csum = psum;
|
|
|
|
return __skb_gro_checksum_complete(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_gro_incr_csum_unnecessary(struct sk_buff *skb)
|
|
{
|
|
if (((struct napi_gro_cb *)(skb)->cb)->csum_cnt > 0) {
|
|
|
|
((struct napi_gro_cb *)(skb)->cb)->csum_cnt--;
|
|
} else {
|
|
|
|
|
|
|
|
|
|
__skb_incr_checksum_unnecessary(skb);
|
|
}
|
|
}
|
|
# 2492 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __skb_gro_checksum_convert_check(struct sk_buff *skb)
|
|
{
|
|
return (((struct napi_gro_cb *)(skb)->cb)->csum_cnt == 0 &&
|
|
!((struct napi_gro_cb *)(skb)->cb)->csum_valid);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_gro_checksum_convert(struct sk_buff *skb,
|
|
__sum16 check, __wsum pseudo)
|
|
{
|
|
((struct napi_gro_cb *)(skb)->cb)->csum = ~pseudo;
|
|
((struct napi_gro_cb *)(skb)->cb)->csum_valid = 1;
|
|
}
|
|
# 2512 "include/linux/netdevice.h"
|
|
struct gro_remcsum {
|
|
int offset;
|
|
__wsum delta;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_gro_remcsum_init(struct gro_remcsum *grc)
|
|
{
|
|
grc->offset = 0;
|
|
grc->delta = 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *skb_gro_remcsum_process(struct sk_buff *skb, void *ptr,
|
|
unsigned int off, size_t hdrlen,
|
|
int start, int offset,
|
|
struct gro_remcsum *grc,
|
|
bool nopartial)
|
|
{
|
|
__wsum delta;
|
|
size_t plen = hdrlen + ({ size_t __max1 = (offset + sizeof(u16)); size_t __max2 = (start); __max1 > __max2 ? __max1: __max2; });
|
|
|
|
do { if (__builtin_expect(!!(!((struct napi_gro_cb *)(skb)->cb)->csum_valid), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/netdevice.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "2532" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
|
|
if (!nopartial) {
|
|
((struct napi_gro_cb *)(skb)->cb)->gro_remcsum_start = off + hdrlen + start;
|
|
return ptr;
|
|
}
|
|
|
|
ptr = skb_gro_header_fast(skb, off);
|
|
if (skb_gro_header_hard(skb, off + plen)) {
|
|
ptr = skb_gro_header_slow(skb, off + plen, off);
|
|
if (!ptr)
|
|
return ((void *)0);
|
|
}
|
|
|
|
delta = remcsum_adjust(ptr + hdrlen, ((struct napi_gro_cb *)(skb)->cb)->csum,
|
|
start, offset);
|
|
|
|
|
|
((struct napi_gro_cb *)(skb)->cb)->csum = csum_add(((struct napi_gro_cb *)(skb)->cb)->csum, delta);
|
|
|
|
grc->offset = off + hdrlen + offset;
|
|
grc->delta = delta;
|
|
|
|
return ptr;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_gro_remcsum_cleanup(struct sk_buff *skb,
|
|
struct gro_remcsum *grc)
|
|
{
|
|
void *ptr;
|
|
size_t plen = grc->offset + sizeof(u16);
|
|
|
|
if (!grc->delta)
|
|
return;
|
|
|
|
ptr = skb_gro_header_fast(skb, grc->offset);
|
|
if (skb_gro_header_hard(skb, grc->offset + sizeof(u16))) {
|
|
ptr = skb_gro_header_slow(skb, plen, grc->offset);
|
|
if (!ptr)
|
|
return;
|
|
}
|
|
|
|
remcsum_unadjust((__sum16 *)ptr, grc->delta);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dev_hard_header(struct sk_buff *skb, struct net_device *dev,
|
|
unsigned short type,
|
|
const void *daddr, const void *saddr,
|
|
unsigned int len)
|
|
{
|
|
if (!dev->header_ops || !dev->header_ops->create)
|
|
return 0;
|
|
|
|
return dev->header_ops->create(skb, dev, type, daddr, saddr, len);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dev_parse_header(const struct sk_buff *skb,
|
|
unsigned char *haddr)
|
|
{
|
|
const struct net_device *dev = skb->dev;
|
|
|
|
if (!dev->header_ops || !dev->header_ops->parse)
|
|
return 0;
|
|
return dev->header_ops->parse(skb, haddr);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dev_validate_header(const struct net_device *dev,
|
|
char *ll_header, int len)
|
|
{
|
|
if (__builtin_expect(!!(len >= dev->hard_header_len), 1))
|
|
return true;
|
|
if (len < dev->min_header_len)
|
|
return false;
|
|
|
|
if (capable(17)) {
|
|
({ void *__p = (ll_header + len); size_t __n = dev->hard_header_len - len; if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); });
|
|
return true;
|
|
}
|
|
|
|
if (dev->header_ops && dev->header_ops->validate)
|
|
return dev->header_ops->validate(ll_header, len);
|
|
|
|
return false;
|
|
}
|
|
|
|
typedef int gifconf_func_t(struct net_device * dev, char * bufptr, int len);
|
|
int register_gifconf(unsigned int family, gifconf_func_t *gifconf);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int unregister_gifconf(unsigned int family)
|
|
{
|
|
return register_gifconf(family, ((void *)0));
|
|
}
|
|
|
|
|
|
|
|
struct sd_flow_limit {
|
|
u64 count;
|
|
unsigned int num_buckets;
|
|
unsigned int history_head;
|
|
u16 history[(1 << 7)];
|
|
u8 buckets[];
|
|
};
|
|
|
|
extern int netdev_flow_limit_table_len;
|
|
|
|
|
|
|
|
|
|
|
|
struct softnet_data {
|
|
struct list_head poll_list;
|
|
struct sk_buff_head process_queue;
|
|
|
|
|
|
unsigned int processed;
|
|
unsigned int time_squeeze;
|
|
unsigned int cpu_collision;
|
|
unsigned int received_rps;
|
|
|
|
struct softnet_data *rps_ipi_list;
|
|
|
|
|
|
struct sd_flow_limit *flow_limit;
|
|
|
|
struct Qdisc *output_queue;
|
|
struct Qdisc **output_queue_tailp;
|
|
struct sk_buff *completion_queue;
|
|
|
|
|
|
|
|
struct call_single_data csd __attribute__((__aligned__((1 << 6))));
|
|
struct softnet_data *rps_ipi_next;
|
|
unsigned int cpu;
|
|
unsigned int input_queue_head;
|
|
unsigned int input_queue_tail;
|
|
|
|
unsigned int dropped;
|
|
struct sk_buff_head input_pkt_queue;
|
|
struct napi_struct backlog;
|
|
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void input_queue_head_incr(struct softnet_data *sd)
|
|
{
|
|
|
|
sd->input_queue_head++;
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void input_queue_tail_incr_save(struct softnet_data *sd,
|
|
unsigned int *qtail)
|
|
{
|
|
|
|
*qtail = ++sd->input_queue_tail;
|
|
|
|
}
|
|
|
|
extern __attribute__((section(".data..percpu" ""))) __typeof__(struct softnet_data) softnet_data __attribute__((__aligned__((1 << 6))));
|
|
|
|
void __netif_schedule(struct Qdisc *q);
|
|
void netif_schedule_queue(struct netdev_queue *txq);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_tx_schedule_all(struct net_device *dev)
|
|
{
|
|
unsigned int i;
|
|
|
|
for (i = 0; i < dev->num_tx_queues; i++)
|
|
netif_schedule_queue(netdev_get_tx_queue(dev, i));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_tx_start_queue(struct netdev_queue *dev_queue)
|
|
{
|
|
_clear_bit(__QUEUE_STATE_DRV_XOFF,&dev_queue->state);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_start_queue(struct net_device *dev)
|
|
{
|
|
netif_tx_start_queue(netdev_get_tx_queue(dev, 0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_tx_start_all_queues(struct net_device *dev)
|
|
{
|
|
unsigned int i;
|
|
|
|
for (i = 0; i < dev->num_tx_queues; i++) {
|
|
struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
|
|
netif_tx_start_queue(txq);
|
|
}
|
|
}
|
|
|
|
void netif_tx_wake_queue(struct netdev_queue *dev_queue);
|
|
# 2737 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_wake_queue(struct net_device *dev)
|
|
{
|
|
netif_tx_wake_queue(netdev_get_tx_queue(dev, 0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_tx_wake_all_queues(struct net_device *dev)
|
|
{
|
|
unsigned int i;
|
|
|
|
for (i = 0; i < dev->num_tx_queues; i++) {
|
|
struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
|
|
netif_tx_wake_queue(txq);
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_tx_stop_queue(struct netdev_queue *dev_queue)
|
|
{
|
|
_set_bit(__QUEUE_STATE_DRV_XOFF,&dev_queue->state);
|
|
}
|
|
# 2764 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_stop_queue(struct net_device *dev)
|
|
{
|
|
netif_tx_stop_queue(netdev_get_tx_queue(dev, 0));
|
|
}
|
|
|
|
void netif_tx_stop_all_queues(struct net_device *dev);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_tx_queue_stopped(const struct netdev_queue *dev_queue)
|
|
{
|
|
return test_bit(__QUEUE_STATE_DRV_XOFF, &dev_queue->state);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_queue_stopped(const struct net_device *dev)
|
|
{
|
|
return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_xmit_stopped(const struct netdev_queue *dev_queue)
|
|
{
|
|
return dev_queue->state & ((1 << __QUEUE_STATE_DRV_XOFF) | (1 << __QUEUE_STATE_STACK_XOFF));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool
|
|
netif_xmit_frozen_or_stopped(const struct netdev_queue *dev_queue)
|
|
{
|
|
return dev_queue->state & (((1 << __QUEUE_STATE_DRV_XOFF) | (1 << __QUEUE_STATE_STACK_XOFF)) | (1 << __QUEUE_STATE_FROZEN));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool
|
|
netif_xmit_frozen_or_drv_stopped(const struct netdev_queue *dev_queue)
|
|
{
|
|
return dev_queue->state & ((1 << __QUEUE_STATE_DRV_XOFF) | (1 << __QUEUE_STATE_FROZEN));
|
|
}
|
|
# 2811 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netdev_txq_bql_enqueue_prefetchw(struct netdev_queue *dev_queue)
|
|
{
|
|
|
|
prefetchw(&dev_queue->dql.num_queued);
|
|
|
|
}
|
|
# 2825 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netdev_txq_bql_complete_prefetchw(struct netdev_queue *dev_queue)
|
|
{
|
|
|
|
prefetchw(&dev_queue->dql.limit);
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netdev_tx_sent_queue(struct netdev_queue *dev_queue,
|
|
unsigned int bytes)
|
|
{
|
|
|
|
dql_queued(&dev_queue->dql, bytes);
|
|
|
|
if (__builtin_expect(!!(dql_avail(&dev_queue->dql) >= 0), 1))
|
|
return;
|
|
|
|
_set_bit(__QUEUE_STATE_STACK_XOFF,&dev_queue->state);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
|
|
|
|
if (__builtin_expect(!!(dql_avail(&dev_queue->dql) >= 0), 0))
|
|
_clear_bit(__QUEUE_STATE_STACK_XOFF,&dev_queue->state);
|
|
|
|
}
|
|
# 2865 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netdev_sent_queue(struct net_device *dev, unsigned int bytes)
|
|
{
|
|
netdev_tx_sent_queue(netdev_get_tx_queue(dev, 0), bytes);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netdev_tx_completed_queue(struct netdev_queue *dev_queue,
|
|
unsigned int pkts, unsigned int bytes)
|
|
{
|
|
|
|
if (__builtin_expect(!!(!bytes), 0))
|
|
return;
|
|
|
|
dql_completed(&dev_queue->dql, bytes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
|
|
if (dql_avail(&dev_queue->dql) < 0)
|
|
return;
|
|
|
|
if (_test_and_clear_bit(__QUEUE_STATE_STACK_XOFF,&dev_queue->state))
|
|
netif_schedule_queue(dev_queue);
|
|
|
|
}
|
|
# 2904 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netdev_completed_queue(struct net_device *dev,
|
|
unsigned int pkts, unsigned int bytes)
|
|
{
|
|
netdev_tx_completed_queue(netdev_get_tx_queue(dev, 0), pkts, bytes);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netdev_tx_reset_queue(struct netdev_queue *q)
|
|
{
|
|
|
|
_clear_bit(__QUEUE_STATE_STACK_XOFF,&q->state);
|
|
dql_reset(&q->dql);
|
|
|
|
}
|
|
# 2925 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netdev_reset_queue(struct net_device *dev_queue)
|
|
{
|
|
netdev_tx_reset_queue(netdev_get_tx_queue(dev_queue, 0));
|
|
}
|
|
# 2938 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u16 netdev_cap_txqueue(struct net_device *dev, u16 queue_index)
|
|
{
|
|
if (__builtin_expect(!!(queue_index >= dev->real_num_tx_queues), 0)) {
|
|
do { if (net_ratelimit()) printk("\001" "4" "%s selects TX queue %d, but real number of TX queues is %d\n", dev->name, queue_index, dev->real_num_tx_queues); } while (0)
|
|
|
|
;
|
|
return 0;
|
|
}
|
|
|
|
return queue_index;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_running(const struct net_device *dev)
|
|
{
|
|
return test_bit(__LINK_STATE_START, &dev->state);
|
|
}
|
|
# 2975 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_start_subqueue(struct net_device *dev, u16 queue_index)
|
|
{
|
|
struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
|
|
|
|
netif_tx_start_queue(txq);
|
|
}
|
|
# 2989 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_stop_subqueue(struct net_device *dev, u16 queue_index)
|
|
{
|
|
struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
|
|
netif_tx_stop_queue(txq);
|
|
}
|
|
# 3002 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __netif_subqueue_stopped(const struct net_device *dev,
|
|
u16 queue_index)
|
|
{
|
|
struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
|
|
|
|
return netif_tx_queue_stopped(txq);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_subqueue_stopped(const struct net_device *dev,
|
|
struct sk_buff *skb)
|
|
{
|
|
return __netif_subqueue_stopped(dev, skb_get_queue_mapping(skb));
|
|
}
|
|
|
|
void netif_wake_subqueue(struct net_device *dev, u16 queue_index);
|
|
|
|
|
|
int netif_set_xps_queue(struct net_device *dev, const struct cpumask *mask,
|
|
u16 index);
|
|
# 3030 "include/linux/netdevice.h"
|
|
u16 __skb_tx_hash(const struct net_device *dev, struct sk_buff *skb,
|
|
unsigned int num_tx_queues);
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u16 skb_tx_hash(const struct net_device *dev,
|
|
struct sk_buff *skb)
|
|
{
|
|
return __skb_tx_hash(dev, skb, dev->real_num_tx_queues);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_is_multiqueue(const struct net_device *dev)
|
|
{
|
|
return dev->num_tx_queues > 1;
|
|
}
|
|
|
|
int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq);
|
|
|
|
|
|
int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq);
|
|
# 3067 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int get_netdev_rx_queue_index(
|
|
struct netdev_rx_queue *queue)
|
|
{
|
|
struct net_device *dev = queue->dev;
|
|
int index = queue - dev->_rx;
|
|
|
|
do { if (__builtin_expect(!!(index >= dev->num_rx_queues), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/netdevice.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "3073" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
return index;
|
|
}
|
|
|
|
|
|
|
|
int netif_get_num_default_rss_queues(void);
|
|
|
|
enum skb_free_reason {
|
|
SKB_REASON_CONSUMED,
|
|
SKB_REASON_DROPPED,
|
|
};
|
|
|
|
void __dev_kfree_skb_irq(struct sk_buff *skb, enum skb_free_reason reason);
|
|
void __dev_kfree_skb_any(struct sk_buff *skb, enum skb_free_reason reason);
|
|
# 3108 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dev_kfree_skb_irq(struct sk_buff *skb)
|
|
{
|
|
__dev_kfree_skb_irq(skb, SKB_REASON_DROPPED);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dev_consume_skb_irq(struct sk_buff *skb)
|
|
{
|
|
__dev_kfree_skb_irq(skb, SKB_REASON_CONSUMED);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dev_kfree_skb_any(struct sk_buff *skb)
|
|
{
|
|
__dev_kfree_skb_any(skb, SKB_REASON_DROPPED);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dev_consume_skb_any(struct sk_buff *skb)
|
|
{
|
|
__dev_kfree_skb_any(skb, SKB_REASON_CONSUMED);
|
|
}
|
|
|
|
int netif_rx(struct sk_buff *skb);
|
|
int netif_rx_ni(struct sk_buff *skb);
|
|
int netif_receive_skb(struct sk_buff *skb);
|
|
gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb);
|
|
void napi_gro_flush(struct napi_struct *napi, bool flush_old);
|
|
struct sk_buff *napi_get_frags(struct napi_struct *napi);
|
|
gro_result_t napi_gro_frags(struct napi_struct *napi);
|
|
struct packet_offload *gro_find_receive_by_type(__be16 type);
|
|
struct packet_offload *gro_find_complete_by_type(__be16 type);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void napi_free_frags(struct napi_struct *napi)
|
|
{
|
|
kfree_skb(napi->skb);
|
|
napi->skb = ((void *)0);
|
|
}
|
|
|
|
bool netdev_is_rx_handler_busy(struct net_device *dev);
|
|
int netdev_rx_handler_register(struct net_device *dev,
|
|
rx_handler_func_t *rx_handler,
|
|
void *rx_handler_data);
|
|
void netdev_rx_handler_unregister(struct net_device *dev);
|
|
|
|
bool dev_valid_name(const char *name);
|
|
int dev_ioctl(struct net *net, unsigned int cmd, void *);
|
|
int dev_ethtool(struct net *net, struct ifreq *);
|
|
unsigned int dev_get_flags(const struct net_device *);
|
|
int __dev_change_flags(struct net_device *, unsigned int flags);
|
|
int dev_change_flags(struct net_device *, unsigned int);
|
|
void __dev_notify_flags(struct net_device *, unsigned int old_flags,
|
|
unsigned int gchanges);
|
|
int dev_change_name(struct net_device *, const char *);
|
|
int dev_set_alias(struct net_device *, const char *, size_t);
|
|
int dev_change_net_namespace(struct net_device *, struct net *, const char *);
|
|
int dev_set_mtu(struct net_device *, int);
|
|
void dev_set_group(struct net_device *, int);
|
|
int dev_set_mac_address(struct net_device *, struct sockaddr *);
|
|
int dev_change_carrier(struct net_device *, bool new_carrier);
|
|
int dev_get_phys_port_id(struct net_device *dev,
|
|
struct netdev_phys_item_id *ppid);
|
|
int dev_get_phys_port_name(struct net_device *dev,
|
|
char *name, size_t len);
|
|
int dev_change_proto_down(struct net_device *dev, bool proto_down);
|
|
struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *dev);
|
|
struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
|
|
struct netdev_queue *txq, int *ret);
|
|
int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
|
|
int dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
|
|
bool is_skb_forwardable(struct net_device *dev, struct sk_buff *skb);
|
|
|
|
extern int netdev_budget;
|
|
|
|
|
|
void netdev_run_todo(void);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dev_put(struct net_device *dev)
|
|
{
|
|
do { do { const void *__vpp_verify = (typeof((&(*dev->pcpu_refcnt)) + 0))((void *)0); (void)__vpp_verify; } while (0); switch(sizeof(*dev->pcpu_refcnt)) { case 1: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*dev->pcpu_refcnt)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*dev->pcpu_refcnt))) *)(&(*dev->pcpu_refcnt)))); (typeof((typeof(*(&(*dev->pcpu_refcnt))) *)(&(*dev->pcpu_refcnt)))) (__ptr + ((__my_cpu_offset()))); }); }) += -(typeof(*dev->pcpu_refcnt))(1); do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 2: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*dev->pcpu_refcnt)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*dev->pcpu_refcnt))) *)(&(*dev->pcpu_refcnt)))); (typeof((typeof(*(&(*dev->pcpu_refcnt))) *)(&(*dev->pcpu_refcnt)))) (__ptr + ((__my_cpu_offset()))); }); }) += -(typeof(*dev->pcpu_refcnt))(1); do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 4: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*dev->pcpu_refcnt)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*dev->pcpu_refcnt))) *)(&(*dev->pcpu_refcnt)))); (typeof((typeof(*(&(*dev->pcpu_refcnt))) *)(&(*dev->pcpu_refcnt)))) (__ptr + ((__my_cpu_offset()))); }); }) += -(typeof(*dev->pcpu_refcnt))(1); do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 8: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*dev->pcpu_refcnt)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*dev->pcpu_refcnt))) *)(&(*dev->pcpu_refcnt)))); (typeof((typeof(*(&(*dev->pcpu_refcnt))) *)(&(*dev->pcpu_refcnt)))) (__ptr + ((__my_cpu_offset()))); }); }) += -(typeof(*dev->pcpu_refcnt))(1); do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; default: __bad_size_call_parameter();break; } } while (0);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dev_hold(struct net_device *dev)
|
|
{
|
|
do { do { const void *__vpp_verify = (typeof((&(*dev->pcpu_refcnt)) + 0))((void *)0); (void)__vpp_verify; } while (0); switch(sizeof(*dev->pcpu_refcnt)) { case 1: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*dev->pcpu_refcnt)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*dev->pcpu_refcnt))) *)(&(*dev->pcpu_refcnt)))); (typeof((typeof(*(&(*dev->pcpu_refcnt))) *)(&(*dev->pcpu_refcnt)))) (__ptr + ((__my_cpu_offset()))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 2: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*dev->pcpu_refcnt)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*dev->pcpu_refcnt))) *)(&(*dev->pcpu_refcnt)))); (typeof((typeof(*(&(*dev->pcpu_refcnt))) *)(&(*dev->pcpu_refcnt)))) (__ptr + ((__my_cpu_offset()))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 4: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*dev->pcpu_refcnt)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*dev->pcpu_refcnt))) *)(&(*dev->pcpu_refcnt)))); (typeof((typeof(*(&(*dev->pcpu_refcnt))) *)(&(*dev->pcpu_refcnt)))) (__ptr + ((__my_cpu_offset()))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; case 8: do { unsigned long __flags; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); __flags = arch_local_irq_save(); } while (0); *({ do { const void *__vpp_verify = (typeof((&(*dev->pcpu_refcnt)) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(&(*dev->pcpu_refcnt))) *)(&(*dev->pcpu_refcnt)))); (typeof((typeof(*(&(*dev->pcpu_refcnt))) *)(&(*dev->pcpu_refcnt)))) (__ptr + ((__my_cpu_offset()))); }); }) += 1; do { ({ unsigned long __dummy; typeof(__flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(__flags); } while (0); } while (0);break; default: __bad_size_call_parameter();break; } } while (0);
|
|
}
|
|
# 3213 "include/linux/netdevice.h"
|
|
void linkwatch_init_dev(struct net_device *dev);
|
|
void linkwatch_fire_event(struct net_device *dev);
|
|
void linkwatch_forget_dev(struct net_device *dev);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_carrier_ok(const struct net_device *dev)
|
|
{
|
|
return !test_bit(__LINK_STATE_NOCARRIER, &dev->state);
|
|
}
|
|
|
|
unsigned long dev_trans_start(struct net_device *dev);
|
|
|
|
void __netdev_watchdog_up(struct net_device *dev);
|
|
|
|
void netif_carrier_on(struct net_device *dev);
|
|
|
|
void netif_carrier_off(struct net_device *dev);
|
|
# 3249 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_dormant_on(struct net_device *dev)
|
|
{
|
|
if (!_test_and_set_bit(__LINK_STATE_DORMANT,&dev->state))
|
|
linkwatch_fire_event(dev);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_dormant_off(struct net_device *dev)
|
|
{
|
|
if (_test_and_clear_bit(__LINK_STATE_DORMANT,&dev->state))
|
|
linkwatch_fire_event(dev);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_dormant(const struct net_device *dev)
|
|
{
|
|
return test_bit(__LINK_STATE_DORMANT, &dev->state);
|
|
}
|
|
# 3285 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_oper_up(const struct net_device *dev)
|
|
{
|
|
return (dev->operstate == IF_OPER_UP ||
|
|
dev->operstate == IF_OPER_UNKNOWN );
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_device_present(struct net_device *dev)
|
|
{
|
|
return test_bit(__LINK_STATE_PRESENT, &dev->state);
|
|
}
|
|
|
|
void netif_device_detach(struct net_device *dev);
|
|
|
|
void netif_device_attach(struct net_device *dev);
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
NETIF_MSG_DRV = 0x0001,
|
|
NETIF_MSG_PROBE = 0x0002,
|
|
NETIF_MSG_LINK = 0x0004,
|
|
NETIF_MSG_TIMER = 0x0008,
|
|
NETIF_MSG_IFDOWN = 0x0010,
|
|
NETIF_MSG_IFUP = 0x0020,
|
|
NETIF_MSG_RX_ERR = 0x0040,
|
|
NETIF_MSG_TX_ERR = 0x0080,
|
|
NETIF_MSG_TX_QUEUED = 0x0100,
|
|
NETIF_MSG_INTR = 0x0200,
|
|
NETIF_MSG_TX_DONE = 0x0400,
|
|
NETIF_MSG_RX_STATUS = 0x0800,
|
|
NETIF_MSG_PKTDATA = 0x1000,
|
|
NETIF_MSG_HW = 0x2000,
|
|
NETIF_MSG_WOL = 0x4000,
|
|
};
|
|
# 3344 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 netif_msg_init(int debug_value, int default_msg_enable_bits)
|
|
{
|
|
|
|
if (debug_value < 0 || debug_value >= (sizeof(u32) * 8))
|
|
return default_msg_enable_bits;
|
|
if (debug_value == 0)
|
|
return 0;
|
|
|
|
return (1 << debug_value) - 1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __netif_tx_lock(struct netdev_queue *txq, int cpu)
|
|
{
|
|
spin_lock(&txq->_xmit_lock);
|
|
txq->xmit_lock_owner = cpu;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __netif_tx_lock_bh(struct netdev_queue *txq)
|
|
{
|
|
spin_lock_bh(&txq->_xmit_lock);
|
|
txq->xmit_lock_owner = (current_thread_info()->cpu);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __netif_tx_trylock(struct netdev_queue *txq)
|
|
{
|
|
bool ok = spin_trylock(&txq->_xmit_lock);
|
|
if (__builtin_expect(!!(ok), 1))
|
|
txq->xmit_lock_owner = (current_thread_info()->cpu);
|
|
return ok;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __netif_tx_unlock(struct netdev_queue *txq)
|
|
{
|
|
txq->xmit_lock_owner = -1;
|
|
spin_unlock(&txq->_xmit_lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __netif_tx_unlock_bh(struct netdev_queue *txq)
|
|
{
|
|
txq->xmit_lock_owner = -1;
|
|
spin_unlock_bh(&txq->_xmit_lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void txq_trans_update(struct netdev_queue *txq)
|
|
{
|
|
if (txq->xmit_lock_owner != -1)
|
|
txq->trans_start = jiffies;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_tx_lock(struct net_device *dev)
|
|
{
|
|
unsigned int i;
|
|
int cpu;
|
|
|
|
spin_lock(&dev->tx_global_lock);
|
|
cpu = (current_thread_info()->cpu);
|
|
for (i = 0; i < dev->num_tx_queues; i++) {
|
|
struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__netif_tx_lock(txq, cpu);
|
|
_set_bit(__QUEUE_STATE_FROZEN,&txq->state);
|
|
__netif_tx_unlock(txq);
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_tx_lock_bh(struct net_device *dev)
|
|
{
|
|
local_bh_disable();
|
|
netif_tx_lock(dev);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_tx_unlock(struct net_device *dev)
|
|
{
|
|
unsigned int i;
|
|
|
|
for (i = 0; i < dev->num_tx_queues; i++) {
|
|
struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
|
|
|
|
|
|
|
|
|
|
|
|
_clear_bit(__QUEUE_STATE_FROZEN,&txq->state);
|
|
netif_schedule_queue(txq);
|
|
}
|
|
spin_unlock(&dev->tx_global_lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_tx_unlock_bh(struct net_device *dev)
|
|
{
|
|
netif_tx_unlock(dev);
|
|
local_bh_enable();
|
|
}
|
|
# 3467 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_tx_disable(struct net_device *dev)
|
|
{
|
|
unsigned int i;
|
|
int cpu;
|
|
|
|
local_bh_disable();
|
|
cpu = (current_thread_info()->cpu);
|
|
for (i = 0; i < dev->num_tx_queues; i++) {
|
|
struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
|
|
|
|
__netif_tx_lock(txq, cpu);
|
|
netif_tx_stop_queue(txq);
|
|
__netif_tx_unlock(txq);
|
|
}
|
|
local_bh_enable();
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_addr_lock(struct net_device *dev)
|
|
{
|
|
spin_lock(&dev->addr_list_lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_addr_lock_nested(struct net_device *dev)
|
|
{
|
|
int subclass = 1;
|
|
|
|
if (dev->netdev_ops->ndo_get_lock_subclass)
|
|
subclass = dev->netdev_ops->ndo_get_lock_subclass(dev);
|
|
|
|
do { _raw_spin_lock(((void)(subclass), (spinlock_check(&dev->addr_list_lock)))); } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_addr_lock_bh(struct net_device *dev)
|
|
{
|
|
spin_lock_bh(&dev->addr_list_lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_addr_unlock(struct net_device *dev)
|
|
{
|
|
spin_unlock(&dev->addr_list_lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_addr_unlock_bh(struct net_device *dev)
|
|
{
|
|
spin_unlock_bh(&dev->addr_list_lock);
|
|
}
|
|
# 3523 "include/linux/netdevice.h"
|
|
void ether_setup(struct net_device *dev);
|
|
|
|
|
|
struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
|
|
unsigned char name_assign_type,
|
|
void (*setup)(struct net_device *),
|
|
unsigned int txqs, unsigned int rxqs);
|
|
int dev_get_valid_name(struct net *net, struct net_device *dev,
|
|
const char *name);
|
|
# 3540 "include/linux/netdevice.h"
|
|
int register_netdev(struct net_device *dev);
|
|
void unregister_netdev(struct net_device *dev);
|
|
|
|
|
|
int __hw_addr_sync(struct netdev_hw_addr_list *to_list,
|
|
struct netdev_hw_addr_list *from_list, int addr_len);
|
|
void __hw_addr_unsync(struct netdev_hw_addr_list *to_list,
|
|
struct netdev_hw_addr_list *from_list, int addr_len);
|
|
int __hw_addr_sync_dev(struct netdev_hw_addr_list *list,
|
|
struct net_device *dev,
|
|
int (*sync)(struct net_device *, const unsigned char *),
|
|
int (*unsync)(struct net_device *,
|
|
const unsigned char *));
|
|
void __hw_addr_unsync_dev(struct netdev_hw_addr_list *list,
|
|
struct net_device *dev,
|
|
int (*unsync)(struct net_device *,
|
|
const unsigned char *));
|
|
void __hw_addr_init(struct netdev_hw_addr_list *list);
|
|
|
|
|
|
int dev_addr_add(struct net_device *dev, const unsigned char *addr,
|
|
unsigned char addr_type);
|
|
int dev_addr_del(struct net_device *dev, const unsigned char *addr,
|
|
unsigned char addr_type);
|
|
void dev_addr_flush(struct net_device *dev);
|
|
int dev_addr_init(struct net_device *dev);
|
|
|
|
|
|
int dev_uc_add(struct net_device *dev, const unsigned char *addr);
|
|
int dev_uc_add_excl(struct net_device *dev, const unsigned char *addr);
|
|
int dev_uc_del(struct net_device *dev, const unsigned char *addr);
|
|
int dev_uc_sync(struct net_device *to, struct net_device *from);
|
|
int dev_uc_sync_multiple(struct net_device *to, struct net_device *from);
|
|
void dev_uc_unsync(struct net_device *to, struct net_device *from);
|
|
void dev_uc_flush(struct net_device *dev);
|
|
void dev_uc_init(struct net_device *dev);
|
|
# 3586 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __dev_uc_sync(struct net_device *dev,
|
|
int (*sync)(struct net_device *,
|
|
const unsigned char *),
|
|
int (*unsync)(struct net_device *,
|
|
const unsigned char *))
|
|
{
|
|
return __hw_addr_sync_dev(&dev->uc, dev, sync, unsync);
|
|
}
|
|
# 3602 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __dev_uc_unsync(struct net_device *dev,
|
|
int (*unsync)(struct net_device *,
|
|
const unsigned char *))
|
|
{
|
|
__hw_addr_unsync_dev(&dev->uc, dev, unsync);
|
|
}
|
|
|
|
|
|
int dev_mc_add(struct net_device *dev, const unsigned char *addr);
|
|
int dev_mc_add_global(struct net_device *dev, const unsigned char *addr);
|
|
int dev_mc_add_excl(struct net_device *dev, const unsigned char *addr);
|
|
int dev_mc_del(struct net_device *dev, const unsigned char *addr);
|
|
int dev_mc_del_global(struct net_device *dev, const unsigned char *addr);
|
|
int dev_mc_sync(struct net_device *to, struct net_device *from);
|
|
int dev_mc_sync_multiple(struct net_device *to, struct net_device *from);
|
|
void dev_mc_unsync(struct net_device *to, struct net_device *from);
|
|
void dev_mc_flush(struct net_device *dev);
|
|
void dev_mc_init(struct net_device *dev);
|
|
# 3630 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __dev_mc_sync(struct net_device *dev,
|
|
int (*sync)(struct net_device *,
|
|
const unsigned char *),
|
|
int (*unsync)(struct net_device *,
|
|
const unsigned char *))
|
|
{
|
|
return __hw_addr_sync_dev(&dev->mc, dev, sync, unsync);
|
|
}
|
|
# 3646 "include/linux/netdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __dev_mc_unsync(struct net_device *dev,
|
|
int (*unsync)(struct net_device *,
|
|
const unsigned char *))
|
|
{
|
|
__hw_addr_unsync_dev(&dev->mc, dev, unsync);
|
|
}
|
|
|
|
|
|
void dev_set_rx_mode(struct net_device *dev);
|
|
void __dev_set_rx_mode(struct net_device *dev);
|
|
int dev_set_promiscuity(struct net_device *dev, int inc);
|
|
int dev_set_allmulti(struct net_device *dev, int inc);
|
|
void netdev_state_change(struct net_device *dev);
|
|
void netdev_notify_peers(struct net_device *dev);
|
|
void netdev_features_change(struct net_device *dev);
|
|
|
|
void dev_load(struct net *net, const char *name);
|
|
struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
|
|
struct rtnl_link_stats64 *storage);
|
|
void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64,
|
|
const struct net_device_stats *netdev_stats);
|
|
|
|
extern int netdev_max_backlog;
|
|
extern int netdev_tstamp_prequeue;
|
|
extern int weight_p;
|
|
extern int bpf_jit_enable;
|
|
|
|
bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev);
|
|
struct net_device *netdev_upper_get_next_dev_rcu(struct net_device *dev,
|
|
struct list_head **iter);
|
|
struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev,
|
|
struct list_head **iter);
|
|
# 3693 "include/linux/netdevice.h"
|
|
void *netdev_lower_get_next_private(struct net_device *dev,
|
|
struct list_head **iter);
|
|
void *netdev_lower_get_next_private_rcu(struct net_device *dev,
|
|
struct list_head **iter);
|
|
# 3710 "include/linux/netdevice.h"
|
|
void *netdev_lower_get_next(struct net_device *dev,
|
|
struct list_head **iter);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void *netdev_adjacent_get_private(struct list_head *adj_list);
|
|
void *netdev_lower_get_first_private_rcu(struct net_device *dev);
|
|
struct net_device *netdev_master_upper_dev_get(struct net_device *dev);
|
|
struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev);
|
|
int netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev);
|
|
int netdev_master_upper_dev_link(struct net_device *dev,
|
|
struct net_device *upper_dev);
|
|
int netdev_master_upper_dev_link_private(struct net_device *dev,
|
|
struct net_device *upper_dev,
|
|
void *private);
|
|
void netdev_upper_dev_unlink(struct net_device *dev,
|
|
struct net_device *upper_dev);
|
|
void netdev_adjacent_rename_links(struct net_device *dev, char *oldname);
|
|
void *netdev_lower_dev_get_private(struct net_device *dev,
|
|
struct net_device *lower_dev);
|
|
|
|
|
|
|
|
extern u8 netdev_rss_key[52];
|
|
void netdev_rss_key_fill(void *buffer, size_t len);
|
|
|
|
int dev_get_nest_level(struct net_device *dev,
|
|
bool (*type_check)(struct net_device *dev));
|
|
int skb_checksum_help(struct sk_buff *skb);
|
|
struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
|
|
netdev_features_t features, bool tx_path);
|
|
struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb,
|
|
netdev_features_t features);
|
|
|
|
struct netdev_bonding_info {
|
|
ifslave slave;
|
|
ifbond master;
|
|
};
|
|
|
|
struct netdev_notifier_bonding_info {
|
|
struct netdev_notifier_info info;
|
|
struct netdev_bonding_info bonding_info;
|
|
};
|
|
|
|
void netdev_bonding_info_change(struct net_device *dev,
|
|
struct netdev_bonding_info *bonding_info);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features)
|
|
{
|
|
return __skb_gso_segment(skb, features, true);
|
|
}
|
|
__be16 skb_network_protocol(struct sk_buff *skb, int *depth);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool can_checksum_protocol(netdev_features_t features,
|
|
__be16 protocol)
|
|
{
|
|
return ((features & ((netdev_features_t)1 << (NETIF_F_HW_CSUM_BIT))) ||
|
|
((features & (((netdev_features_t)1 << (NETIF_F_HW_CSUM_BIT)) | ((netdev_features_t)1 << (NETIF_F_IP_CSUM_BIT)))) &&
|
|
protocol == (( __be16)(__builtin_constant_p((__u16)((0x0800))) ? ((__u16)( (((__u16)((0x0800)) & (__u16)0x00ffU) << 8) | (((__u16)((0x0800)) & (__u16)0xff00U) >> 8))) : __fswab16((0x0800))))) ||
|
|
((features & (((netdev_features_t)1 << (NETIF_F_HW_CSUM_BIT)) | ((netdev_features_t)1 << (NETIF_F_IPV6_CSUM_BIT)))) &&
|
|
protocol == (( __be16)(__builtin_constant_p((__u16)((0x86DD))) ? ((__u16)( (((__u16)((0x86DD)) & (__u16)0x00ffU) << 8) | (((__u16)((0x86DD)) & (__u16)0xff00U) >> 8))) : __fswab16((0x86DD))))) ||
|
|
((features & ((netdev_features_t)1 << (NETIF_F_FCOE_CRC_BIT))) &&
|
|
protocol == (( __be16)(__builtin_constant_p((__u16)((0x8906))) ? ((__u16)( (((__u16)((0x8906)) & (__u16)0x00ffU) << 8) | (((__u16)((0x8906)) & (__u16)0xff00U) >> 8))) : __fswab16((0x8906))))));
|
|
}
|
|
|
|
|
|
void netdev_rx_csum_fault(struct net_device *dev);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void net_enable_timestamp(void);
|
|
void net_disable_timestamp(void);
|
|
|
|
|
|
int __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) dev_proc_init(void);
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) netdev_tx_t __netdev_start_xmit(const struct net_device_ops *ops,
|
|
struct sk_buff *skb, struct net_device *dev,
|
|
bool more)
|
|
{
|
|
skb->xmit_more = more ? 1 : 0;
|
|
return ops->ndo_start_xmit(skb, dev);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) netdev_tx_t netdev_start_xmit(struct sk_buff *skb, struct net_device *dev,
|
|
struct netdev_queue *txq, bool more)
|
|
{
|
|
const struct net_device_ops *ops = dev->netdev_ops;
|
|
int rc;
|
|
|
|
rc = __netdev_start_xmit(ops, skb, dev, more);
|
|
if (rc == NETDEV_TX_OK)
|
|
txq_trans_update(txq);
|
|
|
|
return rc;
|
|
}
|
|
|
|
int netdev_class_create_file_ns(struct class_attribute *class_attr,
|
|
const void *ns);
|
|
void netdev_class_remove_file_ns(struct class_attribute *class_attr,
|
|
const void *ns);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int netdev_class_create_file(struct class_attribute *class_attr)
|
|
{
|
|
return netdev_class_create_file_ns(class_attr, ((void *)0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netdev_class_remove_file(struct class_attribute *class_attr)
|
|
{
|
|
netdev_class_remove_file_ns(class_attr, ((void *)0));
|
|
}
|
|
|
|
extern struct kobj_ns_type_operations net_ns_type_operations;
|
|
|
|
const char *netdev_drivername(const struct net_device *dev);
|
|
|
|
void linkwatch_run_queue(void);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) netdev_features_t netdev_intersect_features(netdev_features_t f1,
|
|
netdev_features_t f2)
|
|
{
|
|
if (f1 & ((netdev_features_t)1 << (NETIF_F_HW_CSUM_BIT)))
|
|
f1 |= (((((netdev_features_t)1 << (NETIF_F_HW_CSUM_BIT)) | ((netdev_features_t)1 << (NETIF_F_IP_CSUM_BIT))) | (((netdev_features_t)1 << (NETIF_F_HW_CSUM_BIT)) | ((netdev_features_t)1 << (NETIF_F_IPV6_CSUM_BIT)))) & ~((netdev_features_t)1 << (NETIF_F_HW_CSUM_BIT)));
|
|
if (f2 & ((netdev_features_t)1 << (NETIF_F_HW_CSUM_BIT)))
|
|
f2 |= (((((netdev_features_t)1 << (NETIF_F_HW_CSUM_BIT)) | ((netdev_features_t)1 << (NETIF_F_IP_CSUM_BIT))) | (((netdev_features_t)1 << (NETIF_F_HW_CSUM_BIT)) | ((netdev_features_t)1 << (NETIF_F_IPV6_CSUM_BIT)))) & ~((netdev_features_t)1 << (NETIF_F_HW_CSUM_BIT)));
|
|
f1 &= f2;
|
|
if (f1 & ((netdev_features_t)1 << (NETIF_F_HW_CSUM_BIT)))
|
|
f1 &= ~(((((netdev_features_t)1 << (NETIF_F_HW_CSUM_BIT)) | ((netdev_features_t)1 << (NETIF_F_IP_CSUM_BIT))) | (((netdev_features_t)1 << (NETIF_F_HW_CSUM_BIT)) | ((netdev_features_t)1 << (NETIF_F_IPV6_CSUM_BIT)))) & ~((netdev_features_t)1 << (NETIF_F_HW_CSUM_BIT)));
|
|
|
|
return f1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) netdev_features_t netdev_get_wanted_features(
|
|
struct net_device *dev)
|
|
{
|
|
return (dev->features & ~dev->hw_features) | dev->wanted_features;
|
|
}
|
|
netdev_features_t netdev_increment_features(netdev_features_t all,
|
|
netdev_features_t one, netdev_features_t mask);
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) netdev_features_t netdev_add_tso_features(netdev_features_t features,
|
|
netdev_features_t mask)
|
|
{
|
|
return netdev_increment_features(features, (((netdev_features_t)1 << (NETIF_F_TSO_BIT)) | ((netdev_features_t)1 << (NETIF_F_TSO6_BIT)) | ((netdev_features_t)1 << (NETIF_F_TSO_ECN_BIT))), mask);
|
|
}
|
|
|
|
int __netdev_update_features(struct net_device *dev);
|
|
void netdev_update_features(struct net_device *dev);
|
|
void netdev_change_features(struct net_device *dev);
|
|
|
|
void netif_stacked_transfer_operstate(const struct net_device *rootdev,
|
|
struct net_device *dev);
|
|
|
|
netdev_features_t passthru_features_check(struct sk_buff *skb,
|
|
struct net_device *dev,
|
|
netdev_features_t features);
|
|
netdev_features_t netif_skb_features(struct sk_buff *skb);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool net_gso_ok(netdev_features_t features, int gso_type)
|
|
{
|
|
netdev_features_t feature = gso_type << NETIF_F_GSO_SHIFT;
|
|
|
|
|
|
((void)sizeof(char[1 - 2*!!(SKB_GSO_TCPV4 != (((netdev_features_t)1 << (NETIF_F_TSO_BIT)) >> NETIF_F_GSO_SHIFT))]));
|
|
((void)sizeof(char[1 - 2*!!(SKB_GSO_UDP != (((netdev_features_t)1 << (NETIF_F_UFO_BIT)) >> NETIF_F_GSO_SHIFT))]));
|
|
((void)sizeof(char[1 - 2*!!(SKB_GSO_DODGY != (((netdev_features_t)1 << (NETIF_F_GSO_ROBUST_BIT)) >> NETIF_F_GSO_SHIFT))]));
|
|
((void)sizeof(char[1 - 2*!!(SKB_GSO_TCP_ECN != (((netdev_features_t)1 << (NETIF_F_TSO_ECN_BIT)) >> NETIF_F_GSO_SHIFT))]));
|
|
((void)sizeof(char[1 - 2*!!(SKB_GSO_TCPV6 != (((netdev_features_t)1 << (NETIF_F_TSO6_BIT)) >> NETIF_F_GSO_SHIFT))]));
|
|
((void)sizeof(char[1 - 2*!!(SKB_GSO_FCOE != (((netdev_features_t)1 << (NETIF_F_FSO_BIT)) >> NETIF_F_GSO_SHIFT))]));
|
|
((void)sizeof(char[1 - 2*!!(SKB_GSO_GRE != (((netdev_features_t)1 << (NETIF_F_GSO_GRE_BIT)) >> NETIF_F_GSO_SHIFT))]));
|
|
((void)sizeof(char[1 - 2*!!(SKB_GSO_GRE_CSUM != (((netdev_features_t)1 << (NETIF_F_GSO_GRE_CSUM_BIT)) >> NETIF_F_GSO_SHIFT))]));
|
|
((void)sizeof(char[1 - 2*!!(SKB_GSO_IPIP != (((netdev_features_t)1 << (NETIF_F_GSO_IPIP_BIT)) >> NETIF_F_GSO_SHIFT))]));
|
|
((void)sizeof(char[1 - 2*!!(SKB_GSO_SIT != (((netdev_features_t)1 << (NETIF_F_GSO_SIT_BIT)) >> NETIF_F_GSO_SHIFT))]));
|
|
((void)sizeof(char[1 - 2*!!(SKB_GSO_UDP_TUNNEL != (((netdev_features_t)1 << (NETIF_F_GSO_UDP_TUNNEL_BIT)) >> NETIF_F_GSO_SHIFT))]));
|
|
((void)sizeof(char[1 - 2*!!(SKB_GSO_UDP_TUNNEL_CSUM != (((netdev_features_t)1 << (NETIF_F_GSO_UDP_TUNNEL_CSUM_BIT)) >> NETIF_F_GSO_SHIFT))]));
|
|
((void)sizeof(char[1 - 2*!!(SKB_GSO_TUNNEL_REMCSUM != (((netdev_features_t)1 << (NETIF_F_GSO_TUNNEL_REMCSUM_BIT)) >> NETIF_F_GSO_SHIFT))]));
|
|
|
|
return (features & feature) == feature;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_gso_ok(struct sk_buff *skb, netdev_features_t features)
|
|
{
|
|
return net_gso_ok(features, ((struct skb_shared_info *)(skb_end_pointer(skb)))->gso_type) &&
|
|
(!skb_has_frag_list(skb) || (features & ((netdev_features_t)1 << (NETIF_F_FRAGLIST_BIT))));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_needs_gso(struct sk_buff *skb,
|
|
netdev_features_t features)
|
|
{
|
|
return skb_is_gso(skb) && (!skb_gso_ok(skb, features) ||
|
|
__builtin_expect(!!((skb->ip_summed != 3) && (skb->ip_summed != 1)), 0)
|
|
);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_set_gso_max_size(struct net_device *dev,
|
|
unsigned int size)
|
|
{
|
|
dev->gso_max_size = size;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_gso_error_unwind(struct sk_buff *skb, __be16 protocol,
|
|
int pulled_hlen, u16 mac_offset,
|
|
int mac_len)
|
|
{
|
|
skb->protocol = protocol;
|
|
skb->encapsulation = 1;
|
|
skb_push(skb, pulled_hlen);
|
|
skb_reset_transport_header(skb);
|
|
skb->mac_header = mac_offset;
|
|
skb->network_header = skb->mac_header + mac_len;
|
|
skb->mac_len = mac_len;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_is_macvlan(struct net_device *dev)
|
|
{
|
|
return dev->priv_flags & IFF_MACVLAN;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_is_macvlan_port(struct net_device *dev)
|
|
{
|
|
return dev->priv_flags & IFF_MACVLAN_PORT;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_is_ipvlan(struct net_device *dev)
|
|
{
|
|
return dev->priv_flags & IFF_IPVLAN_SLAVE;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_is_ipvlan_port(struct net_device *dev)
|
|
{
|
|
return dev->priv_flags & IFF_IPVLAN_MASTER;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_is_bond_master(struct net_device *dev)
|
|
{
|
|
return dev->flags & IFF_MASTER && dev->priv_flags & IFF_BONDING;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_is_bond_slave(struct net_device *dev)
|
|
{
|
|
return dev->flags & IFF_SLAVE && dev->priv_flags & IFF_BONDING;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_supports_nofcs(struct net_device *dev)
|
|
{
|
|
return dev->priv_flags & IFF_SUPP_NOFCS;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_is_l3_master(const struct net_device *dev)
|
|
{
|
|
return dev->priv_flags & IFF_L3MDEV_MASTER;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_is_l3_slave(const struct net_device *dev)
|
|
{
|
|
return dev->priv_flags & IFF_L3MDEV_SLAVE;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_is_bridge_master(const struct net_device *dev)
|
|
{
|
|
return dev->priv_flags & IFF_EBRIDGE;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_is_bridge_port(const struct net_device *dev)
|
|
{
|
|
return dev->priv_flags & IFF_BRIDGE_PORT;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_is_ovs_master(const struct net_device *dev)
|
|
{
|
|
return dev->priv_flags & IFF_OPENVSWITCH;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void netif_keep_dst(struct net_device *dev)
|
|
{
|
|
dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM);
|
|
}
|
|
|
|
extern struct pernet_operations loopback_net_ops;
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const char *netdev_name(const struct net_device *dev)
|
|
{
|
|
if (!dev->name[0] || strchr(dev->name, '%'))
|
|
return "(unnamed net_device)";
|
|
return dev->name;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const char *netdev_reg_state(const struct net_device *dev)
|
|
{
|
|
switch (dev->reg_state) {
|
|
case NETREG_UNINITIALIZED: return " (uninitialized)";
|
|
case NETREG_REGISTERED: return "";
|
|
case NETREG_UNREGISTERING: return " (unregistering)";
|
|
case NETREG_UNREGISTERED: return " (unregistered)";
|
|
case NETREG_RELEASED: return " (released)";
|
|
case NETREG_DUMMY: return " (dummy)";
|
|
}
|
|
|
|
({ static bool __attribute__ ((__section__(".data.unlikely"))) __warned; int __ret_warn_once = !!(1); if (__builtin_expect(!!(__ret_warn_once), 0)) if (({ int __ret_warn_on = !!(!__warned); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_fmt("include/linux/netdevice.h", 4027, "%s: unknown reg_state %d\n", dev->name, dev->reg_state); __builtin_expect(!!(__ret_warn_on), 0); })) __warned = true; __builtin_expect(!!(__ret_warn_once), 0); });
|
|
return " (unknown)";
|
|
}
|
|
|
|
__attribute__((format(printf, 3, 4)))
|
|
void netdev_printk(const char *level, const struct net_device *dev,
|
|
const char *format, ...);
|
|
__attribute__((format(printf, 2, 3)))
|
|
void netdev_emerg(const struct net_device *dev, const char *format, ...);
|
|
__attribute__((format(printf, 2, 3)))
|
|
void netdev_alert(const struct net_device *dev, const char *format, ...);
|
|
__attribute__((format(printf, 2, 3)))
|
|
void netdev_crit(const struct net_device *dev, const char *format, ...);
|
|
__attribute__((format(printf, 2, 3)))
|
|
void netdev_err(const struct net_device *dev, const char *format, ...);
|
|
__attribute__((format(printf, 2, 3)))
|
|
void netdev_warn(const struct net_device *dev, const char *format, ...);
|
|
__attribute__((format(printf, 2, 3)))
|
|
void netdev_notice(const struct net_device *dev, const char *format, ...);
|
|
__attribute__((format(printf, 2, 3)))
|
|
void netdev_info(const struct net_device *dev, const char *format, ...);
|
|
# 13 "include/linux/icmpv6.h" 2
|
|
|
|
|
|
extern void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info);
|
|
|
|
typedef void ip6_icmp_send_t(struct sk_buff *skb, u8 type, u8 code, __u32 info);
|
|
extern int inet6_register_icmp_sender(ip6_icmp_send_t *fn);
|
|
extern int inet6_unregister_icmp_sender(ip6_icmp_send_t *fn);
|
|
# 30 "include/linux/icmpv6.h"
|
|
extern int icmpv6_init(void);
|
|
extern int icmpv6_err_convert(u8 type, u8 code,
|
|
int *err);
|
|
extern void icmpv6_cleanup(void);
|
|
extern void icmpv6_param_prob(struct sk_buff *skb,
|
|
u8 code, int pos);
|
|
|
|
struct flowi6;
|
|
struct in6_addr;
|
|
extern void icmpv6_flow_init(struct sock *sk,
|
|
struct flowi6 *fl6,
|
|
u8 type,
|
|
const struct in6_addr *saddr,
|
|
const struct in6_addr *daddr,
|
|
int oif);
|
|
# 84 "include/linux/ipv6.h" 2
|
|
# 1 "include/linux/tcp.h" 1
|
|
# 22 "include/linux/tcp.h"
|
|
# 1 "include/net/sock.h" 1
|
|
# 56 "include/net/sock.h"
|
|
# 1 "include/linux/uaccess.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void pagefault_disabled_inc(void)
|
|
{
|
|
(current_thread_info()->task)->pagefault_disabled++;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) void pagefault_disabled_dec(void)
|
|
{
|
|
(current_thread_info()->task)->pagefault_disabled--;
|
|
({ int __ret_warn_on = !!((current_thread_info()->task)->pagefault_disabled < 0); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/uaccess.h", 15); __builtin_expect(!!(__ret_warn_on), 0); });
|
|
}
|
|
# 25 "include/linux/uaccess.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pagefault_disable(void)
|
|
{
|
|
pagefault_disabled_inc();
|
|
|
|
|
|
|
|
|
|
__asm__ __volatile__("": : :"memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void pagefault_enable(void)
|
|
{
|
|
|
|
|
|
|
|
|
|
__asm__ __volatile__("": : :"memory");
|
|
pagefault_disabled_dec();
|
|
}
|
|
# 64 "include/linux/uaccess.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __copy_from_user_inatomic_nocache(void *to,
|
|
const void *from, unsigned long n)
|
|
{
|
|
return __copy_from_user(to, from, n);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __copy_from_user_nocache(void *to,
|
|
const void *from, unsigned long n)
|
|
{
|
|
return __copy_from_user(to, from, n);
|
|
}
|
|
# 87 "include/linux/uaccess.h"
|
|
extern long probe_kernel_read(void *dst, const void *src, size_t size);
|
|
extern long __probe_kernel_read(void *dst, const void *src, size_t size);
|
|
# 99 "include/linux/uaccess.h"
|
|
extern long __attribute__((no_instrument_function)) probe_kernel_write(void *dst, const void *src, size_t size);
|
|
extern long __attribute__((no_instrument_function)) __probe_kernel_write(void *dst, const void *src, size_t size);
|
|
|
|
extern long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count);
|
|
# 57 "include/net/sock.h" 2
|
|
# 1 "include/linux/page_counter.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct page_counter {
|
|
atomic_long_t count;
|
|
unsigned long limit;
|
|
struct page_counter *parent;
|
|
|
|
|
|
unsigned long watermark;
|
|
unsigned long failcnt;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void page_counter_init(struct page_counter *counter,
|
|
struct page_counter *parent)
|
|
{
|
|
atomic_long_set(&counter->count, 0);
|
|
counter->limit = ((long)(~0UL>>1));
|
|
counter->parent = parent;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long page_counter_read(struct page_counter *counter)
|
|
{
|
|
return atomic_long_read(&counter->count);
|
|
}
|
|
|
|
void page_counter_cancel(struct page_counter *counter, unsigned long nr_pages);
|
|
void page_counter_charge(struct page_counter *counter, unsigned long nr_pages);
|
|
bool page_counter_try_charge(struct page_counter *counter,
|
|
unsigned long nr_pages,
|
|
struct page_counter **fail);
|
|
void page_counter_uncharge(struct page_counter *counter, unsigned long nr_pages);
|
|
int page_counter_limit(struct page_counter *counter, unsigned long limit);
|
|
int page_counter_memparse(const char *buf, const char *max,
|
|
unsigned long *nr_pages);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void page_counter_reset_watermark(struct page_counter *counter)
|
|
{
|
|
counter->watermark = page_counter_read(counter);
|
|
}
|
|
# 58 "include/net/sock.h" 2
|
|
# 1 "include/linux/memcontrol.h" 1
|
|
# 27 "include/linux/memcontrol.h"
|
|
# 1 "include/linux/vmpressure.h" 1
|
|
# 10 "include/linux/vmpressure.h"
|
|
# 1 "include/linux/eventfd.h" 1
|
|
# 28 "include/linux/eventfd.h"
|
|
struct file;
|
|
|
|
|
|
|
|
struct file *eventfd_file_create(unsigned int count, int flags);
|
|
struct eventfd_ctx *eventfd_ctx_get(struct eventfd_ctx *ctx);
|
|
void eventfd_ctx_put(struct eventfd_ctx *ctx);
|
|
struct file *eventfd_fget(int fd);
|
|
struct eventfd_ctx *eventfd_ctx_fdget(int fd);
|
|
struct eventfd_ctx *eventfd_ctx_fileget(struct file *file);
|
|
__u64 eventfd_signal(struct eventfd_ctx *ctx, __u64 n);
|
|
ssize_t eventfd_ctx_read(struct eventfd_ctx *ctx, int no_wait, __u64 *cnt);
|
|
int eventfd_ctx_remove_wait_queue(struct eventfd_ctx *ctx, wait_queue_t *wait,
|
|
__u64 *cnt);
|
|
# 11 "include/linux/vmpressure.h" 2
|
|
|
|
struct vmpressure {
|
|
unsigned long scanned;
|
|
unsigned long reclaimed;
|
|
|
|
struct spinlock sr_lock;
|
|
|
|
|
|
struct list_head events;
|
|
|
|
struct mutex events_lock;
|
|
|
|
struct work_struct work;
|
|
};
|
|
|
|
struct mem_cgroup;
|
|
# 43 "include/linux/vmpressure.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void vmpressure(gfp_t gfp, struct mem_cgroup *memcg,
|
|
unsigned long scanned, unsigned long reclaimed) {}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void vmpressure_prio(gfp_t gfp, struct mem_cgroup *memcg,
|
|
int prio) {}
|
|
# 28 "include/linux/memcontrol.h" 2
|
|
|
|
|
|
# 1 "include/linux/writeback.h" 1
|
|
# 10 "include/linux/writeback.h"
|
|
# 1 "include/linux/flex_proportions.h" 1
|
|
# 27 "include/linux/flex_proportions.h"
|
|
struct fprop_global {
|
|
|
|
struct percpu_counter events;
|
|
|
|
unsigned int period;
|
|
|
|
seqcount_t sequence;
|
|
};
|
|
|
|
int fprop_global_init(struct fprop_global *p, gfp_t gfp);
|
|
void fprop_global_destroy(struct fprop_global *p);
|
|
bool fprop_new_period(struct fprop_global *p, int periods);
|
|
|
|
|
|
|
|
|
|
struct fprop_local_single {
|
|
|
|
unsigned long events;
|
|
|
|
unsigned int period;
|
|
raw_spinlock_t lock;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
int fprop_local_init_single(struct fprop_local_single *pl);
|
|
void fprop_local_destroy_single(struct fprop_local_single *pl);
|
|
void __fprop_inc_single(struct fprop_global *p, struct fprop_local_single *pl);
|
|
void fprop_fraction_single(struct fprop_global *p,
|
|
struct fprop_local_single *pl, unsigned long *numerator,
|
|
unsigned long *denominator);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
void fprop_inc_single(struct fprop_global *p, struct fprop_local_single *pl)
|
|
{
|
|
unsigned long flags;
|
|
|
|
do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0); } while (0);
|
|
__fprop_inc_single(p, pl);
|
|
do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); } while (0);
|
|
}
|
|
|
|
|
|
|
|
|
|
struct fprop_local_percpu {
|
|
|
|
struct percpu_counter events;
|
|
|
|
unsigned int period;
|
|
raw_spinlock_t lock;
|
|
};
|
|
|
|
int fprop_local_init_percpu(struct fprop_local_percpu *pl, gfp_t gfp);
|
|
void fprop_local_destroy_percpu(struct fprop_local_percpu *pl);
|
|
void __fprop_inc_percpu(struct fprop_global *p, struct fprop_local_percpu *pl);
|
|
void __fprop_inc_percpu_max(struct fprop_global *p, struct fprop_local_percpu *pl,
|
|
int max_frac);
|
|
void fprop_fraction_percpu(struct fprop_global *p,
|
|
struct fprop_local_percpu *pl, unsigned long *numerator,
|
|
unsigned long *denominator);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
void fprop_inc_percpu(struct fprop_global *p, struct fprop_local_percpu *pl)
|
|
{
|
|
unsigned long flags;
|
|
|
|
do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); flags = arch_local_irq_save(); } while (0); } while (0);
|
|
__fprop_inc_percpu(p, pl);
|
|
do { do { ({ unsigned long __dummy; typeof(flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); arch_local_irq_restore(flags); } while (0); } while (0);
|
|
}
|
|
# 11 "include/linux/writeback.h" 2
|
|
# 1 "include/linux/backing-dev-defs.h" 1
|
|
# 14 "include/linux/backing-dev-defs.h"
|
|
struct page;
|
|
struct device;
|
|
struct dentry;
|
|
|
|
|
|
|
|
|
|
enum wb_state {
|
|
WB_registered,
|
|
WB_writeback_running,
|
|
WB_has_dirty_io,
|
|
};
|
|
|
|
enum wb_congested_state {
|
|
WB_async_congested,
|
|
WB_sync_congested,
|
|
};
|
|
|
|
typedef int (congested_fn)(void *, int);
|
|
|
|
enum wb_stat_item {
|
|
WB_RECLAIMABLE,
|
|
WB_WRITEBACK,
|
|
WB_DIRTIED,
|
|
WB_WRITTEN,
|
|
NR_WB_STAT_ITEMS
|
|
};
|
|
# 51 "include/linux/backing-dev-defs.h"
|
|
struct bdi_writeback_congested {
|
|
unsigned long state;
|
|
atomic_t refcnt;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
# 81 "include/linux/backing-dev-defs.h"
|
|
struct bdi_writeback {
|
|
struct backing_dev_info *bdi;
|
|
|
|
unsigned long state;
|
|
unsigned long last_old_flush;
|
|
|
|
struct list_head b_dirty;
|
|
struct list_head b_io;
|
|
struct list_head b_more_io;
|
|
struct list_head b_dirty_time;
|
|
spinlock_t list_lock;
|
|
|
|
struct percpu_counter stat[NR_WB_STAT_ITEMS];
|
|
|
|
struct bdi_writeback_congested *congested;
|
|
|
|
unsigned long bw_time_stamp;
|
|
unsigned long dirtied_stamp;
|
|
unsigned long written_stamp;
|
|
unsigned long write_bandwidth;
|
|
unsigned long avg_write_bandwidth;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long dirty_ratelimit;
|
|
unsigned long balanced_dirty_ratelimit;
|
|
|
|
struct fprop_local_percpu completions;
|
|
int dirty_exceeded;
|
|
|
|
spinlock_t work_lock;
|
|
struct list_head work_list;
|
|
struct delayed_work dwork;
|
|
|
|
struct list_head bdi_node;
|
|
# 134 "include/linux/backing-dev-defs.h"
|
|
};
|
|
|
|
struct backing_dev_info {
|
|
struct list_head bdi_list;
|
|
unsigned long ra_pages;
|
|
unsigned int capabilities;
|
|
congested_fn *congested_fn;
|
|
void *congested_data;
|
|
|
|
char *name;
|
|
|
|
unsigned int min_ratio;
|
|
unsigned int max_ratio, max_prop_frac;
|
|
|
|
|
|
|
|
|
|
|
|
atomic_long_t tot_write_bandwidth;
|
|
|
|
struct bdi_writeback wb;
|
|
struct list_head wb_list;
|
|
|
|
|
|
|
|
|
|
|
|
struct bdi_writeback_congested *wb_congested;
|
|
|
|
wait_queue_head_t wb_waitq;
|
|
|
|
struct device *dev;
|
|
struct device *owner;
|
|
|
|
struct timer_list laptop_mode_wb_timer;
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
enum {
|
|
BLK_RW_ASYNC = 0,
|
|
BLK_RW_SYNC = 1,
|
|
};
|
|
|
|
void clear_wb_congested(struct bdi_writeback_congested *congested, int sync);
|
|
void set_wb_congested(struct bdi_writeback_congested *congested, int sync);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void clear_bdi_congested(struct backing_dev_info *bdi, int sync)
|
|
{
|
|
clear_wb_congested(bdi->wb.congested, sync);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_bdi_congested(struct backing_dev_info *bdi, int sync)
|
|
{
|
|
set_wb_congested(bdi->wb.congested, sync);
|
|
}
|
|
|
|
struct wb_lock_cookie {
|
|
bool locked;
|
|
unsigned long flags;
|
|
};
|
|
# 245 "include/linux/backing-dev-defs.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool wb_tryget(struct bdi_writeback *wb)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wb_get(struct bdi_writeback *wb)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wb_put(struct bdi_writeback *wb)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool wb_dying(struct bdi_writeback *wb)
|
|
{
|
|
return false;
|
|
}
|
|
# 12 "include/linux/writeback.h" 2
|
|
|
|
extern __attribute__((section(".data..percpu" ""))) __typeof__(int) dirty_throttle_leaks;
|
|
# 31 "include/linux/writeback.h"
|
|
struct backing_dev_info;
|
|
|
|
|
|
|
|
|
|
enum writeback_sync_modes {
|
|
WB_SYNC_NONE,
|
|
WB_SYNC_ALL,
|
|
};
|
|
|
|
|
|
|
|
|
|
enum wb_reason {
|
|
WB_REASON_BACKGROUND,
|
|
WB_REASON_TRY_TO_FREE_PAGES,
|
|
WB_REASON_SYNC,
|
|
WB_REASON_PERIODIC,
|
|
WB_REASON_LAPTOP_TIMER,
|
|
WB_REASON_FREE_MORE_MEM,
|
|
WB_REASON_FS_FREE_SPACE,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WB_REASON_FORKER_THREAD,
|
|
|
|
WB_REASON_MAX,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct writeback_control {
|
|
long nr_to_write;
|
|
|
|
long pages_skipped;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
loff_t range_start;
|
|
loff_t range_end;
|
|
|
|
enum writeback_sync_modes sync_mode;
|
|
|
|
unsigned for_kupdate:1;
|
|
unsigned for_background:1;
|
|
unsigned tagged_writepages:1;
|
|
unsigned for_reclaim:1;
|
|
unsigned range_cyclic:1;
|
|
unsigned for_sync:1;
|
|
# 101 "include/linux/writeback.h"
|
|
};
|
|
# 110 "include/linux/writeback.h"
|
|
struct wb_domain {
|
|
spinlock_t lock;
|
|
# 130 "include/linux/writeback.h"
|
|
struct fprop_global completions;
|
|
struct timer_list period_timer;
|
|
unsigned long period_time;
|
|
# 144 "include/linux/writeback.h"
|
|
unsigned long dirty_limit_tstamp;
|
|
unsigned long dirty_limit;
|
|
};
|
|
# 160 "include/linux/writeback.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wb_domain_size_changed(struct wb_domain *dom)
|
|
{
|
|
spin_lock(&dom->lock);
|
|
dom->dirty_limit_tstamp = jiffies;
|
|
dom->dirty_limit = 0;
|
|
spin_unlock(&dom->lock);
|
|
}
|
|
|
|
|
|
|
|
|
|
struct bdi_writeback;
|
|
void writeback_inodes_sb(struct super_block *, enum wb_reason reason);
|
|
void writeback_inodes_sb_nr(struct super_block *, unsigned long nr,
|
|
enum wb_reason reason);
|
|
bool try_to_writeback_inodes_sb(struct super_block *, enum wb_reason reason);
|
|
bool try_to_writeback_inodes_sb_nr(struct super_block *, unsigned long nr,
|
|
enum wb_reason reason);
|
|
void sync_inodes_sb(struct super_block *);
|
|
void wakeup_flusher_threads(long nr_pages, enum wb_reason reason);
|
|
void inode_wait_for_writeback(struct inode *inode);
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wait_on_inode(struct inode *inode)
|
|
{
|
|
do { do { } while (0); } while (0);
|
|
wait_on_bit(&inode->i_state, 3, 2);
|
|
}
|
|
# 272 "include/linux/writeback.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inode_attach_wb(struct inode *inode, struct page *page)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inode_detach_wb(struct inode *inode)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wbc_attach_and_unlock_inode(struct writeback_control *wbc,
|
|
struct inode *inode)
|
|
|
|
{
|
|
spin_unlock(&inode->i_lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wbc_attach_fdatawrite_inode(struct writeback_control *wbc,
|
|
struct inode *inode)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wbc_detach_inode(struct writeback_control *wbc)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wbc_init_bio(struct writeback_control *wbc, struct bio *bio)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void wbc_account_io(struct writeback_control *wbc,
|
|
struct page *page, size_t bytes)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void cgroup_writeback_umount(void)
|
|
{
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void laptop_io_completion(struct backing_dev_info *info);
|
|
void laptop_sync_completion(void);
|
|
void laptop_mode_sync(struct work_struct *work);
|
|
void laptop_mode_timer_fn(unsigned long data);
|
|
|
|
|
|
|
|
void throttle_vm_writeout(gfp_t gfp_mask);
|
|
bool zone_dirty_ok(struct zone *zone);
|
|
int wb_domain_init(struct wb_domain *dom, gfp_t gfp);
|
|
|
|
|
|
|
|
|
|
extern struct wb_domain global_wb_domain;
|
|
|
|
|
|
extern int dirty_background_ratio;
|
|
extern unsigned long dirty_background_bytes;
|
|
extern int vm_dirty_ratio;
|
|
extern unsigned long vm_dirty_bytes;
|
|
extern unsigned int dirty_writeback_interval;
|
|
extern unsigned int dirty_expire_interval;
|
|
extern unsigned int dirtytime_expire_interval;
|
|
extern int vm_highmem_is_dirtyable;
|
|
extern int block_dump;
|
|
extern int laptop_mode;
|
|
|
|
extern int dirty_background_ratio_handler(struct ctl_table *table, int write,
|
|
void *buffer, size_t *lenp,
|
|
loff_t *ppos);
|
|
extern int dirty_background_bytes_handler(struct ctl_table *table, int write,
|
|
void *buffer, size_t *lenp,
|
|
loff_t *ppos);
|
|
extern int dirty_ratio_handler(struct ctl_table *table, int write,
|
|
void *buffer, size_t *lenp,
|
|
loff_t *ppos);
|
|
extern int dirty_bytes_handler(struct ctl_table *table, int write,
|
|
void *buffer, size_t *lenp,
|
|
loff_t *ppos);
|
|
int dirtytime_interval_handler(struct ctl_table *table, int write,
|
|
void *buffer, size_t *lenp, loff_t *ppos);
|
|
|
|
struct ctl_table;
|
|
int dirty_writeback_centisecs_handler(struct ctl_table *, int,
|
|
void *, size_t *, loff_t *);
|
|
|
|
void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty);
|
|
unsigned long wb_calc_thresh(struct bdi_writeback *wb, unsigned long thresh);
|
|
|
|
void wb_update_bandwidth(struct bdi_writeback *wb, unsigned long start_time);
|
|
void page_writeback_init(void);
|
|
void balance_dirty_pages_ratelimited(struct address_space *mapping);
|
|
bool wb_over_bg_thresh(struct bdi_writeback *wb);
|
|
|
|
typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc,
|
|
void *data);
|
|
|
|
int generic_writepages(struct address_space *mapping,
|
|
struct writeback_control *wbc);
|
|
void tag_pages_for_writeback(struct address_space *mapping,
|
|
unsigned long start, unsigned long end);
|
|
int write_cache_pages(struct address_space *mapping,
|
|
struct writeback_control *wbc, writepage_t writepage,
|
|
void *data);
|
|
int do_writepages(struct address_space *mapping, struct writeback_control *wbc);
|
|
void writeback_set_ratelimit(void);
|
|
void tag_pages_for_writeback(struct address_space *mapping,
|
|
unsigned long start, unsigned long end);
|
|
|
|
void account_page_redirty(struct page *page);
|
|
# 31 "include/linux/memcontrol.h" 2
|
|
|
|
struct mem_cgroup;
|
|
struct page;
|
|
struct mm_struct;
|
|
struct kmem_cache;
|
|
|
|
|
|
|
|
|
|
|
|
enum mem_cgroup_stat_index {
|
|
|
|
|
|
|
|
MEM_CGROUP_STAT_CACHE,
|
|
MEM_CGROUP_STAT_RSS,
|
|
MEM_CGROUP_STAT_RSS_HUGE,
|
|
MEM_CGROUP_STAT_FILE_MAPPED,
|
|
MEM_CGROUP_STAT_DIRTY,
|
|
MEM_CGROUP_STAT_WRITEBACK,
|
|
MEM_CGROUP_STAT_SWAP,
|
|
MEM_CGROUP_STAT_NSTATS,
|
|
};
|
|
|
|
struct mem_cgroup_reclaim_cookie {
|
|
struct zone *zone;
|
|
int priority;
|
|
unsigned int generation;
|
|
};
|
|
|
|
enum mem_cgroup_events_index {
|
|
MEM_CGROUP_EVENTS_PGPGIN,
|
|
MEM_CGROUP_EVENTS_PGPGOUT,
|
|
MEM_CGROUP_EVENTS_PGFAULT,
|
|
MEM_CGROUP_EVENTS_PGMAJFAULT,
|
|
MEM_CGROUP_EVENTS_NSTATS,
|
|
|
|
MEMCG_LOW = MEM_CGROUP_EVENTS_NSTATS,
|
|
MEMCG_HIGH,
|
|
MEMCG_MAX,
|
|
MEMCG_OOM,
|
|
MEMCG_NR_EVENTS,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum mem_cgroup_events_target {
|
|
MEM_CGROUP_TARGET_THRESH,
|
|
MEM_CGROUP_TARGET_SOFTLIMIT,
|
|
MEM_CGROUP_TARGET_NUMAINFO,
|
|
MEM_CGROUP_NTARGETS,
|
|
};
|
|
|
|
|
|
|
|
|
|
enum cg_proto_flags {
|
|
|
|
MEMCG_SOCK_ACTIVE,
|
|
|
|
MEMCG_SOCK_ACTIVATED,
|
|
};
|
|
|
|
struct cg_proto {
|
|
struct page_counter memory_allocated;
|
|
struct percpu_counter sockets_allocated;
|
|
int memory_pressure;
|
|
long sysctl_mem[3];
|
|
unsigned long flags;
|
|
# 113 "include/linux/memcontrol.h"
|
|
struct mem_cgroup *memcg;
|
|
};
|
|
# 508 "include/linux/memcontrol.h"
|
|
struct mem_cgroup;
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mem_cgroup_events(struct mem_cgroup *memcg,
|
|
enum mem_cgroup_events_index idx,
|
|
unsigned int nr)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool mem_cgroup_low(struct mem_cgroup *root,
|
|
struct mem_cgroup *memcg)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int mem_cgroup_try_charge(struct page *page, struct mm_struct *mm,
|
|
gfp_t gfp_mask,
|
|
struct mem_cgroup **memcgp)
|
|
{
|
|
*memcgp = ((void *)0);
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mem_cgroup_commit_charge(struct page *page,
|
|
struct mem_cgroup *memcg,
|
|
bool lrucare)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mem_cgroup_cancel_charge(struct page *page,
|
|
struct mem_cgroup *memcg)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mem_cgroup_uncharge(struct page *page)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mem_cgroup_uncharge_list(struct list_head *page_list)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mem_cgroup_replace_page(struct page *old, struct page *new)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct lruvec *mem_cgroup_zone_lruvec(struct zone *zone,
|
|
struct mem_cgroup *memcg)
|
|
{
|
|
return &zone->lruvec;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct lruvec *mem_cgroup_page_lruvec(struct page *page,
|
|
struct zone *zone)
|
|
{
|
|
return &zone->lruvec;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool mm_match_cgroup(struct mm_struct *mm,
|
|
struct mem_cgroup *memcg)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool task_in_mem_cgroup(struct task_struct *task,
|
|
const struct mem_cgroup *memcg)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct mem_cgroup *
|
|
mem_cgroup_iter(struct mem_cgroup *root,
|
|
struct mem_cgroup *prev,
|
|
struct mem_cgroup_reclaim_cookie *reclaim)
|
|
{
|
|
return ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mem_cgroup_iter_break(struct mem_cgroup *root,
|
|
struct mem_cgroup *prev)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool mem_cgroup_disabled(void)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool
|
|
mem_cgroup_inactive_anon_is_low(struct lruvec *lruvec)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool mem_cgroup_lruvec_online(struct lruvec *lruvec)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
|
|
mem_cgroup_get_lru_size(struct lruvec *lruvec, enum lru_list lru)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
mem_cgroup_update_lru_size(struct lruvec *lruvec, enum lru_list lru,
|
|
int increment)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct mem_cgroup *mem_cgroup_begin_page_stat(struct page *page)
|
|
{
|
|
return ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mem_cgroup_end_page_stat(struct mem_cgroup *memcg)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mem_cgroup_handle_over_high(void)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mem_cgroup_oom_enable(void)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mem_cgroup_oom_disable(void)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool task_in_memcg_oom(struct task_struct *p)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool mem_cgroup_oom_synchronize(bool wait)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mem_cgroup_inc_page_stat(struct mem_cgroup *memcg,
|
|
enum mem_cgroup_stat_index idx)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mem_cgroup_dec_page_stat(struct mem_cgroup *memcg,
|
|
enum mem_cgroup_stat_index idx)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
|
|
gfp_t gfp_mask,
|
|
unsigned long *total_scanned)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mem_cgroup_split_huge_fixup(struct page *head)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx)
|
|
{
|
|
}
|
|
|
|
|
|
enum {
|
|
UNDER_LIMIT,
|
|
SOFT_LIMIT,
|
|
OVER_LIMIT,
|
|
};
|
|
# 698 "include/linux/memcontrol.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct wb_domain *mem_cgroup_wb_domain(struct bdi_writeback *wb)
|
|
{
|
|
return ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void mem_cgroup_wb_stats(struct bdi_writeback *wb,
|
|
unsigned long *pfilepages,
|
|
unsigned long *pheadroom,
|
|
unsigned long *pdirty,
|
|
unsigned long *pwriteback)
|
|
{
|
|
}
|
|
|
|
|
|
|
|
struct sock;
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sock_update_memcg(struct sock *sk)
|
|
{
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sock_release_memcg(struct sock *sk)
|
|
{
|
|
}
|
|
# 842 "include/linux/memcontrol.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool memcg_kmem_enabled(void)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool memcg_kmem_is_active(struct mem_cgroup *memcg)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int memcg_kmem_charge(struct page *page, gfp_t gfp, int order)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void memcg_kmem_uncharge(struct page *page, int order)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int memcg_cache_id(struct mem_cgroup *memcg)
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void memcg_get_cache_ids(void)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void memcg_put_cache_ids(void)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct kmem_cache *
|
|
memcg_kmem_get_cache(struct kmem_cache *cachep, gfp_t gfp)
|
|
{
|
|
return cachep;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void memcg_kmem_put_cache(struct kmem_cache *cachep)
|
|
{
|
|
}
|
|
# 59 "include/net/sock.h" 2
|
|
# 1 "include/linux/static_key.h" 1
|
|
# 60 "include/net/sock.h" 2
|
|
|
|
|
|
# 1 "include/linux/filter.h" 1
|
|
# 16 "include/linux/filter.h"
|
|
# 1 "include/net/sch_generic.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "./include/uapi/linux/pkt_sched.h" 1
|
|
# 32 "./include/uapi/linux/pkt_sched.h"
|
|
struct tc_stats {
|
|
__u64 bytes;
|
|
__u32 packets;
|
|
__u32 drops;
|
|
__u32 overlimits;
|
|
|
|
__u32 bps;
|
|
__u32 pps;
|
|
__u32 qlen;
|
|
__u32 backlog;
|
|
};
|
|
|
|
struct tc_estimator {
|
|
signed char interval;
|
|
unsigned char ewma_log;
|
|
};
|
|
# 77 "./include/uapi/linux/pkt_sched.h"
|
|
enum tc_link_layer {
|
|
TC_LINKLAYER_UNAWARE,
|
|
TC_LINKLAYER_ETHERNET,
|
|
TC_LINKLAYER_ATM,
|
|
};
|
|
|
|
|
|
struct tc_ratespec {
|
|
unsigned char cell_log;
|
|
__u8 linklayer;
|
|
unsigned short overhead;
|
|
short cell_align;
|
|
unsigned short mpu;
|
|
__u32 rate;
|
|
};
|
|
|
|
|
|
|
|
struct tc_sizespec {
|
|
unsigned char cell_log;
|
|
unsigned char size_log;
|
|
short cell_align;
|
|
int overhead;
|
|
unsigned int linklayer;
|
|
unsigned int mpu;
|
|
unsigned int mtu;
|
|
unsigned int tsize;
|
|
};
|
|
|
|
enum {
|
|
TCA_STAB_UNSPEC,
|
|
TCA_STAB_BASE,
|
|
TCA_STAB_DATA,
|
|
__TCA_STAB_MAX
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct tc_fifo_qopt {
|
|
__u32 limit;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct tc_prio_qopt {
|
|
int bands;
|
|
__u8 priomap[15 +1];
|
|
};
|
|
|
|
|
|
|
|
struct tc_multiq_qopt {
|
|
__u16 bands;
|
|
__u16 max_bands;
|
|
};
|
|
# 145 "./include/uapi/linux/pkt_sched.h"
|
|
struct tc_plug_qopt {
|
|
# 155 "./include/uapi/linux/pkt_sched.h"
|
|
int action;
|
|
__u32 limit;
|
|
};
|
|
|
|
|
|
|
|
struct tc_tbf_qopt {
|
|
struct tc_ratespec rate;
|
|
struct tc_ratespec peakrate;
|
|
__u32 limit;
|
|
__u32 buffer;
|
|
__u32 mtu;
|
|
};
|
|
|
|
enum {
|
|
TCA_TBF_UNSPEC,
|
|
TCA_TBF_PARMS,
|
|
TCA_TBF_RTAB,
|
|
TCA_TBF_PTAB,
|
|
TCA_TBF_RATE64,
|
|
TCA_TBF_PRATE64,
|
|
TCA_TBF_BURST,
|
|
TCA_TBF_PBURST,
|
|
__TCA_TBF_MAX,
|
|
};
|
|
# 190 "./include/uapi/linux/pkt_sched.h"
|
|
struct tc_sfq_qopt {
|
|
unsigned quantum;
|
|
int perturb_period;
|
|
__u32 limit;
|
|
unsigned divisor;
|
|
unsigned flows;
|
|
};
|
|
|
|
struct tc_sfqred_stats {
|
|
__u32 prob_drop;
|
|
__u32 forced_drop;
|
|
__u32 prob_mark;
|
|
__u32 forced_mark;
|
|
__u32 prob_mark_head;
|
|
__u32 forced_mark_head;
|
|
};
|
|
|
|
struct tc_sfq_qopt_v1 {
|
|
struct tc_sfq_qopt v0;
|
|
unsigned int depth;
|
|
unsigned int headdrop;
|
|
|
|
__u32 limit;
|
|
__u32 qth_min;
|
|
__u32 qth_max;
|
|
unsigned char Wlog;
|
|
unsigned char Plog;
|
|
unsigned char Scell_log;
|
|
unsigned char flags;
|
|
__u32 max_P;
|
|
|
|
struct tc_sfqred_stats stats;
|
|
};
|
|
|
|
|
|
struct tc_sfq_xstats {
|
|
__s32 allot;
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
TCA_RED_UNSPEC,
|
|
TCA_RED_PARMS,
|
|
TCA_RED_STAB,
|
|
TCA_RED_MAX_P,
|
|
__TCA_RED_MAX,
|
|
};
|
|
|
|
|
|
|
|
struct tc_red_qopt {
|
|
__u32 limit;
|
|
__u32 qth_min;
|
|
__u32 qth_max;
|
|
unsigned char Wlog;
|
|
unsigned char Plog;
|
|
unsigned char Scell_log;
|
|
unsigned char flags;
|
|
|
|
|
|
|
|
};
|
|
|
|
struct tc_red_xstats {
|
|
__u32 early;
|
|
__u32 pdrop;
|
|
__u32 other;
|
|
__u32 marked;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
TCA_GRED_UNSPEC,
|
|
TCA_GRED_PARMS,
|
|
TCA_GRED_STAB,
|
|
TCA_GRED_DPS,
|
|
TCA_GRED_MAX_P,
|
|
TCA_GRED_LIMIT,
|
|
__TCA_GRED_MAX,
|
|
};
|
|
|
|
|
|
|
|
struct tc_gred_qopt {
|
|
__u32 limit;
|
|
__u32 qth_min;
|
|
__u32 qth_max;
|
|
__u32 DP;
|
|
__u32 backlog;
|
|
__u32 qave;
|
|
__u32 forced;
|
|
__u32 early;
|
|
__u32 other;
|
|
__u32 pdrop;
|
|
__u8 Wlog;
|
|
__u8 Plog;
|
|
__u8 Scell_log;
|
|
__u8 prio;
|
|
__u32 packets;
|
|
__u32 bytesin;
|
|
};
|
|
|
|
|
|
struct tc_gred_sopt {
|
|
__u32 DPs;
|
|
__u32 def_DP;
|
|
__u8 grio;
|
|
__u8 flags;
|
|
__u16 pad1;
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
TCA_CHOKE_UNSPEC,
|
|
TCA_CHOKE_PARMS,
|
|
TCA_CHOKE_STAB,
|
|
TCA_CHOKE_MAX_P,
|
|
__TCA_CHOKE_MAX,
|
|
};
|
|
|
|
|
|
|
|
struct tc_choke_qopt {
|
|
__u32 limit;
|
|
__u32 qth_min;
|
|
__u32 qth_max;
|
|
unsigned char Wlog;
|
|
unsigned char Plog;
|
|
unsigned char Scell_log;
|
|
unsigned char flags;
|
|
};
|
|
|
|
struct tc_choke_xstats {
|
|
__u32 early;
|
|
__u32 pdrop;
|
|
__u32 other;
|
|
__u32 marked;
|
|
__u32 matched;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct tc_htb_opt {
|
|
struct tc_ratespec rate;
|
|
struct tc_ratespec ceil;
|
|
__u32 buffer;
|
|
__u32 cbuffer;
|
|
__u32 quantum;
|
|
__u32 level;
|
|
__u32 prio;
|
|
};
|
|
struct tc_htb_glob {
|
|
__u32 version;
|
|
__u32 rate2quantum;
|
|
__u32 defcls;
|
|
__u32 debug;
|
|
|
|
|
|
__u32 direct_pkts;
|
|
};
|
|
enum {
|
|
TCA_HTB_UNSPEC,
|
|
TCA_HTB_PARMS,
|
|
TCA_HTB_INIT,
|
|
TCA_HTB_CTAB,
|
|
TCA_HTB_RTAB,
|
|
TCA_HTB_DIRECT_QLEN,
|
|
TCA_HTB_RATE64,
|
|
TCA_HTB_CEIL64,
|
|
__TCA_HTB_MAX,
|
|
};
|
|
|
|
|
|
|
|
struct tc_htb_xstats {
|
|
__u32 lends;
|
|
__u32 borrows;
|
|
__u32 giants;
|
|
__u32 tokens;
|
|
__u32 ctokens;
|
|
};
|
|
|
|
|
|
|
|
struct tc_hfsc_qopt {
|
|
__u16 defcls;
|
|
};
|
|
|
|
struct tc_service_curve {
|
|
__u32 m1;
|
|
__u32 d;
|
|
__u32 m2;
|
|
};
|
|
|
|
struct tc_hfsc_stats {
|
|
__u64 work;
|
|
__u64 rtwork;
|
|
__u32 period;
|
|
__u32 level;
|
|
};
|
|
|
|
enum {
|
|
TCA_HFSC_UNSPEC,
|
|
TCA_HFSC_RSC,
|
|
TCA_HFSC_FSC,
|
|
TCA_HFSC_USC,
|
|
__TCA_HFSC_MAX,
|
|
};
|
|
# 416 "./include/uapi/linux/pkt_sched.h"
|
|
struct tc_cbq_lssopt {
|
|
unsigned char change;
|
|
unsigned char flags;
|
|
|
|
|
|
unsigned char ewma_log;
|
|
unsigned char level;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__u32 maxidle;
|
|
__u32 minidle;
|
|
__u32 offtime;
|
|
__u32 avpkt;
|
|
};
|
|
|
|
struct tc_cbq_wrropt {
|
|
unsigned char flags;
|
|
unsigned char priority;
|
|
unsigned char cpriority;
|
|
unsigned char __reserved;
|
|
__u32 allot;
|
|
__u32 weight;
|
|
};
|
|
|
|
struct tc_cbq_ovl {
|
|
unsigned char strategy;
|
|
|
|
|
|
|
|
|
|
|
|
unsigned char priority2;
|
|
__u16 pad;
|
|
__u32 penalty;
|
|
};
|
|
|
|
struct tc_cbq_police {
|
|
unsigned char police;
|
|
unsigned char __res1;
|
|
unsigned short __res2;
|
|
};
|
|
|
|
struct tc_cbq_fopt {
|
|
__u32 split;
|
|
__u32 defmap;
|
|
__u32 defchange;
|
|
};
|
|
|
|
struct tc_cbq_xstats {
|
|
__u32 borrows;
|
|
__u32 overactions;
|
|
__s32 avgidle;
|
|
__s32 undertime;
|
|
};
|
|
|
|
enum {
|
|
TCA_CBQ_UNSPEC,
|
|
TCA_CBQ_LSSOPT,
|
|
TCA_CBQ_WRROPT,
|
|
TCA_CBQ_FOPT,
|
|
TCA_CBQ_OVL_STRATEGY,
|
|
TCA_CBQ_RATE,
|
|
TCA_CBQ_RTAB,
|
|
TCA_CBQ_POLICE,
|
|
__TCA_CBQ_MAX,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
TCA_DSMARK_UNSPEC,
|
|
TCA_DSMARK_INDICES,
|
|
TCA_DSMARK_DEFAULT_INDEX,
|
|
TCA_DSMARK_SET_TC_INDEX,
|
|
TCA_DSMARK_MASK,
|
|
TCA_DSMARK_VALUE,
|
|
__TCA_DSMARK_MAX,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
TCA_ATM_UNSPEC,
|
|
TCA_ATM_FD,
|
|
TCA_ATM_PTR,
|
|
TCA_ATM_HDR,
|
|
TCA_ATM_EXCESS,
|
|
TCA_ATM_ADDR,
|
|
TCA_ATM_STATE,
|
|
__TCA_ATM_MAX,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
TCA_NETEM_UNSPEC,
|
|
TCA_NETEM_CORR,
|
|
TCA_NETEM_DELAY_DIST,
|
|
TCA_NETEM_REORDER,
|
|
TCA_NETEM_CORRUPT,
|
|
TCA_NETEM_LOSS,
|
|
TCA_NETEM_RATE,
|
|
TCA_NETEM_ECN,
|
|
TCA_NETEM_RATE64,
|
|
__TCA_NETEM_MAX,
|
|
};
|
|
|
|
|
|
|
|
struct tc_netem_qopt {
|
|
__u32 latency;
|
|
__u32 limit;
|
|
__u32 loss;
|
|
__u32 gap;
|
|
__u32 duplicate;
|
|
__u32 jitter;
|
|
};
|
|
|
|
struct tc_netem_corr {
|
|
__u32 delay_corr;
|
|
__u32 loss_corr;
|
|
__u32 dup_corr;
|
|
};
|
|
|
|
struct tc_netem_reorder {
|
|
__u32 probability;
|
|
__u32 correlation;
|
|
};
|
|
|
|
struct tc_netem_corrupt {
|
|
__u32 probability;
|
|
__u32 correlation;
|
|
};
|
|
|
|
struct tc_netem_rate {
|
|
__u32 rate;
|
|
__s32 packet_overhead;
|
|
__u32 cell_size;
|
|
__s32 cell_overhead;
|
|
};
|
|
|
|
enum {
|
|
NETEM_LOSS_UNSPEC,
|
|
NETEM_LOSS_GI,
|
|
NETEM_LOSS_GE,
|
|
__NETEM_LOSS_MAX
|
|
};
|
|
|
|
|
|
|
|
struct tc_netem_gimodel {
|
|
__u32 p13;
|
|
__u32 p31;
|
|
__u32 p32;
|
|
__u32 p14;
|
|
__u32 p23;
|
|
};
|
|
|
|
|
|
struct tc_netem_gemodel {
|
|
__u32 p;
|
|
__u32 r;
|
|
__u32 h;
|
|
__u32 k1;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
TCA_DRR_UNSPEC,
|
|
TCA_DRR_QUANTUM,
|
|
__TCA_DRR_MAX
|
|
};
|
|
|
|
|
|
|
|
struct tc_drr_stats {
|
|
__u32 deficit;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct tc_mqprio_qopt {
|
|
__u8 num_tc;
|
|
__u8 prio_tc_map[15 + 1];
|
|
__u8 hw;
|
|
__u16 count[16];
|
|
__u16 offset[16];
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
TCA_SFB_UNSPEC,
|
|
TCA_SFB_PARMS,
|
|
__TCA_SFB_MAX,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct tc_sfb_qopt {
|
|
__u32 rehash_interval;
|
|
__u32 warmup_time;
|
|
__u32 max;
|
|
__u32 bin_size;
|
|
__u32 increment;
|
|
__u32 decrement;
|
|
__u32 limit;
|
|
__u32 penalty_rate;
|
|
__u32 penalty_burst;
|
|
};
|
|
|
|
struct tc_sfb_xstats {
|
|
__u32 earlydrop;
|
|
__u32 penaltydrop;
|
|
__u32 bucketdrop;
|
|
__u32 queuedrop;
|
|
__u32 childdrop;
|
|
__u32 marked;
|
|
__u32 maxqlen;
|
|
__u32 maxprob;
|
|
__u32 avgprob;
|
|
};
|
|
|
|
|
|
|
|
|
|
enum {
|
|
TCA_QFQ_UNSPEC,
|
|
TCA_QFQ_WEIGHT,
|
|
TCA_QFQ_LMAX,
|
|
__TCA_QFQ_MAX
|
|
};
|
|
|
|
|
|
|
|
struct tc_qfq_stats {
|
|
__u32 weight;
|
|
__u32 lmax;
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
TCA_CODEL_UNSPEC,
|
|
TCA_CODEL_TARGET,
|
|
TCA_CODEL_LIMIT,
|
|
TCA_CODEL_INTERVAL,
|
|
TCA_CODEL_ECN,
|
|
TCA_CODEL_CE_THRESHOLD,
|
|
__TCA_CODEL_MAX
|
|
};
|
|
|
|
|
|
|
|
struct tc_codel_xstats {
|
|
__u32 maxpacket;
|
|
__u32 count;
|
|
|
|
|
|
__u32 lastcount;
|
|
__u32 ldelay;
|
|
__s32 drop_next;
|
|
__u32 drop_overlimit;
|
|
__u32 ecn_mark;
|
|
__u32 dropping;
|
|
__u32 ce_mark;
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
TCA_FQ_CODEL_UNSPEC,
|
|
TCA_FQ_CODEL_TARGET,
|
|
TCA_FQ_CODEL_LIMIT,
|
|
TCA_FQ_CODEL_INTERVAL,
|
|
TCA_FQ_CODEL_ECN,
|
|
TCA_FQ_CODEL_FLOWS,
|
|
TCA_FQ_CODEL_QUANTUM,
|
|
TCA_FQ_CODEL_CE_THRESHOLD,
|
|
__TCA_FQ_CODEL_MAX
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
TCA_FQ_CODEL_XSTATS_QDISC,
|
|
TCA_FQ_CODEL_XSTATS_CLASS,
|
|
};
|
|
|
|
struct tc_fq_codel_qd_stats {
|
|
__u32 maxpacket;
|
|
__u32 drop_overlimit;
|
|
|
|
|
|
__u32 ecn_mark;
|
|
|
|
|
|
__u32 new_flow_count;
|
|
|
|
|
|
__u32 new_flows_len;
|
|
__u32 old_flows_len;
|
|
__u32 ce_mark;
|
|
};
|
|
|
|
struct tc_fq_codel_cl_stats {
|
|
__s32 deficit;
|
|
__u32 ldelay;
|
|
|
|
|
|
__u32 count;
|
|
__u32 lastcount;
|
|
__u32 dropping;
|
|
__s32 drop_next;
|
|
};
|
|
|
|
struct tc_fq_codel_xstats {
|
|
__u32 type;
|
|
union {
|
|
struct tc_fq_codel_qd_stats qdisc_stats;
|
|
struct tc_fq_codel_cl_stats class_stats;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
TCA_FQ_UNSPEC,
|
|
|
|
TCA_FQ_PLIMIT,
|
|
|
|
TCA_FQ_FLOW_PLIMIT,
|
|
|
|
TCA_FQ_QUANTUM,
|
|
|
|
TCA_FQ_INITIAL_QUANTUM,
|
|
|
|
TCA_FQ_RATE_ENABLE,
|
|
|
|
TCA_FQ_FLOW_DEFAULT_RATE,
|
|
|
|
TCA_FQ_FLOW_MAX_RATE,
|
|
|
|
TCA_FQ_BUCKETS_LOG,
|
|
|
|
TCA_FQ_FLOW_REFILL_DELAY,
|
|
|
|
TCA_FQ_ORPHAN_MASK,
|
|
|
|
__TCA_FQ_MAX
|
|
};
|
|
|
|
|
|
|
|
struct tc_fq_qd_stats {
|
|
__u64 gc_flows;
|
|
__u64 highprio_packets;
|
|
__u64 tcp_retrans;
|
|
__u64 throttled;
|
|
__u64 flows_plimit;
|
|
__u64 pkts_too_long;
|
|
__u64 allocation_errors;
|
|
__s64 time_next_delayed_flow;
|
|
__u32 flows;
|
|
__u32 inactive_flows;
|
|
__u32 throttled_flows;
|
|
__u32 pad;
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
TCA_HHF_UNSPEC,
|
|
TCA_HHF_BACKLOG_LIMIT,
|
|
TCA_HHF_QUANTUM,
|
|
TCA_HHF_HH_FLOWS_LIMIT,
|
|
TCA_HHF_RESET_TIMEOUT,
|
|
TCA_HHF_ADMIT_BYTES,
|
|
TCA_HHF_EVICT_TIMEOUT,
|
|
TCA_HHF_NON_HH_WEIGHT,
|
|
__TCA_HHF_MAX
|
|
};
|
|
|
|
|
|
|
|
struct tc_hhf_xstats {
|
|
__u32 drop_overlimit;
|
|
|
|
|
|
__u32 hh_overlimit;
|
|
__u32 hh_tot_count;
|
|
__u32 hh_cur_count;
|
|
};
|
|
|
|
|
|
enum {
|
|
TCA_PIE_UNSPEC,
|
|
TCA_PIE_TARGET,
|
|
TCA_PIE_LIMIT,
|
|
TCA_PIE_TUPDATE,
|
|
TCA_PIE_ALPHA,
|
|
TCA_PIE_BETA,
|
|
TCA_PIE_ECN,
|
|
TCA_PIE_BYTEMODE,
|
|
__TCA_PIE_MAX
|
|
};
|
|
|
|
|
|
struct tc_pie_xstats {
|
|
__u32 prob;
|
|
__u32 delay;
|
|
__u32 avg_dq_rate;
|
|
__u32 packets_in;
|
|
__u32 dropped;
|
|
__u32 overlimit;
|
|
__u32 maxq;
|
|
__u32 ecn_mark;
|
|
};
|
|
# 8 "include/net/sch_generic.h" 2
|
|
# 1 "./include/uapi/linux/pkt_cls.h" 1
|
|
# 63 "./include/uapi/linux/pkt_cls.h"
|
|
enum {
|
|
TCA_ACT_UNSPEC,
|
|
TCA_ACT_KIND,
|
|
TCA_ACT_OPTIONS,
|
|
TCA_ACT_INDEX,
|
|
TCA_ACT_STATS,
|
|
__TCA_ACT_MAX
|
|
};
|
|
# 94 "./include/uapi/linux/pkt_cls.h"
|
|
enum {
|
|
TCA_ID_UNSPEC=0,
|
|
TCA_ID_POLICE=1,
|
|
|
|
__TCA_ID_MAX=255
|
|
};
|
|
|
|
|
|
|
|
struct tc_police {
|
|
__u32 index;
|
|
int action;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__u32 limit;
|
|
__u32 burst;
|
|
__u32 mtu;
|
|
struct tc_ratespec rate;
|
|
struct tc_ratespec peakrate;
|
|
int refcnt;
|
|
int bindcnt;
|
|
__u32 capab;
|
|
};
|
|
|
|
struct tcf_t {
|
|
__u64 install;
|
|
__u64 lastuse;
|
|
__u64 expires;
|
|
};
|
|
|
|
struct tc_cnt {
|
|
int refcnt;
|
|
int bindcnt;
|
|
};
|
|
# 140 "./include/uapi/linux/pkt_cls.h"
|
|
enum {
|
|
TCA_POLICE_UNSPEC,
|
|
TCA_POLICE_TBF,
|
|
TCA_POLICE_RATE,
|
|
TCA_POLICE_PEAKRATE,
|
|
TCA_POLICE_AVRATE,
|
|
TCA_POLICE_RESULT,
|
|
__TCA_POLICE_MAX
|
|
|
|
};
|
|
# 163 "./include/uapi/linux/pkt_cls.h"
|
|
enum {
|
|
TCA_U32_UNSPEC,
|
|
TCA_U32_CLASSID,
|
|
TCA_U32_HASH,
|
|
TCA_U32_LINK,
|
|
TCA_U32_DIVISOR,
|
|
TCA_U32_SEL,
|
|
TCA_U32_POLICE,
|
|
TCA_U32_ACT,
|
|
TCA_U32_INDEV,
|
|
TCA_U32_PCNT,
|
|
TCA_U32_MARK,
|
|
__TCA_U32_MAX
|
|
};
|
|
|
|
|
|
|
|
struct tc_u32_key {
|
|
__be32 mask;
|
|
__be32 val;
|
|
int off;
|
|
int offmask;
|
|
};
|
|
|
|
struct tc_u32_sel {
|
|
unsigned char flags;
|
|
unsigned char offshift;
|
|
unsigned char nkeys;
|
|
|
|
__be16 offmask;
|
|
__u16 off;
|
|
short offoff;
|
|
|
|
short hoff;
|
|
__be32 hmask;
|
|
struct tc_u32_key keys[0];
|
|
};
|
|
|
|
struct tc_u32_mark {
|
|
__u32 val;
|
|
__u32 mask;
|
|
__u32 success;
|
|
};
|
|
|
|
struct tc_u32_pcnt {
|
|
__u64 rcnt;
|
|
__u64 rhit;
|
|
__u64 kcnts[0];
|
|
};
|
|
# 225 "./include/uapi/linux/pkt_cls.h"
|
|
enum {
|
|
TCA_RSVP_UNSPEC,
|
|
TCA_RSVP_CLASSID,
|
|
TCA_RSVP_DST,
|
|
TCA_RSVP_SRC,
|
|
TCA_RSVP_PINFO,
|
|
TCA_RSVP_POLICE,
|
|
TCA_RSVP_ACT,
|
|
__TCA_RSVP_MAX
|
|
};
|
|
|
|
|
|
|
|
struct tc_rsvp_gpi {
|
|
__u32 key;
|
|
__u32 mask;
|
|
int offset;
|
|
};
|
|
|
|
struct tc_rsvp_pinfo {
|
|
struct tc_rsvp_gpi dpi;
|
|
struct tc_rsvp_gpi spi;
|
|
__u8 protocol;
|
|
__u8 tunnelid;
|
|
__u8 tunnelhdr;
|
|
__u8 pad;
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
TCA_ROUTE4_UNSPEC,
|
|
TCA_ROUTE4_CLASSID,
|
|
TCA_ROUTE4_TO,
|
|
TCA_ROUTE4_FROM,
|
|
TCA_ROUTE4_IIF,
|
|
TCA_ROUTE4_POLICE,
|
|
TCA_ROUTE4_ACT,
|
|
__TCA_ROUTE4_MAX
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
TCA_FW_UNSPEC,
|
|
TCA_FW_CLASSID,
|
|
TCA_FW_POLICE,
|
|
TCA_FW_INDEV,
|
|
TCA_FW_ACT,
|
|
TCA_FW_MASK,
|
|
__TCA_FW_MAX
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
TCA_TCINDEX_UNSPEC,
|
|
TCA_TCINDEX_HASH,
|
|
TCA_TCINDEX_MASK,
|
|
TCA_TCINDEX_SHIFT,
|
|
TCA_TCINDEX_FALL_THROUGH,
|
|
TCA_TCINDEX_CLASSID,
|
|
TCA_TCINDEX_POLICE,
|
|
TCA_TCINDEX_ACT,
|
|
__TCA_TCINDEX_MAX
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
FLOW_KEY_SRC,
|
|
FLOW_KEY_DST,
|
|
FLOW_KEY_PROTO,
|
|
FLOW_KEY_PROTO_SRC,
|
|
FLOW_KEY_PROTO_DST,
|
|
FLOW_KEY_IIF,
|
|
FLOW_KEY_PRIORITY,
|
|
FLOW_KEY_MARK,
|
|
FLOW_KEY_NFCT,
|
|
FLOW_KEY_NFCT_SRC,
|
|
FLOW_KEY_NFCT_DST,
|
|
FLOW_KEY_NFCT_PROTO_SRC,
|
|
FLOW_KEY_NFCT_PROTO_DST,
|
|
FLOW_KEY_RTCLASSID,
|
|
FLOW_KEY_SKUID,
|
|
FLOW_KEY_SKGID,
|
|
FLOW_KEY_VLAN_TAG,
|
|
FLOW_KEY_RXHASH,
|
|
__FLOW_KEY_MAX,
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
FLOW_MODE_MAP,
|
|
FLOW_MODE_HASH,
|
|
};
|
|
|
|
enum {
|
|
TCA_FLOW_UNSPEC,
|
|
TCA_FLOW_KEYS,
|
|
TCA_FLOW_MODE,
|
|
TCA_FLOW_BASECLASS,
|
|
TCA_FLOW_RSHIFT,
|
|
TCA_FLOW_ADDEND,
|
|
TCA_FLOW_MASK,
|
|
TCA_FLOW_XOR,
|
|
TCA_FLOW_DIVISOR,
|
|
TCA_FLOW_ACT,
|
|
TCA_FLOW_POLICE,
|
|
TCA_FLOW_EMATCHES,
|
|
TCA_FLOW_PERTURB,
|
|
__TCA_FLOW_MAX
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
TCA_BASIC_UNSPEC,
|
|
TCA_BASIC_CLASSID,
|
|
TCA_BASIC_EMATCHES,
|
|
TCA_BASIC_ACT,
|
|
TCA_BASIC_POLICE,
|
|
__TCA_BASIC_MAX
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
TCA_CGROUP_UNSPEC,
|
|
TCA_CGROUP_ACT,
|
|
TCA_CGROUP_POLICE,
|
|
TCA_CGROUP_EMATCHES,
|
|
__TCA_CGROUP_MAX,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
TCA_BPF_UNSPEC,
|
|
TCA_BPF_ACT,
|
|
TCA_BPF_POLICE,
|
|
TCA_BPF_CLASSID,
|
|
TCA_BPF_OPS_LEN,
|
|
TCA_BPF_OPS,
|
|
TCA_BPF_FD,
|
|
TCA_BPF_NAME,
|
|
TCA_BPF_FLAGS,
|
|
__TCA_BPF_MAX,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
TCA_FLOWER_UNSPEC,
|
|
TCA_FLOWER_CLASSID,
|
|
TCA_FLOWER_INDEV,
|
|
TCA_FLOWER_ACT,
|
|
TCA_FLOWER_KEY_ETH_DST,
|
|
TCA_FLOWER_KEY_ETH_DST_MASK,
|
|
TCA_FLOWER_KEY_ETH_SRC,
|
|
TCA_FLOWER_KEY_ETH_SRC_MASK,
|
|
TCA_FLOWER_KEY_ETH_TYPE,
|
|
TCA_FLOWER_KEY_IP_PROTO,
|
|
TCA_FLOWER_KEY_IPV4_SRC,
|
|
TCA_FLOWER_KEY_IPV4_SRC_MASK,
|
|
TCA_FLOWER_KEY_IPV4_DST,
|
|
TCA_FLOWER_KEY_IPV4_DST_MASK,
|
|
TCA_FLOWER_KEY_IPV6_SRC,
|
|
TCA_FLOWER_KEY_IPV6_SRC_MASK,
|
|
TCA_FLOWER_KEY_IPV6_DST,
|
|
TCA_FLOWER_KEY_IPV6_DST_MASK,
|
|
TCA_FLOWER_KEY_TCP_SRC,
|
|
TCA_FLOWER_KEY_TCP_DST,
|
|
TCA_FLOWER_KEY_UDP_SRC,
|
|
TCA_FLOWER_KEY_UDP_DST,
|
|
__TCA_FLOWER_MAX,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct tcf_ematch_tree_hdr {
|
|
__u16 nmatches;
|
|
__u16 progid;
|
|
};
|
|
|
|
enum {
|
|
TCA_EMATCH_TREE_UNSPEC,
|
|
TCA_EMATCH_TREE_HDR,
|
|
TCA_EMATCH_TREE_LIST,
|
|
__TCA_EMATCH_TREE_MAX
|
|
};
|
|
|
|
|
|
struct tcf_ematch_hdr {
|
|
__u16 matchid;
|
|
__u16 kind;
|
|
__u16 flags;
|
|
__u16 pad;
|
|
};
|
|
# 469 "./include/uapi/linux/pkt_cls.h"
|
|
enum {
|
|
TCF_LAYER_LINK,
|
|
TCF_LAYER_NETWORK,
|
|
TCF_LAYER_TRANSPORT,
|
|
__TCF_LAYER_MAX
|
|
};
|
|
# 492 "./include/uapi/linux/pkt_cls.h"
|
|
enum {
|
|
TCF_EM_PROG_TC
|
|
};
|
|
|
|
enum {
|
|
TCF_EM_OPND_EQ,
|
|
TCF_EM_OPND_GT,
|
|
TCF_EM_OPND_LT
|
|
};
|
|
# 9 "include/net/sch_generic.h" 2
|
|
|
|
|
|
# 1 "include/net/gen_stats.h" 1
|
|
|
|
|
|
|
|
# 1 "./include/uapi/linux/gen_stats.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
TCA_STATS_UNSPEC,
|
|
TCA_STATS_BASIC,
|
|
TCA_STATS_RATE_EST,
|
|
TCA_STATS_QUEUE,
|
|
TCA_STATS_APP,
|
|
TCA_STATS_RATE_EST64,
|
|
__TCA_STATS_MAX,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct gnet_stats_basic {
|
|
__u64 bytes;
|
|
__u32 packets;
|
|
};
|
|
struct gnet_stats_basic_packed {
|
|
__u64 bytes;
|
|
__u32 packets;
|
|
} __attribute__ ((packed));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct gnet_stats_rate_est {
|
|
__u32 bps;
|
|
__u32 pps;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct gnet_stats_rate_est64 {
|
|
__u64 bps;
|
|
__u64 pps;
|
|
};
|
|
# 59 "./include/uapi/linux/gen_stats.h"
|
|
struct gnet_stats_queue {
|
|
__u32 qlen;
|
|
__u32 backlog;
|
|
__u32 drops;
|
|
__u32 requeues;
|
|
__u32 overlimits;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct gnet_estimator {
|
|
signed char interval;
|
|
unsigned char ewma_log;
|
|
};
|
|
# 5 "include/net/gen_stats.h" 2
|
|
|
|
# 1 "include/linux/rtnetlink.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "include/uapi/linux/rtnetlink.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "./include/uapi/linux/if_addr.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct ifaddrmsg {
|
|
__u8 ifa_family;
|
|
__u8 ifa_prefixlen;
|
|
__u8 ifa_flags;
|
|
__u8 ifa_scope;
|
|
__u32 ifa_index;
|
|
};
|
|
# 25 "./include/uapi/linux/if_addr.h"
|
|
enum {
|
|
IFA_UNSPEC,
|
|
IFA_ADDRESS,
|
|
IFA_LOCAL,
|
|
IFA_LABEL,
|
|
IFA_BROADCAST,
|
|
IFA_ANYCAST,
|
|
IFA_CACHEINFO,
|
|
IFA_MULTICAST,
|
|
IFA_FLAGS,
|
|
__IFA_MAX,
|
|
};
|
|
# 56 "./include/uapi/linux/if_addr.h"
|
|
struct ifa_cacheinfo {
|
|
__u32 ifa_prefered;
|
|
__u32 ifa_valid;
|
|
__u32 cstamp;
|
|
__u32 tstamp;
|
|
};
|
|
# 8 "include/uapi/linux/rtnetlink.h" 2
|
|
# 23 "include/uapi/linux/rtnetlink.h"
|
|
enum {
|
|
RTM_BASE = 16,
|
|
|
|
|
|
RTM_NEWLINK = 16,
|
|
|
|
RTM_DELLINK,
|
|
|
|
RTM_GETLINK,
|
|
|
|
RTM_SETLINK,
|
|
|
|
|
|
RTM_NEWADDR = 20,
|
|
|
|
RTM_DELADDR,
|
|
|
|
RTM_GETADDR,
|
|
|
|
|
|
RTM_NEWROUTE = 24,
|
|
|
|
RTM_DELROUTE,
|
|
|
|
RTM_GETROUTE,
|
|
|
|
|
|
RTM_NEWNEIGH = 28,
|
|
|
|
RTM_DELNEIGH,
|
|
|
|
RTM_GETNEIGH,
|
|
|
|
|
|
|
|
RTM_UPDATENEIGH,
|
|
|
|
RTM_NEIGHLOOP = 35,
|
|
|
|
|
|
|
|
RTM_NEWRULE = 32,
|
|
|
|
RTM_DELRULE,
|
|
|
|
RTM_GETRULE,
|
|
|
|
|
|
RTM_NEWQDISC = 36,
|
|
|
|
RTM_DELQDISC,
|
|
|
|
RTM_GETQDISC,
|
|
|
|
|
|
RTM_NEWTCLASS = 40,
|
|
|
|
RTM_DELTCLASS,
|
|
|
|
RTM_GETTCLASS,
|
|
|
|
|
|
RTM_NEWTFILTER = 44,
|
|
|
|
RTM_DELTFILTER,
|
|
|
|
RTM_GETTFILTER,
|
|
|
|
|
|
RTM_NEWACTION = 48,
|
|
|
|
RTM_DELACTION,
|
|
|
|
RTM_GETACTION,
|
|
|
|
|
|
RTM_NEWPREFIX = 52,
|
|
|
|
|
|
RTM_GETMULTICAST = 58,
|
|
|
|
|
|
RTM_GETANYCAST = 62,
|
|
|
|
|
|
RTM_NEWNEIGHTBL = 64,
|
|
|
|
RTM_GETNEIGHTBL = 66,
|
|
|
|
RTM_SETNEIGHTBL,
|
|
|
|
|
|
RTM_NEWNDUSEROPT = 68,
|
|
|
|
|
|
RTM_NEWADDRLABEL = 72,
|
|
|
|
RTM_DELADDRLABEL,
|
|
|
|
RTM_GETADDRLABEL,
|
|
|
|
|
|
RTM_GETDCB = 78,
|
|
|
|
RTM_SETDCB,
|
|
|
|
|
|
RTM_NEWNETCONF = 80,
|
|
|
|
RTM_GETNETCONF = 82,
|
|
|
|
|
|
RTM_NEWMDB = 84,
|
|
|
|
RTM_DELMDB = 85,
|
|
|
|
RTM_GETMDB = 86,
|
|
|
|
|
|
RTM_NEWNSID = 88,
|
|
|
|
RTM_DELNSID = 89,
|
|
|
|
RTM_GETNSID = 90,
|
|
|
|
|
|
__RTM_MAX,
|
|
|
|
};
|
|
# 163 "include/uapi/linux/rtnetlink.h"
|
|
struct rtattr {
|
|
unsigned short rta_len;
|
|
unsigned short rta_type;
|
|
};
|
|
# 189 "include/uapi/linux/rtnetlink.h"
|
|
struct rtmsg {
|
|
unsigned char rtm_family;
|
|
unsigned char rtm_dst_len;
|
|
unsigned char rtm_src_len;
|
|
unsigned char rtm_tos;
|
|
|
|
unsigned char rtm_table;
|
|
unsigned char rtm_protocol;
|
|
unsigned char rtm_scope;
|
|
unsigned char rtm_type;
|
|
|
|
unsigned rtm_flags;
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
RTN_UNSPEC,
|
|
RTN_UNICAST,
|
|
RTN_LOCAL,
|
|
RTN_BROADCAST,
|
|
|
|
RTN_ANYCAST,
|
|
|
|
RTN_MULTICAST,
|
|
RTN_BLACKHOLE,
|
|
RTN_UNREACHABLE,
|
|
RTN_PROHIBIT,
|
|
RTN_THROW,
|
|
RTN_NAT,
|
|
RTN_XRESOLVE,
|
|
__RTN_MAX
|
|
};
|
|
# 265 "include/uapi/linux/rtnetlink.h"
|
|
enum rt_scope_t {
|
|
RT_SCOPE_UNIVERSE=0,
|
|
|
|
RT_SCOPE_SITE=200,
|
|
RT_SCOPE_LINK=253,
|
|
RT_SCOPE_HOST=254,
|
|
RT_SCOPE_NOWHERE=255
|
|
};
|
|
# 284 "include/uapi/linux/rtnetlink.h"
|
|
enum rt_class_t {
|
|
RT_TABLE_UNSPEC=0,
|
|
|
|
RT_TABLE_COMPAT=252,
|
|
RT_TABLE_DEFAULT=253,
|
|
RT_TABLE_MAIN=254,
|
|
RT_TABLE_LOCAL=255,
|
|
RT_TABLE_MAX=0xFFFFFFFF
|
|
};
|
|
|
|
|
|
|
|
|
|
enum rtattr_type_t {
|
|
RTA_UNSPEC,
|
|
RTA_DST,
|
|
RTA_SRC,
|
|
RTA_IIF,
|
|
RTA_OIF,
|
|
RTA_GATEWAY,
|
|
RTA_PRIORITY,
|
|
RTA_PREFSRC,
|
|
RTA_METRICS,
|
|
RTA_MULTIPATH,
|
|
RTA_PROTOINFO,
|
|
RTA_FLOW,
|
|
RTA_CACHEINFO,
|
|
RTA_SESSION,
|
|
RTA_MP_ALGO,
|
|
RTA_TABLE,
|
|
RTA_MARK,
|
|
RTA_MFC_STATS,
|
|
RTA_VIA,
|
|
RTA_NEWDST,
|
|
RTA_PREF,
|
|
RTA_ENCAP_TYPE,
|
|
RTA_ENCAP,
|
|
__RTA_MAX
|
|
};
|
|
# 338 "include/uapi/linux/rtnetlink.h"
|
|
struct rtnexthop {
|
|
unsigned short rtnh_len;
|
|
unsigned char rtnh_flags;
|
|
unsigned char rtnh_hops;
|
|
int rtnh_ifindex;
|
|
};
|
|
# 367 "include/uapi/linux/rtnetlink.h"
|
|
struct rtvia {
|
|
__kernel_sa_family_t rtvia_family;
|
|
__u8 rtvia_addr[0];
|
|
};
|
|
|
|
|
|
|
|
struct rta_cacheinfo {
|
|
__u32 rta_clntref;
|
|
__u32 rta_lastuse;
|
|
__s32 rta_expires;
|
|
__u32 rta_error;
|
|
__u32 rta_used;
|
|
|
|
|
|
__u32 rta_id;
|
|
__u32 rta_ts;
|
|
__u32 rta_tsage;
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
RTAX_UNSPEC,
|
|
|
|
RTAX_LOCK,
|
|
|
|
RTAX_MTU,
|
|
|
|
RTAX_WINDOW,
|
|
|
|
RTAX_RTT,
|
|
|
|
RTAX_RTTVAR,
|
|
|
|
RTAX_SSTHRESH,
|
|
|
|
RTAX_CWND,
|
|
|
|
RTAX_ADVMSS,
|
|
|
|
RTAX_REORDERING,
|
|
|
|
RTAX_HOPLIMIT,
|
|
|
|
RTAX_INITCWND,
|
|
|
|
RTAX_FEATURES,
|
|
|
|
RTAX_RTO_MIN,
|
|
|
|
RTAX_INITRWND,
|
|
|
|
RTAX_QUICKACK,
|
|
|
|
RTAX_CC_ALGO,
|
|
|
|
__RTAX_MAX
|
|
};
|
|
# 437 "include/uapi/linux/rtnetlink.h"
|
|
struct rta_session {
|
|
__u8 proto;
|
|
__u8 pad1;
|
|
__u16 pad2;
|
|
|
|
union {
|
|
struct {
|
|
__u16 sport;
|
|
__u16 dport;
|
|
} ports;
|
|
|
|
struct {
|
|
__u8 type;
|
|
__u8 code;
|
|
__u16 ident;
|
|
} icmpt;
|
|
|
|
__u32 spi;
|
|
} u;
|
|
};
|
|
|
|
struct rta_mfc_stats {
|
|
__u64 mfcs_packets;
|
|
__u64 mfcs_bytes;
|
|
__u64 mfcs_wrong_if;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct rtgenmsg {
|
|
unsigned char rtgen_family;
|
|
};
|
|
# 481 "include/uapi/linux/rtnetlink.h"
|
|
struct ifinfomsg {
|
|
unsigned char ifi_family;
|
|
unsigned char __ifi_pad;
|
|
unsigned short ifi_type;
|
|
int ifi_index;
|
|
unsigned ifi_flags;
|
|
unsigned ifi_change;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct prefixmsg {
|
|
unsigned char prefix_family;
|
|
unsigned char prefix_pad1;
|
|
unsigned short prefix_pad2;
|
|
int prefix_ifindex;
|
|
unsigned char prefix_type;
|
|
unsigned char prefix_len;
|
|
unsigned char prefix_flags;
|
|
unsigned char prefix_pad3;
|
|
};
|
|
|
|
enum
|
|
{
|
|
PREFIX_UNSPEC,
|
|
PREFIX_ADDRESS,
|
|
PREFIX_CACHEINFO,
|
|
__PREFIX_MAX
|
|
};
|
|
|
|
|
|
|
|
struct prefix_cacheinfo {
|
|
__u32 preferred_time;
|
|
__u32 valid_time;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct tcmsg {
|
|
unsigned char tcm_family;
|
|
unsigned char tcm__pad1;
|
|
unsigned short tcm__pad2;
|
|
int tcm_ifindex;
|
|
__u32 tcm_handle;
|
|
__u32 tcm_parent;
|
|
__u32 tcm_info;
|
|
};
|
|
|
|
enum {
|
|
TCA_UNSPEC,
|
|
TCA_KIND,
|
|
TCA_OPTIONS,
|
|
TCA_STATS,
|
|
TCA_XSTATS,
|
|
TCA_RATE,
|
|
TCA_FCNT,
|
|
TCA_STATS2,
|
|
TCA_STAB,
|
|
__TCA_MAX
|
|
};
|
|
# 557 "include/uapi/linux/rtnetlink.h"
|
|
struct nduseroptmsg {
|
|
unsigned char nduseropt_family;
|
|
unsigned char nduseropt_pad1;
|
|
unsigned short nduseropt_opts_len;
|
|
int nduseropt_ifindex;
|
|
__u8 nduseropt_icmp_type;
|
|
__u8 nduseropt_icmp_code;
|
|
unsigned short nduseropt_pad2;
|
|
unsigned int nduseropt_pad3;
|
|
|
|
};
|
|
|
|
enum {
|
|
NDUSEROPT_UNSPEC,
|
|
NDUSEROPT_SRCADDR,
|
|
__NDUSEROPT_MAX
|
|
};
|
|
# 601 "include/uapi/linux/rtnetlink.h"
|
|
enum rtnetlink_groups {
|
|
RTNLGRP_NONE,
|
|
|
|
RTNLGRP_LINK,
|
|
|
|
RTNLGRP_NOTIFY,
|
|
|
|
RTNLGRP_NEIGH,
|
|
|
|
RTNLGRP_TC,
|
|
|
|
RTNLGRP_IPV4_IFADDR,
|
|
|
|
RTNLGRP_IPV4_MROUTE,
|
|
|
|
RTNLGRP_IPV4_ROUTE,
|
|
|
|
RTNLGRP_IPV4_RULE,
|
|
|
|
RTNLGRP_IPV6_IFADDR,
|
|
|
|
RTNLGRP_IPV6_MROUTE,
|
|
|
|
RTNLGRP_IPV6_ROUTE,
|
|
|
|
RTNLGRP_IPV6_IFINFO,
|
|
|
|
RTNLGRP_DECnet_IFADDR,
|
|
|
|
RTNLGRP_NOP2,
|
|
RTNLGRP_DECnet_ROUTE,
|
|
|
|
RTNLGRP_DECnet_RULE,
|
|
|
|
RTNLGRP_NOP4,
|
|
RTNLGRP_IPV6_PREFIX,
|
|
|
|
RTNLGRP_IPV6_RULE,
|
|
|
|
RTNLGRP_ND_USEROPT,
|
|
|
|
RTNLGRP_PHONET_IFADDR,
|
|
|
|
RTNLGRP_PHONET_ROUTE,
|
|
|
|
RTNLGRP_DCB,
|
|
|
|
RTNLGRP_IPV4_NETCONF,
|
|
|
|
RTNLGRP_IPV6_NETCONF,
|
|
|
|
RTNLGRP_MDB,
|
|
|
|
RTNLGRP_MPLS_ROUTE,
|
|
|
|
RTNLGRP_NSID,
|
|
|
|
__RTNLGRP_MAX
|
|
};
|
|
|
|
|
|
|
|
struct tcamsg {
|
|
unsigned char tca_family;
|
|
unsigned char tca__pad1;
|
|
unsigned short tca__pad2;
|
|
};
|
|
# 9 "include/linux/rtnetlink.h" 2
|
|
|
|
extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo);
|
|
extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid);
|
|
extern void rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid,
|
|
u32 group, struct nlmsghdr *nlh, gfp_t flags);
|
|
extern void rtnl_set_sk_err(struct net *net, u32 group, int error);
|
|
extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics);
|
|
extern int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst,
|
|
u32 id, long expires, u32 error);
|
|
|
|
void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change, gfp_t flags);
|
|
struct sk_buff *rtmsg_ifinfo_build_skb(int type, struct net_device *dev,
|
|
unsigned change, gfp_t flags);
|
|
void rtmsg_ifinfo_send(struct sk_buff *skb, struct net_device *dev,
|
|
gfp_t flags);
|
|
|
|
|
|
|
|
extern void rtnl_lock(void);
|
|
extern void rtnl_unlock(void);
|
|
extern int rtnl_trylock(void);
|
|
extern int rtnl_is_locked(void);
|
|
|
|
extern wait_queue_head_t netdev_unregistering_wq;
|
|
extern struct mutex net_mutex;
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool lockdep_rtnl_is_held(void)
|
|
{
|
|
return true;
|
|
}
|
|
# 75 "include/linux/rtnetlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct netdev_queue *dev_ingress_queue(struct net_device *dev)
|
|
{
|
|
return ({ do { } while (0); ; ((typeof(*(dev->ingress_queue)) *)((dev->ingress_queue))); });
|
|
}
|
|
|
|
struct netdev_queue *dev_ingress_queue_create(struct net_device *dev);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern void rtnetlink_init(void);
|
|
extern void __rtnl_unlock(void);
|
|
# 98 "include/linux/rtnetlink.h"
|
|
extern int ndo_dflt_fdb_dump(struct sk_buff *skb,
|
|
struct netlink_callback *cb,
|
|
struct net_device *dev,
|
|
struct net_device *filter_dev,
|
|
int idx);
|
|
extern int ndo_dflt_fdb_add(struct ndmsg *ndm,
|
|
struct nlattr *tb[],
|
|
struct net_device *dev,
|
|
const unsigned char *addr,
|
|
u16 vid,
|
|
u16 flags);
|
|
extern int ndo_dflt_fdb_del(struct ndmsg *ndm,
|
|
struct nlattr *tb[],
|
|
struct net_device *dev,
|
|
const unsigned char *addr,
|
|
u16 vid);
|
|
|
|
extern int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
|
|
struct net_device *dev, u16 mode,
|
|
u32 flags, u32 mask, int nlflags,
|
|
u32 filter_mask,
|
|
int (*vlan_fill)(struct sk_buff *skb,
|
|
struct net_device *dev,
|
|
u32 filter_mask));
|
|
|
|
|
|
extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data);
|
|
# 7 "include/net/gen_stats.h" 2
|
|
|
|
|
|
struct gnet_stats_basic_cpu {
|
|
struct gnet_stats_basic_packed bstats;
|
|
struct u64_stats_sync syncp;
|
|
};
|
|
|
|
struct gnet_dump {
|
|
spinlock_t * lock;
|
|
struct sk_buff * skb;
|
|
struct nlattr * tail;
|
|
|
|
|
|
int compat_tc_stats;
|
|
int compat_xstats;
|
|
void * xstats;
|
|
int xstats_len;
|
|
struct tc_stats tc_stats;
|
|
};
|
|
|
|
int gnet_stats_start_copy(struct sk_buff *skb, int type, spinlock_t *lock,
|
|
struct gnet_dump *d);
|
|
|
|
int gnet_stats_start_copy_compat(struct sk_buff *skb, int type,
|
|
int tc_stats_type, int xstats_type,
|
|
spinlock_t *lock, struct gnet_dump *d);
|
|
|
|
int gnet_stats_copy_basic(struct gnet_dump *d,
|
|
struct gnet_stats_basic_cpu *cpu,
|
|
struct gnet_stats_basic_packed *b);
|
|
void __gnet_stats_copy_basic(struct gnet_stats_basic_packed *bstats,
|
|
struct gnet_stats_basic_cpu *cpu,
|
|
struct gnet_stats_basic_packed *b);
|
|
int gnet_stats_copy_rate_est(struct gnet_dump *d,
|
|
const struct gnet_stats_basic_packed *b,
|
|
struct gnet_stats_rate_est64 *r);
|
|
int gnet_stats_copy_queue(struct gnet_dump *d,
|
|
struct gnet_stats_queue *cpu_q,
|
|
struct gnet_stats_queue *q, __u32 qlen);
|
|
int gnet_stats_copy_app(struct gnet_dump *d, void *st, int len);
|
|
|
|
int gnet_stats_finish_copy(struct gnet_dump *d);
|
|
|
|
int gen_new_estimator(struct gnet_stats_basic_packed *bstats,
|
|
struct gnet_stats_basic_cpu *cpu_bstats,
|
|
struct gnet_stats_rate_est64 *rate_est,
|
|
spinlock_t *stats_lock, struct nlattr *opt);
|
|
void gen_kill_estimator(struct gnet_stats_basic_packed *bstats,
|
|
struct gnet_stats_rate_est64 *rate_est);
|
|
int gen_replace_estimator(struct gnet_stats_basic_packed *bstats,
|
|
struct gnet_stats_basic_cpu *cpu_bstats,
|
|
struct gnet_stats_rate_est64 *rate_est,
|
|
spinlock_t *stats_lock, struct nlattr *opt);
|
|
bool gen_estimator_active(const struct gnet_stats_basic_packed *bstats,
|
|
const struct gnet_stats_rate_est64 *rate_est);
|
|
# 12 "include/net/sch_generic.h" 2
|
|
# 1 "include/net/rtnetlink.h" 1
|
|
|
|
|
|
|
|
|
|
# 1 "include/net/netlink.h" 1
|
|
# 161 "include/net/netlink.h"
|
|
enum {
|
|
NLA_UNSPEC,
|
|
NLA_U8,
|
|
NLA_U16,
|
|
NLA_U32,
|
|
NLA_U64,
|
|
NLA_STRING,
|
|
NLA_FLAG,
|
|
NLA_MSECS,
|
|
NLA_NESTED,
|
|
NLA_NESTED_COMPAT,
|
|
NLA_NUL_STRING,
|
|
NLA_BINARY,
|
|
NLA_S8,
|
|
NLA_S16,
|
|
NLA_S32,
|
|
NLA_S64,
|
|
__NLA_TYPE_MAX,
|
|
};
|
|
# 215 "include/net/netlink.h"
|
|
struct nla_policy {
|
|
u16 type;
|
|
u16 len;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct nl_info {
|
|
struct nlmsghdr *nlh;
|
|
struct net *nl_net;
|
|
u32 portid;
|
|
};
|
|
|
|
int netlink_rcv_skb(struct sk_buff *skb,
|
|
int (*cb)(struct sk_buff *, struct nlmsghdr *));
|
|
int nlmsg_notify(struct sock *sk, struct sk_buff *skb, u32 portid,
|
|
unsigned int group, int report, gfp_t flags);
|
|
|
|
int nla_validate(const struct nlattr *head, int len, int maxtype,
|
|
const struct nla_policy *policy);
|
|
int nla_parse(struct nlattr **tb, int maxtype, const struct nlattr *head,
|
|
int len, const struct nla_policy *policy);
|
|
int nla_policy_len(const struct nla_policy *, int);
|
|
struct nlattr *nla_find(const struct nlattr *head, int len, int attrtype);
|
|
size_t nla_strlcpy(char *dst, const struct nlattr *nla, size_t dstsize);
|
|
int nla_memcpy(void *dest, const struct nlattr *src, int count);
|
|
int nla_memcmp(const struct nlattr *nla, const void *data, size_t size);
|
|
int nla_strcmp(const struct nlattr *nla, const char *str);
|
|
struct nlattr *__nla_reserve(struct sk_buff *skb, int attrtype, int attrlen);
|
|
void *__nla_reserve_nohdr(struct sk_buff *skb, int attrlen);
|
|
struct nlattr *nla_reserve(struct sk_buff *skb, int attrtype, int attrlen);
|
|
void *nla_reserve_nohdr(struct sk_buff *skb, int attrlen);
|
|
void __nla_put(struct sk_buff *skb, int attrtype, int attrlen,
|
|
const void *data);
|
|
void __nla_put_nohdr(struct sk_buff *skb, int attrlen, const void *data);
|
|
int nla_put(struct sk_buff *skb, int attrtype, int attrlen, const void *data);
|
|
int nla_put_nohdr(struct sk_buff *skb, int attrlen, const void *data);
|
|
int nla_append(struct sk_buff *skb, int attrlen, const void *data);
|
|
# 265 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nlmsg_msg_size(int payload)
|
|
{
|
|
return ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )) + payload;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nlmsg_total_size(int payload)
|
|
{
|
|
return ( ((nlmsg_msg_size(payload))+4U -1) & ~(4U -1) );
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nlmsg_padlen(int payload)
|
|
{
|
|
return nlmsg_total_size(payload) - nlmsg_msg_size(payload);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *nlmsg_data(const struct nlmsghdr *nlh)
|
|
{
|
|
return (unsigned char *) nlh + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nlmsg_len(const struct nlmsghdr *nlh)
|
|
{
|
|
return nlh->nlmsg_len - ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct nlattr *nlmsg_attrdata(const struct nlmsghdr *nlh,
|
|
int hdrlen)
|
|
{
|
|
unsigned char *data = nlmsg_data(nlh);
|
|
return (struct nlattr *) (data + ( ((hdrlen)+4U -1) & ~(4U -1) ));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nlmsg_attrlen(const struct nlmsghdr *nlh, int hdrlen)
|
|
{
|
|
return nlmsg_len(nlh) - ( ((hdrlen)+4U -1) & ~(4U -1) );
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nlmsg_ok(const struct nlmsghdr *nlh, int remaining)
|
|
{
|
|
return (remaining >= (int) sizeof(struct nlmsghdr) &&
|
|
nlh->nlmsg_len >= sizeof(struct nlmsghdr) &&
|
|
nlh->nlmsg_len <= remaining);
|
|
}
|
|
# 348 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct nlmsghdr *
|
|
nlmsg_next(const struct nlmsghdr *nlh, int *remaining)
|
|
{
|
|
int totlen = ( ((nlh->nlmsg_len)+4U -1) & ~(4U -1) );
|
|
|
|
*remaining -= totlen;
|
|
|
|
return (struct nlmsghdr *) ((unsigned char *) nlh + totlen);
|
|
}
|
|
# 368 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nlmsg_parse(const struct nlmsghdr *nlh, int hdrlen,
|
|
struct nlattr *tb[], int maxtype,
|
|
const struct nla_policy *policy)
|
|
{
|
|
if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen))
|
|
return -22;
|
|
|
|
return nla_parse(tb, maxtype, nlmsg_attrdata(nlh, hdrlen),
|
|
nlmsg_attrlen(nlh, hdrlen), policy);
|
|
}
|
|
# 387 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct nlattr *nlmsg_find_attr(const struct nlmsghdr *nlh,
|
|
int hdrlen, int attrtype)
|
|
{
|
|
return nla_find(nlmsg_attrdata(nlh, hdrlen),
|
|
nlmsg_attrlen(nlh, hdrlen), attrtype);
|
|
}
|
|
# 401 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nlmsg_validate(const struct nlmsghdr *nlh,
|
|
int hdrlen, int maxtype,
|
|
const struct nla_policy *policy)
|
|
{
|
|
if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen))
|
|
return -22;
|
|
|
|
return nla_validate(nlmsg_attrdata(nlh, hdrlen),
|
|
nlmsg_attrlen(nlh, hdrlen), maxtype, policy);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nlmsg_report(const struct nlmsghdr *nlh)
|
|
{
|
|
return !!(nlh->nlmsg_flags & 8);
|
|
}
|
|
# 446 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct nlmsghdr *nlmsg_put(struct sk_buff *skb, u32 portid, u32 seq,
|
|
int type, int payload, int flags)
|
|
{
|
|
if (__builtin_expect(!!(skb_tailroom(skb) < nlmsg_total_size(payload)), 0))
|
|
return ((void *)0);
|
|
|
|
return __nlmsg_put(skb, portid, seq, type, payload, flags);
|
|
}
|
|
# 466 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct nlmsghdr *nlmsg_put_answer(struct sk_buff *skb,
|
|
struct netlink_callback *cb,
|
|
int type, int payload,
|
|
int flags)
|
|
{
|
|
return nlmsg_put(skb, (*(struct netlink_skb_parms*)&((cb->skb)->cb)).portid, cb->nlh->nlmsg_seq,
|
|
type, payload, flags);
|
|
}
|
|
# 483 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *nlmsg_new(size_t payload, gfp_t flags)
|
|
{
|
|
return alloc_skb(nlmsg_total_size(payload), flags);
|
|
}
|
|
# 497 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void nlmsg_end(struct sk_buff *skb, struct nlmsghdr *nlh)
|
|
{
|
|
nlh->nlmsg_len = skb_tail_pointer(skb) - (unsigned char *)nlh;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *nlmsg_get_pos(struct sk_buff *skb)
|
|
{
|
|
return skb_tail_pointer(skb);
|
|
}
|
|
# 520 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void nlmsg_trim(struct sk_buff *skb, const void *mark)
|
|
{
|
|
if (mark) {
|
|
({ int __ret_warn_on = !!((unsigned char *) mark < skb->data); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/net/netlink.h", 523); __builtin_expect(!!(__ret_warn_on), 0); });
|
|
skb_trim(skb, (unsigned char *) mark - skb->data);
|
|
}
|
|
}
|
|
# 536 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void nlmsg_cancel(struct sk_buff *skb, struct nlmsghdr *nlh)
|
|
{
|
|
nlmsg_trim(skb, nlh);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void nlmsg_free(struct sk_buff *skb)
|
|
{
|
|
kfree_skb(skb);
|
|
}
|
|
# 558 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nlmsg_multicast(struct sock *sk, struct sk_buff *skb,
|
|
u32 portid, unsigned int group, gfp_t flags)
|
|
{
|
|
int err;
|
|
|
|
(*(struct netlink_skb_parms*)&((skb)->cb)).dst_group = group;
|
|
|
|
err = netlink_broadcast(sk, skb, portid, group, flags);
|
|
if (err > 0)
|
|
err = 0;
|
|
|
|
return err;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nlmsg_unicast(struct sock *sk, struct sk_buff *skb, u32 portid)
|
|
{
|
|
int err;
|
|
|
|
err = netlink_unicast(sk, skb, portid, 0x40);
|
|
if (err > 0)
|
|
err = 0;
|
|
|
|
return err;
|
|
}
|
|
# 616 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
nl_dump_check_consistent(struct netlink_callback *cb,
|
|
struct nlmsghdr *nlh)
|
|
{
|
|
if (cb->prev_seq && cb->seq != cb->prev_seq)
|
|
nlh->nlmsg_flags |= 16;
|
|
cb->prev_seq = cb->seq;
|
|
}
|
|
# 633 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_attr_size(int payload)
|
|
{
|
|
return ((int) (((sizeof(struct nlattr)) + 4 - 1) & ~(4 - 1))) + payload;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_total_size(int payload)
|
|
{
|
|
return (((nla_attr_size(payload)) + 4 - 1) & ~(4 - 1));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_padlen(int payload)
|
|
{
|
|
return nla_total_size(payload) - nla_attr_size(payload);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_type(const struct nlattr *nla)
|
|
{
|
|
return nla->nla_type & ~((1 << 15) | (1 << 14));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *nla_data(const struct nlattr *nla)
|
|
{
|
|
return (char *) nla + ((int) (((sizeof(struct nlattr)) + 4 - 1) & ~(4 - 1)));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_len(const struct nlattr *nla)
|
|
{
|
|
return nla->nla_len - ((int) (((sizeof(struct nlattr)) + 4 - 1) & ~(4 - 1)));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_ok(const struct nlattr *nla, int remaining)
|
|
{
|
|
return remaining >= (int) sizeof(*nla) &&
|
|
nla->nla_len >= sizeof(*nla) &&
|
|
nla->nla_len <= remaining;
|
|
}
|
|
# 703 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct nlattr *nla_next(const struct nlattr *nla, int *remaining)
|
|
{
|
|
int totlen = (((nla->nla_len) + 4 - 1) & ~(4 - 1));
|
|
|
|
*remaining -= totlen;
|
|
return (struct nlattr *) ((char *) nla + totlen);
|
|
}
|
|
# 718 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct nlattr *
|
|
nla_find_nested(const struct nlattr *nla, int attrtype)
|
|
{
|
|
return nla_find(nla_data(nla), nla_len(nla), attrtype);
|
|
}
|
|
# 733 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_parse_nested(struct nlattr *tb[], int maxtype,
|
|
const struct nlattr *nla,
|
|
const struct nla_policy *policy)
|
|
{
|
|
return nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_u8(struct sk_buff *skb, int attrtype, u8 value)
|
|
{
|
|
|
|
u8 tmp = value;
|
|
|
|
return nla_put(skb, attrtype, sizeof(u8), &tmp);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_u16(struct sk_buff *skb, int attrtype, u16 value)
|
|
{
|
|
u16 tmp = value;
|
|
|
|
return nla_put(skb, attrtype, sizeof(u16), &tmp);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value)
|
|
{
|
|
__be16 tmp = value;
|
|
|
|
return nla_put(skb, attrtype, sizeof(__be16), &tmp);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_net16(struct sk_buff *skb, int attrtype, __be16 value)
|
|
{
|
|
__be16 tmp = value;
|
|
|
|
return nla_put_be16(skb, attrtype | (1 << 14), tmp);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_le16(struct sk_buff *skb, int attrtype, __le16 value)
|
|
{
|
|
__le16 tmp = value;
|
|
|
|
return nla_put(skb, attrtype, sizeof(__le16), &tmp);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_u32(struct sk_buff *skb, int attrtype, u32 value)
|
|
{
|
|
u32 tmp = value;
|
|
|
|
return nla_put(skb, attrtype, sizeof(u32), &tmp);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value)
|
|
{
|
|
__be32 tmp = value;
|
|
|
|
return nla_put(skb, attrtype, sizeof(__be32), &tmp);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_net32(struct sk_buff *skb, int attrtype, __be32 value)
|
|
{
|
|
__be32 tmp = value;
|
|
|
|
return nla_put_be32(skb, attrtype | (1 << 14), tmp);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_le32(struct sk_buff *skb, int attrtype, __le32 value)
|
|
{
|
|
__le32 tmp = value;
|
|
|
|
return nla_put(skb, attrtype, sizeof(__le32), &tmp);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_u64(struct sk_buff *skb, int attrtype, u64 value)
|
|
{
|
|
u64 tmp = value;
|
|
|
|
return nla_put(skb, attrtype, sizeof(u64), &tmp);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value)
|
|
{
|
|
__be64 tmp = value;
|
|
|
|
return nla_put(skb, attrtype, sizeof(__be64), &tmp);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value)
|
|
{
|
|
__be64 tmp = value;
|
|
|
|
return nla_put_be64(skb, attrtype | (1 << 14), tmp);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_le64(struct sk_buff *skb, int attrtype, __le64 value)
|
|
{
|
|
__le64 tmp = value;
|
|
|
|
return nla_put(skb, attrtype, sizeof(__le64), &tmp);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_s8(struct sk_buff *skb, int attrtype, s8 value)
|
|
{
|
|
s8 tmp = value;
|
|
|
|
return nla_put(skb, attrtype, sizeof(s8), &tmp);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_s16(struct sk_buff *skb, int attrtype, s16 value)
|
|
{
|
|
s16 tmp = value;
|
|
|
|
return nla_put(skb, attrtype, sizeof(s16), &tmp);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_s32(struct sk_buff *skb, int attrtype, s32 value)
|
|
{
|
|
s32 tmp = value;
|
|
|
|
return nla_put(skb, attrtype, sizeof(s32), &tmp);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_s64(struct sk_buff *skb, int attrtype, s64 value)
|
|
{
|
|
s64 tmp = value;
|
|
|
|
return nla_put(skb, attrtype, sizeof(s64), &tmp);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_string(struct sk_buff *skb, int attrtype,
|
|
const char *str)
|
|
{
|
|
return nla_put(skb, attrtype, strlen(str) + 1, str);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_flag(struct sk_buff *skb, int attrtype)
|
|
{
|
|
return nla_put(skb, attrtype, 0, ((void *)0));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_msecs(struct sk_buff *skb, int attrtype,
|
|
unsigned long njiffies)
|
|
{
|
|
u64 tmp = jiffies_to_msecs(njiffies);
|
|
return nla_put(skb, attrtype, sizeof(u64), &tmp);
|
|
}
|
|
# 1004 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_in_addr(struct sk_buff *skb, int attrtype,
|
|
__be32 addr)
|
|
{
|
|
__be32 tmp = addr;
|
|
|
|
return nla_put_be32(skb, attrtype, tmp);
|
|
}
|
|
# 1019 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_put_in6_addr(struct sk_buff *skb, int attrtype,
|
|
const struct in6_addr *addr)
|
|
{
|
|
return nla_put(skb, attrtype, sizeof(*addr), addr);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 nla_get_u32(const struct nlattr *nla)
|
|
{
|
|
return *(u32 *) nla_data(nla);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __be32 nla_get_be32(const struct nlattr *nla)
|
|
{
|
|
return *(__be32 *) nla_data(nla);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __le32 nla_get_le32(const struct nlattr *nla)
|
|
{
|
|
return *(__le32 *) nla_data(nla);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u16 nla_get_u16(const struct nlattr *nla)
|
|
{
|
|
return *(u16 *) nla_data(nla);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __be16 nla_get_be16(const struct nlattr *nla)
|
|
{
|
|
return *(__be16 *) nla_data(nla);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __le16 nla_get_le16(const struct nlattr *nla)
|
|
{
|
|
return *(__le16 *) nla_data(nla);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u8 nla_get_u8(const struct nlattr *nla)
|
|
{
|
|
return *(u8 *) nla_data(nla);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 nla_get_u64(const struct nlattr *nla)
|
|
{
|
|
u64 tmp;
|
|
|
|
nla_memcpy(&tmp, nla, sizeof(tmp));
|
|
|
|
return tmp;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __be64 nla_get_be64(const struct nlattr *nla)
|
|
{
|
|
__be64 tmp;
|
|
|
|
nla_memcpy(&tmp, nla, sizeof(tmp));
|
|
|
|
return tmp;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __le64 nla_get_le64(const struct nlattr *nla)
|
|
{
|
|
return *(__le64 *) nla_data(nla);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s32 nla_get_s32(const struct nlattr *nla)
|
|
{
|
|
return *(s32 *) nla_data(nla);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s16 nla_get_s16(const struct nlattr *nla)
|
|
{
|
|
return *(s16 *) nla_data(nla);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s8 nla_get_s8(const struct nlattr *nla)
|
|
{
|
|
return *(s8 *) nla_data(nla);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) s64 nla_get_s64(const struct nlattr *nla)
|
|
{
|
|
s64 tmp;
|
|
|
|
nla_memcpy(&tmp, nla, sizeof(tmp));
|
|
|
|
return tmp;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_get_flag(const struct nlattr *nla)
|
|
{
|
|
return !!nla;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long nla_get_msecs(const struct nlattr *nla)
|
|
{
|
|
u64 msecs = nla_get_u64(nla);
|
|
|
|
return msecs_to_jiffies((unsigned long) msecs);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __be32 nla_get_in_addr(const struct nlattr *nla)
|
|
{
|
|
return *(__be32 *) nla_data(nla);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct in6_addr nla_get_in6_addr(const struct nlattr *nla)
|
|
{
|
|
struct in6_addr tmp;
|
|
|
|
nla_memcpy(&tmp, nla, sizeof(tmp));
|
|
return tmp;
|
|
}
|
|
# 1213 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct nlattr *nla_nest_start(struct sk_buff *skb, int attrtype)
|
|
{
|
|
struct nlattr *start = (struct nlattr *)skb_tail_pointer(skb);
|
|
|
|
if (nla_put(skb, attrtype, 0, ((void *)0)) < 0)
|
|
return ((void *)0);
|
|
|
|
return start;
|
|
}
|
|
# 1233 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_nest_end(struct sk_buff *skb, struct nlattr *start)
|
|
{
|
|
start->nla_len = skb_tail_pointer(skb) - (unsigned char *)start;
|
|
return skb->len;
|
|
}
|
|
# 1247 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void nla_nest_cancel(struct sk_buff *skb, struct nlattr *start)
|
|
{
|
|
nlmsg_trim(skb, start);
|
|
}
|
|
# 1264 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nla_validate_nested(const struct nlattr *start, int maxtype,
|
|
const struct nla_policy *policy)
|
|
{
|
|
return nla_validate(nla_data(start), nla_len(start), maxtype, policy);
|
|
}
|
|
# 1296 "include/net/netlink.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool nla_is_last(const struct nlattr *nla, int rem)
|
|
{
|
|
return nla->nla_len == rem;
|
|
}
|
|
# 6 "include/net/rtnetlink.h" 2
|
|
|
|
typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *);
|
|
typedef int (*rtnl_dumpit_func)(struct sk_buff *, struct netlink_callback *);
|
|
typedef u16 (*rtnl_calcit_func)(struct sk_buff *, struct nlmsghdr *);
|
|
|
|
int __rtnl_register(int protocol, int msgtype,
|
|
rtnl_doit_func, rtnl_dumpit_func, rtnl_calcit_func);
|
|
void rtnl_register(int protocol, int msgtype,
|
|
rtnl_doit_func, rtnl_dumpit_func, rtnl_calcit_func);
|
|
int rtnl_unregister(int protocol, int msgtype);
|
|
void rtnl_unregister_all(int protocol);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int rtnl_msg_family(const struct nlmsghdr *nlh)
|
|
{
|
|
if (nlmsg_len(nlh) >= sizeof(struct rtgenmsg))
|
|
return ((struct rtgenmsg *) nlmsg_data(nlh))->rtgen_family;
|
|
else
|
|
return 0;
|
|
}
|
|
# 51 "include/net/rtnetlink.h"
|
|
struct rtnl_link_ops {
|
|
struct list_head list;
|
|
|
|
const char *kind;
|
|
|
|
size_t priv_size;
|
|
void (*setup)(struct net_device *dev);
|
|
|
|
int maxtype;
|
|
const struct nla_policy *policy;
|
|
int (*validate)(struct nlattr *tb[],
|
|
struct nlattr *data[]);
|
|
|
|
int (*newlink)(struct net *src_net,
|
|
struct net_device *dev,
|
|
struct nlattr *tb[],
|
|
struct nlattr *data[]);
|
|
int (*changelink)(struct net_device *dev,
|
|
struct nlattr *tb[],
|
|
struct nlattr *data[]);
|
|
void (*dellink)(struct net_device *dev,
|
|
struct list_head *head);
|
|
|
|
size_t (*get_size)(const struct net_device *dev);
|
|
int (*fill_info)(struct sk_buff *skb,
|
|
const struct net_device *dev);
|
|
|
|
size_t (*get_xstats_size)(const struct net_device *dev);
|
|
int (*fill_xstats)(struct sk_buff *skb,
|
|
const struct net_device *dev);
|
|
unsigned int (*get_num_tx_queues)(void);
|
|
unsigned int (*get_num_rx_queues)(void);
|
|
|
|
int slave_maxtype;
|
|
const struct nla_policy *slave_policy;
|
|
int (*slave_validate)(struct nlattr *tb[],
|
|
struct nlattr *data[]);
|
|
int (*slave_changelink)(struct net_device *dev,
|
|
struct net_device *slave_dev,
|
|
struct nlattr *tb[],
|
|
struct nlattr *data[]);
|
|
size_t (*get_slave_size)(const struct net_device *dev,
|
|
const struct net_device *slave_dev);
|
|
int (*fill_slave_info)(struct sk_buff *skb,
|
|
const struct net_device *dev,
|
|
const struct net_device *slave_dev);
|
|
struct net *(*get_link_net)(const struct net_device *dev);
|
|
};
|
|
|
|
int __rtnl_link_register(struct rtnl_link_ops *ops);
|
|
void __rtnl_link_unregister(struct rtnl_link_ops *ops);
|
|
|
|
int rtnl_link_register(struct rtnl_link_ops *ops);
|
|
void rtnl_link_unregister(struct rtnl_link_ops *ops);
|
|
# 120 "include/net/rtnetlink.h"
|
|
struct rtnl_af_ops {
|
|
struct list_head list;
|
|
int family;
|
|
|
|
int (*fill_link_af)(struct sk_buff *skb,
|
|
const struct net_device *dev,
|
|
u32 ext_filter_mask);
|
|
size_t (*get_link_af_size)(const struct net_device *dev,
|
|
u32 ext_filter_mask);
|
|
|
|
int (*validate_link_af)(const struct net_device *dev,
|
|
const struct nlattr *attr);
|
|
int (*set_link_af)(struct net_device *dev,
|
|
const struct nlattr *attr);
|
|
};
|
|
|
|
void __rtnl_af_unregister(struct rtnl_af_ops *ops);
|
|
|
|
void rtnl_af_register(struct rtnl_af_ops *ops);
|
|
void rtnl_af_unregister(struct rtnl_af_ops *ops);
|
|
|
|
struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]);
|
|
struct net_device *rtnl_create_link(struct net *net, const char *ifname,
|
|
unsigned char name_assign_type,
|
|
const struct rtnl_link_ops *ops,
|
|
struct nlattr *tb[]);
|
|
int rtnl_delete_link(struct net_device *dev);
|
|
int rtnl_configure_link(struct net_device *dev, const struct ifinfomsg *ifm);
|
|
|
|
int rtnl_nla_parse_ifla(struct nlattr **tb, const struct nlattr *head, int len);
|
|
# 13 "include/net/sch_generic.h" 2
|
|
|
|
struct Qdisc_ops;
|
|
struct qdisc_walker;
|
|
struct tcf_walker;
|
|
struct module;
|
|
|
|
struct qdisc_rate_table {
|
|
struct tc_ratespec rate;
|
|
u32 data[256];
|
|
struct qdisc_rate_table *next;
|
|
int refcnt;
|
|
};
|
|
|
|
enum qdisc_state_t {
|
|
__QDISC_STATE_SCHED,
|
|
__QDISC_STATE_DEACTIVATED,
|
|
__QDISC_STATE_THROTTLED,
|
|
};
|
|
|
|
|
|
|
|
|
|
enum qdisc___state_t {
|
|
__QDISC___STATE_RUNNING = 1,
|
|
};
|
|
|
|
struct qdisc_size_table {
|
|
struct callback_head rcu;
|
|
struct list_head list;
|
|
struct tc_sizespec szopts;
|
|
int refcnt;
|
|
u16 data[];
|
|
};
|
|
|
|
struct Qdisc {
|
|
int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev);
|
|
struct sk_buff * (*dequeue)(struct Qdisc *dev);
|
|
unsigned int flags;
|
|
# 67 "include/net/sch_generic.h"
|
|
u32 limit;
|
|
const struct Qdisc_ops *ops;
|
|
struct qdisc_size_table *stab;
|
|
struct list_head list;
|
|
u32 handle;
|
|
u32 parent;
|
|
int (*reshape_fail)(struct sk_buff *skb,
|
|
struct Qdisc *q);
|
|
|
|
void *u32_node;
|
|
|
|
|
|
|
|
|
|
struct Qdisc *__parent;
|
|
struct netdev_queue *dev_queue;
|
|
|
|
struct gnet_stats_rate_est64 rate_est;
|
|
struct gnet_stats_basic_cpu *cpu_bstats;
|
|
struct gnet_stats_queue *cpu_qstats;
|
|
|
|
struct Qdisc *next_sched;
|
|
struct sk_buff *gso_skb;
|
|
|
|
|
|
|
|
unsigned long state;
|
|
struct sk_buff_head q;
|
|
struct gnet_stats_basic_packed bstats;
|
|
unsigned int __state;
|
|
struct gnet_stats_queue qstats;
|
|
struct callback_head callback_head;
|
|
int padded;
|
|
atomic_t refcnt;
|
|
|
|
spinlock_t busylock __attribute__((__aligned__((1 << 6))));
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool qdisc_is_running(const struct Qdisc *qdisc)
|
|
{
|
|
return (qdisc->__state & __QDISC___STATE_RUNNING) ? true : false;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool qdisc_run_begin(struct Qdisc *qdisc)
|
|
{
|
|
if (qdisc_is_running(qdisc))
|
|
return false;
|
|
qdisc->__state |= __QDISC___STATE_RUNNING;
|
|
return true;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void qdisc_run_end(struct Qdisc *qdisc)
|
|
{
|
|
qdisc->__state &= ~__QDISC___STATE_RUNNING;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool qdisc_may_bulk(const struct Qdisc *qdisc)
|
|
{
|
|
return qdisc->flags & 0x10;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int qdisc_avail_bulklimit(const struct netdev_queue *txq)
|
|
{
|
|
|
|
|
|
return dql_avail(&txq->dql);
|
|
|
|
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool qdisc_is_throttled(const struct Qdisc *qdisc)
|
|
{
|
|
return test_bit(__QDISC_STATE_THROTTLED, &qdisc->state) ? true : false;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void qdisc_throttled(struct Qdisc *qdisc)
|
|
{
|
|
_set_bit(__QDISC_STATE_THROTTLED,&qdisc->state);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void qdisc_unthrottled(struct Qdisc *qdisc)
|
|
{
|
|
_clear_bit(__QDISC_STATE_THROTTLED,&qdisc->state);
|
|
}
|
|
|
|
struct Qdisc_class_ops {
|
|
|
|
struct netdev_queue * (*select_queue)(struct Qdisc *, struct tcmsg *);
|
|
int (*graft)(struct Qdisc *, unsigned long cl,
|
|
struct Qdisc *, struct Qdisc **);
|
|
struct Qdisc * (*leaf)(struct Qdisc *, unsigned long cl);
|
|
void (*qlen_notify)(struct Qdisc *, unsigned long);
|
|
|
|
|
|
unsigned long (*get)(struct Qdisc *, u32 classid);
|
|
void (*put)(struct Qdisc *, unsigned long);
|
|
int (*change)(struct Qdisc *, u32, u32,
|
|
struct nlattr **, unsigned long *);
|
|
int (*delete)(struct Qdisc *, unsigned long);
|
|
void (*walk)(struct Qdisc *, struct qdisc_walker * arg);
|
|
|
|
|
|
struct tcf_proto ** (*tcf_chain)(struct Qdisc *, unsigned long);
|
|
unsigned long (*bind_tcf)(struct Qdisc *, unsigned long,
|
|
u32 classid);
|
|
void (*unbind_tcf)(struct Qdisc *, unsigned long);
|
|
|
|
|
|
int (*dump)(struct Qdisc *, unsigned long,
|
|
struct sk_buff *skb, struct tcmsg*);
|
|
int (*dump_stats)(struct Qdisc *, unsigned long,
|
|
struct gnet_dump *);
|
|
};
|
|
|
|
struct Qdisc_ops {
|
|
struct Qdisc_ops *next;
|
|
const struct Qdisc_class_ops *cl_ops;
|
|
char id[16];
|
|
int priv_size;
|
|
|
|
int (*enqueue)(struct sk_buff *, struct Qdisc *);
|
|
struct sk_buff * (*dequeue)(struct Qdisc *);
|
|
struct sk_buff * (*peek)(struct Qdisc *);
|
|
unsigned int (*drop)(struct Qdisc *);
|
|
|
|
int (*init)(struct Qdisc *, struct nlattr *arg);
|
|
void (*reset)(struct Qdisc *);
|
|
void (*destroy)(struct Qdisc *);
|
|
int (*change)(struct Qdisc *, struct nlattr *arg);
|
|
void (*attach)(struct Qdisc *);
|
|
|
|
int (*dump)(struct Qdisc *, struct sk_buff *);
|
|
int (*dump_stats)(struct Qdisc *, struct gnet_dump *);
|
|
|
|
struct module *owner;
|
|
};
|
|
|
|
|
|
struct tcf_result {
|
|
unsigned long class;
|
|
u32 classid;
|
|
};
|
|
|
|
struct tcf_proto_ops {
|
|
struct list_head head;
|
|
char kind[16];
|
|
|
|
int (*classify)(struct sk_buff *,
|
|
const struct tcf_proto *,
|
|
struct tcf_result *);
|
|
int (*init)(struct tcf_proto*);
|
|
bool (*destroy)(struct tcf_proto*, bool);
|
|
|
|
unsigned long (*get)(struct tcf_proto*, u32 handle);
|
|
int (*change)(struct net *net, struct sk_buff *,
|
|
struct tcf_proto*, unsigned long,
|
|
u32 handle, struct nlattr **,
|
|
unsigned long *, bool);
|
|
int (*delete)(struct tcf_proto*, unsigned long);
|
|
void (*walk)(struct tcf_proto*, struct tcf_walker *arg);
|
|
|
|
|
|
int (*dump)(struct net*, struct tcf_proto*, unsigned long,
|
|
struct sk_buff *skb, struct tcmsg*);
|
|
|
|
struct module *owner;
|
|
};
|
|
|
|
struct tcf_proto {
|
|
|
|
struct tcf_proto *next;
|
|
void *root;
|
|
int (*classify)(struct sk_buff *,
|
|
const struct tcf_proto *,
|
|
struct tcf_result *);
|
|
__be16 protocol;
|
|
|
|
|
|
u32 prio;
|
|
u32 classid;
|
|
struct Qdisc *q;
|
|
void *data;
|
|
const struct tcf_proto_ops *ops;
|
|
struct callback_head rcu;
|
|
};
|
|
|
|
struct qdisc_skb_cb {
|
|
unsigned int pkt_len;
|
|
u16 slave_dev_queue_mapping;
|
|
u16 tc_classid;
|
|
|
|
unsigned char data[20];
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
|
|
{
|
|
struct qdisc_skb_cb *qcb;
|
|
|
|
((void)sizeof(char[1 - 2*!!(sizeof(skb->cb) < __builtin_offsetof(struct qdisc_skb_cb, data) + sz)]));
|
|
((void)sizeof(char[1 - 2*!!(sizeof(qcb->data) < sz)]));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int qdisc_qlen(const struct Qdisc *q)
|
|
{
|
|
return q->q.qlen;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct qdisc_skb_cb *qdisc_skb_cb(const struct sk_buff *skb)
|
|
{
|
|
return (struct qdisc_skb_cb *)skb->cb;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) spinlock_t *qdisc_lock(struct Qdisc *qdisc)
|
|
{
|
|
return &qdisc->q.lock;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct Qdisc *qdisc_root(const struct Qdisc *qdisc)
|
|
{
|
|
struct Qdisc *q = ({ typeof(*(qdisc->dev_queue->qdisc)) *________p1 = (typeof(*(qdisc->dev_queue->qdisc)) *)({ typeof((qdisc->dev_queue->qdisc)) _________p1 = ({ union { typeof((qdisc->dev_queue->qdisc)) __val; char __c[1]; } __u; if (1) __read_once_size(&((qdisc->dev_queue->qdisc)), __u.__c, sizeof((qdisc->dev_queue->qdisc))); else __read_once_size_nocheck(&((qdisc->dev_queue->qdisc)), __u.__c, sizeof((qdisc->dev_queue->qdisc))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(qdisc->dev_queue->qdisc)) *)(________p1)); });
|
|
|
|
return q;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct Qdisc *qdisc_root_sleeping(const struct Qdisc *qdisc)
|
|
{
|
|
return qdisc->dev_queue->qdisc_sleeping;
|
|
}
|
|
# 308 "include/net/sch_generic.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) spinlock_t *qdisc_root_lock(const struct Qdisc *qdisc)
|
|
{
|
|
struct Qdisc *root = qdisc_root(qdisc);
|
|
|
|
do { if (__builtin_expect(!!(!rtnl_is_locked()), 0)) { printk("\001" "3" "RTNL: assertion failed at %s (%d)\n", "include/net/sch_generic.h", 312); dump_stack(); } } while(0);
|
|
return qdisc_lock(root);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) spinlock_t *qdisc_root_sleeping_lock(const struct Qdisc *qdisc)
|
|
{
|
|
struct Qdisc *root = qdisc_root_sleeping(qdisc);
|
|
|
|
do { if (__builtin_expect(!!(!rtnl_is_locked()), 0)) { printk("\001" "3" "RTNL: assertion failed at %s (%d)\n", "include/net/sch_generic.h", 320); dump_stack(); } } while(0);
|
|
return qdisc_lock(root);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct net_device *qdisc_dev(const struct Qdisc *qdisc)
|
|
{
|
|
return qdisc->dev_queue->dev;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sch_tree_lock(const struct Qdisc *q)
|
|
{
|
|
spin_lock_bh(qdisc_root_sleeping_lock(q));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sch_tree_unlock(const struct Qdisc *q)
|
|
{
|
|
spin_unlock_bh(qdisc_root_sleeping_lock(q));
|
|
}
|
|
|
|
|
|
|
|
|
|
extern struct Qdisc noop_qdisc;
|
|
extern struct Qdisc_ops noop_qdisc_ops;
|
|
extern struct Qdisc_ops pfifo_fast_ops;
|
|
extern struct Qdisc_ops mq_qdisc_ops;
|
|
extern struct Qdisc_ops noqueue_qdisc_ops;
|
|
extern const struct Qdisc_ops *default_qdisc_ops;
|
|
|
|
struct Qdisc_class_common {
|
|
u32 classid;
|
|
struct hlist_node hnode;
|
|
};
|
|
|
|
struct Qdisc_class_hash {
|
|
struct hlist_head *hash;
|
|
unsigned int hashsize;
|
|
unsigned int hashmask;
|
|
unsigned int hashelems;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int qdisc_class_hash(u32 id, u32 mask)
|
|
{
|
|
id ^= id >> 8;
|
|
id ^= id >> 4;
|
|
return id & mask;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct Qdisc_class_common *
|
|
qdisc_class_find(const struct Qdisc_class_hash *hash, u32 id)
|
|
{
|
|
struct Qdisc_class_common *cl;
|
|
unsigned int h;
|
|
|
|
h = qdisc_class_hash(id, hash->hashmask);
|
|
for (cl = ({ typeof((&hash->hash[h])->first) ____ptr = ((&hash->hash[h])->first); ____ptr ? ({ const typeof( ((typeof(*(cl)) *)0)->hnode ) *__mptr = (____ptr); (typeof(*(cl)) *)( (char *)__mptr - __builtin_offsetof(typeof(*(cl)), hnode) );}) : ((void *)0); }); cl; cl = ({ typeof((cl)->hnode.next) ____ptr = ((cl)->hnode.next); ____ptr ? ({ const typeof( ((typeof(*(cl)) *)0)->hnode ) *__mptr = (____ptr); (typeof(*(cl)) *)( (char *)__mptr - __builtin_offsetof(typeof(*(cl)), hnode) );}) : ((void *)0); })) {
|
|
if (cl->classid == id)
|
|
return cl;
|
|
}
|
|
return ((void *)0);
|
|
}
|
|
|
|
int qdisc_class_hash_init(struct Qdisc_class_hash *);
|
|
void qdisc_class_hash_insert(struct Qdisc_class_hash *,
|
|
struct Qdisc_class_common *);
|
|
void qdisc_class_hash_remove(struct Qdisc_class_hash *,
|
|
struct Qdisc_class_common *);
|
|
void qdisc_class_hash_grow(struct Qdisc *, struct Qdisc_class_hash *);
|
|
void qdisc_class_hash_destroy(struct Qdisc_class_hash *);
|
|
|
|
void dev_init_scheduler(struct net_device *dev);
|
|
void dev_shutdown(struct net_device *dev);
|
|
void dev_activate(struct net_device *dev);
|
|
void dev_deactivate(struct net_device *dev);
|
|
void dev_deactivate_many(struct list_head *head);
|
|
struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue,
|
|
struct Qdisc *qdisc);
|
|
void qdisc_reset(struct Qdisc *qdisc);
|
|
void qdisc_destroy(struct Qdisc *qdisc);
|
|
void qdisc_tree_reduce_backlog(struct Qdisc *qdisc, unsigned int n,
|
|
unsigned int len);
|
|
struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
|
|
const struct Qdisc_ops *ops);
|
|
struct Qdisc *qdisc_create_dflt(struct netdev_queue *dev_queue,
|
|
const struct Qdisc_ops *ops, u32 parentid);
|
|
void __qdisc_calculate_pkt_len(struct sk_buff *skb,
|
|
const struct qdisc_size_table *stab);
|
|
bool tcf_destroy(struct tcf_proto *tp, bool force);
|
|
void tcf_destroy_chain(struct tcf_proto **fl);
|
|
int skb_do_redirect(struct sk_buff *);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_at_tc_ingress(const struct sk_buff *skb)
|
|
{
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i)
|
|
{
|
|
struct Qdisc *qdisc;
|
|
|
|
for (; i < dev->num_tx_queues; i++) {
|
|
qdisc = ({ do { } while (0); ; ((typeof(*(netdev_get_tx_queue(dev, i)->qdisc)) *)((netdev_get_tx_queue(dev, i)->qdisc))); });
|
|
if (qdisc) {
|
|
spin_lock_bh(qdisc_lock(qdisc));
|
|
qdisc_reset(qdisc);
|
|
spin_unlock_bh(qdisc_lock(qdisc));
|
|
}
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void qdisc_reset_all_tx(struct net_device *dev)
|
|
{
|
|
qdisc_reset_all_tx_gt(dev, 0);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool qdisc_all_tx_empty(const struct net_device *dev)
|
|
{
|
|
unsigned int i;
|
|
|
|
rcu_read_lock();
|
|
for (i = 0; i < dev->num_tx_queues; i++) {
|
|
struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
|
|
const struct Qdisc *q = ({ typeof(*(txq->qdisc)) *________p1 = (typeof(*(txq->qdisc)) *)({ typeof((txq->qdisc)) _________p1 = ({ union { typeof((txq->qdisc)) __val; char __c[1]; } __u; if (1) __read_once_size(&((txq->qdisc)), __u.__c, sizeof((txq->qdisc))); else __read_once_size_nocheck(&((txq->qdisc)), __u.__c, sizeof((txq->qdisc))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(txq->qdisc)) *)(________p1)); });
|
|
|
|
if (q->q.qlen) {
|
|
rcu_read_unlock();
|
|
return false;
|
|
}
|
|
}
|
|
rcu_read_unlock();
|
|
return true;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool qdisc_tx_changing(const struct net_device *dev)
|
|
{
|
|
unsigned int i;
|
|
|
|
for (i = 0; i < dev->num_tx_queues; i++) {
|
|
struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
|
|
if (({ typeof(*(txq->qdisc)) *_________p1 = (typeof(*(txq->qdisc)) *)({ union { typeof((txq->qdisc)) __val; char __c[1]; } __u; if (1) __read_once_size(&((txq->qdisc)), __u.__c, sizeof((txq->qdisc))); else __read_once_size_nocheck(&((txq->qdisc)), __u.__c, sizeof((txq->qdisc))); __u.__val; }); ; ((typeof(*(txq->qdisc)) *)(_________p1)); }) != txq->qdisc_sleeping)
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool qdisc_tx_is_noop(const struct net_device *dev)
|
|
{
|
|
unsigned int i;
|
|
|
|
for (i = 0; i < dev->num_tx_queues; i++) {
|
|
struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
|
|
if (({ typeof(*(txq->qdisc)) *_________p1 = (typeof(*(txq->qdisc)) *)({ union { typeof((txq->qdisc)) __val; char __c[1]; } __u; if (1) __read_once_size(&((txq->qdisc)), __u.__c, sizeof((txq->qdisc))); else __read_once_size_nocheck(&((txq->qdisc)), __u.__c, sizeof((txq->qdisc))); __u.__val; }); ; ((typeof(*(txq->qdisc)) *)(_________p1)); }) != &noop_qdisc)
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int qdisc_pkt_len(const struct sk_buff *skb)
|
|
{
|
|
return qdisc_skb_cb(skb)->pkt_len;
|
|
}
|
|
|
|
|
|
enum net_xmit_qdisc_t {
|
|
__NET_XMIT_STOLEN = 0x00010000,
|
|
__NET_XMIT_BYPASS = 0x00020000,
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void qdisc_calculate_pkt_len(struct sk_buff *skb,
|
|
const struct Qdisc *sch)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch)
|
|
{
|
|
qdisc_calculate_pkt_len(skb, sch);
|
|
return sch->enqueue(skb, sch);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool qdisc_is_percpu_stats(const struct Qdisc *q)
|
|
{
|
|
return q->flags & 0x20;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bstats_update(struct gnet_stats_basic_packed *bstats,
|
|
const struct sk_buff *skb)
|
|
{
|
|
bstats->bytes += qdisc_pkt_len(skb);
|
|
bstats->packets += skb_is_gso(skb) ? ((struct skb_shared_info *)(skb_end_pointer(skb)))->gso_segs : 1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bstats_cpu_update(struct gnet_stats_basic_cpu *bstats,
|
|
const struct sk_buff *skb)
|
|
{
|
|
u64_stats_update_begin(&bstats->syncp);
|
|
bstats_update(&bstats->bstats, skb);
|
|
u64_stats_update_end(&bstats->syncp);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void qdisc_bstats_cpu_update(struct Qdisc *sch,
|
|
const struct sk_buff *skb)
|
|
{
|
|
bstats_cpu_update(({ do { const void *__vpp_verify = (typeof((sch->cpu_bstats) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(sch->cpu_bstats)) *)(sch->cpu_bstats))); (typeof((typeof(*(sch->cpu_bstats)) *)(sch->cpu_bstats))) (__ptr + ((__my_cpu_offset()))); }); }), skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void qdisc_bstats_update(struct Qdisc *sch,
|
|
const struct sk_buff *skb)
|
|
{
|
|
bstats_update(&sch->bstats, skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void qdisc_qstats_backlog_dec(struct Qdisc *sch,
|
|
const struct sk_buff *skb)
|
|
{
|
|
sch->qstats.backlog -= qdisc_pkt_len(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void qdisc_qstats_backlog_inc(struct Qdisc *sch,
|
|
const struct sk_buff *skb)
|
|
{
|
|
sch->qstats.backlog += qdisc_pkt_len(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __qdisc_qstats_drop(struct Qdisc *sch, int count)
|
|
{
|
|
sch->qstats.drops += count;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void qstats_drop_inc(struct gnet_stats_queue *qstats)
|
|
{
|
|
qstats->drops++;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void qstats_overlimit_inc(struct gnet_stats_queue *qstats)
|
|
{
|
|
qstats->overlimits++;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void qdisc_qstats_drop(struct Qdisc *sch)
|
|
{
|
|
qstats_drop_inc(&sch->qstats);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void qdisc_qstats_cpu_drop(struct Qdisc *sch)
|
|
{
|
|
qstats_drop_inc(({ do { const void *__vpp_verify = (typeof((sch->cpu_qstats) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : "0"((typeof(*(sch->cpu_qstats)) *)(sch->cpu_qstats))); (typeof((typeof(*(sch->cpu_qstats)) *)(sch->cpu_qstats))) (__ptr + ((__my_cpu_offset()))); }); }));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void qdisc_qstats_overlimit(struct Qdisc *sch)
|
|
{
|
|
sch->qstats.overlimits++;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch,
|
|
struct sk_buff_head *list)
|
|
{
|
|
__skb_queue_tail(list, skb);
|
|
qdisc_qstats_backlog_inc(sch, skb);
|
|
|
|
return 0x00;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch)
|
|
{
|
|
return __qdisc_enqueue_tail(skb, sch, &sch->q);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *__qdisc_dequeue_head(struct Qdisc *sch,
|
|
struct sk_buff_head *list)
|
|
{
|
|
struct sk_buff *skb = __skb_dequeue(list);
|
|
|
|
if (__builtin_expect(!!(skb != ((void *)0)), 1)) {
|
|
qdisc_qstats_backlog_dec(sch, skb);
|
|
qdisc_bstats_update(sch, skb);
|
|
}
|
|
|
|
return skb;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *qdisc_dequeue_head(struct Qdisc *sch)
|
|
{
|
|
return __qdisc_dequeue_head(sch, &sch->q);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int __qdisc_queue_drop_head(struct Qdisc *sch,
|
|
struct sk_buff_head *list)
|
|
{
|
|
struct sk_buff *skb = __skb_dequeue(list);
|
|
|
|
if (__builtin_expect(!!(skb != ((void *)0)), 1)) {
|
|
unsigned int len = qdisc_pkt_len(skb);
|
|
qdisc_qstats_backlog_dec(sch, skb);
|
|
kfree_skb(skb);
|
|
return len;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int qdisc_queue_drop_head(struct Qdisc *sch)
|
|
{
|
|
return __qdisc_queue_drop_head(sch, &sch->q);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *__qdisc_dequeue_tail(struct Qdisc *sch,
|
|
struct sk_buff_head *list)
|
|
{
|
|
struct sk_buff *skb = __skb_dequeue_tail(list);
|
|
|
|
if (__builtin_expect(!!(skb != ((void *)0)), 1))
|
|
qdisc_qstats_backlog_dec(sch, skb);
|
|
|
|
return skb;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *qdisc_dequeue_tail(struct Qdisc *sch)
|
|
{
|
|
return __qdisc_dequeue_tail(sch, &sch->q);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *qdisc_peek_head(struct Qdisc *sch)
|
|
{
|
|
return skb_peek(&sch->q);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *qdisc_peek_dequeued(struct Qdisc *sch)
|
|
{
|
|
|
|
if (!sch->gso_skb) {
|
|
sch->gso_skb = sch->dequeue(sch);
|
|
if (sch->gso_skb)
|
|
|
|
sch->q.qlen++;
|
|
}
|
|
|
|
return sch->gso_skb;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *qdisc_dequeue_peeked(struct Qdisc *sch)
|
|
{
|
|
struct sk_buff *skb = sch->gso_skb;
|
|
|
|
if (skb) {
|
|
sch->gso_skb = ((void *)0);
|
|
sch->q.qlen--;
|
|
} else {
|
|
skb = sch->dequeue(sch);
|
|
}
|
|
|
|
return skb;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __qdisc_reset_queue(struct Qdisc *sch,
|
|
struct sk_buff_head *list)
|
|
{
|
|
|
|
|
|
|
|
|
|
__skb_queue_purge(list);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void qdisc_reset_queue(struct Qdisc *sch)
|
|
{
|
|
__qdisc_reset_queue(sch, &sch->q);
|
|
sch->qstats.backlog = 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct Qdisc *qdisc_replace(struct Qdisc *sch, struct Qdisc *new,
|
|
struct Qdisc **pold)
|
|
{
|
|
struct Qdisc *old;
|
|
|
|
sch_tree_lock(sch);
|
|
old = *pold;
|
|
*pold = new;
|
|
if (old != ((void *)0)) {
|
|
unsigned int qlen = old->q.qlen;
|
|
unsigned int backlog = old->qstats.backlog;
|
|
|
|
qdisc_reset(old);
|
|
qdisc_tree_reduce_backlog(old, qlen, backlog);
|
|
}
|
|
sch_tree_unlock(sch);
|
|
|
|
return old;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int __qdisc_queue_drop(struct Qdisc *sch,
|
|
struct sk_buff_head *list)
|
|
{
|
|
struct sk_buff *skb = __qdisc_dequeue_tail(sch, list);
|
|
|
|
if (__builtin_expect(!!(skb != ((void *)0)), 1)) {
|
|
unsigned int len = qdisc_pkt_len(skb);
|
|
kfree_skb(skb);
|
|
return len;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int qdisc_queue_drop(struct Qdisc *sch)
|
|
{
|
|
return __qdisc_queue_drop(sch, &sch->q);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int qdisc_drop(struct sk_buff *skb, struct Qdisc *sch)
|
|
{
|
|
kfree_skb(skb);
|
|
qdisc_qstats_drop(sch);
|
|
|
|
return 0x01;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int qdisc_reshape_fail(struct sk_buff *skb, struct Qdisc *sch)
|
|
{
|
|
qdisc_qstats_drop(sch);
|
|
# 770 "include/net/sch_generic.h"
|
|
kfree_skb(skb);
|
|
return 0x01;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 qdisc_l2t(struct qdisc_rate_table* rtab, unsigned int pktlen)
|
|
{
|
|
int slot = pktlen + rtab->rate.cell_align + rtab->rate.overhead;
|
|
if (slot < 0)
|
|
slot = 0;
|
|
slot >>= rtab->rate.cell_log;
|
|
if (slot > 255)
|
|
return rtab->data[255]*(slot >> 8) + rtab->data[slot & 0xFF];
|
|
return rtab->data[slot];
|
|
}
|
|
|
|
struct psched_ratecfg {
|
|
u64 rate_bytes_ps;
|
|
u32 mult;
|
|
u16 overhead;
|
|
u8 linklayer;
|
|
u8 shift;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 psched_l2t_ns(const struct psched_ratecfg *r,
|
|
unsigned int len)
|
|
{
|
|
len += r->overhead;
|
|
|
|
if (__builtin_expect(!!(r->linklayer == TC_LINKLAYER_ATM), 0))
|
|
return ((u64)((((len) + (48) - 1) / (48))*53) * r->mult) >> r->shift;
|
|
|
|
return ((u64)len * r->mult) >> r->shift;
|
|
}
|
|
|
|
void psched_ratecfg_precompute(struct psched_ratecfg *r,
|
|
const struct tc_ratespec *conf,
|
|
u64 rate64);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void psched_ratecfg_getrate(struct tc_ratespec *res,
|
|
const struct psched_ratecfg *r)
|
|
{
|
|
({ void *__p = (res); size_t __n = sizeof(*res); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); });
|
|
|
|
|
|
|
|
|
|
|
|
res->rate = ({ u64 __min1 = (r->rate_bytes_ps); u64 __min2 = (~0U); __min1 < __min2 ? __min1: __min2; });
|
|
|
|
res->overhead = r->overhead;
|
|
res->linklayer = (r->linklayer & 0x0F);
|
|
}
|
|
# 17 "include/linux/filter.h" 2
|
|
|
|
# 1 "./arch/arm/include/asm/cacheflush.h" 1
|
|
# 15 "./arch/arm/include/asm/cacheflush.h"
|
|
# 1 "./arch/arm/include/asm/glue-cache.h" 1
|
|
# 13 "./arch/arm/include/asm/glue-cache.h"
|
|
# 1 "./arch/arm/include/asm/glue.h" 1
|
|
# 14 "./arch/arm/include/asm/glue-cache.h" 2
|
|
# 133 "./arch/arm/include/asm/glue-cache.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void nop_flush_icache_all(void) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void nop_flush_kern_cache_all(void) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void nop_flush_kern_cache_louis(void) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void nop_flush_user_cache_all(void) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void nop_flush_user_cache_range(unsigned long a,
|
|
unsigned long b, unsigned int c) { }
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void nop_coherent_kern_range(unsigned long a, unsigned long b) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int nop_coherent_user_range(unsigned long a,
|
|
unsigned long b) { return 0; }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void nop_flush_kern_dcache_area(void *a, size_t s) { }
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void nop_dma_flush_range(const void *a, const void *b) { }
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void nop_dma_map_area(const void *s, size_t l, int f) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void nop_dma_unmap_area(const void *s, size_t l, int f) { }
|
|
# 16 "./arch/arm/include/asm/cacheflush.h" 2
|
|
|
|
# 1 "./arch/arm/include/asm/cachetype.h" 1
|
|
# 12 "./arch/arm/include/asm/cachetype.h"
|
|
extern unsigned int cacheid;
|
|
# 53 "./arch/arm/include/asm/cachetype.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int __attribute__((pure)) cacheid_is(unsigned int mask)
|
|
{
|
|
return ((0) & mask) |
|
|
(~((1 << 0)) & ((1 << 1) | (1 << 3) | (1 << 4) | (1 << 5)) & mask & cacheid);
|
|
}
|
|
# 18 "./arch/arm/include/asm/cacheflush.h" 2
|
|
# 1 "./arch/arm/include/asm/outercache.h" 1
|
|
# 26 "./arch/arm/include/asm/outercache.h"
|
|
struct l2x0_regs;
|
|
|
|
struct outer_cache_fns {
|
|
void (*inv_range)(unsigned long, unsigned long);
|
|
void (*clean_range)(unsigned long, unsigned long);
|
|
void (*flush_range)(unsigned long, unsigned long);
|
|
void (*flush_all)(void);
|
|
void (*disable)(void);
|
|
|
|
void (*sync)(void);
|
|
|
|
void (*resume)(void);
|
|
|
|
|
|
void (*write_sec)(unsigned long, unsigned);
|
|
void (*configure)(const struct l2x0_regs *);
|
|
};
|
|
|
|
extern struct outer_cache_fns outer_cache;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void outer_inv_range(phys_addr_t start, phys_addr_t end)
|
|
{
|
|
if (outer_cache.inv_range)
|
|
outer_cache.inv_range(start, end);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void outer_clean_range(phys_addr_t start, phys_addr_t end)
|
|
{
|
|
if (outer_cache.clean_range)
|
|
outer_cache.clean_range(start, end);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void outer_flush_range(phys_addr_t start, phys_addr_t end)
|
|
{
|
|
if (outer_cache.flush_range)
|
|
outer_cache.flush_range(start, end);
|
|
}
|
|
# 91 "./arch/arm/include/asm/outercache.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void outer_flush_all(void)
|
|
{
|
|
if (outer_cache.flush_all)
|
|
outer_cache.flush_all();
|
|
}
|
|
# 104 "./arch/arm/include/asm/outercache.h"
|
|
extern void outer_disable(void);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void outer_resume(void)
|
|
{
|
|
if (outer_cache.resume)
|
|
outer_cache.resume();
|
|
}
|
|
# 19 "./arch/arm/include/asm/cacheflush.h" 2
|
|
# 104 "./arch/arm/include/asm/cacheflush.h"
|
|
struct cpu_cache_fns {
|
|
void (*flush_icache_all)(void);
|
|
void (*flush_kern_all)(void);
|
|
void (*flush_kern_louis)(void);
|
|
void (*flush_user_all)(void);
|
|
void (*flush_user_range)(unsigned long, unsigned long, unsigned int);
|
|
|
|
void (*coherent_kern_range)(unsigned long, unsigned long);
|
|
int (*coherent_user_range)(unsigned long, unsigned long);
|
|
void (*flush_kern_dcache_area)(void *, size_t);
|
|
|
|
void (*dma_map_area)(const void *, size_t, int);
|
|
void (*dma_unmap_area)(const void *, size_t, int);
|
|
|
|
void (*dma_flush_range)(const void *, const void *);
|
|
};
|
|
# 147 "./arch/arm/include/asm/cacheflush.h"
|
|
extern void v7_flush_icache_all(void);
|
|
extern void v7_flush_kern_cache_all(void);
|
|
extern void v7_flush_kern_cache_louis(void);
|
|
extern void v7_flush_user_cache_all(void);
|
|
extern void v7_flush_user_cache_range(unsigned long, unsigned long, unsigned int);
|
|
extern void v7_coherent_kern_range(unsigned long, unsigned long);
|
|
extern int v7_coherent_user_range(unsigned long, unsigned long);
|
|
extern void v7_flush_kern_dcache_area(void *, size_t);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern void v7_dma_flush_range(const void *, const void *);
|
|
# 171 "./arch/arm/include/asm/cacheflush.h"
|
|
extern void copy_to_user_page(struct vm_area_struct *, struct page *,
|
|
unsigned long, void *, const void *, unsigned long);
|
|
# 208 "./arch/arm/include/asm/cacheflush.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __flush_icache_all(void)
|
|
{
|
|
v7_flush_icache_all();
|
|
__asm__ __volatile__ ("dsb " "ishst" : : : "memory");
|
|
}
|
|
# 221 "./arch/arm/include/asm/cacheflush.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void vivt_flush_cache_mm(struct mm_struct *mm)
|
|
{
|
|
if (cpumask_test_cpu((current_thread_info()->cpu), mm_cpumask(mm)))
|
|
v7_flush_user_cache_all();
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
vivt_flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end)
|
|
{
|
|
struct mm_struct *mm = vma->vm_mm;
|
|
|
|
if (!mm || cpumask_test_cpu((current_thread_info()->cpu), mm_cpumask(mm)))
|
|
v7_flush_user_cache_range(start & (~((1 << 12) - 1)), ((((end)) + ((typeof((end)))((((1UL) << 12))) - 1)) & ~((typeof((end)))((((1UL) << 12))) - 1)),
|
|
vma->vm_flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
vivt_flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn)
|
|
{
|
|
struct mm_struct *mm = vma->vm_mm;
|
|
|
|
if (!mm || cpumask_test_cpu((current_thread_info()->cpu), mm_cpumask(mm))) {
|
|
unsigned long addr = user_addr & (~((1 << 12) - 1));
|
|
v7_flush_user_cache_range(addr, addr + ((1UL) << 12), vma->vm_flags);
|
|
}
|
|
}
|
|
# 256 "./arch/arm/include/asm/cacheflush.h"
|
|
extern void flush_cache_mm(struct mm_struct *mm);
|
|
extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end);
|
|
extern void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn);
|
|
# 295 "./arch/arm/include/asm/cacheflush.h"
|
|
extern void flush_dcache_page(struct page *);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void flush_kernel_vmap_range(void *addr, int size)
|
|
{
|
|
if ((cacheid_is((1 << 0)) || cacheid_is((1 << 2))))
|
|
v7_flush_kern_dcache_area(addr, (size_t)size);
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void invalidate_kernel_vmap_range(void *addr, int size)
|
|
{
|
|
if ((cacheid_is((1 << 0)) || cacheid_is((1 << 2))))
|
|
v7_flush_kern_dcache_area(addr, (size_t)size);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void flush_anon_page(struct vm_area_struct *vma,
|
|
struct page *page, unsigned long vmaddr)
|
|
{
|
|
extern void __flush_anon_page(struct vm_area_struct *vma,
|
|
struct page *, unsigned long);
|
|
if (PageAnon(page))
|
|
__flush_anon_page(vma, page, vmaddr);
|
|
}
|
|
|
|
|
|
extern void flush_kernel_dcache_page(struct page *);
|
|
# 342 "./arch/arm/include/asm/cacheflush.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void flush_cache_vmap(unsigned long start, unsigned long end)
|
|
{
|
|
if (!cacheid_is((1 << 1)))
|
|
v7_flush_kern_cache_all();
|
|
else
|
|
|
|
|
|
|
|
|
|
__asm__ __volatile__ ("dsb " "ishst" : : : "memory");
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void flush_cache_vunmap(unsigned long start, unsigned long end)
|
|
{
|
|
if (!cacheid_is((1 << 1)))
|
|
v7_flush_kern_cache_all();
|
|
}
|
|
# 397 "./arch/arm/include/asm/cacheflush.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __sync_cache_range_w(volatile void *p, size_t size)
|
|
{
|
|
char *_p = (char *)p;
|
|
|
|
v7_flush_kern_dcache_area(_p, size);
|
|
outer_clean_range(__virt_to_phys((unsigned long)(_p)), __virt_to_phys((unsigned long)(_p + size)));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __sync_cache_range_r(volatile void *p, size_t size)
|
|
{
|
|
char *_p = (char *)p;
|
|
|
|
|
|
if (outer_cache.flush_range) {
|
|
|
|
|
|
|
|
|
|
v7_flush_kern_dcache_area(_p, size);
|
|
|
|
|
|
outer_flush_range(__virt_to_phys((unsigned long)(_p)), __virt_to_phys((unsigned long)(_p + size)));
|
|
}
|
|
|
|
|
|
|
|
v7_flush_kern_dcache_area(_p, size);
|
|
}
|
|
# 482 "./arch/arm/include/asm/cacheflush.h"
|
|
int set_memory_ro(unsigned long addr, int numpages);
|
|
int set_memory_rw(unsigned long addr, int numpages);
|
|
int set_memory_x(unsigned long addr, int numpages);
|
|
int set_memory_nx(unsigned long addr, int numpages);
|
|
# 498 "./arch/arm/include/asm/cacheflush.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_kernel_text_rw(void) { }
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void set_kernel_text_ro(void) { }
|
|
|
|
|
|
void flush_uprobe_xol_access(struct page *page, unsigned long uaddr,
|
|
void *kaddr, unsigned long len);
|
|
# 514 "./arch/arm/include/asm/cacheflush.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void secure_flush_area(const void *addr, size_t size)
|
|
{
|
|
phys_addr_t phys = __virt_to_phys((unsigned long)(addr));
|
|
|
|
v7_flush_kern_dcache_area((void *)addr, size);
|
|
outer_flush_range(phys, phys + size);
|
|
}
|
|
# 19 "include/linux/filter.h" 2
|
|
|
|
# 1 "include/uapi/linux/filter.h" 1
|
|
# 10 "include/uapi/linux/filter.h"
|
|
# 1 "./include/uapi/linux/bpf_common.h" 1
|
|
# 11 "include/uapi/linux/filter.h" 2
|
|
# 23 "include/uapi/linux/filter.h"
|
|
struct sock_filter {
|
|
__u16 code;
|
|
__u8 jt;
|
|
__u8 jf;
|
|
__u32 k;
|
|
};
|
|
|
|
struct sock_fprog {
|
|
unsigned short len;
|
|
struct sock_filter *filter;
|
|
};
|
|
# 21 "include/linux/filter.h" 2
|
|
# 1 "include/uapi/linux/bpf.h" 1
|
|
# 40 "include/uapi/linux/bpf.h"
|
|
enum {
|
|
BPF_REG_0 = 0,
|
|
BPF_REG_1,
|
|
BPF_REG_2,
|
|
BPF_REG_3,
|
|
BPF_REG_4,
|
|
BPF_REG_5,
|
|
BPF_REG_6,
|
|
BPF_REG_7,
|
|
BPF_REG_8,
|
|
BPF_REG_9,
|
|
BPF_REG_10,
|
|
__MAX_BPF_REG,
|
|
};
|
|
|
|
|
|
|
|
|
|
struct bpf_insn {
|
|
__u8 code;
|
|
__u8 dst_reg:4;
|
|
__u8 src_reg:4;
|
|
__s16 off;
|
|
__s32 imm;
|
|
};
|
|
|
|
|
|
enum bpf_cmd {
|
|
BPF_MAP_CREATE,
|
|
BPF_MAP_LOOKUP_ELEM,
|
|
BPF_MAP_UPDATE_ELEM,
|
|
BPF_MAP_DELETE_ELEM,
|
|
BPF_MAP_GET_NEXT_KEY,
|
|
BPF_PROG_LOAD,
|
|
BPF_OBJ_PIN,
|
|
BPF_OBJ_GET,
|
|
};
|
|
|
|
enum bpf_map_type {
|
|
BPF_MAP_TYPE_UNSPEC,
|
|
BPF_MAP_TYPE_HASH,
|
|
BPF_MAP_TYPE_ARRAY,
|
|
BPF_MAP_TYPE_PROG_ARRAY,
|
|
BPF_MAP_TYPE_PERF_EVENT_ARRAY,
|
|
};
|
|
|
|
enum bpf_prog_type {
|
|
BPF_PROG_TYPE_UNSPEC,
|
|
BPF_PROG_TYPE_SOCKET_FILTER,
|
|
BPF_PROG_TYPE_KPROBE,
|
|
BPF_PROG_TYPE_SCHED_CLS,
|
|
BPF_PROG_TYPE_SCHED_ACT,
|
|
};
|
|
# 101 "include/uapi/linux/bpf.h"
|
|
union bpf_attr {
|
|
struct {
|
|
__u32 map_type;
|
|
__u32 key_size;
|
|
__u32 value_size;
|
|
__u32 max_entries;
|
|
};
|
|
|
|
struct {
|
|
__u32 map_fd;
|
|
__u64 __attribute__((aligned(8))) key;
|
|
union {
|
|
__u64 __attribute__((aligned(8))) value;
|
|
__u64 __attribute__((aligned(8))) next_key;
|
|
};
|
|
__u64 flags;
|
|
};
|
|
|
|
struct {
|
|
__u32 prog_type;
|
|
__u32 insn_cnt;
|
|
__u64 __attribute__((aligned(8))) insns;
|
|
__u64 __attribute__((aligned(8))) license;
|
|
__u32 log_level;
|
|
__u32 log_size;
|
|
__u64 __attribute__((aligned(8))) log_buf;
|
|
__u32 kern_version;
|
|
};
|
|
|
|
struct {
|
|
__u64 __attribute__((aligned(8))) pathname;
|
|
__u32 bpf_fd;
|
|
};
|
|
} __attribute__((aligned(8)));
|
|
|
|
|
|
|
|
|
|
enum bpf_func_id {
|
|
BPF_FUNC_unspec,
|
|
BPF_FUNC_map_lookup_elem,
|
|
BPF_FUNC_map_update_elem,
|
|
BPF_FUNC_map_delete_elem,
|
|
BPF_FUNC_probe_read,
|
|
BPF_FUNC_ktime_get_ns,
|
|
BPF_FUNC_trace_printk,
|
|
BPF_FUNC_get_prandom_u32,
|
|
BPF_FUNC_get_smp_processor_id,
|
|
# 160 "include/uapi/linux/bpf.h"
|
|
BPF_FUNC_skb_store_bytes,
|
|
# 172 "include/uapi/linux/bpf.h"
|
|
BPF_FUNC_l3_csum_replace,
|
|
# 185 "include/uapi/linux/bpf.h"
|
|
BPF_FUNC_l4_csum_replace,
|
|
# 194 "include/uapi/linux/bpf.h"
|
|
BPF_FUNC_tail_call,
|
|
# 204 "include/uapi/linux/bpf.h"
|
|
BPF_FUNC_clone_redirect,
|
|
|
|
|
|
|
|
|
|
|
|
BPF_FUNC_get_current_pid_tgid,
|
|
|
|
|
|
|
|
|
|
|
|
BPF_FUNC_get_current_uid_gid,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BPF_FUNC_get_current_comm,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BPF_FUNC_get_cgroup_classid,
|
|
BPF_FUNC_skb_vlan_push,
|
|
BPF_FUNC_skb_vlan_pop,
|
|
# 243 "include/uapi/linux/bpf.h"
|
|
BPF_FUNC_skb_get_tunnel_key,
|
|
BPF_FUNC_skb_set_tunnel_key,
|
|
BPF_FUNC_perf_event_read,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BPF_FUNC_redirect,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BPF_FUNC_get_route_realm,
|
|
# 271 "include/uapi/linux/bpf.h"
|
|
BPF_FUNC_perf_event_output,
|
|
__BPF_FUNC_MAX_ID,
|
|
};
|
|
|
|
|
|
|
|
|
|
struct __sk_buff {
|
|
__u32 len;
|
|
__u32 pkt_type;
|
|
__u32 mark;
|
|
__u32 queue_mapping;
|
|
__u32 protocol;
|
|
__u32 vlan_present;
|
|
__u32 vlan_tci;
|
|
__u32 vlan_proto;
|
|
__u32 priority;
|
|
__u32 ingress_ifindex;
|
|
__u32 ifindex;
|
|
__u32 tc_index;
|
|
__u32 cb[5];
|
|
__u32 hash;
|
|
__u32 tc_classid;
|
|
};
|
|
|
|
struct bpf_tunnel_key {
|
|
__u32 tunnel_id;
|
|
__u32 remote_ipv4;
|
|
};
|
|
# 22 "include/linux/filter.h" 2
|
|
|
|
struct sk_buff;
|
|
struct sock;
|
|
struct seccomp_data;
|
|
struct bpf_prog_aux;
|
|
# 314 "include/linux/filter.h"
|
|
struct sock_fprog_kern {
|
|
u16 len;
|
|
struct sock_filter *filter;
|
|
};
|
|
|
|
struct bpf_binary_header {
|
|
unsigned int pages;
|
|
u8 image[];
|
|
};
|
|
|
|
struct bpf_prog {
|
|
u16 pages;
|
|
;
|
|
u16 jited:1,
|
|
gpl_compatible:1,
|
|
cb_access:1,
|
|
dst_needed:1;
|
|
;
|
|
u32 len;
|
|
enum bpf_prog_type type;
|
|
struct bpf_prog_aux *aux;
|
|
struct sock_fprog_kern *orig_prog;
|
|
unsigned int (*bpf_func)(const struct sk_buff *skb,
|
|
const struct bpf_insn *filter);
|
|
|
|
union {
|
|
struct sock_filter insns[0];
|
|
struct bpf_insn insnsi[0];
|
|
};
|
|
};
|
|
|
|
struct sk_filter {
|
|
atomic_t refcnt;
|
|
struct callback_head rcu;
|
|
struct bpf_prog *prog;
|
|
};
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 bpf_prog_run_save_cb(const struct bpf_prog *prog,
|
|
struct sk_buff *skb)
|
|
{
|
|
u8 *cb_data = qdisc_skb_cb(skb)->data;
|
|
u8 saved_cb[20];
|
|
u32 res;
|
|
|
|
((void)sizeof(char[1 - 2*!!((sizeof(((struct __sk_buff*)0)->cb)) != 20)]))
|
|
;
|
|
|
|
if (__builtin_expect(!!(prog->cb_access), 0)) {
|
|
memcpy(saved_cb, cb_data, sizeof(saved_cb));
|
|
({ void *__p = (cb_data); size_t __n = sizeof(saved_cb); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); });
|
|
}
|
|
|
|
res = (*prog->bpf_func)(skb, prog->insnsi);
|
|
|
|
if (__builtin_expect(!!(prog->cb_access), 0))
|
|
memcpy(cb_data, saved_cb, sizeof(saved_cb));
|
|
|
|
return res;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 bpf_prog_run_clear_cb(const struct bpf_prog *prog,
|
|
struct sk_buff *skb)
|
|
{
|
|
u8 *cb_data = qdisc_skb_cb(skb)->data;
|
|
|
|
if (__builtin_expect(!!(prog->cb_access), 0))
|
|
({ void *__p = (cb_data); size_t __n = 20; if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); });
|
|
return (*prog->bpf_func)(skb, prog->insnsi);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int bpf_prog_size(unsigned int proglen)
|
|
{
|
|
return ({ typeof(sizeof(struct bpf_prog)) _max1 = (sizeof(struct bpf_prog)); typeof(__builtin_offsetof(struct bpf_prog, insns[proglen])) _max2 = (__builtin_offsetof(struct bpf_prog, insns[proglen])); (void) (&_max1 == &_max2); _max1 > _max2 ? _max1 : _max2; })
|
|
;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool bpf_prog_was_classic(const struct bpf_prog *prog)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
return prog->type == BPF_PROG_TYPE_UNSPEC;
|
|
}
|
|
# 415 "include/linux/filter.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bpf_prog_lock_ro(struct bpf_prog *fp)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bpf_prog_unlock_ro(struct bpf_prog *fp)
|
|
{
|
|
}
|
|
|
|
|
|
int sk_filter_trim_cap(struct sock *sk, struct sk_buff *skb, unsigned int cap);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sk_filter(struct sock *sk, struct sk_buff *skb)
|
|
{
|
|
return sk_filter_trim_cap(sk, skb, 1);
|
|
}
|
|
|
|
int bpf_prog_select_runtime(struct bpf_prog *fp);
|
|
void bpf_prog_free(struct bpf_prog *fp);
|
|
|
|
struct bpf_prog *bpf_prog_alloc(unsigned int size, gfp_t gfp_extra_flags);
|
|
struct bpf_prog *bpf_prog_realloc(struct bpf_prog *fp_old, unsigned int size,
|
|
gfp_t gfp_extra_flags);
|
|
void __bpf_prog_free(struct bpf_prog *fp);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bpf_prog_unlock_free(struct bpf_prog *fp)
|
|
{
|
|
bpf_prog_unlock_ro(fp);
|
|
__bpf_prog_free(fp);
|
|
}
|
|
|
|
typedef int (*bpf_aux_classic_check_t)(struct sock_filter *filter,
|
|
unsigned int flen);
|
|
|
|
int bpf_prog_create(struct bpf_prog **pfp, struct sock_fprog_kern *fprog);
|
|
int bpf_prog_create_from_user(struct bpf_prog **pfp, struct sock_fprog *fprog,
|
|
bpf_aux_classic_check_t trans, bool save_orig);
|
|
void bpf_prog_destroy(struct bpf_prog *fp);
|
|
|
|
int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
|
|
int __sk_attach_filter(struct sock_fprog *fprog, struct sock *sk,
|
|
bool locked);
|
|
int sk_attach_bpf(u32 ufd, struct sock *sk);
|
|
int sk_detach_filter(struct sock *sk);
|
|
int __sk_detach_filter(struct sock *sk, bool locked);
|
|
|
|
int sk_get_filter(struct sock *sk, struct sock_filter *filter,
|
|
unsigned int len);
|
|
|
|
bool sk_filter_charge(struct sock *sk, struct sk_filter *fp);
|
|
void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp);
|
|
|
|
u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5);
|
|
void bpf_int_jit_compile(struct bpf_prog *fp);
|
|
bool bpf_helper_changes_skb_data(void *func);
|
|
|
|
struct bpf_prog *bpf_patch_insn_single(struct bpf_prog *prog, u32 off,
|
|
const struct bpf_insn *patch, u32 len);
|
|
# 495 "include/linux/filter.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bpf_jit_compile(struct bpf_prog *fp)
|
|
{
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void bpf_jit_free(struct bpf_prog *fp)
|
|
{
|
|
bpf_prog_unlock_free(fp);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool bpf_needs_clear_a(const struct sock_filter *first)
|
|
{
|
|
switch (first->code) {
|
|
case 0x06 | 0x00:
|
|
case 0x00 | 0x00 | 0x80:
|
|
return false;
|
|
|
|
case 0x00 | 0x00 | 0x20:
|
|
case 0x00 | 0x08 | 0x20:
|
|
case 0x00 | 0x10 | 0x20:
|
|
if (first->k == (-0x1000) + 40)
|
|
return true;
|
|
return false;
|
|
|
|
default:
|
|
return true;
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u16 bpf_anc_helper(const struct sock_filter *ftest)
|
|
{
|
|
do { if (__builtin_expect(!!(ftest->code & (1UL << (15))), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/filter.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "528" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
|
|
switch (ftest->code) {
|
|
case 0x00 | 0x00 | 0x20:
|
|
case 0x00 | 0x08 | 0x20:
|
|
case 0x00 | 0x10 | 0x20:
|
|
|
|
|
|
switch (ftest->k) {
|
|
case (-0x1000) + 0: return (1UL << (15)) | 0;
|
|
case (-0x1000) + 4: return (1UL << (15)) | 4;
|
|
case (-0x1000) + 8: return (1UL << (15)) | 8;
|
|
case (-0x1000) + 12: return (1UL << (15)) | 12;
|
|
case (-0x1000) + 16: return (1UL << (15)) | 16;
|
|
case (-0x1000) + 20: return (1UL << (15)) | 20;
|
|
case (-0x1000) + 24: return (1UL << (15)) | 24;
|
|
case (-0x1000) + 28: return (1UL << (15)) | 28;
|
|
case (-0x1000) + 32: return (1UL << (15)) | 32;
|
|
case (-0x1000) + 36: return (1UL << (15)) | 36;
|
|
case (-0x1000) + 40: return (1UL << (15)) | 40;
|
|
case (-0x1000) + 44: return (1UL << (15)) | 44;
|
|
case (-0x1000) + 48: return (1UL << (15)) | 48;
|
|
case (-0x1000) + 52: return (1UL << (15)) | 52;
|
|
case (-0x1000) + 56: return (1UL << (15)) | 56;
|
|
case (-0x1000) + 60: return (1UL << (15)) | 60;
|
|
}
|
|
|
|
default:
|
|
return ftest->code;
|
|
}
|
|
}
|
|
|
|
void *bpf_internal_load_pointer_neg_helper(const struct sk_buff *skb,
|
|
int k, unsigned int size);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *bpf_load_pointer(const struct sk_buff *skb, int k,
|
|
unsigned int size, void *buffer)
|
|
{
|
|
if (k >= 0)
|
|
return skb_header_pointer(skb, k, size, buffer);
|
|
|
|
return bpf_internal_load_pointer_neg_helper(skb, k, size);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int bpf_tell_extensions(void)
|
|
{
|
|
return 64;
|
|
}
|
|
# 63 "include/net/sock.h" 2
|
|
# 1 "include/linux/rculist_nulls.h" 1
|
|
# 32 "include/linux/rculist_nulls.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_nulls_del_init_rcu(struct hlist_nulls_node *n)
|
|
{
|
|
if (!hlist_nulls_unhashed(n)) {
|
|
__hlist_nulls_del(n);
|
|
n->pprev = ((void *)0);
|
|
}
|
|
}
|
|
# 65 "include/linux/rculist_nulls.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_nulls_del_rcu(struct hlist_nulls_node *n)
|
|
{
|
|
__hlist_nulls_del(n);
|
|
n->pprev = ((void *) 0x200 + 0);
|
|
}
|
|
# 90 "include/linux/rculist_nulls.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void hlist_nulls_add_head_rcu(struct hlist_nulls_node *n,
|
|
struct hlist_nulls_head *h)
|
|
{
|
|
struct hlist_nulls_node *first = h->first;
|
|
|
|
n->next = first;
|
|
n->pprev = &h->first;
|
|
do { do { bool __cond = !((sizeof(*&(*((struct hlist_nulls_node **)&(h)->first))) == sizeof(char) || sizeof(*&(*((struct hlist_nulls_node **)&(h)->first))) == sizeof(short) || sizeof(*&(*((struct hlist_nulls_node **)&(h)->first))) == sizeof(int) || sizeof(*&(*((struct hlist_nulls_node **)&(h)->first))) == sizeof(long))); extern void __compiletime_assert_97(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_97(); do { } while (0); } while (0); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); ({ union { typeof(*&(*((struct hlist_nulls_node **)&(h)->first))) __val; char __c[1]; } __u = { .__val = ( typeof(*&(*((struct hlist_nulls_node **)&(h)->first)))) ((typeof(*(n)) *)(n)) }; __write_once_size(&(*&(*((struct hlist_nulls_node **)&(h)->first))), __u.__c, sizeof(*&(*((struct hlist_nulls_node **)&(h)->first)))); __u.__val; }); } while (0);
|
|
if (!is_a_nulls(first))
|
|
first->pprev = &n->next;
|
|
}
|
|
# 64 "include/net/sock.h" 2
|
|
# 1 "include/linux/poll.h" 1
|
|
# 12 "include/linux/poll.h"
|
|
# 1 "include/uapi/linux/poll.h" 1
|
|
# 1 "arch/arm/include/generated/asm/poll.h" 1
|
|
# 1 "./include/uapi/asm-generic/poll.h" 1
|
|
# 35 "./include/uapi/asm-generic/poll.h"
|
|
struct pollfd {
|
|
int fd;
|
|
short events;
|
|
short revents;
|
|
};
|
|
# 1 "arch/arm/include/generated/asm/poll.h" 2
|
|
# 1 "include/uapi/linux/poll.h" 2
|
|
# 13 "include/linux/poll.h" 2
|
|
|
|
extern struct ctl_table epoll_table[];
|
|
# 26 "include/linux/poll.h"
|
|
struct poll_table_struct;
|
|
|
|
|
|
|
|
|
|
typedef void (*poll_queue_proc)(struct file *, wait_queue_head_t *, struct poll_table_struct *);
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct poll_table_struct {
|
|
poll_queue_proc _qproc;
|
|
unsigned long _key;
|
|
} poll_table;
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p)
|
|
{
|
|
if (p && p->_qproc && wait_address)
|
|
p->_qproc(filp, wait_address, p);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool poll_does_not_wait(const poll_table *p)
|
|
{
|
|
return p == ((void *)0) || p->_qproc == ((void *)0);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long poll_requested_events(const poll_table *p)
|
|
{
|
|
return p ? p->_key : ~0UL;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc)
|
|
{
|
|
pt->_qproc = qproc;
|
|
pt->_key = ~0UL;
|
|
}
|
|
|
|
struct poll_table_entry {
|
|
struct file *filp;
|
|
unsigned long key;
|
|
wait_queue_t wait;
|
|
wait_queue_head_t *wait_address;
|
|
};
|
|
|
|
|
|
|
|
|
|
struct poll_wqueues {
|
|
poll_table pt;
|
|
struct poll_table_page *table;
|
|
struct task_struct *polling_task;
|
|
int triggered;
|
|
int error;
|
|
int inline_index;
|
|
struct poll_table_entry inline_entries[((832 - 256) / sizeof(struct poll_table_entry))];
|
|
};
|
|
|
|
extern void poll_initwait(struct poll_wqueues *pwq);
|
|
extern void poll_freewait(struct poll_wqueues *pwq);
|
|
extern int poll_schedule_timeout(struct poll_wqueues *pwq, int state,
|
|
ktime_t *expires, unsigned long slack);
|
|
extern long select_estimate_accuracy(struct timespec *tv);
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int poll_schedule(struct poll_wqueues *pwq, int state)
|
|
{
|
|
return poll_schedule_timeout(pwq, state, ((void *)0), 0);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
unsigned long *in, *out, *ex;
|
|
unsigned long *res_in, *res_out, *res_ex;
|
|
} fd_set_bits;
|
|
# 129 "include/linux/poll.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
int get_fd_set(unsigned long nr, void *ufdset, unsigned long *fdset)
|
|
{
|
|
nr = ((((nr)+(8*sizeof(long))-1)/(8*sizeof(long)))*sizeof(long));
|
|
if (ufdset)
|
|
return copy_from_user(fdset, ufdset, nr) ? -14 : 0;
|
|
|
|
({ void *__p = (fdset); size_t __n = nr; if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); });
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long __attribute__((warn_unused_result))
|
|
set_fd_set(unsigned long nr, void *ufdset, unsigned long *fdset)
|
|
{
|
|
if (ufdset)
|
|
return __copy_to_user(ufdset, fdset, ((((nr)+(8*sizeof(long))-1)/(8*sizeof(long)))*sizeof(long)));
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
void zero_fd_set(unsigned long nr, unsigned long *fdset)
|
|
{
|
|
({ void *__p = (fdset); size_t __n = ((((nr)+(8*sizeof(long))-1)/(8*sizeof(long)))*sizeof(long)); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); });
|
|
}
|
|
|
|
|
|
|
|
extern int do_select(int n, fd_set_bits *fds, struct timespec *end_time);
|
|
extern int do_sys_poll(struct pollfd * ufds, unsigned int nfds,
|
|
struct timespec *end_time);
|
|
extern int core_sys_select(int n, fd_set *inp, fd_set *outp,
|
|
fd_set *exp, struct timespec *end_time);
|
|
|
|
extern int poll_select_set_timeout(struct timespec *to, long sec, long nsec);
|
|
# 65 "include/net/sock.h" 2
|
|
|
|
|
|
# 1 "include/net/dst.h" 1
|
|
# 17 "include/net/dst.h"
|
|
# 1 "include/net/neighbour.h" 1
|
|
# 39 "include/net/neighbour.h"
|
|
struct neighbour;
|
|
|
|
enum {
|
|
NEIGH_VAR_MCAST_PROBES,
|
|
NEIGH_VAR_UCAST_PROBES,
|
|
NEIGH_VAR_APP_PROBES,
|
|
NEIGH_VAR_MCAST_REPROBES,
|
|
NEIGH_VAR_RETRANS_TIME,
|
|
NEIGH_VAR_BASE_REACHABLE_TIME,
|
|
NEIGH_VAR_DELAY_PROBE_TIME,
|
|
NEIGH_VAR_GC_STALETIME,
|
|
NEIGH_VAR_QUEUE_LEN_BYTES,
|
|
NEIGH_VAR_PROXY_QLEN,
|
|
NEIGH_VAR_ANYCAST_DELAY,
|
|
NEIGH_VAR_PROXY_DELAY,
|
|
NEIGH_VAR_LOCKTIME,
|
|
|
|
|
|
NEIGH_VAR_QUEUE_LEN,
|
|
NEIGH_VAR_RETRANS_TIME_MS,
|
|
NEIGH_VAR_BASE_REACHABLE_TIME_MS,
|
|
|
|
NEIGH_VAR_DEFAULT_ROUTE,
|
|
|
|
|
|
NEIGH_VAR_GC_INTERVAL,
|
|
NEIGH_VAR_GC_THRESH1,
|
|
NEIGH_VAR_GC_THRESH2,
|
|
NEIGH_VAR_GC_THRESH3,
|
|
NEIGH_VAR_MAX
|
|
};
|
|
|
|
struct neigh_parms {
|
|
possible_net_t net;
|
|
struct net_device *dev;
|
|
struct list_head list;
|
|
int (*neigh_setup)(struct neighbour *);
|
|
void (*neigh_cleanup)(struct neighbour *);
|
|
struct neigh_table *tbl;
|
|
|
|
void *sysctl_table;
|
|
|
|
int dead;
|
|
atomic_t refcnt;
|
|
struct callback_head callback_head;
|
|
|
|
int reachable_time;
|
|
int data[(NEIGH_VAR_LOCKTIME + 1)];
|
|
|
|
char dlf_route[64];
|
|
|
|
unsigned long data_state[((((NEIGH_VAR_LOCKTIME + 1)) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))];
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void neigh_var_set(struct neigh_parms *p, int index, int val)
|
|
{
|
|
_set_bit(index,p->data_state);
|
|
p->data[index] = val;
|
|
}
|
|
# 107 "include/net/neighbour.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void neigh_parms_data_state_setall(struct neigh_parms *p)
|
|
{
|
|
bitmap_fill(p->data_state, (NEIGH_VAR_LOCKTIME + 1));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void neigh_parms_data_state_cleanall(struct neigh_parms *p)
|
|
{
|
|
bitmap_zero(p->data_state, (NEIGH_VAR_LOCKTIME + 1));
|
|
}
|
|
|
|
struct neigh_statistics {
|
|
unsigned long allocs;
|
|
unsigned long destroys;
|
|
unsigned long hash_grows;
|
|
|
|
unsigned long res_failed;
|
|
|
|
unsigned long lookups;
|
|
unsigned long hits;
|
|
|
|
unsigned long rcv_probes_mcast;
|
|
unsigned long rcv_probes_ucast;
|
|
|
|
unsigned long periodic_gc_runs;
|
|
unsigned long forced_gc_runs;
|
|
|
|
unsigned long unres_discards;
|
|
unsigned long table_fulls;
|
|
};
|
|
|
|
|
|
|
|
struct neighbour {
|
|
struct neighbour *next;
|
|
struct neigh_table *tbl;
|
|
struct neigh_parms *parms;
|
|
unsigned long confirmed;
|
|
unsigned long updated;
|
|
rwlock_t lock;
|
|
atomic_t refcnt;
|
|
struct sk_buff_head arp_queue;
|
|
unsigned int arp_queue_len_bytes;
|
|
struct timer_list timer;
|
|
unsigned long used;
|
|
atomic_t probes;
|
|
__u8 flags;
|
|
__u8 nud_state;
|
|
__u8 type;
|
|
__u8 dead;
|
|
seqlock_t ha_lock;
|
|
unsigned char ha[((((32)) + ((typeof((32)))((sizeof(unsigned long))) - 1)) & ~((typeof((32)))((sizeof(unsigned long))) - 1))];
|
|
struct hh_cache hh;
|
|
int (*output)(struct neighbour *, struct sk_buff *);
|
|
const struct neigh_ops *ops;
|
|
struct callback_head rcu;
|
|
struct net_device *dev;
|
|
u8 primary_key[0];
|
|
};
|
|
|
|
struct neigh_ops {
|
|
int family;
|
|
void (*solicit)(struct neighbour *, struct sk_buff *);
|
|
void (*error_report)(struct neighbour *, struct sk_buff *);
|
|
int (*output)(struct neighbour *, struct sk_buff *);
|
|
int (*connected_output)(struct neighbour *, struct sk_buff *);
|
|
};
|
|
|
|
struct pneigh_entry {
|
|
struct pneigh_entry *next;
|
|
possible_net_t net;
|
|
struct net_device *dev;
|
|
u8 flags;
|
|
u8 key[0];
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct neigh_hash_table {
|
|
struct neighbour **hash_buckets;
|
|
unsigned int hash_shift;
|
|
__u32 hash_rnd[4];
|
|
struct callback_head rcu;
|
|
};
|
|
|
|
|
|
struct neigh_table {
|
|
int family;
|
|
int entry_size;
|
|
int key_len;
|
|
__be16 protocol;
|
|
__u32 (*hash)(const void *pkey,
|
|
const struct net_device *dev,
|
|
__u32 *hash_rnd);
|
|
bool (*key_eq)(const struct neighbour *, const void *pkey);
|
|
int (*constructor)(struct neighbour *);
|
|
int (*pconstructor)(struct pneigh_entry *);
|
|
void (*pdestructor)(struct pneigh_entry *);
|
|
void (*proxy_redo)(struct sk_buff *skb);
|
|
char *id;
|
|
struct neigh_parms parms;
|
|
struct list_head parms_list;
|
|
int gc_interval;
|
|
int gc_thresh1;
|
|
int gc_thresh2;
|
|
int gc_thresh3;
|
|
unsigned long last_flush;
|
|
struct delayed_work gc_work;
|
|
struct timer_list proxy_timer;
|
|
struct sk_buff_head proxy_queue;
|
|
atomic_t entries;
|
|
rwlock_t lock;
|
|
unsigned long last_rand;
|
|
struct neigh_statistics *stats;
|
|
struct neigh_hash_table *nht;
|
|
struct pneigh_entry **phash_buckets;
|
|
};
|
|
|
|
enum {
|
|
NEIGH_ARP_TABLE = 0,
|
|
NEIGH_ND_TABLE = 1,
|
|
NEIGH_DN_TABLE = 2,
|
|
NEIGH_NR_TABLES,
|
|
NEIGH_LINK_TABLE = NEIGH_NR_TABLES
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int neigh_parms_family(struct neigh_parms *p)
|
|
{
|
|
return p->tbl->family;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *neighbour_priv(const struct neighbour *n)
|
|
{
|
|
return (char *)n + n->tbl->entry_size;
|
|
}
|
|
# 257 "include/net/neighbour.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool neigh_key_eq16(const struct neighbour *n, const void *pkey)
|
|
{
|
|
return *(const u16 *)n->primary_key == *(const u16 *)pkey;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool neigh_key_eq32(const struct neighbour *n, const void *pkey)
|
|
{
|
|
return *(const u32 *)n->primary_key == *(const u32 *)pkey;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool neigh_key_eq128(const struct neighbour *n, const void *pkey)
|
|
{
|
|
const u32 *n32 = (const u32 *)n->primary_key;
|
|
const u32 *p32 = pkey;
|
|
|
|
return ((n32[0] ^ p32[0]) | (n32[1] ^ p32[1]) |
|
|
(n32[2] ^ p32[2]) | (n32[3] ^ p32[3])) == 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct neighbour *___neigh_lookup_noref(
|
|
struct neigh_table *tbl,
|
|
bool (*key_eq)(const struct neighbour *n, const void *pkey),
|
|
__u32 (*hash)(const void *pkey,
|
|
const struct net_device *dev,
|
|
__u32 *hash_rnd),
|
|
const void *pkey,
|
|
struct net_device *dev)
|
|
{
|
|
struct neigh_hash_table *nht = ({ typeof(*(tbl->nht)) *________p1 = (typeof(*(tbl->nht)) *)({ typeof((tbl->nht)) _________p1 = ({ union { typeof((tbl->nht)) __val; char __c[1]; } __u; if (1) __read_once_size(&((tbl->nht)), __u.__c, sizeof((tbl->nht))); else __read_once_size_nocheck(&((tbl->nht)), __u.__c, sizeof((tbl->nht))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(tbl->nht)) *)(________p1)); });
|
|
struct neighbour *n;
|
|
u32 hash_val;
|
|
|
|
hash_val = hash(pkey, dev, nht->hash_rnd) >> (32 - nht->hash_shift);
|
|
for (n = ({ typeof(*(nht->hash_buckets[hash_val])) *________p1 = (typeof(*(nht->hash_buckets[hash_val])) *)({ typeof((nht->hash_buckets[hash_val])) _________p1 = ({ union { typeof((nht->hash_buckets[hash_val])) __val; char __c[1]; } __u; if (1) __read_once_size(&((nht->hash_buckets[hash_val])), __u.__c, sizeof((nht->hash_buckets[hash_val]))); else __read_once_size_nocheck(&((nht->hash_buckets[hash_val])), __u.__c, sizeof((nht->hash_buckets[hash_val]))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(nht->hash_buckets[hash_val])) *)(________p1)); });
|
|
n != ((void *)0);
|
|
n = ({ typeof(*(n->next)) *________p1 = (typeof(*(n->next)) *)({ typeof((n->next)) _________p1 = ({ union { typeof((n->next)) __val; char __c[1]; } __u; if (1) __read_once_size(&((n->next)), __u.__c, sizeof((n->next))); else __read_once_size_nocheck(&((n->next)), __u.__c, sizeof((n->next))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(n->next)) *)(________p1)); })) {
|
|
if (n->dev == dev && key_eq(n, pkey))
|
|
return n;
|
|
}
|
|
|
|
return ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct neighbour *__neigh_lookup_noref(struct neigh_table *tbl,
|
|
const void *pkey,
|
|
struct net_device *dev)
|
|
{
|
|
return ___neigh_lookup_noref(tbl, tbl->key_eq, tbl->hash, pkey, dev);
|
|
}
|
|
|
|
void neigh_table_init(int index, struct neigh_table *tbl);
|
|
int neigh_table_clear(int index, struct neigh_table *tbl);
|
|
struct neighbour *neigh_lookup(struct neigh_table *tbl, const void *pkey,
|
|
struct net_device *dev);
|
|
struct neighbour *neigh_lookup_nodev(struct neigh_table *tbl, struct net *net,
|
|
const void *pkey);
|
|
struct neighbour *__neigh_create(struct neigh_table *tbl, const void *pkey,
|
|
struct net_device *dev, bool want_ref);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct neighbour *neigh_create(struct neigh_table *tbl,
|
|
const void *pkey,
|
|
struct net_device *dev)
|
|
{
|
|
return __neigh_create(tbl, pkey, dev, true);
|
|
}
|
|
void neigh_destroy(struct neighbour *neigh);
|
|
int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb);
|
|
int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, u32 flags);
|
|
void __neigh_set_probe_once(struct neighbour *neigh);
|
|
void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev);
|
|
int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev);
|
|
int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb);
|
|
int neigh_connected_output(struct neighbour *neigh, struct sk_buff *skb);
|
|
int neigh_direct_output(struct neighbour *neigh, struct sk_buff *skb);
|
|
struct neighbour *neigh_event_ns(struct neigh_table *tbl,
|
|
u8 *lladdr, void *saddr,
|
|
struct net_device *dev);
|
|
|
|
struct neigh_parms *neigh_parms_alloc(struct net_device *dev,
|
|
struct neigh_table *tbl);
|
|
void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
struct net *neigh_parms_net(const struct neigh_parms *parms)
|
|
{
|
|
return read_pnet(&parms->net);
|
|
}
|
|
|
|
unsigned long neigh_rand_reach_time(unsigned long base);
|
|
|
|
void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p,
|
|
struct sk_buff *skb);
|
|
struct pneigh_entry *pneigh_lookup(struct neigh_table *tbl, struct net *net,
|
|
const void *key, struct net_device *dev,
|
|
int creat);
|
|
struct pneigh_entry *__pneigh_lookup(struct neigh_table *tbl, struct net *net,
|
|
const void *key, struct net_device *dev);
|
|
int pneigh_delete(struct neigh_table *tbl, struct net *net, const void *key,
|
|
struct net_device *dev);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct net *pneigh_net(const struct pneigh_entry *pneigh)
|
|
{
|
|
return read_pnet(&pneigh->net);
|
|
}
|
|
|
|
void neigh_app_ns(struct neighbour *n);
|
|
void neigh_for_each(struct neigh_table *tbl,
|
|
void (*cb)(struct neighbour *, void *), void *cookie);
|
|
void __neigh_for_each_release(struct neigh_table *tbl,
|
|
int (*cb)(struct neighbour *));
|
|
int neigh_xmit(int fam, struct net_device *, const void *, struct sk_buff *);
|
|
void pneigh_for_each(struct neigh_table *tbl,
|
|
void (*cb)(struct pneigh_entry *));
|
|
|
|
struct neigh_seq_state {
|
|
struct seq_net_private p;
|
|
struct neigh_table *tbl;
|
|
struct neigh_hash_table *nht;
|
|
void *(*neigh_sub_iter)(struct neigh_seq_state *state,
|
|
struct neighbour *n, loff_t *pos);
|
|
unsigned int bucket;
|
|
unsigned int flags;
|
|
|
|
|
|
|
|
};
|
|
void *neigh_seq_start(struct seq_file *, loff_t *, struct neigh_table *,
|
|
unsigned int);
|
|
void *neigh_seq_next(struct seq_file *, void *, loff_t *);
|
|
void neigh_seq_stop(struct seq_file *, void *);
|
|
|
|
int neigh_proc_dointvec(struct ctl_table *ctl, int write,
|
|
void *buffer, size_t *lenp, loff_t *ppos);
|
|
int neigh_proc_dointvec_jiffies(struct ctl_table *ctl, int write,
|
|
void *buffer,
|
|
size_t *lenp, loff_t *ppos);
|
|
int neigh_proc_dointvec_ms_jiffies(struct ctl_table *ctl, int write,
|
|
void *buffer,
|
|
size_t *lenp, loff_t *ppos);
|
|
|
|
int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
|
|
proc_handler *proc_handler);
|
|
void neigh_sysctl_unregister(struct neigh_parms *p);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __neigh_parms_put(struct neigh_parms *parms)
|
|
{
|
|
atomic_sub(1, &parms->refcnt);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct neigh_parms *neigh_parms_clone(struct neigh_parms *parms)
|
|
{
|
|
atomic_add(1, &parms->refcnt);
|
|
return parms;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void neigh_release(struct neighbour *neigh)
|
|
{
|
|
if ((({ typeof(atomic_sub_return_relaxed(1, &neigh->refcnt)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_sub_return_relaxed(1, &neigh->refcnt); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) == 0))
|
|
neigh_destroy(neigh);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct neighbour * neigh_clone(struct neighbour *neigh)
|
|
{
|
|
if (neigh)
|
|
atomic_add(1, &neigh->refcnt);
|
|
return neigh;
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
|
|
{
|
|
unsigned long now = jiffies;
|
|
|
|
if (neigh->used != now)
|
|
neigh->used = now;
|
|
if (!(neigh->nud_state&((0x80|0x40|0x02)|0x08|0x10)))
|
|
return __neigh_event_send(neigh, skb);
|
|
return 0;
|
|
}
|
|
# 455 "include/net/neighbour.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int neigh_hh_output(const struct hh_cache *hh, struct sk_buff *skb)
|
|
{
|
|
unsigned int seq;
|
|
int hh_len;
|
|
|
|
do {
|
|
seq = read_seqbegin(&hh->hh_lock);
|
|
hh_len = hh->hh_len;
|
|
if (__builtin_expect(!!(hh_len <= 16), 1)) {
|
|
|
|
memcpy(skb->data - 16, hh->hh_data, 16);
|
|
} else {
|
|
int hh_alen = (((hh_len)+(16 -1))&~(16 - 1));
|
|
|
|
memcpy(skb->data - hh_alen, hh->hh_data, hh_alen);
|
|
}
|
|
} while (read_seqretry(&hh->hh_lock, seq));
|
|
|
|
skb_push(skb, hh_len);
|
|
return dev_queue_xmit(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct neighbour *
|
|
__neigh_lookup(struct neigh_table *tbl, const void *pkey, struct net_device *dev, int creat)
|
|
{
|
|
struct neighbour *n = neigh_lookup(tbl, pkey, dev);
|
|
|
|
if (n || !creat)
|
|
return n;
|
|
|
|
n = neigh_create(tbl, pkey, dev);
|
|
return IS_ERR(n) ? ((void *)0) : n;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct neighbour *
|
|
__neigh_lookup_errno(struct neigh_table *tbl, const void *pkey,
|
|
struct net_device *dev)
|
|
{
|
|
struct neighbour *n = neigh_lookup(tbl, pkey, dev);
|
|
|
|
if (n)
|
|
return n;
|
|
|
|
return neigh_create(tbl, pkey, dev);
|
|
}
|
|
|
|
struct neighbour_cb {
|
|
unsigned long sched_next;
|
|
unsigned int flags;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void neigh_ha_snapshot(char *dst, const struct neighbour *n,
|
|
const struct net_device *dev)
|
|
{
|
|
unsigned int seq;
|
|
|
|
do {
|
|
seq = read_seqbegin(&n->ha_lock);
|
|
memcpy(dst, n->ha, dev->addr_len);
|
|
} while (read_seqretry(&n->ha_lock, seq));
|
|
}
|
|
# 18 "include/net/dst.h" 2
|
|
# 31 "include/net/dst.h"
|
|
struct sk_buff;
|
|
|
|
struct dst_entry {
|
|
struct callback_head callback_head;
|
|
struct dst_entry *child;
|
|
struct net_device *dev;
|
|
struct dst_ops *ops;
|
|
unsigned long _metrics;
|
|
unsigned long expires;
|
|
struct dst_entry *path;
|
|
struct dst_entry *from;
|
|
|
|
struct xfrm_state *xfrm;
|
|
|
|
|
|
|
|
int (*input)(struct sk_buff *);
|
|
int (*output)(struct net *net, struct sock *sk, struct sk_buff *skb);
|
|
|
|
unsigned short flags;
|
|
# 62 "include/net/dst.h"
|
|
unsigned short pending_confirm;
|
|
|
|
short error;
|
|
# 74 "include/net/dst.h"
|
|
short obsolete;
|
|
|
|
|
|
|
|
|
|
unsigned short header_len;
|
|
unsigned short trailer_len;
|
|
|
|
|
|
|
|
__u32 __pad2;
|
|
# 99 "include/net/dst.h"
|
|
atomic_t __refcnt;
|
|
int __use;
|
|
unsigned long lastuse;
|
|
|
|
struct lwtunnel_state *lwtstate;
|
|
|
|
union {
|
|
struct dst_entry *next;
|
|
struct rtable *rt_next;
|
|
struct rt6_info *rt6_next;
|
|
struct dn_route *dn_next;
|
|
};
|
|
};
|
|
|
|
struct dst_metrics {
|
|
u32 metrics[(__RTAX_MAX - 1)];
|
|
atomic_t refcnt;
|
|
};
|
|
extern const struct dst_metrics dst_default_metrics;
|
|
|
|
u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old);
|
|
# 128 "include/net/dst.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dst_metrics_read_only(const struct dst_entry *dst)
|
|
{
|
|
return dst->_metrics & 0x1UL;
|
|
}
|
|
|
|
void __dst_destroy_metrics_generic(struct dst_entry *dst, unsigned long old);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dst_destroy_metrics_generic(struct dst_entry *dst)
|
|
{
|
|
unsigned long val = dst->_metrics;
|
|
if (!(val & 0x1UL))
|
|
__dst_destroy_metrics_generic(dst, val);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 *dst_metrics_write_ptr(struct dst_entry *dst)
|
|
{
|
|
unsigned long p = dst->_metrics;
|
|
|
|
do { if (__builtin_expect(!!(!p), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/net/dst.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "146" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
|
|
if (p & 0x1UL)
|
|
return dst->ops->cow_metrics(dst, p);
|
|
return ((u32 *)((p) & ~0x3UL));
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dst_init_metrics(struct dst_entry *dst,
|
|
const u32 *src_metrics,
|
|
bool read_only)
|
|
{
|
|
dst->_metrics = ((unsigned long) src_metrics) |
|
|
(read_only ? 0x1UL : 0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dst_copy_metrics(struct dst_entry *dest, const struct dst_entry *src)
|
|
{
|
|
u32 *dst_metrics = dst_metrics_write_ptr(dest);
|
|
|
|
if (dst_metrics) {
|
|
u32 *src_metrics = ((u32 *)(((src)->_metrics) & ~0x3UL));
|
|
|
|
memcpy(dst_metrics, src_metrics, (__RTAX_MAX - 1) * sizeof(u32));
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 *dst_metrics_ptr(struct dst_entry *dst)
|
|
{
|
|
return ((u32 *)(((dst)->_metrics) & ~0x3UL));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32
|
|
dst_metric_raw(const struct dst_entry *dst, const int metric)
|
|
{
|
|
u32 *p = ((u32 *)(((dst)->_metrics) & ~0x3UL));
|
|
|
|
return p[metric-1];
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32
|
|
dst_metric(const struct dst_entry *dst, const int metric)
|
|
{
|
|
({ static bool __attribute__ ((__section__(".data.unlikely"))) __warned; int __ret_warn_once = !!(metric == RTAX_HOPLIMIT || metric == RTAX_ADVMSS || metric == RTAX_MTU); if (__builtin_expect(!!(__ret_warn_once), 0)) if (({ int __ret_warn_on = !!(!__warned); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null(
|
|
|
|
"include/net/dst.h"
|
|
# 191 "include/net/dst.h"
|
|
,
|
|
|
|
193
|
|
# 191 "include/net/dst.h"
|
|
); __builtin_expect(!!(__ret_warn_on), 0); })) __warned = true; __builtin_expect(!!(__ret_warn_once), 0); })
|
|
|
|
;
|
|
return dst_metric_raw(dst, metric);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32
|
|
dst_metric_advmss(const struct dst_entry *dst)
|
|
{
|
|
u32 advmss = dst_metric_raw(dst, RTAX_ADVMSS);
|
|
|
|
if (!advmss)
|
|
advmss = dst->ops->default_advmss(dst);
|
|
|
|
return advmss;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dst_metric_set(struct dst_entry *dst, int metric, u32 val)
|
|
{
|
|
u32 *p = dst_metrics_write_ptr(dst);
|
|
|
|
if (p)
|
|
p[metric-1] = val;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32
|
|
dst_feature(const struct dst_entry *dst, u32 feature)
|
|
{
|
|
return dst_metric(dst, RTAX_FEATURES) & feature;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 dst_mtu(const struct dst_entry *dst)
|
|
{
|
|
return dst->ops->mtu(dst);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long dst_metric_rtt(const struct dst_entry *dst, int metric)
|
|
{
|
|
return msecs_to_jiffies(dst_metric(dst, metric));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32
|
|
dst_allfrag(const struct dst_entry *dst)
|
|
{
|
|
int ret = dst_feature(dst, (1 << 3));
|
|
return ret;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
dst_metric_locked(const struct dst_entry *dst, int metric)
|
|
{
|
|
return dst_metric(dst, RTAX_LOCK) & (1<<metric);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dst_hold(struct dst_entry *dst)
|
|
{
|
|
|
|
|
|
|
|
|
|
((void)sizeof(char[1 - 2*!!(__builtin_offsetof(struct dst_entry, __refcnt) & 63)]));
|
|
atomic_add(1, &dst->__refcnt);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dst_use(struct dst_entry *dst, unsigned long time)
|
|
{
|
|
dst_hold(dst);
|
|
dst->__use++;
|
|
dst->lastuse = time;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dst_use_noref(struct dst_entry *dst, unsigned long time)
|
|
{
|
|
dst->__use++;
|
|
dst->lastuse = time;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dst_entry *dst_clone(struct dst_entry *dst)
|
|
{
|
|
if (dst)
|
|
atomic_add(1, &dst->__refcnt);
|
|
return dst;
|
|
}
|
|
|
|
void dst_release(struct dst_entry *dst);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void refdst_drop(unsigned long refdst)
|
|
{
|
|
if (!(refdst & 1UL))
|
|
dst_release((struct dst_entry *)(refdst & ~(1UL)));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_dst_drop(struct sk_buff *skb)
|
|
{
|
|
if (skb->_skb_refdst) {
|
|
refdst_drop(skb->_skb_refdst);
|
|
skb->_skb_refdst = 0UL;
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_dst_copy(struct sk_buff *nskb, unsigned long refdst)
|
|
{
|
|
nskb->_skb_refdst = refdst;
|
|
if (!(nskb->_skb_refdst & 1UL))
|
|
dst_clone(skb_dst(nskb));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_dst_copy(struct sk_buff *nskb, const struct sk_buff *oskb)
|
|
{
|
|
__skb_dst_copy(nskb, oskb->_skb_refdst);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_dst_force(struct sk_buff *skb)
|
|
{
|
|
if (skb_dst_is_noref(skb)) {
|
|
({ int __ret_warn_on = !!(!rcu_read_lock_held()); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/net/dst.h", 325); __builtin_expect(!!(__ret_warn_on), 0); });
|
|
skb->_skb_refdst &= ~1UL;
|
|
dst_clone(skb_dst(skb));
|
|
}
|
|
}
|
|
# 338 "include/net/dst.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool dst_hold_safe(struct dst_entry *dst)
|
|
{
|
|
if (dst->flags & 0x0010)
|
|
return atomic_add_unless((&dst->__refcnt), 1, 0);
|
|
dst_hold(dst);
|
|
return true;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_dst_force_safe(struct sk_buff *skb)
|
|
{
|
|
if (skb_dst_is_noref(skb)) {
|
|
struct dst_entry *dst = skb_dst(skb);
|
|
|
|
if (!dst_hold_safe(dst))
|
|
dst = ((void *)0);
|
|
|
|
skb->_skb_refdst = (unsigned long)dst;
|
|
}
|
|
}
|
|
# 374 "include/net/dst.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev,
|
|
struct net *net)
|
|
{
|
|
skb->dev = dev;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
skb_clear_hash_if_not_l4(skb);
|
|
skb_set_queue_mapping(skb, 0);
|
|
skb_scrub_packet(skb, !net_eq(net, dev_net(dev)));
|
|
}
|
|
# 398 "include/net/dst.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev,
|
|
struct net *net)
|
|
{
|
|
|
|
dev->stats.rx_packets++;
|
|
dev->stats.rx_bytes += skb->len;
|
|
__skb_tunnel_rx(skb, dev, net);
|
|
}
|
|
|
|
int dst_discard_out(struct net *net, struct sock *sk, struct sk_buff *skb);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dst_discard(struct sk_buff *skb)
|
|
{
|
|
return dst_discard_out(&init_net, skb->sk, skb);
|
|
}
|
|
void *dst_alloc(struct dst_ops *ops, struct net_device *dev, int initial_ref,
|
|
int initial_obsolete, unsigned short flags);
|
|
void dst_init(struct dst_entry *dst, struct dst_ops *ops,
|
|
struct net_device *dev, int initial_ref, int initial_obsolete,
|
|
unsigned short flags);
|
|
void __dst_free(struct dst_entry *dst);
|
|
struct dst_entry *dst_destroy(struct dst_entry *dst);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dst_free(struct dst_entry *dst)
|
|
{
|
|
if (dst->obsolete > 0)
|
|
return;
|
|
if (!({ union { typeof((&dst->__refcnt)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&dst->__refcnt)->counter), __u.__c, sizeof((&dst->__refcnt)->counter)); else __read_once_size_nocheck(&((&dst->__refcnt)->counter), __u.__c, sizeof((&dst->__refcnt)->counter)); __u.__val; })) {
|
|
dst = dst_destroy(dst);
|
|
if (!dst)
|
|
return;
|
|
}
|
|
__dst_free(dst);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dst_rcu_free(struct callback_head *head)
|
|
{
|
|
struct dst_entry *dst = ({ const typeof( ((struct dst_entry *)0)->callback_head ) *__mptr = (head); (struct dst_entry *)( (char *)__mptr - __builtin_offsetof(struct dst_entry, callback_head) );});
|
|
dst_free(dst);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dst_confirm(struct dst_entry *dst)
|
|
{
|
|
dst->pending_confirm = 1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dst_neigh_output(struct dst_entry *dst, struct neighbour *n,
|
|
struct sk_buff *skb)
|
|
{
|
|
const struct hh_cache *hh;
|
|
|
|
if (dst->pending_confirm) {
|
|
unsigned long now = jiffies;
|
|
|
|
dst->pending_confirm = 0;
|
|
|
|
if (n->confirmed != now)
|
|
n->confirmed = now;
|
|
}
|
|
|
|
hh = &n->hh;
|
|
if ((n->nud_state & (0x80|0x40|0x02)) && hh->hh_len)
|
|
return neigh_hh_output(hh, skb);
|
|
else
|
|
return n->output(n, skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct neighbour *dst_neigh_lookup(const struct dst_entry *dst, const void *daddr)
|
|
{
|
|
struct neighbour *n = dst->ops->neigh_lookup(dst, ((void *)0), daddr);
|
|
return IS_ERR(n) ? ((void *)0) : n;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct neighbour *dst_neigh_lookup_skb(const struct dst_entry *dst,
|
|
struct sk_buff *skb)
|
|
{
|
|
struct neighbour *n = dst->ops->neigh_lookup(dst, skb, ((void *)0));
|
|
return IS_ERR(n) ? ((void *)0) : n;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dst_link_failure(struct sk_buff *skb)
|
|
{
|
|
struct dst_entry *dst = skb_dst(skb);
|
|
if (dst && dst->ops && dst->ops->link_failure)
|
|
dst->ops->link_failure(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dst_set_expires(struct dst_entry *dst, int timeout)
|
|
{
|
|
unsigned long expires = jiffies + timeout;
|
|
|
|
if (expires == 0)
|
|
expires = 1;
|
|
|
|
if (dst->expires == 0 || (({ unsigned long __dummy; typeof(dst->expires) __dummy2; (void)(&__dummy == &__dummy2); 1; }) && ({ unsigned long __dummy; typeof(expires) __dummy2; (void)(&__dummy == &__dummy2); 1; }) && ((long)((expires) - (dst->expires)) < 0)))
|
|
dst->expires = expires;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dst_output(struct net *net, struct sock *sk, struct sk_buff *skb)
|
|
{
|
|
return skb_dst(skb)->output(net, sk, skb);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int dst_input(struct sk_buff *skb)
|
|
{
|
|
return skb_dst(skb)->input(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dst_entry *dst_check(struct dst_entry *dst, u32 cookie)
|
|
{
|
|
if (dst->obsolete)
|
|
dst = dst->ops->check(dst, cookie);
|
|
return dst;
|
|
}
|
|
|
|
void dst_subsys_init(void);
|
|
|
|
|
|
enum {
|
|
XFRM_LOOKUP_ICMP = 1 << 0,
|
|
XFRM_LOOKUP_QUEUE = 1 << 1,
|
|
XFRM_LOOKUP_KEEP_DST_REF = 1 << 2,
|
|
};
|
|
|
|
struct flowi;
|
|
# 549 "include/net/dst.h"
|
|
struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig,
|
|
const struct flowi *fl, const struct sock *sk,
|
|
int flags);
|
|
|
|
struct dst_entry *xfrm_lookup_route(struct net *net, struct dst_entry *dst_orig,
|
|
const struct flowi *fl, const struct sock *sk,
|
|
int flags);
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct xfrm_state *dst_xfrm(const struct dst_entry *dst)
|
|
{
|
|
return dst->xfrm;
|
|
}
|
|
# 68 "include/net/sock.h" 2
|
|
|
|
# 1 "include/net/tcp_states.h" 1
|
|
# 16 "include/net/tcp_states.h"
|
|
enum {
|
|
TCP_ESTABLISHED = 1,
|
|
TCP_SYN_SENT,
|
|
TCP_SYN_RECV,
|
|
TCP_FIN_WAIT1,
|
|
TCP_FIN_WAIT2,
|
|
TCP_TIME_WAIT,
|
|
TCP_CLOSE,
|
|
TCP_CLOSE_WAIT,
|
|
TCP_LAST_ACK,
|
|
TCP_LISTEN,
|
|
TCP_CLOSING,
|
|
TCP_NEW_SYN_RECV,
|
|
|
|
TCP_MAX_STATES
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
TCPF_ESTABLISHED = (1 << 1),
|
|
TCPF_SYN_SENT = (1 << 2),
|
|
TCPF_SYN_RECV = (1 << 3),
|
|
TCPF_FIN_WAIT1 = (1 << 4),
|
|
TCPF_FIN_WAIT2 = (1 << 5),
|
|
TCPF_TIME_WAIT = (1 << 6),
|
|
TCPF_CLOSE = (1 << 7),
|
|
TCPF_CLOSE_WAIT = (1 << 8),
|
|
TCPF_LAST_ACK = (1 << 9),
|
|
TCPF_LISTEN = (1 << 10),
|
|
TCPF_CLOSING = (1 << 11),
|
|
TCPF_NEW_SYN_RECV = (1 << 12),
|
|
};
|
|
# 70 "include/net/sock.h" 2
|
|
# 1 "./include/uapi/linux/net_tstamp.h" 1
|
|
# 15 "./include/uapi/linux/net_tstamp.h"
|
|
enum {
|
|
SOF_TIMESTAMPING_TX_HARDWARE = (1<<0),
|
|
SOF_TIMESTAMPING_TX_SOFTWARE = (1<<1),
|
|
SOF_TIMESTAMPING_RX_HARDWARE = (1<<2),
|
|
SOF_TIMESTAMPING_RX_SOFTWARE = (1<<3),
|
|
SOF_TIMESTAMPING_SOFTWARE = (1<<4),
|
|
SOF_TIMESTAMPING_SYS_HARDWARE = (1<<5),
|
|
SOF_TIMESTAMPING_RAW_HARDWARE = (1<<6),
|
|
SOF_TIMESTAMPING_OPT_ID = (1<<7),
|
|
SOF_TIMESTAMPING_TX_SCHED = (1<<8),
|
|
SOF_TIMESTAMPING_TX_ACK = (1<<9),
|
|
SOF_TIMESTAMPING_OPT_CMSG = (1<<10),
|
|
SOF_TIMESTAMPING_OPT_TSONLY = (1<<11),
|
|
|
|
SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_OPT_TSONLY,
|
|
SOF_TIMESTAMPING_MASK = (SOF_TIMESTAMPING_LAST - 1) |
|
|
SOF_TIMESTAMPING_LAST
|
|
};
|
|
# 47 "./include/uapi/linux/net_tstamp.h"
|
|
struct hwtstamp_config {
|
|
int flags;
|
|
int tx_type;
|
|
int rx_filter;
|
|
};
|
|
|
|
|
|
enum hwtstamp_tx_types {
|
|
|
|
|
|
|
|
|
|
|
|
HWTSTAMP_TX_OFF,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HWTSTAMP_TX_ON,
|
|
# 77 "./include/uapi/linux/net_tstamp.h"
|
|
HWTSTAMP_TX_ONESTEP_SYNC,
|
|
};
|
|
|
|
|
|
enum hwtstamp_rx_filters {
|
|
|
|
HWTSTAMP_FILTER_NONE,
|
|
|
|
|
|
HWTSTAMP_FILTER_ALL,
|
|
|
|
|
|
HWTSTAMP_FILTER_SOME,
|
|
|
|
|
|
HWTSTAMP_FILTER_PTP_V1_L4_EVENT,
|
|
|
|
HWTSTAMP_FILTER_PTP_V1_L4_SYNC,
|
|
|
|
HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ,
|
|
|
|
HWTSTAMP_FILTER_PTP_V2_L4_EVENT,
|
|
|
|
HWTSTAMP_FILTER_PTP_V2_L4_SYNC,
|
|
|
|
HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ,
|
|
|
|
|
|
HWTSTAMP_FILTER_PTP_V2_L2_EVENT,
|
|
|
|
HWTSTAMP_FILTER_PTP_V2_L2_SYNC,
|
|
|
|
HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ,
|
|
|
|
|
|
HWTSTAMP_FILTER_PTP_V2_EVENT,
|
|
|
|
HWTSTAMP_FILTER_PTP_V2_SYNC,
|
|
|
|
HWTSTAMP_FILTER_PTP_V2_DELAY_REQ,
|
|
};
|
|
# 71 "include/net/sock.h" 2
|
|
# 1 "include/linux/foe_hook.h" 1
|
|
# 433 "include/linux/foe_hook.h"
|
|
extern int (*ra_sw_wifi_hook_is_wifi_down) (struct sk_buff * skb, int band);
|
|
extern int (*ra_sw_wifi_hook_wifi_down_handle) (struct net_device *dev);
|
|
extern int (*ra_sw_wifi_hook_wifi_up_handle) (struct net_device *dev);
|
|
# 72 "include/net/sock.h" 2
|
|
|
|
struct cgroup;
|
|
struct cgroup_subsys;
|
|
|
|
int mem_cgroup_sockets_init(struct mem_cgroup *memcg, struct cgroup_subsys *ss);
|
|
void mem_cgroup_sockets_destroy(struct mem_cgroup *memcg);
|
|
# 112 "include/net/sock.h"
|
|
typedef struct {
|
|
spinlock_t slock;
|
|
int owned;
|
|
wait_queue_head_t wq;
|
|
# 125 "include/net/sock.h"
|
|
} socket_lock_t;
|
|
|
|
struct sock;
|
|
struct proto;
|
|
struct net;
|
|
|
|
typedef __u32 __portpair;
|
|
typedef __u64 __addrpair;
|
|
# 163 "include/net/sock.h"
|
|
struct sock_common {
|
|
|
|
|
|
|
|
union {
|
|
__addrpair skc_addrpair;
|
|
struct {
|
|
__be32 skc_daddr;
|
|
__be32 skc_rcv_saddr;
|
|
};
|
|
};
|
|
union {
|
|
unsigned int skc_hash;
|
|
__u16 skc_u16hashes[2];
|
|
};
|
|
|
|
union {
|
|
__portpair skc_portpair;
|
|
struct {
|
|
__be16 skc_dport;
|
|
__u16 skc_num;
|
|
};
|
|
};
|
|
|
|
unsigned short skc_family;
|
|
volatile unsigned char skc_state;
|
|
unsigned char skc_reuse:4;
|
|
unsigned char skc_reuseport:1;
|
|
unsigned char skc_ipv6only:1;
|
|
unsigned char skc_net_refcnt:1;
|
|
int skc_bound_dev_if;
|
|
union {
|
|
struct hlist_node skc_bind_node;
|
|
struct hlist_nulls_node skc_portaddr_node;
|
|
};
|
|
struct proto *skc_prot;
|
|
possible_net_t skc_net;
|
|
|
|
|
|
struct in6_addr skc_v6_daddr;
|
|
struct in6_addr skc_v6_rcv_saddr;
|
|
|
|
|
|
atomic64_t skc_cookie;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
union {
|
|
unsigned long skc_flags;
|
|
struct sock *skc_listener;
|
|
struct inet_timewait_death_row *skc_tw_dr;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
int skc_dontcopy_begin[0];
|
|
|
|
union {
|
|
struct hlist_node skc_node;
|
|
struct hlist_nulls_node skc_nulls_node;
|
|
};
|
|
int skc_tx_queue_mapping;
|
|
union {
|
|
int skc_incoming_cpu;
|
|
u32 skc_rcv_wnd;
|
|
u32 skc_tw_rcv_nxt;
|
|
};
|
|
|
|
atomic_t skc_refcnt;
|
|
|
|
int skc_dontcopy_end[0];
|
|
union {
|
|
u32 skc_rxhash;
|
|
u32 skc_window_clamp;
|
|
u32 skc_tw_snd_nxt;
|
|
};
|
|
|
|
};
|
|
|
|
struct cg_proto;
|
|
# 322 "include/net/sock.h"
|
|
struct sock {
|
|
|
|
|
|
|
|
|
|
struct sock_common __sk_common;
|
|
# 359 "include/net/sock.h"
|
|
socket_lock_t sk_lock;
|
|
struct sk_buff_head sk_receive_queue;
|
|
# 369 "include/net/sock.h"
|
|
struct {
|
|
atomic_t rmem_alloc;
|
|
int len;
|
|
struct sk_buff *head;
|
|
struct sk_buff *tail;
|
|
} sk_backlog;
|
|
|
|
int sk_forward_alloc;
|
|
|
|
__u32 sk_txhash;
|
|
|
|
unsigned int sk_napi_id;
|
|
unsigned int sk_ll_usec;
|
|
|
|
atomic_t sk_drops;
|
|
int sk_rcvbuf;
|
|
|
|
struct sk_filter *sk_filter;
|
|
union {
|
|
struct socket_wq *sk_wq;
|
|
struct socket_wq *sk_wq_raw;
|
|
};
|
|
|
|
struct xfrm_policy *sk_policy[2];
|
|
|
|
struct dst_entry *sk_rx_dst;
|
|
struct dst_entry *sk_dst_cache;
|
|
|
|
atomic_t sk_wmem_alloc;
|
|
atomic_t sk_omem_alloc;
|
|
int sk_sndbuf;
|
|
struct sk_buff_head sk_write_queue;
|
|
;
|
|
unsigned int sk_shutdown : 2,
|
|
sk_no_check_tx : 1,
|
|
sk_no_check_rx : 1,
|
|
sk_userlocks : 4,
|
|
sk_protocol : 8,
|
|
sk_type : 16;
|
|
|
|
;
|
|
int sk_wmem_queued;
|
|
gfp_t sk_allocation;
|
|
u32 sk_pacing_rate;
|
|
u32 sk_max_pacing_rate;
|
|
netdev_features_t sk_route_caps;
|
|
netdev_features_t sk_route_nocaps;
|
|
int sk_gso_type;
|
|
unsigned int sk_gso_max_size;
|
|
u16 sk_gso_max_segs;
|
|
int sk_rcvlowat;
|
|
unsigned long sk_lingertime;
|
|
struct sk_buff_head sk_error_queue;
|
|
struct proto *sk_prot_creator;
|
|
rwlock_t sk_callback_lock;
|
|
int sk_err,
|
|
sk_err_soft;
|
|
u32 sk_ack_backlog;
|
|
u32 sk_max_ack_backlog;
|
|
__u32 sk_priority;
|
|
|
|
|
|
|
|
struct pid *sk_peer_pid;
|
|
const struct cred *sk_peer_cred;
|
|
long sk_rcvtimeo;
|
|
long sk_sndtimeo;
|
|
struct timer_list sk_timer;
|
|
ktime_t sk_stamp;
|
|
u16 sk_tsflags;
|
|
u32 sk_tskey;
|
|
struct socket *sk_socket;
|
|
void *sk_user_data;
|
|
struct page_frag sk_frag;
|
|
struct sk_buff *sk_send_head;
|
|
__s32 sk_peek_off;
|
|
int sk_write_pending;
|
|
|
|
void *sk_security;
|
|
|
|
__u32 sk_mark;
|
|
# 462 "include/net/sock.h"
|
|
__u16 lPbit;
|
|
__u16 lVlanId;
|
|
struct cg_proto *sk_cgrp;
|
|
void (*sk_state_change)(struct sock *sk);
|
|
void (*sk_data_ready)(struct sock *sk);
|
|
void (*sk_write_space)(struct sock *sk);
|
|
void (*sk_error_report)(struct sock *sk);
|
|
int (*sk_backlog_rcv)(struct sock *sk,
|
|
struct sk_buff *skb);
|
|
void (*sk_destruct)(struct sock *sk);
|
|
|
|
struct SkbFoeInfo sk_foe_info;
|
|
};
|
|
# 492 "include/net/sock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sk_peek_offset(struct sock *sk, int flags)
|
|
{
|
|
if ((flags & 2) && (sk->sk_peek_off >= 0))
|
|
return sk->sk_peek_off;
|
|
else
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_peek_offset_bwd(struct sock *sk, int val)
|
|
{
|
|
if (sk->sk_peek_off >= 0) {
|
|
if (sk->sk_peek_off >= val)
|
|
sk->sk_peek_off -= val;
|
|
else
|
|
sk->sk_peek_off = 0;
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_peek_offset_fwd(struct sock *sk, int val)
|
|
{
|
|
if (sk->sk_peek_off >= 0)
|
|
sk->sk_peek_off += val;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sock *sk_entry(const struct hlist_node *node)
|
|
{
|
|
return ({ const typeof( ((struct sock *)0)->__sk_common.skc_node ) *__mptr = (node); (struct sock *)( (char *)__mptr - __builtin_offsetof(struct sock, __sk_common.skc_node) );});
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sock *__sk_head(const struct hlist_head *head)
|
|
{
|
|
return ({ const typeof( ((struct sock *)0)->__sk_common.skc_node ) *__mptr = (head->first); (struct sock *)( (char *)__mptr - __builtin_offsetof(struct sock, __sk_common.skc_node) );});
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sock *sk_head(const struct hlist_head *head)
|
|
{
|
|
return hlist_empty(head) ? ((void *)0) : __sk_head(head);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sock *__sk_nulls_head(const struct hlist_nulls_head *head)
|
|
{
|
|
return ({ const typeof( ((struct sock *)0)->__sk_common.skc_nulls_node ) *__mptr = (head->first); (struct sock *)( (char *)__mptr - __builtin_offsetof(struct sock, __sk_common.skc_nulls_node) );});
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sock *sk_nulls_head(const struct hlist_nulls_head *head)
|
|
{
|
|
return hlist_nulls_empty(head) ? ((void *)0) : __sk_nulls_head(head);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sock *sk_next(const struct sock *sk)
|
|
{
|
|
return sk->__sk_common.skc_node.next ?
|
|
({ const typeof( ((struct sock *)0)->__sk_common.skc_node ) *__mptr = (sk->__sk_common.skc_node.next); (struct sock *)( (char *)__mptr - __builtin_offsetof(struct sock, __sk_common.skc_node) );}) : ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sock *sk_nulls_next(const struct sock *sk)
|
|
{
|
|
return (!is_a_nulls(sk->__sk_common.skc_nulls_node.next)) ?
|
|
({ const typeof( ((struct sock *)0)->__sk_common.skc_nulls_node ) *__mptr = (sk->__sk_common.skc_nulls_node.next); (struct sock *)( (char *)__mptr - __builtin_offsetof(struct sock, __sk_common.skc_nulls_node) );})
|
|
:
|
|
((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sk_unhashed(const struct sock *sk)
|
|
{
|
|
return hlist_unhashed(&sk->__sk_common.skc_node);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sk_hashed(const struct sock *sk)
|
|
{
|
|
return !sk_unhashed(sk);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_node_init(struct hlist_node *node)
|
|
{
|
|
node->pprev = ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_nulls_node_init(struct hlist_nulls_node *node)
|
|
{
|
|
node->pprev = ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __sk_del_node(struct sock *sk)
|
|
{
|
|
__hlist_del(&sk->__sk_common.skc_node);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __sk_del_node_init(struct sock *sk)
|
|
{
|
|
if (sk_hashed(sk)) {
|
|
__sk_del_node(sk);
|
|
sk_node_init(&sk->__sk_common.skc_node);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sock_hold(struct sock *sk)
|
|
{
|
|
atomic_add(1, &sk->__sk_common.skc_refcnt);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __sock_put(struct sock *sk)
|
|
{
|
|
atomic_sub(1, &sk->__sk_common.skc_refcnt);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sk_del_node_init(struct sock *sk)
|
|
{
|
|
bool rc = __sk_del_node_init(sk);
|
|
|
|
if (rc) {
|
|
|
|
({ int __ret_warn_on = !!(({ union { typeof((&sk->__sk_common.skc_refcnt)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&sk->__sk_common.skc_refcnt)->counter), __u.__c, sizeof((&sk->__sk_common.skc_refcnt)->counter)); else __read_once_size_nocheck(&((&sk->__sk_common.skc_refcnt)->counter), __u.__c, sizeof((&sk->__sk_common.skc_refcnt)->counter)); __u.__val; }) == 1); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/net/sock.h", 619); __builtin_expect(!!(__ret_warn_on), 0); });
|
|
__sock_put(sk);
|
|
}
|
|
return rc;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __sk_nulls_del_node_init_rcu(struct sock *sk)
|
|
{
|
|
if (sk_hashed(sk)) {
|
|
hlist_nulls_del_init_rcu(&sk->__sk_common.skc_nulls_node);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sk_nulls_del_node_init_rcu(struct sock *sk)
|
|
{
|
|
bool rc = __sk_nulls_del_node_init_rcu(sk);
|
|
|
|
if (rc) {
|
|
|
|
({ int __ret_warn_on = !!(({ union { typeof((&sk->__sk_common.skc_refcnt)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&sk->__sk_common.skc_refcnt)->counter), __u.__c, sizeof((&sk->__sk_common.skc_refcnt)->counter)); else __read_once_size_nocheck(&((&sk->__sk_common.skc_refcnt)->counter), __u.__c, sizeof((&sk->__sk_common.skc_refcnt)->counter)); __u.__val; }) == 1); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/net/sock.h", 641); __builtin_expect(!!(__ret_warn_on), 0); });
|
|
__sock_put(sk);
|
|
}
|
|
return rc;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __sk_add_node(struct sock *sk, struct hlist_head *list)
|
|
{
|
|
hlist_add_head(&sk->__sk_common.skc_node, list);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_add_node(struct sock *sk, struct hlist_head *list)
|
|
{
|
|
sock_hold(sk);
|
|
__sk_add_node(sk, list);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_add_node_rcu(struct sock *sk, struct hlist_head *list)
|
|
{
|
|
sock_hold(sk);
|
|
hlist_add_head_rcu(&sk->__sk_common.skc_node, list);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __sk_nulls_add_node_rcu(struct sock *sk, struct hlist_nulls_head *list)
|
|
{
|
|
hlist_nulls_add_head_rcu(&sk->__sk_common.skc_nulls_node, list);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_nulls_add_node_rcu(struct sock *sk, struct hlist_nulls_head *list)
|
|
{
|
|
sock_hold(sk);
|
|
__sk_nulls_add_node_rcu(sk, list);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __sk_del_bind_node(struct sock *sk)
|
|
{
|
|
__hlist_del(&sk->__sk_common.skc_bind_node);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_add_bind_node(struct sock *sk,
|
|
struct hlist_head *list)
|
|
{
|
|
hlist_add_head(&sk->__sk_common.skc_bind_node, list);
|
|
}
|
|
# 718 "include/net/sock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct user_namespace *sk_user_ns(struct sock *sk)
|
|
{
|
|
|
|
|
|
|
|
|
|
return sk->sk_socket->file->f_cred->user_ns;
|
|
}
|
|
|
|
|
|
enum sock_flags {
|
|
SOCK_DEAD,
|
|
SOCK_DONE,
|
|
SOCK_URGINLINE,
|
|
SOCK_KEEPOPEN,
|
|
SOCK_LINGER,
|
|
SOCK_DESTROY,
|
|
SOCK_BROADCAST,
|
|
SOCK_TIMESTAMP,
|
|
SOCK_ZAPPED,
|
|
SOCK_USE_WRITE_QUEUE,
|
|
SOCK_DBG,
|
|
SOCK_RCVTSTAMP,
|
|
SOCK_RCVTSTAMPNS,
|
|
SOCK_LOCALROUTE,
|
|
SOCK_QUEUE_SHRUNK,
|
|
SOCK_MEMALLOC,
|
|
SOCK_TIMESTAMPING_RX_SOFTWARE,
|
|
SOCK_FASYNC,
|
|
SOCK_RXQ_OVFL,
|
|
SOCK_ZEROCOPY,
|
|
SOCK_WIFI_STATUS,
|
|
SOCK_NOFCS,
|
|
|
|
|
|
|
|
SOCK_FILTER_LOCKED,
|
|
SOCK_SELECT_ERR_QUEUE,
|
|
};
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sock_copy_flags(struct sock *nsk, struct sock *osk)
|
|
{
|
|
nsk->__sk_common.skc_flags = osk->__sk_common.skc_flags;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sock_set_flag(struct sock *sk, enum sock_flags flag)
|
|
{
|
|
__set_bit(flag, &sk->__sk_common.skc_flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sock_reset_flag(struct sock *sk, enum sock_flags flag)
|
|
{
|
|
__clear_bit(flag, &sk->__sk_common.skc_flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sock_flag(const struct sock *sk, enum sock_flags flag)
|
|
{
|
|
return test_bit(flag, &sk->__sk_common.skc_flags);
|
|
}
|
|
|
|
|
|
extern struct static_key memalloc_socks;
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sk_memalloc_socks(void)
|
|
{
|
|
return static_key_false(&memalloc_socks);
|
|
}
|
|
# 795 "include/net/sock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) gfp_t sk_gfp_atomic(const struct sock *sk, gfp_t gfp_mask)
|
|
{
|
|
return ((( gfp_t)0x20u)|(( gfp_t)0x80000u)|(( gfp_t)0x2000000u)) | (sk->sk_allocation & (( gfp_t)0x2000u));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_acceptq_removed(struct sock *sk)
|
|
{
|
|
sk->sk_ack_backlog--;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_acceptq_added(struct sock *sk)
|
|
{
|
|
sk->sk_ack_backlog++;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sk_acceptq_is_full(const struct sock *sk)
|
|
{
|
|
return sk->sk_ack_backlog > sk->sk_max_ack_backlog;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sk_stream_min_wspace(const struct sock *sk)
|
|
{
|
|
return sk->sk_wmem_queued >> 1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sk_stream_wspace(const struct sock *sk)
|
|
{
|
|
return sk->sk_sndbuf - sk->sk_wmem_queued;
|
|
}
|
|
|
|
void sk_stream_write_space(struct sock *sk);
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __sk_add_backlog(struct sock *sk, struct sk_buff *skb)
|
|
{
|
|
|
|
skb_dst_force_safe(skb);
|
|
|
|
if (!sk->sk_backlog.tail)
|
|
sk->sk_backlog.head = skb;
|
|
else
|
|
sk->sk_backlog.tail->next = skb;
|
|
|
|
sk->sk_backlog.tail = skb;
|
|
skb->next = ((void *)0);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sk_rcvqueues_full(const struct sock *sk, unsigned int limit)
|
|
{
|
|
unsigned int qsize = sk->sk_backlog.len + ({ union { typeof((&sk->sk_backlog.rmem_alloc)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&sk->sk_backlog.rmem_alloc)->counter), __u.__c, sizeof((&sk->sk_backlog.rmem_alloc)->counter)); else __read_once_size_nocheck(&((&sk->sk_backlog.rmem_alloc)->counter), __u.__c, sizeof((&sk->sk_backlog.rmem_alloc)->counter)); __u.__val; });
|
|
|
|
return qsize > limit;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((warn_unused_result)) int sk_add_backlog(struct sock *sk, struct sk_buff *skb,
|
|
unsigned int limit)
|
|
{
|
|
if (sk_rcvqueues_full(sk, limit))
|
|
return -105;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (skb_pfmemalloc(skb) && !sock_flag(sk, SOCK_MEMALLOC))
|
|
return -12;
|
|
|
|
__sk_add_backlog(sk, skb);
|
|
sk->sk_backlog.len += skb->truesize;
|
|
return 0;
|
|
}
|
|
|
|
int __sk_backlog_rcv(struct sock *sk, struct sk_buff *skb);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sk_backlog_rcv(struct sock *sk, struct sk_buff *skb)
|
|
{
|
|
if (sk_memalloc_socks() && skb_pfmemalloc(skb))
|
|
return __sk_backlog_rcv(sk, skb);
|
|
|
|
return sk->sk_backlog_rcv(sk, skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_incoming_cpu_update(struct sock *sk)
|
|
{
|
|
sk->__sk_common.skc_incoming_cpu = (current_thread_info()->cpu);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sock_rps_record_flow_hash(__u32 hash)
|
|
{
|
|
|
|
struct rps_sock_flow_table *sock_flow_table;
|
|
|
|
rcu_read_lock();
|
|
sock_flow_table = ({ typeof(*(rps_sock_flow_table)) *________p1 = (typeof(*(rps_sock_flow_table)) *)({ typeof((rps_sock_flow_table)) _________p1 = ({ union { typeof((rps_sock_flow_table)) __val; char __c[1]; } __u; if (1) __read_once_size(&((rps_sock_flow_table)), __u.__c, sizeof((rps_sock_flow_table))); else __read_once_size_nocheck(&((rps_sock_flow_table)), __u.__c, sizeof((rps_sock_flow_table))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(rps_sock_flow_table)) *)(________p1)); });
|
|
rps_record_sock_flow(sock_flow_table, hash);
|
|
rcu_read_unlock();
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sock_rps_record_flow(const struct sock *sk)
|
|
{
|
|
|
|
sock_rps_record_flow_hash(sk->__sk_common.skc_rxhash);
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sock_rps_save_rxhash(struct sock *sk,
|
|
const struct sk_buff *skb)
|
|
{
|
|
|
|
if (__builtin_expect(!!(sk->__sk_common.skc_rxhash != skb->hash), 0))
|
|
sk->__sk_common.skc_rxhash = skb->hash;
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sock_rps_reset_rxhash(struct sock *sk)
|
|
{
|
|
|
|
sk->__sk_common.skc_rxhash = 0;
|
|
|
|
}
|
|
# 940 "include/net/sock.h"
|
|
int sk_stream_wait_connect(struct sock *sk, long *timeo_p);
|
|
int sk_stream_wait_memory(struct sock *sk, long *timeo_p);
|
|
void sk_stream_wait_close(struct sock *sk, long timeo_p);
|
|
int sk_stream_error(struct sock *sk, int flags, int err);
|
|
void sk_stream_kill_queues(struct sock *sk);
|
|
void sk_set_memalloc(struct sock *sk);
|
|
void sk_clear_memalloc(struct sock *sk);
|
|
|
|
int sk_wait_data(struct sock *sk, long *timeo, const struct sk_buff *skb);
|
|
|
|
struct request_sock_ops;
|
|
struct timewait_sock_ops;
|
|
struct inet_hashinfo;
|
|
struct raw_hashinfo;
|
|
struct module;
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_prot_clear_nulls(struct sock *sk, int size)
|
|
{
|
|
if (__builtin_offsetof(struct sock, __sk_common.skc_node.next) != 0)
|
|
({ void *__p = (sk); size_t __n = __builtin_offsetof(struct sock, __sk_common.skc_node.next); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); });
|
|
({ void *__p = (&sk->__sk_common.skc_node.pprev); size_t __n = size - __builtin_offsetof(struct sock, __sk_common.skc_node.pprev); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); })
|
|
;
|
|
}
|
|
|
|
|
|
|
|
|
|
struct proto {
|
|
void (*close)(struct sock *sk,
|
|
long timeout);
|
|
int (*connect)(struct sock *sk,
|
|
struct sockaddr *uaddr,
|
|
int addr_len);
|
|
int (*disconnect)(struct sock *sk, int flags);
|
|
|
|
struct sock * (*accept)(struct sock *sk, int flags, int *err);
|
|
|
|
int (*ioctl)(struct sock *sk, int cmd,
|
|
unsigned long arg);
|
|
int (*init)(struct sock *sk);
|
|
void (*destroy)(struct sock *sk);
|
|
void (*shutdown)(struct sock *sk, int how);
|
|
int (*setsockopt)(struct sock *sk, int level,
|
|
int optname, char *optval,
|
|
unsigned int optlen);
|
|
int (*getsockopt)(struct sock *sk, int level,
|
|
int optname, char *optval,
|
|
int *option);
|
|
# 1004 "include/net/sock.h"
|
|
int (*sendmsg)(struct sock *sk, struct msghdr *msg,
|
|
size_t len);
|
|
int (*recvmsg)(struct sock *sk, struct msghdr *msg,
|
|
size_t len, int noblock, int flags,
|
|
int *addr_len);
|
|
int (*sendpage)(struct sock *sk, struct page *page,
|
|
int offset, size_t size, int flags);
|
|
int (*bind)(struct sock *sk,
|
|
struct sockaddr *uaddr, int addr_len);
|
|
|
|
int (*backlog_rcv) (struct sock *sk,
|
|
struct sk_buff *skb);
|
|
|
|
void (*release_cb)(struct sock *sk);
|
|
|
|
|
|
void (*hash)(struct sock *sk);
|
|
void (*unhash)(struct sock *sk);
|
|
void (*rehash)(struct sock *sk);
|
|
int (*get_port)(struct sock *sk, unsigned short snum);
|
|
void (*clear_sk)(struct sock *sk, int size);
|
|
|
|
|
|
|
|
unsigned int inuse_idx;
|
|
|
|
|
|
bool (*stream_memory_free)(const struct sock *sk);
|
|
|
|
void (*enter_memory_pressure)(struct sock *sk);
|
|
atomic_long_t *memory_allocated;
|
|
struct percpu_counter *sockets_allocated;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int *memory_pressure;
|
|
long *sysctl_mem;
|
|
int *sysctl_wmem;
|
|
int *sysctl_rmem;
|
|
int max_header;
|
|
bool no_autobind;
|
|
|
|
struct kmem_cache *slab;
|
|
unsigned int obj_size;
|
|
int slab_flags;
|
|
|
|
struct percpu_counter *orphan_count;
|
|
|
|
struct request_sock_ops *rsk_prot;
|
|
struct timewait_sock_ops *twsk_prot;
|
|
|
|
union {
|
|
struct inet_hashinfo *hashinfo;
|
|
struct udp_table *udp_table;
|
|
struct raw_hashinfo *raw_hash;
|
|
} h;
|
|
|
|
struct module *owner;
|
|
|
|
char name[32];
|
|
|
|
struct list_head node;
|
|
# 1084 "include/net/sock.h"
|
|
};
|
|
|
|
int proto_register(struct proto *prot, int alloc_slab);
|
|
void proto_unregister(struct proto *prot);
|
|
# 1124 "include/net/sock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct cg_proto *parent_cg_proto(struct proto *proto,
|
|
struct cg_proto *cg_proto)
|
|
{
|
|
return ((void *)0);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sk_stream_memory_free(const struct sock *sk)
|
|
{
|
|
if (sk->sk_wmem_queued >= sk->sk_sndbuf)
|
|
return false;
|
|
|
|
return sk->__sk_common.skc_prot->stream_memory_free ?
|
|
sk->__sk_common.skc_prot->stream_memory_free(sk) : true;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sk_stream_is_writeable(const struct sock *sk)
|
|
{
|
|
return sk_stream_wspace(sk) >= sk_stream_min_wspace(sk) &&
|
|
sk_stream_memory_free(sk);
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sk_has_memory_pressure(const struct sock *sk)
|
|
{
|
|
return sk->__sk_common.skc_prot->memory_pressure != ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sk_under_memory_pressure(const struct sock *sk)
|
|
{
|
|
if (!sk->__sk_common.skc_prot->memory_pressure)
|
|
return false;
|
|
|
|
if (0 && sk->sk_cgrp)
|
|
return !!sk->sk_cgrp->memory_pressure;
|
|
|
|
return !!*sk->__sk_common.skc_prot->memory_pressure;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_leave_memory_pressure(struct sock *sk)
|
|
{
|
|
int *memory_pressure = sk->__sk_common.skc_prot->memory_pressure;
|
|
|
|
if (!memory_pressure)
|
|
return;
|
|
|
|
if (*memory_pressure)
|
|
*memory_pressure = 0;
|
|
|
|
if (0 && sk->sk_cgrp) {
|
|
struct cg_proto *cg_proto = sk->sk_cgrp;
|
|
struct proto *prot = sk->__sk_common.skc_prot;
|
|
|
|
for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto))
|
|
cg_proto->memory_pressure = 0;
|
|
}
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_enter_memory_pressure(struct sock *sk)
|
|
{
|
|
if (!sk->__sk_common.skc_prot->enter_memory_pressure)
|
|
return;
|
|
|
|
if (0 && sk->sk_cgrp) {
|
|
struct cg_proto *cg_proto = sk->sk_cgrp;
|
|
struct proto *prot = sk->__sk_common.skc_prot;
|
|
|
|
for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto))
|
|
cg_proto->memory_pressure = 1;
|
|
}
|
|
|
|
sk->__sk_common.skc_prot->enter_memory_pressure(sk);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long sk_prot_mem_limits(const struct sock *sk, int index)
|
|
{
|
|
long *prot = sk->__sk_common.skc_prot->sysctl_mem;
|
|
if (0 && sk->sk_cgrp)
|
|
prot = sk->sk_cgrp->sysctl_mem;
|
|
return prot[index];
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void memcg_memory_allocated_add(struct cg_proto *prot,
|
|
unsigned long amt,
|
|
int *parent_status)
|
|
{
|
|
page_counter_charge(&prot->memory_allocated, amt);
|
|
|
|
if (page_counter_read(&prot->memory_allocated) >
|
|
prot->memory_allocated.limit)
|
|
*parent_status = OVER_LIMIT;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void memcg_memory_allocated_sub(struct cg_proto *prot,
|
|
unsigned long amt)
|
|
{
|
|
page_counter_uncharge(&prot->memory_allocated, amt);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long
|
|
sk_memory_allocated(const struct sock *sk)
|
|
{
|
|
struct proto *prot = sk->__sk_common.skc_prot;
|
|
|
|
if (0 && sk->sk_cgrp)
|
|
return page_counter_read(&sk->sk_cgrp->memory_allocated);
|
|
|
|
return atomic_long_read(prot->memory_allocated);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long
|
|
sk_memory_allocated_add(struct sock *sk, int amt, int *parent_status)
|
|
{
|
|
struct proto *prot = sk->__sk_common.skc_prot;
|
|
|
|
if (0 && sk->sk_cgrp) {
|
|
memcg_memory_allocated_add(sk->sk_cgrp, amt, parent_status);
|
|
|
|
atomic_long_add_return(amt, prot->memory_allocated);
|
|
return page_counter_read(&sk->sk_cgrp->memory_allocated);
|
|
}
|
|
|
|
return atomic_long_add_return(amt, prot->memory_allocated);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
sk_memory_allocated_sub(struct sock *sk, int amt)
|
|
{
|
|
struct proto *prot = sk->__sk_common.skc_prot;
|
|
|
|
if (0 && sk->sk_cgrp)
|
|
memcg_memory_allocated_sub(sk->sk_cgrp, amt);
|
|
|
|
atomic_long_sub(amt, prot->memory_allocated);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_sockets_allocated_dec(struct sock *sk)
|
|
{
|
|
struct proto *prot = sk->__sk_common.skc_prot;
|
|
|
|
if (0 && sk->sk_cgrp) {
|
|
struct cg_proto *cg_proto = sk->sk_cgrp;
|
|
|
|
for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto))
|
|
percpu_counter_dec(&cg_proto->sockets_allocated);
|
|
}
|
|
|
|
percpu_counter_dec(prot->sockets_allocated);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_sockets_allocated_inc(struct sock *sk)
|
|
{
|
|
struct proto *prot = sk->__sk_common.skc_prot;
|
|
|
|
if (0 && sk->sk_cgrp) {
|
|
struct cg_proto *cg_proto = sk->sk_cgrp;
|
|
|
|
for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto))
|
|
percpu_counter_inc(&cg_proto->sockets_allocated);
|
|
}
|
|
|
|
percpu_counter_inc(prot->sockets_allocated);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
sk_sockets_allocated_read_positive(struct sock *sk)
|
|
{
|
|
struct proto *prot = sk->__sk_common.skc_prot;
|
|
|
|
if (0 && sk->sk_cgrp)
|
|
return percpu_counter_read_positive(&sk->sk_cgrp->sockets_allocated);
|
|
|
|
return percpu_counter_read_positive(prot->sockets_allocated);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int
|
|
proto_sockets_allocated_sum_positive(struct proto *prot)
|
|
{
|
|
return percpu_counter_sum_positive(prot->sockets_allocated);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long
|
|
proto_memory_allocated(struct proto *prot)
|
|
{
|
|
return atomic_long_read(prot->memory_allocated);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool
|
|
proto_memory_pressure(struct proto *prot)
|
|
{
|
|
if (!prot->memory_pressure)
|
|
return false;
|
|
return !!*prot->memory_pressure;
|
|
}
|
|
|
|
|
|
|
|
|
|
void sock_prot_inuse_add(struct net *net, struct proto *prot, int inc);
|
|
int sock_prot_inuse_get(struct net *net, struct proto *proto);
|
|
# 1336 "include/net/sock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __sk_prot_rehash(struct sock *sk)
|
|
{
|
|
sk->__sk_common.skc_prot->unhash(sk);
|
|
sk->__sk_common.skc_prot->hash(sk);
|
|
}
|
|
|
|
void sk_prot_clear_portaddr_nulls(struct sock *sk, int size);
|
|
# 1359 "include/net/sock.h"
|
|
struct socket_alloc {
|
|
struct socket socket;
|
|
struct inode vfs_inode;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct socket *SOCKET_I(struct inode *inode)
|
|
{
|
|
return &({ const typeof( ((struct socket_alloc *)0)->vfs_inode ) *__mptr = (inode); (struct socket_alloc *)( (char *)__mptr - __builtin_offsetof(struct socket_alloc, vfs_inode) );})->socket;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct inode *SOCK_INODE(struct socket *socket)
|
|
{
|
|
return &({ const typeof( ((struct socket_alloc *)0)->socket ) *__mptr = (socket); (struct socket_alloc *)( (char *)__mptr - __builtin_offsetof(struct socket_alloc, socket) );})->vfs_inode;
|
|
}
|
|
|
|
|
|
|
|
|
|
int __sk_mem_schedule(struct sock *sk, int size, int kind);
|
|
void __sk_mem_reclaim(struct sock *sk, int amount);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sk_mem_pages(int amt)
|
|
{
|
|
return (amt + ((int)((1UL) << 12)) - 1) >> ( __builtin_constant_p(((int)((1UL) << 12))) ? ( (((int)((1UL) << 12))) < 2 ? 0 : (((int)((1UL) << 12))) & (1ULL << 63) ? 63 : (((int)((1UL) << 12))) & (1ULL << 62) ? 62 : (((int)((1UL) << 12))) & (1ULL << 61) ? 61 : (((int)((1UL) << 12))) & (1ULL << 60) ? 60 : (((int)((1UL) << 12))) & (1ULL << 59) ? 59 : (((int)((1UL) << 12))) & (1ULL << 58) ? 58 : (((int)((1UL) << 12))) & (1ULL << 57) ? 57 : (((int)((1UL) << 12))) & (1ULL << 56) ? 56 : (((int)((1UL) << 12))) & (1ULL << 55) ? 55 : (((int)((1UL) << 12))) & (1ULL << 54) ? 54 : (((int)((1UL) << 12))) & (1ULL << 53) ? 53 : (((int)((1UL) << 12))) & (1ULL << 52) ? 52 : (((int)((1UL) << 12))) & (1ULL << 51) ? 51 : (((int)((1UL) << 12))) & (1ULL << 50) ? 50 : (((int)((1UL) << 12))) & (1ULL << 49) ? 49 : (((int)((1UL) << 12))) & (1ULL << 48) ? 48 : (((int)((1UL) << 12))) & (1ULL << 47) ? 47 : (((int)((1UL) << 12))) & (1ULL << 46) ? 46 : (((int)((1UL) << 12))) & (1ULL << 45) ? 45 : (((int)((1UL) << 12))) & (1ULL << 44) ? 44 : (((int)((1UL) << 12))) & (1ULL << 43) ? 43 : (((int)((1UL) << 12))) & (1ULL << 42) ? 42 : (((int)((1UL) << 12))) & (1ULL << 41) ? 41 : (((int)((1UL) << 12))) & (1ULL << 40) ? 40 : (((int)((1UL) << 12))) & (1ULL << 39) ? 39 : (((int)((1UL) << 12))) & (1ULL << 38) ? 38 : (((int)((1UL) << 12))) & (1ULL << 37) ? 37 : (((int)((1UL) << 12))) & (1ULL << 36) ? 36 : (((int)((1UL) << 12))) & (1ULL << 35) ? 35 : (((int)((1UL) << 12))) & (1ULL << 34) ? 34 : (((int)((1UL) << 12))) & (1ULL << 33) ? 33 : (((int)((1UL) << 12))) & (1ULL << 32) ? 32 : (((int)((1UL) << 12))) & (1ULL << 31) ? 31 : (((int)((1UL) << 12))) & (1ULL << 30) ? 30 : (((int)((1UL) << 12))) & (1ULL << 29) ? 29 : (((int)((1UL) << 12))) & (1ULL << 28) ? 28 : (((int)((1UL) << 12))) & (1ULL << 27) ? 27 : (((int)((1UL) << 12))) & (1ULL << 26) ? 26 : (((int)((1UL) << 12))) & (1ULL << 25) ? 25 : (((int)((1UL) << 12))) & (1ULL << 24) ? 24 : (((int)((1UL) << 12))) & (1ULL << 23) ? 23 : (((int)((1UL) << 12))) & (1ULL << 22) ? 22 : (((int)((1UL) << 12))) & (1ULL << 21) ? 21 : (((int)((1UL) << 12))) & (1ULL << 20) ? 20 : (((int)((1UL) << 12))) & (1ULL << 19) ? 19 : (((int)((1UL) << 12))) & (1ULL << 18) ? 18 : (((int)((1UL) << 12))) & (1ULL << 17) ? 17 : (((int)((1UL) << 12))) & (1ULL << 16) ? 16 : (((int)((1UL) << 12))) & (1ULL << 15) ? 15 : (((int)((1UL) << 12))) & (1ULL << 14) ? 14 : (((int)((1UL) << 12))) & (1ULL << 13) ? 13 : (((int)((1UL) << 12))) & (1ULL << 12) ? 12 : (((int)((1UL) << 12))) & (1ULL << 11) ? 11 : (((int)((1UL) << 12))) & (1ULL << 10) ? 10 : (((int)((1UL) << 12))) & (1ULL << 9) ? 9 : (((int)((1UL) << 12))) & (1ULL << 8) ? 8 : (((int)((1UL) << 12))) & (1ULL << 7) ? 7 : (((int)((1UL) << 12))) & (1ULL << 6) ? 6 : (((int)((1UL) << 12))) & (1ULL << 5) ? 5 : (((int)((1UL) << 12))) & (1ULL << 4) ? 4 : (((int)((1UL) << 12))) & (1ULL << 3) ? 3 : (((int)((1UL) << 12))) & (1ULL << 2) ? 2 : 1 ) : (sizeof(((int)((1UL) << 12))) <= 4) ? __ilog2_u32(((int)((1UL) << 12))) : __ilog2_u64(((int)((1UL) << 12))) );
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sk_has_account(struct sock *sk)
|
|
{
|
|
|
|
return !!sk->__sk_common.skc_prot->memory_allocated;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sk_wmem_schedule(struct sock *sk, int size)
|
|
{
|
|
if (!sk_has_account(sk))
|
|
return true;
|
|
return size <= sk->sk_forward_alloc ||
|
|
__sk_mem_schedule(sk, size, 0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool
|
|
sk_rmem_schedule(struct sock *sk, struct sk_buff *skb, int size)
|
|
{
|
|
if (!sk_has_account(sk))
|
|
return true;
|
|
return size<= sk->sk_forward_alloc ||
|
|
__sk_mem_schedule(sk, size, 1) ||
|
|
skb_pfmemalloc(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_mem_reclaim(struct sock *sk)
|
|
{
|
|
if (!sk_has_account(sk))
|
|
return;
|
|
if (sk->sk_forward_alloc >= ((int)((1UL) << 12)))
|
|
__sk_mem_reclaim(sk, sk->sk_forward_alloc);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_mem_reclaim_partial(struct sock *sk)
|
|
{
|
|
if (!sk_has_account(sk))
|
|
return;
|
|
if (sk->sk_forward_alloc > ((int)((1UL) << 12)))
|
|
__sk_mem_reclaim(sk, sk->sk_forward_alloc - 1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_mem_charge(struct sock *sk, int size)
|
|
{
|
|
if (!sk_has_account(sk))
|
|
return;
|
|
sk->sk_forward_alloc -= size;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_mem_uncharge(struct sock *sk, int size)
|
|
{
|
|
if (!sk_has_account(sk))
|
|
return;
|
|
sk->sk_forward_alloc += size;
|
|
# 1450 "include/net/sock.h"
|
|
if (__builtin_expect(!!(sk->sk_forward_alloc >= 1 << 21), 0))
|
|
__sk_mem_reclaim(sk, 1 << 20);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_wmem_free_skb(struct sock *sk, struct sk_buff *skb)
|
|
{
|
|
sock_set_flag(sk, SOCK_QUEUE_SHRUNK);
|
|
sk->sk_wmem_queued -= skb->truesize;
|
|
sk_mem_uncharge(sk, skb->truesize);
|
|
__kfree_skb(skb);
|
|
}
|
|
# 1477 "include/net/sock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sock_release_ownership(struct sock *sk)
|
|
{
|
|
sk->sk_lock.owned = 0;
|
|
}
|
|
# 1501 "include/net/sock.h"
|
|
void lock_sock_nested(struct sock *sk, int subclass);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void lock_sock(struct sock *sk)
|
|
{
|
|
lock_sock_nested(sk, 0);
|
|
}
|
|
|
|
void release_sock(struct sock *sk);
|
|
# 1517 "include/net/sock.h"
|
|
bool lock_sock_fast(struct sock *sk);
|
|
# 1526 "include/net/sock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void unlock_sock_fast(struct sock *sk, bool slow)
|
|
{
|
|
if (slow)
|
|
release_sock(sk);
|
|
else
|
|
spin_unlock_bh(&sk->sk_lock.slock);
|
|
}
|
|
|
|
|
|
struct sock *sk_alloc(struct net *net, int family, gfp_t priority,
|
|
struct proto *prot, int kern);
|
|
void sk_free(struct sock *sk);
|
|
void sk_destruct(struct sock *sk);
|
|
struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority);
|
|
|
|
struct sk_buff *sock_wmalloc(struct sock *sk, unsigned long size, int force,
|
|
gfp_t priority);
|
|
void sock_wfree(struct sk_buff *skb);
|
|
void skb_orphan_partial(struct sk_buff *skb);
|
|
void sock_rfree(struct sk_buff *skb);
|
|
void sock_efree(struct sk_buff *skb);
|
|
|
|
void sock_edemux(struct sk_buff *skb);
|
|
|
|
|
|
|
|
|
|
int sock_setsockopt(struct socket *sock, int level, int op,
|
|
char *optval, unsigned int optlen);
|
|
|
|
int sock_getsockopt(struct socket *sock, int level, int op,
|
|
char *optval, int *optlen);
|
|
struct sk_buff *sock_alloc_send_skb(struct sock *sk, unsigned long size,
|
|
int noblock, int *errcode);
|
|
struct sk_buff *sock_alloc_send_pskb(struct sock *sk, unsigned long header_len,
|
|
unsigned long data_len, int noblock,
|
|
int *errcode, int max_page_order);
|
|
void *sock_kmalloc(struct sock *sk, int size, gfp_t priority);
|
|
void sock_kfree_s(struct sock *sk, void *mem, int size);
|
|
void sock_kzfree_s(struct sock *sk, void *mem, int size);
|
|
void sk_send_sigurg(struct sock *sk);
|
|
|
|
struct sockcm_cookie {
|
|
u32 mark;
|
|
};
|
|
|
|
int sock_cmsg_send(struct sock *sk, struct msghdr *msg,
|
|
struct sockcm_cookie *sockc);
|
|
|
|
|
|
|
|
|
|
|
|
int sock_no_bind(struct socket *, struct sockaddr *, int);
|
|
int sock_no_connect(struct socket *, struct sockaddr *, int, int);
|
|
int sock_no_socketpair(struct socket *, struct socket *);
|
|
int sock_no_accept(struct socket *, struct socket *, int);
|
|
int sock_no_getname(struct socket *, struct sockaddr *, int *, int);
|
|
unsigned int sock_no_poll(struct file *, struct socket *,
|
|
struct poll_table_struct *);
|
|
int sock_no_ioctl(struct socket *, unsigned int, unsigned long);
|
|
int sock_no_listen(struct socket *, int);
|
|
int sock_no_shutdown(struct socket *, int);
|
|
int sock_no_getsockopt(struct socket *, int , int, char *, int *);
|
|
int sock_no_setsockopt(struct socket *, int, int, char *, unsigned int);
|
|
int sock_no_sendmsg(struct socket *, struct msghdr *, size_t);
|
|
int sock_no_recvmsg(struct socket *, struct msghdr *, size_t, int);
|
|
int sock_no_mmap(struct file *file, struct socket *sock,
|
|
struct vm_area_struct *vma);
|
|
ssize_t sock_no_sendpage(struct socket *sock, struct page *page, int offset,
|
|
size_t size, int flags);
|
|
|
|
|
|
|
|
|
|
|
|
int sock_common_getsockopt(struct socket *sock, int level, int optname,
|
|
char *optval, int *optlen);
|
|
int sock_common_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
|
|
int flags);
|
|
int sock_common_setsockopt(struct socket *sock, int level, int optname,
|
|
char *optval, unsigned int optlen);
|
|
int compat_sock_common_getsockopt(struct socket *sock, int level,
|
|
int optname, char *optval, int *optlen);
|
|
int compat_sock_common_setsockopt(struct socket *sock, int level,
|
|
int optname, char *optval, unsigned int optlen);
|
|
|
|
void sk_common_release(struct sock *sk);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void sock_init_data(struct socket *sock, struct sock *sk);
|
|
# 1648 "include/net/sock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sock_put(struct sock *sk)
|
|
{
|
|
if ((({ typeof(atomic_sub_return_relaxed(1, &sk->__sk_common.skc_refcnt)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_sub_return_relaxed(1, &sk->__sk_common.skc_refcnt); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) == 0))
|
|
sk_free(sk);
|
|
}
|
|
|
|
|
|
|
|
void sock_gen_put(struct sock *sk);
|
|
|
|
int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_tx_queue_set(struct sock *sk, int tx_queue)
|
|
{
|
|
sk->__sk_common.skc_tx_queue_mapping = tx_queue;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_tx_queue_clear(struct sock *sk)
|
|
{
|
|
sk->__sk_common.skc_tx_queue_mapping = -1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sk_tx_queue_get(const struct sock *sk)
|
|
{
|
|
return sk ? sk->__sk_common.skc_tx_queue_mapping : -1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_set_socket(struct sock *sk, struct socket *sock)
|
|
{
|
|
sk_tx_queue_clear(sk);
|
|
sk->sk_socket = sock;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) wait_queue_head_t *sk_sleep(struct sock *sk)
|
|
{
|
|
((void)sizeof(char[1 - 2*!!(__builtin_offsetof(struct socket_wq, wait) != 0)]));
|
|
return &({ typeof(*(sk->sk_wq)) *________p1 = (typeof(*(sk->sk_wq)) *)({ typeof((sk->sk_wq)) _________p1 = ({ union { typeof((sk->sk_wq)) __val; char __c[1]; } __u; if (1) __read_once_size(&((sk->sk_wq)), __u.__c, sizeof((sk->sk_wq))); else __read_once_size_nocheck(&((sk->sk_wq)), __u.__c, sizeof((sk->sk_wq))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(sk->sk_wq)) *)(________p1)); })->wait;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sock_orphan(struct sock *sk)
|
|
{
|
|
_raw_write_lock_bh(&sk->sk_callback_lock);
|
|
sock_set_flag(sk, SOCK_DEAD);
|
|
sk_set_socket(sk, ((void *)0));
|
|
sk->sk_wq = ((void *)0);
|
|
_raw_write_unlock_bh(&sk->sk_callback_lock);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sock_graft(struct sock *sk, struct socket *parent)
|
|
{
|
|
_raw_write_lock_bh(&sk->sk_callback_lock);
|
|
sk->sk_wq = parent->wq;
|
|
parent->sk = sk;
|
|
sk_set_socket(sk, parent);
|
|
security_sock_graft(sk, parent);
|
|
_raw_write_unlock_bh(&sk->sk_callback_lock);
|
|
}
|
|
|
|
kuid_t sock_i_uid(struct sock *sk);
|
|
unsigned long sock_i_ino(struct sock *sk);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 net_tx_rndhash(void)
|
|
{
|
|
u32 v = prandom_u32();
|
|
|
|
return v ?: 1;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_set_txhash(struct sock *sk)
|
|
{
|
|
sk->sk_txhash = net_tx_rndhash();
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_rethink_txhash(struct sock *sk)
|
|
{
|
|
if (sk->sk_txhash)
|
|
sk_set_txhash(sk);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dst_entry *
|
|
__sk_dst_get(struct sock *sk)
|
|
{
|
|
return ({ typeof(*(sk->sk_dst_cache)) *________p1 = (typeof(*(sk->sk_dst_cache)) *)({ typeof((sk->sk_dst_cache)) _________p1 = ({ union { typeof((sk->sk_dst_cache)) __val; char __c[1]; } __u; if (1) __read_once_size(&((sk->sk_dst_cache)), __u.__c, sizeof((sk->sk_dst_cache))); else __read_once_size_nocheck(&((sk->sk_dst_cache)), __u.__c, sizeof((sk->sk_dst_cache))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(sk->sk_dst_cache)) *)(________p1)); })
|
|
;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct dst_entry *
|
|
sk_dst_get(struct sock *sk)
|
|
{
|
|
struct dst_entry *dst;
|
|
|
|
rcu_read_lock();
|
|
dst = ({ typeof(*(sk->sk_dst_cache)) *________p1 = (typeof(*(sk->sk_dst_cache)) *)({ typeof((sk->sk_dst_cache)) _________p1 = ({ union { typeof((sk->sk_dst_cache)) __val; char __c[1]; } __u; if (1) __read_once_size(&((sk->sk_dst_cache)), __u.__c, sizeof((sk->sk_dst_cache))); else __read_once_size_nocheck(&((sk->sk_dst_cache)), __u.__c, sizeof((sk->sk_dst_cache))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(sk->sk_dst_cache)) *)(________p1)); });
|
|
if (dst && !atomic_add_unless((&dst->__refcnt), 1, 0))
|
|
dst = ((void *)0);
|
|
rcu_read_unlock();
|
|
return dst;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void dst_negative_advice(struct sock *sk)
|
|
{
|
|
struct dst_entry *ndst, *dst = __sk_dst_get(sk);
|
|
|
|
sk_rethink_txhash(sk);
|
|
|
|
if (dst && dst->ops->negative_advice) {
|
|
ndst = dst->ops->negative_advice(dst);
|
|
|
|
if (ndst != dst) {
|
|
do { do { bool __cond = !((sizeof(*&sk->sk_dst_cache) == sizeof(char) || sizeof(*&sk->sk_dst_cache) == sizeof(short) || sizeof(*&sk->sk_dst_cache) == sizeof(int) || sizeof(*&sk->sk_dst_cache) == sizeof(long))); extern void __compiletime_assert_1763(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_1763(); do { } while (0); } while (0); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); ({ union { typeof(*&sk->sk_dst_cache) __val; char __c[1]; } __u = { .__val = ( typeof(*&sk->sk_dst_cache)) ((typeof(*(ndst)) *)(ndst)) }; __write_once_size(&(*&sk->sk_dst_cache), __u.__c, sizeof(*&sk->sk_dst_cache)); __u.__val; }); } while (0);
|
|
sk_tx_queue_clear(sk);
|
|
}
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
__sk_dst_set(struct sock *sk, struct dst_entry *dst)
|
|
{
|
|
struct dst_entry *old_dst;
|
|
|
|
sk_tx_queue_clear(sk);
|
|
|
|
|
|
|
|
|
|
old_dst = ({ typeof(*(sk->sk_dst_cache)) *________p1 = (typeof(*(sk->sk_dst_cache)) *)({ typeof((sk->sk_dst_cache)) _________p1 = ({ union { typeof((sk->sk_dst_cache)) __val; char __c[1]; } __u; if (1) __read_once_size(&((sk->sk_dst_cache)), __u.__c, sizeof((sk->sk_dst_cache))); else __read_once_size_nocheck(&((sk->sk_dst_cache)), __u.__c, sizeof((sk->sk_dst_cache))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(sk->sk_dst_cache)) *)(________p1)); });
|
|
do { do { bool __cond = !((sizeof(*&sk->sk_dst_cache) == sizeof(char) || sizeof(*&sk->sk_dst_cache) == sizeof(short) || sizeof(*&sk->sk_dst_cache) == sizeof(int) || sizeof(*&sk->sk_dst_cache) == sizeof(long))); extern void __compiletime_assert_1780(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_1780(); do { } while (0); } while (0); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); ({ union { typeof(*&sk->sk_dst_cache) __val; char __c[1]; } __u = { .__val = ( typeof(*&sk->sk_dst_cache)) ((typeof(*(dst)) *)(dst)) }; __write_once_size(&(*&sk->sk_dst_cache), __u.__c, sizeof(*&sk->sk_dst_cache)); __u.__val; }); } while (0);
|
|
dst_release(old_dst);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
sk_dst_set(struct sock *sk, struct dst_entry *dst)
|
|
{
|
|
struct dst_entry *old_dst;
|
|
|
|
sk_tx_queue_clear(sk);
|
|
old_dst = ({ typeof(({ (__typeof__(*(( struct dst_entry **)&sk->sk_dst_cache)))__xchg((unsigned long)(dst), (( struct dst_entry **)&sk->sk_dst_cache), sizeof(*(( struct dst_entry **)&sk->sk_dst_cache))); })) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = ({ (__typeof__(*(( struct dst_entry **)&sk->sk_dst_cache)))__xchg((unsigned long)(dst), (( struct dst_entry **)&sk->sk_dst_cache), sizeof(*(( struct dst_entry **)&sk->sk_dst_cache))); }); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; });
|
|
dst_release(old_dst);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
__sk_dst_reset(struct sock *sk)
|
|
{
|
|
__sk_dst_set(sk, ((void *)0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
sk_dst_reset(struct sock *sk)
|
|
{
|
|
sk_dst_set(sk, ((void *)0));
|
|
}
|
|
|
|
struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie);
|
|
|
|
struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie);
|
|
|
|
bool sk_mc_loop(struct sock *sk);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sk_can_gso(const struct sock *sk)
|
|
{
|
|
return net_gso_ok(sk->sk_route_caps, sk->sk_gso_type);
|
|
}
|
|
|
|
void sk_setup_caps(struct sock *sk, struct dst_entry *dst);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_nocaps_add(struct sock *sk, netdev_features_t flags)
|
|
{
|
|
sk->sk_route_nocaps |= flags;
|
|
sk->sk_route_caps &= ~flags;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_do_copy_data_nocache(struct sock *sk, struct sk_buff *skb,
|
|
struct iov_iter *from, char *to,
|
|
int copy, int offset)
|
|
{
|
|
if (skb->ip_summed == 0) {
|
|
__wsum csum = 0;
|
|
if (csum_and_copy_from_iter(to, copy, &csum, from) != copy)
|
|
return -14;
|
|
skb->csum = csum_block_add(skb->csum, csum, offset);
|
|
} else if (sk->sk_route_caps & ((netdev_features_t)1 << (NETIF_F_NOCACHE_COPY_BIT))) {
|
|
if (copy_from_iter_nocache(to, copy, from) != copy)
|
|
return -14;
|
|
} else if (copy_from_iter(to, copy, from) != copy)
|
|
return -14;
|
|
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_add_data_nocache(struct sock *sk, struct sk_buff *skb,
|
|
struct iov_iter *from, int copy)
|
|
{
|
|
int err, offset = skb->len;
|
|
|
|
err = skb_do_copy_data_nocache(sk, skb, from, skb_put(skb, copy),
|
|
copy, offset);
|
|
if (err)
|
|
__skb_trim(skb, offset);
|
|
|
|
return err;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int skb_copy_to_page_nocache(struct sock *sk, struct iov_iter *from,
|
|
struct sk_buff *skb,
|
|
struct page *page,
|
|
int off, int copy)
|
|
{
|
|
int err;
|
|
|
|
err = skb_do_copy_data_nocache(sk, skb, from, page_address(page) + off,
|
|
copy, skb->len);
|
|
if (err)
|
|
return err;
|
|
|
|
skb->len += copy;
|
|
skb->data_len += copy;
|
|
skb->truesize += copy;
|
|
sk->sk_wmem_queued += copy;
|
|
sk_mem_charge(sk, copy);
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sk_wmem_alloc_get(const struct sock *sk)
|
|
{
|
|
return ({ union { typeof((&sk->sk_wmem_alloc)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&sk->sk_wmem_alloc)->counter), __u.__c, sizeof((&sk->sk_wmem_alloc)->counter)); else __read_once_size_nocheck(&((&sk->sk_wmem_alloc)->counter), __u.__c, sizeof((&sk->sk_wmem_alloc)->counter)); __u.__val; }) - 1;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sk_rmem_alloc_get(const struct sock *sk)
|
|
{
|
|
return ({ union { typeof((&sk->sk_backlog.rmem_alloc)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&sk->sk_backlog.rmem_alloc)->counter), __u.__c, sizeof((&sk->sk_backlog.rmem_alloc)->counter)); else __read_once_size_nocheck(&((&sk->sk_backlog.rmem_alloc)->counter), __u.__c, sizeof((&sk->sk_backlog.rmem_alloc)->counter)); __u.__val; });
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sk_has_allocations(const struct sock *sk)
|
|
{
|
|
return sk_wmem_alloc_get(sk) || sk_rmem_alloc_get(sk);
|
|
}
|
|
# 1941 "include/net/sock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool wq_has_sleeper(struct socket_wq *wq)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
return wq && waitqueue_active(&wq->wait);
|
|
}
|
|
# 1960 "include/net/sock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sock_poll_wait(struct file *filp,
|
|
wait_queue_head_t *wait_address, poll_table *p)
|
|
{
|
|
if (!poll_does_not_wait(p) && wait_address) {
|
|
poll_wait(filp, wait_address, p);
|
|
|
|
|
|
|
|
|
|
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_set_hash_from_sk(struct sk_buff *skb, struct sock *sk)
|
|
{
|
|
if (sk->sk_txhash) {
|
|
skb->l4_hash = 1;
|
|
skb->hash = sk->sk_txhash;
|
|
}
|
|
}
|
|
|
|
void skb_set_owner_w(struct sk_buff *skb, struct sock *sk);
|
|
# 1992 "include/net/sock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
|
|
{
|
|
skb_orphan(skb);
|
|
skb->sk = sk;
|
|
skb->destructor = sock_rfree;
|
|
atomic_add(skb->truesize, &sk->sk_backlog.rmem_alloc);
|
|
sk_mem_charge(sk, skb->truesize);
|
|
}
|
|
|
|
void sk_reset_timer(struct sock *sk, struct timer_list *timer,
|
|
unsigned long expires);
|
|
|
|
void sk_stop_timer(struct sock *sk, struct timer_list *timer);
|
|
|
|
int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
|
|
|
|
int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb);
|
|
struct sk_buff *sock_dequeue_err_skb(struct sock *sk);
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sock_error(struct sock *sk)
|
|
{
|
|
int err;
|
|
if (__builtin_expect(!!(!sk->sk_err), 1))
|
|
return 0;
|
|
err = ({ typeof(({ (__typeof__(*(&sk->sk_err)))__xchg((unsigned long)(0), (&sk->sk_err), sizeof(*(&sk->sk_err))); })) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = ({ (__typeof__(*(&sk->sk_err)))__xchg((unsigned long)(0), (&sk->sk_err), sizeof(*(&sk->sk_err))); }); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; });
|
|
return -err;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long sock_wspace(struct sock *sk)
|
|
{
|
|
int amt = 0;
|
|
|
|
if (!(sk->sk_shutdown & 2)) {
|
|
amt = sk->sk_sndbuf - ({ union { typeof((&sk->sk_wmem_alloc)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&sk->sk_wmem_alloc)->counter), __u.__c, sizeof((&sk->sk_wmem_alloc)->counter)); else __read_once_size_nocheck(&((&sk->sk_wmem_alloc)->counter), __u.__c, sizeof((&sk->sk_wmem_alloc)->counter)); __u.__val; });
|
|
if (amt < 0)
|
|
amt = 0;
|
|
}
|
|
return amt;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_set_bit(int nr, struct sock *sk)
|
|
{
|
|
_set_bit(nr,&sk->sk_wq_raw->flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_clear_bit(int nr, struct sock *sk)
|
|
{
|
|
_clear_bit(nr,&sk->sk_wq_raw->flags);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_wake_async(const struct sock *sk, int how, int band)
|
|
{
|
|
if (sock_flag(sk, SOCK_FASYNC)) {
|
|
rcu_read_lock();
|
|
sock_wake_async(({ typeof(*(sk->sk_wq)) *________p1 = (typeof(*(sk->sk_wq)) *)({ typeof((sk->sk_wq)) _________p1 = ({ union { typeof((sk->sk_wq)) __val; char __c[1]; } __u; if (1) __read_once_size(&((sk->sk_wq)), __u.__c, sizeof((sk->sk_wq))); else __read_once_size_nocheck(&((sk->sk_wq)), __u.__c, sizeof((sk->sk_wq))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(sk->sk_wq)) *)(________p1)); }), how, band);
|
|
rcu_read_unlock();
|
|
}
|
|
}
|
|
# 2069 "include/net/sock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_stream_moderate_sndbuf(struct sock *sk)
|
|
{
|
|
if (!(sk->sk_userlocks & 1)) {
|
|
sk->sk_sndbuf = ({ typeof(sk->sk_sndbuf) _min1 = (sk->sk_sndbuf); typeof(sk->sk_wmem_queued >> 1) _min2 = (sk->sk_wmem_queued >> 1); (void) (&_min1 == &_min2); _min1 < _min2 ? _min1 : _min2; });
|
|
sk->sk_sndbuf = ({ u32 __max1 = (sk->sk_sndbuf); u32 __max2 = (((2048 + ((((sizeof(struct sk_buff))) + ((typeof((sizeof(struct sk_buff))))(((1 << 6))) - 1)) & ~((typeof((sizeof(struct sk_buff))))(((1 << 6))) - 1))) * 2)); __max1 > __max2 ? __max1: __max2; });
|
|
}
|
|
}
|
|
|
|
struct sk_buff *sk_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp,
|
|
bool force_schedule);
|
|
# 2087 "include/net/sock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct page_frag *sk_page_frag(struct sock *sk)
|
|
{
|
|
if (gfpflags_allow_blocking(sk->sk_allocation))
|
|
return &(current_thread_info()->task)->task_frag;
|
|
|
|
return &sk->sk_frag;
|
|
}
|
|
|
|
bool sk_page_frag_refill(struct sock *sk, struct page_frag *pfrag);
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sock_writeable(const struct sock *sk)
|
|
{
|
|
return ({ union { typeof((&sk->sk_wmem_alloc)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&sk->sk_wmem_alloc)->counter), __u.__c, sizeof((&sk->sk_wmem_alloc)->counter)); else __read_once_size_nocheck(&((&sk->sk_wmem_alloc)->counter), __u.__c, sizeof((&sk->sk_wmem_alloc)->counter)); __u.__val; }) < (sk->sk_sndbuf >> 1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) gfp_t gfp_any(void)
|
|
{
|
|
return ((preempt_count() & (((1UL << (8))-1) << (0 + 8)))) ? ((( gfp_t)0x20u)|(( gfp_t)0x80000u)|(( gfp_t)0x2000000u)) : ((( gfp_t)(0x400000u|0x2000000u)) | (( gfp_t)0x40u) | (( gfp_t)0x80u));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long sock_rcvtimeo(const struct sock *sk, bool noblock)
|
|
{
|
|
return noblock ? 0 : sk->sk_rcvtimeo;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) long sock_sndtimeo(const struct sock *sk, bool noblock)
|
|
{
|
|
return noblock ? 0 : sk->sk_sndtimeo;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sock_rcvlowat(const struct sock *sk, int waitall, int len)
|
|
{
|
|
return (waitall ? len : ({ int __min1 = (sk->sk_rcvlowat); int __min2 = (len); __min1 < __min2 ? __min1: __min2; })) ? : 1;
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sock_intr_errno(long timeo)
|
|
{
|
|
return timeo == ((long)(~0UL>>1)) ? -512 : -4;
|
|
}
|
|
|
|
struct sock_skb_cb {
|
|
u32 dropcount;
|
|
};
|
|
# 2150 "include/net/sock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
sock_skb_set_dropcount(const struct sock *sk, struct sk_buff *skb)
|
|
{
|
|
((struct sock_skb_cb *)((skb)->cb + (((sizeof(((struct sk_buff*)0)->cb)) - sizeof(struct sock_skb_cb)))))->dropcount = ({ union { typeof((&sk->sk_drops)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&sk->sk_drops)->counter), __u.__c, sizeof((&sk->sk_drops)->counter)); else __read_once_size_nocheck(&((&sk->sk_drops)->counter), __u.__c, sizeof((&sk->sk_drops)->counter)); __u.__val; });
|
|
}
|
|
|
|
void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk,
|
|
struct sk_buff *skb);
|
|
void __sock_recv_wifi_status(struct msghdr *msg, struct sock *sk,
|
|
struct sk_buff *skb);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void
|
|
sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb)
|
|
{
|
|
ktime_t kt = skb->tstamp;
|
|
struct skb_shared_hwtstamps *hwtstamps = skb_hwtstamps(skb);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (sock_flag(sk, SOCK_RCVTSTAMP) ||
|
|
(sk->sk_tsflags & SOF_TIMESTAMPING_RX_SOFTWARE) ||
|
|
(kt.tv64 && sk->sk_tsflags & SOF_TIMESTAMPING_SOFTWARE) ||
|
|
(hwtstamps->hwtstamp.tv64 &&
|
|
(sk->sk_tsflags & SOF_TIMESTAMPING_RAW_HARDWARE)))
|
|
__sock_recv_timestamp(msg, sk, skb);
|
|
else
|
|
sk->sk_stamp = kt;
|
|
|
|
if (sock_flag(sk, SOCK_WIFI_STATUS) && skb->wifi_acked_valid)
|
|
__sock_recv_wifi_status(msg, sk, skb);
|
|
}
|
|
|
|
void __sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,
|
|
struct sk_buff *skb);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,
|
|
struct sk_buff *skb)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
if (sk->__sk_common.skc_flags & ((1UL << SOCK_RXQ_OVFL) | (1UL << SOCK_RCVTSTAMP)) || sk->sk_tsflags & (SOF_TIMESTAMPING_SOFTWARE | SOF_TIMESTAMPING_RAW_HARDWARE))
|
|
__sock_recv_ts_and_drops(msg, sk, skb);
|
|
else
|
|
sk->sk_stamp = skb->tstamp;
|
|
}
|
|
|
|
void __sock_tx_timestamp(const struct sock *sk, __u8 *tx_flags);
|
|
# 2212 "include/net/sock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sock_tx_timestamp(const struct sock *sk, __u8 *tx_flags)
|
|
{
|
|
if (__builtin_expect(!!(sk->sk_tsflags), 0))
|
|
__sock_tx_timestamp(sk, tx_flags);
|
|
if (__builtin_expect(!!(sock_flag(sk, SOCK_WIFI_STATUS)), 0))
|
|
*tx_flags |= SKBTX_WIFI_STATUS;
|
|
}
|
|
# 2228 "include/net/sock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_eat_skb(struct sock *sk, struct sk_buff *skb)
|
|
{
|
|
__skb_unlink(skb, &sk->sk_receive_queue);
|
|
__kfree_skb(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
struct net *sock_net(const struct sock *sk)
|
|
{
|
|
return read_pnet(&sk->__sk_common.skc_net);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
void sock_net_set(struct sock *sk, struct net *net)
|
|
{
|
|
write_pnet(&sk->__sk_common.skc_net, net);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sock *skb_steal_sock(struct sk_buff *skb)
|
|
{
|
|
if (skb->sk) {
|
|
struct sock *sk = skb->sk;
|
|
|
|
skb->destructor = ((void *)0);
|
|
skb->sk = ((void *)0);
|
|
return sk;
|
|
}
|
|
return ((void *)0);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sk_fullsock(const struct sock *sk)
|
|
{
|
|
return (1 << sk->__sk_common.skc_state) & ~(TCPF_TIME_WAIT | TCPF_NEW_SYN_RECV);
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sk_listener(const struct sock *sk)
|
|
{
|
|
return (1 << sk->__sk_common.skc_state) & (TCPF_LISTEN | TCPF_NEW_SYN_RECV);
|
|
}
|
|
# 2281 "include/net/sock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int sk_state_load(const struct sock *sk)
|
|
{
|
|
return ({ typeof(*&sk->__sk_common.skc_state) ___p1 = ({ union { typeof(*&sk->__sk_common.skc_state) __val; char __c[1]; } __u; if (1) __read_once_size(&(*&sk->__sk_common.skc_state), __u.__c, sizeof(*&sk->__sk_common.skc_state)); else __read_once_size_nocheck(&(*&sk->__sk_common.skc_state), __u.__c, sizeof(*&sk->__sk_common.skc_state)); __u.__val; }); do { bool __cond = !((sizeof(*&sk->__sk_common.skc_state) == sizeof(char) || sizeof(*&sk->__sk_common.skc_state) == sizeof(short) || sizeof(*&sk->__sk_common.skc_state) == sizeof(int) || sizeof(*&sk->__sk_common.skc_state) == sizeof(long))); extern void __compiletime_assert_2283(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_2283(); do { } while (0); } while (0); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); ___p1; });
|
|
}
|
|
# 2294 "include/net/sock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void sk_state_store(struct sock *sk, int newstate)
|
|
{
|
|
do { do { bool __cond = !((sizeof(*&sk->__sk_common.skc_state) == sizeof(char) || sizeof(*&sk->__sk_common.skc_state) == sizeof(short) || sizeof(*&sk->__sk_common.skc_state) == sizeof(int) || sizeof(*&sk->__sk_common.skc_state) == sizeof(long))); extern void __compiletime_assert_2296(void) __attribute__((error("Need native word sized stores/loads for atomicity."))); if (__cond) __compiletime_assert_2296(); do { } while (0); } while (0); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); ({ union { typeof(*&sk->__sk_common.skc_state) __val; char __c[1]; } __u = { .__val = ( typeof(*&sk->__sk_common.skc_state)) (newstate) }; __write_once_size(&(*&sk->__sk_common.skc_state), __u.__c, sizeof(*&sk->__sk_common.skc_state)); __u.__val; }); } while (0);
|
|
}
|
|
|
|
void sock_enable_timestamp(struct sock *sk, int flag);
|
|
int sock_get_timestamp(struct sock *, struct timeval *);
|
|
int sock_get_timestampns(struct sock *, struct timespec *);
|
|
int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len, int level,
|
|
int type);
|
|
|
|
bool sk_ns_capable(const struct sock *sk,
|
|
struct user_namespace *user_ns, int cap);
|
|
bool sk_capable(const struct sock *sk, int cap);
|
|
bool sk_net_capable(const struct sock *sk, int cap);
|
|
|
|
extern __u32 sysctl_wmem_max;
|
|
extern __u32 sysctl_rmem_max;
|
|
|
|
extern int sysctl_tstamp_allow_data;
|
|
extern int sysctl_optmem_max;
|
|
|
|
extern __u32 sysctl_wmem_default;
|
|
extern __u32 sysctl_rmem_default;
|
|
# 23 "include/linux/tcp.h" 2
|
|
# 1 "include/net/inet_connection_sock.h" 1
|
|
# 23 "include/net/inet_connection_sock.h"
|
|
# 1 "include/net/inet_sock.h" 1
|
|
# 23 "include/net/inet_sock.h"
|
|
# 1 "include/linux/jhash.h" 1
|
|
# 27 "include/linux/jhash.h"
|
|
# 1 "include/linux/unaligned/packed_struct.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
struct __una_u16 { u16 x; } __attribute__((packed));
|
|
struct __una_u32 { u32 x; } __attribute__((packed));
|
|
struct __una_u64 { u64 x; } __attribute__((packed));
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u16 __get_unaligned_cpu16(const void *p)
|
|
{
|
|
const struct __una_u16 *ptr = (const struct __una_u16 *)p;
|
|
return ptr->x;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 __get_unaligned_cpu32(const void *p)
|
|
{
|
|
const struct __una_u32 *ptr = (const struct __una_u32 *)p;
|
|
return ptr->x;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 __get_unaligned_cpu64(const void *p)
|
|
{
|
|
const struct __una_u64 *ptr = (const struct __una_u64 *)p;
|
|
return ptr->x;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __put_unaligned_cpu16(u16 val, void *p)
|
|
{
|
|
struct __una_u16 *ptr = (struct __una_u16 *)p;
|
|
ptr->x = val;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __put_unaligned_cpu32(u32 val, void *p)
|
|
{
|
|
struct __una_u32 *ptr = (struct __una_u32 *)p;
|
|
ptr->x = val;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __put_unaligned_cpu64(u64 val, void *p)
|
|
{
|
|
struct __una_u64 *ptr = (struct __una_u64 *)p;
|
|
ptr->x = val;
|
|
}
|
|
# 28 "include/linux/jhash.h" 2
|
|
# 70 "include/linux/jhash.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 jhash(const void *key, u32 length, u32 initval)
|
|
{
|
|
u32 a, b, c;
|
|
const u8 *k = key;
|
|
|
|
|
|
a = b = c = 0xdeadbeef + length + initval;
|
|
|
|
|
|
while (length > 12) {
|
|
a += __get_unaligned_cpu32(k);
|
|
b += __get_unaligned_cpu32(k + 4);
|
|
c += __get_unaligned_cpu32(k + 8);
|
|
{ a -= c; a ^= rol32(c, 4); c += b; b -= a; b ^= rol32(a, 6); a += c; c -= b; c ^= rol32(b, 8); b += a; a -= c; a ^= rol32(c, 16); c += b; b -= a; b ^= rol32(a, 19); a += c; c -= b; c ^= rol32(b, 4); b += a; };
|
|
length -= 12;
|
|
k += 12;
|
|
}
|
|
|
|
|
|
switch (length) {
|
|
case 12: c += (u32)k[11]<<24;
|
|
case 11: c += (u32)k[10]<<16;
|
|
case 10: c += (u32)k[9]<<8;
|
|
case 9: c += k[8];
|
|
case 8: b += (u32)k[7]<<24;
|
|
case 7: b += (u32)k[6]<<16;
|
|
case 6: b += (u32)k[5]<<8;
|
|
case 5: b += k[4];
|
|
case 4: a += (u32)k[3]<<24;
|
|
case 3: a += (u32)k[2]<<16;
|
|
case 2: a += (u32)k[1]<<8;
|
|
case 1: a += k[0];
|
|
{ c ^= b; c -= rol32(b, 14); a ^= c; a -= rol32(c, 11); b ^= a; b -= rol32(a, 25); c ^= b; c -= rol32(b, 16); a ^= c; a -= rol32(c, 4); b ^= a; b -= rol32(a, 14); c ^= b; c -= rol32(b, 24); };
|
|
case 0:
|
|
break;
|
|
}
|
|
|
|
return c;
|
|
}
|
|
# 117 "include/linux/jhash.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 jhash2(const u32 *k, u32 length, u32 initval)
|
|
{
|
|
u32 a, b, c;
|
|
|
|
|
|
a = b = c = 0xdeadbeef + (length<<2) + initval;
|
|
|
|
|
|
while (length > 3) {
|
|
a += k[0];
|
|
b += k[1];
|
|
c += k[2];
|
|
{ a -= c; a ^= rol32(c, 4); c += b; b -= a; b ^= rol32(a, 6); a += c; c -= b; c ^= rol32(b, 8); b += a; a -= c; a ^= rol32(c, 16); c += b; b -= a; b ^= rol32(a, 19); a += c; c -= b; c ^= rol32(b, 4); b += a; };
|
|
length -= 3;
|
|
k += 3;
|
|
}
|
|
|
|
|
|
switch (length) {
|
|
case 3: c += k[2];
|
|
case 2: b += k[1];
|
|
case 1: a += k[0];
|
|
{ c ^= b; c -= rol32(b, 14); a ^= c; a -= rol32(c, 11); b ^= a; b -= rol32(a, 25); c ^= b; c -= rol32(b, 16); a ^= c; a -= rol32(c, 4); b ^= a; b -= rol32(a, 14); c ^= b; c -= rol32(b, 24); };
|
|
case 0:
|
|
break;
|
|
}
|
|
|
|
return c;
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 __jhash_nwords(u32 a, u32 b, u32 c, u32 initval)
|
|
{
|
|
a += initval;
|
|
b += initval;
|
|
c += initval;
|
|
|
|
{ c ^= b; c -= rol32(b, 14); a ^= c; a -= rol32(c, 11); b ^= a; b -= rol32(a, 25); c ^= b; c -= rol32(b, 16); a ^= c; a -= rol32(c, 4); b ^= a; b -= rol32(a, 14); c ^= b; c -= rol32(b, 24); };
|
|
|
|
return c;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 jhash_3words(u32 a, u32 b, u32 c, u32 initval)
|
|
{
|
|
return __jhash_nwords(a, b, c, initval + 0xdeadbeef + (3 << 2));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 jhash_2words(u32 a, u32 b, u32 initval)
|
|
{
|
|
return __jhash_nwords(a, b, 0, initval + 0xdeadbeef + (2 << 2));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 jhash_1word(u32 a, u32 initval)
|
|
{
|
|
return __jhash_nwords(a, 0, 0, initval + 0xdeadbeef + (1 << 2));
|
|
}
|
|
# 24 "include/net/inet_sock.h" 2
|
|
|
|
|
|
|
|
|
|
# 1 "include/net/request_sock.h" 1
|
|
# 25 "include/net/request_sock.h"
|
|
struct request_sock;
|
|
struct sk_buff;
|
|
struct dst_entry;
|
|
struct proto;
|
|
|
|
struct request_sock_ops {
|
|
int family;
|
|
int obj_size;
|
|
struct kmem_cache *slab;
|
|
char *slab_name;
|
|
int (*rtx_syn_ack)(const struct sock *sk,
|
|
struct request_sock *req);
|
|
void (*send_ack)(const struct sock *sk, struct sk_buff *skb,
|
|
struct request_sock *req);
|
|
void (*send_reset)(const struct sock *sk,
|
|
struct sk_buff *skb);
|
|
void (*destructor)(struct request_sock *req);
|
|
void (*syn_ack_timeout)(const struct request_sock *req);
|
|
};
|
|
|
|
int inet_rtx_syn_ack(const struct sock *parent, struct request_sock *req);
|
|
|
|
|
|
|
|
struct request_sock {
|
|
struct sock_common __req_common;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct request_sock *dl_next;
|
|
u16 mss;
|
|
u8 num_retrans;
|
|
u8 cookie_ts:1;
|
|
u8 num_timeout:7;
|
|
u32 ts_recent;
|
|
struct timer_list rsk_timer;
|
|
const struct request_sock_ops *rsk_ops;
|
|
struct sock *sk;
|
|
u32 *saved_syn;
|
|
u32 secid;
|
|
u32 peer_secid;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct request_sock *inet_reqsk(struct sock *sk)
|
|
{
|
|
return (struct request_sock *)sk;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sock *req_to_sk(struct request_sock *req)
|
|
{
|
|
return (struct sock *)req;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct request_sock *
|
|
reqsk_alloc(const struct request_sock_ops *ops, struct sock *sk_listener,
|
|
bool attach_listener)
|
|
{
|
|
struct request_sock *req;
|
|
|
|
req = kmem_cache_alloc(ops->slab, ((( gfp_t)0x20u)|(( gfp_t)0x80000u)|(( gfp_t)0x2000000u)) | (( gfp_t)0x200u));
|
|
|
|
if (req) {
|
|
req->rsk_ops = ops;
|
|
if (attach_listener) {
|
|
sock_hold(sk_listener);
|
|
req->__req_common.skc_listener = sk_listener;
|
|
} else {
|
|
req->__req_common.skc_listener = ((void *)0);
|
|
}
|
|
req_to_sk(req)->__sk_common.skc_prot = sk_listener->__sk_common.skc_prot;
|
|
sk_node_init(&req_to_sk(req)->__sk_common.skc_node);
|
|
sk_tx_queue_clear(req_to_sk(req));
|
|
req->saved_syn = ((void *)0);
|
|
|
|
|
|
|
|
({ union { typeof(((&req->__req_common.skc_refcnt)->counter)) __val; char __c[1]; } __u = { .__val = ( typeof(((&req->__req_common.skc_refcnt)->counter))) ((0)) }; __write_once_size(&(((&req->__req_common.skc_refcnt)->counter)), __u.__c, sizeof(((&req->__req_common.skc_refcnt)->counter))); __u.__val; });
|
|
}
|
|
return req;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void reqsk_free(struct request_sock *req)
|
|
{
|
|
|
|
({ static bool __attribute__ ((__section__(".data.unlikely"))) __warned; int __ret_warn_once = !!(({ union { typeof((&req->__req_common.skc_refcnt)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&req->__req_common.skc_refcnt)->counter), __u.__c, sizeof((&req->__req_common.skc_refcnt)->counter)); else __read_once_size_nocheck(&((&req->__req_common.skc_refcnt)->counter), __u.__c, sizeof((&req->__req_common.skc_refcnt)->counter)); __u.__val; }) != 0); if (__builtin_expect(!!(__ret_warn_once), 0)) if (({ int __ret_warn_on = !!(!__warned); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/net/request_sock.h", 112); __builtin_expect(!!(__ret_warn_on), 0); })) __warned = true; __builtin_expect(!!(__ret_warn_once), 0); });
|
|
|
|
req->rsk_ops->destructor(req);
|
|
if (req->__req_common.skc_listener)
|
|
sock_put(req->__req_common.skc_listener);
|
|
kfree(req->saved_syn);
|
|
kmem_cache_free(req->rsk_ops->slab, req);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void reqsk_put(struct request_sock *req)
|
|
{
|
|
if ((({ typeof(atomic_sub_return_relaxed(1, &req->__req_common.skc_refcnt)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_sub_return_relaxed(1, &req->__req_common.skc_refcnt); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) == 0))
|
|
reqsk_free(req);
|
|
}
|
|
|
|
extern int sysctl_max_syn_backlog;
|
|
# 146 "include/net/request_sock.h"
|
|
struct fastopen_queue {
|
|
struct request_sock *rskq_rst_head;
|
|
struct request_sock *rskq_rst_tail;
|
|
|
|
|
|
|
|
spinlock_t lock;
|
|
int qlen;
|
|
int max_qlen;
|
|
};
|
|
# 164 "include/net/request_sock.h"
|
|
struct request_sock_queue {
|
|
spinlock_t rskq_lock;
|
|
u8 rskq_defer_accept;
|
|
|
|
u32 synflood_warned;
|
|
atomic_t qlen;
|
|
atomic_t young;
|
|
|
|
struct request_sock *rskq_accept_head;
|
|
struct request_sock *rskq_accept_tail;
|
|
struct fastopen_queue fastopenq;
|
|
|
|
|
|
};
|
|
|
|
void reqsk_queue_alloc(struct request_sock_queue *queue);
|
|
|
|
void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req,
|
|
bool reset);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool reqsk_queue_empty(const struct request_sock_queue *queue)
|
|
{
|
|
return queue->rskq_accept_head == ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct request_sock *reqsk_queue_remove(struct request_sock_queue *queue,
|
|
struct sock *parent)
|
|
{
|
|
struct request_sock *req;
|
|
|
|
spin_lock_bh(&queue->rskq_lock);
|
|
req = queue->rskq_accept_head;
|
|
if (req) {
|
|
sk_acceptq_removed(parent);
|
|
queue->rskq_accept_head = req->dl_next;
|
|
if (queue->rskq_accept_head == ((void *)0))
|
|
queue->rskq_accept_tail = ((void *)0);
|
|
}
|
|
spin_unlock_bh(&queue->rskq_lock);
|
|
return req;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void reqsk_queue_removed(struct request_sock_queue *queue,
|
|
const struct request_sock *req)
|
|
{
|
|
if (req->num_timeout == 0)
|
|
atomic_sub(1, &queue->young);
|
|
atomic_sub(1, &queue->qlen);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void reqsk_queue_added(struct request_sock_queue *queue)
|
|
{
|
|
atomic_add(1, &queue->young);
|
|
atomic_add(1, &queue->qlen);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int reqsk_queue_len(const struct request_sock_queue *queue)
|
|
{
|
|
return ({ union { typeof((&queue->qlen)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&queue->qlen)->counter), __u.__c, sizeof((&queue->qlen)->counter)); else __read_once_size_nocheck(&((&queue->qlen)->counter), __u.__c, sizeof((&queue->qlen)->counter)); __u.__val; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int reqsk_queue_len_young(const struct request_sock_queue *queue)
|
|
{
|
|
return ({ union { typeof((&queue->young)->counter) __val; char __c[1]; } __u; if (1) __read_once_size(&((&queue->young)->counter), __u.__c, sizeof((&queue->young)->counter)); else __read_once_size_nocheck(&((&queue->young)->counter), __u.__c, sizeof((&queue->young)->counter)); __u.__val; });
|
|
}
|
|
# 29 "include/net/inet_sock.h" 2
|
|
# 1 "include/net/netns/hash.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
struct net;
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 net_hash_mix(const struct net *net)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (u32)(((unsigned long)net) >> 6);
|
|
|
|
|
|
|
|
}
|
|
# 30 "include/net/inet_sock.h" 2
|
|
# 43 "include/net/inet_sock.h"
|
|
struct ip_options {
|
|
__be32 faddr;
|
|
__be32 nexthop;
|
|
unsigned char optlen;
|
|
unsigned char srr;
|
|
unsigned char rr;
|
|
unsigned char ts;
|
|
unsigned char is_strictroute:1,
|
|
srr_is_hit:1,
|
|
is_changed:1,
|
|
rr_needaddr:1,
|
|
ts_needtime:1,
|
|
ts_needaddr:1;
|
|
unsigned char router_alert;
|
|
unsigned char cipso;
|
|
unsigned char __pad2;
|
|
unsigned char __data[0];
|
|
};
|
|
|
|
struct ip_options_rcu {
|
|
struct callback_head rcu;
|
|
struct ip_options opt;
|
|
};
|
|
|
|
struct ip_options_data {
|
|
struct ip_options_rcu opt;
|
|
char data[40];
|
|
};
|
|
|
|
struct inet_request_sock {
|
|
struct request_sock req;
|
|
# 86 "include/net/inet_sock.h"
|
|
;
|
|
u16 snd_wscale : 4,
|
|
rcv_wscale : 4,
|
|
tstamp_ok : 1,
|
|
sack_ok : 1,
|
|
wscale_ok : 1,
|
|
ecn_ok : 1,
|
|
acked : 1,
|
|
no_srccheck: 1;
|
|
;
|
|
u32 ir_mark;
|
|
union {
|
|
struct ip_options_rcu *ireq_opt;
|
|
struct sk_buff *pktopts;
|
|
};
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct inet_request_sock *inet_rsk(const struct request_sock *sk)
|
|
{
|
|
return (struct inet_request_sock *)sk;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 inet_request_mark(const struct sock *sk, struct sk_buff *skb)
|
|
{
|
|
if (!sk->sk_mark && sock_net(sk)->ipv4.sysctl_tcp_fwmark_accept)
|
|
return skb->mark;
|
|
|
|
return sk->sk_mark;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct ip_options_rcu *ireq_opt_deref(const struct inet_request_sock *ireq)
|
|
{
|
|
return ({ typeof(*(ireq->ireq_opt)) *________p1 = (typeof(*(ireq->ireq_opt)) *)({ typeof((ireq->ireq_opt)) _________p1 = ({ union { typeof((ireq->ireq_opt)) __val; char __c[1]; } __u; if (1) __read_once_size(&((ireq->ireq_opt)), __u.__c, sizeof((ireq->ireq_opt))); else __read_once_size_nocheck(&((ireq->ireq_opt)), __u.__c, sizeof((ireq->ireq_opt))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(ireq->ireq_opt)) *)(________p1)); })
|
|
;
|
|
}
|
|
|
|
struct inet_cork {
|
|
unsigned int flags;
|
|
__be32 addr;
|
|
struct ip_options *opt;
|
|
unsigned int fragsize;
|
|
int length;
|
|
struct dst_entry *dst;
|
|
u8 tx_flags;
|
|
__u8 ttl;
|
|
__s16 tos;
|
|
char priority;
|
|
};
|
|
|
|
struct inet_cork_full {
|
|
struct inet_cork base;
|
|
struct flowi fl;
|
|
};
|
|
|
|
struct ip_mc_socklist;
|
|
struct ipv6_pinfo;
|
|
struct rtable;
|
|
# 164 "include/net/inet_sock.h"
|
|
struct inet_sock {
|
|
|
|
struct sock sk;
|
|
|
|
struct ipv6_pinfo *pinet6;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__be32 inet_saddr;
|
|
__s16 uc_ttl;
|
|
__u16 cmsg_flags;
|
|
__be16 inet_sport;
|
|
__u16 inet_id;
|
|
|
|
struct ip_options_rcu *inet_opt;
|
|
int rx_dst_ifindex;
|
|
__u8 tos;
|
|
__u8 min_ttl;
|
|
__u8 mc_ttl;
|
|
__u8 pmtudisc;
|
|
__u8 recverr:1,
|
|
is_icsk:1,
|
|
freebind:1,
|
|
hdrincl:1,
|
|
mc_loop:1,
|
|
transparent:1,
|
|
mc_all:1,
|
|
nodefrag:1;
|
|
__u8 bind_address_no_port:1;
|
|
__u8 rcv_tos;
|
|
__u8 convert_csum;
|
|
int uc_index;
|
|
int mc_index;
|
|
__be32 mc_addr;
|
|
struct ip_mc_socklist *mc_list;
|
|
struct inet_cork_full cork;
|
|
};
|
|
# 226 "include/net/inet_sock.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sock *sk_to_full_sk(struct sock *sk)
|
|
{
|
|
|
|
if (sk && sk->__sk_common.skc_state == TCP_NEW_SYN_RECV)
|
|
sk = inet_reqsk(sk)->__req_common.skc_listener;
|
|
|
|
return sk;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const struct sock *sk_const_to_full_sk(const struct sock *sk)
|
|
{
|
|
|
|
if (sk && sk->__sk_common.skc_state == TCP_NEW_SYN_RECV)
|
|
sk = ((const struct request_sock *)sk)->__req_common.skc_listener;
|
|
|
|
return sk;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sock *skb_to_full_sk(const struct sk_buff *skb)
|
|
{
|
|
return sk_to_full_sk(skb->sk);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct inet_sock *inet_sk(const struct sock *sk)
|
|
{
|
|
return (struct inet_sock *)sk;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __inet_sk_copy_descendant(struct sock *sk_to,
|
|
const struct sock *sk_from,
|
|
const int ancestor_size)
|
|
{
|
|
memcpy(inet_sk(sk_to) + 1, inet_sk(sk_from) + 1,
|
|
sk_from->__sk_common.skc_prot->obj_size - ancestor_size);
|
|
}
|
|
# 270 "include/net/inet_sock.h"
|
|
int inet_sk_rebuild_header(struct sock *sk);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int __inet_ehashfn(const __be32 laddr,
|
|
const __u16 lport,
|
|
const __be32 faddr,
|
|
const __be16 fport,
|
|
u32 initval)
|
|
{
|
|
return jhash_3words(( __u32) laddr,
|
|
( __u32) faddr,
|
|
((__u32) lport) << 16 | ( __u32)fport,
|
|
initval);
|
|
}
|
|
|
|
struct request_sock *inet_reqsk_alloc(const struct request_sock_ops *ops,
|
|
struct sock *sk_listener,
|
|
bool attach_listener);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u8 inet_sk_flowi_flags(const struct sock *sk)
|
|
{
|
|
__u8 flags = 0;
|
|
|
|
if (inet_sk(sk)->transparent || inet_sk(sk)->hdrincl)
|
|
flags |= 0x01;
|
|
return flags;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inet_inc_convert_csum(struct sock *sk)
|
|
{
|
|
inet_sk(sk)->convert_csum++;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inet_dec_convert_csum(struct sock *sk)
|
|
{
|
|
if (inet_sk(sk)->convert_csum > 0)
|
|
inet_sk(sk)->convert_csum--;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool inet_get_convert_csum(struct sock *sk)
|
|
{
|
|
return !!inet_sk(sk)->convert_csum;
|
|
}
|
|
# 24 "include/net/inet_connection_sock.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct inet_bind_bucket;
|
|
struct tcp_congestion_ops;
|
|
|
|
|
|
|
|
|
|
|
|
struct inet_connection_sock_af_ops {
|
|
int (*queue_xmit)(struct sock *sk, struct sk_buff *skb, struct flowi *fl);
|
|
void (*send_check)(struct sock *sk, struct sk_buff *skb);
|
|
int (*rebuild_header)(struct sock *sk);
|
|
void (*sk_rx_dst_set)(struct sock *sk, const struct sk_buff *skb);
|
|
int (*conn_request)(struct sock *sk, struct sk_buff *skb);
|
|
struct sock *(*syn_recv_sock)(const struct sock *sk, struct sk_buff *skb,
|
|
struct request_sock *req,
|
|
struct dst_entry *dst,
|
|
struct request_sock *req_unhash,
|
|
bool *own_req);
|
|
u16 net_header_len;
|
|
u16 net_frag_header_len;
|
|
u16 sockaddr_len;
|
|
int (*setsockopt)(struct sock *sk, int level, int optname,
|
|
char *optval, unsigned int optlen);
|
|
int (*getsockopt)(struct sock *sk, int level, int optname,
|
|
char *optval, int *optlen);
|
|
# 64 "include/net/inet_connection_sock.h"
|
|
void (*addr2sockaddr)(struct sock *sk, struct sockaddr *);
|
|
int (*bind_conflict)(const struct sock *sk,
|
|
const struct inet_bind_bucket *tb, bool relax);
|
|
void (*mtu_reduced)(struct sock *sk);
|
|
};
|
|
# 90 "include/net/inet_connection_sock.h"
|
|
struct inet_connection_sock {
|
|
|
|
struct inet_sock icsk_inet;
|
|
struct request_sock_queue icsk_accept_queue;
|
|
struct inet_bind_bucket *icsk_bind_hash;
|
|
unsigned long icsk_timeout;
|
|
struct timer_list icsk_retransmit_timer;
|
|
struct timer_list icsk_delack_timer;
|
|
__u32 icsk_rto;
|
|
__u32 icsk_pmtu_cookie;
|
|
const struct tcp_congestion_ops *icsk_ca_ops;
|
|
const struct inet_connection_sock_af_ops *icsk_af_ops;
|
|
unsigned int (*icsk_sync_mss)(struct sock *sk, u32 pmtu);
|
|
__u8 icsk_ca_state:6,
|
|
icsk_ca_setsockopt:1,
|
|
icsk_ca_dst_locked:1;
|
|
__u8 icsk_retransmits;
|
|
__u8 icsk_pending;
|
|
__u8 icsk_backoff;
|
|
__u8 icsk_syn_retries;
|
|
__u8 icsk_probes_out;
|
|
__u16 icsk_ext_hdr_len;
|
|
struct {
|
|
__u8 pending;
|
|
__u8 quick;
|
|
__u8 pingpong;
|
|
__u8 blocked;
|
|
__u32 ato;
|
|
unsigned long timeout;
|
|
__u32 lrcvtime;
|
|
__u16 last_seg_size;
|
|
__u16 rcv_mss;
|
|
} icsk_ack;
|
|
struct {
|
|
int enabled;
|
|
|
|
|
|
int search_high;
|
|
int search_low;
|
|
|
|
|
|
int probe_size;
|
|
|
|
u32 probe_timestamp;
|
|
} icsk_mtup;
|
|
u32 icsk_user_timeout;
|
|
|
|
u64 icsk_ca_priv[64 / sizeof(u64)];
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct inet_connection_sock *inet_csk(const struct sock *sk)
|
|
{
|
|
return (struct inet_connection_sock *)sk;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *inet_csk_ca(const struct sock *sk)
|
|
{
|
|
return (void *)inet_csk(sk)->icsk_ca_priv;
|
|
}
|
|
|
|
struct sock *inet_csk_clone_lock(const struct sock *sk,
|
|
const struct request_sock *req,
|
|
const gfp_t priority);
|
|
|
|
enum inet_csk_ack_state_t {
|
|
ICSK_ACK_SCHED = 1,
|
|
ICSK_ACK_TIMER = 2,
|
|
ICSK_ACK_PUSHED = 4,
|
|
ICSK_ACK_PUSHED2 = 8
|
|
};
|
|
|
|
void inet_csk_init_xmit_timers(struct sock *sk,
|
|
void (*retransmit_handler)(unsigned long),
|
|
void (*delack_handler)(unsigned long),
|
|
void (*keepalive_handler)(unsigned long));
|
|
void inet_csk_clear_xmit_timers(struct sock *sk);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inet_csk_schedule_ack(struct sock *sk)
|
|
{
|
|
inet_csk(sk)->icsk_ack.pending |= ICSK_ACK_SCHED;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int inet_csk_ack_scheduled(const struct sock *sk)
|
|
{
|
|
return inet_csk(sk)->icsk_ack.pending & ICSK_ACK_SCHED;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inet_csk_delack_init(struct sock *sk)
|
|
{
|
|
({ void *__p = (&inet_csk(sk)->icsk_ack); size_t __n = sizeof(inet_csk(sk)->icsk_ack); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); });
|
|
}
|
|
|
|
void inet_csk_delete_keepalive_timer(struct sock *sk);
|
|
void inet_csk_reset_keepalive_timer(struct sock *sk, unsigned long timeout);
|
|
|
|
|
|
extern const char inet_csk_timer_bug_msg[];
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inet_csk_clear_xmit_timer(struct sock *sk, const int what)
|
|
{
|
|
struct inet_connection_sock *icsk = inet_csk(sk);
|
|
|
|
if (what == 1 || what == 3) {
|
|
icsk->icsk_pending = 0;
|
|
|
|
|
|
|
|
} else if (what == 2) {
|
|
icsk->icsk_ack.blocked = icsk->icsk_ack.pending = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
else {
|
|
no_printk("\001" "7" "%s", inet_csk_timer_bug_msg);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inet_csk_reset_xmit_timer(struct sock *sk, const int what,
|
|
unsigned long when,
|
|
const unsigned long max_when)
|
|
{
|
|
struct inet_connection_sock *icsk = inet_csk(sk);
|
|
|
|
if (when > max_when) {
|
|
|
|
no_printk("\001" "7" "reset_xmit_timer: sk=%p %d when=0x%lx, caller=%p\n", sk, what, when, ({ __label__ _l; _l: &&_l;}))
|
|
;
|
|
|
|
when = max_when;
|
|
}
|
|
|
|
if (what == 1 || what == 3 ||
|
|
what == 4 || what == 5) {
|
|
icsk->icsk_pending = what;
|
|
icsk->icsk_timeout = jiffies + when;
|
|
sk_reset_timer(sk, &icsk->icsk_retransmit_timer, icsk->icsk_timeout);
|
|
} else if (what == 2) {
|
|
icsk->icsk_ack.pending |= ICSK_ACK_TIMER;
|
|
icsk->icsk_ack.timeout = jiffies + when;
|
|
sk_reset_timer(sk, &icsk->icsk_delack_timer, icsk->icsk_ack.timeout);
|
|
}
|
|
|
|
else {
|
|
no_printk("\001" "7" "%s", inet_csk_timer_bug_msg);
|
|
}
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long
|
|
inet_csk_rto_backoff(const struct inet_connection_sock *icsk,
|
|
unsigned long max_when)
|
|
{
|
|
u64 when = (u64)icsk->icsk_rto << icsk->icsk_backoff;
|
|
|
|
return (unsigned long)({ u64 __min1 = (when); u64 __min2 = (max_when); __min1 < __min2 ? __min1: __min2; });
|
|
}
|
|
|
|
struct sock *inet_csk_accept(struct sock *sk, int flags, int *err);
|
|
|
|
int inet_csk_bind_conflict(const struct sock *sk,
|
|
const struct inet_bind_bucket *tb, bool relax);
|
|
int inet_csk_get_port(struct sock *sk, unsigned short snum);
|
|
|
|
struct dst_entry *inet_csk_route_req(const struct sock *sk, struct flowi4 *fl4,
|
|
const struct request_sock *req);
|
|
struct dst_entry *inet_csk_route_child_sock(const struct sock *sk,
|
|
struct sock *newsk,
|
|
const struct request_sock *req);
|
|
|
|
struct sock *inet_csk_reqsk_queue_add(struct sock *sk,
|
|
struct request_sock *req,
|
|
struct sock *child);
|
|
void inet_csk_reqsk_queue_hash_add(struct sock *sk, struct request_sock *req,
|
|
unsigned long timeout);
|
|
struct sock *inet_csk_complete_hashdance(struct sock *sk, struct sock *child,
|
|
struct request_sock *req,
|
|
bool own_req);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inet_csk_reqsk_queue_added(struct sock *sk)
|
|
{
|
|
reqsk_queue_added(&inet_csk(sk)->icsk_accept_queue);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int inet_csk_reqsk_queue_len(const struct sock *sk)
|
|
{
|
|
return reqsk_queue_len(&inet_csk(sk)->icsk_accept_queue);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int inet_csk_reqsk_queue_young(const struct sock *sk)
|
|
{
|
|
return reqsk_queue_len_young(&inet_csk(sk)->icsk_accept_queue);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int inet_csk_reqsk_queue_is_full(const struct sock *sk)
|
|
{
|
|
return inet_csk_reqsk_queue_len(sk) >= sk->sk_max_ack_backlog;
|
|
}
|
|
|
|
void inet_csk_reqsk_queue_drop(struct sock *sk, struct request_sock *req);
|
|
void inet_csk_reqsk_queue_drop_and_put(struct sock *sk, struct request_sock *req);
|
|
|
|
void inet_csk_destroy_sock(struct sock *sk);
|
|
void inet_csk_prepare_forced_close(struct sock *sk);
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int inet_csk_listen_poll(const struct sock *sk)
|
|
{
|
|
return !reqsk_queue_empty(&inet_csk(sk)->icsk_accept_queue) ?
|
|
(0x0001 | 0x0040) : 0;
|
|
}
|
|
|
|
int inet_csk_listen_start(struct sock *sk, int backlog);
|
|
void inet_csk_listen_stop(struct sock *sk);
|
|
|
|
void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr);
|
|
|
|
int inet_csk_compat_getsockopt(struct sock *sk, int level, int optname,
|
|
char *optval, int *optlen);
|
|
int inet_csk_compat_setsockopt(struct sock *sk, int level, int optname,
|
|
char *optval, unsigned int optlen);
|
|
|
|
struct dst_entry *inet_csk_update_pmtu(struct sock *sk, u32 mtu);
|
|
# 24 "include/linux/tcp.h" 2
|
|
# 1 "include/net/inet_timewait_sock.h" 1
|
|
# 28 "include/net/inet_timewait_sock.h"
|
|
# 1 "include/net/timewait_sock.h" 1
|
|
# 18 "include/net/timewait_sock.h"
|
|
struct timewait_sock_ops {
|
|
struct kmem_cache *twsk_slab;
|
|
char *twsk_slab_name;
|
|
unsigned int twsk_obj_size;
|
|
int (*twsk_unique)(struct sock *sk,
|
|
struct sock *sktw, void *twp);
|
|
void (*twsk_destructor)(struct sock *sk);
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int twsk_unique(struct sock *sk, struct sock *sktw, void *twp)
|
|
{
|
|
if (sk->__sk_common.skc_prot->twsk_prot->twsk_unique != ((void *)0))
|
|
return sk->__sk_common.skc_prot->twsk_prot->twsk_unique(sk, sktw, twp);
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void twsk_destructor(struct sock *sk)
|
|
{
|
|
if (sk->__sk_common.skc_prot->twsk_prot->twsk_destructor != ((void *)0))
|
|
sk->__sk_common.skc_prot->twsk_prot->twsk_destructor(sk);
|
|
}
|
|
# 29 "include/net/inet_timewait_sock.h" 2
|
|
|
|
|
|
|
|
struct inet_hashinfo;
|
|
|
|
struct inet_timewait_death_row {
|
|
atomic_t tw_count;
|
|
|
|
struct inet_hashinfo *hashinfo __attribute__((__aligned__((1 << 6))));
|
|
int sysctl_tw_recycle;
|
|
int sysctl_max_tw_buckets;
|
|
};
|
|
|
|
struct inet_bind_bucket;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct inet_timewait_sock {
|
|
|
|
|
|
|
|
|
|
struct sock_common __tw_common;
|
|
# 75 "include/net/inet_timewait_sock.h"
|
|
int tw_timeout;
|
|
volatile unsigned char tw_substate;
|
|
unsigned char tw_rcv_wscale;
|
|
|
|
|
|
|
|
__be16 tw_sport;
|
|
;
|
|
|
|
unsigned int tw_kill : 1,
|
|
tw_transparent : 1,
|
|
tw_flowlabel : 20,
|
|
tw_pad : 2,
|
|
tw_tos : 8;
|
|
;
|
|
struct timer_list tw_timer;
|
|
struct inet_bind_bucket *tw_tb;
|
|
};
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct inet_timewait_sock *inet_twsk(const struct sock *sk)
|
|
{
|
|
return (struct inet_timewait_sock *)sk;
|
|
}
|
|
|
|
void inet_twsk_free(struct inet_timewait_sock *tw);
|
|
void inet_twsk_put(struct inet_timewait_sock *tw);
|
|
|
|
void inet_twsk_bind_unhash(struct inet_timewait_sock *tw,
|
|
struct inet_hashinfo *hashinfo);
|
|
|
|
struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk,
|
|
struct inet_timewait_death_row *dr,
|
|
const int state);
|
|
|
|
void __inet_twsk_hashdance(struct inet_timewait_sock *tw, struct sock *sk,
|
|
struct inet_hashinfo *hashinfo);
|
|
|
|
void __inet_twsk_schedule(struct inet_timewait_sock *tw, int timeo,
|
|
bool rearm);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inet_twsk_schedule(struct inet_timewait_sock *tw, int timeo)
|
|
{
|
|
__inet_twsk_schedule(tw, timeo, false);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inet_twsk_reschedule(struct inet_timewait_sock *tw, int timeo)
|
|
{
|
|
__inet_twsk_schedule(tw, timeo, true);
|
|
}
|
|
|
|
void inet_twsk_deschedule_put(struct inet_timewait_sock *tw);
|
|
|
|
void inet_twsk_purge(struct inet_hashinfo *hashinfo,
|
|
struct inet_timewait_death_row *twdr, int family);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
struct net *twsk_net(const struct inet_timewait_sock *twsk)
|
|
{
|
|
return read_pnet(&twsk->__tw_common.skc_net);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
void twsk_net_set(struct inet_timewait_sock *twsk, struct net *net)
|
|
{
|
|
write_pnet(&twsk->__tw_common.skc_net, net);
|
|
}
|
|
# 25 "include/linux/tcp.h" 2
|
|
# 1 "include/uapi/linux/tcp.h" 1
|
|
# 24 "include/uapi/linux/tcp.h"
|
|
struct tcphdr {
|
|
__be16 source;
|
|
__be16 dest;
|
|
__be32 seq;
|
|
__be32 ack_seq;
|
|
|
|
__u16 res1:4,
|
|
doff:4,
|
|
fin:1,
|
|
syn:1,
|
|
rst:1,
|
|
psh:1,
|
|
ack:1,
|
|
urg:1,
|
|
ece:1,
|
|
cwr:1;
|
|
# 54 "include/uapi/linux/tcp.h"
|
|
__be16 window;
|
|
__sum16 check;
|
|
__be16 urg_ptr;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
union tcp_word_hdr {
|
|
struct tcphdr hdr;
|
|
__be32 words[5];
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
TCP_FLAG_CWR = (( __be32)((__u32)( (((__u32)((0x00800000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x00800000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x00800000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x00800000)) & (__u32)0xff000000UL) >> 24)))),
|
|
TCP_FLAG_ECE = (( __be32)((__u32)( (((__u32)((0x00400000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x00400000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x00400000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x00400000)) & (__u32)0xff000000UL) >> 24)))),
|
|
TCP_FLAG_URG = (( __be32)((__u32)( (((__u32)((0x00200000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x00200000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x00200000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x00200000)) & (__u32)0xff000000UL) >> 24)))),
|
|
TCP_FLAG_ACK = (( __be32)((__u32)( (((__u32)((0x00100000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x00100000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x00100000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x00100000)) & (__u32)0xff000000UL) >> 24)))),
|
|
TCP_FLAG_PSH = (( __be32)((__u32)( (((__u32)((0x00080000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x00080000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x00080000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x00080000)) & (__u32)0xff000000UL) >> 24)))),
|
|
TCP_FLAG_RST = (( __be32)((__u32)( (((__u32)((0x00040000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x00040000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x00040000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x00040000)) & (__u32)0xff000000UL) >> 24)))),
|
|
TCP_FLAG_SYN = (( __be32)((__u32)( (((__u32)((0x00020000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x00020000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x00020000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x00020000)) & (__u32)0xff000000UL) >> 24)))),
|
|
TCP_FLAG_FIN = (( __be32)((__u32)( (((__u32)((0x00010000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x00010000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x00010000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x00010000)) & (__u32)0xff000000UL) >> 24)))),
|
|
TCP_RESERVED_BITS = (( __be32)((__u32)( (((__u32)((0x0F000000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x0F000000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x0F000000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x0F000000)) & (__u32)0xff000000UL) >> 24)))),
|
|
TCP_DATA_OFFSET = (( __be32)((__u32)( (((__u32)((0xF0000000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xF0000000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xF0000000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xF0000000)) & (__u32)0xff000000UL) >> 24))))
|
|
};
|
|
# 119 "include/uapi/linux/tcp.h"
|
|
struct tcp_repair_opt {
|
|
__u32 opt_code;
|
|
__u32 opt_val;
|
|
};
|
|
|
|
enum {
|
|
TCP_NO_QUEUE,
|
|
TCP_RECV_QUEUE,
|
|
TCP_SEND_QUEUE,
|
|
TCP_QUEUES_NR,
|
|
};
|
|
# 139 "include/uapi/linux/tcp.h"
|
|
enum tcp_ca_state {
|
|
TCP_CA_Open = 0,
|
|
|
|
TCP_CA_Disorder = 1,
|
|
|
|
TCP_CA_CWR = 2,
|
|
|
|
TCP_CA_Recovery = 3,
|
|
|
|
TCP_CA_Loss = 4
|
|
|
|
};
|
|
|
|
struct tcp_info {
|
|
__u8 tcpi_state;
|
|
__u8 tcpi_ca_state;
|
|
__u8 tcpi_retransmits;
|
|
__u8 tcpi_probes;
|
|
__u8 tcpi_backoff;
|
|
__u8 tcpi_options;
|
|
__u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
|
|
|
|
__u32 tcpi_rto;
|
|
__u32 tcpi_ato;
|
|
__u32 tcpi_snd_mss;
|
|
__u32 tcpi_rcv_mss;
|
|
|
|
__u32 tcpi_unacked;
|
|
__u32 tcpi_sacked;
|
|
__u32 tcpi_lost;
|
|
__u32 tcpi_retrans;
|
|
__u32 tcpi_fackets;
|
|
|
|
|
|
__u32 tcpi_last_data_sent;
|
|
__u32 tcpi_last_ack_sent;
|
|
__u32 tcpi_last_data_recv;
|
|
__u32 tcpi_last_ack_recv;
|
|
|
|
|
|
__u32 tcpi_pmtu;
|
|
__u32 tcpi_rcv_ssthresh;
|
|
__u32 tcpi_rtt;
|
|
__u32 tcpi_rttvar;
|
|
__u32 tcpi_snd_ssthresh;
|
|
__u32 tcpi_snd_cwnd;
|
|
__u32 tcpi_advmss;
|
|
__u32 tcpi_reordering;
|
|
|
|
__u32 tcpi_rcv_rtt;
|
|
__u32 tcpi_rcv_space;
|
|
|
|
__u32 tcpi_total_retrans;
|
|
|
|
__u64 tcpi_pacing_rate;
|
|
__u64 tcpi_max_pacing_rate;
|
|
__u64 tcpi_bytes_acked;
|
|
__u64 tcpi_bytes_received;
|
|
__u32 tcpi_segs_out;
|
|
__u32 tcpi_segs_in;
|
|
};
|
|
|
|
|
|
|
|
|
|
struct tcp_md5sig {
|
|
struct __kernel_sockaddr_storage tcpm_addr;
|
|
__u16 __tcpm_pad1;
|
|
__u16 tcpm_keylen;
|
|
__u32 __tcpm_pad2;
|
|
__u8 tcpm_key[80];
|
|
};
|
|
# 26 "include/linux/tcp.h" 2
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct tcphdr *tcp_hdr(const struct sk_buff *skb)
|
|
{
|
|
return (struct tcphdr *)skb_transport_header(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int __tcp_hdrlen(const struct tcphdr *th)
|
|
{
|
|
return th->doff * 4;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int tcp_hdrlen(const struct sk_buff *skb)
|
|
{
|
|
return __tcp_hdrlen(tcp_hdr(skb));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct tcphdr *inner_tcp_hdr(const struct sk_buff *skb)
|
|
{
|
|
return (struct tcphdr *)skb_inner_transport_header(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int inner_tcp_hdrlen(const struct sk_buff *skb)
|
|
{
|
|
return inner_tcp_hdr(skb)->doff * 4;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int tcp_optlen(const struct sk_buff *skb)
|
|
{
|
|
return (tcp_hdr(skb)->doff - 5) * 4;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct tcp_fastopen_cookie {
|
|
union {
|
|
u8 val[16];
|
|
|
|
struct in6_addr addr;
|
|
|
|
};
|
|
s8 len;
|
|
bool exp;
|
|
};
|
|
|
|
|
|
struct tcp_sack_block_wire {
|
|
__be32 start_seq;
|
|
__be32 end_seq;
|
|
};
|
|
|
|
struct tcp_sack_block {
|
|
u32 start_seq;
|
|
u32 end_seq;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct tcp_options_received {
|
|
|
|
long ts_recent_stamp;
|
|
u32 ts_recent;
|
|
u32 rcv_tsval;
|
|
u32 rcv_tsecr;
|
|
u16 saw_tstamp : 1,
|
|
tstamp_ok : 1,
|
|
dsack : 1,
|
|
wscale_ok : 1,
|
|
sack_ok : 4,
|
|
snd_wscale : 4,
|
|
rcv_wscale : 4;
|
|
u8 num_sacks;
|
|
u16 user_mss;
|
|
u16 mss_clamp;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tcp_clear_options(struct tcp_options_received *rx_opt)
|
|
{
|
|
rx_opt->tstamp_ok = rx_opt->sack_ok = 0;
|
|
rx_opt->wscale_ok = rx_opt->snd_wscale = 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct tcp_request_sock_ops;
|
|
|
|
struct tcp_request_sock {
|
|
struct inet_request_sock req;
|
|
const struct tcp_request_sock_ops *af_specific;
|
|
struct skb_mstamp snt_synack;
|
|
bool tfo_listener;
|
|
u32 txhash;
|
|
u32 rcv_isn;
|
|
u32 snt_isn;
|
|
u32 last_oow_ack_time;
|
|
u32 rcv_nxt;
|
|
|
|
|
|
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct tcp_request_sock *tcp_rsk(const struct request_sock *req)
|
|
{
|
|
return (struct tcp_request_sock *)req;
|
|
}
|
|
|
|
struct tcp_sock {
|
|
|
|
struct inet_connection_sock inet_conn;
|
|
u16 tcp_header_len;
|
|
u16 gso_segs;
|
|
|
|
|
|
|
|
|
|
|
|
__be32 pred_flags;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
u64 bytes_received;
|
|
|
|
|
|
|
|
u32 segs_in;
|
|
|
|
|
|
u32 rcv_nxt;
|
|
u32 copied_seq;
|
|
u32 rcv_wup;
|
|
u32 snd_nxt;
|
|
u32 segs_out;
|
|
|
|
|
|
u64 bytes_acked;
|
|
|
|
|
|
|
|
struct u64_stats_sync syncp;
|
|
|
|
u32 snd_una;
|
|
u32 snd_sml;
|
|
u32 rcv_tstamp;
|
|
u32 lsndtime;
|
|
u32 last_oow_ack_time;
|
|
|
|
u32 tsoffset;
|
|
|
|
struct list_head tsq_node;
|
|
unsigned long tsq_flags;
|
|
|
|
|
|
struct {
|
|
struct sk_buff_head prequeue;
|
|
struct task_struct *task;
|
|
struct msghdr *msg;
|
|
int memory;
|
|
int len;
|
|
} ucopy;
|
|
|
|
u32 snd_wl1;
|
|
u32 snd_wnd;
|
|
u32 max_window;
|
|
u32 mss_cache;
|
|
|
|
u32 window_clamp;
|
|
u32 rcv_ssthresh;
|
|
|
|
|
|
struct tcp_rack {
|
|
struct skb_mstamp mstamp;
|
|
u8 advanced;
|
|
u8 reord;
|
|
} rack;
|
|
u16 advmss;
|
|
u8 unused;
|
|
u8 nonagle : 4,
|
|
thin_lto : 1,
|
|
thin_dupack : 1,
|
|
repair : 1,
|
|
frto : 1;
|
|
u8 repair_queue;
|
|
u8 do_early_retrans:1,
|
|
syn_data:1,
|
|
syn_fastopen:1,
|
|
syn_fastopen_exp:1,
|
|
syn_data_acked:1,
|
|
save_syn:1,
|
|
is_cwnd_limited:1;
|
|
u32 tlp_high_seq;
|
|
|
|
|
|
u32 srtt_us;
|
|
u32 mdev_us;
|
|
u32 mdev_max_us;
|
|
u32 rttvar_us;
|
|
u32 rtt_seq;
|
|
struct rtt_meas {
|
|
u32 rtt, ts;
|
|
} rtt_min[3];
|
|
|
|
u32 packets_out;
|
|
u32 retrans_out;
|
|
u32 max_packets_out;
|
|
u32 max_packets_seq;
|
|
|
|
u16 urg_data;
|
|
u8 ecn_flags;
|
|
u8 keepalive_probes;
|
|
u32 reordering;
|
|
u32 snd_up;
|
|
|
|
|
|
|
|
|
|
struct tcp_options_received rx_opt;
|
|
|
|
|
|
|
|
|
|
u32 snd_ssthresh;
|
|
u32 snd_cwnd;
|
|
u32 snd_cwnd_cnt;
|
|
u32 snd_cwnd_clamp;
|
|
u32 snd_cwnd_used;
|
|
u32 snd_cwnd_stamp;
|
|
u32 prior_cwnd;
|
|
u32 prr_delivered;
|
|
|
|
u32 prr_out;
|
|
|
|
u32 rcv_wnd;
|
|
u32 write_seq;
|
|
u32 notsent_lowat;
|
|
u32 pushed_seq;
|
|
u32 lost_out;
|
|
u32 sacked_out;
|
|
u32 fackets_out;
|
|
|
|
|
|
struct sk_buff* lost_skb_hint;
|
|
struct sk_buff *retransmit_skb_hint;
|
|
|
|
|
|
|
|
|
|
struct sk_buff_head out_of_order_queue;
|
|
|
|
|
|
struct tcp_sack_block duplicate_sack[1];
|
|
struct tcp_sack_block selective_acks[4];
|
|
|
|
struct tcp_sack_block recv_sack_cache[4];
|
|
|
|
struct sk_buff *highest_sack;
|
|
|
|
|
|
|
|
|
|
|
|
int lost_cnt_hint;
|
|
u32 retransmit_high;
|
|
|
|
u32 prior_ssthresh;
|
|
u32 high_seq;
|
|
|
|
u32 retrans_stamp;
|
|
|
|
|
|
u32 undo_marker;
|
|
int undo_retrans;
|
|
u32 total_retrans;
|
|
|
|
u32 urg_seq;
|
|
unsigned int keepalive_time;
|
|
unsigned int keepalive_intvl;
|
|
|
|
int linger2;
|
|
|
|
|
|
struct {
|
|
u32 rtt;
|
|
u32 seq;
|
|
u32 time;
|
|
} rcv_rtt_est;
|
|
|
|
|
|
struct {
|
|
int space;
|
|
u32 seq;
|
|
u32 time;
|
|
} rcvq_space;
|
|
|
|
|
|
struct {
|
|
u32 probe_seq_start;
|
|
u32 probe_seq_end;
|
|
} mtu_probe;
|
|
u32 mtu_info;
|
|
|
|
|
|
|
|
|
|
|
|
const struct tcp_sock_af_ops *af_specific;
|
|
|
|
|
|
struct tcp_md5sig_info *md5sig_info;
|
|
|
|
|
|
|
|
struct tcp_fastopen_request *fastopen_req;
|
|
|
|
|
|
|
|
struct request_sock *fastopen_rsk;
|
|
u32 *saved_syn;
|
|
};
|
|
|
|
enum tsq_flags {
|
|
TSQ_THROTTLED,
|
|
TSQ_QUEUED,
|
|
TCP_TSQ_DEFERRED,
|
|
TCP_WRITE_TIMER_DEFERRED,
|
|
TCP_DELACK_TIMER_DEFERRED,
|
|
TCP_MTU_REDUCED_DEFERRED,
|
|
|
|
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct tcp_sock *tcp_sk(const struct sock *sk)
|
|
{
|
|
return (struct tcp_sock *)sk;
|
|
}
|
|
|
|
struct tcp_timewait_sock {
|
|
struct inet_timewait_sock tw_sk;
|
|
|
|
|
|
u32 tw_rcv_wnd;
|
|
u32 tw_ts_offset;
|
|
u32 tw_ts_recent;
|
|
|
|
|
|
u32 tw_last_oow_ack_time;
|
|
|
|
long tw_ts_recent_stamp;
|
|
|
|
struct tcp_md5sig_key *tw_md5_key;
|
|
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct tcp_timewait_sock *tcp_twsk(const struct sock *sk)
|
|
{
|
|
return (struct tcp_timewait_sock *)sk;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool tcp_passive_fastopen(const struct sock *sk)
|
|
{
|
|
return (sk->__sk_common.skc_state == TCP_SYN_RECV &&
|
|
tcp_sk(sk)->fastopen_rsk != ((void *)0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void fastopen_queue_tune(struct sock *sk, int backlog)
|
|
{
|
|
struct request_sock_queue *queue = &inet_csk(sk)->icsk_accept_queue;
|
|
int somaxconn = ({ union { typeof(sock_net(sk)->core.sysctl_somaxconn) __val; char __c[1]; } __u; if (1) __read_once_size(&(sock_net(sk)->core.sysctl_somaxconn), __u.__c, sizeof(sock_net(sk)->core.sysctl_somaxconn)); else __read_once_size_nocheck(&(sock_net(sk)->core.sysctl_somaxconn), __u.__c, sizeof(sock_net(sk)->core.sysctl_somaxconn)); __u.__val; });
|
|
|
|
queue->fastopenq.max_qlen = ({ unsigned int __min1 = (backlog); unsigned int __min2 = (somaxconn); __min1 < __min2 ? __min1: __min2; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tcp_move_syn(struct tcp_sock *tp,
|
|
struct request_sock *req)
|
|
{
|
|
tp->saved_syn = req->saved_syn;
|
|
req->saved_syn = ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void tcp_saved_syn_free(struct tcp_sock *tp)
|
|
{
|
|
kfree(tp->saved_syn);
|
|
tp->saved_syn = ((void *)0);
|
|
}
|
|
# 85 "include/linux/ipv6.h" 2
|
|
# 1 "include/linux/udp.h" 1
|
|
# 23 "include/linux/udp.h"
|
|
# 1 "include/uapi/linux/udp.h" 1
|
|
# 22 "include/uapi/linux/udp.h"
|
|
struct udphdr {
|
|
__be16 source;
|
|
__be16 dest;
|
|
__be16 len;
|
|
__sum16 check;
|
|
};
|
|
# 24 "include/linux/udp.h" 2
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct udphdr *udp_hdr(const struct sk_buff *skb)
|
|
{
|
|
return (struct udphdr *)skb_transport_header(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct udphdr *inner_udp_hdr(const struct sk_buff *skb)
|
|
{
|
|
return (struct udphdr *)skb_inner_transport_header(skb);
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 udp_hashfn(const struct net *net, u32 num, u32 mask)
|
|
{
|
|
return (num + net_hash_mix(net)) & mask;
|
|
}
|
|
|
|
struct udp_sock {
|
|
|
|
struct inet_sock inet;
|
|
|
|
|
|
|
|
int pending;
|
|
unsigned int corkflag;
|
|
__u8 encap_type;
|
|
unsigned char no_check6_tx:1,
|
|
no_check6_rx:1;
|
|
|
|
|
|
|
|
|
|
__u16 len;
|
|
|
|
|
|
|
|
__u16 pcslen;
|
|
__u16 pcrlen;
|
|
|
|
|
|
|
|
|
|
__u8 pcflag;
|
|
__u8 unused[3];
|
|
|
|
|
|
|
|
int (*encap_rcv)(struct sock *sk, struct sk_buff *skb);
|
|
void (*encap_destroy)(struct sock *sk);
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct udp_sock *udp_sk(const struct sock *sk)
|
|
{
|
|
return (struct udp_sock *)sk;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void udp_set_no_check6_tx(struct sock *sk, bool val)
|
|
{
|
|
udp_sk(sk)->no_check6_tx = val;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void udp_set_no_check6_rx(struct sock *sk, bool val)
|
|
{
|
|
udp_sk(sk)->no_check6_rx = val;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool udp_get_no_check6_tx(struct sock *sk)
|
|
{
|
|
return udp_sk(sk)->no_check6_tx;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool udp_get_no_check6_rx(struct sock *sk)
|
|
{
|
|
return udp_sk(sk)->no_check6_rx;
|
|
}
|
|
# 86 "include/linux/ipv6.h" 2
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct ipv6hdr *ipv6_hdr(const struct sk_buff *skb)
|
|
{
|
|
return (struct ipv6hdr *)skb_network_header(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct ipv6hdr *inner_ipv6_hdr(const struct sk_buff *skb)
|
|
{
|
|
return (struct ipv6hdr *)skb_inner_network_header(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct ipv6hdr *ipipv6_hdr(const struct sk_buff *skb)
|
|
{
|
|
return (struct ipv6hdr *)skb_transport_header(skb);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct inet6_skb_parm {
|
|
int iif;
|
|
__be16 ra;
|
|
__u16 dst0;
|
|
__u16 srcrt;
|
|
__u16 dst1;
|
|
__u16 lastopt;
|
|
__u16 nhoff;
|
|
__u16 flags;
|
|
|
|
|
|
|
|
__u16 frag_max_size;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int inet6_iif(const struct sk_buff *skb)
|
|
{
|
|
return ((struct inet6_skb_parm*)((skb)->cb))->iif;
|
|
}
|
|
|
|
struct tcp6_request_sock {
|
|
struct tcp_request_sock tcp6rsk_tcp;
|
|
};
|
|
|
|
struct ipv6_mc_socklist;
|
|
struct ipv6_ac_socklist;
|
|
struct ipv6_fl_socklist;
|
|
|
|
struct inet6_cork {
|
|
struct ipv6_txoptions *opt;
|
|
u8 hop_limit;
|
|
u8 tclass;
|
|
};
|
|
# 161 "include/linux/ipv6.h"
|
|
struct ipv6_pinfo {
|
|
struct in6_addr saddr;
|
|
struct in6_pktinfo sticky_pktinfo;
|
|
const struct in6_addr *daddr_cache;
|
|
|
|
|
|
|
|
|
|
__be32 flow_label;
|
|
__u32 frag_size;
|
|
# 180 "include/linux/ipv6.h"
|
|
__u16 __unused_1:7;
|
|
__s16 hop_limit:9;
|
|
# 190 "include/linux/ipv6.h"
|
|
__u16 mc_loop:1,
|
|
__unused_2:6;
|
|
__s16 mcast_hops:9;
|
|
|
|
int ucast_oif;
|
|
int mcast_oif;
|
|
|
|
|
|
union {
|
|
struct {
|
|
__u16 srcrt:1,
|
|
osrcrt:1,
|
|
rxinfo:1,
|
|
rxoinfo:1,
|
|
rxhlim:1,
|
|
rxohlim:1,
|
|
hopopts:1,
|
|
ohopopts:1,
|
|
dstopts:1,
|
|
odstopts:1,
|
|
rxflow:1,
|
|
rxtclass:1,
|
|
rxpmtu:1,
|
|
rxorigdstaddr:1;
|
|
|
|
} bits;
|
|
__u16 all;
|
|
} rxopt;
|
|
|
|
|
|
__u16 recverr:1,
|
|
sndflow:1,
|
|
repflow:1,
|
|
pmtudisc:3,
|
|
padding:1,
|
|
srcprefs:3,
|
|
|
|
|
|
|
|
dontfrag:1,
|
|
autoflowlabel:1,
|
|
autoflowlabel_set:1;
|
|
__u8 min_hopcount;
|
|
__u8 tclass;
|
|
__be32 rcv_flowinfo;
|
|
|
|
__u32 dst_cookie;
|
|
__u32 rx_dst_cookie;
|
|
|
|
struct ipv6_mc_socklist *ipv6_mc_list;
|
|
struct ipv6_ac_socklist *ipv6_ac_list;
|
|
struct ipv6_fl_socklist *ipv6_fl_list;
|
|
|
|
struct ipv6_txoptions *opt;
|
|
struct sk_buff *pktoptions;
|
|
struct sk_buff *rxpmtu;
|
|
struct inet6_cork cork;
|
|
};
|
|
|
|
|
|
struct raw6_sock {
|
|
|
|
struct inet_sock inet;
|
|
__u32 checksum;
|
|
__u32 offset;
|
|
struct icmp6_filter filter;
|
|
__u32 ip6mr_table;
|
|
|
|
struct ipv6_pinfo inet6;
|
|
};
|
|
|
|
struct udp6_sock {
|
|
struct udp_sock udp;
|
|
|
|
struct ipv6_pinfo inet6;
|
|
};
|
|
|
|
struct tcp6_sock {
|
|
struct tcp_sock tcp;
|
|
|
|
struct ipv6_pinfo inet6;
|
|
};
|
|
|
|
extern int inet6_sk_rebuild_header(struct sock *sk);
|
|
|
|
struct tcp6_timewait_sock {
|
|
struct tcp_timewait_sock tcp6tw_tcp;
|
|
};
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct ipv6_pinfo *inet6_sk(const struct sock *__sk)
|
|
{
|
|
return sk_fullsock(__sk) ? inet_sk(__sk)->pinet6 : ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct raw6_sock *raw6_sk(const struct sock *sk)
|
|
{
|
|
return (struct raw6_sock *)sk;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inet_sk_copy_descendant(struct sock *sk_to,
|
|
const struct sock *sk_from)
|
|
{
|
|
int ancestor_size = sizeof(struct inet_sock);
|
|
|
|
if (sk_from->__sk_common.skc_family == 10)
|
|
ancestor_size += sizeof(struct ipv6_pinfo);
|
|
|
|
__inet_sk_copy_descendant(sk_to, sk_from, ancestor_size);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) const struct in6_addr *inet6_rcv_saddr(const struct sock *sk)
|
|
{
|
|
if (sk->__sk_common.skc_family == 10)
|
|
return &sk->__sk_common.skc_v6_rcv_saddr;
|
|
return ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int inet_v6_ipv6only(const struct sock *sk)
|
|
{
|
|
|
|
return ((sk->__sk_common.skc_ipv6only));
|
|
}
|
|
# 53 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c" 2
|
|
# 1 "include/linux/if_vlan.h" 1
|
|
# 16 "include/linux/if_vlan.h"
|
|
# 1 "include/linux/etherdevice.h" 1
|
|
# 28 "include/linux/etherdevice.h"
|
|
# 1 "./arch/arm/include/asm/unaligned.h" 1
|
|
# 12 "./arch/arm/include/asm/unaligned.h"
|
|
# 1 "include/linux/unaligned/le_struct.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u16 get_unaligned_le16(const void *p)
|
|
{
|
|
return __get_unaligned_cpu16((const u8 *)p);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 get_unaligned_le32(const void *p)
|
|
{
|
|
return __get_unaligned_cpu32((const u8 *)p);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 get_unaligned_le64(const void *p)
|
|
{
|
|
return __get_unaligned_cpu64((const u8 *)p);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_unaligned_le16(u16 val, void *p)
|
|
{
|
|
__put_unaligned_cpu16(val, p);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_unaligned_le32(u32 val, void *p)
|
|
{
|
|
__put_unaligned_cpu32(val, p);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_unaligned_le64(u64 val, void *p)
|
|
{
|
|
__put_unaligned_cpu64(val, p);
|
|
}
|
|
# 13 "./arch/arm/include/asm/unaligned.h" 2
|
|
# 1 "include/linux/unaligned/be_byteshift.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u16 __get_unaligned_be16(const u8 *p)
|
|
{
|
|
return p[0] << 8 | p[1];
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 __get_unaligned_be32(const u8 *p)
|
|
{
|
|
return p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3];
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 __get_unaligned_be64(const u8 *p)
|
|
{
|
|
return (u64)__get_unaligned_be32(p) << 32 |
|
|
__get_unaligned_be32(p + 4);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __put_unaligned_be16(u16 val, u8 *p)
|
|
{
|
|
*p++ = val >> 8;
|
|
*p++ = val;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __put_unaligned_be32(u32 val, u8 *p)
|
|
{
|
|
__put_unaligned_be16(val >> 16, p);
|
|
__put_unaligned_be16(val, p + 2);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __put_unaligned_be64(u64 val, u8 *p)
|
|
{
|
|
__put_unaligned_be32(val >> 32, p);
|
|
__put_unaligned_be32(val, p + 4);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u16 get_unaligned_be16(const void *p)
|
|
{
|
|
return __get_unaligned_be16((const u8 *)p);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 get_unaligned_be32(const void *p)
|
|
{
|
|
return __get_unaligned_be32((const u8 *)p);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u64 get_unaligned_be64(const void *p)
|
|
{
|
|
return __get_unaligned_be64((const u8 *)p);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_unaligned_be16(u16 val, void *p)
|
|
{
|
|
__put_unaligned_be16(val, p);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_unaligned_be32(u32 val, void *p)
|
|
{
|
|
__put_unaligned_be32(val, p);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void put_unaligned_be64(u64 val, void *p)
|
|
{
|
|
__put_unaligned_be64(val, p);
|
|
}
|
|
# 14 "./arch/arm/include/asm/unaligned.h" 2
|
|
# 1 "include/linux/unaligned/generic.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern void __bad_unaligned_access_size(void);
|
|
# 15 "./arch/arm/include/asm/unaligned.h" 2
|
|
# 29 "include/linux/etherdevice.h" 2
|
|
# 1 "arch/arm/include/generated/asm/bitsperlong.h" 1
|
|
# 30 "include/linux/etherdevice.h" 2
|
|
|
|
|
|
u32 eth_get_headlen(void *data, unsigned int max_len);
|
|
__be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev);
|
|
extern const struct header_ops eth_header_ops;
|
|
|
|
int eth_header(struct sk_buff *skb, struct net_device *dev, unsigned short type,
|
|
const void *daddr, const void *saddr, unsigned len);
|
|
int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr);
|
|
int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh,
|
|
__be16 type);
|
|
void eth_header_cache_update(struct hh_cache *hh, const struct net_device *dev,
|
|
const unsigned char *haddr);
|
|
int eth_prepare_mac_addr_change(struct net_device *dev, void *p);
|
|
void eth_commit_mac_addr_change(struct net_device *dev, void *p);
|
|
int eth_mac_addr(struct net_device *dev, void *p);
|
|
int eth_change_mtu(struct net_device *dev, int new_mtu);
|
|
int eth_validate_addr(struct net_device *dev);
|
|
|
|
struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,
|
|
unsigned int rxqs);
|
|
|
|
|
|
|
|
struct sk_buff **eth_gro_receive(struct sk_buff **head,
|
|
struct sk_buff *skb);
|
|
int eth_gro_complete(struct sk_buff *skb, int nhoff);
|
|
|
|
|
|
static const u8 eth_reserved_addr_base[6] __attribute__((aligned(2))) =
|
|
{ 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 };
|
|
# 71 "include/linux/etherdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_link_local_ether_addr(const u8 *addr)
|
|
{
|
|
__be16 *a = (__be16 *)addr;
|
|
static const __be16 *b = (const __be16 *)eth_reserved_addr_base;
|
|
static const __be16 m = (( __be16)(__builtin_constant_p((__u16)((0xfff0))) ? ((__u16)( (((__u16)((0xfff0)) & (__u16)0x00ffU) << 8) | (((__u16)((0xfff0)) & (__u16)0xff00U) >> 8))) : __fswab16((0xfff0))));
|
|
|
|
|
|
return (((*(const u32 *)addr) ^ (*(const u32 *)b)) |
|
|
( int)((a[2] ^ b[2]) & m)) == 0;
|
|
|
|
|
|
|
|
}
|
|
# 93 "include/linux/etherdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_zero_ether_addr(const u8 *addr)
|
|
{
|
|
|
|
return ((*(const u32 *)addr) | (*(const u16 *)(addr + 4))) == 0;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
# 111 "include/linux/etherdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_multicast_ether_addr(const u8 *addr)
|
|
{
|
|
|
|
u32 a = *(const u32 *)addr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 0x01 & a;
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_multicast_ether_addr_64bits(const u8 addr[6+2])
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return is_multicast_ether_addr(addr);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_local_ether_addr(const u8 *addr)
|
|
{
|
|
return 0x02 & addr[0];
|
|
}
|
|
# 157 "include/linux/etherdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_broadcast_ether_addr(const u8 *addr)
|
|
{
|
|
return (*(const u16 *)(addr + 0) &
|
|
*(const u16 *)(addr + 2) &
|
|
*(const u16 *)(addr + 4)) == 0xffff;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_unicast_ether_addr(const u8 *addr)
|
|
{
|
|
return !is_multicast_ether_addr(addr);
|
|
}
|
|
# 186 "include/linux/etherdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_valid_ether_addr(const u8 *addr)
|
|
{
|
|
|
|
|
|
return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr);
|
|
}
|
|
# 201 "include/linux/etherdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool eth_proto_is_802_3(__be16 proto)
|
|
{
|
|
|
|
|
|
proto &= (( __be16)(__builtin_constant_p((__u16)((0xFF00))) ? ((__u16)( (((__u16)((0xFF00)) & (__u16)0x00ffU) << 8) | (((__u16)((0xFF00)) & (__u16)0xff00U) >> 8))) : __fswab16((0xFF00))));
|
|
|
|
|
|
return ( u16)proto >= ( u16)(( __be16)(__builtin_constant_p((__u16)((0x0600))) ? ((__u16)( (((__u16)((0x0600)) & (__u16)0x00ffU) << 8) | (((__u16)((0x0600)) & (__u16)0xff00U) >> 8))) : __fswab16((0x0600))));
|
|
}
|
|
# 218 "include/linux/etherdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void eth_random_addr(u8 *addr)
|
|
{
|
|
get_random_bytes(addr, 6);
|
|
addr[0] &= 0xfe;
|
|
addr[0] |= 0x02;
|
|
}
|
|
# 233 "include/linux/etherdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void eth_broadcast_addr(u8 *addr)
|
|
{
|
|
({ void *__p = (addr); size_t __n = 6; if ((__n) != 0) { if (__builtin_constant_p((0xff)) && (0xff) == 0) __memzero((__p),(__n)); else memset((__p),(0xff),(__n)); } (__p); });
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void eth_zero_addr(u8 *addr)
|
|
{
|
|
({ void *__p = (addr); size_t __n = 6; if ((__n) != 0) { if (__builtin_constant_p((0x00)) && (0x00) == 0) __memzero((__p),(__n)); else memset((__p),(0x00),(__n)); } (__p); });
|
|
}
|
|
# 258 "include/linux/etherdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void eth_hw_addr_random(struct net_device *dev)
|
|
{
|
|
dev->addr_assign_type = 1;
|
|
eth_random_addr(dev->dev_addr);
|
|
}
|
|
# 271 "include/linux/etherdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ether_addr_copy(u8 *dst, const u8 *src)
|
|
{
|
|
|
|
*(u32 *)dst = *(const u32 *)src;
|
|
*(u16 *)(dst + 4) = *(const u16 *)(src + 4);
|
|
# 284 "include/linux/etherdevice.h"
|
|
}
|
|
# 294 "include/linux/etherdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void eth_hw_addr_inherit(struct net_device *dst,
|
|
struct net_device *src)
|
|
{
|
|
dst->addr_assign_type = src->addr_assign_type;
|
|
ether_addr_copy(dst->dev_addr, src->dev_addr);
|
|
}
|
|
# 310 "include/linux/etherdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
|
|
{
|
|
|
|
u32 fold = ((*(const u32 *)addr1) ^ (*(const u32 *)addr2)) |
|
|
((*(const u16 *)(addr1 + 4)) ^ (*(const u16 *)(addr2 + 4)));
|
|
|
|
return fold == 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
# 339 "include/linux/etherdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ether_addr_equal_64bits(const u8 addr1[6+2],
|
|
const u8 addr2[6+2])
|
|
{
|
|
# 351 "include/linux/etherdevice.h"
|
|
return ether_addr_equal(addr1, addr2);
|
|
|
|
}
|
|
# 364 "include/linux/etherdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ether_addr_equal_unaligned(const u8 *addr1, const u8 *addr2)
|
|
{
|
|
|
|
return ether_addr_equal(addr1, addr2);
|
|
|
|
|
|
|
|
}
|
|
# 384 "include/linux/etherdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_etherdev_addr(const struct net_device *dev,
|
|
const u8 addr[6 + 2])
|
|
{
|
|
struct netdev_hw_addr *ha;
|
|
bool res = false;
|
|
|
|
rcu_read_lock();
|
|
for (ha = ({ const typeof( ((typeof(*ha) *)0)->list ) *__mptr = (({ typeof((&dev->dev_addrs.list)->next) _________p1 = ({ union { typeof((&dev->dev_addrs.list)->next) __val; char __c[1]; } __u; if (1) __read_once_size(&((&dev->dev_addrs.list)->next), __u.__c, sizeof((&dev->dev_addrs.list)->next)); else __read_once_size_nocheck(&((&dev->dev_addrs.list)->next), __u.__c, sizeof((&dev->dev_addrs.list)->next)); __u.__val; }); do { } while(0); (_________p1); })); (typeof(*ha) *)( (char *)__mptr - __builtin_offsetof(typeof(*ha), list) );}); &ha->list != (&dev->dev_addrs.list); ha = ({ const typeof( ((typeof(*ha) *)0)->list ) *__mptr = (({ typeof(ha->list.next) _________p1 = ({ union { typeof(ha->list.next) __val; char __c[1]; } __u; if (1) __read_once_size(&(ha->list.next), __u.__c, sizeof(ha->list.next)); else __read_once_size_nocheck(&(ha->list.next), __u.__c, sizeof(ha->list.next)); __u.__val; }); do { } while(0); (_________p1); })); (typeof(*ha) *)( (char *)__mptr - __builtin_offsetof(typeof(*ha), list) );})) {
|
|
res = ether_addr_equal_64bits(addr, ha->addr);
|
|
if (res)
|
|
break;
|
|
}
|
|
rcu_read_unlock();
|
|
return res;
|
|
}
|
|
# 413 "include/linux/etherdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long compare_ether_header(const void *a, const void *b)
|
|
{
|
|
# 430 "include/linux/etherdevice.h"
|
|
u32 *a32 = (u32 *)((u8 *)a + 2);
|
|
u32 *b32 = (u32 *)((u8 *)b + 2);
|
|
|
|
return (*(u16 *)a ^ *(u16 *)b) | (a32[0] ^ b32[0]) |
|
|
(a32[1] ^ b32[1]) | (a32[2] ^ b32[2]);
|
|
|
|
}
|
|
# 445 "include/linux/etherdevice.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int eth_skb_pad(struct sk_buff *skb)
|
|
{
|
|
return skb_put_padto(skb, 60);
|
|
}
|
|
# 17 "include/linux/if_vlan.h" 2
|
|
|
|
|
|
# 1 "include/uapi/linux/if_vlan.h" 1
|
|
# 20 "include/uapi/linux/if_vlan.h"
|
|
enum vlan_ioctl_cmds {
|
|
ADD_VLAN_CMD,
|
|
DEL_VLAN_CMD,
|
|
SET_VLAN_INGRESS_PRIORITY_CMD,
|
|
SET_VLAN_EGRESS_PRIORITY_CMD,
|
|
GET_VLAN_INGRESS_PRIORITY_CMD,
|
|
GET_VLAN_EGRESS_PRIORITY_CMD,
|
|
SET_VLAN_NAME_TYPE_CMD,
|
|
SET_VLAN_FLAG_CMD,
|
|
GET_VLAN_REALDEV_NAME_CMD,
|
|
GET_VLAN_VID_CMD
|
|
};
|
|
|
|
enum vlan_flags {
|
|
VLAN_FLAG_REORDER_HDR = 0x1,
|
|
VLAN_FLAG_GVRP = 0x2,
|
|
VLAN_FLAG_LOOSE_BINDING = 0x4,
|
|
VLAN_FLAG_MVRP = 0x8,
|
|
};
|
|
|
|
enum vlan_name_types {
|
|
VLAN_NAME_TYPE_PLUS_VID,
|
|
VLAN_NAME_TYPE_RAW_PLUS_VID,
|
|
VLAN_NAME_TYPE_PLUS_VID_NO_PAD,
|
|
VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD,
|
|
VLAN_NAME_TYPE_HIGHEST
|
|
};
|
|
|
|
struct vlan_ioctl_args {
|
|
int cmd;
|
|
char device1[24];
|
|
|
|
union {
|
|
char device2[24];
|
|
int VID;
|
|
unsigned int skb_priority;
|
|
unsigned int name_type;
|
|
unsigned int bind_type;
|
|
unsigned int flag;
|
|
} u;
|
|
|
|
short vlan_qos;
|
|
};
|
|
# 20 "include/linux/if_vlan.h" 2
|
|
# 39 "include/linux/if_vlan.h"
|
|
struct vlan_hdr {
|
|
__be16 h_vlan_TCI;
|
|
__be16 h_vlan_encapsulated_proto;
|
|
};
|
|
# 52 "include/linux/if_vlan.h"
|
|
struct vlan_ethhdr {
|
|
unsigned char h_dest[6];
|
|
unsigned char h_source[6];
|
|
__be16 h_vlan_proto;
|
|
__be16 h_vlan_TCI;
|
|
__be16 h_vlan_encapsulated_proto;
|
|
};
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb)
|
|
{
|
|
return (struct vlan_ethhdr *)skb_mac_header(skb);
|
|
}
|
|
# 75 "include/linux/if_vlan.h"
|
|
extern void vlan_ioctl_set(int (*hook)(struct net *, void *));
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool is_vlan_dev(struct net_device *dev)
|
|
{
|
|
return dev->priv_flags & IFF_802_1Q_VLAN;
|
|
}
|
|
# 97 "include/linux/if_vlan.h"
|
|
struct vlan_pcpu_stats {
|
|
u64 rx_packets;
|
|
u64 rx_bytes;
|
|
u64 rx_multicast;
|
|
u64 tx_packets;
|
|
u64 tx_bytes;
|
|
struct u64_stats_sync syncp;
|
|
u32 rx_errors;
|
|
u32 tx_dropped;
|
|
};
|
|
|
|
|
|
|
|
extern struct net_device *__vlan_find_dev_deep_rcu(struct net_device *real_dev,
|
|
__be16 vlan_proto, u16 vlan_id);
|
|
extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
|
|
extern u16 vlan_dev_vlan_id(const struct net_device *dev);
|
|
extern __be16 vlan_dev_vlan_proto(const struct net_device *dev);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct vlan_priority_tci_mapping {
|
|
u32 priority;
|
|
u16 vlan_qos;
|
|
struct vlan_priority_tci_mapping *next;
|
|
};
|
|
|
|
struct proc_dir_entry;
|
|
struct netpoll;
|
|
# 145 "include/linux/if_vlan.h"
|
|
struct vlan_dev_priv {
|
|
unsigned int nr_ingress_mappings;
|
|
u32 ingress_priority_map[8];
|
|
unsigned int nr_egress_mappings;
|
|
struct vlan_priority_tci_mapping *egress_priority_map[16];
|
|
|
|
__be16 vlan_proto;
|
|
u16 vlan_id;
|
|
u16 flags;
|
|
|
|
struct net_device *real_dev;
|
|
unsigned char real_dev_addr[6];
|
|
|
|
struct proc_dir_entry *dent;
|
|
struct vlan_pcpu_stats *vlan_pcpu_stats;
|
|
|
|
|
|
|
|
unsigned int nest_level;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct vlan_dev_priv *vlan_dev_priv(const struct net_device *dev)
|
|
{
|
|
return netdev_priv(dev);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u16
|
|
vlan_dev_get_egress_qos_mask(struct net_device *dev, u32 skprio)
|
|
{
|
|
struct vlan_priority_tci_mapping *mp;
|
|
|
|
__asm__ __volatile__ ("dmb " "ish" : : : "memory");
|
|
|
|
mp = vlan_dev_priv(dev)->egress_priority_map[(skprio & 0xF)];
|
|
while (mp) {
|
|
if (mp->priority == skprio) {
|
|
return mp->vlan_qos;
|
|
|
|
|
|
}
|
|
mp = mp->next;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
extern bool vlan_do_receive(struct sk_buff **skb);
|
|
|
|
extern int vlan_vid_add(struct net_device *dev, __be16 proto, u16 vid);
|
|
extern void vlan_vid_del(struct net_device *dev, __be16 proto, u16 vid);
|
|
|
|
extern int vlan_vids_add_by_dev(struct net_device *dev,
|
|
const struct net_device *by_dev);
|
|
extern void vlan_vids_del_by_dev(struct net_device *dev,
|
|
const struct net_device *by_dev);
|
|
|
|
extern bool vlan_uses_dev(const struct net_device *dev);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int vlan_get_encap_level(struct net_device *dev)
|
|
{
|
|
do { if (__builtin_expect(!!(!is_vlan_dev(dev)), 0)) do { asm volatile("1:\t" ".long " "((0xe7f001f2) & 0xFFFFFFFF)" "\n\t" "\n" ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" "2:\t.asciz " "\"include/linux/if_vlan.h\"" "\n" ".popsection\n" ".pushsection __bug_table,\"a\"\n" ".align 2\n" "3:\t.word 1b, 2b\n" "\t.hword " "204" ", 0\n" ".popsection"); __builtin_unreachable(); } while (0); } while (0);
|
|
return vlan_dev_priv(dev)->nest_level;
|
|
}
|
|
# 275 "include/linux/if_vlan.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool vlan_hw_offload_capable(netdev_features_t features,
|
|
__be16 proto)
|
|
{
|
|
if (proto == (( __be16)(__builtin_constant_p((__u16)((0x8100))) ? ((__u16)( (((__u16)((0x8100)) & (__u16)0x00ffU) << 8) | (((__u16)((0x8100)) & (__u16)0xff00U) >> 8))) : __fswab16((0x8100)))) && features & ((netdev_features_t)1 << (NETIF_F_HW_VLAN_CTAG_TX_BIT)))
|
|
return true;
|
|
if (proto == (( __be16)(__builtin_constant_p((__u16)((0x88A8))) ? ((__u16)( (((__u16)((0x88A8)) & (__u16)0x00ffU) << 8) | (((__u16)((0x88A8)) & (__u16)0xff00U) >> 8))) : __fswab16((0x88A8)))) && features & ((netdev_features_t)1 << (NETIF_F_HW_VLAN_STAG_TX_BIT)))
|
|
return true;
|
|
return false;
|
|
}
|
|
# 296 "include/linux/if_vlan.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __vlan_insert_tag(struct sk_buff *skb,
|
|
__be16 vlan_proto, u16 vlan_tci)
|
|
{
|
|
struct vlan_ethhdr *veth;
|
|
|
|
if (skb_cow_head(skb, 4) < 0)
|
|
return -12;
|
|
|
|
veth = (struct vlan_ethhdr *)skb_push(skb, 4);
|
|
|
|
|
|
memmove(skb->data, skb->data + 4, 2 * 6);
|
|
skb->mac_header -= 4;
|
|
|
|
|
|
veth->h_vlan_proto = vlan_proto;
|
|
|
|
|
|
veth->h_vlan_TCI = (( __be16)(__builtin_constant_p((__u16)((vlan_tci))) ? ((__u16)( (((__u16)((vlan_tci)) & (__u16)0x00ffU) << 8) | (((__u16)((vlan_tci)) & (__u16)0xff00U) >> 8))) : __fswab16((vlan_tci))));
|
|
|
|
return 0;
|
|
}
|
|
# 333 "include/linux/if_vlan.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *vlan_insert_tag(struct sk_buff *skb,
|
|
__be16 vlan_proto, u16 vlan_tci)
|
|
{
|
|
int err;
|
|
|
|
err = __vlan_insert_tag(skb, vlan_proto, vlan_tci);
|
|
if (err) {
|
|
dev_kfree_skb_any(skb);
|
|
return ((void *)0);
|
|
}
|
|
return skb;
|
|
}
|
|
# 358 "include/linux/if_vlan.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *vlan_insert_tag_set_proto(struct sk_buff *skb,
|
|
__be16 vlan_proto,
|
|
u16 vlan_tci)
|
|
{
|
|
skb = vlan_insert_tag(skb, vlan_proto, vlan_tci);
|
|
if (skb)
|
|
skb->protocol = vlan_proto;
|
|
return skb;
|
|
}
|
|
# 377 "include/linux/if_vlan.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *__vlan_hwaccel_push_inside(struct sk_buff *skb)
|
|
{
|
|
skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto,
|
|
((skb)->vlan_tci & ~0x1000));
|
|
if (__builtin_expect(!!(skb), 1))
|
|
skb->vlan_tci = 0;
|
|
return skb;
|
|
}
|
|
# 395 "include/linux/if_vlan.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *vlan_hwaccel_push_inside(struct sk_buff *skb)
|
|
{
|
|
if (((skb)->vlan_tci & 0x1000))
|
|
skb = __vlan_hwaccel_push_inside(skb);
|
|
return skb;
|
|
}
|
|
# 410 "include/linux/if_vlan.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __vlan_hwaccel_put_tag(struct sk_buff *skb,
|
|
__be16 vlan_proto, u16 vlan_tci)
|
|
{
|
|
skb->vlan_proto = vlan_proto;
|
|
skb->vlan_tci = 0x1000 | vlan_tci;
|
|
}
|
|
# 424 "include/linux/if_vlan.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci)
|
|
{
|
|
struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data;
|
|
|
|
if (veth->h_vlan_proto != (( __be16)(__builtin_constant_p((__u16)((0x8100))) ? ((__u16)( (((__u16)((0x8100)) & (__u16)0x00ffU) << 8) | (((__u16)((0x8100)) & (__u16)0xff00U) >> 8))) : __fswab16((0x8100)))) &&
|
|
veth->h_vlan_proto != (( __be16)(__builtin_constant_p((__u16)((0x88A8))) ? ((__u16)( (((__u16)((0x88A8)) & (__u16)0x00ffU) << 8) | (((__u16)((0x88A8)) & (__u16)0xff00U) >> 8))) : __fswab16((0x88A8)))))
|
|
return -22;
|
|
|
|
*vlan_tci = (__builtin_constant_p((__u16)(( __u16)(__be16)(veth->h_vlan_TCI))) ? ((__u16)( (((__u16)(( __u16)(__be16)(veth->h_vlan_TCI)) & (__u16)0x00ffU) << 8) | (((__u16)(( __u16)(__be16)(veth->h_vlan_TCI)) & (__u16)0xff00U) >> 8))) : __fswab16(( __u16)(__be16)(veth->h_vlan_TCI)));
|
|
return 0;
|
|
}
|
|
# 443 "include/linux/if_vlan.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __vlan_hwaccel_get_tag(const struct sk_buff *skb,
|
|
u16 *vlan_tci)
|
|
{
|
|
if (((skb)->vlan_tci & 0x1000)) {
|
|
*vlan_tci = ((skb)->vlan_tci & ~0x1000);
|
|
return 0;
|
|
} else {
|
|
*vlan_tci = 0;
|
|
return -22;
|
|
}
|
|
}
|
|
# 464 "include/linux/if_vlan.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci)
|
|
{
|
|
if (skb->dev->features & ((netdev_features_t)1 << (NETIF_F_HW_VLAN_CTAG_TX_BIT))) {
|
|
return __vlan_hwaccel_get_tag(skb, vlan_tci);
|
|
} else {
|
|
return __vlan_get_tag(skb, vlan_tci);
|
|
}
|
|
}
|
|
# 482 "include/linux/if_vlan.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __be16 __vlan_get_protocol(struct sk_buff *skb, __be16 type,
|
|
int *depth)
|
|
{
|
|
unsigned int vlan_depth = skb->mac_len;
|
|
|
|
|
|
|
|
|
|
|
|
if (type == (( __be16)(__builtin_constant_p((__u16)((0x8100))) ? ((__u16)( (((__u16)((0x8100)) & (__u16)0x00ffU) << 8) | (((__u16)((0x8100)) & (__u16)0xff00U) >> 8))) : __fswab16((0x8100)))) || type == (( __be16)(__builtin_constant_p((__u16)((0x88A8))) ? ((__u16)( (((__u16)((0x88A8)) & (__u16)0x00ffU) << 8) | (((__u16)((0x88A8)) & (__u16)0xff00U) >> 8))) : __fswab16((0x88A8))))) {
|
|
if (vlan_depth) {
|
|
if (({ int __ret_warn_on = !!(vlan_depth < 4); if (__builtin_expect(!!(__ret_warn_on), 0)) warn_slowpath_null("include/linux/if_vlan.h", 493); __builtin_expect(!!(__ret_warn_on), 0); }))
|
|
return 0;
|
|
vlan_depth -= 4;
|
|
} else {
|
|
vlan_depth = 14;
|
|
}
|
|
do {
|
|
struct vlan_hdr *vh;
|
|
|
|
if (__builtin_expect(!!(!pskb_may_pull(skb, vlan_depth + 4)), 0)
|
|
)
|
|
return 0;
|
|
|
|
vh = (struct vlan_hdr *)(skb->data + vlan_depth);
|
|
type = vh->h_vlan_encapsulated_proto;
|
|
vlan_depth += 4;
|
|
} while (type == (( __be16)(__builtin_constant_p((__u16)((0x8100))) ? ((__u16)( (((__u16)((0x8100)) & (__u16)0x00ffU) << 8) | (((__u16)((0x8100)) & (__u16)0xff00U) >> 8))) : __fswab16((0x8100)))) ||
|
|
type == (( __be16)(__builtin_constant_p((__u16)((0x88A8))) ? ((__u16)( (((__u16)((0x88A8)) & (__u16)0x00ffU) << 8) | (((__u16)((0x88A8)) & (__u16)0xff00U) >> 8))) : __fswab16((0x88A8)))));
|
|
}
|
|
|
|
if (depth)
|
|
*depth = vlan_depth;
|
|
|
|
return type;
|
|
}
|
|
# 526 "include/linux/if_vlan.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __be16 vlan_get_protocol(struct sk_buff *skb)
|
|
{
|
|
return __vlan_get_protocol(skb, skb->protocol, ((void *)0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void vlan_set_encap_proto(struct sk_buff *skb,
|
|
struct vlan_hdr *vhdr)
|
|
{
|
|
__be16 proto;
|
|
unsigned short *rawp;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proto = vhdr->h_vlan_encapsulated_proto;
|
|
if (eth_proto_is_802_3(proto)) {
|
|
skb->protocol = proto;
|
|
return;
|
|
}
|
|
|
|
rawp = (unsigned short *)(vhdr + 1);
|
|
if (*rawp == 0xFFFF)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
skb->protocol = (( __be16)(__builtin_constant_p((__u16)((0x0001))) ? ((__u16)( (((__u16)((0x0001)) & (__u16)0x00ffU) << 8) | (((__u16)((0x0001)) & (__u16)0xff00U) >> 8))) : __fswab16((0x0001))));
|
|
else
|
|
|
|
|
|
|
|
skb->protocol = (( __be16)(__builtin_constant_p((__u16)((0x0004))) ? ((__u16)( (((__u16)((0x0004)) & (__u16)0x00ffU) << 8) | (((__u16)((0x0004)) & (__u16)0xff00U) >> 8))) : __fswab16((0x0004))));
|
|
}
|
|
# 572 "include/linux/if_vlan.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_vlan_tagged(const struct sk_buff *skb)
|
|
{
|
|
if (!((skb)->vlan_tci & 0x1000) &&
|
|
__builtin_expect(!!(skb->protocol != (( __be16)(__builtin_constant_p((__u16)((0x8100))) ? ((__u16)( (((__u16)((0x8100)) & (__u16)0x00ffU) << 8) | (((__u16)((0x8100)) & (__u16)0xff00U) >> 8))) : __fswab16((0x8100)))) && skb->protocol != (( __be16)(__builtin_constant_p((__u16)((0x88A8))) ? ((__u16)( (((__u16)((0x88A8)) & (__u16)0x00ffU) << 8) | (((__u16)((0x88A8)) & (__u16)0xff00U) >> 8))) : __fswab16((0x88A8))))), 1)
|
|
)
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
# 589 "include/linux/if_vlan.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool skb_vlan_tagged_multi(const struct sk_buff *skb)
|
|
{
|
|
__be16 protocol = skb->protocol;
|
|
|
|
if (!((skb)->vlan_tci & 0x1000)) {
|
|
struct vlan_ethhdr *veh;
|
|
|
|
if (__builtin_expect(!!(protocol != (( __be16)(__builtin_constant_p((__u16)((0x8100))) ? ((__u16)( (((__u16)((0x8100)) & (__u16)0x00ffU) << 8) | (((__u16)((0x8100)) & (__u16)0xff00U) >> 8))) : __fswab16((0x8100)))) && protocol != (( __be16)(__builtin_constant_p((__u16)((0x88A8))) ? ((__u16)( (((__u16)((0x88A8)) & (__u16)0x00ffU) << 8) | (((__u16)((0x88A8)) & (__u16)0xff00U) >> 8))) : __fswab16((0x88A8))))), 1)
|
|
)
|
|
return false;
|
|
|
|
veh = (struct vlan_ethhdr *)skb->data;
|
|
protocol = veh->h_vlan_encapsulated_proto;
|
|
}
|
|
|
|
if (protocol != (( __be16)(__builtin_constant_p((__u16)((0x8100))) ? ((__u16)( (((__u16)((0x8100)) & (__u16)0x00ffU) << 8) | (((__u16)((0x8100)) & (__u16)0xff00U) >> 8))) : __fswab16((0x8100)))) && protocol != (( __be16)(__builtin_constant_p((__u16)((0x88A8))) ? ((__u16)( (((__u16)((0x88A8)) & (__u16)0x00ffU) << 8) | (((__u16)((0x88A8)) & (__u16)0xff00U) >> 8))) : __fswab16((0x88A8)))))
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
# 617 "include/linux/if_vlan.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) netdev_features_t vlan_features_check(const struct sk_buff *skb,
|
|
netdev_features_t features)
|
|
{
|
|
if (skb_vlan_tagged_multi(skb)) {
|
|
|
|
|
|
|
|
|
|
|
|
features &= ((netdev_features_t)1 << (NETIF_F_SG_BIT)) | ((netdev_features_t)1 << (NETIF_F_HIGHDMA_BIT)) | ((netdev_features_t)1 << (NETIF_F_HW_CSUM_BIT)) |
|
|
((netdev_features_t)1 << (NETIF_F_FRAGLIST_BIT)) | ((netdev_features_t)1 << (NETIF_F_HW_VLAN_CTAG_TX_BIT)) |
|
|
((netdev_features_t)1 << (NETIF_F_HW_VLAN_STAG_TX_BIT));
|
|
}
|
|
return features;
|
|
}
|
|
# 642 "include/linux/if_vlan.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long compare_vlan_header(const struct vlan_hdr *h1,
|
|
const struct vlan_hdr *h2)
|
|
{
|
|
|
|
return *(u32 *)h1 ^ *(u32 *)h2;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
# 54 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c" 2
|
|
# 1 "include/linux/if_pppox.h" 1
|
|
# 20 "include/linux/if_pppox.h"
|
|
# 1 "include/linux/ppp_channel.h" 1
|
|
# 27 "include/linux/ppp_channel.h"
|
|
struct ppp_channel;
|
|
|
|
struct ppp_channel_ops {
|
|
|
|
|
|
int (*start_xmit)(struct ppp_channel *, struct sk_buff *);
|
|
|
|
int (*ioctl)(struct ppp_channel *, unsigned int, unsigned long);
|
|
};
|
|
|
|
struct ppp_channel {
|
|
void *private;
|
|
const struct ppp_channel_ops *ops;
|
|
int mtu;
|
|
int hdrlen;
|
|
void *ppp;
|
|
int speed;
|
|
|
|
int latency;
|
|
};
|
|
|
|
|
|
|
|
extern void ppp_output_wakeup(struct ppp_channel *);
|
|
|
|
|
|
|
|
extern void ppp_input(struct ppp_channel *, struct sk_buff *);
|
|
|
|
|
|
|
|
extern void ppp_input_error(struct ppp_channel *, int code);
|
|
|
|
|
|
extern int ppp_register_net_channel(struct net *, struct ppp_channel *);
|
|
|
|
|
|
extern int ppp_register_channel(struct ppp_channel *);
|
|
|
|
|
|
extern void ppp_unregister_channel(struct ppp_channel *);
|
|
|
|
|
|
extern int ppp_channel_index(struct ppp_channel *);
|
|
|
|
|
|
extern int ppp_unit_number(struct ppp_channel *);
|
|
|
|
|
|
extern char *ppp_dev_name(struct ppp_channel *);
|
|
# 21 "include/linux/if_pppox.h" 2
|
|
|
|
|
|
# 1 "include/uapi/linux/if_pppox.h" 1
|
|
# 25 "include/uapi/linux/if_pppox.h"
|
|
# 1 "include/linux/if_pppol2tp.h" 1
|
|
# 19 "include/linux/if_pppol2tp.h"
|
|
# 1 "include/uapi/linux/if_pppol2tp.h" 1
|
|
# 24 "include/uapi/linux/if_pppol2tp.h"
|
|
struct pppol2tp_addr {
|
|
__kernel_pid_t pid;
|
|
|
|
int fd;
|
|
|
|
struct sockaddr_in addr;
|
|
|
|
__u16 s_tunnel, s_session;
|
|
__u16 d_tunnel, d_session;
|
|
};
|
|
|
|
|
|
|
|
|
|
struct pppol2tpin6_addr {
|
|
__kernel_pid_t pid;
|
|
|
|
int fd;
|
|
|
|
__u16 s_tunnel, s_session;
|
|
__u16 d_tunnel, d_session;
|
|
|
|
struct sockaddr_in6 addr;
|
|
};
|
|
|
|
|
|
|
|
|
|
struct pppol2tpv3_addr {
|
|
__kernel_pid_t pid;
|
|
|
|
int fd;
|
|
|
|
struct sockaddr_in addr;
|
|
|
|
__u32 s_tunnel, s_session;
|
|
__u32 d_tunnel, d_session;
|
|
};
|
|
|
|
struct pppol2tpv3in6_addr {
|
|
__kernel_pid_t pid;
|
|
|
|
int fd;
|
|
|
|
__u32 s_tunnel, s_session;
|
|
__u32 d_tunnel, d_session;
|
|
|
|
struct sockaddr_in6 addr;
|
|
};
|
|
# 84 "include/uapi/linux/if_pppol2tp.h"
|
|
enum {
|
|
PPPOL2TP_SO_DEBUG = 1,
|
|
PPPOL2TP_SO_RECVSEQ = 2,
|
|
PPPOL2TP_SO_SENDSEQ = 3,
|
|
PPPOL2TP_SO_LNSMODE = 4,
|
|
PPPOL2TP_SO_REORDERTO = 5,
|
|
};
|
|
|
|
|
|
enum {
|
|
PPPOL2TP_MSG_DEBUG = (1 << 0),
|
|
|
|
PPPOL2TP_MSG_CONTROL = (1 << 1),
|
|
|
|
PPPOL2TP_MSG_SEQ = (1 << 2),
|
|
PPPOL2TP_MSG_DATA = (1 << 3),
|
|
};
|
|
# 20 "include/linux/if_pppol2tp.h" 2
|
|
# 26 "include/uapi/linux/if_pppox.h" 2
|
|
# 39 "include/uapi/linux/if_pppox.h"
|
|
typedef __be16 sid_t;
|
|
struct pppoe_addr {
|
|
sid_t sid;
|
|
unsigned char remote[6];
|
|
char dev[16];
|
|
};
|
|
|
|
|
|
|
|
|
|
struct pptp_addr {
|
|
__u16 call_id;
|
|
struct in_addr sin_addr;
|
|
};
|
|
# 62 "include/uapi/linux/if_pppox.h"
|
|
struct sockaddr_pppox {
|
|
__kernel_sa_family_t sa_family;
|
|
unsigned int sa_protocol;
|
|
union {
|
|
struct pppoe_addr pppoe;
|
|
struct pptp_addr pptp;
|
|
} sa_addr;
|
|
} __attribute__((packed));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct sockaddr_pppol2tp {
|
|
__kernel_sa_family_t sa_family;
|
|
unsigned int sa_protocol;
|
|
struct pppol2tp_addr pppol2tp;
|
|
} __attribute__((packed));
|
|
|
|
struct sockaddr_pppol2tpin6 {
|
|
__kernel_sa_family_t sa_family;
|
|
unsigned int sa_protocol;
|
|
struct pppol2tpin6_addr pppol2tp;
|
|
} __attribute__((packed));
|
|
|
|
|
|
|
|
|
|
struct sockaddr_pppol2tpv3 {
|
|
__kernel_sa_family_t sa_family;
|
|
unsigned int sa_protocol;
|
|
struct pppol2tpv3_addr pppol2tp;
|
|
} __attribute__((packed));
|
|
|
|
struct sockaddr_pppol2tpv3in6 {
|
|
__kernel_sa_family_t sa_family;
|
|
unsigned int sa_protocol;
|
|
struct pppol2tpv3in6_addr pppol2tp;
|
|
} __attribute__((packed));
|
|
# 119 "include/uapi/linux/if_pppox.h"
|
|
struct pppoe_tag {
|
|
__be16 tag_type;
|
|
__be16 tag_len;
|
|
char tag_data[0];
|
|
} __attribute__ ((packed));
|
|
# 137 "include/uapi/linux/if_pppox.h"
|
|
struct pppoe_hdr {
|
|
|
|
__u8 type : 4;
|
|
__u8 ver : 4;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__u8 code;
|
|
__be16 sid;
|
|
__be16 length;
|
|
struct pppoe_tag tag[0];
|
|
} __attribute__((packed));
|
|
# 24 "include/linux/if_pppox.h" 2
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pppoe_hdr *pppoe_hdr(const struct sk_buff *skb)
|
|
{
|
|
return (struct pppoe_hdr *)skb_network_header(skb);
|
|
}
|
|
|
|
struct pppoe_opt {
|
|
struct net_device *dev;
|
|
int ifindex;
|
|
struct pppoe_addr pa;
|
|
struct sockaddr_pppox relay;
|
|
|
|
struct work_struct padt_work;
|
|
};
|
|
|
|
struct pptp_opt {
|
|
struct pptp_addr src_addr;
|
|
struct pptp_addr dst_addr;
|
|
u32 ack_sent, ack_recv;
|
|
u32 seq_sent, seq_recv;
|
|
int ppp_flags;
|
|
};
|
|
|
|
|
|
struct pppox_sock {
|
|
|
|
struct sock sk;
|
|
struct ppp_channel chan;
|
|
struct pppox_sock *next;
|
|
union {
|
|
struct pppoe_opt pppoe;
|
|
struct pptp_opt pptp;
|
|
} proto;
|
|
__be16 num;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct pppox_sock *pppox_sk(struct sock *sk)
|
|
{
|
|
return (struct pppox_sock *)sk;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sock *sk_pppox(struct pppox_sock *po)
|
|
{
|
|
return (struct sock *)po;
|
|
}
|
|
|
|
struct module;
|
|
|
|
struct pppox_proto {
|
|
int (*create)(struct net *net, struct socket *sock, int kern);
|
|
int (*ioctl)(struct socket *sock, unsigned int cmd,
|
|
unsigned long arg);
|
|
struct module *owner;
|
|
};
|
|
|
|
extern int register_pppox_proto(int proto_num, const struct pppox_proto *pp);
|
|
extern void unregister_pppox_proto(int proto_num);
|
|
extern void pppox_unbind_sock(struct sock *sk);
|
|
extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
|
|
|
|
|
|
enum {
|
|
PPPOX_NONE = 0,
|
|
PPPOX_CONNECTED = 1,
|
|
PPPOX_BOUND = 2,
|
|
PPPOX_RELAY = 4,
|
|
PPPOX_ZOMBIE = 8,
|
|
PPPOX_DEAD = 16
|
|
};
|
|
# 55 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c" 2
|
|
# 1 "include/linux/ppp_defs.h" 1
|
|
# 13 "include/linux/ppp_defs.h"
|
|
# 1 "include/linux/crc-ccitt.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
extern u16 const crc_ccitt_table[256];
|
|
|
|
extern u16 crc_ccitt(u16 crc, const u8 *buffer, size_t len);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u16 crc_ccitt_byte(u16 crc, const u8 c)
|
|
{
|
|
return (crc >> 8) ^ crc_ccitt_table[(crc ^ c) & 0xff];
|
|
}
|
|
# 14 "include/linux/ppp_defs.h" 2
|
|
# 1 "include/uapi/linux/ppp_defs.h" 1
|
|
# 74 "include/uapi/linux/ppp_defs.h"
|
|
typedef __u32 ext_accm[8];
|
|
|
|
|
|
|
|
|
|
enum NPmode {
|
|
NPMODE_PASS,
|
|
NPMODE_DROP,
|
|
NPMODE_ERROR,
|
|
NPMODE_QUEUE
|
|
};
|
|
|
|
|
|
|
|
|
|
struct pppstat {
|
|
__u32 ppp_discards;
|
|
|
|
__u32 ppp_ibytes;
|
|
__u32 ppp_ioctects;
|
|
__u32 ppp_ipackets;
|
|
__u32 ppp_ierrors;
|
|
__u32 ppp_ilqrs;
|
|
|
|
__u32 ppp_obytes;
|
|
__u32 ppp_ooctects;
|
|
__u32 ppp_opackets;
|
|
__u32 ppp_oerrors;
|
|
__u32 ppp_olqrs;
|
|
};
|
|
|
|
struct vjstat {
|
|
__u32 vjs_packets;
|
|
__u32 vjs_compressed;
|
|
__u32 vjs_searches;
|
|
__u32 vjs_misses;
|
|
__u32 vjs_uncompressedin;
|
|
__u32 vjs_compressedin;
|
|
__u32 vjs_errorin;
|
|
__u32 vjs_tossed;
|
|
};
|
|
|
|
struct compstat {
|
|
__u32 unc_bytes;
|
|
__u32 unc_packets;
|
|
__u32 comp_bytes;
|
|
__u32 comp_packets;
|
|
__u32 inc_bytes;
|
|
__u32 inc_packets;
|
|
|
|
|
|
__u32 in_count;
|
|
__u32 bytes_out;
|
|
|
|
double ratio;
|
|
};
|
|
|
|
struct ppp_stats {
|
|
struct pppstat p;
|
|
struct vjstat vj;
|
|
};
|
|
|
|
struct ppp_comp_stats {
|
|
struct compstat c;
|
|
struct compstat d;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct ppp_idle {
|
|
__kernel_time_t xmit_idle;
|
|
__kernel_time_t recv_idle;
|
|
};
|
|
# 15 "include/linux/ppp_defs.h" 2
|
|
# 56 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c" 2
|
|
|
|
# 1 "include/linux/foe_hook.h" 1
|
|
# 433 "include/linux/foe_hook.h"
|
|
extern int (*ra_sw_wifi_hook_is_wifi_down) (struct sk_buff * skb, int band);
|
|
extern int (*ra_sw_wifi_hook_wifi_down_handle) (struct net_device *dev);
|
|
extern int (*ra_sw_wifi_hook_wifi_up_handle) (struct net_device *dev);
|
|
# 58 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c" 2
|
|
# 1 "include/linux/libcompileoption.h" 1
|
|
# 19 "include/linux/libcompileoption.h"
|
|
typedef int CompileOption_Val;
|
|
|
|
extern CompileOption_Val TCSUPPORT_MANUAL_ETHERNET_PORTMAP_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_VLAN_TAG_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_VLAN_TAG_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_TCAPI_ENHANCE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CUC_C5_2P_VAL;
|
|
|
|
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_GD_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_GDV20_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_CZ_GDCS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_CY_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_ZARLINK_LE89156A_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_ZARLINK_LE89156B_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_CY_JX_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_BIND2_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_JS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_FJ_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_GX_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_CQ_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_UPG_PINGPONG_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_BACKUPROMFILE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_PRODUCTIONLINE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CUC_CWMP_PARAMETER_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_NOTDEFAULTROMFILEAREA_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_MIDWARE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CDS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_VLAN_DOT1P_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_VLAN_PASSTHROUGH_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CUC_FJ_SFU_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_BACKUPROMFILEENCHANCEMENT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CUC_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CY_PON_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PHONEAPP_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_C9_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_JS_IP_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_VOIP_LED_APPCTRL_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_VOIP_CRYPT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_PON_FH_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_VOIP_SIP_DNS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_AUTOBENCH_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_YN_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_DEV_ACCESS_TYPE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_ECN_GZ_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_WANNINDEX_INCREASE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_MONITORCOLLECTOR_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PPPOE_EMULATOR_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_NMG_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CY_E8_SFU_VAL;
|
|
|
|
extern CompileOption_Val CT_COM_DEVICEREG_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_ITMS_CONFIG_AS_DEFAULT_VAL;
|
|
extern CompileOption_Val TCSUPPORT_DMS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_UPNP_DM_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_TR69_IP_HOST_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_PON_IP_HOST_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PPPINFORM_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_C1_MS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_C1_ZY_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_PONMGR_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_PMMGR_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_WAN_ATM_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CPU_MT7505_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_SWQOS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_SIMCARD_SEPARATION_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_2PORTS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_LAN_VLAN_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_LAN_VLAN_RANGE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_HWNAT_L2VID_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_IFC_EN_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_SN_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_WAN_PTM_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_C1_CUC_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_SYSLOG_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PORT_BIND_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_GUIACCESSLIMIT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PPPOEPROXY_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_ZIPROMFILE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_RESERVEAREA_EXTEND_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_C7_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CY_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_E8B_ADSL_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_WANNODE_MAPPING_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_BLOCK_PROCESS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_ROUTEPOLICY_PRIOR_PORTBIND_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CPU_MT7510_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CPU_MT7520_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_TRUE_LANDING_PAGE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CWMP_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CWMP_TR181_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CWMP_NO_HOST_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_WLAN_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_TEST_WLAN_SHORTCUT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_INIC_CLIENT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CZ_GENERAL_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_KEYPARA_STORE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_VPN_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_MULTI_BOOT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_START_TRAP_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_SYSLOG_ENHANCE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_WLAN_AC_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CWMP_FAST_GET_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CD_DDNS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_WAN_GPON_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_WAN_EPON_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_WAN_ETHER_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_WAN_XSI_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_HSGMII_LAN_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_ACTIVE_ETHERNET_WAN_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_OMCI_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_EPON_OAM_CTC_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CMDPROMPT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_RANDOM_INFORM_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_SERVICELIST_E8C_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_ALARMMONITOR_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CZ_TM_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_INFORM_NODE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_LONG_RESETBTN_VAL;
|
|
|
|
extern CompileOption_Val CWMP_REDIRECT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PPP_ONDEMAND_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PPP_MANUALLY_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_CWMP_ZIPROMFILE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_TR69_BIND_PVC_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_NO_BOOT_VALUECHANGE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CROSS_REBOOT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_BHARTI_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_TTNET_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CWMP_PRECISE_TIME_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_C1_NEW_GUI_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_PROLINE_CMD_ACTION_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_MULTISERVICE_ON_WAN_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_UPNP_ENHANCE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_C1_OBM_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_WAN_PTM_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CD_NEW_GUI_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CCT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CLMP_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_SAGECOM_CWMP_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_FW_UPGRADE_DELAY_VAL;
|
|
|
|
extern CompileOption_Val AZTECH_CWMP_REORDER_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CWMP_IOT_STRINGTYPE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CWMP_FAULT_RESPONSE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CWMP_CRPORTCHANGE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_WEB_INTERCEPTION_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_MNT_CONF_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_FTP_USB_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_FTP_DOWNLOADCLIENT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_NEWGUI_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_IPV6_FIREWALL_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_IPV6_FIREWALL_RFC2827_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_PRODUCTIONLINE_CONTENT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_HWQOS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CHT_RAMENU_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_EPON_OAM_LAN_DBG_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_E8B_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_VLAN_BIND_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_DSLITE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_TC2031_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_HWNAT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_HWNAT_WAN_ACCOUNT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CUC_QOS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_1FXS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_2PORTS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_C7_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_USBHOST_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_STANDARD_E8C_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_IPV6_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_WLAN_RT3390_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_WLAN_RT3090_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_WLAN_RT5392_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_WLAN_MULTIDRIVER_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_WLAN_MT7592_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_OMCI_ALCATEL_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_GPON_MAPPING_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_EPON_MAPPING_VAL;
|
|
extern CompileOption_Val TCSUPPORT_PON_USER_ISOLATION_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_PON_VLAN_FILTER_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_PON_MAC_FILTER_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_XPON_IGMP_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_PON_SFU_HGU_HYBRID_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_MULTICAST_SPEED_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_XPON_HAL_API_QOS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_XPON_HAL_API_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_XPON_HAL_API_EXT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_XPON_PON_QOS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_PON_VLAN_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_OMCI_LAN_DEBUG_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_XPON_LED_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_UPSTREAM_VLAN_POLICER_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_GPON_DOWNSTREAM_MAPPING_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_IGMP_SET_GROUP_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CD_WIND_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_ARC_CWMP_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_BUTTONDETECT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_ECN_SIP_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_ECN_MEGACO_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_VOIP_SIP_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CHS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_VOIP_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_SLIC_ZL88801_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_JX_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_STBMAC_REPORT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PMINFORM_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_HUB_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_ADSL_HN_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_SC_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_C9_HUN_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_TR143_WGET_DOWNLOAD_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_TR143_CURL_UPLOAD_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_ADSL_TJ_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_ADSL_BIND1_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_NAMECHGNOTIFY_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_C5_HEN_SFU_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_SFU_SX_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_EPON_DUMMY_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_HWNAT_OFFLOAD_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_DS_HWNAT_OFFLOAD_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_SK_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CMCC_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CMCCV2_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CMCC_GANSU_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CSC_EEUROPE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_ITMS_TMOUT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CPU_PERFORMANCE_TEST_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_XPON_IGMP_CHT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_WAN_UPSTREAM_REMARK_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_XPON_HAL_API_MCST_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CPU_EN75XX_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CPU_EN758X_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CPU_EN7528_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CPU_EN7512_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_JOYME_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CMCC_ENTERPRISE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_JOYME2_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_JOYME4_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_JOYME_BANDWIDTH_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_FH_JOYMEV2_PON_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_C9_ROST_LED_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_CWMP_WORK_COMPATIBLE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_UPGRADE_NO_REBOOT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_CN_JS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CUC_PON_SD_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_PON_ROSTELECOM_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_XPON_LED_UPGRADE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_FWC_ENV_VAL;
|
|
|
|
extern CompileOption_Val RA_NAT_EXE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_DLF_CTRL_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_FWC_QOS_VAL;
|
|
|
|
|
|
extern CompileOption_Val TCSUPPORT_FWC_FDB_VLAN_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_FWC_VLAN_TAG_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_FWC_MCST_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_CZ_GD_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_PON_CZ_NX_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_VNPTT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CCA_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_SWNAT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_TR64_DIGEST_AUTH_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_PORT_ISOLATION_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_TLS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_SDN_OVS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_FH_SDN_PON_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CRJO_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_XPON_HAL_API_NG_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_WLAN_SW_RPS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_IPSEC_PASSTHROUGH_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_MIPS_1004K_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_HIGHMEM_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_GOOGLE_FIBER_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_SMUX_HW_STAT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_IPV6_CWMP_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CWMP_SSL_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CWMP_OPENSSL_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_RA_HWNAT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_RA_HWNAT_ENHANCE_HOOK_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_LRO_ENABLE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_BBF_247_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_NEW_WDOG_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_HWNAT_ADD_DEL_API_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_MULIF_WAN_SAME_MAC_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_ALPHION_PON_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_BB_256KB_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_MULTI_USER_ITF_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CWMP_NG_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_GRE_TUNNEL_HWNAT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CFG_NG_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_IPV6_CEROUTER_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_MULTI_SWITCH_EXT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_USER_DEFINE_FIRST_MAC_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CG_DS_ADD_TAG_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_QDMA_WAN_FOR_ETHER_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_VLAN_ACCESS_TRUNK_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_CONGW_CH_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_DBUS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_VPN_ONDEMAND_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_VPN_PPTP_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_QOS_EIGHT_QUEUE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_WLAN_MT7615_TXOFFLOAD_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_EXTENDED_VLAN_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CDS_CT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_DUAL_WLAN_MT7613E_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_UNKNOW_MULTICAST_COUNT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_NP_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_NP_CMCC_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_ANDLINK_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_PORTBIND_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CATV_GD_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_ASYM_VOD_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CPU_ARMV8_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_FH_UNIFIED_PLATFORM_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_VXLAN_HW_OFFLOAD_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_MAP_INSIDE_AGENT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_WLAN_WDS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_NP_CODE_SHRINK_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_NP_RAM_SHRINK_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CHARSET_CHANGE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_DSL_PHYMODE_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_DSL_PHYMODE_HOST_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_UBUS_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_CT_DS_LIMIT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_SECURE_BOOT_V1_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_SAMBA_4_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_MESH_ROLE_AUTO_DETECT_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_MESH_ETHETWAN_PORT_ONBOARDING_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_NPU_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_NPU_TUNNEL_OFFLOAD_VAL;
|
|
|
|
extern CompileOption_Val TCSUPPORT_NPU_WIFI_OFFLOAD_VAL;
|
|
|
|
void
|
|
init_compileoption_val(void);
|
|
# 59 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c" 2
|
|
# 1 "include/net/ipv6.h" 1
|
|
# 19 "include/net/ipv6.h"
|
|
# 1 "include/net/if_inet6.h" 1
|
|
# 33 "include/net/if_inet6.h"
|
|
enum {
|
|
INET6_IFADDR_STATE_PREDAD,
|
|
INET6_IFADDR_STATE_DAD,
|
|
INET6_IFADDR_STATE_POSTDAD,
|
|
INET6_IFADDR_STATE_ERRDAD,
|
|
INET6_IFADDR_STATE_DEAD,
|
|
};
|
|
|
|
struct inet6_ifaddr {
|
|
struct in6_addr addr;
|
|
__u32 prefix_len;
|
|
|
|
|
|
__u32 valid_lft;
|
|
__u32 prefered_lft;
|
|
atomic_t refcnt;
|
|
spinlock_t lock;
|
|
|
|
int state;
|
|
|
|
__u32 flags;
|
|
__u8 dad_probes;
|
|
__u8 stable_privacy_retry;
|
|
|
|
__u16 scope;
|
|
|
|
unsigned long cstamp;
|
|
unsigned long tstamp;
|
|
|
|
struct delayed_work dad_work;
|
|
|
|
struct inet6_dev *idev;
|
|
struct rt6_info *rt;
|
|
|
|
struct hlist_node addr_lst;
|
|
struct list_head if_list;
|
|
|
|
struct list_head tmp_list;
|
|
struct inet6_ifaddr *ifpub;
|
|
int regen_count;
|
|
|
|
bool tokenized;
|
|
|
|
struct callback_head rcu;
|
|
struct in6_addr peer_addr;
|
|
};
|
|
|
|
struct ip6_sf_socklist {
|
|
unsigned int sl_max;
|
|
unsigned int sl_count;
|
|
struct in6_addr sl_addr[0];
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct ipv6_mc_socklist {
|
|
struct in6_addr addr;
|
|
int ifindex;
|
|
struct ipv6_mc_socklist *next;
|
|
rwlock_t sflock;
|
|
unsigned int sfmode;
|
|
struct ip6_sf_socklist *sflist;
|
|
struct callback_head rcu;
|
|
};
|
|
|
|
struct ip6_sf_list {
|
|
struct ip6_sf_list *sf_next;
|
|
struct in6_addr sf_addr;
|
|
unsigned long sf_count[2];
|
|
unsigned char sf_gsresp;
|
|
unsigned char sf_oldin;
|
|
unsigned char sf_crcount;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct ifmcaddr6 {
|
|
struct in6_addr mca_addr;
|
|
struct inet6_dev *idev;
|
|
struct ifmcaddr6 *next;
|
|
struct ip6_sf_list *mca_sources;
|
|
struct ip6_sf_list *mca_tomb;
|
|
unsigned int mca_sfmode;
|
|
unsigned char mca_crcount;
|
|
unsigned long mca_sfcount[2];
|
|
struct timer_list mca_timer;
|
|
unsigned int mca_flags;
|
|
int mca_users;
|
|
atomic_t mca_refcnt;
|
|
spinlock_t mca_lock;
|
|
unsigned long mca_cstamp;
|
|
unsigned long mca_tstamp;
|
|
};
|
|
|
|
|
|
|
|
struct ipv6_ac_socklist {
|
|
struct in6_addr acl_addr;
|
|
int acl_ifindex;
|
|
struct ipv6_ac_socklist *acl_next;
|
|
};
|
|
|
|
struct ifacaddr6 {
|
|
struct in6_addr aca_addr;
|
|
struct inet6_dev *aca_idev;
|
|
struct rt6_info *aca_rt;
|
|
struct ifacaddr6 *aca_next;
|
|
int aca_users;
|
|
atomic_t aca_refcnt;
|
|
unsigned long aca_cstamp;
|
|
unsigned long aca_tstamp;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct ipv6_devstat {
|
|
struct proc_dir_entry *proc_dir_entry;
|
|
__typeof__(struct ipstats_mib) *ipv6;
|
|
__typeof__(struct icmpv6_mib_device) *icmpv6dev;
|
|
__typeof__(struct icmpv6msg_mib_device) *icmpv6msgdev;
|
|
};
|
|
|
|
struct inet6_dev {
|
|
struct net_device *dev;
|
|
|
|
struct list_head addr_list;
|
|
|
|
struct ifmcaddr6 *mc_list;
|
|
struct ifmcaddr6 *mc_tomb;
|
|
spinlock_t mc_lock;
|
|
|
|
unsigned char mc_qrv;
|
|
unsigned char mc_gq_running;
|
|
unsigned char mc_ifc_count;
|
|
unsigned char mc_dad_count;
|
|
|
|
unsigned long mc_v1_seen;
|
|
unsigned long mc_qi;
|
|
unsigned long mc_qri;
|
|
unsigned long mc_maxdelay;
|
|
|
|
struct timer_list mc_gq_timer;
|
|
struct timer_list mc_ifc_timer;
|
|
struct timer_list mc_dad_timer;
|
|
|
|
struct ifacaddr6 *ac_list;
|
|
rwlock_t lock;
|
|
atomic_t refcnt;
|
|
__u32 if_flags;
|
|
int dead;
|
|
|
|
u8 rndid[8];
|
|
struct timer_list regen_timer;
|
|
struct list_head tempaddr_list;
|
|
|
|
struct in6_addr token;
|
|
|
|
struct neigh_parms *nd_parms;
|
|
struct ipv6_devconf cnf;
|
|
struct ipv6_devstat stats;
|
|
|
|
struct timer_list rs_timer;
|
|
__u8 rs_probes;
|
|
|
|
__u8 addr_gen_mode;
|
|
unsigned long tstamp;
|
|
struct callback_head rcu;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ipv6_eth_mc_map(const struct in6_addr *addr, char *buf)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
buf[0]= 0x33;
|
|
buf[1]= 0x33;
|
|
|
|
memcpy(buf + 2, &addr->in6_u.u6_addr32[3], sizeof(__u32));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ipv6_arcnet_mc_map(const struct in6_addr *addr, char *buf)
|
|
{
|
|
buf[0] = 0x00;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ipv6_ib_mc_map(const struct in6_addr *addr,
|
|
const unsigned char *broadcast, char *buf)
|
|
{
|
|
unsigned char scope = broadcast[5] & 0xF;
|
|
|
|
buf[0] = 0;
|
|
buf[1] = 0xff;
|
|
buf[2] = 0xff;
|
|
buf[3] = 0xff;
|
|
buf[4] = 0xff;
|
|
buf[5] = 0x10 | scope;
|
|
buf[6] = 0x60;
|
|
buf[7] = 0x1b;
|
|
buf[8] = broadcast[8];
|
|
buf[9] = broadcast[9];
|
|
memcpy(buf + 10, addr->in6_u.u6_addr8 + 6, 10);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ipv6_ipgre_mc_map(const struct in6_addr *addr,
|
|
const unsigned char *broadcast, char *buf)
|
|
{
|
|
if ((broadcast[0] | broadcast[1] | broadcast[2] | broadcast[3]) != 0) {
|
|
memcpy(buf, broadcast, 4);
|
|
} else {
|
|
|
|
if ((addr->in6_u.u6_addr32[0] | addr->in6_u.u6_addr32[1] |
|
|
(addr->in6_u.u6_addr32[2] ^ (( __be32)(__builtin_constant_p((__u32)((0x0000ffff))) ? ((__u32)( (((__u32)((0x0000ffff)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x0000ffff)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x0000ffff)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x0000ffff)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x0000ffff)))))) != 0)
|
|
return -22;
|
|
memcpy(buf, &addr->in6_u.u6_addr32[3], 4);
|
|
}
|
|
return 0;
|
|
}
|
|
# 20 "include/net/ipv6.h" 2
|
|
# 1 "include/net/ndisc.h" 1
|
|
# 27 "include/net/ndisc.h"
|
|
enum {
|
|
__ND_OPT_PREFIX_INFO_END = 0,
|
|
ND_OPT_SOURCE_LL_ADDR = 1,
|
|
ND_OPT_TARGET_LL_ADDR = 2,
|
|
ND_OPT_PREFIX_INFO = 3,
|
|
ND_OPT_REDIRECT_HDR = 4,
|
|
ND_OPT_MTU = 5,
|
|
__ND_OPT_ARRAY_MAX,
|
|
ND_OPT_ROUTE_INFO = 24,
|
|
ND_OPT_RDNSS = 25,
|
|
ND_OPT_DNSSL = 31,
|
|
__ND_OPT_MAX
|
|
};
|
|
# 50 "include/net/ndisc.h"
|
|
# 1 "include/linux/if_arp.h" 1
|
|
# 27 "include/linux/if_arp.h"
|
|
# 1 "include/uapi/linux/if_arp.h" 1
|
|
# 113 "include/uapi/linux/if_arp.h"
|
|
struct arpreq {
|
|
struct sockaddr arp_pa;
|
|
struct sockaddr arp_ha;
|
|
int arp_flags;
|
|
struct sockaddr arp_netmask;
|
|
char arp_dev[16];
|
|
};
|
|
|
|
struct arpreq_old {
|
|
struct sockaddr arp_pa;
|
|
struct sockaddr arp_ha;
|
|
int arp_flags;
|
|
struct sockaddr arp_netmask;
|
|
};
|
|
# 141 "include/uapi/linux/if_arp.h"
|
|
struct arphdr {
|
|
__be16 ar_hrd;
|
|
__be16 ar_pro;
|
|
unsigned char ar_hln;
|
|
unsigned char ar_pln;
|
|
__be16 ar_op;
|
|
# 158 "include/uapi/linux/if_arp.h"
|
|
};
|
|
# 28 "include/linux/if_arp.h" 2
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct arphdr *arp_hdr(const struct sk_buff *skb)
|
|
{
|
|
return (struct arphdr *)skb_network_header(skb);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int arp_hdr_len(struct net_device *dev)
|
|
{
|
|
switch (dev->type) {
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
return sizeof(struct arphdr) + (dev->addr_len + sizeof(u32)) * 2;
|
|
}
|
|
}
|
|
# 51 "include/net/ndisc.h" 2
|
|
|
|
# 1 "include/linux/hash.h" 1
|
|
# 51 "include/linux/hash.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __attribute__((always_inline)) u64 hash_64(u64 val, unsigned int bits)
|
|
{
|
|
u64 hash = val;
|
|
|
|
|
|
|
|
|
|
|
|
u64 n = hash;
|
|
n <<= 18;
|
|
hash -= n;
|
|
n <<= 33;
|
|
hash -= n;
|
|
n <<= 3;
|
|
hash += n;
|
|
n <<= 3;
|
|
hash -= n;
|
|
n <<= 4;
|
|
hash += n;
|
|
n <<= 2;
|
|
hash += n;
|
|
|
|
|
|
|
|
return hash >> (64 - bits);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 hash_32(u32 val, unsigned int bits)
|
|
{
|
|
|
|
u32 hash = val * 0x9e370001UL;
|
|
|
|
|
|
return hash >> (32 - bits);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned long hash_ptr(const void *ptr, unsigned int bits)
|
|
{
|
|
return hash_32((unsigned long)ptr, bits);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 hash32_ptr(const void *ptr)
|
|
{
|
|
unsigned long val = (unsigned long)ptr;
|
|
|
|
|
|
|
|
|
|
return (u32)val;
|
|
}
|
|
# 53 "include/net/ndisc.h" 2
|
|
|
|
|
|
|
|
struct ctl_table;
|
|
struct inet6_dev;
|
|
struct net_device;
|
|
struct net_proto_family;
|
|
struct sk_buff;
|
|
|
|
extern struct neigh_table nd_tbl;
|
|
|
|
struct nd_msg {
|
|
struct icmp6hdr icmph;
|
|
struct in6_addr target;
|
|
__u8 opt[0];
|
|
};
|
|
|
|
struct rs_msg {
|
|
struct icmp6hdr icmph;
|
|
__u8 opt[0];
|
|
};
|
|
|
|
struct ra_msg {
|
|
struct icmp6hdr icmph;
|
|
__be32 reachable_time;
|
|
__be32 retrans_timer;
|
|
};
|
|
|
|
struct rd_msg {
|
|
struct icmp6hdr icmph;
|
|
struct in6_addr target;
|
|
struct in6_addr dest;
|
|
__u8 opt[0];
|
|
};
|
|
|
|
struct nd_opt_hdr {
|
|
__u8 nd_opt_type;
|
|
__u8 nd_opt_len;
|
|
} __attribute__((packed));
|
|
|
|
|
|
struct ndisc_options {
|
|
struct nd_opt_hdr *nd_opt_array[__ND_OPT_ARRAY_MAX];
|
|
|
|
|
|
|
|
|
|
struct nd_opt_hdr *nd_useropts;
|
|
struct nd_opt_hdr *nd_useropts_end;
|
|
};
|
|
# 113 "include/net/ndisc.h"
|
|
struct ndisc_options *ndisc_parse_options(u8 *opt, int opt_len,
|
|
struct ndisc_options *ndopts);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ndisc_addr_option_pad(unsigned short type)
|
|
{
|
|
switch (type) {
|
|
case 32: return 2;
|
|
default: return 0;
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ndisc_opt_addr_space(struct net_device *dev)
|
|
{
|
|
return (((dev->addr_len + ndisc_addr_option_pad(dev->type))+2+7)&~7)
|
|
;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u8 *ndisc_opt_addr_data(struct nd_opt_hdr *p,
|
|
struct net_device *dev)
|
|
{
|
|
u8 *lladdr = (u8 *)(p + 1);
|
|
int lladdrlen = p->nd_opt_len << 3;
|
|
int prepad = ndisc_addr_option_pad(dev->type);
|
|
if (lladdrlen != ndisc_opt_addr_space(dev))
|
|
return ((void *)0);
|
|
return lladdr + prepad;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 ndisc_hashfn(const void *pkey, const struct net_device *dev, __u32 *hash_rnd)
|
|
{
|
|
const u32 *p32 = pkey;
|
|
|
|
return (((p32[0] ^ hash32_ptr(dev)) * hash_rnd[0]) +
|
|
(p32[1] * hash_rnd[1]) +
|
|
(p32[2] * hash_rnd[2]) +
|
|
(p32[3] * hash_rnd[3]));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct neighbour *__ipv6_neigh_lookup_noref(struct net_device *dev, const void *pkey)
|
|
{
|
|
return ___neigh_lookup_noref(&nd_tbl, neigh_key_eq128, ndisc_hashfn, pkey, dev);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct neighbour *__ipv6_neigh_lookup(struct net_device *dev, const void *pkey)
|
|
{
|
|
struct neighbour *n;
|
|
|
|
rcu_read_lock_bh();
|
|
n = __ipv6_neigh_lookup_noref(dev, pkey);
|
|
if (n && !atomic_add_unless((&n->refcnt), 1, 0))
|
|
n = ((void *)0);
|
|
rcu_read_unlock_bh();
|
|
|
|
return n;
|
|
}
|
|
|
|
int ndisc_init(void);
|
|
int ndisc_late_init(void);
|
|
|
|
void ndisc_late_cleanup(void);
|
|
void ndisc_cleanup(void);
|
|
|
|
int ndisc_rcv(struct sk_buff *skb);
|
|
|
|
void ndisc_send_ns(struct net_device *dev, const struct in6_addr *solicit,
|
|
const struct in6_addr *daddr, const struct in6_addr *saddr);
|
|
|
|
void ndisc_send_rs(struct net_device *dev,
|
|
const struct in6_addr *saddr, const struct in6_addr *daddr);
|
|
void ndisc_send_na(struct net_device *dev, const struct in6_addr *daddr,
|
|
const struct in6_addr *solicited_addr,
|
|
bool router, bool solicited, bool override, bool inc_opt);
|
|
|
|
void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target);
|
|
|
|
int ndisc_mc_map(const struct in6_addr *addr, char *buf, struct net_device *dev,
|
|
int dir);
|
|
|
|
|
|
|
|
|
|
|
|
int igmp6_init(void);
|
|
|
|
void igmp6_cleanup(void);
|
|
|
|
int igmp6_event_query(struct sk_buff *skb);
|
|
|
|
int igmp6_event_report(struct sk_buff *skb);
|
|
|
|
|
|
|
|
int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write,
|
|
void *buffer, size_t *lenp, loff_t *ppos);
|
|
int ndisc_ifinfo_sysctl_strategy(struct ctl_table *ctl,
|
|
void *oldval, size_t *oldlenp,
|
|
void *newval, size_t newlen);
|
|
|
|
|
|
void inet6_ifinfo_notify(int event, struct inet6_dev *idev);
|
|
# 21 "include/net/ipv6.h" 2
|
|
# 105 "include/net/ipv6.h"
|
|
struct frag_hdr {
|
|
__u8 nexthdr;
|
|
__u8 reserved;
|
|
__be16 frag_off;
|
|
__be32 identification;
|
|
};
|
|
# 121 "include/net/ipv6.h"
|
|
extern int sysctl_mld_max_msf;
|
|
extern int sysctl_mld_qrv;
|
|
# 192 "include/net/ipv6.h"
|
|
struct ip6_ra_chain {
|
|
struct ip6_ra_chain *next;
|
|
struct sock *sk;
|
|
int sel;
|
|
void (*destructor)(struct sock *);
|
|
};
|
|
|
|
extern struct ip6_ra_chain *ip6_ra_chain;
|
|
extern rwlock_t ip6_ra_lock;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct ipv6_txoptions {
|
|
atomic_t refcnt;
|
|
|
|
int tot_len;
|
|
|
|
|
|
|
|
__u16 opt_flen;
|
|
__u16 opt_nflen;
|
|
|
|
struct ipv6_opt_hdr *hopopt;
|
|
struct ipv6_opt_hdr *dst0opt;
|
|
struct ipv6_rt_hdr *srcrt;
|
|
struct ipv6_opt_hdr *dst1opt;
|
|
struct callback_head rcu;
|
|
|
|
};
|
|
|
|
struct ip6_flowlabel {
|
|
struct ip6_flowlabel *next;
|
|
__be32 label;
|
|
atomic_t users;
|
|
struct in6_addr dst;
|
|
struct ipv6_txoptions *opt;
|
|
unsigned long linger;
|
|
struct callback_head rcu;
|
|
u8 share;
|
|
union {
|
|
struct pid *pid;
|
|
kuid_t uid;
|
|
} owner;
|
|
unsigned long lastuse;
|
|
unsigned long expires;
|
|
struct net *fl_net;
|
|
};
|
|
# 250 "include/net/ipv6.h"
|
|
struct ipv6_fl_socklist {
|
|
struct ipv6_fl_socklist *next;
|
|
struct ip6_flowlabel *fl;
|
|
struct callback_head rcu;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct ipv6_txoptions *txopt_get(const struct ipv6_pinfo *np)
|
|
{
|
|
struct ipv6_txoptions *opt;
|
|
|
|
rcu_read_lock();
|
|
opt = ({ typeof(*(np->opt)) *________p1 = (typeof(*(np->opt)) *)({ typeof((np->opt)) _________p1 = ({ union { typeof((np->opt)) __val; char __c[1]; } __u; if (1) __read_once_size(&((np->opt)), __u.__c, sizeof((np->opt))); else __read_once_size_nocheck(&((np->opt)), __u.__c, sizeof((np->opt))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(np->opt)) *)(________p1)); });
|
|
if (opt && !atomic_add_unless((&opt->refcnt), 1, 0))
|
|
opt = ((void *)0);
|
|
rcu_read_unlock();
|
|
return opt;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void txopt_put(struct ipv6_txoptions *opt)
|
|
{
|
|
if (opt && (({ typeof(atomic_sub_return_relaxed(1, &opt->refcnt)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_sub_return_relaxed(1, &opt->refcnt); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) == 0))
|
|
do { ((void)sizeof(char[1 - 2*!!(!((__builtin_offsetof(typeof(*(opt)), rcu)) < 4096))])); kfree_call_rcu(&((opt)->rcu), (rcu_callback_t)(unsigned long)(__builtin_offsetof(typeof(*(opt)), rcu))); } while (0);
|
|
}
|
|
|
|
struct ip6_flowlabel *fl6_sock_lookup(struct sock *sk, __be32 label);
|
|
struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions *opt_space,
|
|
struct ip6_flowlabel *fl,
|
|
struct ipv6_txoptions *fopt);
|
|
void fl6_free_socklist(struct sock *sk);
|
|
int ipv6_flowlabel_opt(struct sock *sk, char *optval, int optlen);
|
|
int ipv6_flowlabel_opt_get(struct sock *sk, struct in6_flowlabel_req *freq,
|
|
int flags);
|
|
int ip6_flowlabel_init(void);
|
|
void ip6_flowlabel_cleanup(void);
|
|
bool ip6_autoflowlabel(struct net *net, const struct ipv6_pinfo *np);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void fl6_sock_release(struct ip6_flowlabel *fl)
|
|
{
|
|
if (fl)
|
|
atomic_sub(1, &fl->users);
|
|
}
|
|
|
|
void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info);
|
|
|
|
int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6,
|
|
struct icmp6hdr *thdr, int len);
|
|
|
|
int ip6_ra_control(struct sock *sk, int sel);
|
|
|
|
int ipv6_parse_hopopts(struct sk_buff *skb);
|
|
|
|
struct ipv6_txoptions *ipv6_dup_options(struct sock *sk,
|
|
struct ipv6_txoptions *opt);
|
|
struct ipv6_txoptions *ipv6_renew_options(struct sock *sk,
|
|
struct ipv6_txoptions *opt,
|
|
int newtype,
|
|
struct ipv6_opt_hdr *newopt,
|
|
int newoptlen);
|
|
struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space,
|
|
struct ipv6_txoptions *opt);
|
|
|
|
bool ipv6_opt_accepted(const struct sock *sk, const struct sk_buff *skb,
|
|
const struct inet6_skb_parm *opt);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ipv6_accept_ra(struct inet6_dev *idev)
|
|
{
|
|
|
|
|
|
|
|
return idev->cnf.forwarding ? idev->cnf.accept_ra == 2 :
|
|
idev->cnf.accept_ra;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ip6_frag_mem(struct net *net)
|
|
{
|
|
return sum_frag_mem_limit(&net->ipv6.frags);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int __ipv6_addr_type(const struct in6_addr *addr);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ipv6_addr_type(const struct in6_addr *addr)
|
|
{
|
|
return __ipv6_addr_type(addr) & 0xffff;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ipv6_addr_scope(const struct in6_addr *addr)
|
|
{
|
|
return __ipv6_addr_type(addr) & 0x00f0U;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __ipv6_addr_src_scope(int type)
|
|
{
|
|
return (type == 0x0000U) ? -1 : (type >> 16);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ipv6_addr_src_scope(const struct in6_addr *addr)
|
|
{
|
|
return __ipv6_addr_src_scope(__ipv6_addr_type(addr));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool __ipv6_addr_needs_scope_id(int type)
|
|
{
|
|
return type & 0x0020U ||
|
|
(type & 0x0002U &&
|
|
(type & (0x0010U|0x0020U)));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u32 ipv6_iface_scope_id(const struct in6_addr *addr, int iface)
|
|
{
|
|
return __ipv6_addr_needs_scope_id(__ipv6_addr_type(addr)) ? iface : 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ipv6_addr_cmp(const struct in6_addr *a1, const struct in6_addr *a2)
|
|
{
|
|
return memcmp(a1, a2, sizeof(struct in6_addr));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool
|
|
ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m,
|
|
const struct in6_addr *a2)
|
|
{
|
|
# 384 "include/net/ipv6.h"
|
|
return !!(((a1->in6_u.u6_addr32[0] ^ a2->in6_u.u6_addr32[0]) & m->in6_u.u6_addr32[0]) |
|
|
((a1->in6_u.u6_addr32[1] ^ a2->in6_u.u6_addr32[1]) & m->in6_u.u6_addr32[1]) |
|
|
((a1->in6_u.u6_addr32[2] ^ a2->in6_u.u6_addr32[2]) & m->in6_u.u6_addr32[2]) |
|
|
((a1->in6_u.u6_addr32[3] ^ a2->in6_u.u6_addr32[3]) & m->in6_u.u6_addr32[3]));
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ipv6_addr_prefix(struct in6_addr *pfx,
|
|
const struct in6_addr *addr,
|
|
int plen)
|
|
{
|
|
|
|
int o = plen >> 3,
|
|
b = plen & 0x7;
|
|
|
|
({ void *__p = (pfx->in6_u.u6_addr8); size_t __n = sizeof(pfx->in6_u.u6_addr8); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); });
|
|
memcpy(pfx->in6_u.u6_addr8, addr, o);
|
|
if (b != 0)
|
|
pfx->in6_u.u6_addr8[o] = addr->in6_u.u6_addr8[o] & (0xff00 >> b);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void __ipv6_addr_set_half(__be32 *addr,
|
|
__be32 wh, __be32 wl)
|
|
{
|
|
# 421 "include/net/ipv6.h"
|
|
addr[0] = wh;
|
|
addr[1] = wl;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ipv6_addr_set(struct in6_addr *addr,
|
|
__be32 w1, __be32 w2,
|
|
__be32 w3, __be32 w4)
|
|
{
|
|
__ipv6_addr_set_half(&addr->in6_u.u6_addr32[0], w1, w2);
|
|
__ipv6_addr_set_half(&addr->in6_u.u6_addr32[2], w3, w4);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ipv6_addr_equal(const struct in6_addr *a1,
|
|
const struct in6_addr *a2)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ((a1->in6_u.u6_addr32[0] ^ a2->in6_u.u6_addr32[0]) |
|
|
(a1->in6_u.u6_addr32[1] ^ a2->in6_u.u6_addr32[1]) |
|
|
(a1->in6_u.u6_addr32[2] ^ a2->in6_u.u6_addr32[2]) |
|
|
(a1->in6_u.u6_addr32[3] ^ a2->in6_u.u6_addr32[3])) == 0;
|
|
|
|
}
|
|
# 474 "include/net/ipv6.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ipv6_prefix_equal(const struct in6_addr *addr1,
|
|
const struct in6_addr *addr2,
|
|
unsigned int prefixlen)
|
|
{
|
|
const __be32 *a1 = addr1->in6_u.u6_addr32;
|
|
const __be32 *a2 = addr2->in6_u.u6_addr32;
|
|
unsigned int pdw, pbi;
|
|
|
|
|
|
pdw = prefixlen >> 5;
|
|
if (pdw && memcmp(a1, a2, pdw << 2))
|
|
return false;
|
|
|
|
|
|
pbi = prefixlen & 0x1f;
|
|
if (pbi && ((a1[pdw] ^ a2[pdw]) & (( __be32)(__builtin_constant_p((__u32)(((0xffffffff) << (32 - pbi)))) ? ((__u32)( (((__u32)(((0xffffffff) << (32 - pbi))) & (__u32)0x000000ffUL) << 24) | (((__u32)(((0xffffffff) << (32 - pbi))) & (__u32)0x0000ff00UL) << 8) | (((__u32)(((0xffffffff) << (32 - pbi))) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(((0xffffffff) << (32 - pbi))) & (__u32)0xff000000UL) >> 24))) : __fswab32(((0xffffffff) << (32 - pbi)))))))
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
|
|
|
|
struct inet_frag_queue;
|
|
|
|
enum ip6_defrag_users {
|
|
IP6_DEFRAG_LOCAL_DELIVER,
|
|
IP6_DEFRAG_CONNTRACK_IN,
|
|
__IP6_DEFRAG_CONNTRACK_IN = IP6_DEFRAG_CONNTRACK_IN + ((u16)(~0U)),
|
|
IP6_DEFRAG_CONNTRACK_OUT,
|
|
__IP6_DEFRAG_CONNTRACK_OUT = IP6_DEFRAG_CONNTRACK_OUT + ((u16)(~0U)),
|
|
IP6_DEFRAG_CONNTRACK_BRIDGE_IN,
|
|
__IP6_DEFRAG_CONNTRACK_BRIDGE_IN = IP6_DEFRAG_CONNTRACK_BRIDGE_IN + ((u16)(~0U)),
|
|
};
|
|
|
|
struct ip6_create_arg {
|
|
__be32 id;
|
|
u32 user;
|
|
const struct in6_addr *src;
|
|
const struct in6_addr *dst;
|
|
int iif;
|
|
u8 ecn;
|
|
};
|
|
|
|
void ip6_frag_init(struct inet_frag_queue *q, const void *a);
|
|
bool ip6_frag_match(const struct inet_frag_queue *q, const void *a);
|
|
|
|
|
|
|
|
|
|
struct frag_queue {
|
|
struct inet_frag_queue q;
|
|
|
|
__be32 id;
|
|
u32 user;
|
|
struct in6_addr saddr;
|
|
struct in6_addr daddr;
|
|
|
|
int iif;
|
|
unsigned int csum;
|
|
__u16 nhoffset;
|
|
u8 ecn;
|
|
};
|
|
|
|
void ip6_expire_frag_queue(struct net *net, struct frag_queue *fq,
|
|
struct inet_frags *frags);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ipv6_addr_any(const struct in6_addr *a)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
return (a->in6_u.u6_addr32[0] | a->in6_u.u6_addr32[1] |
|
|
a->in6_u.u6_addr32[2] | a->in6_u.u6_addr32[3]) == 0;
|
|
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 ipv6_addr_hash(const struct in6_addr *a)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( u32)(a->in6_u.u6_addr32[0] ^ a->in6_u.u6_addr32[1] ^
|
|
a->in6_u.u6_addr32[2] ^ a->in6_u.u6_addr32[3]);
|
|
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 __ipv6_addr_jhash(const struct in6_addr *a, const u32 initval)
|
|
{
|
|
u32 v = ( u32)a->in6_u.u6_addr32[0] ^ ( u32)a->in6_u.u6_addr32[1];
|
|
|
|
return jhash_3words(v,
|
|
( u32)a->in6_u.u6_addr32[2],
|
|
( u32)a->in6_u.u6_addr32[3],
|
|
initval);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ipv6_addr_loopback(const struct in6_addr *a)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
return (a->in6_u.u6_addr32[0] | a->in6_u.u6_addr32[1] |
|
|
a->in6_u.u6_addr32[2] | (a->in6_u.u6_addr32[3] ^ (( __be32)(__builtin_constant_p((__u32)((1))) ? ((__u32)( (((__u32)((1)) & (__u32)0x000000ffUL) << 24) | (((__u32)((1)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((1)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((1)) & (__u32)0xff000000UL) >> 24))) : __fswab32((1)))))) == 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ipv6_addr_v4mapped(const struct in6_addr *a)
|
|
{
|
|
return (
|
|
|
|
|
|
|
|
( unsigned long)(a->in6_u.u6_addr32[0] | a->in6_u.u6_addr32[1]) |
|
|
|
|
( unsigned long)(a->in6_u.u6_addr32[2] ^
|
|
(( __be32)(__builtin_constant_p((__u32)((0x0000ffff))) ? ((__u32)( (((__u32)((0x0000ffff)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x0000ffff)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x0000ffff)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x0000ffff)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x0000ffff)))))) == 0UL;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ipv6_addr_orchid(const struct in6_addr *a)
|
|
{
|
|
return (a->in6_u.u6_addr32[0] & (( __be32)(__builtin_constant_p((__u32)((0xfffffff0))) ? ((__u32)( (((__u32)((0xfffffff0)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xfffffff0)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xfffffff0)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xfffffff0)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xfffffff0))))) == (( __be32)(__builtin_constant_p((__u32)((0x20010010))) ? ((__u32)( (((__u32)((0x20010010)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x20010010)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x20010010)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x20010010)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x20010010))));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ipv6_addr_is_multicast(const struct in6_addr *addr)
|
|
{
|
|
return (addr->in6_u.u6_addr32[0] & (( __be32)(__builtin_constant_p((__u32)((0xFF000000))) ? ((__u32)( (((__u32)((0xFF000000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xFF000000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xFF000000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xFF000000)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xFF000000))))) == (( __be32)(__builtin_constant_p((__u32)((0xFF000000))) ? ((__u32)( (((__u32)((0xFF000000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0xFF000000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0xFF000000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0xFF000000)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0xFF000000))));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ipv6_addr_set_v4mapped(const __be32 addr,
|
|
struct in6_addr *v4mapped)
|
|
{
|
|
ipv6_addr_set(v4mapped,
|
|
0, 0,
|
|
(( __be32)(__builtin_constant_p((__u32)((0x0000FFFF))) ? ((__u32)( (((__u32)((0x0000FFFF)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x0000FFFF)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x0000FFFF)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x0000FFFF)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x0000FFFF)))),
|
|
addr);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __ipv6_addr_diff32(const void *token1, const void *token2, int addrlen)
|
|
{
|
|
const __be32 *a1 = token1, *a2 = token2;
|
|
int i;
|
|
|
|
addrlen >>= 2;
|
|
|
|
for (i = 0; i < addrlen; i++) {
|
|
__be32 xb = a1[i] ^ a2[i];
|
|
if (xb)
|
|
return i * 32 + 31 - __fls((__builtin_constant_p((__u32)(( __u32)(__be32)(xb))) ? ((__u32)( (((__u32)(( __u32)(__be32)(xb)) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__be32)(xb)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__be32)(xb)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__be32)(xb)) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__be32)(xb))));
|
|
}
|
|
# 660 "include/net/ipv6.h"
|
|
return addrlen << 5;
|
|
}
|
|
# 681 "include/net/ipv6.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int __ipv6_addr_diff(const void *token1, const void *token2, int addrlen)
|
|
{
|
|
|
|
|
|
|
|
|
|
return __ipv6_addr_diff32(token1, token2, addrlen);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_addr *a2)
|
|
{
|
|
return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr));
|
|
}
|
|
|
|
__be32 ipv6_select_ident(struct net *net,
|
|
const struct in6_addr *daddr,
|
|
const struct in6_addr *saddr);
|
|
void ipv6_proxy_select_ident(struct net *net, struct sk_buff *skb);
|
|
|
|
int ip6_dst_hoplimit(struct dst_entry *dst);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ip6_sk_dst_hoplimit(struct ipv6_pinfo *np, struct flowi6 *fl6,
|
|
struct dst_entry *dst)
|
|
{
|
|
int hlimit;
|
|
|
|
if (ipv6_addr_is_multicast(&fl6->daddr))
|
|
hlimit = np->mcast_hops;
|
|
else
|
|
hlimit = np->hop_limit;
|
|
if (hlimit < 0)
|
|
hlimit = ip6_dst_hoplimit(dst);
|
|
return hlimit;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void iph_to_flow_copy_v6addrs(struct flow_keys *flow,
|
|
const struct ipv6hdr *iph)
|
|
{
|
|
((void)sizeof(char[1 - 2*!!(__builtin_offsetof(typeof(flow->addrs), v6addrs.dst) != __builtin_offsetof(typeof(flow->addrs), v6addrs.src) + sizeof(flow->addrs.v6addrs.src))]))
|
|
|
|
;
|
|
memcpy(&flow->addrs.v6addrs, &iph->saddr, sizeof(flow->addrs.v6addrs));
|
|
flow->control.addr_type = FLOW_DISSECTOR_KEY_IPV6_ADDRS;
|
|
}
|
|
# 742 "include/net/ipv6.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __be32 ip6_make_flowlabel(struct net *net, struct sk_buff *skb,
|
|
__be32 flowlabel, bool autolabel,
|
|
struct flowi6 *fl6)
|
|
{
|
|
u32 hash;
|
|
|
|
|
|
|
|
|
|
flowlabel &= (( __be32)(__builtin_constant_p((__u32)((0x000FFFFF))) ? ((__u32)( (((__u32)((0x000FFFFF)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x000FFFFF)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x000FFFFF)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x000FFFFF)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x000FFFFF))));
|
|
|
|
if (flowlabel ||
|
|
net->ipv6.sysctl.auto_flowlabels == 0 ||
|
|
(!autolabel &&
|
|
net->ipv6.sysctl.auto_flowlabels != 3))
|
|
return flowlabel;
|
|
|
|
hash = skb_get_hash_flowi6(skb, fl6);
|
|
|
|
|
|
|
|
|
|
|
|
rol32(hash, 16);
|
|
|
|
flowlabel = ( __be32)hash & (( __be32)(__builtin_constant_p((__u32)((0x000FFFFF))) ? ((__u32)( (((__u32)((0x000FFFFF)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x000FFFFF)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x000FFFFF)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x000FFFFF)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x000FFFFF))));
|
|
|
|
if (net->ipv6.sysctl.flowlabel_state_ranges)
|
|
flowlabel |= (( __be32)(__builtin_constant_p((__u32)((0x00080000))) ? ((__u32)( (((__u32)((0x00080000)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x00080000)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x00080000)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x00080000)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x00080000))));
|
|
|
|
return flowlabel;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ip6_default_np_autolabel(struct net *net)
|
|
{
|
|
switch (net->ipv6.sysctl.auto_flowlabels) {
|
|
case 0:
|
|
case 2:
|
|
default:
|
|
return 0;
|
|
case 1:
|
|
case 3:
|
|
return 1;
|
|
}
|
|
}
|
|
# 805 "include/net/ipv6.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ip6_flow_hdr(struct ipv6hdr *hdr, unsigned int tclass,
|
|
__be32 flowlabel)
|
|
{
|
|
*(__be32 *)hdr = (( __be32)(__builtin_constant_p((__u32)((0x60000000 | (tclass << 20)))) ? ((__u32)( (((__u32)((0x60000000 | (tclass << 20))) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x60000000 | (tclass << 20))) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x60000000 | (tclass << 20))) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x60000000 | (tclass << 20))) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x60000000 | (tclass << 20))))) | flowlabel;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __be32 ip6_flowinfo(const struct ipv6hdr *hdr)
|
|
{
|
|
return *(__be32 *)hdr & (( __be32)(__builtin_constant_p((__u32)((0x0FFFFFFF))) ? ((__u32)( (((__u32)((0x0FFFFFFF)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x0FFFFFFF)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x0FFFFFFF)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x0FFFFFFF)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x0FFFFFFF))));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __be32 ip6_flowlabel(const struct ipv6hdr *hdr)
|
|
{
|
|
return *(__be32 *)hdr & (( __be32)(__builtin_constant_p((__u32)((0x000FFFFF))) ? ((__u32)( (((__u32)((0x000FFFFF)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x000FFFFF)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x000FFFFF)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x000FFFFF)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x000FFFFF))));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u8 ip6_tclass(__be32 flowinfo)
|
|
{
|
|
return (__builtin_constant_p((__u32)(( __u32)(__be32)(flowinfo & ((( __be32)(__builtin_constant_p((__u32)((0x0FFFFFFF))) ? ((__u32)( (((__u32)((0x0FFFFFFF)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x0FFFFFFF)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x0FFFFFFF)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x0FFFFFFF)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x0FFFFFFF)))) & ~(( __be32)(__builtin_constant_p((__u32)((0x000FFFFF))) ? ((__u32)( (((__u32)((0x000FFFFF)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x000FFFFF)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x000FFFFF)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x000FFFFF)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x000FFFFF)))))))) ? ((__u32)( (((__u32)(( __u32)(__be32)(flowinfo & ((( __be32)(__builtin_constant_p((__u32)((0x0FFFFFFF))) ? ((__u32)( (((__u32)((0x0FFFFFFF)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x0FFFFFFF)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x0FFFFFFF)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x0FFFFFFF)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x0FFFFFFF)))) & ~(( __be32)(__builtin_constant_p((__u32)((0x000FFFFF))) ? ((__u32)( (((__u32)((0x000FFFFF)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x000FFFFF)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x000FFFFF)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x000FFFFF)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x000FFFFF))))))) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__be32)(flowinfo & ((( __be32)(__builtin_constant_p((__u32)((0x0FFFFFFF))) ? ((__u32)( (((__u32)((0x0FFFFFFF)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x0FFFFFFF)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x0FFFFFFF)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x0FFFFFFF)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x0FFFFFFF)))) & ~(( __be32)(__builtin_constant_p((__u32)((0x000FFFFF))) ? ((__u32)( (((__u32)((0x000FFFFF)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x000FFFFF)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x000FFFFF)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x000FFFFF)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x000FFFFF))))))) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__be32)(flowinfo & ((( __be32)(__builtin_constant_p((__u32)((0x0FFFFFFF))) ? ((__u32)( (((__u32)((0x0FFFFFFF)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x0FFFFFFF)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x0FFFFFFF)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x0FFFFFFF)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x0FFFFFFF)))) & ~(( __be32)(__builtin_constant_p((__u32)((0x000FFFFF))) ? ((__u32)( (((__u32)((0x000FFFFF)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x000FFFFF)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x000FFFFF)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x000FFFFF)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x000FFFFF))))))) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__be32)(flowinfo & ((( __be32)(__builtin_constant_p((__u32)((0x0FFFFFFF))) ? ((__u32)( (((__u32)((0x0FFFFFFF)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x0FFFFFFF)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x0FFFFFFF)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x0FFFFFFF)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x0FFFFFFF)))) & ~(( __be32)(__builtin_constant_p((__u32)((0x000FFFFF))) ? ((__u32)( (((__u32)((0x000FFFFF)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x000FFFFF)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x000FFFFF)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x000FFFFF)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x000FFFFF))))))) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__be32)(flowinfo & ((( __be32)(__builtin_constant_p((__u32)((0x0FFFFFFF))) ? ((__u32)( (((__u32)((0x0FFFFFFF)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x0FFFFFFF)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x0FFFFFFF)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x0FFFFFFF)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x0FFFFFFF)))) & ~(( __be32)(__builtin_constant_p((__u32)((0x000FFFFF))) ? ((__u32)( (((__u32)((0x000FFFFF)) & (__u32)0x000000ffUL) << 24) | (((__u32)((0x000FFFFF)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((0x000FFFFF)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((0x000FFFFF)) & (__u32)0xff000000UL) >> 24))) : __fswab32((0x000FFFFF)))))))) >> 20;
|
|
}
|
|
# 833 "include/net/ipv6.h"
|
|
int ipv6_rcv(struct sk_buff *skb, struct net_device *dev,
|
|
struct packet_type *pt, struct net_device *orig_dev);
|
|
|
|
int ip6_rcv_finish(struct net *net, struct sock *sk, struct sk_buff *skb);
|
|
|
|
|
|
|
|
|
|
int ip6_xmit(const struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6,
|
|
struct ipv6_txoptions *opt, int tclass);
|
|
|
|
int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr);
|
|
|
|
int ip6_append_data(struct sock *sk,
|
|
int getfrag(void *from, char *to, int offset, int len,
|
|
int odd, struct sk_buff *skb),
|
|
void *from, int length, int transhdrlen, int hlimit,
|
|
int tclass, struct ipv6_txoptions *opt, struct flowi6 *fl6,
|
|
struct rt6_info *rt, unsigned int flags, int dontfrag);
|
|
|
|
int ip6_push_pending_frames(struct sock *sk);
|
|
|
|
void ip6_flush_pending_frames(struct sock *sk);
|
|
|
|
int ip6_send_skb(struct sk_buff *skb);
|
|
|
|
struct sk_buff *__ip6_make_skb(struct sock *sk, struct sk_buff_head *queue,
|
|
struct inet_cork_full *cork,
|
|
struct inet6_cork *v6_cork);
|
|
struct sk_buff *ip6_make_skb(struct sock *sk,
|
|
int getfrag(void *from, char *to, int offset,
|
|
int len, int odd, struct sk_buff *skb),
|
|
void *from, int length, int transhdrlen,
|
|
int hlimit, int tclass, struct ipv6_txoptions *opt,
|
|
struct flowi6 *fl6, struct rt6_info *rt,
|
|
unsigned int flags, int dontfrag);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *ip6_finish_skb(struct sock *sk)
|
|
{
|
|
return __ip6_make_skb(sk, &sk->sk_write_queue, &inet_sk(sk)->cork,
|
|
&inet6_sk(sk)->cork);
|
|
}
|
|
|
|
int ip6_dst_lookup(struct net *net, struct sock *sk, struct dst_entry **dst,
|
|
struct flowi6 *fl6);
|
|
struct dst_entry *ip6_dst_lookup_flow(const struct sock *sk, struct flowi6 *fl6,
|
|
const struct in6_addr *final_dst);
|
|
struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
|
|
const struct in6_addr *final_dst);
|
|
struct dst_entry *ip6_blackhole_route(struct net *net,
|
|
struct dst_entry *orig_dst);
|
|
|
|
|
|
|
|
|
|
|
|
int ip6_output(struct net *net, struct sock *sk, struct sk_buff *skb);
|
|
int ip6_forward(struct sk_buff *skb);
|
|
int ip6_input(struct sk_buff *skb);
|
|
int ip6_mc_input(struct sk_buff *skb);
|
|
|
|
int __ip6_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
|
|
int ip6_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
|
|
|
|
|
|
|
|
|
|
|
|
void ipv6_push_nfrag_opts(struct sk_buff *skb, struct ipv6_txoptions *opt,
|
|
u8 *proto, struct in6_addr **daddr_p);
|
|
void ipv6_push_frag_opts(struct sk_buff *skb, struct ipv6_txoptions *opt,
|
|
u8 *proto);
|
|
|
|
int ipv6_skip_exthdr(const struct sk_buff *, int start, u8 *nexthdrp,
|
|
__be16 *frag_offp);
|
|
|
|
bool ipv6_ext_hdr(u8 nexthdr);
|
|
|
|
enum {
|
|
IP6_FH_F_FRAG = (1 << 0),
|
|
IP6_FH_F_AUTH = (1 << 1),
|
|
IP6_FH_F_SKIP_RH = (1 << 2),
|
|
};
|
|
|
|
|
|
int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, int target,
|
|
unsigned short *fragoff, int *fragflg);
|
|
|
|
int ipv6_find_tlv(struct sk_buff *skb, int offset, int type);
|
|
|
|
struct in6_addr *fl6_update_dst(struct flowi6 *fl6,
|
|
const struct ipv6_txoptions *opt,
|
|
struct in6_addr *orig);
|
|
|
|
|
|
|
|
|
|
|
|
int ipv6_setsockopt(struct sock *sk, int level, int optname,
|
|
char *optval, unsigned int optlen);
|
|
int ipv6_getsockopt(struct sock *sk, int level, int optname,
|
|
char *optval, int *optlen);
|
|
int compat_ipv6_setsockopt(struct sock *sk, int level, int optname,
|
|
char *optval, unsigned int optlen);
|
|
int compat_ipv6_getsockopt(struct sock *sk, int level, int optname,
|
|
char *optval, int *optlen);
|
|
|
|
int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len);
|
|
int ip6_datagram_connect_v6_only(struct sock *sk, struct sockaddr *addr,
|
|
int addr_len);
|
|
|
|
int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len,
|
|
int *addr_len);
|
|
int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len,
|
|
int *addr_len);
|
|
void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port,
|
|
u32 info, u8 *payload);
|
|
void ipv6_local_error(struct sock *sk, int err, struct flowi6 *fl6, u32 info);
|
|
void ipv6_local_rxpmtu(struct sock *sk, struct flowi6 *fl6, u32 mtu);
|
|
|
|
int inet6_release(struct socket *sock);
|
|
int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len);
|
|
int inet6_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len,
|
|
int peer);
|
|
int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
|
|
|
|
int inet6_hash_connect(struct inet_timewait_death_row *death_row,
|
|
struct sock *sk);
|
|
|
|
|
|
|
|
|
|
extern const struct proto_ops inet6_stream_ops;
|
|
extern const struct proto_ops inet6_dgram_ops;
|
|
extern const struct proto_ops inet6_sockraw_ops;
|
|
|
|
struct group_source_req;
|
|
struct group_filter;
|
|
|
|
int ip6_mc_source(int add, int omode, struct sock *sk,
|
|
struct group_source_req *pgsr);
|
|
int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf);
|
|
int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
|
|
struct group_filter *optval, int *optlen);
|
|
|
|
|
|
int ac6_proc_init(struct net *net);
|
|
void ac6_proc_exit(struct net *net);
|
|
int raw6_proc_init(void);
|
|
void raw6_proc_exit(void);
|
|
int tcp6_proc_init(struct net *net);
|
|
void tcp6_proc_exit(struct net *net);
|
|
int udp6_proc_init(struct net *net);
|
|
void udp6_proc_exit(struct net *net);
|
|
int udplite6_proc_init(void);
|
|
void udplite6_proc_exit(void);
|
|
int ipv6_misc_proc_init(void);
|
|
void ipv6_misc_proc_exit(void);
|
|
int snmp6_register_dev(struct inet6_dev *idev);
|
|
int snmp6_unregister_dev(struct inet6_dev *idev);
|
|
# 1002 "include/net/ipv6.h"
|
|
extern struct ctl_table ipv6_route_table_template[];
|
|
|
|
struct ctl_table *ipv6_icmp_sysctl_init(struct net *net);
|
|
struct ctl_table *ipv6_route_sysctl_init(struct net *net);
|
|
int ipv6_sysctl_register(void);
|
|
void ipv6_sysctl_unregister(void);
|
|
|
|
|
|
int ipv6_sock_mc_join(struct sock *sk, int ifindex,
|
|
const struct in6_addr *addr);
|
|
int ipv6_sock_mc_drop(struct sock *sk, int ifindex,
|
|
const struct in6_addr *addr);
|
|
# 60 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c" 2
|
|
# 1 "include/net/ip.h" 1
|
|
# 31 "include/net/ip.h"
|
|
# 1 "include/net/route.h" 1
|
|
# 28 "include/net/route.h"
|
|
# 1 "include/net/inetpeer.h" 1
|
|
# 19 "include/net/inetpeer.h"
|
|
struct ipv4_addr_key {
|
|
__be32 addr;
|
|
int vif;
|
|
};
|
|
|
|
|
|
|
|
struct inetpeer_addr {
|
|
union {
|
|
struct ipv4_addr_key a4;
|
|
struct in6_addr a6;
|
|
u32 key[(sizeof(struct in6_addr) / sizeof(u32))];
|
|
};
|
|
__u16 family;
|
|
};
|
|
|
|
struct inet_peer {
|
|
|
|
struct inet_peer *avl_left, *avl_right;
|
|
struct inetpeer_addr daddr;
|
|
__u32 avl_height;
|
|
|
|
u32 metrics[(__RTAX_MAX - 1)];
|
|
u32 rate_tokens;
|
|
unsigned long rate_last;
|
|
union {
|
|
struct list_head gc_list;
|
|
struct callback_head gc_rcu;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
union {
|
|
struct {
|
|
atomic_t rid;
|
|
};
|
|
struct callback_head rcu;
|
|
struct inet_peer *gc_next;
|
|
};
|
|
|
|
|
|
__u32 dtime;
|
|
atomic_t refcnt;
|
|
};
|
|
|
|
struct inet_peer_base {
|
|
struct inet_peer *root;
|
|
seqlock_t lock;
|
|
int total;
|
|
};
|
|
|
|
void inet_peer_base_init(struct inet_peer_base *);
|
|
|
|
void inet_initpeers(void) __attribute__ ((__section__(".init.text"))) __attribute__((__cold__)) __attribute__((no_instrument_function)) ;
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inetpeer_set_addr_v4(struct inetpeer_addr *iaddr, __be32 ip)
|
|
{
|
|
iaddr->a4.addr = ip;
|
|
iaddr->a4.vif = 0;
|
|
iaddr->family = 2;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __be32 inetpeer_get_addr_v4(struct inetpeer_addr *iaddr)
|
|
{
|
|
return iaddr->a4.addr;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void inetpeer_set_addr_v6(struct inetpeer_addr *iaddr,
|
|
struct in6_addr *in6)
|
|
{
|
|
iaddr->a6 = *in6;
|
|
iaddr->family = 10;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct in6_addr *inetpeer_get_addr_v6(struct inetpeer_addr *iaddr)
|
|
{
|
|
return &iaddr->a6;
|
|
}
|
|
|
|
|
|
struct inet_peer *inet_getpeer(struct inet_peer_base *base,
|
|
const struct inetpeer_addr *daddr,
|
|
int create);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct inet_peer *inet_getpeer_v4(struct inet_peer_base *base,
|
|
__be32 v4daddr,
|
|
int vif, int create)
|
|
{
|
|
struct inetpeer_addr daddr;
|
|
|
|
daddr.a4.addr = v4daddr;
|
|
daddr.a4.vif = vif;
|
|
daddr.family = 2;
|
|
return inet_getpeer(base, &daddr, create);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct inet_peer *inet_getpeer_v6(struct inet_peer_base *base,
|
|
const struct in6_addr *v6daddr,
|
|
int create)
|
|
{
|
|
struct inetpeer_addr daddr;
|
|
|
|
daddr.a6 = *v6daddr;
|
|
daddr.family = 10;
|
|
return inet_getpeer(base, &daddr, create);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int inetpeer_addr_cmp(const struct inetpeer_addr *a,
|
|
const struct inetpeer_addr *b)
|
|
{
|
|
int i, n;
|
|
|
|
if (a->family == 2)
|
|
n = sizeof(a->a4) / sizeof(u32);
|
|
else
|
|
n = sizeof(a->a6) / sizeof(u32);
|
|
|
|
for (i = 0; i < n; i++) {
|
|
if (a->key[i] == b->key[i])
|
|
continue;
|
|
if (a->key[i] < b->key[i])
|
|
return -1;
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
|
|
void inet_putpeer(struct inet_peer *p);
|
|
bool inet_peer_xrlim_allow(struct inet_peer *peer, int timeout);
|
|
|
|
void inetpeer_invalidate_tree(struct inet_peer_base *);
|
|
# 29 "include/net/route.h" 2
|
|
|
|
|
|
# 1 "include/net/ip_fib.h" 1
|
|
# 22 "include/net/ip_fib.h"
|
|
# 1 "include/net/fib_rules.h" 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1 "./include/uapi/linux/fib_rules.h" 1
|
|
# 18 "./include/uapi/linux/fib_rules.h"
|
|
struct fib_rule_hdr {
|
|
__u8 family;
|
|
__u8 dst_len;
|
|
__u8 src_len;
|
|
__u8 tos;
|
|
|
|
__u8 table;
|
|
__u8 res1;
|
|
__u8 res2;
|
|
__u8 action;
|
|
|
|
__u32 flags;
|
|
};
|
|
|
|
enum {
|
|
FRA_UNSPEC,
|
|
FRA_DST,
|
|
FRA_SRC,
|
|
FRA_IIFNAME,
|
|
|
|
FRA_GOTO,
|
|
FRA_UNUSED2,
|
|
FRA_PRIORITY,
|
|
FRA_UNUSED3,
|
|
FRA_UNUSED4,
|
|
FRA_UNUSED5,
|
|
FRA_FWMARK,
|
|
FRA_FLOW,
|
|
FRA_TUN_ID,
|
|
FRA_SUPPRESS_IFGROUP,
|
|
FRA_SUPPRESS_PREFIXLEN,
|
|
FRA_TABLE,
|
|
FRA_FWMASK,
|
|
FRA_OIFNAME,
|
|
__FRA_MAX
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
FR_ACT_UNSPEC,
|
|
FR_ACT_TO_TBL,
|
|
FR_ACT_GOTO,
|
|
FR_ACT_NOP,
|
|
FR_ACT_RES3,
|
|
FR_ACT_RES4,
|
|
FR_ACT_BLACKHOLE,
|
|
FR_ACT_UNREACHABLE,
|
|
FR_ACT_PROHIBIT,
|
|
__FR_ACT_MAX,
|
|
};
|
|
# 8 "include/net/fib_rules.h" 2
|
|
|
|
|
|
|
|
struct fib_rule {
|
|
struct list_head list;
|
|
int iifindex;
|
|
int oifindex;
|
|
u32 mark;
|
|
u32 mark_mask;
|
|
u32 flags;
|
|
u32 table;
|
|
u8 action;
|
|
|
|
u32 target;
|
|
__be64 tun_id;
|
|
struct fib_rule *ctarget;
|
|
struct net *fr_net;
|
|
|
|
atomic_t refcnt;
|
|
u32 pref;
|
|
int suppress_ifgroup;
|
|
int suppress_prefixlen;
|
|
char iifname[16];
|
|
char oifname[16];
|
|
struct callback_head rcu;
|
|
};
|
|
|
|
struct fib_lookup_arg {
|
|
void *lookup_ptr;
|
|
void *result;
|
|
struct fib_rule *rule;
|
|
int flags;
|
|
|
|
|
|
};
|
|
|
|
struct fib_rules_ops {
|
|
int family;
|
|
struct list_head list;
|
|
int rule_size;
|
|
int addr_size;
|
|
int unresolved_rules;
|
|
int nr_goto_rules;
|
|
|
|
int (*action)(struct fib_rule *,
|
|
struct flowi *, int,
|
|
struct fib_lookup_arg *);
|
|
bool (*suppress)(struct fib_rule *,
|
|
struct fib_lookup_arg *);
|
|
int (*match)(struct fib_rule *,
|
|
struct flowi *, int);
|
|
int (*configure)(struct fib_rule *,
|
|
struct sk_buff *,
|
|
struct fib_rule_hdr *,
|
|
struct nlattr **);
|
|
int (*delete)(struct fib_rule *);
|
|
int (*compare)(struct fib_rule *,
|
|
struct fib_rule_hdr *,
|
|
struct nlattr **);
|
|
int (*fill)(struct fib_rule *, struct sk_buff *,
|
|
struct fib_rule_hdr *);
|
|
size_t (*nlmsg_payload)(struct fib_rule *);
|
|
|
|
|
|
|
|
void (*flush_cache)(struct fib_rules_ops *ops);
|
|
|
|
int nlgroup;
|
|
const struct nla_policy *policy;
|
|
struct list_head rules_list;
|
|
struct module *owner;
|
|
struct net *fro_net;
|
|
struct callback_head rcu;
|
|
};
|
|
# 94 "include/net/fib_rules.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void fib_rule_get(struct fib_rule *rule)
|
|
{
|
|
atomic_add(1, &rule->refcnt);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void fib_rule_put(struct fib_rule *rule)
|
|
{
|
|
if ((({ typeof(atomic_sub_return_relaxed(1, &rule->refcnt)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_sub_return_relaxed(1, &rule->refcnt); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) == 0))
|
|
do { ((void)sizeof(char[1 - 2*!!(!((__builtin_offsetof(typeof(*(rule)), rcu)) < 4096))])); kfree_call_rcu(&((rule)->rcu), (rcu_callback_t)(unsigned long)(__builtin_offsetof(typeof(*(rule)), rcu))); } while (0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla)
|
|
{
|
|
if (nla[FRA_TABLE])
|
|
return nla_get_u32(nla[FRA_TABLE]);
|
|
return frh->table;
|
|
}
|
|
|
|
struct fib_rules_ops *fib_rules_register(const struct fib_rules_ops *,
|
|
struct net *);
|
|
void fib_rules_unregister(struct fib_rules_ops *);
|
|
|
|
int fib_rules_lookup(struct fib_rules_ops *, struct flowi *, int flags,
|
|
struct fib_lookup_arg *);
|
|
int fib_default_rule_add(struct fib_rules_ops *, u32 pref, u32 table,
|
|
u32 flags);
|
|
# 23 "include/net/ip_fib.h" 2
|
|
|
|
|
|
|
|
struct fib_config {
|
|
u8 fc_dst_len;
|
|
u8 fc_tos;
|
|
u8 fc_protocol;
|
|
u8 fc_scope;
|
|
u8 fc_type;
|
|
|
|
u32 fc_table;
|
|
__be32 fc_dst;
|
|
__be32 fc_gw;
|
|
int fc_oif;
|
|
u32 fc_flags;
|
|
u32 fc_priority;
|
|
__be32 fc_prefsrc;
|
|
struct nlattr *fc_mx;
|
|
struct rtnexthop *fc_mp;
|
|
int fc_mx_len;
|
|
int fc_mp_len;
|
|
u32 fc_flow;
|
|
u32 fc_nlflags;
|
|
struct nl_info fc_nlinfo;
|
|
struct nlattr *fc_encap;
|
|
u16 fc_encap_type;
|
|
};
|
|
|
|
struct fib_info;
|
|
struct rtable;
|
|
|
|
struct fib_nh_exception {
|
|
struct fib_nh_exception *fnhe_next;
|
|
int fnhe_genid;
|
|
__be32 fnhe_daddr;
|
|
u32 fnhe_pmtu;
|
|
__be32 fnhe_gw;
|
|
unsigned long fnhe_expires;
|
|
struct rtable *fnhe_rth_input;
|
|
struct rtable *fnhe_rth_output;
|
|
unsigned long fnhe_stamp;
|
|
struct callback_head rcu;
|
|
};
|
|
|
|
struct fnhe_hash_bucket {
|
|
struct fib_nh_exception *chain;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct fib_nh {
|
|
struct net_device *nh_dev;
|
|
struct hlist_node nh_hash;
|
|
struct fib_info *nh_parent;
|
|
unsigned int nh_flags;
|
|
unsigned char nh_scope;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int nh_oif;
|
|
__be32 nh_gw;
|
|
__be32 nh_saddr;
|
|
int nh_saddr_genid;
|
|
struct rtable * *nh_pcpu_rth_output;
|
|
struct rtable *nh_rth_input;
|
|
struct fnhe_hash_bucket *nh_exceptions;
|
|
struct lwtunnel_state *nh_lwtstate;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct fib_info {
|
|
struct hlist_node fib_hash;
|
|
struct hlist_node fib_lhash;
|
|
struct net *fib_net;
|
|
int fib_treeref;
|
|
atomic_t fib_clntref;
|
|
unsigned int fib_flags;
|
|
unsigned char fib_dead;
|
|
unsigned char fib_protocol;
|
|
unsigned char fib_scope;
|
|
unsigned char fib_type;
|
|
__be32 fib_prefsrc;
|
|
u32 fib_priority;
|
|
struct dst_metrics *fib_metrics;
|
|
|
|
|
|
|
|
|
|
int fib_nhs;
|
|
|
|
|
|
|
|
struct callback_head rcu;
|
|
struct fib_nh fib_nh[0];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct fib_rule;
|
|
|
|
|
|
struct fib_table;
|
|
struct fib_result {
|
|
unsigned char prefixlen;
|
|
unsigned char nh_sel;
|
|
unsigned char type;
|
|
unsigned char scope;
|
|
u32 tclassid;
|
|
struct fib_info *fi;
|
|
struct fib_table *table;
|
|
struct hlist_head *fa_head;
|
|
};
|
|
|
|
struct fib_result_nl {
|
|
__be32 fl_addr;
|
|
u32 fl_mark;
|
|
unsigned char fl_tos;
|
|
unsigned char fl_scope;
|
|
unsigned char tb_id_in;
|
|
|
|
unsigned char tb_id;
|
|
unsigned char prefixlen;
|
|
unsigned char nh_sel;
|
|
unsigned char type;
|
|
unsigned char scope;
|
|
int err;
|
|
};
|
|
# 173 "include/net/ip_fib.h"
|
|
__be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh);
|
|
# 187 "include/net/ip_fib.h"
|
|
struct fib_table {
|
|
struct hlist_node tb_hlist;
|
|
u32 tb_id;
|
|
int tb_num_default;
|
|
struct callback_head rcu;
|
|
unsigned long *tb_data;
|
|
unsigned long __data[0];
|
|
};
|
|
|
|
int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp,
|
|
struct fib_result *res, int fib_flags);
|
|
int fib_table_insert(struct fib_table *, struct fib_config *);
|
|
int fib_table_delete(struct fib_table *, struct fib_config *);
|
|
int fib_table_dump(struct fib_table *table, struct sk_buff *skb,
|
|
struct netlink_callback *cb);
|
|
int fib_table_flush(struct fib_table *table);
|
|
struct fib_table *fib_trie_unmerge(struct fib_table *main_tb);
|
|
void fib_table_flush_external(struct fib_table *table);
|
|
void fib_free_table(struct fib_table *tb);
|
|
# 252 "include/net/ip_fib.h"
|
|
int fib4_rules_init(struct net *net);
|
|
void fib4_rules_exit(struct net *net);
|
|
|
|
struct fib_table *fib_new_table(struct net *net, u32 id);
|
|
struct fib_table *fib_get_table(struct net *net, u32 id);
|
|
|
|
int __fib_lookup(struct net *net, struct flowi4 *flp,
|
|
struct fib_result *res, unsigned int flags);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fib_lookup(struct net *net, struct flowi4 *flp,
|
|
struct fib_result *res, unsigned int flags)
|
|
{
|
|
struct fib_table *tb;
|
|
int err = -101;
|
|
|
|
flags |= 1;
|
|
if (net->ipv4.fib_has_custom_rules)
|
|
return __fib_lookup(net, flp, res, flags);
|
|
|
|
rcu_read_lock();
|
|
|
|
res->tclassid = 0;
|
|
|
|
tb = ({ typeof(*(net->ipv4.fib_main)) *________p1 = (typeof(*(net->ipv4.fib_main)) *)({ typeof((net->ipv4.fib_main)) _________p1 = ({ union { typeof((net->ipv4.fib_main)) __val; char __c[1]; } __u; if (1) __read_once_size(&((net->ipv4.fib_main)), __u.__c, sizeof((net->ipv4.fib_main))); else __read_once_size_nocheck(&((net->ipv4.fib_main)), __u.__c, sizeof((net->ipv4.fib_main))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(net->ipv4.fib_main)) *)(________p1)); });
|
|
if (tb)
|
|
err = fib_table_lookup(tb, flp, res, flags);
|
|
|
|
if (!err)
|
|
goto out;
|
|
|
|
tb = ({ typeof(*(net->ipv4.fib_default)) *________p1 = (typeof(*(net->ipv4.fib_default)) *)({ typeof((net->ipv4.fib_default)) _________p1 = ({ union { typeof((net->ipv4.fib_default)) __val; char __c[1]; } __u; if (1) __read_once_size(&((net->ipv4.fib_default)), __u.__c, sizeof((net->ipv4.fib_default))); else __read_once_size_nocheck(&((net->ipv4.fib_default)), __u.__c, sizeof((net->ipv4.fib_default))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(net->ipv4.fib_default)) *)(________p1)); });
|
|
if (tb)
|
|
err = fib_table_lookup(tb, flp, res, flags);
|
|
|
|
out:
|
|
if (err == -11)
|
|
err = -101;
|
|
|
|
rcu_read_unlock();
|
|
|
|
return err;
|
|
}
|
|
|
|
|
|
|
|
|
|
extern const struct nla_policy rtm_ipv4_policy[];
|
|
void ip_fib_init(void);
|
|
__be32 fib_compute_spec_dst(struct sk_buff *skb);
|
|
int fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst,
|
|
u8 tos, int oif, struct net_device *dev,
|
|
struct in_device *idev, u32 *itag);
|
|
void fib_select_default(const struct flowi4 *flp, struct fib_result *res);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fib_num_tclassid_users(struct net *net)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
int fib_unmerge(struct net *net);
|
|
void fib_flush_external(struct net *net);
|
|
|
|
|
|
int ip_fib_check_default(__be32 gw, struct net_device *dev);
|
|
int fib_sync_down_dev(struct net_device *dev, unsigned long event, bool force);
|
|
int fib_sync_down_addr(struct net *net, __be32 local);
|
|
int fib_sync_up(struct net_device *dev, unsigned int nh_flags);
|
|
|
|
extern u32 fib_multipath_secret __attribute__((__section__(".data..read_mostly")));
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int fib_multipath_hash(__be32 saddr, __be32 daddr)
|
|
{
|
|
return jhash_2words(saddr, daddr, fib_multipath_secret) >> 1;
|
|
}
|
|
|
|
void fib_select_multipath(struct fib_result *res, int hash);
|
|
void fib_select_path(struct net *net, struct fib_result *res,
|
|
struct flowi4 *fl4, int mp_hash);
|
|
|
|
|
|
void fib_trie_init(void);
|
|
struct fib_table *fib_trie_table(u32 id, struct fib_table *alias);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void fib_combine_itag(u32 *itag, const struct fib_result *res)
|
|
{
|
|
# 354 "include/net/ip_fib.h"
|
|
}
|
|
|
|
void free_fib_info(struct fib_info *fi);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void fib_info_put(struct fib_info *fi)
|
|
{
|
|
if ((({ typeof(atomic_sub_return_relaxed(1, &fi->fib_clntref)) __ret; __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret = atomic_sub_return_relaxed(1, &fi->fib_clntref); __asm__ __volatile__ ("dmb " "ish" : : : "memory"); __ret; }) == 0))
|
|
free_fib_info(fi);
|
|
}
|
|
|
|
|
|
int fib_proc_init(struct net *net);
|
|
void fib_proc_exit(struct net *net);
|
|
# 32 "include/net/route.h" 2
|
|
# 1 "include/net/l3mdev.h" 1
|
|
# 26 "include/net/l3mdev.h"
|
|
struct l3mdev_ops {
|
|
u32 (*l3mdev_fib_table)(const struct net_device *dev);
|
|
|
|
|
|
struct rtable * (*l3mdev_get_rtable)(const struct net_device *dev,
|
|
const struct flowi4 *fl4);
|
|
int (*l3mdev_get_saddr)(struct net_device *dev,
|
|
struct flowi4 *fl4);
|
|
|
|
|
|
struct dst_entry * (*l3mdev_get_rt6_dst)(const struct net_device *dev,
|
|
const struct flowi6 *fl6);
|
|
};
|
|
# 164 "include/net/l3mdev.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int l3mdev_master_ifindex_rcu(struct net_device *dev)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int l3mdev_master_ifindex(struct net_device *dev)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int l3mdev_fib_oif_rcu(struct net_device *dev)
|
|
{
|
|
return dev ? dev->ifindex : 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int l3mdev_fib_oif(struct net_device *dev)
|
|
{
|
|
return dev ? dev->ifindex : 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 l3mdev_fib_table_rcu(const struct net_device *dev)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 l3mdev_fib_table(const struct net_device *dev)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) u32 l3mdev_fib_table_by_index(struct net *net, int ifindex)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct rtable *l3mdev_get_rtable(const struct net_device *dev,
|
|
const struct flowi4 *fl4)
|
|
{
|
|
return ((void *)0);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool netif_index_is_l3_master(struct net *net, int ifindex)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int l3mdev_get_saddr(struct net *net, int ifindex,
|
|
struct flowi4 *fl4)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
struct dst_entry *l3mdev_get_rt6_dst(const struct net_device *dev,
|
|
const struct flowi6 *fl6)
|
|
{
|
|
return ((void *)0);
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
struct dst_entry *l3mdev_rt6_dst_by_oif(struct net *net,
|
|
const struct flowi6 *fl6)
|
|
{
|
|
return ((void *)0);
|
|
}
|
|
# 33 "include/net/route.h" 2
|
|
# 1 "./include/uapi/linux/in_route.h" 1
|
|
# 34 "include/net/route.h" 2
|
|
|
|
|
|
# 1 "./include/uapi/linux/route.h" 1
|
|
# 30 "./include/uapi/linux/route.h"
|
|
struct rtentry {
|
|
unsigned long rt_pad1;
|
|
struct sockaddr rt_dst;
|
|
struct sockaddr rt_gateway;
|
|
struct sockaddr rt_genmask;
|
|
unsigned short rt_flags;
|
|
short rt_pad2;
|
|
unsigned long rt_pad3;
|
|
void *rt_pad4;
|
|
short rt_metric;
|
|
char *rt_dev;
|
|
unsigned long rt_mtu;
|
|
|
|
|
|
|
|
unsigned long rt_window;
|
|
unsigned short rt_irtt;
|
|
};
|
|
# 37 "include/net/route.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
extern int (*get_voice_rule_mark_hook)(__be32 addr, __be16 port);
|
|
extern int (*is_SIP_Packet)(__be32 addr, __be16 port);
|
|
# 54 "include/net/route.h"
|
|
struct fib_nh;
|
|
struct fib_info;
|
|
struct uncached_list;
|
|
struct rtable {
|
|
struct dst_entry dst;
|
|
|
|
int rt_genid;
|
|
unsigned int rt_flags;
|
|
__u16 rt_type;
|
|
__u8 rt_is_input;
|
|
__u8 rt_uses_gateway;
|
|
|
|
int rt_iif;
|
|
|
|
|
|
__be32 rt_gateway;
|
|
|
|
|
|
u32 rt_pmtu;
|
|
|
|
u32 rt_table_id;
|
|
|
|
struct list_head rt_uncached;
|
|
struct uncached_list *rt_uncached_list;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool rt_is_input_route(const struct rtable *rt)
|
|
{
|
|
return rt->rt_is_input != 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool rt_is_output_route(const struct rtable *rt)
|
|
{
|
|
return rt->rt_is_input == 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __be32 rt_nexthop(const struct rtable *rt, __be32 daddr)
|
|
{
|
|
if (rt->rt_gateway)
|
|
return rt->rt_gateway;
|
|
return daddr;
|
|
}
|
|
|
|
struct ip_rt_acct {
|
|
__u32 o_bytes;
|
|
__u32 o_packets;
|
|
__u32 i_bytes;
|
|
__u32 i_packets;
|
|
};
|
|
|
|
struct rt_cache_stat {
|
|
unsigned int in_slow_tot;
|
|
unsigned int in_slow_mc;
|
|
unsigned int in_no_route;
|
|
unsigned int in_brd;
|
|
unsigned int in_martian_dst;
|
|
unsigned int in_martian_src;
|
|
unsigned int out_slow_tot;
|
|
unsigned int out_slow_mc;
|
|
};
|
|
|
|
extern struct ip_rt_acct *ip_rt_acct;
|
|
|
|
struct in_device;
|
|
|
|
int ip_rt_init(void);
|
|
void rt_cache_flush(struct net *net);
|
|
void rt_flush_dev(struct net_device *dev);
|
|
struct rtable *__ip_route_output_key_hash(struct net *, struct flowi4 *flp,
|
|
int mp_hash);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct rtable *__ip_route_output_key(struct net *net,
|
|
struct flowi4 *flp)
|
|
{
|
|
return __ip_route_output_key_hash(net, flp, -1);
|
|
}
|
|
|
|
struct rtable *ip_route_output_flow(struct net *, struct flowi4 *flp,
|
|
const struct sock *sk);
|
|
struct dst_entry *ipv4_blackhole_route(struct net *net,
|
|
struct dst_entry *dst_orig);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct rtable *ip_route_output_key(struct net *net, struct flowi4 *flp)
|
|
{
|
|
return ip_route_output_flow(net, flp, ((void *)0));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct rtable *ip_route_output(struct net *net, __be32 daddr,
|
|
__be32 saddr, u8 tos, int oif)
|
|
{
|
|
struct flowi4 fl4 = {
|
|
.__fl_common.flowic_oif = oif,
|
|
.__fl_common.flowic_tos = tos,
|
|
.daddr = daddr,
|
|
.saddr = saddr,
|
|
};
|
|
return ip_route_output_key(net, &fl4);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct rtable *ip_route_output_ports(struct net *net, struct flowi4 *fl4,
|
|
struct sock *sk,
|
|
__be32 daddr, __be32 saddr,
|
|
__be16 dport, __be16 sport,
|
|
__u8 proto, __u8 tos, int oif)
|
|
{
|
|
flowi4_init_output(fl4, oif, sk ? sk->sk_mark : 0, tos,
|
|
RT_SCOPE_UNIVERSE, proto,
|
|
sk ? inet_sk_flowi_flags(sk) : 0,
|
|
daddr, saddr, dport, sport);
|
|
if (sk)
|
|
security_sk_classify_flow(sk, flowi4_to_flowi(fl4));
|
|
return ip_route_output_flow(net, fl4, sk);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct rtable *ip_route_output_gre(struct net *net, struct flowi4 *fl4,
|
|
__be32 daddr, __be32 saddr,
|
|
__be32 gre_key, __u8 tos, int oif)
|
|
{
|
|
({ void *__p = (fl4); size_t __n = sizeof(*fl4); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); });
|
|
fl4->__fl_common.flowic_oif = oif;
|
|
fl4->daddr = daddr;
|
|
fl4->saddr = saddr;
|
|
fl4->__fl_common.flowic_tos = tos;
|
|
fl4->__fl_common.flowic_proto = IPPROTO_GRE;
|
|
fl4->uli.gre_key = gre_key;
|
|
return ip_route_output_key(net, fl4);
|
|
}
|
|
|
|
int ip_route_input_noref(struct sk_buff *skb, __be32 dst, __be32 src,
|
|
u8 tos, struct net_device *devin);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ip_route_input(struct sk_buff *skb, __be32 dst, __be32 src,
|
|
u8 tos, struct net_device *devin)
|
|
{
|
|
int err;
|
|
|
|
rcu_read_lock();
|
|
err = ip_route_input_noref(skb, dst, src, tos, devin);
|
|
if (!err)
|
|
skb_dst_force(skb);
|
|
rcu_read_unlock();
|
|
|
|
return err;
|
|
}
|
|
|
|
void ipv4_update_pmtu(struct sk_buff *skb, struct net *net, u32 mtu, int oif,
|
|
u32 mark, u8 protocol, int flow_flags);
|
|
void ipv4_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, u32 mtu);
|
|
void ipv4_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark,
|
|
u8 protocol, int flow_flags);
|
|
void ipv4_sk_redirect(struct sk_buff *skb, struct sock *sk);
|
|
void ip_rt_send_redirect(struct sk_buff *skb);
|
|
|
|
unsigned int inet_addr_type(struct net *net, __be32 addr);
|
|
unsigned int inet_addr_type_table(struct net *net, __be32 addr, u32 tb_id);
|
|
unsigned int inet_dev_addr_type(struct net *net, const struct net_device *dev,
|
|
__be32 addr);
|
|
unsigned int inet_addr_type_dev_table(struct net *net,
|
|
const struct net_device *dev,
|
|
__be32 addr);
|
|
void ip_rt_multicast_event(struct in_device *);
|
|
int ip_rt_ioctl(struct net *, unsigned int cmd, void *arg);
|
|
void ip_rt_get_source(u8 *src, struct sk_buff *skb, struct rtable *rt);
|
|
|
|
struct in_ifaddr;
|
|
void fib_add_ifaddr(struct in_ifaddr *);
|
|
void fib_del_ifaddr(struct in_ifaddr *, struct in_ifaddr *);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ip_rt_put(struct rtable *rt)
|
|
{
|
|
|
|
|
|
|
|
((void)sizeof(char[1 - 2*!!(__builtin_offsetof(struct rtable, dst) != 0)]));
|
|
dst_release(&rt->dst);
|
|
}
|
|
|
|
|
|
|
|
extern const __u8 ip_tos2prio[16];
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) char rt_tos2priority(u8 tos)
|
|
{
|
|
return ip_tos2prio[((tos)&0x1E)>>1];
|
|
}
|
|
# 264 "include/net/route.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ip_route_connect_init(struct flowi4 *fl4, __be32 dst, __be32 src,
|
|
u32 tos, int oif, u8 protocol,
|
|
__be16 sport, __be16 dport,
|
|
struct sock *sk)
|
|
{
|
|
__u8 flow_flags = 0;
|
|
|
|
if (inet_sk(sk)->transparent)
|
|
flow_flags |= 0x01;
|
|
|
|
flowi4_init_output(fl4, oif, sk->sk_mark, tos, RT_SCOPE_UNIVERSE,
|
|
protocol, flow_flags, dst, src, dport, sport);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct rtable *ip_route_connect(struct flowi4 *fl4,
|
|
__be32 dst, __be32 src, u32 tos,
|
|
int oif, u8 protocol,
|
|
__be16 sport, __be16 dport,
|
|
struct sock *sk)
|
|
{
|
|
struct net *net = sock_net(sk);
|
|
struct rtable *rt;
|
|
|
|
|
|
struct inet_sock *inet = inet_sk(sk);
|
|
int rulemark;
|
|
typeof(get_voice_rule_mark_hook) get_rule_mark;
|
|
typeof(is_SIP_Packet) check_sip_packet;
|
|
|
|
|
|
ip_route_connect_init(fl4, dst, src, tos, oif, protocol,
|
|
sport, dport, sk);
|
|
|
|
if (!src && oif) {
|
|
int rc;
|
|
|
|
rc = l3mdev_get_saddr(net, oif, fl4);
|
|
if (rc < 0)
|
|
return ERR_PTR(rc);
|
|
|
|
src = fl4->saddr;
|
|
}
|
|
if (!dst || !src) {
|
|
rt = __ip_route_output_key(net, fl4);
|
|
if (IS_ERR(rt))
|
|
return rt;
|
|
ip_rt_put(rt);
|
|
flowi4_update_output(fl4, oif, tos, fl4->daddr, fl4->saddr);
|
|
}
|
|
security_sk_classify_flow(sk, flowi4_to_flowi(fl4));
|
|
|
|
|
|
get_rule_mark = ({ typeof(*(get_voice_rule_mark_hook)) *________p1 = (typeof(*(get_voice_rule_mark_hook)) *)({ typeof((get_voice_rule_mark_hook)) _________p1 = ({ union { typeof((get_voice_rule_mark_hook)) __val; char __c[1]; } __u; if (1) __read_once_size(&((get_voice_rule_mark_hook)), __u.__c, sizeof((get_voice_rule_mark_hook))); else __read_once_size_nocheck(&((get_voice_rule_mark_hook)), __u.__c, sizeof((get_voice_rule_mark_hook))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(get_voice_rule_mark_hook)) *)(________p1)); });
|
|
|
|
if ( get_rule_mark &&
|
|
(rulemark = get_rule_mark(inet->inet_saddr, (__builtin_constant_p((__u16)(( __u16)(__be16)(inet->inet_sport))) ? ((__u16)( (((__u16)(( __u16)(__be16)(inet->inet_sport)) & (__u16)0x00ffU) << 8) | (((__u16)(( __u16)(__be16)(inet->inet_sport)) & (__u16)0xff00U) >> 8))) : __fswab16(( __u16)(__be16)(inet->inet_sport))))) != 0 )
|
|
{
|
|
fl4->__fl_common.flowic_mark = rulemark;
|
|
sk->sk_mark = 0x61;
|
|
}
|
|
|
|
check_sip_packet = ({ typeof(*(is_SIP_Packet)) *________p1 = (typeof(*(is_SIP_Packet)) *)({ typeof((is_SIP_Packet)) _________p1 = ({ union { typeof((is_SIP_Packet)) __val; char __c[1]; } __u; if (1) __read_once_size(&((is_SIP_Packet)), __u.__c, sizeof((is_SIP_Packet))); else __read_once_size_nocheck(&((is_SIP_Packet)), __u.__c, sizeof((is_SIP_Packet))); __u.__val; }); do { } while(0); (_________p1); }); do { } while (0); ; ((typeof(*(is_SIP_Packet)) *)(________p1)); });
|
|
if (check_sip_packet && check_sip_packet(inet->inet_saddr, (__builtin_constant_p((__u16)(( __u16)(__be16)(inet->inet_sport))) ? ((__u16)( (((__u16)(( __u16)(__be16)(inet->inet_sport)) & (__u16)0x00ffU) << 8) | (((__u16)(( __u16)(__be16)(inet->inet_sport)) & (__u16)0xff00U) >> 8))) : __fswab16(( __u16)(__be16)(inet->inet_sport)))) >= 0)
|
|
{
|
|
sk->sk_mark = 0x61;
|
|
}
|
|
|
|
|
|
|
|
return ip_route_output_flow(net, fl4, sk);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct rtable *ip_route_newports(struct flowi4 *fl4, struct rtable *rt,
|
|
__be16 orig_sport, __be16 orig_dport,
|
|
__be16 sport, __be16 dport,
|
|
struct sock *sk)
|
|
{
|
|
if (sport != orig_sport || dport != orig_dport) {
|
|
fl4->uli.ports.dport = dport;
|
|
fl4->uli.ports.sport = sport;
|
|
ip_rt_put(rt);
|
|
flowi4_update_output(fl4, sk->__sk_common.skc_bound_dev_if,
|
|
(((inet_sk(sk)->tos)&0x1E) | sock_flag(sk, SOCK_LOCALROUTE)), fl4->daddr,
|
|
fl4->saddr);
|
|
security_sk_classify_flow(sk, flowi4_to_flowi(fl4));
|
|
return ip_route_output_flow(sock_net(sk), fl4, sk);
|
|
}
|
|
return rt;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int inet_iif(const struct sk_buff *skb)
|
|
{
|
|
int iif = skb_rtable(skb)->rt_iif;
|
|
|
|
if (iif)
|
|
return iif;
|
|
return skb->skb_iif;
|
|
}
|
|
|
|
extern int sysctl_ip_default_ttl;
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ip4_dst_hoplimit(const struct dst_entry *dst)
|
|
{
|
|
int hoplimit = dst_metric_raw(dst, RTAX_HOPLIMIT);
|
|
|
|
if (hoplimit == 0)
|
|
hoplimit = sysctl_ip_default_ttl;
|
|
return hoplimit;
|
|
}
|
|
# 32 "include/net/ip.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct sock;
|
|
|
|
struct inet_skb_parm {
|
|
struct ip_options opt;
|
|
unsigned char flags;
|
|
# 52 "include/net/ip.h"
|
|
u16 frag_max_size;
|
|
};
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int ip_hdrlen(const struct sk_buff *skb)
|
|
{
|
|
return ip_hdr(skb)->ihl * 4;
|
|
}
|
|
|
|
struct ipcm_cookie {
|
|
__be32 addr;
|
|
int oif;
|
|
struct ip_options_rcu *opt;
|
|
__u8 tx_flags;
|
|
__u8 ttl;
|
|
__s16 tos;
|
|
char priority;
|
|
};
|
|
|
|
|
|
|
|
|
|
struct ip_ra_chain {
|
|
struct ip_ra_chain *next;
|
|
struct sock *sk;
|
|
union {
|
|
void (*destructor)(struct sock *);
|
|
struct sock *saved_sk;
|
|
};
|
|
struct callback_head rcu;
|
|
};
|
|
|
|
extern struct ip_ra_chain *ip_ra_chain;
|
|
# 93 "include/net/ip.h"
|
|
struct msghdr;
|
|
struct net_device;
|
|
struct packet_type;
|
|
struct rtable;
|
|
struct sockaddr;
|
|
|
|
int igmp_mc_init(void);
|
|
|
|
|
|
|
|
|
|
|
|
int ip_build_and_send_pkt(struct sk_buff *skb, const struct sock *sk,
|
|
__be32 saddr, __be32 daddr,
|
|
struct ip_options_rcu *opt);
|
|
int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt,
|
|
struct net_device *orig_dev);
|
|
int ip_local_deliver(struct sk_buff *skb);
|
|
int ip_mr_input(struct sk_buff *skb);
|
|
int ip_output(struct net *net, struct sock *sk, struct sk_buff *skb);
|
|
int ip_mc_output(struct net *net, struct sock *sk, struct sk_buff *skb);
|
|
int ip_do_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
|
|
int (*output)(struct net *, struct sock *, struct sk_buff *));
|
|
void ip_send_check(struct iphdr *ip);
|
|
int __ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
|
|
int ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
|
|
|
|
int ip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl);
|
|
void ip_init(void);
|
|
int ip_append_data(struct sock *sk, struct flowi4 *fl4,
|
|
int getfrag(void *from, char *to, int offset, int len,
|
|
int odd, struct sk_buff *skb),
|
|
void *from, int len, int protolen,
|
|
struct ipcm_cookie *ipc,
|
|
struct rtable **rt,
|
|
unsigned int flags);
|
|
int ip_generic_getfrag(void *from, char *to, int offset, int len, int odd,
|
|
struct sk_buff *skb);
|
|
ssize_t ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page,
|
|
int offset, size_t size, int flags);
|
|
struct sk_buff *__ip_make_skb(struct sock *sk, struct flowi4 *fl4,
|
|
struct sk_buff_head *queue,
|
|
struct inet_cork *cork);
|
|
int ip_send_skb(struct net *net, struct sk_buff *skb);
|
|
int ip_push_pending_frames(struct sock *sk, struct flowi4 *fl4);
|
|
void ip_flush_pending_frames(struct sock *sk);
|
|
struct sk_buff *ip_make_skb(struct sock *sk, struct flowi4 *fl4,
|
|
int getfrag(void *from, char *to, int offset,
|
|
int len, int odd, struct sk_buff *skb),
|
|
void *from, int length, int transhdrlen,
|
|
struct ipcm_cookie *ipc, struct rtable **rtp,
|
|
unsigned int flags);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct sk_buff *ip_finish_skb(struct sock *sk, struct flowi4 *fl4)
|
|
{
|
|
return __ip_make_skb(sk, fl4, &sk->sk_write_queue, &inet_sk(sk)->cork.base);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u8 get_rttos(struct ipcm_cookie* ipc, struct inet_sock *inet)
|
|
{
|
|
return (ipc->tos != -1) ? ((ipc->tos)&0x1E) : ((inet->tos)&0x1E);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u8 get_rtconn_flags(struct ipcm_cookie* ipc, struct sock* sk)
|
|
{
|
|
return (ipc->tos != -1) ? (((ipc->tos)&0x1E) | sock_flag(sk, SOCK_LOCALROUTE)) : (((inet_sk(sk)->tos)&0x1E) | sock_flag(sk, SOCK_LOCALROUTE));
|
|
}
|
|
|
|
|
|
int __ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len);
|
|
int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len);
|
|
|
|
void ip4_datagram_release_cb(struct sock *sk);
|
|
|
|
struct ip_reply_arg {
|
|
struct kvec iov[1];
|
|
int flags;
|
|
__wsum csum;
|
|
int csumoffset;
|
|
|
|
int bound_dev_if;
|
|
u8 tos;
|
|
};
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __u8 ip_reply_arg_flowi_flags(const struct ip_reply_arg *arg)
|
|
{
|
|
return (arg->flags & 1) ? 0x01 : 0;
|
|
}
|
|
|
|
void ip_send_unicast_reply(struct sock *sk, struct sk_buff *skb,
|
|
const struct ip_options *sopt,
|
|
__be32 daddr, __be32 saddr,
|
|
const struct ip_reply_arg *arg,
|
|
unsigned int len);
|
|
# 203 "include/net/ip.h"
|
|
u64 snmp_get_cpu_field(void *mib, int cpu, int offct);
|
|
unsigned long snmp_fold_field(void *mib, int offt);
|
|
|
|
u64 snmp_get_cpu_field64(void *mib, int cpu, int offct,
|
|
size_t syncp_offset);
|
|
u64 snmp_fold_field64(void *mib, int offt, size_t sync_off);
|
|
# 223 "include/net/ip.h"
|
|
void inet_get_local_port_range(struct net *net, int *low, int *high);
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int inet_is_local_reserved_port(struct net *net, int port)
|
|
{
|
|
if (!net->ipv4.sysctl_local_reserved_ports)
|
|
return 0;
|
|
return test_bit(port, net->ipv4.sysctl_local_reserved_ports);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool sysctl_dev_name_is_allowed(const char *name)
|
|
{
|
|
return strcmp(name, "default") != 0 && strcmp(name, "all") != 0;
|
|
}
|
|
# 246 "include/net/ip.h"
|
|
extern int inet_peer_threshold;
|
|
extern int inet_peer_minttl;
|
|
extern int inet_peer_maxttl;
|
|
|
|
|
|
extern int sysctl_ip_early_demux;
|
|
|
|
|
|
extern int sysctl_ip_dynaddr;
|
|
|
|
void ipfrag_init(void);
|
|
|
|
void ip_static_sysctl_init(void);
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ip_is_fragment(const struct iphdr *iph)
|
|
{
|
|
return (iph->frag_off & (( __be16)(__builtin_constant_p((__u16)((0x2000 | 0x1FFF))) ? ((__u16)( (((__u16)((0x2000 | 0x1FFF)) & (__u16)0x00ffU) << 8) | (((__u16)((0x2000 | 0x1FFF)) & (__u16)0xff00U) >> 8))) : __fswab16((0x2000 | 0x1FFF))))) != 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
int ip_decrease_ttl(struct iphdr *iph)
|
|
{
|
|
u32 check = ( u32)iph->check;
|
|
check += ( u32)(( __be16)(__builtin_constant_p((__u16)((0x0100))) ? ((__u16)( (((__u16)((0x0100)) & (__u16)0x00ffU) << 8) | (((__u16)((0x0100)) & (__u16)0xff00U) >> 8))) : __fswab16((0x0100))));
|
|
iph->check = ( __sum16)(check + (check>=0xFFFF));
|
|
return --iph->ttl;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function))
|
|
int ip_dont_fragment(const struct sock *sk, const struct dst_entry *dst)
|
|
{
|
|
u8 pmtudisc = ({ union { typeof(inet_sk(sk)->pmtudisc) __val; char __c[1]; } __u; if (1) __read_once_size(&(inet_sk(sk)->pmtudisc), __u.__c, sizeof(inet_sk(sk)->pmtudisc)); else __read_once_size_nocheck(&(inet_sk(sk)->pmtudisc), __u.__c, sizeof(inet_sk(sk)->pmtudisc)); __u.__val; });
|
|
|
|
return pmtudisc == 2 ||
|
|
(pmtudisc == 1 &&
|
|
!(dst_metric_locked(dst, RTAX_MTU)));
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ip_sk_accept_pmtu(const struct sock *sk)
|
|
{
|
|
return inet_sk(sk)->pmtudisc != 4 &&
|
|
inet_sk(sk)->pmtudisc != 5;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ip_sk_use_pmtu(const struct sock *sk)
|
|
{
|
|
return inet_sk(sk)->pmtudisc < 3;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ip_sk_ignore_df(const struct sock *sk)
|
|
{
|
|
return inet_sk(sk)->pmtudisc < 2 ||
|
|
inet_sk(sk)->pmtudisc == 5;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int ip_dst_mtu_maybe_forward(const struct dst_entry *dst,
|
|
bool forwarding)
|
|
{
|
|
struct net *net = dev_net(dst->dev);
|
|
|
|
if (net->ipv4.sysctl_ip_fwd_use_pmtu ||
|
|
dst_metric_locked(dst, RTAX_MTU) ||
|
|
!forwarding)
|
|
return dst_mtu(dst);
|
|
|
|
return ({ typeof(({ union { typeof(dst->dev->mtu) __val; char __c[1]; } __u; if (1) __read_once_size(&(dst->dev->mtu), __u.__c, sizeof(dst->dev->mtu)); else __read_once_size_nocheck(&(dst->dev->mtu), __u.__c, sizeof(dst->dev->mtu)); __u.__val; })) _min1 = (({ union { typeof(dst->dev->mtu) __val; char __c[1]; } __u; if (1) __read_once_size(&(dst->dev->mtu), __u.__c, sizeof(dst->dev->mtu)); else __read_once_size_nocheck(&(dst->dev->mtu), __u.__c, sizeof(dst->dev->mtu)); __u.__val; })); typeof(0xFFFFU) _min2 = (0xFFFFU); (void) (&_min1 == &_min2); _min1 < _min2 ? _min1 : _min2; });
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int ip_skb_dst_mtu(const struct sk_buff *skb)
|
|
{
|
|
struct sock *sk = skb->sk;
|
|
|
|
if (!sk || !sk_fullsock(sk) || ip_sk_use_pmtu(sk)) {
|
|
bool forwarding = ((struct inet_skb_parm*)((skb)->cb))->flags & (1UL << (0));
|
|
|
|
return ip_dst_mtu_maybe_forward(skb_dst(skb), forwarding);
|
|
}
|
|
|
|
return ({ typeof(({ union { typeof(skb_dst(skb)->dev->mtu) __val; char __c[1]; } __u; if (1) __read_once_size(&(skb_dst(skb)->dev->mtu), __u.__c, sizeof(skb_dst(skb)->dev->mtu)); else __read_once_size_nocheck(&(skb_dst(skb)->dev->mtu), __u.__c, sizeof(skb_dst(skb)->dev->mtu)); __u.__val; })) _min1 = (({ union { typeof(skb_dst(skb)->dev->mtu) __val; char __c[1]; } __u; if (1) __read_once_size(&(skb_dst(skb)->dev->mtu), __u.__c, sizeof(skb_dst(skb)->dev->mtu)); else __read_once_size_nocheck(&(skb_dst(skb)->dev->mtu), __u.__c, sizeof(skb_dst(skb)->dev->mtu)); __u.__val; })); typeof(0xFFFFU) _min2 = (0xFFFFU); (void) (&_min1 == &_min2); _min1 < _min2 ? _min1 : _min2; });
|
|
}
|
|
|
|
u32 ip_idents_reserve(u32 hash, int segs);
|
|
void __ip_select_ident(struct net *net, struct iphdr *iph, int segs);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ip_select_ident_segs(struct net *net, struct sk_buff *skb,
|
|
struct sock *sk, int segs)
|
|
{
|
|
struct iphdr *iph = ip_hdr(skb);
|
|
|
|
if ((iph->frag_off & (( __be16)(__builtin_constant_p((__u16)((0x4000))) ? ((__u16)( (((__u16)((0x4000)) & (__u16)0x00ffU) << 8) | (((__u16)((0x4000)) & (__u16)0xff00U) >> 8))) : __fswab16((0x4000))))) && !skb->ignore_df) {
|
|
|
|
|
|
|
|
|
|
|
|
if (sk && inet_sk(sk)->sk.__sk_common.skc_daddr) {
|
|
iph->id = (( __be16)(__builtin_constant_p((__u16)((inet_sk(sk)->inet_id))) ? ((__u16)( (((__u16)((inet_sk(sk)->inet_id)) & (__u16)0x00ffU) << 8) | (((__u16)((inet_sk(sk)->inet_id)) & (__u16)0xff00U) >> 8))) : __fswab16((inet_sk(sk)->inet_id))));
|
|
inet_sk(sk)->inet_id += segs;
|
|
} else {
|
|
iph->id = 0;
|
|
}
|
|
} else {
|
|
__ip_select_ident(net, iph, segs);
|
|
}
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ip_select_ident(struct net *net, struct sk_buff *skb,
|
|
struct sock *sk)
|
|
{
|
|
ip_select_ident_segs(net, skb, sk, 1);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __wsum inet_compute_pseudo(struct sk_buff *skb, int proto)
|
|
{
|
|
return csum_tcpudp_nofold(ip_hdr(skb)->saddr, ip_hdr(skb)->daddr,
|
|
skb->len, proto, 0);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void iph_to_flow_copy_v4addrs(struct flow_keys *flow,
|
|
const struct iphdr *iph)
|
|
{
|
|
((void)sizeof(char[1 - 2*!!(__builtin_offsetof(typeof(flow->addrs), v4addrs.dst) != __builtin_offsetof(typeof(flow->addrs), v4addrs.src) + sizeof(flow->addrs.v4addrs.src))]))
|
|
|
|
;
|
|
memcpy(&flow->addrs.v4addrs, &iph->saddr, sizeof(flow->addrs.v4addrs));
|
|
flow->control.addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) __wsum inet_gro_compute_pseudo(struct sk_buff *skb, int proto)
|
|
{
|
|
const struct iphdr *iph = skb_gro_network_header(skb);
|
|
|
|
return csum_tcpudp_nofold(iph->saddr, iph->daddr,
|
|
skb_gro_len(skb), proto, 0);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ip_eth_mc_map(__be32 naddr, char *buf)
|
|
{
|
|
__u32 addr=(__builtin_constant_p((__u32)(( __u32)(__be32)(naddr))) ? ((__u32)( (((__u32)(( __u32)(__be32)(naddr)) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__be32)(naddr)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__be32)(naddr)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__be32)(naddr)) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__be32)(naddr)));
|
|
buf[0]=0x01;
|
|
buf[1]=0x00;
|
|
buf[2]=0x5e;
|
|
buf[5]=addr&0xFF;
|
|
addr>>=8;
|
|
buf[4]=addr&0xFF;
|
|
addr>>=8;
|
|
buf[3]=addr&0x7F;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ip_ib_mc_map(__be32 naddr, const unsigned char *broadcast, char *buf)
|
|
{
|
|
__u32 addr;
|
|
unsigned char scope = broadcast[5] & 0xF;
|
|
|
|
buf[0] = 0;
|
|
buf[1] = 0xff;
|
|
buf[2] = 0xff;
|
|
buf[3] = 0xff;
|
|
addr = (__builtin_constant_p((__u32)(( __u32)(__be32)(naddr))) ? ((__u32)( (((__u32)(( __u32)(__be32)(naddr)) & (__u32)0x000000ffUL) << 24) | (((__u32)(( __u32)(__be32)(naddr)) & (__u32)0x0000ff00UL) << 8) | (((__u32)(( __u32)(__be32)(naddr)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(( __u32)(__be32)(naddr)) & (__u32)0xff000000UL) >> 24))) : __fswab32(( __u32)(__be32)(naddr)));
|
|
buf[4] = 0xff;
|
|
buf[5] = 0x10 | scope;
|
|
buf[6] = 0x40;
|
|
buf[7] = 0x1b;
|
|
buf[8] = broadcast[8];
|
|
buf[9] = broadcast[9];
|
|
buf[10] = 0;
|
|
buf[11] = 0;
|
|
buf[12] = 0;
|
|
buf[13] = 0;
|
|
buf[14] = 0;
|
|
buf[15] = 0;
|
|
buf[19] = addr & 0xff;
|
|
addr >>= 8;
|
|
buf[18] = addr & 0xff;
|
|
addr >>= 8;
|
|
buf[17] = addr & 0xff;
|
|
addr >>= 8;
|
|
buf[16] = addr & 0x0f;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ip_ipgre_mc_map(__be32 naddr, const unsigned char *broadcast, char *buf)
|
|
{
|
|
if ((broadcast[0] | broadcast[1] | broadcast[2] | broadcast[3]) != 0)
|
|
memcpy(buf, broadcast, 4);
|
|
else
|
|
memcpy(buf, &naddr, sizeof(naddr));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static __inline__ __attribute__((always_inline)) __attribute__((no_instrument_function)) void inet_reset_saddr(struct sock *sk)
|
|
{
|
|
inet_sk(sk)->sk.__sk_common.skc_rcv_saddr = inet_sk(sk)->inet_saddr = 0;
|
|
|
|
if (sk->__sk_common.skc_family == 10) {
|
|
struct ipv6_pinfo *np = inet6_sk(sk);
|
|
|
|
({ void *__p = (&np->saddr); size_t __n = sizeof(np->saddr); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); });
|
|
({ void *__p = (&sk->__sk_common.skc_v6_rcv_saddr); size_t __n = sizeof(sk->__sk_common.skc_v6_rcv_saddr); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); });
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int ipv4_addr_hash(__be32 ip)
|
|
{
|
|
return ( unsigned int) ip;
|
|
}
|
|
|
|
bool ip_call_ra_chain(struct sk_buff *skb);
|
|
|
|
|
|
|
|
|
|
|
|
enum ip_defrag_users {
|
|
IP_DEFRAG_LOCAL_DELIVER,
|
|
IP_DEFRAG_CALL_RA_CHAIN,
|
|
IP_DEFRAG_CONNTRACK_IN,
|
|
__IP_DEFRAG_CONNTRACK_IN_END = IP_DEFRAG_CONNTRACK_IN + ((u16)(~0U)),
|
|
IP_DEFRAG_CONNTRACK_OUT,
|
|
__IP_DEFRAG_CONNTRACK_OUT_END = IP_DEFRAG_CONNTRACK_OUT + ((u16)(~0U)),
|
|
IP_DEFRAG_CONNTRACK_BRIDGE_IN,
|
|
__IP_DEFRAG_CONNTRACK_BRIDGE_IN = IP_DEFRAG_CONNTRACK_BRIDGE_IN + ((u16)(~0U)),
|
|
IP_DEFRAG_VS_IN,
|
|
IP_DEFRAG_VS_OUT,
|
|
IP_DEFRAG_VS_FWD,
|
|
IP_DEFRAG_AF_PACKET,
|
|
IP_DEFRAG_MACVLAN,
|
|
};
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) bool ip_defrag_user_in_between(u32 user,
|
|
enum ip_defrag_users lower_bond,
|
|
enum ip_defrag_users upper_bond)
|
|
{
|
|
return user >= lower_bond && user <= upper_bond;
|
|
}
|
|
|
|
int ip_defrag(struct net *net, struct sk_buff *skb, u32 user);
|
|
|
|
struct sk_buff *ip_check_defrag(struct net *net, struct sk_buff *skb, u32 user);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int ip_frag_mem(struct net *net);
|
|
|
|
|
|
|
|
|
|
|
|
int ip_forward(struct sk_buff *skb);
|
|
|
|
|
|
|
|
|
|
|
|
void ip_options_build(struct sk_buff *skb, struct ip_options *opt,
|
|
__be32 daddr, struct rtable *rt, int is_frag);
|
|
|
|
int __ip_options_echo(struct ip_options *dopt, struct sk_buff *skb,
|
|
const struct ip_options *sopt);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ip_options_echo(struct ip_options *dopt, struct sk_buff *skb)
|
|
{
|
|
return __ip_options_echo(dopt, skb, &((struct inet_skb_parm*)((skb)->cb))->opt);
|
|
}
|
|
|
|
void ip_options_fragment(struct sk_buff *skb);
|
|
int ip_options_compile(struct net *net, struct ip_options *opt,
|
|
struct sk_buff *skb);
|
|
int ip_options_get(struct net *net, struct ip_options_rcu **optp,
|
|
unsigned char *data, int optlen);
|
|
int ip_options_get_from_user(struct net *net, struct ip_options_rcu **optp,
|
|
unsigned char *data, int optlen);
|
|
void ip_options_undo(struct ip_options *opt);
|
|
void ip_forward_options(struct sk_buff *skb);
|
|
int ip_options_rcv_srr(struct sk_buff *skb);
|
|
|
|
|
|
|
|
|
|
|
|
void ipv4_pktinfo_prepare(const struct sock *sk, struct sk_buff *skb);
|
|
void ip_cmsg_recv_offset(struct msghdr *msg, struct sk_buff *skb, int tlen, int offset);
|
|
int ip_cmsg_send(struct net *net, struct msghdr *msg,
|
|
struct ipcm_cookie *ipc, bool allow_ipv6);
|
|
int ip_setsockopt(struct sock *sk, int level, int optname, char *optval,
|
|
unsigned int optlen);
|
|
int ip_getsockopt(struct sock *sk, int level, int optname, char *optval,
|
|
int *optlen);
|
|
int compat_ip_setsockopt(struct sock *sk, int level, int optname,
|
|
char *optval, unsigned int optlen);
|
|
int compat_ip_getsockopt(struct sock *sk, int level, int optname,
|
|
char *optval, int *optlen);
|
|
int ip_ra_control(struct sock *sk, unsigned char on,
|
|
void (*destructor)(struct sock *));
|
|
|
|
int ip_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len);
|
|
void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port,
|
|
u32 info, u8 *payload);
|
|
void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport,
|
|
u32 info);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb)
|
|
{
|
|
ip_cmsg_recv_offset(msg, skb, 0, 0);
|
|
}
|
|
|
|
bool icmp_global_allow(void);
|
|
extern int sysctl_icmp_msgs_per_sec;
|
|
extern int sysctl_icmp_msgs_burst;
|
|
|
|
|
|
int ip_misc_proc_init(void);
|
|
# 61 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c" 2
|
|
# 1 "include/ecnt_hook/ecnt_hook_ifc_type.h" 1
|
|
# 61 "include/ecnt_hook/ecnt_hook_ifc_type.h"
|
|
typedef enum {
|
|
ECNT_IFC_API,
|
|
}IFC_Api_SubType_t;
|
|
|
|
typedef enum {
|
|
IFC_DISABLE = 0 ,
|
|
IFC_ENABLE
|
|
} IFC_Mode_t ;
|
|
|
|
typedef enum {
|
|
IFC_SET_GLOBAL_ENABLE = 0,
|
|
IFC_GET_GLOBAL_ENABLE,
|
|
IFC_SET_LUT_RULE_AUTO,
|
|
IFC_DEL_LUT_RULE_AUTO,
|
|
IFC_SET_LUT0_RULE,
|
|
IFC_SET_LUT1_RULE,
|
|
IFC_SET_ACTION,
|
|
IFC_SET_VIP,
|
|
IFC_DEL_VIP,
|
|
IFC_SET_GENERAL,
|
|
IFC_DEL_GENERAL,
|
|
IFC_UDF_RULE,
|
|
IFC_FUNCTION_MAX_NUM,
|
|
} IFC_HookFunctionID_t ;
|
|
|
|
typedef enum{
|
|
IFC_PROTO_UDP= 0,
|
|
IFC_PROTO_TCP,
|
|
IFC_PROTO_ALL,
|
|
}IFC_PROTO;
|
|
|
|
struct ecnt_ifc_param {
|
|
unsigned int field[48];
|
|
unsigned int command[48];
|
|
unsigned int mask[48];
|
|
unsigned int mask_high[48];
|
|
unsigned int key[48];
|
|
unsigned int key_high[48];
|
|
};
|
|
|
|
struct ecnt_ifc_data {
|
|
unsigned char ifcEnable;
|
|
IFC_HookFunctionID_t function_id;
|
|
unsigned int ifcIndex;
|
|
unsigned int actIdx;
|
|
unsigned int enMode;
|
|
unsigned int endFlag;
|
|
unsigned int field;
|
|
unsigned int command;
|
|
unsigned int mask_low;
|
|
unsigned int mask_high;
|
|
unsigned int key_low;
|
|
unsigned int key_high;
|
|
unsigned int value0;
|
|
unsigned int value1;
|
|
unsigned int value2;
|
|
unsigned int value3;
|
|
struct ecnt_ifc_param ifc_param;
|
|
union{
|
|
struct{
|
|
unsigned char fport;
|
|
unsigned int nbq;
|
|
unsigned int channel;
|
|
unsigned int queue;
|
|
unsigned int gemport;
|
|
unsigned int fqos;
|
|
unsigned int vlan;
|
|
}tls_dmac_data;
|
|
}api_data;
|
|
int retValue;
|
|
};
|
|
|
|
enum IFC_FIELDS {
|
|
DMAC = 1,
|
|
SMAC,
|
|
DIPv4,
|
|
SIPv4,
|
|
DIPv6_31_0,
|
|
DIPv6_63_32,
|
|
DIPv6_95_64,
|
|
DIPv6_127_96,
|
|
SIPv6_31_0,
|
|
SIPv6_63_32,
|
|
SIPv6_95_64,
|
|
SIPv6_127_96,
|
|
|
|
FLOW_LABEL,
|
|
SINF,
|
|
FRAME_TYPE,
|
|
VPM0,
|
|
VPM1,
|
|
|
|
VID0,
|
|
PBIT0,
|
|
VID1,
|
|
PBIT1,
|
|
|
|
ETYPE,
|
|
GEMPORT,
|
|
|
|
IPv4_PROTOCOL,
|
|
IPv6_NEXT_HEADER,
|
|
IPv4_DSCP,
|
|
IPv6_TRAFFIC_CLASS,
|
|
|
|
DPORT,
|
|
SPORT,
|
|
|
|
PPPOE_SESSION,
|
|
DMAC_TYPE,
|
|
|
|
UDF0 = 32,
|
|
UDF15 = 47
|
|
};
|
|
|
|
enum IFC_COMMAND {
|
|
IFC_COMMAND_EQUAL = 0,
|
|
IFC_COMMAND_NOT_EQUAL,
|
|
IFC_COMMAND_IN_RANGE,
|
|
IFC_COMMAND_NOT_IN_RANGE,
|
|
};
|
|
|
|
typedef enum
|
|
{
|
|
IFC_VIP_FIELD_ETYPE = 0,
|
|
IFC_VIP_FIELD_IPV4_PROTO,
|
|
IFC_VIP_FIELD_IPV6_NXTHDR,
|
|
IFC_VIP_FIELD_PORT,
|
|
IFC_VIP_FIELD_SIP_SPORT,
|
|
IFC_VIP_FIELD_DIP_DPORT,
|
|
IFC_VIP_FIELD_PBIT,
|
|
IFC_VIP_FIELD_DSCP,
|
|
IFC_VIP_FIELD_TRAFFIC_CLASS,
|
|
}IFC_VIP_FIELD;
|
|
|
|
typedef enum
|
|
{
|
|
IFC_GENERAL_FIELD_IPV4_PROTO,
|
|
IFC_GENERAL_FIELD_DMAC,
|
|
IFC_GENERAL_FIELD_IGMPTYPE,
|
|
}IFC_GENERAL_FIELD;
|
|
# 62 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c" 2
|
|
|
|
|
|
# 1 "include/linux/proc_fs.h" 1
|
|
# 10 "include/linux/proc_fs.h"
|
|
struct proc_dir_entry;
|
|
|
|
# 1 "include/linux/proc_ns.h" 1
|
|
# 9 "include/linux/proc_ns.h"
|
|
struct pid_namespace;
|
|
struct nsproxy;
|
|
struct path;
|
|
|
|
struct proc_ns_operations {
|
|
const char *name;
|
|
int type;
|
|
struct ns_common *(*get)(struct task_struct *task);
|
|
void (*put)(struct ns_common *ns);
|
|
int (*install)(struct nsproxy *nsproxy, struct ns_common *ns);
|
|
};
|
|
|
|
extern const struct proc_ns_operations netns_operations;
|
|
extern const struct proc_ns_operations utsns_operations;
|
|
extern const struct proc_ns_operations ipcns_operations;
|
|
extern const struct proc_ns_operations pidns_operations;
|
|
extern const struct proc_ns_operations userns_operations;
|
|
extern const struct proc_ns_operations mntns_operations;
|
|
|
|
|
|
|
|
|
|
enum {
|
|
PROC_ROOT_INO = 1,
|
|
PROC_IPC_INIT_INO = 0xEFFFFFFFU,
|
|
PROC_UTS_INIT_INO = 0xEFFFFFFEU,
|
|
PROC_USER_INIT_INO = 0xEFFFFFFDU,
|
|
PROC_PID_INIT_INO = 0xEFFFFFFCU,
|
|
};
|
|
|
|
|
|
|
|
extern int pid_ns_prepare_proc(struct pid_namespace *ns);
|
|
extern void pid_ns_release_proc(struct pid_namespace *ns);
|
|
extern int proc_alloc_inum(unsigned int *pino);
|
|
extern void proc_free_inum(unsigned int inum);
|
|
# 60 "include/linux/proc_ns.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int ns_alloc_inum(struct ns_common *ns)
|
|
{
|
|
atomic_long_set(&ns->stashed, 0);
|
|
return proc_alloc_inum(&ns->inum);
|
|
}
|
|
|
|
|
|
|
|
extern struct file *proc_ns_fget(int fd);
|
|
|
|
extern void *ns_get_path(struct path *path, struct task_struct *task,
|
|
const struct proc_ns_operations *ns_ops);
|
|
|
|
extern int ns_get_name(char *buf, size_t size, struct task_struct *task,
|
|
const struct proc_ns_operations *ns_ops);
|
|
extern void nsfs_init(void);
|
|
# 13 "include/linux/proc_fs.h" 2
|
|
|
|
typedef int (read_proc_t)(char *page, char **start, off_t off,
|
|
int count, int *eof, void *data);
|
|
typedef int (write_proc_t)(struct file *file, const char *buffer,
|
|
unsigned long count, void *data);
|
|
struct proc_dir_entry {
|
|
unsigned int low_ino;
|
|
umode_t mode;
|
|
nlink_t nlink;
|
|
kuid_t uid;
|
|
kgid_t gid;
|
|
loff_t size;
|
|
const struct inode_operations *proc_iops;
|
|
const struct file_operations *proc_fops;
|
|
struct proc_dir_entry *parent;
|
|
struct rb_root subdir;
|
|
struct rb_node subdir_node;
|
|
void *data;
|
|
read_proc_t *read_proc;
|
|
write_proc_t *write_proc;
|
|
int pde_users;
|
|
atomic_t count;
|
|
atomic_t in_use;
|
|
|
|
struct completion *pde_unload_completion;
|
|
struct list_head pde_openers;
|
|
spinlock_t pde_unload_lock;
|
|
u8 namelen;
|
|
char name[];
|
|
};
|
|
|
|
union proc_op {
|
|
int (*proc_get_link)(struct dentry *, struct path *);
|
|
int (*proc_show)(struct seq_file *m,
|
|
struct pid_namespace *ns, struct pid *pid,
|
|
struct task_struct *task);
|
|
};
|
|
|
|
struct proc_inode {
|
|
struct pid *pid;
|
|
int fd;
|
|
union proc_op op;
|
|
struct proc_dir_entry *pde;
|
|
struct ctl_table_header *sysctl;
|
|
struct ctl_table *sysctl_entry;
|
|
const struct proc_ns_operations *ns_ops;
|
|
struct inode vfs_inode;
|
|
};
|
|
|
|
extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode,
|
|
struct proc_dir_entry *parent);
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct proc_dir_entry *create_proc_read_entry(const char *name,
|
|
mode_t mode, struct proc_dir_entry *base,
|
|
read_proc_t *read_proc, void * data)
|
|
{
|
|
struct proc_dir_entry *res=create_proc_entry(name,mode,base);
|
|
if (res) {
|
|
res->read_proc=read_proc;
|
|
res->data=data;
|
|
}
|
|
return res;
|
|
}
|
|
|
|
|
|
|
|
extern void proc_root_init(void);
|
|
extern void proc_flush_task(struct task_struct *);
|
|
|
|
extern struct proc_dir_entry *proc_symlink(const char *,
|
|
struct proc_dir_entry *, const char *);
|
|
extern struct proc_dir_entry *proc_mkdir(const char *, struct proc_dir_entry *);
|
|
extern struct proc_dir_entry *proc_mkdir_data(const char *, umode_t,
|
|
struct proc_dir_entry *, void *);
|
|
extern struct proc_dir_entry *proc_mkdir_mode(const char *, umode_t,
|
|
struct proc_dir_entry *);
|
|
|
|
extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
|
|
struct proc_dir_entry *,
|
|
const struct file_operations *,
|
|
void *);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct proc_dir_entry *proc_create(
|
|
const char *name, umode_t mode, struct proc_dir_entry *parent,
|
|
const struct file_operations *proc_fops)
|
|
{
|
|
return proc_create_data(name, mode, parent, proc_fops, ((void *)0));
|
|
}
|
|
|
|
extern void proc_set_size(struct proc_dir_entry *, loff_t);
|
|
extern void proc_set_user(struct proc_dir_entry *, kuid_t, kgid_t);
|
|
extern void *PDE_DATA(const struct inode *);
|
|
extern void *proc_get_parent_data(const struct inode *);
|
|
extern void proc_remove(struct proc_dir_entry *);
|
|
extern void remove_proc_entry(const char *, struct proc_dir_entry *);
|
|
extern int remove_proc_subtree(const char *, struct proc_dir_entry *);
|
|
# 141 "include/linux/proc_fs.h"
|
|
struct net;
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct proc_dir_entry *proc_net_mkdir(
|
|
struct net *net, const char *name, struct proc_dir_entry *parent)
|
|
{
|
|
return proc_mkdir_data(name, 0, parent, net);
|
|
}
|
|
# 65 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c" 2
|
|
|
|
# 1 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_dev.h" 1
|
|
# 45 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_dev.h"
|
|
# 1 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_glb.h" 1
|
|
# 45 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_glb.h"
|
|
# 1 "./arch/arm/include/asm/tc3162/tc3162.h" 1
|
|
# 94 "./arch/arm/include/asm/tc3162/tc3162.h"
|
|
# 1 "/home/work/XX530vUS1/sdk/en7529/global_inc/cpu/pkgid.h" 1
|
|
# 92 "/home/work/XX530vUS1/sdk/en7529/global_inc/cpu/pkgid.h"
|
|
# 1 "/home/work/XX530vUS1/sdk/en7529/global_inc/common/ecnt_chip_id.h" 1
|
|
# 41 "/home/work/XX530vUS1/sdk/en7529/global_inc/common/ecnt_chip_id.h"
|
|
# 1 "/home/work/XX530vUS1/sdk/en7529/global_inc/common/../uapi/common/ecnt_chip_id.h" 1
|
|
# 50 "/home/work/XX530vUS1/sdk/en7529/global_inc/common/../uapi/common/ecnt_chip_id.h"
|
|
typedef struct
|
|
{
|
|
unsigned int chidIdx;
|
|
unsigned int chipId;
|
|
}chipInformation;
|
|
|
|
typedef enum {
|
|
|
|
EN7529DU = 0,
|
|
EN7529DT,
|
|
EN7529CU,
|
|
EN7562DU,
|
|
EN7562DT,
|
|
EN7562CU,
|
|
EN7523GU,
|
|
EN7523DU,
|
|
EN7529GTH,
|
|
EN7562GTH,
|
|
EN7523SU,
|
|
EN7529GTS,
|
|
EN7562GTS,
|
|
EN7529IT,
|
|
EN7529CT,
|
|
EN7562CT,
|
|
EN7523DT,
|
|
EN7529DTM,
|
|
EN7562DTM,
|
|
EN7529ITM,
|
|
EN7529CTM,
|
|
EN7562CTM,
|
|
EN7523DTM,
|
|
|
|
|
|
EN7528HU,
|
|
EN7528DU,
|
|
EN7561DU,
|
|
EN7526FH_EN7528DU,
|
|
EN7521G_EN7528DU,
|
|
|
|
|
|
EN7580GT,
|
|
EN7580ST,
|
|
EN7580GAT,
|
|
EN7565,
|
|
|
|
|
|
EN7516G,
|
|
|
|
|
|
EN7527G,
|
|
EN7561G,
|
|
|
|
|
|
EN7512,
|
|
EN7513,
|
|
EN7513G,
|
|
|
|
|
|
EN7521FCUD,
|
|
EN7521F,
|
|
EN7521S,
|
|
EN7526D,
|
|
EN7526F,
|
|
EN7526G,
|
|
EN7526FT,
|
|
EN7526FP,
|
|
EN7526FT_C,
|
|
END_PACKAGE_ID = 0xFFFFFFFF,
|
|
} chipId_t ;
|
|
# 42 "/home/work/XX530vUS1/sdk/en7529/global_inc/common/ecnt_chip_id.h" 2
|
|
# 93 "/home/work/XX530vUS1/sdk/en7529/global_inc/cpu/pkgid.h" 2
|
|
# 104 "/home/work/XX530vUS1/sdk/en7529/global_inc/cpu/pkgid.h"
|
|
extern uint32_t GET_PACKAGE_ID(void);
|
|
# 95 "./arch/arm/include/asm/tc3162/tc3162.h" 2
|
|
|
|
|
|
|
|
|
|
|
|
extern void ecnt_dma_flush_range(unsigned long start, unsigned long end);
|
|
extern void ecnt_dma_inv_range(unsigned long start, unsigned long end);
|
|
|
|
|
|
# 1 "include/linux/of_platform.h" 1
|
|
# 17 "include/linux/of_platform.h"
|
|
# 1 "include/linux/of_device.h" 1
|
|
|
|
|
|
|
|
# 1 "include/linux/cpu.h" 1
|
|
# 16 "include/linux/cpu.h"
|
|
# 1 "include/linux/node.h" 1
|
|
# 21 "include/linux/node.h"
|
|
struct node {
|
|
struct device dev;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
struct memory_block;
|
|
extern struct node *node_devices[];
|
|
typedef void (*node_registration_func_t)(struct node *);
|
|
|
|
extern void unregister_node(struct node *node);
|
|
# 49 "include/linux/node.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int register_one_node(int nid)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int unregister_one_node(int nid)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int register_cpu_under_node(unsigned int cpu, unsigned int nid)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int unregister_cpu_under_node(unsigned int cpu, unsigned int nid)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int register_mem_sect_under_node(struct memory_block *mem_blk,
|
|
int nid)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int unregister_mem_sect_under_nodes(struct memory_block *mem_blk,
|
|
unsigned long phys_index)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void register_hugetlbfs_with_node(node_registration_func_t reg,
|
|
node_registration_func_t unreg)
|
|
{
|
|
}
|
|
# 17 "include/linux/cpu.h" 2
|
|
|
|
|
|
|
|
struct device;
|
|
struct device_node;
|
|
struct attribute_group;
|
|
|
|
struct cpu {
|
|
int node_id;
|
|
int hotpluggable;
|
|
struct device dev;
|
|
};
|
|
|
|
extern int register_cpu(struct cpu *cpu, int num);
|
|
extern struct device *get_cpu_device(unsigned cpu);
|
|
extern bool cpu_is_hotpluggable(unsigned cpu);
|
|
extern bool arch_match_cpu_phys_id(int cpu, u64 phys_id);
|
|
extern bool arch_find_n_match_cpu_physical_id(struct device_node *cpun,
|
|
int cpu, unsigned int *thread);
|
|
|
|
extern int cpu_add_dev_attr(struct device_attribute *attr);
|
|
extern void cpu_remove_dev_attr(struct device_attribute *attr);
|
|
|
|
extern int cpu_add_dev_attr_group(struct attribute_group *attrs);
|
|
extern void cpu_remove_dev_attr_group(struct attribute_group *attrs);
|
|
|
|
extern ssize_t cpu_show_meltdown(struct device *dev,
|
|
struct device_attribute *attr, char *buf);
|
|
extern ssize_t cpu_show_spectre_v1(struct device *dev,
|
|
struct device_attribute *attr, char *buf);
|
|
extern ssize_t cpu_show_spectre_v2(struct device *dev,
|
|
struct device_attribute *attr, char *buf);
|
|
|
|
extern __attribute__((format(printf, 4, 5)))
|
|
struct device *cpu_device_create(struct device *parent, void *drvdata,
|
|
const struct attribute_group **groups,
|
|
const char *fmt, ...);
|
|
|
|
extern void unregister_cpu(struct cpu *cpu);
|
|
extern ssize_t arch_cpu_probe(const char *, size_t);
|
|
extern ssize_t arch_cpu_release(const char *, size_t);
|
|
|
|
struct notifier_block;
|
|
|
|
|
|
|
|
|
|
enum {
|
|
# 76 "include/linux/cpu.h"
|
|
CPU_PRI_SCHED_ACTIVE = ((int)(~0U>>1)),
|
|
CPU_PRI_CPUSET_ACTIVE = ((int)(~0U>>1)) - 1,
|
|
CPU_PRI_SCHED_INACTIVE = (-((int)(~0U>>1)) - 1) + 1,
|
|
CPU_PRI_CPUSET_INACTIVE = (-((int)(~0U>>1)) - 1),
|
|
|
|
|
|
CPU_PRI_PERF = 20,
|
|
CPU_PRI_MIGRATION = 10,
|
|
CPU_PRI_SMPBOOT = 9,
|
|
|
|
CPU_PRI_WORKQUEUE_UP = 5,
|
|
CPU_PRI_WORKQUEUE_DOWN = -5,
|
|
};
|
|
# 142 "include/linux/cpu.h"
|
|
extern int register_cpu_notifier(struct notifier_block *nb);
|
|
extern int __register_cpu_notifier(struct notifier_block *nb);
|
|
extern void unregister_cpu_notifier(struct notifier_block *nb);
|
|
extern void __unregister_cpu_notifier(struct notifier_block *nb);
|
|
# 170 "include/linux/cpu.h"
|
|
void smpboot_thread_init(void);
|
|
int cpu_up(unsigned int cpu);
|
|
void notify_cpu_starting(unsigned int cpu);
|
|
extern void cpu_maps_update_begin(void);
|
|
extern void cpu_maps_update_done(void);
|
|
# 223 "include/linux/cpu.h"
|
|
extern struct bus_type cpu_subsys;
|
|
|
|
|
|
|
|
|
|
extern void cpu_hotplug_begin(void);
|
|
extern void cpu_hotplug_done(void);
|
|
extern void get_online_cpus(void);
|
|
extern void put_online_cpus(void);
|
|
extern void cpu_hotplug_disable(void);
|
|
extern void cpu_hotplug_enable(void);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void clear_tasks_mm_cpumask(int cpu);
|
|
int cpu_down(unsigned int cpu);
|
|
# 261 "include/linux/cpu.h"
|
|
extern int disable_nonboot_cpus(void);
|
|
extern void enable_nonboot_cpus(void);
|
|
|
|
|
|
|
|
|
|
|
|
enum cpuhp_state {
|
|
CPUHP_OFFLINE,
|
|
CPUHP_ONLINE,
|
|
};
|
|
|
|
void cpu_startup_entry(enum cpuhp_state state);
|
|
|
|
void cpu_idle_poll_ctrl(bool enable);
|
|
|
|
void arch_cpu_idle(void);
|
|
void arch_cpu_idle_prepare(void);
|
|
void arch_cpu_idle_enter(void);
|
|
void arch_cpu_idle_exit(void);
|
|
void arch_cpu_idle_dead(void);
|
|
|
|
extern __attribute__((section(".data..percpu" ""))) __typeof__(bool) cpu_dead_idle;
|
|
|
|
int cpu_report_state(int cpu);
|
|
int cpu_check_up_prepare(int cpu);
|
|
void cpu_set_state_online(int cpu);
|
|
|
|
bool cpu_wait_death(unsigned int cpu, int seconds);
|
|
bool cpu_report_death(void);
|
|
# 5 "include/linux/of_device.h" 2
|
|
# 1 "include/linux/platform_device.h" 1
|
|
# 20 "include/linux/platform_device.h"
|
|
struct mfd_cell;
|
|
|
|
struct platform_device {
|
|
const char *name;
|
|
int id;
|
|
bool id_auto;
|
|
struct device dev;
|
|
u32 num_resources;
|
|
struct resource *resource;
|
|
|
|
const struct platform_device_id *id_entry;
|
|
char *driver_override;
|
|
|
|
|
|
struct mfd_cell *mfd_cell;
|
|
|
|
|
|
struct pdev_archdata archdata;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
extern int platform_device_register(struct platform_device *);
|
|
extern void platform_device_unregister(struct platform_device *);
|
|
|
|
extern struct bus_type platform_bus_type;
|
|
extern struct device platform_bus;
|
|
|
|
extern void arch_setup_pdev_archdata(struct platform_device *);
|
|
extern struct resource *platform_get_resource(struct platform_device *,
|
|
unsigned int, unsigned int);
|
|
extern int platform_get_irq(struct platform_device *, unsigned int);
|
|
extern struct resource *platform_get_resource_byname(struct platform_device *,
|
|
unsigned int,
|
|
const char *);
|
|
extern int platform_get_irq_byname(struct platform_device *, const char *);
|
|
extern int platform_add_devices(struct platform_device **, int);
|
|
|
|
struct platform_device_info {
|
|
struct device *parent;
|
|
struct fwnode_handle *fwnode;
|
|
|
|
const char *name;
|
|
int id;
|
|
|
|
const struct resource *res;
|
|
unsigned int num_res;
|
|
|
|
const void *data;
|
|
size_t size_data;
|
|
u64 dma_mask;
|
|
};
|
|
extern struct platform_device *platform_device_register_full(
|
|
const struct platform_device_info *pdevinfo);
|
|
# 91 "include/linux/platform_device.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct platform_device *platform_device_register_resndata(
|
|
struct device *parent, const char *name, int id,
|
|
const struct resource *res, unsigned int num,
|
|
const void *data, size_t size) {
|
|
|
|
struct platform_device_info pdevinfo = {
|
|
.parent = parent,
|
|
.name = name,
|
|
.id = id,
|
|
.res = res,
|
|
.num_res = num,
|
|
.data = data,
|
|
.size_data = size,
|
|
.dma_mask = 0,
|
|
};
|
|
|
|
return platform_device_register_full(&pdevinfo);
|
|
}
|
|
# 132 "include/linux/platform_device.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct platform_device *platform_device_register_simple(
|
|
const char *name, int id,
|
|
const struct resource *res, unsigned int num)
|
|
{
|
|
return platform_device_register_resndata(((void *)0), name, id,
|
|
res, num, ((void *)0), 0);
|
|
}
|
|
# 156 "include/linux/platform_device.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct platform_device *platform_device_register_data(
|
|
struct device *parent, const char *name, int id,
|
|
const void *data, size_t size)
|
|
{
|
|
return platform_device_register_resndata(parent, name, id,
|
|
((void *)0), 0, data, size);
|
|
}
|
|
|
|
extern struct platform_device *platform_device_alloc(const char *name, int id);
|
|
extern int platform_device_add_resources(struct platform_device *pdev,
|
|
const struct resource *res,
|
|
unsigned int num);
|
|
extern int platform_device_add_data(struct platform_device *pdev,
|
|
const void *data, size_t size);
|
|
extern int platform_device_add(struct platform_device *pdev);
|
|
extern void platform_device_del(struct platform_device *pdev);
|
|
extern void platform_device_put(struct platform_device *pdev);
|
|
|
|
struct platform_driver {
|
|
int (*probe)(struct platform_device *);
|
|
int (*remove)(struct platform_device *);
|
|
void (*shutdown)(struct platform_device *);
|
|
int (*suspend)(struct platform_device *, pm_message_t state);
|
|
int (*resume)(struct platform_device *);
|
|
struct device_driver driver;
|
|
const struct platform_device_id *id_table;
|
|
bool prevent_deferred_probe;
|
|
};
|
|
# 193 "include/linux/platform_device.h"
|
|
extern int __platform_driver_register(struct platform_driver *,
|
|
struct module *);
|
|
extern void platform_driver_unregister(struct platform_driver *);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern int __platform_driver_probe(struct platform_driver *driver,
|
|
int (*probe)(struct platform_device *), struct module *module);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void *platform_get_drvdata(const struct platform_device *pdev)
|
|
{
|
|
return dev_get_drvdata(&pdev->dev);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void platform_set_drvdata(struct platform_device *pdev,
|
|
void *data)
|
|
{
|
|
dev_set_drvdata(&pdev->dev, data);
|
|
}
|
|
# 268 "include/linux/platform_device.h"
|
|
extern struct platform_device *__platform_create_bundle(
|
|
struct platform_driver *driver, int (*probe)(struct platform_device *),
|
|
struct resource *res, unsigned int n_res,
|
|
const void *data, size_t size, struct module *module);
|
|
|
|
int __platform_register_drivers(struct platform_driver * const *drivers,
|
|
unsigned int count, struct module *owner);
|
|
void platform_unregister_drivers(struct platform_driver * const *drivers,
|
|
unsigned int count);
|
|
|
|
|
|
|
|
|
|
|
|
struct early_platform_driver {
|
|
const char *class_str;
|
|
struct platform_driver *pdrv;
|
|
struct list_head list;
|
|
int requested_id;
|
|
char *buffer;
|
|
int bufsize;
|
|
};
|
|
|
|
|
|
|
|
|
|
extern int early_platform_driver_register(struct early_platform_driver *epdrv,
|
|
char *buf);
|
|
extern void early_platform_add_devices(struct platform_device **devs, int num);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int is_early_platform_device(struct platform_device *pdev)
|
|
{
|
|
return !pdev->dev.driver;
|
|
}
|
|
|
|
extern void early_platform_driver_register_all(char *class_str);
|
|
extern int early_platform_driver_probe(char *class_str,
|
|
int nr_probe, int user_only);
|
|
extern void early_platform_cleanup(void);
|
|
# 334 "include/linux/platform_device.h"
|
|
extern int platform_pm_suspend(struct device *dev);
|
|
extern int platform_pm_resume(struct device *dev);
|
|
# 6 "include/linux/of_device.h" 2
|
|
# 1 "include/linux/of_platform.h" 1
|
|
# 7 "include/linux/of_device.h" 2
|
|
|
|
|
|
|
|
|
|
struct device;
|
|
|
|
|
|
extern const struct of_device_id *of_match_device(
|
|
const struct of_device_id *matches, const struct device *dev);
|
|
extern void of_device_make_bus_id(struct device *dev);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int of_driver_match_device(struct device *dev,
|
|
const struct device_driver *drv)
|
|
{
|
|
return of_match_device(drv->of_match_table, dev) != ((void *)0);
|
|
}
|
|
|
|
extern struct platform_device *of_dev_get(struct platform_device *dev);
|
|
extern void of_dev_put(struct platform_device *dev);
|
|
|
|
extern int of_device_add(struct platform_device *pdev);
|
|
extern int of_device_register(struct platform_device *ofdev);
|
|
extern void of_device_unregister(struct platform_device *ofdev);
|
|
|
|
extern const void *of_device_get_match_data(const struct device *dev);
|
|
|
|
extern ssize_t of_device_get_modalias(struct device *dev,
|
|
char *str, ssize_t len);
|
|
|
|
extern void of_device_uevent(struct device *dev, struct kobj_uevent_env *env);
|
|
extern int of_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *env);
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void of_device_node_put(struct device *dev)
|
|
{
|
|
of_node_put(dev->of_node);
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) struct device_node *of_cpu_device_node_get(int cpu)
|
|
{
|
|
struct device *cpu_dev;
|
|
cpu_dev = get_cpu_device(cpu);
|
|
if (!cpu_dev)
|
|
return ((void *)0);
|
|
return of_node_get(cpu_dev->of_node);
|
|
}
|
|
|
|
void of_dma_configure(struct device *dev, struct device_node *np);
|
|
# 18 "include/linux/of_platform.h" 2
|
|
# 42 "include/linux/of_platform.h"
|
|
struct of_dev_auxdata {
|
|
char *compatible;
|
|
resource_size_t phys_addr;
|
|
char *name;
|
|
void *platform_data;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern const struct of_device_id of_default_bus_match_table[];
|
|
|
|
|
|
extern struct platform_device *of_device_alloc(struct device_node *np,
|
|
const char *bus_id,
|
|
struct device *parent);
|
|
extern struct platform_device *of_find_device_by_node(struct device_node *np);
|
|
|
|
|
|
extern struct platform_device *of_platform_device_create(struct device_node *np,
|
|
const char *bus_id,
|
|
struct device *parent);
|
|
|
|
extern int of_platform_bus_probe(struct device_node *root,
|
|
const struct of_device_id *matches,
|
|
struct device *parent);
|
|
|
|
extern int of_platform_populate(struct device_node *root,
|
|
const struct of_device_id *matches,
|
|
const struct of_dev_auxdata *lookup,
|
|
struct device *parent);
|
|
extern int of_platform_default_populate(struct device_node *root,
|
|
const struct of_dev_auxdata *lookup,
|
|
struct device *parent);
|
|
extern void of_platform_depopulate(struct device *parent);
|
|
# 99 "include/linux/of_platform.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) void of_platform_register_reconfig_notifier(void) { }
|
|
# 105 "./arch/arm/include/asm/tc3162/tc3162.h" 2
|
|
|
|
|
|
|
|
# 1 "./arch/arm/include/asm/tc3162/arm_v7_pmu.h" 1
|
|
# 65 "./arch/arm/include/asm/tc3162/arm_v7_pmu.h"
|
|
unsigned int getPMN(void);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void pmnConfig(unsigned int counter, unsigned int event, unsigned filter);
|
|
|
|
|
|
|
|
void ccntDivider(int divider);
|
|
# 87 "./arch/arm/include/asm/tc3162/arm_v7_pmu.h"
|
|
void enablePMU(void);
|
|
|
|
|
|
|
|
void disablePMU(void);
|
|
|
|
|
|
void enableCCNT(void);
|
|
|
|
|
|
void disableCCNT(void);
|
|
|
|
|
|
|
|
void enablePMN(unsigned int counter);
|
|
|
|
|
|
|
|
void disablePMN(unsigned int counter);
|
|
# 114 "./arch/arm/include/asm/tc3162/arm_v7_pmu.h"
|
|
unsigned int readCCNT(void);
|
|
|
|
|
|
void writeCCNT(unsigned int);
|
|
|
|
|
|
|
|
unsigned int readPMN(unsigned int counter);
|
|
# 130 "./arch/arm/include/asm/tc3162/arm_v7_pmu.h"
|
|
unsigned int readFlags(void);
|
|
|
|
|
|
void writeFlags(unsigned int flags);
|
|
|
|
|
|
void enableCCNTIrq(void);
|
|
|
|
|
|
void disableCCNTIrq(void);
|
|
|
|
|
|
|
|
void enablePMNIrq(unsigned int counter);
|
|
|
|
|
|
|
|
void disablePMNIrq(unsigned int counter);
|
|
# 156 "./arch/arm/include/asm/tc3162/arm_v7_pmu.h"
|
|
void resetPMN(void);
|
|
|
|
|
|
void resetCCNT(void);
|
|
# 169 "./arch/arm/include/asm/tc3162/arm_v7_pmu.h"
|
|
void pmuSoftwareIncrement(unsigned int counter);
|
|
# 178 "./arch/arm/include/asm/tc3162/arm_v7_pmu.h"
|
|
void enablePMUUserAccess(void);
|
|
|
|
|
|
void disablePMUserAccess(void);
|
|
# 109 "./arch/arm/include/asm/tc3162/tc3162.h" 2
|
|
|
|
# 1 "/home/work/XX530vUS1/sdk/en7529/global_inc/modules/spi/spi_controller.h" 1
|
|
# 103 "/home/work/XX530vUS1/sdk/en7529/global_inc/modules/spi/spi_controller.h"
|
|
typedef enum{
|
|
SPI_CONTROLLER_SPEED_SINGLE =0,
|
|
SPI_CONTROLLER_SPEED_DUAL,
|
|
SPI_CONTROLLER_SPEED_QUAD
|
|
|
|
} SPI_CONTROLLER_SPEED_T;
|
|
|
|
typedef enum{
|
|
SPI_CONTROLLER_RTN_NO_ERROR =0,
|
|
SPI_CONTROLLER_RTN_SET_OPFIFO_ERROR,
|
|
SPI_CONTROLLER_RTN_READ_DATAPFIFO_ERROR,
|
|
SPI_CONTROLLER_RTN_WRITE_DATAPFIFO_ERROR,
|
|
|
|
SPI_CONTROLLER_RTN_DEF_NO
|
|
} SPI_CONTROLLER_RTN_T;
|
|
|
|
|
|
typedef enum{
|
|
SPI_CONTROLLER_MODE_AUTO=0,
|
|
SPI_CONTROLLER_MODE_MANUAL,
|
|
SPI_CONTROLLER_MODE_DMA,
|
|
SPI_CONTROLLER_MODE_NO
|
|
} SPI_CONTROLLER_MODE_T;
|
|
|
|
typedef enum{
|
|
SPI_CONTROLLER_SPI_NAND=0,
|
|
SPI_CONTROLLER_SPI_NOR,
|
|
SPI_CONTROLLER_PARALLEL_NAND
|
|
} SPI_CONTROLLER_SPI_TYPE_T;
|
|
|
|
typedef struct SPI_CONTROLLER_CONFIGURE
|
|
{
|
|
SPI_CONTROLLER_MODE_T mode;
|
|
u32 dummy_byte_num;
|
|
} SPI_CONTROLLER_CONF_T;
|
|
|
|
SPI_CONTROLLER_RTN_T SPI_CONTROLLER_Set_Configure( SPI_CONTROLLER_CONF_T *ptr_spi_controller_conf_t );
|
|
SPI_CONTROLLER_RTN_T SPI_CONTROLLER_Get_Configure( SPI_CONTROLLER_CONF_T *ptr_rtn_spi_controller_conf_t );
|
|
# 159 "/home/work/XX530vUS1/sdk/en7529/global_inc/modules/spi/spi_controller.h"
|
|
SPI_CONTROLLER_RTN_T SPI_CONTROLLER_Enable_Manual_Mode( void );
|
|
# 178 "/home/work/XX530vUS1/sdk/en7529/global_inc/modules/spi/spi_controller.h"
|
|
SPI_CONTROLLER_RTN_T SPI_CONTROLLER_Write_One_Byte( u8 data );
|
|
SPI_CONTROLLER_RTN_T SPI_CONTROLLER_Write_One_Byte_With_Cmd(u8 op_cmd, u8 data );
|
|
# 202 "/home/work/XX530vUS1/sdk/en7529/global_inc/modules/spi/spi_controller.h"
|
|
SPI_CONTROLLER_RTN_T SPI_CONTROLLER_Write_NByte( u8 *ptr_data,
|
|
u32 len,
|
|
SPI_CONTROLLER_SPEED_T speed );
|
|
# 226 "/home/work/XX530vUS1/sdk/en7529/global_inc/modules/spi/spi_controller.h"
|
|
SPI_CONTROLLER_RTN_T SPI_CONTROLLER_Read_NByte( u8 *ptr_rtn_data,
|
|
u32 len,
|
|
SPI_CONTROLLER_SPEED_T speed );
|
|
# 247 "/home/work/XX530vUS1/sdk/en7529/global_inc/modules/spi/spi_controller.h"
|
|
SPI_CONTROLLER_RTN_T SPI_CONTROLLER_Chip_Select_Low( void );
|
|
# 266 "/home/work/XX530vUS1/sdk/en7529/global_inc/modules/spi/spi_controller.h"
|
|
SPI_CONTROLLER_RTN_T SPI_CONTROLLER_Chip_Select_High( void );
|
|
|
|
void SPI_CONTROLLER_DEBUG_ENABLE( void );
|
|
# 287 "/home/work/XX530vUS1/sdk/en7529/global_inc/modules/spi/spi_controller.h"
|
|
void SPI_CONTROLLER_DEBUG_DISABLE( void );
|
|
u32 get_sfc_strap(void);
|
|
# 310 "/home/work/XX530vUS1/sdk/en7529/global_inc/modules/spi/spi_controller.h"
|
|
void spi_set_clock_speed(u32 clk);
|
|
void set_spi_quad_mode_shared_pin(void);
|
|
SPI_CONTROLLER_SPI_TYPE_T spi_type(void);
|
|
# 111 "./arch/arm/include/asm/tc3162/tc3162.h" 2
|
|
|
|
|
|
|
|
typedef int32_t int32;
|
|
|
|
|
|
|
|
|
|
typedef uint32_t uint32;
|
|
|
|
|
|
|
|
|
|
typedef uint16_t uint16;
|
|
|
|
|
|
|
|
|
|
typedef uint8_t uint8;
|
|
|
|
|
|
|
|
|
|
typedef signed short int int16;
|
|
# 185 "./arch/arm/include/asm/tc3162/tc3162.h"
|
|
extern uint32_t GET_HIR(void);
|
|
# 203 "./arch/arm/include/asm/tc3162/tc3162.h"
|
|
extern u32 GET_PDIDR(void);
|
|
extern u32 GET_IS_FPGA(void);
|
|
extern u32 GET_SYS_CLK(void);
|
|
# 46 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_glb.h" 2
|
|
# 211 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_glb.h"
|
|
typedef enum {
|
|
IFC_LUT0 = 0 ,
|
|
IFC_LUT1
|
|
} IFC_TYPE_t ;
|
|
|
|
typedef enum {
|
|
Type_TCP = 0 ,
|
|
Type_UDP,
|
|
Type_None
|
|
} L4_Type ;
|
|
|
|
typedef enum {
|
|
Type_IPv4 = 0 ,
|
|
Type_IPv6,
|
|
Type_6RD,
|
|
Type_DSLite
|
|
} L3_Type ;
|
|
|
|
typedef struct {
|
|
unchar dbgLevel ;
|
|
int channel ;
|
|
int queue ;
|
|
int isPktChkErrFlag ;
|
|
int isRecvOKFlag ;
|
|
uint Lut0RecvIndexMap ;
|
|
uint Lut1RecvIndexMap[2] ;
|
|
spinlock_t ifcLock ;
|
|
} IFC_Private_T ;
|
|
|
|
|
|
typedef union {
|
|
struct {
|
|
|
|
|
|
|
|
|
|
uint enable:31 ;
|
|
uint valid:1 ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint C31_17:30 ;
|
|
uint :2 ;
|
|
|
|
|
|
uint C16_1:32 ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint M30:16 ;
|
|
uint M31:2 ;
|
|
uint :14 ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint M28:16 ;
|
|
uint M29:16 ;
|
|
# 285 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_glb.h"
|
|
uint M24:8 ;
|
|
uint M25:8 ;
|
|
uint M26:8 ;
|
|
uint M27:8 ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint M22:16 ;
|
|
uint M23:16 ;
|
|
# 305 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_glb.h"
|
|
uint M18:12 ;
|
|
uint M19:4 ;
|
|
uint M20:12 ;
|
|
uint M21:4 ;
|
|
# 318 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_glb.h"
|
|
uint M13:20 ;
|
|
uint M14:5 ;
|
|
uint M15:3 ;
|
|
uint M16:2 ;
|
|
uint M17:2 ;
|
|
|
|
|
|
uint M12:32 ;
|
|
uint M11:32 ;
|
|
uint M10:32 ;
|
|
uint M9:32 ;
|
|
uint M8:32 ;
|
|
uint M7:32 ;
|
|
uint M6:32 ;
|
|
uint M5:32 ;
|
|
uint M4:32 ;
|
|
uint M3:32 ;
|
|
|
|
uint M2_H:32 ;
|
|
|
|
|
|
|
|
|
|
uint M1_H:16 ;
|
|
uint M2_L:16 ;
|
|
|
|
uint M1_L:32 ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint K30:16 ;
|
|
uint K31:2 ;
|
|
uint :14 ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint K28:16 ;
|
|
uint K29:16 ;
|
|
# 370 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_glb.h"
|
|
uint K24:8 ;
|
|
uint K25:8 ;
|
|
uint K26:8 ;
|
|
uint K27:8 ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint K22:16 ;
|
|
uint K23:16 ;
|
|
# 390 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_glb.h"
|
|
uint K18:12 ;
|
|
uint K19:4 ;
|
|
uint K20:12 ;
|
|
uint K21:4 ;
|
|
# 403 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_glb.h"
|
|
uint K13:20 ;
|
|
uint K14:5 ;
|
|
uint K15:3 ;
|
|
uint K16:2 ;
|
|
uint K17:2 ;
|
|
|
|
|
|
uint K12:32 ;
|
|
uint K11:32 ;
|
|
uint K10:32 ;
|
|
uint K9:32 ;
|
|
uint K8:32 ;
|
|
uint K7:32 ;
|
|
uint K6:32 ;
|
|
uint K5:32 ;
|
|
uint K4:32 ;
|
|
uint K3:32 ;
|
|
|
|
uint K2_H:32 ;
|
|
|
|
|
|
|
|
|
|
uint K1_H:16 ;
|
|
uint K2_L:16 ;
|
|
|
|
uint K1_L:32 ;
|
|
};
|
|
uint msg[41] ;
|
|
} IFC_LUT0_Format ;
|
|
|
|
typedef union {
|
|
|
|
union {
|
|
struct{
|
|
# 448 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_glb.h"
|
|
uint F0:6 ;
|
|
uint C0:2 ;
|
|
uint S0:2 ;
|
|
uint :3 ;
|
|
uint Type:1 ;
|
|
uint end:1 ;
|
|
uint valid:1 ;
|
|
uint :16 ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint K0:16 ;
|
|
uint M0:16 ;
|
|
|
|
};
|
|
uint msg[2] ;
|
|
} IFC_LUT1_Format0;
|
|
|
|
|
|
union {
|
|
struct{
|
|
# 482 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_glb.h"
|
|
uint F0:6 ;
|
|
uint C0:1 ;
|
|
uint D0:1 ;
|
|
uint M0:5 ;
|
|
uint Type:1 ;
|
|
uint end:1 ;
|
|
uint valid:1 ;
|
|
uint :16 ;
|
|
|
|
|
|
uint K0 ;
|
|
};
|
|
uint msg[2] ;
|
|
} IFC_LUT1_Format1;
|
|
}IFC_LUT1_Format;
|
|
|
|
typedef union {
|
|
struct{
|
|
# 522 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_glb.h"
|
|
uint vo0:2 ;
|
|
uint vo1:2 ;
|
|
uint vpm0:2 ;
|
|
uint fqos:1 ;
|
|
uint fast:1 ;
|
|
uint mc:1 ;
|
|
uint kpcp:1 ;
|
|
|
|
uint dpi:1 ;
|
|
uint owf:1 ;
|
|
uint enable:14 ;
|
|
uint cpu:1 ;
|
|
uint nbq_low:5 ;
|
|
# 550 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_glb.h"
|
|
uint vid0:12 ;
|
|
uint pcp0:4 ;
|
|
uint vid1:12 ;
|
|
uint pcp1:4 ;
|
|
# 570 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_glb.h"
|
|
uint cnt0_hi:2 ;
|
|
uint cnt1:5 ;
|
|
uint :1 ;
|
|
|
|
|
|
|
|
|
|
uint meter_group_id:8 ;
|
|
uint ipv4_dscp:8 ;
|
|
uint ipv6_traffic_class:8 ;
|
|
# 594 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_glb.h"
|
|
uint queue:3 ;
|
|
uint channel:5 ;
|
|
|
|
uint fport:4 ;
|
|
|
|
|
|
|
|
|
|
uint sp_tag:16 ;
|
|
uint cnt0_low:4 ;
|
|
|
|
|
|
};
|
|
uint msg[4] ;
|
|
} IFC_Action_Format ;
|
|
# 46 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_dev.h" 2
|
|
# 98 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_dev.h"
|
|
typedef union {
|
|
struct {
|
|
# 112 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_dev.h"
|
|
uint32 :3;
|
|
uint32 channel :5;
|
|
uint32 oam :1;
|
|
uint32 :2;
|
|
uint32 crcer :1;
|
|
uint32 runtf :1;
|
|
uint32 longf :1;
|
|
uint32 gem :16;
|
|
uint32 no_mic :1;
|
|
uint32 :1;
|
|
# 136 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_dev.h"
|
|
uint32 ppe_entry :15;
|
|
uint32 crsn :5;
|
|
uint32 sport :5;
|
|
uint32 l4f :1;
|
|
uint32 l4vld :1;
|
|
uint32 ip4f :1;
|
|
uint32 ip4 :1;
|
|
uint32 ip6 :1;
|
|
uint32 dei :1;
|
|
uint32 :1;
|
|
# 154 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_dev.h"
|
|
uint32 l2_len :7;
|
|
uint32 ifc_hit :1;
|
|
uint32 ifc_fid :8;
|
|
uint32 :16;
|
|
|
|
|
|
uint32 resv;
|
|
} ;
|
|
uint32 word[4] ;
|
|
} FERxMsg_T ;
|
|
# 310 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_dev.h"
|
|
typedef struct {
|
|
|
|
uint8_t snap_en;
|
|
uint8_t vlan_layer;
|
|
uint8_t pppoe_en;
|
|
uint8_t ip_type;
|
|
uint8_t tcp_udp_type;
|
|
uint8_t fix_seed;
|
|
|
|
|
|
uint8_t dmac[6];
|
|
uint8_t smac[6];
|
|
uint16_t eth_type;
|
|
|
|
|
|
uint16_t vlan1_tag;
|
|
uint16_t vlan1;
|
|
uint16_t vlan2_tag;
|
|
uint16_t vlan2;
|
|
|
|
uint16_t vlan3_tag;
|
|
uint16_t vlan3;
|
|
uint16_t vlan4_tag;
|
|
uint16_t vlan4;
|
|
|
|
|
|
uint16_t ppp_tag;
|
|
uint16_t pppoe_sid;
|
|
|
|
|
|
struct iphdr iph;
|
|
struct ipv6hdr ip6h;
|
|
|
|
|
|
struct tcphdr th;
|
|
struct udphdr uh;
|
|
|
|
struct sk_buff *skb;
|
|
} pktInfo;
|
|
|
|
typedef struct {
|
|
|
|
uint8_t dmac[6];
|
|
uint8_t smac[6];
|
|
uint16_t eth_type;
|
|
uint16_t dmac_type;
|
|
|
|
|
|
uint16_t vlan1_gap;
|
|
uint16_t vlan1_tag;
|
|
uint16_t vlan1;
|
|
uint16_t vlan2_gap;
|
|
uint16_t vlan2_tag;
|
|
uint16_t vlan2;
|
|
|
|
uint16_t vlan3_gap;
|
|
uint16_t vlan3_tag;
|
|
uint16_t vlan3;
|
|
uint16_t vlan4_gap;
|
|
uint16_t vlan4_tag;
|
|
uint16_t vlan4;
|
|
uint16_t vlan_layer;
|
|
|
|
|
|
uint32_t pppoe_gap;
|
|
uint16_t ppp_tag;
|
|
uint16_t pppoe_sid;
|
|
|
|
|
|
struct iphdr iph;
|
|
struct ipv6hdr ip6h;
|
|
|
|
|
|
struct tcphdr th;
|
|
struct udphdr uh;
|
|
|
|
|
|
uint8_t pppoe_en;
|
|
uint8_t iph_en;
|
|
uint8_t ip6h_en;
|
|
uint8_t tcp_udp_en;
|
|
|
|
|
|
uint8_t l2_offset;
|
|
uint8_t l3_offset;
|
|
uint8_t l4_offset;
|
|
|
|
|
|
uint16_t sinf;
|
|
uint16_t gem_port_id;
|
|
uint16_t frame_type;
|
|
} IfcPktParseResult;
|
|
# 414 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_dev.h"
|
|
int get_ifc_index(struct sk_buff *skb, FERxMsg_T *rxMsgPtr);
|
|
# 67 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c" 2
|
|
# 1 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_util.h" 1
|
|
# 45 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_util.h"
|
|
# 1 "include/ecnt_hook/ecnt_hook_qdma.h" 1
|
|
# 45 "include/ecnt_hook/ecnt_hook_qdma.h"
|
|
# 1 "include/ecnt_hook/ecnt_hook.h" 1
|
|
# 77 "include/ecnt_hook/ecnt_hook.h"
|
|
typedef enum {
|
|
ECNT_HOOK_ERROR = -1,
|
|
ECNT_RETURN_DROP= 0,
|
|
ECNT_CONTINUE ,
|
|
ECNT_RETURN,
|
|
}ecnt_ret_val;
|
|
|
|
enum ecnt_maintype{
|
|
ECNT_NET_CORE_DEV,
|
|
ECNT_NET_VLAN_DEV,
|
|
ECNT_NET_BR_FDB,
|
|
ECNT_NET_BR_FORWARD,
|
|
ECNT_NET_BR_INPUT,
|
|
ECNT_NET_PPP_GENERIC,
|
|
ECNT_NET_UDP,
|
|
ECNT_NET_UDPV6,
|
|
ECNT_NET_AF,
|
|
ECNT_NET_SOCK,
|
|
ECNT_NET_IP_OUTPUT,
|
|
ECNT_NET_IGMP,
|
|
ECNT_NF_BR,
|
|
ECNT_NF_ARP,
|
|
ECNT_NF_IPV4,
|
|
ECNT_NF_IPV6,
|
|
ECNT_NF_TRACK_CORE,
|
|
ECNT_QDMA_WAN,
|
|
ECNT_QDMA_LAN,
|
|
ECNT_FE,
|
|
ECNT_PPE,
|
|
ECNT_ATM,
|
|
ECNT_PTM,
|
|
ECNT_ETHER_SWITCH,
|
|
ECNT_ETHER_PHY,
|
|
ECNT_XPON_MAC,
|
|
ECNT_XPON_PHY,
|
|
ECNT_QDMA_7510_20,
|
|
ECNT_PCIE,
|
|
ECNT_MULTICAST,
|
|
ECNT_L2TP,
|
|
ECNT_TRAFFIC_CLASSIFY,
|
|
ECNT_SMUX,
|
|
ECNT_VOIP,
|
|
ECNT_CRYPTO,
|
|
ECNT_HOOK_EVENT,
|
|
ECNT_MULTICAST_GENERAL,
|
|
ECNT_IRQ_NUM,
|
|
ECNT_SAR,
|
|
ECNT_TSO_WAN,
|
|
ECNT_TSO_LAN,
|
|
ECNT_LRO_WAN,
|
|
ECNT_LRO_LAN,
|
|
ECNT_XPON_VLAN,
|
|
ECNT_XPON_MAPPING,
|
|
ECNT_XPON_IGMP,
|
|
ECNT_SPI_NAND,
|
|
ECNT_AUTOBENCH_USB,
|
|
ECNT_AUTOBENCH_DMT,
|
|
ECNT_UART,
|
|
ECNT_XSI_MAC,
|
|
ECNT_XSI_PHY,
|
|
ECNT_IFC,
|
|
ECNT_NET_GRE,
|
|
ECNT_DGASP,
|
|
ECNT_NET_VXLAN,
|
|
ECNT_NET_IP6_OUTPUT,
|
|
ECNT_NET_NF,
|
|
ECNT_THERMAL_PHY,
|
|
ECNT_GPON_FLOW,
|
|
ECNT_VLAN,
|
|
ECNT_ASYM,
|
|
ECNT_XSI_WAN_MAC,
|
|
ECNT_HSGMII_LAN_MAC,
|
|
ECNT_AE_WAN_MAC,
|
|
ECNT_NET_PPTP,
|
|
ECNT_NUM_MAINTYPE
|
|
};
|
|
|
|
struct ecnt_data;
|
|
|
|
typedef ecnt_ret_val ecnt_hookfn(struct ecnt_data *in_data);
|
|
|
|
struct net_info_s{
|
|
|
|
};
|
|
|
|
struct nf_info_s{
|
|
|
|
};
|
|
|
|
struct ecnt_ops_info{
|
|
unsigned int drop_num;
|
|
union{
|
|
struct nf_info_s nf_info;
|
|
struct net_info_s net_info;
|
|
};
|
|
};
|
|
struct ecnt_hook_ops {
|
|
struct list_head list;
|
|
unsigned int hook_id;
|
|
struct ecnt_ops_info info;
|
|
|
|
const char *name;
|
|
unsigned int is_execute;
|
|
ecnt_hookfn *hookfn;
|
|
unsigned int maintype;
|
|
unsigned int subtype;
|
|
|
|
int priority;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
extern struct list_head ecnt_hooks[ECNT_NUM_MAINTYPE][8];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern void ecnt_hook_init(void);
|
|
extern int __ECNT_HOOK(unsigned int maintype, unsigned int subtype,struct ecnt_data *in_data);
|
|
extern int ecnt_register_hook(struct ecnt_hook_ops *reg);
|
|
extern void ecnt_unregister_hook(struct ecnt_hook_ops *reg);
|
|
extern int show_all_ecnt_hookfn(void);
|
|
extern int set_ecnt_hookfn_execute_or_not(unsigned int maintype, unsigned int subtype, unsigned int hook_id, unsigned int is_execute);
|
|
extern int ecnt_ops_unregister(unsigned int maintype, unsigned int subtype, unsigned int hook_id);
|
|
extern int get_ecnt_hookfn(unsigned int maintype, unsigned int subtype);
|
|
extern int ecnt_register_hooks(struct ecnt_hook_ops *reg, unsigned int n);
|
|
extern void ecnt_unregister_hooks(struct ecnt_hook_ops *reg, unsigned int n);
|
|
# 46 "include/ecnt_hook/ecnt_hook_qdma.h" 2
|
|
# 1 "include/ecnt_hook/ecnt_hook_qdma_type.h" 1
|
|
# 176 "include/ecnt_hook/ecnt_hook_qdma_type.h"
|
|
struct port_info;
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
DBG_ERR ,
|
|
DBG_ST ,
|
|
DBG_WARN ,
|
|
DBG_MSG ,
|
|
DBG_LEVEL_MAX
|
|
} QDMA_DebugLevel_t ;
|
|
|
|
typedef enum {
|
|
QDMA_CALLBACK_RX_PACKET,
|
|
|
|
|
|
|
|
QDMA_CALLBACK_EVENT_HANDLER,
|
|
QDMA_CALLBACK_RECYCLE_PACKET,
|
|
QDMA_CALLBACK_GPON_MAC_HANDLER,
|
|
QDMA_CALLBACK_EPON_MAC_HANDLER,
|
|
QDMA_CALLBACK_XPON_PHY_HANDLER,
|
|
|
|
QDMA_CALLBACK_INT2_RX_PACKET,
|
|
QDMA_CALLBACK_INT2_EVENT_HANDLER,
|
|
QDMA_CALLBACK_INT3_RX_PACKET,
|
|
QDMA_CALLBACK_INT3_EVENT_HANDLER,
|
|
QDMA_CALLBACK_INT4_RX_PACKET,
|
|
QDMA_CALLBACK_INT4_EVENT_HANDLER,
|
|
} QDMA_CbType_t ;
|
|
|
|
typedef enum {
|
|
QDMA_EVENT_RECV_PKTS = 0 ,
|
|
QDMA_EVENT_NO_RX_BUFFER ,
|
|
QDMA_EVENT_TX_CROWDED
|
|
} QDMA_EventType_t ;
|
|
|
|
typedef enum {
|
|
QDMA_LOOPBACK_DISABLE = 0 ,
|
|
QDMA_LOOPBACK_QDMA ,
|
|
QDMA_LOOPBACK_UMAC
|
|
} QDMA_LoopbackMode_t ;
|
|
|
|
typedef enum {
|
|
QDMA_TX_POLLING = 0 ,
|
|
QDMA_TX_INTERRUPT ,
|
|
} QDMA_RecycleMode_t ;
|
|
|
|
typedef enum {
|
|
QDMA_RX_POLLING = 0 ,
|
|
QDMA_RX_INTERRUPT ,
|
|
QDMA_RX_NAPI
|
|
} QDMA_RecvMode_t ;
|
|
|
|
typedef enum {
|
|
QDMA_DISABLE = 0 ,
|
|
QDMA_ENABLE
|
|
} QDMA_Mode_t ;
|
|
|
|
typedef enum {
|
|
QDMA_WAN_TYPE_GPON = 0,
|
|
QDMA_WAN_TYPE_EPON,
|
|
QDMA_WAN_TYPE_PTM,
|
|
QDMA_WAN_TYPE_SAR
|
|
} QDMA_WanType_t ;
|
|
|
|
typedef enum {
|
|
QDMA_TXQOS_WEIGHT_BY_PACKET = 0,
|
|
QDMA_TXQOS_WEIGHT_BY_BYTE,
|
|
QDMA_TXQOS_WEIGHT_MAX,
|
|
} QDMA_TxQosWeightType_t ;
|
|
|
|
|
|
typedef enum {
|
|
QDMA_TXQOS_WEIGHT_SCALE_1B = 0,
|
|
QDMA_TXQOS_WEIGHT_SCALE_16B,
|
|
QDMA_TXQOS_WEIGHT_SCALE_MAX,
|
|
} QDMA_TxQosWeightScale_t ;
|
|
# 263 "include/ecnt_hook/ecnt_hook_qdma_type.h"
|
|
typedef enum {
|
|
QDMA_TXQOS_TYPE_WRR = 0,
|
|
QDMA_TXQOS_TYPE_SP,
|
|
QDMA_TXQOS_TYPE_SPWRR7,
|
|
QDMA_TXQOS_TYPE_SPWRR6,
|
|
QDMA_TXQOS_TYPE_SPWRR5,
|
|
QDMA_TXQOS_TYPE_SPWRR4,
|
|
QDMA_TXQOS_TYPE_SPWRR3,
|
|
QDMA_TXQOS_TYPE_SPWRR2,
|
|
QDMA_TXQOS_TYPE_NUMS
|
|
} QDMA_TxQosType_t ;
|
|
|
|
typedef enum {
|
|
QDMA_VCHNL_TXQOS_TYPE_WRR = 0,
|
|
QDMA_VCHNL_TXQOS_TYPE_SP,
|
|
QDMA_VCHNL_TXQOS_TYPE_SPWRR3,
|
|
QDMA_VCHNL_TXQOS_TYPE_SPWRR2,
|
|
QDMA_VCHNL_TXQOS_TYPE_NUMS
|
|
} QDMA_VirChnlQosType_t ;
|
|
|
|
typedef enum {
|
|
QDMA_TRTCM_SCALE_1BYTE = 0,
|
|
QDMA_TRTCM_SCALE_2BYTE,
|
|
QDMA_TRTCM_SCALE_4BYTE,
|
|
QDMA_TRTCM_SCALE_8BYTE,
|
|
QDMA_TRTCM_SCALE_16BYTE,
|
|
QDMA_TRTCM_SCALE_32BYTE,
|
|
QDMA_TRTCM_SCALE_64BYTE,
|
|
QDMA_TRTCM_SCALE_128BYTE,
|
|
QDMA_TRTCM_SCALE_256BYTE,
|
|
QDMA_TRTCM_SCALE_512BYTE,
|
|
QDMA_TRTCM_SCALE_1KBYTE,
|
|
QDMA_TRTCM_SCALE_2KBYTE,
|
|
QDMA_TRTCM_SCALE_4KBYTE,
|
|
QDMA_TRTCM_SCALE_8KBYTE,
|
|
QDMA_TRTCM_SCALE_16KBYTE,
|
|
QDMA_TRTCM_SCALE_32KBYTE,
|
|
QDMA_TRTCM_SCALE_MAX_ITEMS
|
|
} QDMA_TrtcmScale_t ;
|
|
|
|
typedef enum {
|
|
QDMA_TRTCM_PARAM_CIR = 0,
|
|
QDMA_TRTCM_PARAM_CBS,
|
|
QDMA_TRTCM_PARAM_PIR,
|
|
QDMA_TRTCM_PARAM_PBS
|
|
} QDMA_TrtcmParamType_t ;
|
|
|
|
typedef enum {
|
|
QDMA_EPON_REPORT_WO_THRESHOLD = 0,
|
|
QDMA_EPON_REPORT_ONE_THRESHOLD,
|
|
QDMA_EPON_REPORT_TWO_THRESHOLD,
|
|
QDMA_EPON_REPORT_THREE_THRESHOLD
|
|
} QDMA_EponReportMode_t ;
|
|
|
|
typedef enum {
|
|
QDMA_TXQUEUE_SCALE_2_DSCP = 0,
|
|
QDMA_TXQUEUE_SCALE_4_DSCP,
|
|
QDMA_TXQUEUE_SCALE_8_DSCP,
|
|
QDMA_TXQUEUE_SCALE_16_DSCP,
|
|
QDMA_TXQUEUE_SCALE_ITEMS
|
|
} QDMA_TxQueueThresholdScale_t ;
|
|
|
|
typedef enum {
|
|
PSE_PCP_TYPE_CDM_TX = 0,
|
|
PSE_PCP_TYPE_CDM_RX,
|
|
PSE_PCP_TYPE_GDM_RX
|
|
} PSE_PcpType_t ;
|
|
|
|
typedef enum {
|
|
PSE_PCP_MODE_DISABLE = 0,
|
|
PSE_PCP_MODE_8B0D = 1,
|
|
PSE_PCP_MODE_7B1D = 2,
|
|
PSE_PCP_MODE_6B2D = 4,
|
|
PSE_PCP_MODE_5B3D = 8
|
|
} PSE_PcpMode_t ;
|
|
|
|
typedef enum {
|
|
QDMA_RX_RATE_LIMIT_BY_BYTE = 0,
|
|
QDMA_RX_RATE_LIMIT_BY_PACKET,
|
|
} QDMA_RxPktMode_t ;
|
|
# 358 "include/ecnt_hook/ecnt_hook_qdma_type.h"
|
|
typedef enum {
|
|
QDMA_Tx_Rate_Limit_CIR = 0,
|
|
QDMA_Tx_Rate_Limit_CBS,
|
|
QDMA_Tx_Rate_Limit_PIR,
|
|
QDMA_Tx_Rate_Limit_PBS
|
|
} QDMA_TxRateLimitType_t ;
|
|
|
|
|
|
typedef enum {
|
|
QDMA_INT1 = 1,
|
|
QDMA_INT2 ,
|
|
QDMA_INT3 ,
|
|
QDMA_INT4 ,
|
|
QDMA_INT_NUM,
|
|
} QDMA_InterruptNo_t ;
|
|
|
|
typedef enum {
|
|
QDMA_IRQ1 = 1,
|
|
QDMA_IRQ2 ,
|
|
QDMA_IRQ_MAX_NUM,
|
|
} QDMA_IrqNo_t ;
|
|
|
|
typedef enum {
|
|
|
|
|
|
|
|
QDMA_INT_ENABLE1 = 1 ,
|
|
QDMA_INT_ENABLE2 = 2 ,
|
|
|
|
QDMA_INT_ENABLE_NUM = 2 ,
|
|
|
|
|
|
|
|
} QDMA_IntEnable_t ;
|
|
|
|
|
|
|
|
typedef enum{
|
|
QDMA_DRAM_MODE=0,
|
|
QDMA_SRAM_MODE=1,
|
|
}QDMA_RamMode_T;
|
|
|
|
|
|
typedef enum{
|
|
INGRESS_TRTCM=0,
|
|
SLA_TRTCM,
|
|
EGRESS_TRTCM,
|
|
GLB_RATECTL,
|
|
TRTCM_MODE_MAX,
|
|
} GENERAL_TrtcmModuleType_T;
|
|
|
|
|
|
typedef enum{
|
|
TRTCM_DISABLE=0,
|
|
TRTCM_ENABLE
|
|
} GENERAL_Trtcm_T;
|
|
|
|
|
|
typedef enum{
|
|
TRTCM_RATELIMIT_MODE=0,
|
|
TRTCM_MODE
|
|
} GENERAL_TrtcmMode_T;
|
|
|
|
|
|
typedef enum{
|
|
GENERAL_METER_DISABLE=0,
|
|
GENERAL_METER_ENABLE
|
|
} GENERAL_TrtcmMeter_T;
|
|
|
|
typedef enum{
|
|
TRTCM_FAST_TICK = 0,
|
|
TRTCM_SLOW_TICK
|
|
} GENERAL_TrtcmTickSel_T;
|
|
|
|
typedef enum{
|
|
TRTCM_MISC = 0,
|
|
TRTCM_TOKEN_RATE,
|
|
TRTCM_BUCKETSIZE_SHIFT,
|
|
TRTCM_BUCKET_COUNTER
|
|
} GENERAL_TrtcmParaType_T;
|
|
|
|
typedef enum{
|
|
TRTCM_COMMIT_MODE = 0,
|
|
TRTCM_PEAK_MODE,
|
|
TRTCM_RATE_TYPE_MAX
|
|
} GENERAL_TrtcmRateType_T ;
|
|
|
|
typedef enum{
|
|
TRTCM_BYTE_MODE = 0,
|
|
TRTCM_PACKET_MODE
|
|
}GENERAL_TrtcmPktMode_T;
|
|
|
|
typedef enum{
|
|
FLOWCNT_CLEAR_BYTE=0,
|
|
FLOWCNT_CLEAR_PKT,
|
|
FLOWCNT_CLEAR_ALL,
|
|
}QDMA_FlowCnt_Clear_Mode_T;
|
|
|
|
typedef enum{
|
|
NORMAL_PACKET=0,
|
|
DEI_PACKET,
|
|
PACKET_TYPE_ITEMS
|
|
}QDMA_PacketType_T;
|
|
|
|
typedef enum{
|
|
ACNT0_TYPE=0,
|
|
ACNT1_TYPE,
|
|
ACNT2_TYPE,
|
|
}QDMA_AcntType_T;
|
|
|
|
|
|
|
|
typedef enum{
|
|
QDMA_QOS_AGING_THRESHOLD=0,
|
|
QDMA_QOS_AGING_ALWAYS=1,
|
|
}QDMA_AgingMethod_T;
|
|
|
|
|
|
typedef enum {
|
|
QDMA_TX_RATE_METER_TIME_DIVISOR_1 = 0,
|
|
QDMA_TX_RATE_METER_TIME_DIVISOR_2,
|
|
QDMA_TX_RATE_METER_TIME_DIVISOR_4,
|
|
QDMA_TX_RATE_METER_TIME_DIVISOR_8,
|
|
QDMA_TX_RATE_METER_TIME_DIVISOR_ITEMS
|
|
} QDMA_TxRateMeterTimeDivisor_t ;
|
|
|
|
typedef enum {
|
|
QDMA_DYNCNGST_DEI_THRH_SCALE_1_2 = 0,
|
|
QDMA_DYNCNGST_DEI_THRH_SCALE_1_4,
|
|
QDMA_DYNCNGST_DEI_THRH_SCALE_1_8,
|
|
QDMA_DYNCNGST_DEI_THRH_SCALE_1_16,
|
|
QDMA_DYNCNGST_DEI_THRH_SCALE_ITEMS
|
|
} QDMA_TxDynCngstDeiThrhScale_t ;
|
|
|
|
typedef enum {
|
|
QDMA_QUEUE_NONBLOCKING = 0 ,
|
|
QDMA_QUEUE_NORMAL
|
|
} QDMA_TxQCngstQueueMode_t ;
|
|
|
|
typedef enum {
|
|
QDMA_CHANNEL_NONBLOCKING = 0 ,
|
|
QDMA_CHANNEL_NORMAL
|
|
} QDMA_TxQCngstChannelMode_t ;
|
|
|
|
typedef enum {
|
|
QDMA_DBG_CNTR_SRC_CPU_TX = 0,
|
|
QDMA_DBG_CNTR_SRC_FWD_TX,
|
|
QDMA_DBG_CNTR_SRC_CPU_RX,
|
|
QDMA_DBG_CNTR_SRC_FWD_RX,
|
|
QDMA_DBG_CNTR_CPU_TX_DROP,
|
|
QDMA_DBG_CNTR_FWD_RX_DROP,
|
|
QDMA_DBG_CNTR_CPU_RX_DROP,
|
|
QDMA_DBG_CNTR_MULTICAST_DROP,
|
|
QDMA_DBG_CNTR_MULTICAST_ALL_DROP,
|
|
QDMA_DBG_CNTR_AGE_OUT_DROP,
|
|
QDMA_DBG_CNTR_SRC_ITEMS,
|
|
} QDMA_DbgCntrSrc_t ;
|
|
|
|
typedef enum {
|
|
QDMA_TXCNGST_DYNAMIC_NORMAL = 0,
|
|
QDMA_TXCNGST_DYNAMIC_PEAKRATE_MARGIN,
|
|
QDMA_TXCNGST_STATIC,
|
|
} QDMA_TxCngstMode_t ;
|
|
|
|
typedef enum {
|
|
QDMA_TXCNGST_PEEKRATE_MARGIN_0 = 0,
|
|
QDMA_TXCNGST_PEEKRATE_MARGIN_25,
|
|
QDMA_TXCNGST_PEEKRATE_MARGIN_50,
|
|
QDMA_TXCNGST_PEEKRATE_MARGIN_100,
|
|
} QDMA_PeekRateMargin_t ;
|
|
|
|
|
|
typedef enum {
|
|
QDMA_DBG_MEM_XS_MEMSEL_LOCAL_DSCP_INFO = 0,
|
|
QDMA_DBG_MEM_XS_MEMSEL_LOCAL_QUEUE_INFO,
|
|
QDMA_DBG_MEM_XS_MEMSEL_QOS_WEIGHT_COUNTER,
|
|
QDMA_DBG_MEM_XS_MEMSEL_LOCAL_DMA_INDEX,
|
|
QDMA_DBG_MEM_XS_MEMSEL_BUFFER_MONITOR,
|
|
QDMA_DBG_MEM_XS_MEMSEL_RATELIMIT_PARAM,
|
|
QDMA_DBG_MEM_XS_MEMSEL_VCHNL_QOS_WEIGHT,
|
|
QDMA_DBG_MEM_XS_MEMSEL_MAX,
|
|
} QDMA_DbgMemXsMemSel_t ;
|
|
|
|
typedef enum {
|
|
MAC_TYPE_ETHER = 0,
|
|
MAC_TYPE_XPON,
|
|
MAC_TYPE_PTM,
|
|
MAC_TYPE_ATM,
|
|
MAC_TYPE_LRO,
|
|
} MAC_Type_t ;
|
|
|
|
typedef enum {
|
|
QDMA_VIRTUAL_CHANNEL_16Queue = 0,
|
|
QDMA_VIRTUAL_CHANNEL_32Queue,
|
|
} QDMA_VirChnlMapMode_t ;
|
|
|
|
typedef enum {
|
|
QDMA_DBG_CNTR_CHNL_TXCPU = 0,
|
|
QDMA_DBG_CNTR_CHNL_TXFWD1,
|
|
QDMA_DBG_CNTR_CHNL_TXFWD2,
|
|
QDMA_DBG_CNTR_QUEUE,
|
|
|
|
|
|
|
|
QDMA_DBG_CNTR_MAX,
|
|
} QDMA_DbgCntrChnlGroup_t ;
|
|
|
|
typedef enum {
|
|
QDMA_DBG_CNTR_MEM_CTX = 0,
|
|
QDMA_DBG_CNTR_MEM_FTX,
|
|
QDMA_DBG_CNTR_MEM_FRX,
|
|
QDMA_DBG_CNTR_MEM_AGEOUT_DROP,
|
|
QDMA_DBG_CNTR_MEM_MAX,
|
|
} QDMA_DbgCntrMemGroup_t ;
|
|
|
|
typedef enum {
|
|
QDMA_DUMP_TX_DSCP = 0,
|
|
QDMA_DUMP_RX_DSCP,
|
|
} QDMA_DscpDumpMode_t ;
|
|
|
|
typedef enum{
|
|
NULLQOS = -1,
|
|
QOS_SW_PQ = 0,
|
|
QOS_SW_WRR = 1,
|
|
QOS_SW_CAR = 2,
|
|
QOS_HW_WRR = 3,
|
|
QOS_HW_PQ = 4,
|
|
QOS_HW_CAR = 5,
|
|
}QDMA_QoSClassfication_t ;
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
|
QDMA_FUNCTION_INIT = 0,
|
|
QDMA_FUNCTION_DEINIT ,
|
|
QDMA_FUNCTION_TX_DMA_MODE ,
|
|
QDMA_FUNCTION_RX_DMA_MODE ,
|
|
QDMA_FUNCTION_LOOPBACK_MODE ,
|
|
QDMA_FUNCTION_REGISTER ,
|
|
QDMA_FUNCTION_UNREGISTER ,
|
|
QDMA_FUNCTION_ENABLE_RXPKT_INT ,
|
|
QDMA_FUNCTION_DISABLE_RXPKT_INT ,
|
|
QDMA_FUNCTION_RECEIVE_PACKETS ,
|
|
QDMA_FUNCTION_TRANSMIT_PACKETS ,
|
|
QDMA_FUNCTION_SET_TX_QOS_WEIGHT ,
|
|
QDMA_FUNCTION_GET_TX_QOS_WEIGHT ,
|
|
QDMA_FUNCTION_SET_TX_QOS ,
|
|
QDMA_FUNCTION_GET_TX_QOS ,
|
|
QDMA_FUNCTION_SET_MAC_LIMIT_THRESHOLD ,
|
|
QDMA_FUNCTION_GET_MAC_LIMIT_THRESHOLD ,
|
|
QDMA_FUNCTION_TRANSMIT_PACKET_WIFI_FAST ,
|
|
|
|
|
|
|
|
QDMA_FUNCTION_SET_TXBUF_THRESHOLD ,
|
|
QDMA_FUNCTION_GET_TXBUF_THRESHOLD ,
|
|
QDMA_FUNCTION_SET_PREFETCH_MODE ,
|
|
QDMA_FUNCTION_SET_PKTSIZE_OVERHEAD_EN ,
|
|
QDMA_FUNCTION_GET_PKTSIZE_OVERHEAD_EN ,
|
|
QDMA_FUNCTION_SET_PKTSIZE_OVERHEAD_VALUE ,
|
|
QDMA_FUNCTION_GET_PKTSIZE_OVERHEAD_VALUE ,
|
|
QDMA_FUNCTION_SET_LMGR_LOW_THRESHOLD ,
|
|
QDMA_FUNCTION_GET_LMGR_LOW_THRESHOLD ,
|
|
QDMA_FUNCTION_GET_LMGR_STATUS ,
|
|
|
|
|
|
|
|
QDMA_FUNCTION_SET_DEBUG_LEVEL,
|
|
QDMA_FUNCTION_DUMP_DMA_BUSY,
|
|
QDMA_FUNCTION_DUMP_REG_POLLING,
|
|
QDMA_FUNCTION_SET_FORCE_RX_RING1,
|
|
|
|
|
|
|
|
QDMA_FUNCTION_SET_TX_DROP_EN,
|
|
QDMA_FUNCTION_GET_TX_DROP_EN,
|
|
QDMA_FUNCTION_SET_TX_RATEMETER,
|
|
QDMA_FUNCTION_GET_TX_RATEMETER,
|
|
QDMA_FUNCTION_ENABLE_TX_RATELIMIT,
|
|
QDMA_FUNCTION_SET_TX_RATELIMIT_CFG,
|
|
QDMA_FUNCTION_GET_TX_RATELIMIT_CFG,
|
|
QDMA_FUNCTION_SET_TX_RATELIMIT,
|
|
QDMA_FUNCTION_GET_TX_RATELIMIT,
|
|
QDMA_FUNCTION_SET_TX_DBAREPORT,
|
|
QDMA_FUNCTION_GET_TX_DBAREPORT,
|
|
|
|
|
|
|
|
QDMA_FUNCTION_SET_RX_PROTECT_EN,
|
|
QDMA_FUNCTION_GET_RX_PROTECT_EN,
|
|
QDMA_FUNCTION_SET_RX_LOW_THRESHOLD,
|
|
QDMA_FUNCTION_GET_RX_LOW_THRESHOLD,
|
|
QDMA_FUNCTION_SET_RX_RATELIMIT_EN,
|
|
QDMA_FUNCTION_SET_RX_RATELIMIT_PKT_MODE,
|
|
QDMA_FUNCTION_GET_RX_RATELIMIT_CFG,
|
|
QDMA_FUNCTION_SET_RX_RATELIMIT,
|
|
QDMA_FUNCTION_GET_RX_RATELIMIT,
|
|
|
|
|
|
|
|
QDMA_FUNCTION_SET_TXQ_DEI_DROP_MODE,
|
|
QDMA_FUNCTION_GET_TXQ_DEI_DROP_MODE,
|
|
QDMA_FUNCTION_SET_TXQ_CNGST_MODE,
|
|
QDMA_FUNCTION_GET_TXQ_CNGST_MODE,
|
|
QDMA_FUNCTION_SET_TXQ_DEI_THRH_SCALE,
|
|
QDMA_FUNCTION_GET_TXQ_DEI_THRH_SCALE,
|
|
QDMA_FUNCTION_SET_TXQ_CNGST_AUTO_CONFIG,
|
|
QDMA_FUNCTION_GET_TXQ_CNGST_AUTO_CONFIG,
|
|
QDMA_FUNCTION_SET_TXQ_CNGST_DYNAMIC_THRESHOLD,
|
|
QDMA_FUNCTION_GET_TXQ_CNGST_DYNAMIC_THRESHOLD,
|
|
QDMA_FUNCTION_SET_TXQ_CNGST_TOTAL_THRESHOLD,
|
|
QDMA_FUNCTION_GET_TXQ_CNGST_TOTAL_THRESHOLD,
|
|
QDMA_FUNCTION_SET_TXQ_CNGST_CHANNEL_THRESHOLD,
|
|
QDMA_FUNCTION_GET_TXQ_CNGST_CHANNEL_THRESHOLD,
|
|
QDMA_FUNCTION_SET_TXQ_CNGST_QUEUE_THRESHOLD,
|
|
QDMA_FUNCTION_GET_TXQ_CNGST_QUEUE_THRESHOLD,
|
|
QDMA_FUNCTION_SET_PEEKRATE_PARAMS,
|
|
QDMA_FUNCTION_GET_PEEKRATE_PARAMS,
|
|
QDMA_FUNCTION_SET_TXQ_STATIC_QUEUE_NORMAL_THRESHOLD,
|
|
QDMA_FUNCTION_SET_TXQ_STATIC_QUEUE_DEI_THRESHOLD,
|
|
QDMA_FUNCTION_GET_TXQ_CNGST_DYNAMIC_INFO,
|
|
QDMA_FUNCTION_GET_TXQ_CNGST_STATIC_INFO,
|
|
QDMA_FUNCTION_SET_TXQ_CNGST_QUEUE_NONBLOCKING,
|
|
QDMA_FUNCTION_GET_TXQ_CNGST_QUEUE_NONBLOCKING,
|
|
QDMA_FUNCTION_SET_TXQ_CNGST_CHANNEL_NONBLOCKING,
|
|
QDMA_FUNCTION_GET_TXQ_CNGST_CHANNEL_NONBLOCKING,
|
|
|
|
|
|
|
|
QDMA_FUNCTION_SET_VIRTUAL_CHANNEL_MODE,
|
|
QDMA_FUNCTION_GET_VIRTUAL_CHANNEL_MODE,
|
|
QDMA_FUNCTION_SET_VIRTUAL_CHANNEL_QOS,
|
|
QDMA_FUNCTION_GET_VIRTUAL_CHANNEL_QOS,
|
|
|
|
|
|
|
|
QDMA_FUNCTION_SET_DBGCNTR_CHANNEL,
|
|
QDMA_FUNCTION_SET_DBGCNTR_QUEUE,
|
|
QDMA_FUNCTION_CLEAR_DBGCNTR,
|
|
QDMA_FUNCTION_DUMP_DBGCNTR,
|
|
QDMA_FUNCTION_SET_CHANNEL,
|
|
QDMA_FUNCTION_DUMP_CHANNEL,
|
|
QDMA_FUNCTION_GET_ALL_QUEUE_DBGCNTR,
|
|
|
|
|
|
|
|
QDMA_FUNCTION_DUMP_TX_QOS,
|
|
QDMA_FUNCTION_DUMP_VIRTUAL_CHANNEL_QOS,
|
|
QDMA_FUNCTION_DUMP_TX_RATELIMIT,
|
|
QDMA_FUNCTION_DUMP_RX_RATELIMIT,
|
|
QDMA_FUNCTION_DUMP_TX_DBA_REPORT,
|
|
QDMA_FUNCTION_DUMP_TXQ_CNGST,
|
|
|
|
QDMA_FUNCTION_CLEAR_CPU_COUNTER,
|
|
QDMA_FUNCTION_DUMP_CPU_COUNTER,
|
|
QDMA_FUNCTION_DUMP_REGISTER_INFO,
|
|
QDMA_FUNCTION_DUMP_DESCRIPTOR_INFO,
|
|
QDMA_FUNCTION_DUMP_IRQ_INFO,
|
|
QDMA_FUNCTION_DUMP_HWFWD_INFO,
|
|
QDMA_FUNCTION_DUMP_INFO_ALL,
|
|
|
|
|
|
|
|
QDMA_FUNCTION_READ_VIP_INFO,
|
|
QDMA_FUNCTION_SET_MAC_QOS_CONFIG,
|
|
|
|
QDMA_FUNCTION_GENERAL_SET_TRTCM_CFG,
|
|
QDMA_FUNCTION_GENERAL_GET_TRTCM_CFG,
|
|
QDMA_FUNCTION_GENERAL_SET_RATELIMIT_MODE_CFG,
|
|
QDMA_FUNCTION_GENERAL_GET_RATELIMIT_MODE_CFG,
|
|
QDMA_FUNCTION_GENERAL_SET_RATELIMIT_MODE_VALUE,
|
|
QDMA_FUNCTION_GENERAL_GET_RATELIMIT_MODE_VALUE,
|
|
QDMA_FUNCTION_GENERAL_SET_RATELIMIT_BUCKET_SIZE,
|
|
|
|
|
|
|
|
QDMA_FUNCTION_SET_DBGCNTR_RING,
|
|
|
|
|
|
|
|
QDMA_FUNCTION_ENABLE_RXPKT_INT2 ,
|
|
QDMA_FUNCTION_DISABLE_RXPKT_INT2 ,
|
|
QDMA_FUNCTION_RECEIVE_PACKETS_INT2 ,
|
|
|
|
QDMA_FUNCTION_GENERAL_SET_TRTCM_MODE_CFG,
|
|
QDMA_FUNCTION_GENERAL_GET_TRTCM_MODE_CFG,
|
|
QDMA_FUNCTION_GENERAL_SET_TRTCM_MODE_VALUE,
|
|
QDMA_FUNCTION_GENERAL_GET_TRTCM_MODE_VALUE,
|
|
QDMA_FUNCTION_GENERAL_SET_TRTCM_BUCKET_SIZE,
|
|
|
|
QDMA_FUNCTION_SET_FLOW_CNTR_CFG,
|
|
QDMA_FUNCTION_GET_FLOW_CNTR_CFG,
|
|
QDMA_FUNCTION_GET_FLOW_CNTR_VALUE,
|
|
QDMA_FUNCTION_CLEAR_FLOW_CNTR_VALUE,
|
|
QDMA_FUNCTION_SET_TX_WRED_MODE,
|
|
QDMA_FUNCTION_GET_TX_WRED_MODE,
|
|
QDMA_FUNCTION_SET_TX_WRED_THRESHOLD,
|
|
QDMA_FUNCTION_SET_TX_WRED_PROBABILITY,
|
|
QDMA_FUNCTION_GET_TX_WRED_CFG,
|
|
QDMA_FUNCTION_SET_CPU_RX_RED_PROBABILITY,
|
|
QDMA_FUNCTION_GET_CPU_RX_RED_PROBABILITY,
|
|
|
|
QDMA_FUNCTION_SET_CHANNEL_CLOSE_STATUS,
|
|
QDMA_FUNCTION_GET_CHANNEL_CLOSE_STATUS,
|
|
QDMA_FUNCTION_GET_CHANNEL_EMPTY_STATUS,
|
|
|
|
QDMA_FUNCTION_SET_OAM_MODIFY_FP_EN,
|
|
QDMA_FUNCTION_GET_OAM_MODIFY_FP_EN,
|
|
QDMA_FUNCTION_SET_MULTICAST_EN,
|
|
QDMA_FUNCTION_GET_MULTICAST_EN,
|
|
|
|
QDMA_FUNCTION_ALLOCATE_METER,
|
|
QDMA_FUNCTION_FREE_METER,
|
|
QDMA_FUNCTION_GET_QOS_FLAG,
|
|
QDMA_FUNCTION_ALLOCATE_ACNT,
|
|
QDMA_FUNCTION_FREE_ACNT,
|
|
|
|
|
|
|
|
QDMA_FUNCTION_SET_SLA_CHANNEL_CFG,
|
|
QDMA_FUNCTION_GET_SLA_CHANNEL_CFG,
|
|
QDMA_FUNCTION_SET_QOS_AGING_CFG,
|
|
QDMA_FUNCTION_GET_QOS_AGING_CFG,
|
|
QDMA_FUNCTION_SET_PER_QUEUE_AGING_CFG,
|
|
QDMA_FUNCTION_GET_PER_QUEUE_AGING_CFG,
|
|
QDMA_FUNCTION_SET_MULTICAST_SPTAG_CFG,
|
|
QDMA_FUNCTION_GET_MULTICAST_SPTAG_CFG,
|
|
QDMA_FUNCTION_SET_MULTICAST_FPORT_CFG,
|
|
QDMA_FUNCTION_GET_MULTICAST_FPORT_CFG,
|
|
QDMA_FUNCTION_SET_TXQ_STATIC_CHANNEL_EN,
|
|
QDMA_FUNCTION_SET_TXQ_STATIC_QUEUE_RATIO,
|
|
QDMA_FUNCTION_GET_HQOS_EN,
|
|
|
|
|
|
QDMA_FUNCTION_RESET,
|
|
QDMA_FUNCTION_DRAM_TEST_DMA_CONFIG,
|
|
QDMA_FUNCTION_DRAM_TEST_DMA_ENABLE,
|
|
QDMA_FUNCTION_DRAM_TEST_RX_DONE,
|
|
QDMA_FUNCTION_DRAM_TEST_DST_GET,
|
|
|
|
|
|
QDMA_FUNCTION_MAX_NUM ,
|
|
} QDMA_HookFunction_t ;
|
|
|
|
typedef struct {
|
|
int ring_idx;
|
|
uint tcp_ts_rply;
|
|
uint tcp_ack_seq;
|
|
} QDMA_RxInfo_T ;
|
|
|
|
typedef int (*qdma_callback_recv_packet_with_info_t)(void *, uint, struct sk_buff *, uint, QDMA_RxInfo_T *) ;
|
|
typedef int (*qdma_callback_recv_packet_t)(void *, uint, struct sk_buff *, uint) ;
|
|
typedef int (*qdma_callback_event_handler_t)(QDMA_EventType_t) ;
|
|
typedef void (*qdma_callback_int_handler_t)(void) ;
|
|
typedef int (*qdma_callback_recycle_packet_t)(struct sk_buff *, uint) ;
|
|
|
|
typedef struct {
|
|
MAC_Type_t macType ;
|
|
unchar txRecycleThrh ;
|
|
qdma_callback_recv_packet_t cbRecvPkts ;
|
|
|
|
|
|
|
|
qdma_callback_event_handler_t cbEventHandler ;
|
|
qdma_callback_recycle_packet_t cbRecyclePkts ;
|
|
qdma_callback_int_handler_t cbGponMacHandler ;
|
|
qdma_callback_int_handler_t cbEponMacHandler ;
|
|
qdma_callback_int_handler_t cbXponPhyHandler ;
|
|
|
|
qdma_callback_recv_packet_with_info_t cbInt2RecvPkts ;
|
|
qdma_callback_event_handler_t cbInt2EventHandler ;
|
|
qdma_callback_recv_packet_with_info_t cbInt3RecvPkts ;
|
|
qdma_callback_event_handler_t cbInt3EventHandler ;
|
|
qdma_callback_recv_packet_with_info_t cbInt4RecvPkts ;
|
|
qdma_callback_event_handler_t cbInt4EventHandler ;
|
|
} QDMA_InitCfg_t ;
|
|
|
|
typedef struct {
|
|
QDMA_Mode_t mode ;
|
|
ushort chnThreshold ;
|
|
ushort totalThreshold ;
|
|
} QDMA_TxBufCtrl_T ;
|
|
|
|
typedef struct {
|
|
unchar channel ;
|
|
QDMA_TxQosType_t qosType ;
|
|
struct {
|
|
ushort weight ;
|
|
} queue[8] ;
|
|
} QDMA_TxQosScheduler_T ;
|
|
|
|
typedef struct {
|
|
unchar channel ;
|
|
ushort cir ;
|
|
ushort cbs ;
|
|
ushort pir ;
|
|
ushort pbs ;
|
|
} QDMA_TrtcmParam_T ;
|
|
|
|
typedef struct {
|
|
QDMA_TxQueueThresholdScale_t maxScale ;
|
|
QDMA_TxQueueThresholdScale_t minScale ;
|
|
} QDMA_TxQueueCongestScale_T ;
|
|
|
|
typedef struct {
|
|
unchar deiScale;
|
|
struct {
|
|
unchar staticDeiThreshold ;
|
|
unchar staticNormalThreshold ;
|
|
} queue[8] ;
|
|
} QDMA_TxQueueCongestCfg_T ;
|
|
|
|
typedef struct {
|
|
uint normalThrh[8] ;
|
|
} QDMA_TxQStaticNormalCfg_T ;
|
|
|
|
typedef struct {
|
|
uint deiThrh[8] ;
|
|
} QDMA_TxQStaticDeiCfg_T ;
|
|
|
|
|
|
typedef struct {
|
|
unchar chnlIdx;
|
|
QDMA_Mode_t staticThrEn;
|
|
}QDMA_TxQStaticCfg_T ;
|
|
|
|
typedef struct {
|
|
unchar queueThrRatio[8] ;
|
|
}QDMA_TxQStaticThrRatio_T ;
|
|
|
|
typedef struct {
|
|
unchar slaIdx;
|
|
QDMA_Mode_t slaEn;
|
|
unchar chnlIdx;
|
|
}QDMA_SlaChnlCfg_T ;
|
|
|
|
typedef struct {
|
|
QDMA_Mode_t agingEn;
|
|
QDMA_AgingMethod_T agingMethod;
|
|
QDMA_Mode_t agingFastReplaceEn;
|
|
uint agingTime;
|
|
}QDMA_QoSAgingCfg_T ;
|
|
|
|
typedef struct {
|
|
unchar chnlIdx;
|
|
unchar queueIdx;
|
|
QDMA_Mode_t queueAgingEn;
|
|
}QDMA_TxQAgingCfg_T ;
|
|
|
|
typedef struct {
|
|
unchar chnlIdx;
|
|
unchar sptagKeepHiEn;
|
|
ushort sptag;
|
|
}QDMA_MulticastSptagCfg_T ;
|
|
|
|
typedef struct {
|
|
unchar chnlIdx;
|
|
ushort fport;
|
|
}QDMA_MulticastFportCfg_T ;
|
|
|
|
|
|
typedef struct {
|
|
unchar cntrIdx ;
|
|
unchar cntrEn ;
|
|
QDMA_DbgCntrSrc_t cntrSrc ;
|
|
unchar isChnlAll ;
|
|
unchar isQueueAll ;
|
|
unchar isDscpRingAll ;
|
|
unchar chnlIdx ;
|
|
unchar queueIdx ;
|
|
unchar dscpRingIdx ;
|
|
uint cntrVal ;
|
|
} QDMA_DBG_CNTR_T ;
|
|
|
|
|
|
typedef struct {
|
|
GENERAL_TrtcmModuleType_T trtcmModule;
|
|
GENERAL_Trtcm_T trtcmEn;
|
|
GENERAL_TrtcmMode_T trtcmMode;
|
|
uint trtcmSlowTickRatio;
|
|
uint trtcmFastTick;
|
|
}GENERAL_TrtcmCfg_T ;
|
|
|
|
|
|
typedef struct {
|
|
GENERAL_TrtcmModuleType_T trtcmModule;
|
|
unchar Index;
|
|
GENERAL_TrtcmMeter_T MeterEn;
|
|
GENERAL_TrtcmPktMode_T PktMode;
|
|
GENERAL_TrtcmTickSel_T TickSel;
|
|
}GENERAL_TrtcmRatelimitCfg_T ;
|
|
|
|
|
|
typedef struct {
|
|
GENERAL_TrtcmModuleType_T trtcmModule;
|
|
unchar Index;
|
|
uint RateLimitValue;
|
|
uint BucketSize;
|
|
}GENERAL_TrtcmRatelimitSet_T ;
|
|
|
|
|
|
typedef struct {
|
|
GENERAL_TrtcmModuleType_T trtcmModule;
|
|
unchar Index;
|
|
GENERAL_TrtcmMeter_T CbsMeterEn;
|
|
GENERAL_TrtcmPktMode_T CbsPktMode;
|
|
GENERAL_TrtcmTickSel_T CbsTickSel;
|
|
GENERAL_TrtcmMeter_T PbsMeterEn;
|
|
GENERAL_TrtcmPktMode_T PbsPktMode;
|
|
GENERAL_TrtcmTickSel_T PbsTickSel;
|
|
}GENERAL_TrtcmCbsPbsCfg_T ;
|
|
|
|
|
|
typedef struct {
|
|
GENERAL_TrtcmModuleType_T trtcmModule;
|
|
unchar Index;
|
|
uint CbsParamValue;
|
|
uint PbsParamValue;
|
|
uint CbsBucketSize;
|
|
uint PbsBucketSize;
|
|
}GENERAL_TrtcmCbsPbsSet_T ;
|
|
|
|
|
|
typedef struct {
|
|
unchar grpIdx;
|
|
unchar enable;
|
|
}QDMA_FlowCntIncDropCfg_T ;
|
|
|
|
typedef struct {
|
|
unchar grpIdx;
|
|
unchar cntIdx;
|
|
uint byteLow;
|
|
uint byteHigh;
|
|
uint pktCnt;
|
|
uint pktHigh;
|
|
}QDMA_FlowCntValueGet_T ;
|
|
|
|
typedef struct {
|
|
unchar grpIdx;
|
|
unchar cntIdx;
|
|
QDMA_FlowCnt_Clear_Mode_T clearMode;
|
|
}QDMA_FlowCntValueClear_T ;
|
|
|
|
typedef struct {
|
|
unchar chnlIdx;
|
|
|
|
unchar chnlStatus;
|
|
}QDMA_ChannelStatus_T ;
|
|
|
|
typedef struct {
|
|
char bind_func_name[(16)];
|
|
int meter_id;
|
|
int Qos_flag;
|
|
}QDMA_MeterManage_T ;
|
|
|
|
typedef struct {
|
|
char bind_func_name[(16)];
|
|
int acnt_id;
|
|
QDMA_AcntType_T acnt_type;
|
|
}QDMA_AcntManage_T ;
|
|
|
|
typedef struct {
|
|
QDMA_Mode_t txWredEn;
|
|
QDMA_PacketType_T txWredPacketType;
|
|
unchar txWredThrProbability[(4)];
|
|
unchar txWredThrValue[(5)];
|
|
}QDMA_TxWredCfg_T ;
|
|
|
|
typedef struct {
|
|
QDMA_PacketType_T rxRedPacketType;
|
|
unchar rxRedThrProbability;
|
|
unchar rxRedThrValue[(16)];
|
|
}QDMA_RxRedCfg_T ;
|
|
|
|
|
|
|
|
typedef struct {
|
|
ushort txRateMeterWindowSize ;
|
|
ushort txRateMeterTimeSlice ;
|
|
} QDMA_TxRateMeter_T ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
ushort txRateLimitUnit[(2)] ;
|
|
QDMA_TrtcmScale_t txRateLimitBucketScale ;
|
|
} QDMA_TxRateLimitCfg_T ;
|
|
|
|
typedef struct {
|
|
unchar chnlIdx ;
|
|
unchar chnlRateLimitEn ;
|
|
uint rateLimitValue ;
|
|
} QDMA_TxRateLimitSet_T ;
|
|
|
|
typedef struct {
|
|
unchar chnlIdx ;
|
|
unchar chnlRateLimitEn ;
|
|
uint rateLimitValue ;
|
|
uint pbsParamValue ;
|
|
} QDMA_TxRateLimitGet_T ;
|
|
|
|
typedef struct {
|
|
unchar tsid ;
|
|
ushort cirParamValue ;
|
|
ushort cbsParamValue ;
|
|
ushort pirParamValue ;
|
|
ushort pbsParamValue ;
|
|
} QDMA_TxQueueTrtcm_T ;
|
|
|
|
typedef struct {
|
|
unchar channel ;
|
|
unchar queue ;
|
|
unchar thrIdx ;
|
|
ushort value ;
|
|
} QDMA_EponQueueThreshold_T ;
|
|
|
|
typedef struct {
|
|
unchar channel ;
|
|
uint cirParamValue ;
|
|
uint cbsParamValue ;
|
|
uint pirParamValue ;
|
|
uint pbsParamValue ;
|
|
} QDMA_TxDbaReport_T ;
|
|
|
|
|
|
typedef struct {
|
|
uint rxRingLowThrh[(16)] ;
|
|
|
|
} QDMA_RxLowThreshold_T ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
unchar rxRateLimitEn ;
|
|
QDMA_RxPktMode_t rxRateLimitPktMode ;
|
|
ushort rxRateLimitUnit ;
|
|
QDMA_TrtcmScale_t rxRateLimitBucketScale ;
|
|
|
|
|
|
|
|
} QDMA_RxRateLimitCfg_T ;
|
|
|
|
typedef struct {
|
|
unchar ringIdx ;
|
|
uint rateLimitValue ;
|
|
} QDMA_RxRateLimitSet_T ;
|
|
|
|
typedef struct {
|
|
unchar ringIdx ;
|
|
uint rateLimitValue ;
|
|
uint pbsParamValue ;
|
|
|
|
|
|
|
|
} QDMA_RxRateLimitGet_T ;
|
|
|
|
typedef struct {
|
|
unchar cngstDropEn ;
|
|
unchar cngstDeiDropEn ;
|
|
unchar dynCngstEn ;
|
|
|
|
|
|
unchar cngstWredEn ;
|
|
|
|
unchar dynCngstMaxThrhTxEn[(8)] ;
|
|
unchar dynCngstMinThrhTxEn[(8)];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unchar dynCngstModeConfigTrigEn ;
|
|
unchar dynCngstModePacketTrigEn ;
|
|
unchar dynCngstModeTimeTrigEn ;
|
|
ushort dynCngstTicksel ;
|
|
QDMA_TxDynCngstDeiThrhScale_t dynCngstDeiThrhScale ;
|
|
} QDMA_TxQCngstCfg_T ;
|
|
|
|
typedef struct {
|
|
uint dynCngstTotalMaxThrh ;
|
|
uint dynCngstTotalMinThrh ;
|
|
} QDMA_TxQDynCngstTotalThrh_T ;
|
|
|
|
typedef struct {
|
|
uint dynCngstChnlMaxThrh ;
|
|
uint dynCngstChnlMinThrh ;
|
|
} QDMA_TxQDynCngstChnlThrh_T ;
|
|
|
|
typedef struct {
|
|
uint dynCngstQueueMaxThrh ;
|
|
uint dynCngstQueueMinThrh ;
|
|
} QDMA_TxQDynCngstQueueThrh_T ;
|
|
|
|
typedef struct {
|
|
ushort dynCngstTotalMaxThrh ;
|
|
ushort dynCngstTotalMinThrh ;
|
|
ushort dynCngstChnlMaxThrh ;
|
|
ushort dynCngstChnlMinThrh ;
|
|
ushort dynCngstQueueMaxThrh ;
|
|
ushort dynCngstQueueMinThrh ;
|
|
|
|
ushort dynCngstMinDscpThrh ;
|
|
|
|
} QDMA_TxQDynCngstThrh_T ;
|
|
|
|
typedef struct {
|
|
unchar queueIdx ;
|
|
ushort staticDeiThrh ;
|
|
ushort staticNormalThrh ;
|
|
} QDMA_TxQStaticCngstThrh_T ;
|
|
|
|
typedef struct {
|
|
QDMA_TxCngstMode_t txCngstMode ;
|
|
QDMA_PeekRateMargin_t peekRateMargin ;
|
|
uint peekRateDuration ;
|
|
} QDMA_txCngstCfg_t ;
|
|
|
|
typedef struct {
|
|
QDMA_Mode_t peekRateEn ;
|
|
QDMA_PeekRateMargin_t peekRateMargin ;
|
|
uint peekRateDuration ;
|
|
} QDMA_PeekRateCfg_t ;
|
|
|
|
typedef struct {
|
|
QDMA_TxQDynCngstTotalThrh_T *totalThrhPtr;
|
|
QDMA_TxQDynCngstChnlThrh_T *chnlThrhPtr;
|
|
QDMA_TxQDynCngstQueueThrh_T *queueThrhPtr;
|
|
QDMA_PeekRateCfg_t *peekrateCfgPtr;
|
|
} QDMA_TxQDynamicCngstInfo_T ;
|
|
|
|
typedef struct {
|
|
QDMA_TxQDynCngstTotalThrh_T *totalThrhPtr;
|
|
|
|
QDMA_TxQStaticCfg_T *staticThrhCfgPtr;
|
|
QDMA_TxQStaticThrRatio_T *staticThrhRatioPtr;
|
|
|
|
|
|
|
|
|
|
} QDMA_TxQStaticCngstInfo_T ;
|
|
|
|
typedef struct {
|
|
QDMA_TxQCngstQueueMode_t queueMode;
|
|
uint queue;
|
|
} QDMA_TxQCngstQueueCfg_T ;
|
|
|
|
typedef struct {
|
|
QDMA_TxQCngstChannelMode_t channelMode;
|
|
uint channel;
|
|
} QDMA_TxQCngstChannelCfg_T ;
|
|
|
|
typedef struct {
|
|
uint queueAllCount[8];
|
|
} QDMA_TxQCngstAllQueueValue_T ;
|
|
|
|
typedef struct {
|
|
QDMA_Mode_t virChnlEn;
|
|
QDMA_VirChnlMapMode_t virChnlMode;
|
|
} QDMA_VirtualChannelMode_T ;
|
|
|
|
typedef struct {
|
|
unchar phyChnl ;
|
|
QDMA_VirChnlQosType_t qosType ;
|
|
struct {
|
|
unchar weight ;
|
|
} queue[4] ;
|
|
} QDMA_VirtualChannelQoS_T ;
|
|
|
|
typedef struct {
|
|
QDMA_CbType_t type;
|
|
void *pCbFun;
|
|
} QDMA_RegisterCallBack_T ;
|
|
|
|
typedef struct {
|
|
struct sk_buff *skb;
|
|
uint msg0;
|
|
uint msg1;
|
|
struct port_info *pMacInfo;
|
|
} QDMA_Transmit_T ;
|
|
|
|
typedef struct {
|
|
struct sk_buff *skb;
|
|
int ringIdx;
|
|
} QDMA_Transmit_Wifi_Fast_T ;
|
|
|
|
typedef struct {
|
|
QDMA_TxQosWeightType_t weightBase;
|
|
QDMA_TxQosWeightScale_t weightScale;
|
|
QDMA_TxQosScheduler_T *pTxQos;
|
|
} QDMA_TxQos_T;
|
|
|
|
typedef struct {
|
|
QDMA_Mode_t prefecthMode;
|
|
QDMA_Mode_t overDragMode;
|
|
uint overDragCnt;
|
|
} QDMA_PrefetchMode_T;
|
|
|
|
typedef struct {
|
|
uint freeLmgr;
|
|
uint usedLmgr;
|
|
uint usedBuf;
|
|
} QDMA_LmgrStatus_T;
|
|
|
|
typedef struct {
|
|
uint dbgLevel;
|
|
uint busyDuration;
|
|
uint regOffset;
|
|
uint pollingDuration;
|
|
uint forceEn;
|
|
} QDMA_OldProc_T;
|
|
|
|
typedef struct {
|
|
uint chnlThrh;
|
|
uint queueThrh;
|
|
} QDMA_MacLimitThrh_T;
|
|
|
|
typedef struct {
|
|
QDMA_DscpDumpMode_t dscpDumpMode;
|
|
unchar ringIdx;
|
|
} QDMA_DscpDumpInfo_T;
|
|
|
|
typedef struct {
|
|
QDMA_QoSClassfication_t qosClsfy;
|
|
int queueMask;
|
|
int qosWrrInfo[4];
|
|
}QDMA_MacQoSCfg_T;
|
|
|
|
typedef struct {
|
|
unchar *dataP;
|
|
int dataLen;
|
|
struct sk_buff *skb;
|
|
unchar rxDone;
|
|
}QDMA_DramTestCfg_T;
|
|
|
|
struct ECNT_QDMA_Data {
|
|
QDMA_HookFunction_t function_id;
|
|
int retValue;
|
|
|
|
union {
|
|
QDMA_InitCfg_t *pInitCfg;
|
|
QDMA_Mode_t mode;
|
|
QDMA_LoopbackMode_t lbMode;
|
|
QDMA_DbgCntrChnlGroup_t cntrSrc;
|
|
int cnt;
|
|
int channel;
|
|
uint threshold;
|
|
|
|
QDMA_RegisterCallBack_T qdma_reg_cb;
|
|
QDMA_Transmit_T qdma_transmit;
|
|
QDMA_Transmit_Wifi_Fast_T qdma_transmit_wifi_fast;
|
|
QDMA_TxQos_T qdma_tx_qos;
|
|
QDMA_TxBufCtrl_T *pQdmaTxBufCtrl;
|
|
QDMA_PrefetchMode_T *qdma_prefetch;
|
|
QDMA_LmgrStatus_T *qdma_lmgr_status;
|
|
QDMA_OldProc_T qdma_old_proc;
|
|
QDMA_MacLimitThrh_T *qdma_mac_limit_thrh;
|
|
|
|
|
|
GENERAL_TrtcmCfg_T *generalTrtcmCfgPtr;
|
|
GENERAL_TrtcmRatelimitCfg_T *generalTrtcmRatelimitCfgPtr;
|
|
GENERAL_TrtcmRatelimitSet_T *generalTrtcmRatelimitSetPtr;
|
|
GENERAL_TrtcmCbsPbsCfg_T *generalTrtcmCbsPbsCfgPtr;
|
|
GENERAL_TrtcmCbsPbsSet_T *generalTrtcmCbsPbsSetPtr;
|
|
|
|
QDMA_FlowCntIncDropCfg_T *flowCntIncDropCfg;
|
|
QDMA_FlowCntValueGet_T *flowCntValueGet;
|
|
QDMA_FlowCntValueClear_T *flowCntValueClear;
|
|
QDMA_TxWredCfg_T *txWredCfgPtr;
|
|
QDMA_RxRedCfg_T *rxRedCfgPtr;
|
|
|
|
QDMA_ChannelStatus_T *chnlCloseStatusSet;
|
|
QDMA_ChannelStatus_T *chnlCloseStatusGet;
|
|
QDMA_ChannelStatus_T *chnlEmptyStatusGet;
|
|
|
|
QDMA_MeterManage_T *meterManage;
|
|
QDMA_AcntManage_T *acntManage;
|
|
|
|
|
|
|
|
QDMA_SlaChnlCfg_T *slaChnlCfgPtr;
|
|
QDMA_QoSAgingCfg_T *qosAgingCfgPtr;
|
|
QDMA_TxQAgingCfg_T *txqAgingCfgPtr;
|
|
QDMA_MulticastSptagCfg_T *multicastSptagCfgPtr;
|
|
QDMA_MulticastFportCfg_T *multicastFportCfgPtr;
|
|
|
|
|
|
QDMA_TxRateMeter_T *txRateMeterPtr;
|
|
QDMA_TxRateLimitCfg_T *txRateLimitCfgPtr;
|
|
QDMA_TxRateLimitSet_T *txRateLimitSetPtr;
|
|
QDMA_TxRateLimitGet_T *txRateLimitGetPtr;
|
|
QDMA_TxDbaReport_T *txDbaReportPtr;
|
|
|
|
QDMA_RxLowThreshold_T *rxLowThresholdPtr;
|
|
QDMA_RxPktMode_t pktMode;
|
|
QDMA_RxRateLimitCfg_T *rxRateLimitCfgPtr;
|
|
QDMA_RxRateLimitSet_T *rxRateLimitSetPtr;
|
|
QDMA_RxRateLimitGet_T *rxRateLimitGetPtr;
|
|
|
|
QDMA_txCngstCfg_t *pTxCngstCfg;
|
|
QDMA_TxQDynCngstThrh_T *dynCngstThrhPtr;
|
|
QDMA_TxQDynCngstTotalThrh_T *totalThrhPtr;
|
|
QDMA_TxQDynCngstChnlThrh_T *chnlThrhPtr;
|
|
QDMA_TxQDynCngstQueueThrh_T *queueThrhPtr;
|
|
QDMA_PeekRateCfg_t *peekrateCfgPtr;
|
|
|
|
QDMA_TxQStaticDeiCfg_T *deiThrhPtr;
|
|
QDMA_TxQStaticNormalCfg_T *normThrhPtr;
|
|
|
|
QDMA_TxQStaticCfg_T *staticThrhCfgPtr;
|
|
QDMA_TxQStaticThrRatio_T *staticThrhRatioPtr;
|
|
|
|
|
|
QDMA_TxQDynamicCngstInfo_T *dynCfgPtr;
|
|
QDMA_TxQStaticCngstInfo_T *staticCfgPtr;
|
|
|
|
QDMA_VirtualChannelMode_T *virChnlModePtr;
|
|
QDMA_VirtualChannelQoS_T *virChnlQoSPtr;
|
|
QDMA_TxQCngstQueueCfg_T *txqCngstQueueCfgPtr;
|
|
QDMA_TxQCngstChannelCfg_T *txqCngstChannelCfgPtr;
|
|
|
|
QDMA_DscpDumpInfo_T *dscpDumpInfoPtr;
|
|
QDMA_MacQoSCfg_T *macQosCfg;
|
|
QDMA_TxQCngstAllQueueValue_T *txqCngstAllQueueValuePtr;
|
|
|
|
QDMA_DramTestCfg_T *dramTestCfgPtr;
|
|
} qdma_private;
|
|
};
|
|
|
|
typedef union
|
|
{
|
|
struct
|
|
{
|
|
# 1413 "include/ecnt_hook/ecnt_hook_qdma_type.h"
|
|
uint queue : 3 ;
|
|
uint channel : 5 ;
|
|
uint oam : 1 ;
|
|
uint fast : 1 ;
|
|
uint tso : 1 ;
|
|
uint tco : 1 ;
|
|
uint uco : 1 ;
|
|
uint ico : 1 ;
|
|
uint gem_port_id: 16 ;
|
|
uint mic_idx : 1 ;
|
|
uint wifi : 1 ;
|
|
|
|
}raw0;
|
|
struct
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint queue : 3;
|
|
uint channel : 8;
|
|
uint oam : 1;
|
|
uint sp_tag : 16;
|
|
uint : 4;
|
|
|
|
}raw1;
|
|
struct
|
|
{
|
|
uint reserve1 : 7;
|
|
uint dei : 1;
|
|
uint gemport_id : 12;
|
|
uint oam : 1;
|
|
uint channel : 8;
|
|
uint queue : 3;
|
|
}raw2;
|
|
uint word;
|
|
}QDMA_txMsgWord0_t;
|
|
|
|
typedef union
|
|
{
|
|
struct
|
|
{
|
|
# 1477 "include/ecnt_hook/ecnt_hook_qdma_type.h"
|
|
uint acnt_g0 : 6;
|
|
uint acnt_g1 : 5;
|
|
uint : 3;
|
|
uint hwf :1;
|
|
uint nboq : 5;
|
|
uint fport : 4;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint mtr_g : 7;
|
|
uint no_drop : 1;
|
|
|
|
}raw0;
|
|
struct
|
|
{
|
|
# 1505 "include/ecnt_hook/ecnt_hook_qdma_type.h"
|
|
uint : 19;
|
|
uint fport : 3;
|
|
uint : 6;
|
|
uint tso : 1;
|
|
uint tco : 1;
|
|
uint uco : 1;
|
|
uint ico : 1;
|
|
|
|
}raw1;
|
|
struct
|
|
{
|
|
uint ico:1;
|
|
uint uco:1;
|
|
uint tco:1;
|
|
uint tso:1;
|
|
uint rsv1:6;
|
|
uint fport:3;
|
|
uint rsv2:19;
|
|
}raw2;
|
|
uint word;
|
|
} QDMA_txMsgWord1_t;
|
|
|
|
typedef struct QDMA_txMsgWord_s{
|
|
QDMA_txMsgWord0_t *pTxMsgW0;
|
|
QDMA_txMsgWord1_t *pTxMsgW1;
|
|
} QDMA_txMsgWord_t;
|
|
# 47 "include/ecnt_hook/ecnt_hook_qdma.h" 2
|
|
# 66 "include/ecnt_hook/ecnt_hook_qdma.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_INIT(unsigned int mainType, QDMA_InitCfg_t *pInitCfg) {
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_INIT;
|
|
in_data.qdma_private.pInitCfg = pInitCfg;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_DEINIT(unsigned int mainType){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_DEINIT;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_TX_DMA_MODE(unsigned int mainType, QDMA_Mode_t txMode){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_TX_DMA_MODE;
|
|
in_data.qdma_private.mode = txMode ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_RX_DMA_MODE(unsigned int mainType, QDMA_Mode_t rxMode){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_RX_DMA_MODE;
|
|
in_data.qdma_private.mode = rxMode ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_LOOPBACK_MODE(unsigned int mainType, QDMA_LoopbackMode_t lbMode){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_LOOPBACK_MODE;
|
|
in_data.qdma_private.lbMode = lbMode ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_REGISTER_HOOKFUNC(unsigned int mainType, QDMA_CbType_t type, void *pCbFun){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_REGISTER;
|
|
in_data.qdma_private.qdma_reg_cb.type = type ;
|
|
in_data.qdma_private.qdma_reg_cb.pCbFun = pCbFun ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_UNREGISTER_HOOKFUNC(unsigned int mainType, QDMA_CbType_t type){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_UNREGISTER;
|
|
in_data.qdma_private.qdma_reg_cb.type = type ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_ENABLE_RXPKT_INT(unsigned int mainType){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_ENABLE_RXPKT_INT;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_DISABLE_RXPKT_INT(unsigned int mainType){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_DISABLE_RXPKT_INT;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_RECEIVE_PACKETS(unsigned int mainType, int maxPkts){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_RECEIVE_PACKETS;
|
|
in_data.qdma_private.cnt = maxPkts ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_TRANSMIT_PACKETS(unsigned int mainType, struct sk_buff *skb, uint msg0, uint msg1, struct port_info *pMacInfo){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_TRANSMIT_PACKETS;
|
|
in_data.qdma_private.qdma_transmit.skb = skb ;
|
|
in_data.qdma_private.qdma_transmit.msg0 = msg0 ;
|
|
in_data.qdma_private.qdma_transmit.msg1 = msg1 ;
|
|
in_data.qdma_private.qdma_transmit.pMacInfo = pMacInfo ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TX_QOS_WEIGHT(unsigned int mainType, QDMA_TxQosWeightType_t weightBase, QDMA_TxQosWeightScale_t weightScale){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_TX_QOS_WEIGHT;
|
|
in_data.qdma_private.qdma_tx_qos.weightBase = weightBase ;
|
|
in_data.qdma_private.qdma_tx_qos.weightScale = weightScale ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_TX_QOS_WEIGHT(unsigned int mainType, QDMA_TxQosWeightType_t *pWeightBase, QDMA_TxQosWeightScale_t *pWeightScale){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_TX_QOS_WEIGHT;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
*pWeightBase = in_data.qdma_private.qdma_tx_qos.weightBase ;
|
|
*pWeightScale = in_data.qdma_private.qdma_tx_qos.weightScale ;
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TX_QOS(unsigned int mainType, QDMA_TxQosScheduler_T *pTxQos){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_TX_QOS;
|
|
in_data.qdma_private.qdma_tx_qos.pTxQos = pTxQos ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_TX_QOS(unsigned int mainType, QDMA_TxQosScheduler_T *pTxQos){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_TX_QOS;
|
|
in_data.qdma_private.qdma_tx_qos.pTxQos = pTxQos ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_MAC_LIMIT_THRESHOLD(unsigned int mainType, uint chnlThrh, uint queueThrh){
|
|
struct ECNT_QDMA_Data in_data;
|
|
QDMA_MacLimitThrh_T mac_limit_thrh;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_MAC_LIMIT_THRESHOLD;
|
|
mac_limit_thrh.chnlThrh = chnlThrh ;
|
|
mac_limit_thrh.queueThrh = queueThrh ;
|
|
in_data.qdma_private.qdma_mac_limit_thrh = &mac_limit_thrh ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_TRANSMIT_PACKETS_WIFI_FAST(unsigned int mainType, struct sk_buff *skb, int ringIdx){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_TRANSMIT_PACKET_WIFI_FAST;
|
|
in_data.qdma_private.qdma_transmit_wifi_fast.skb = skb ;
|
|
in_data.qdma_private.qdma_transmit_wifi_fast.ringIdx = ringIdx;
|
|
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TXBUF_THRESHOLD(unsigned int mainType, QDMA_TxBufCtrl_T *pTxBufCtrl){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_TXBUF_THRESHOLD;
|
|
in_data.qdma_private.pQdmaTxBufCtrl = pTxBufCtrl ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_TXBUF_THRESHOLD(unsigned int mainType, QDMA_TxBufCtrl_T *pTxBufCtrl){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_TXBUF_THRESHOLD;
|
|
in_data.qdma_private.pQdmaTxBufCtrl = pTxBufCtrl ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_PREFETCH_MODE(unsigned int mainType, QDMA_Mode_t prefecthMode, QDMA_Mode_t overDragMode, uint overDragCnt){
|
|
struct ECNT_QDMA_Data in_data;
|
|
QDMA_PrefetchMode_T qdma_prefetch;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_PREFETCH_MODE;
|
|
qdma_prefetch.prefecthMode = prefecthMode ;
|
|
qdma_prefetch.overDragMode = overDragMode ;
|
|
qdma_prefetch.overDragCnt = overDragCnt ;
|
|
in_data.qdma_private.qdma_prefetch = &qdma_prefetch ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_PKTSIZE_OVERHEAD_EN(unsigned int mainType, QDMA_Mode_t mode){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_PKTSIZE_OVERHEAD_EN;
|
|
in_data.qdma_private.mode = mode ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) QDMA_Mode_t QDMA_API_GET_PKTSIZE_OVERHEAD_EN(unsigned int mainType){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_PKTSIZE_OVERHEAD_EN;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_PKTSIZE_OVERHEAD_VALUE(unsigned int mainType, int cnt){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_PKTSIZE_OVERHEAD_VALUE;
|
|
in_data.qdma_private.cnt = cnt ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) uint QDMA_API_GET_PKTSIZE_OVERHEAD_VALUE(unsigned int mainType){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_PKTSIZE_OVERHEAD_VALUE;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_LMGR_LOW_THRESHOLD(unsigned int mainType, uint lowThrh){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_LMGR_LOW_THRESHOLD;
|
|
in_data.qdma_private.threshold = lowThrh ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) uint QDMA_API_GET_LMGR_LOW_THRESHOLD(unsigned int mainType){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_LMGR_LOW_THRESHOLD;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_ENABLE_RXPKT_INT2(unsigned int mainType){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_ENABLE_RXPKT_INT2;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_DISABLE_RXPKT_INT2(unsigned int mainType){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_DISABLE_RXPKT_INT2;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_RECEIVE_PACKETS_INT2(unsigned int mainType, int maxPkts){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_RECEIVE_PACKETS_INT2;
|
|
in_data.qdma_private.cnt = maxPkts ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_GENERAL_TRTCM_INIT(unsigned int mainType, GENERAL_TrtcmCfg_T *generalTrtcmCfgPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GENERAL_SET_TRTCM_CFG;
|
|
in_data.qdma_private.generalTrtcmCfgPtr = generalTrtcmCfgPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_GENERAL_TRTCM_INIT(unsigned int mainType, GENERAL_TrtcmCfg_T *generalTrtcmCfgPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GENERAL_GET_TRTCM_CFG;
|
|
in_data.qdma_private.generalTrtcmCfgPtr = generalTrtcmCfgPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_GENERAL_RATELIMIT_CFG(unsigned int mainType, GENERAL_TrtcmRatelimitCfg_T *generalTrtcmRatelimitCfgPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GENERAL_SET_RATELIMIT_MODE_CFG;
|
|
in_data.qdma_private.generalTrtcmRatelimitCfgPtr = generalTrtcmRatelimitCfgPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_GENERAL_RATELIMIT_CFG(unsigned int mainType, GENERAL_TrtcmRatelimitCfg_T *generalTrtcmRatelimitCfgPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GENERAL_GET_RATELIMIT_MODE_CFG;
|
|
in_data.qdma_private.generalTrtcmRatelimitCfgPtr = generalTrtcmRatelimitCfgPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_GENERAL_RATELIMIT_VALUE(unsigned int mainType, GENERAL_TrtcmRatelimitSet_T *generalTrtcmRatelimitSetPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GENERAL_SET_RATELIMIT_MODE_VALUE;
|
|
in_data.qdma_private.generalTrtcmRatelimitSetPtr = generalTrtcmRatelimitSetPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_GENERAL_RATELIMIT_VALUE(unsigned int mainType, GENERAL_TrtcmRatelimitSet_T *generalTrtcmRatelimitSetPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GENERAL_GET_RATELIMIT_MODE_VALUE;
|
|
in_data.qdma_private.generalTrtcmRatelimitSetPtr = generalTrtcmRatelimitSetPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_GENERAL_RATELIMIT_BUCKET_SIZE(unsigned int mainType, GENERAL_TrtcmRatelimitSet_T *generalTrtcmRatelimitSetPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GENERAL_SET_RATELIMIT_BUCKET_SIZE;
|
|
in_data.qdma_private.generalTrtcmRatelimitSetPtr = generalTrtcmRatelimitSetPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_GENERAL_TRTCM_CFG(unsigned int mainType, GENERAL_TrtcmCbsPbsCfg_T *generalTrtcmCbsPbsCfgPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GENERAL_SET_TRTCM_MODE_CFG;
|
|
in_data.qdma_private.generalTrtcmCbsPbsCfgPtr = generalTrtcmCbsPbsCfgPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_GENERAL_TRTCM_CFG(unsigned int mainType, GENERAL_TrtcmCbsPbsCfg_T *generalTrtcmCbsPbsCfgPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GENERAL_GET_TRTCM_MODE_CFG;
|
|
in_data.qdma_private.generalTrtcmCbsPbsCfgPtr = generalTrtcmCbsPbsCfgPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_GENERAL_TRTCM_VALUE(unsigned int mainType, GENERAL_TrtcmCbsPbsSet_T *generalTrtcmCbsPbsSetPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GENERAL_SET_TRTCM_MODE_VALUE;
|
|
in_data.qdma_private.generalTrtcmCbsPbsSetPtr = generalTrtcmCbsPbsSetPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_GENERAL_TRTCM_VALUE(unsigned int mainType, GENERAL_TrtcmCbsPbsSet_T *generalTrtcmCbsPbsSetPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GENERAL_GET_TRTCM_MODE_VALUE;
|
|
in_data.qdma_private.generalTrtcmCbsPbsSetPtr = generalTrtcmCbsPbsSetPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_GENERAL_TRTCM_BUCKET_SIZE(unsigned int mainType, GENERAL_TrtcmCbsPbsSet_T *generalTrtcmCbsPbsSetPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GENERAL_SET_TRTCM_BUCKET_SIZE;
|
|
in_data.qdma_private.generalTrtcmCbsPbsSetPtr = generalTrtcmCbsPbsSetPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_FLOW_CNTR_CFG(unsigned int mainType, QDMA_FlowCntIncDropCfg_T *flowCntIncDropCfg){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_FLOW_CNTR_CFG;
|
|
in_data.qdma_private.flowCntIncDropCfg = flowCntIncDropCfg ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_FLOW_CNTR_CFG(unsigned int mainType, QDMA_FlowCntIncDropCfg_T *flowCntIncDropCfg){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_FLOW_CNTR_CFG;
|
|
in_data.qdma_private.flowCntIncDropCfg = flowCntIncDropCfg ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_FLOW_CNTR_VALUE(unsigned int mainType, QDMA_FlowCntValueGet_T *flowCntValueGet){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_FLOW_CNTR_VALUE;
|
|
in_data.qdma_private.flowCntValueGet = flowCntValueGet ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_CLEAR_FLOW_CNTR_VALUE(unsigned int mainType, QDMA_FlowCntValueClear_T *flowCntValueClear){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_CLEAR_FLOW_CNTR_VALUE;
|
|
in_data.qdma_private.flowCntValueClear = flowCntValueClear ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_CHANNEL_CLOSE_STATUS(unsigned int mainType, QDMA_ChannelStatus_T *chnlCloseStatusSet){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_CHANNEL_CLOSE_STATUS;
|
|
in_data.qdma_private.chnlCloseStatusSet = chnlCloseStatusSet ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_CHANNEL_CLOSE_STATUS(unsigned int mainType, QDMA_ChannelStatus_T *chnlCloseStatusGet){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_CHANNEL_CLOSE_STATUS;
|
|
in_data.qdma_private.chnlCloseStatusGet = chnlCloseStatusGet ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_CHANNEL_EMPTY_STATUS(unsigned int mainType, QDMA_ChannelStatus_T *chnlEmptyStatusGet){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_CHANNEL_EMPTY_STATUS;
|
|
in_data.qdma_private.chnlEmptyStatusGet = chnlEmptyStatusGet ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_OAM_MODIFY_FP_EN(unsigned int mainType, QDMA_Mode_t mode){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_OAM_MODIFY_FP_EN;
|
|
in_data.qdma_private.mode = mode ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_OAM_MODIFY_FP_EN(unsigned int mainType){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_OAM_MODIFY_FP_EN;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_MULTICAST_EN(unsigned int mainType, QDMA_Mode_t mode){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_MULTICAST_EN;
|
|
in_data.qdma_private.mode = mode ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_MULTICAST_EN(unsigned int mainType){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_MULTICAST_EN;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_ALLOCATE_METER(unsigned int mainType, QDMA_MeterManage_T *meterManage){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret = 0;
|
|
({ void *__p = (&in_data); size_t __n = sizeof(struct ECNT_QDMA_Data); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); }) ;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_ALLOCATE_METER;
|
|
in_data.qdma_private.meterManage = meterManage ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_FREE_METER(unsigned int mainType, int meter_idx){
|
|
struct ECNT_QDMA_Data in_data;
|
|
QDMA_MeterManage_T meterManage;
|
|
int ret = 0;
|
|
({ void *__p = (&in_data); size_t __n = sizeof(struct ECNT_QDMA_Data); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); }) ;
|
|
({ void *__p = (&meterManage); size_t __n = sizeof(QDMA_MeterManage_T); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); }) ;
|
|
|
|
meterManage.meter_id = meter_idx;
|
|
in_data.function_id = QDMA_FUNCTION_FREE_METER;
|
|
in_data.qdma_private.meterManage = &meterManage ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_QOS_FLAG(unsigned int mainType, int *qos_flag_num){
|
|
struct ECNT_QDMA_Data in_data;
|
|
QDMA_MeterManage_T meterManage;
|
|
int ret = 0;
|
|
({ void *__p = (&in_data); size_t __n = sizeof(struct ECNT_QDMA_Data); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); }) ;
|
|
({ void *__p = (&meterManage); size_t __n = sizeof(QDMA_MeterManage_T); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); }) ;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_QOS_FLAG;
|
|
in_data.qdma_private.meterManage = &meterManage ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
*qos_flag_num = meterManage.Qos_flag;
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_ALLOCATE_ACNT(unsigned int mainType, QDMA_AcntManage_T *acntManage){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret = 0;
|
|
({ void *__p = (&in_data); size_t __n = sizeof(struct ECNT_QDMA_Data); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); }) ;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_ALLOCATE_ACNT;
|
|
in_data.qdma_private.acntManage = acntManage;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_FREE_ACNT(unsigned int mainType, QDMA_AcntManage_T *acntManage){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret = 0;
|
|
({ void *__p = (&in_data); size_t __n = sizeof(struct ECNT_QDMA_Data); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); }) ;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_FREE_ACNT;
|
|
in_data.qdma_private.acntManage = acntManage;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_SLA_CHANNEL_CFG(unsigned int mainType, QDMA_SlaChnlCfg_T *slaChnlCfg){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret = 0;
|
|
({ void *__p = (&in_data); size_t __n = sizeof(struct ECNT_QDMA_Data); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); }) ;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_SLA_CHANNEL_CFG;
|
|
in_data.qdma_private.slaChnlCfgPtr = slaChnlCfg;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_SLA_CHANNEL_CFG(unsigned int mainType, QDMA_SlaChnlCfg_T *slaChnlCfg){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret = 0;
|
|
({ void *__p = (&in_data); size_t __n = sizeof(struct ECNT_QDMA_Data); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); }) ;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_SLA_CHANNEL_CFG;
|
|
in_data.qdma_private.slaChnlCfgPtr = slaChnlCfg;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_QOS_AGING_CFG(unsigned int mainType, QDMA_QoSAgingCfg_T *qosAgingCfg){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret = 0;
|
|
({ void *__p = (&in_data); size_t __n = sizeof(struct ECNT_QDMA_Data); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); }) ;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_QOS_AGING_CFG;
|
|
in_data.qdma_private.qosAgingCfgPtr = qosAgingCfg;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_QOS_AGING_CFG(unsigned int mainType, QDMA_QoSAgingCfg_T *qosAgingCfg){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret = 0;
|
|
({ void *__p = (&in_data); size_t __n = sizeof(struct ECNT_QDMA_Data); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); }) ;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_QOS_AGING_CFG;
|
|
in_data.qdma_private.qosAgingCfgPtr = qosAgingCfg;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_PER_QUEUE_AGING_CFG(unsigned int mainType, QDMA_TxQAgingCfg_T *txqAgingCfg){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret = 0;
|
|
({ void *__p = (&in_data); size_t __n = sizeof(struct ECNT_QDMA_Data); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); }) ;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_PER_QUEUE_AGING_CFG;
|
|
in_data.qdma_private.txqAgingCfgPtr = txqAgingCfg;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_PER_QUEUE_AGING_CFG(unsigned int mainType, QDMA_TxQAgingCfg_T *txqAgingCfg){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret = 0;
|
|
({ void *__p = (&in_data); size_t __n = sizeof(struct ECNT_QDMA_Data); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); }) ;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_PER_QUEUE_AGING_CFG;
|
|
in_data.qdma_private.txqAgingCfgPtr = txqAgingCfg;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_MULTICAST_SPTAG_CFG(unsigned int mainType, QDMA_MulticastSptagCfg_T *multicastSptagCfg){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret = 0;
|
|
({ void *__p = (&in_data); size_t __n = sizeof(struct ECNT_QDMA_Data); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); }) ;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_MULTICAST_SPTAG_CFG;
|
|
in_data.qdma_private.multicastSptagCfgPtr = multicastSptagCfg;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_MULTICAST_SPTAG_CFG(unsigned int mainType, QDMA_MulticastSptagCfg_T *multicastSptagCfg){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret = 0;
|
|
({ void *__p = (&in_data); size_t __n = sizeof(struct ECNT_QDMA_Data); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); }) ;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_MULTICAST_SPTAG_CFG;
|
|
in_data.qdma_private.multicastSptagCfgPtr = multicastSptagCfg;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_MULTICAST_FPORT_CFG(unsigned int mainType, QDMA_MulticastFportCfg_T *multicastFportCfg){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret = 0;
|
|
({ void *__p = (&in_data); size_t __n = sizeof(struct ECNT_QDMA_Data); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); }) ;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_MULTICAST_FPORT_CFG;
|
|
in_data.qdma_private.multicastFportCfgPtr = multicastFportCfg;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_MULTICAST_FPORT_CFG(unsigned int mainType, QDMA_MulticastFportCfg_T *multicastFportCfg){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret = 0;
|
|
({ void *__p = (&in_data); size_t __n = sizeof(struct ECNT_QDMA_Data); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); }) ;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_MULTICAST_FPORT_CFG;
|
|
in_data.qdma_private.multicastFportCfgPtr = multicastFportCfg;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TXQ_STATIC_CHANNEL_EN(unsigned int mainType, QDMA_TxQStaticCfg_T *staticThrhCfg){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret = 0;
|
|
({ void *__p = (&in_data); size_t __n = sizeof(struct ECNT_QDMA_Data); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); }) ;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_TXQ_STATIC_CHANNEL_EN;
|
|
in_data.qdma_private.staticThrhCfgPtr = staticThrhCfg;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TXQ_STATIC_QUEUE_RATIO(unsigned int mainType, QDMA_TxQStaticThrRatio_T *staticThrhRatio){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret = 0;
|
|
({ void *__p = (&in_data); size_t __n = sizeof(struct ECNT_QDMA_Data); if ((__n) != 0) { if (__builtin_constant_p((0)) && (0) == 0) __memzero((__p),(__n)); else memset((__p),(0),(__n)); } (__p); }) ;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_TXQ_STATIC_QUEUE_RATIO;
|
|
in_data.qdma_private.staticThrhRatioPtr = staticThrhRatio;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_HQOS_EN(unsigned int mainType){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_HQOS_EN;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
# 1033 "include/ecnt_hook/ecnt_hook_qdma.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TX_DROP_EN(unsigned int mainType, QDMA_Mode_t mode){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_TX_DROP_EN;
|
|
in_data.qdma_private.mode = mode ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_TX_DROP_EN(unsigned int mainType){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_TX_DROP_EN;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TX_RATEMETER(unsigned int mainType, QDMA_TxRateMeter_T *txRateMeterPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_TX_RATEMETER;
|
|
in_data.qdma_private.txRateMeterPtr = txRateMeterPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_TX_RATEMETER(unsigned int mainType, QDMA_TxRateMeter_T *txRateMeterPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_TX_RATEMETER;
|
|
in_data.qdma_private.txRateMeterPtr = txRateMeterPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_ENABLE_TX_RATELIMIT(unsigned int mainType){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_ENABLE_TX_RATELIMIT;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
# 1124 "include/ecnt_hook/ecnt_hook_qdma.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TX_RATELIMIT(unsigned int mainType, QDMA_TxRateLimitSet_T *txRateLimitSetPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_TX_RATELIMIT;
|
|
in_data.qdma_private.txRateLimitSetPtr = txRateLimitSetPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_TX_RATELIMIT(unsigned int mainType, QDMA_TxRateLimitGet_T *txRateLimitGetPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_TX_RATELIMIT;
|
|
in_data.qdma_private.txRateLimitGetPtr = txRateLimitGetPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TX_DBA_REPORT(unsigned int mainType, QDMA_TxDbaReport_T *txDbaReportPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_TX_DBAREPORT;
|
|
in_data.qdma_private.txDbaReportPtr = txDbaReportPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_TX_DBA_REPORT(unsigned int mainType, QDMA_TxDbaReport_T *txDbaReportPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_TX_DBAREPORT;
|
|
in_data.qdma_private.txDbaReportPtr = txDbaReportPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_RX_PROTECT_EN(unsigned int mainType, QDMA_Mode_t mode){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_RX_PROTECT_EN;
|
|
in_data.qdma_private.mode = mode ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_RX_PROTECT_EN(unsigned int mainType){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_RX_PROTECT_EN;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_RX_LOW_THRESHOLD(unsigned int mainType, QDMA_RxLowThreshold_T *rxLowThrhPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_RX_LOW_THRESHOLD;
|
|
in_data.qdma_private.rxLowThresholdPtr = rxLowThrhPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_RX_LOW_THRESHOLD(unsigned int mainType, QDMA_RxLowThreshold_T *rxLowThrhPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_RX_LOW_THRESHOLD;
|
|
in_data.qdma_private.rxLowThresholdPtr = rxLowThrhPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_RX_RATELIMIT_EN(unsigned int mainType, QDMA_Mode_t mode){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_RX_RATELIMIT_EN;
|
|
in_data.qdma_private.mode = mode ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_RX_RATELIMIT_PKT_MODE(unsigned int mainType, QDMA_RxPktMode_t pktMode )
|
|
{
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_RX_RATELIMIT_PKT_MODE;
|
|
in_data.qdma_private.pktMode = pktMode ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_RX_RATELIMIT_CFG(unsigned int mainType, QDMA_RxRateLimitCfg_T *rxRateLimitCfgPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_RX_RATELIMIT_CFG;
|
|
in_data.qdma_private.rxRateLimitCfgPtr = rxRateLimitCfgPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_RX_RATELIMIT(unsigned int mainType, QDMA_RxRateLimitSet_T *rxRateLimitSetPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_RX_RATELIMIT;
|
|
in_data.qdma_private.rxRateLimitSetPtr = rxRateLimitSetPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_RX_RATELIMIT(unsigned int mainType, QDMA_RxRateLimitGet_T *rxRateLimitGetPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_RX_RATELIMIT;
|
|
in_data.qdma_private.rxRateLimitGetPtr = rxRateLimitGetPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TXQ_DEI_DROP_MODE(unsigned int mainType, QDMA_Mode_t deiDropMode){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_TXQ_DEI_DROP_MODE;
|
|
in_data.qdma_private.mode = deiDropMode ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) QDMA_Mode_t QDMA_API_GET_TXQ_DEI_DROP_MODE(unsigned int mainType){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_TXQ_DEI_DROP_MODE;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TXQ_CNGST_MODE(unsigned int mainType, QDMA_Mode_t dynCngstEn){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_TXQ_CNGST_MODE;
|
|
in_data.qdma_private.mode = dynCngstEn ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) QDMA_Mode_t QDMA_API_GET_TXQ_CNGST_MODE(unsigned int mainType){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_TXQ_CNGST_MODE;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TXQ_DEI_THRESHOLD_SCALE(unsigned int mainType, QDMA_TxDynCngstDeiThrhScale_t deiThrhScale){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_TXQ_DEI_THRH_SCALE;
|
|
in_data.qdma_private.threshold = deiThrhScale ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) QDMA_TxDynCngstDeiThrhScale_t QDMA_API_GET_TXQ_DEI_THRESHOLD_SCALE(unsigned int mainType){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_TXQ_DEI_THRH_SCALE;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TXQ_CNGST_AUTO_CONFIG(unsigned int mainType, QDMA_txCngstCfg_t *pTxCngstCfg){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_TXQ_CNGST_AUTO_CONFIG;
|
|
in_data.qdma_private.pTxCngstCfg = pTxCngstCfg ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_TXQ_CNGST_AUTO_CONFIG(unsigned int mainType, QDMA_txCngstCfg_t *pTxCngstCfg){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_TXQ_CNGST_AUTO_CONFIG;
|
|
in_data.qdma_private.pTxCngstCfg = pTxCngstCfg ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TXQ_CNGST_DYNAMIC_THRESHOLD(unsigned int mainType, QDMA_TxQDynCngstThrh_T *txqCngstThrhPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_TXQ_CNGST_DYNAMIC_THRESHOLD;
|
|
in_data.qdma_private.dynCngstThrhPtr = txqCngstThrhPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_TXQ_CNGST_DYNAMIC_THRESHOLD(unsigned int mainType, QDMA_TxQDynCngstThrh_T *txqCngstThrhPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_TXQ_CNGST_DYNAMIC_THRESHOLD;
|
|
in_data.qdma_private.dynCngstThrhPtr = txqCngstThrhPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TXQ_CNGST_TOTAL_THRESHOLD(unsigned int mainType, QDMA_TxQDynCngstTotalThrh_T *totalThrhPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_TXQ_CNGST_TOTAL_THRESHOLD;
|
|
in_data.qdma_private.totalThrhPtr = totalThrhPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_TXQ_CNGST_TOTAL_THRESHOLD(unsigned int mainType, QDMA_TxQDynCngstTotalThrh_T *totalThrhPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_TXQ_CNGST_TOTAL_THRESHOLD;
|
|
in_data.qdma_private.totalThrhPtr = totalThrhPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TXQ_CNGST_CHANNEL_THRESHOLD(unsigned int mainType, QDMA_TxQDynCngstChnlThrh_T *chnlThrhPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_TXQ_CNGST_CHANNEL_THRESHOLD;
|
|
in_data.qdma_private.chnlThrhPtr = chnlThrhPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_TXQ_CNGST_CHANNEL_THRESHOLD(unsigned int mainType, QDMA_TxQDynCngstChnlThrh_T *chnlThrhPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_TXQ_CNGST_CHANNEL_THRESHOLD;
|
|
in_data.qdma_private.chnlThrhPtr = chnlThrhPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TXQ_CNGST_QUEUE_THRESHOLD(unsigned int mainType, QDMA_TxQDynCngstQueueThrh_T *queueThrhPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_TXQ_CNGST_QUEUE_THRESHOLD;
|
|
in_data.qdma_private.queueThrhPtr = queueThrhPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_TXQ_CNGST_QUEUE_THRESHOLD(unsigned int mainType, QDMA_TxQDynCngstQueueThrh_T *queueThrhPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_TXQ_CNGST_QUEUE_THRESHOLD;
|
|
in_data.qdma_private.queueThrhPtr = queueThrhPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TXQ_CNGST_QUEUE_NONBLOCKING(unsigned int mainType, QDMA_TxQCngstQueueCfg_T *txqCngstQueueCfgPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_TXQ_CNGST_QUEUE_NONBLOCKING;
|
|
in_data.qdma_private.txqCngstQueueCfgPtr = txqCngstQueueCfgPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_TXQ_CNGST_QUEUE_NONBLOCKING(unsigned int mainType, QDMA_TxQCngstQueueCfg_T *txqCngstQueueCfgPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_TXQ_CNGST_QUEUE_NONBLOCKING;
|
|
in_data.qdma_private.txqCngstQueueCfgPtr = txqCngstQueueCfgPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TXQ_CNGST_CHANNEL_NONBLOCKING(unsigned int mainType, QDMA_TxQCngstChannelCfg_T *txqCngstChannelCfgPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_TXQ_CNGST_CHANNEL_NONBLOCKING;
|
|
in_data.qdma_private.txqCngstChannelCfgPtr = txqCngstChannelCfgPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_TXQ_CNGST_CHANNEL_NONBLOCKING(unsigned int mainType, QDMA_TxQCngstChannelCfg_T *txqCngstChannelCfgPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_TXQ_CNGST_CHANNEL_NONBLOCKING;
|
|
in_data.qdma_private.txqCngstChannelCfgPtr = txqCngstChannelCfgPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TXQ_PEEKRATE_PARAMS(unsigned int mainType, QDMA_PeekRateCfg_t *peekrateCfgPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_PEEKRATE_PARAMS;
|
|
in_data.qdma_private.peekrateCfgPtr = peekrateCfgPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_TXQ_PEEKRATE_PARAMS(unsigned int mainType, QDMA_PeekRateCfg_t *peekrateCfgPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_PEEKRATE_PARAMS;
|
|
in_data.qdma_private.peekrateCfgPtr = peekrateCfgPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TXQ_STATIC_QUEUE_NORMAL_THRESHOLD(unsigned int mainType, QDMA_TxQStaticNormalCfg_T *normThrhPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_TXQ_STATIC_QUEUE_NORMAL_THRESHOLD;
|
|
in_data.qdma_private.normThrhPtr = normThrhPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_TXQ_STATIC_QUEUE_DEI_THRESHOLD(unsigned int mainType, QDMA_TxQStaticDeiCfg_T *deiThrhPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_TXQ_STATIC_QUEUE_DEI_THRESHOLD;
|
|
in_data.qdma_private.deiThrhPtr = deiThrhPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_TXQ_CNGST_DYNAMIC_INFO(unsigned int mainType, QDMA_TxQDynamicCngstInfo_T *allThrhPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_TXQ_CNGST_DYNAMIC_INFO;
|
|
in_data.qdma_private.dynCfgPtr = allThrhPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_TXQ_CNGST_STATIC_INFO(unsigned int mainType, QDMA_TxQStaticCngstInfo_T *staticInfoPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_TXQ_CNGST_STATIC_INFO;
|
|
in_data.qdma_private.staticCfgPtr = staticInfoPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_VIRTUAL_CHANNEL_MODE(unsigned int mainType, QDMA_VirtualChannelMode_T *virChnlModePtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_VIRTUAL_CHANNEL_MODE;
|
|
in_data.qdma_private.virChnlModePtr = virChnlModePtr;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_VIRTUAL_CHANNEL_MODE(unsigned int mainType, QDMA_VirtualChannelMode_T *virChnlModePtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_VIRTUAL_CHANNEL_MODE;
|
|
in_data.qdma_private.virChnlModePtr = virChnlModePtr;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_VIRTUAL_CHANNEL_QOS(unsigned int mainType, QDMA_VirtualChannelQoS_T *virChnlQoSPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_SET_VIRTUAL_CHANNEL_QOS;
|
|
in_data.qdma_private.virChnlQoSPtr = virChnlQoSPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_VIRTUAL_CHANNEL_QOS(unsigned int mainType, QDMA_VirtualChannelQoS_T *virChnlQoSPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_GET_VIRTUAL_CHANNEL_QOS;
|
|
in_data.qdma_private.virChnlQoSPtr = virChnlQoSPtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_READ_VIP_INFO(unsigned int mainType){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
in_data.function_id = QDMA_FUNCTION_READ_VIP_INFO;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_CNTR_CHANNEL(unsigned int mainType,unsigned channel_id){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
in_data.function_id = QDMA_FUNCTION_SET_CHANNEL;
|
|
in_data.qdma_private.channel = channel_id;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_DUMP_CNTR_CHANNEL(unsigned int mainType,unsigned channel_id){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
in_data.function_id = QDMA_FUNCTION_DUMP_CHANNEL;
|
|
in_data.qdma_private.channel = channel_id;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_SET_MAC_QOS_CONFIG(unsigned int mainType, QDMA_MacQoSCfg_T *macQosCfgPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
in_data.function_id = QDMA_FUNCTION_SET_MAC_QOS_CONFIG;
|
|
in_data.qdma_private.macQosCfg = macQosCfgPtr;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_RESET(unsigned int mainType){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
in_data.function_id = QDMA_FUNCTION_RESET;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_GET_DBG_CNTR_ALL_QUEUE_COUNTER(unsigned int mainType, QDMA_TxQCngstAllQueueValue_T *txqCngstAllQueueValuePtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
in_data.function_id = QDMA_FUNCTION_GET_ALL_QUEUE_DBGCNTR;
|
|
in_data.qdma_private.txqCngstAllQueueValuePtr = txqCngstAllQueueValuePtr ;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_DRAM_TEST_DMA_CONFIG(unsigned int mainType, QDMA_DramTestCfg_T *dramTestCfgPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_DRAM_TEST_DMA_CONFIG;
|
|
in_data.qdma_private.dramTestCfgPtr = dramTestCfgPtr;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_DRAM_TEST_DMA_ENABLE(unsigned int mainType){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_DRAM_TEST_DMA_ENABLE;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_DRAM_TEST_RX_DONE(unsigned int mainType, QDMA_DramTestCfg_T *dramTestCfgPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_DRAM_TEST_RX_DONE;
|
|
in_data.qdma_private.dramTestCfgPtr = dramTestCfgPtr;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return dramTestCfgPtr->rxDone;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int QDMA_API_DRAM_TEST_DST_GET(unsigned int mainType, QDMA_DramTestCfg_T *dramTestCfgPtr){
|
|
struct ECNT_QDMA_Data in_data;
|
|
int ret=0;
|
|
|
|
in_data.function_id = QDMA_FUNCTION_DRAM_TEST_DST_GET;
|
|
in_data.qdma_private.dramTestCfgPtr = dramTestCfgPtr;
|
|
ret = __ECNT_HOOK(mainType, 0, (struct ecnt_data *)&in_data);
|
|
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
# 46 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_util.h" 2
|
|
# 1 "include/ecnt_hook/ecnt_hook_ifc.h" 1
|
|
# 46 "include/ecnt_hook/ecnt_hook_ifc.h"
|
|
# 1 "include/ecnt_hook/ecnt_hook_ifc_type.h" 1
|
|
# 47 "include/ecnt_hook/ecnt_hook_ifc.h" 2
|
|
# 74 "include/ecnt_hook/ecnt_hook_ifc.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int IFC_API_SET_GLOBAL_ENABLE(unsigned char enableMode) {
|
|
struct ecnt_ifc_data in_data;
|
|
int ret = 0;
|
|
|
|
in_data.function_id = IFC_SET_GLOBAL_ENABLE;
|
|
in_data.ifcEnable = enableMode;
|
|
ret = __ECNT_HOOK(ECNT_IFC, ECNT_IFC_API, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int IFC_API_GET_GLOBAL_ENABLE(void) {
|
|
struct ecnt_ifc_data in_data;
|
|
int ret = 0;
|
|
|
|
in_data.function_id = IFC_GET_GLOBAL_ENABLE;
|
|
ret = __ECNT_HOOK(ECNT_IFC, ECNT_IFC_API, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.ifcEnable;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int IFC_API_SET_LUT_RULE_AUTO(struct ecnt_ifc_param *ifc_param_ptr) {
|
|
struct ecnt_ifc_data in_data;
|
|
int ret = 0;
|
|
|
|
in_data.function_id = IFC_SET_LUT_RULE_AUTO;
|
|
memcpy(&in_data.ifc_param, ifc_param_ptr, sizeof(struct ecnt_ifc_param));
|
|
ret = __ECNT_HOOK(ECNT_IFC, ECNT_IFC_API, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int IFC_API_DEL_LUT_RULE_AUTO(struct ecnt_ifc_param *ifc_param_ptr) {
|
|
struct ecnt_ifc_data in_data;
|
|
int ret = 0;
|
|
|
|
in_data.function_id = IFC_DEL_LUT_RULE_AUTO;
|
|
memcpy(&in_data.ifc_param, ifc_param_ptr, sizeof(struct ecnt_ifc_param));
|
|
ret = __ECNT_HOOK(ECNT_IFC, ECNT_IFC_API, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int IFC_API_SET_LUT0_RULE(uint ifcIndex, IFC_Mode_t enMode, uint field, uint command, uint mask_low, uint mask_high, uint key_low, uint key_high) {
|
|
struct ecnt_ifc_data in_data;
|
|
int ret = 0;
|
|
|
|
in_data.function_id = IFC_SET_LUT0_RULE;
|
|
in_data.ifcIndex = ifcIndex;
|
|
in_data.enMode = enMode;
|
|
in_data.field = field;
|
|
in_data.command = command;
|
|
in_data.mask_low = mask_low;
|
|
in_data.mask_high = mask_high;
|
|
in_data.key_low = key_low;
|
|
in_data.key_high = key_high;
|
|
ret = __ECNT_HOOK(ECNT_IFC, ECNT_IFC_API, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static int IFC_API_SET_LUT1_RULE(uint ifcIndex, IFC_Mode_t enMode, uint endFlag, uint field, uint command, uint mask_low, uint key_low, uint key_high) {
|
|
struct ecnt_ifc_data in_data;
|
|
int ret = 0;
|
|
|
|
in_data.function_id = IFC_SET_LUT1_RULE;
|
|
in_data.ifcIndex = ifcIndex;
|
|
in_data.enMode = enMode;
|
|
in_data.endFlag = endFlag;
|
|
in_data.field = field;
|
|
in_data.command = command;
|
|
in_data.mask_low = mask_low;
|
|
in_data.key_low = key_low;
|
|
in_data.key_high = key_high;
|
|
ret = __ECNT_HOOK(ECNT_IFC, ECNT_IFC_API, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int IFC_API_SET_ACTION(uint ifcIndex, uint actIdx, IFC_Mode_t enMode, uint value0, uint value1, uint value2, uint value3) {
|
|
struct ecnt_ifc_data in_data;
|
|
int ret = 0;
|
|
|
|
in_data.function_id = IFC_SET_ACTION;
|
|
in_data.ifcIndex = ifcIndex;
|
|
in_data.actIdx = actIdx;
|
|
in_data.enMode = enMode;
|
|
in_data.value0 = value0;
|
|
in_data.value1 = value1;
|
|
in_data.value2 = value2;
|
|
in_data.value3 = value3;
|
|
ret = __ECNT_HOOK(ECNT_IFC, ECNT_IFC_API, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int IFC_API_SET_VIP_BY_ETYPE(unsigned short ether_type)
|
|
{
|
|
struct ecnt_ifc_data in_data;
|
|
int ret = 0;
|
|
|
|
in_data.function_id = IFC_SET_VIP;
|
|
in_data.field = IFC_VIP_FIELD_ETYPE;
|
|
in_data.ifc_param.key[0] = ether_type;
|
|
ret = __ECNT_HOOK(ECNT_IFC, ECNT_IFC_API, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int IFC_API_SET_VIP_BY_IPV4_PROTO(unsigned short proto)
|
|
{
|
|
struct ecnt_ifc_data in_data;
|
|
int ret = 0;
|
|
|
|
in_data.function_id = IFC_SET_VIP;
|
|
in_data.field = IFC_VIP_FIELD_IPV4_PROTO;
|
|
in_data.ifc_param.key[0] = proto;
|
|
ret = __ECNT_HOOK(ECNT_IFC, ECNT_IFC_API, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int IFC_API_SET_VIP_BY_IPV6_NXTHDR(unsigned short nxthdr)
|
|
{
|
|
struct ecnt_ifc_data in_data;
|
|
int ret = 0;
|
|
|
|
in_data.function_id = IFC_SET_VIP;
|
|
in_data.field = IFC_VIP_FIELD_IPV6_NXTHDR;
|
|
in_data.ifc_param.key[0] = nxthdr;
|
|
ret = __ECNT_HOOK(ECNT_IFC, ECNT_IFC_API, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int IFC_API_SET_VIP_BY_PORT(unsigned short sport,unsigned short dport)
|
|
{
|
|
struct ecnt_ifc_data in_data;
|
|
int ret = 0;
|
|
|
|
in_data.function_id = IFC_SET_VIP;
|
|
in_data.field = IFC_VIP_FIELD_PORT;
|
|
in_data.ifc_param.key[0] = sport;
|
|
in_data.ifc_param.key[1] = dport;
|
|
ret = __ECNT_HOOK(ECNT_IFC, ECNT_IFC_API, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int IFC_API_SET_VIP_BY_SIP_AND_SPORT(unsigned int sip,unsigned short sport)
|
|
{
|
|
struct ecnt_ifc_data in_data;
|
|
int ret = 0;
|
|
|
|
in_data.function_id = IFC_SET_VIP;
|
|
in_data.field = IFC_VIP_FIELD_SIP_SPORT;
|
|
in_data.ifc_param.key[0] = sip;
|
|
in_data.ifc_param.key[1] = sport;
|
|
ret = __ECNT_HOOK(ECNT_IFC, ECNT_IFC_API, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int IFC_API_DEL_VIP_BY_ETYPE(unsigned short ether_type)
|
|
{
|
|
struct ecnt_ifc_data in_data;
|
|
int ret = 0;
|
|
|
|
in_data.function_id = IFC_DEL_VIP;
|
|
in_data.field = IFC_VIP_FIELD_ETYPE;
|
|
in_data.ifc_param.key[0] = ether_type;
|
|
ret = __ECNT_HOOK(ECNT_IFC, ECNT_IFC_API, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int IFC_API_DEL_VIP_BY_IPV4_PROTO(unsigned short proto)
|
|
{
|
|
struct ecnt_ifc_data in_data;
|
|
int ret = 0;
|
|
|
|
in_data.function_id = IFC_DEL_VIP;
|
|
in_data.field = IFC_VIP_FIELD_IPV4_PROTO;
|
|
in_data.ifc_param.key[0] = proto;
|
|
ret = __ECNT_HOOK(ECNT_IFC, ECNT_IFC_API, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int IFC_API_DEL_VIP_BY_IPV6_NXTHDR(unsigned short nxthdr)
|
|
{
|
|
struct ecnt_ifc_data in_data;
|
|
int ret = 0;
|
|
|
|
in_data.function_id = IFC_DEL_VIP;
|
|
in_data.field = IFC_VIP_FIELD_IPV6_NXTHDR;
|
|
in_data.ifc_param.key[0] = nxthdr;
|
|
ret = __ECNT_HOOK(ECNT_IFC, ECNT_IFC_API, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int IFC_API_DEL_VIP_BY_PORT(unsigned short sport,unsigned short dport)
|
|
{
|
|
struct ecnt_ifc_data in_data;
|
|
int ret = 0;
|
|
|
|
in_data.function_id = IFC_DEL_VIP;
|
|
in_data.field = IFC_VIP_FIELD_PORT;
|
|
in_data.ifc_param.key[0] = sport;
|
|
in_data.ifc_param.key[1] = dport;
|
|
ret = __ECNT_HOOK(ECNT_IFC, ECNT_IFC_API, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) int IFC_API_DEL_VIP_BY_SIP_AND_SPORT(unsigned int sip,unsigned short sport)
|
|
{
|
|
struct ecnt_ifc_data in_data;
|
|
int ret = 0;
|
|
|
|
in_data.function_id = IFC_DEL_VIP;
|
|
in_data.field = IFC_VIP_FIELD_SIP_SPORT;
|
|
in_data.ifc_param.key[0] = sip;
|
|
in_data.ifc_param.key[1] = sport;
|
|
ret = __ECNT_HOOK(ECNT_IFC, ECNT_IFC_API, (struct ecnt_data *)&in_data);
|
|
if(ret != ECNT_HOOK_ERROR)
|
|
return in_data.retValue;
|
|
else
|
|
return ECNT_HOOK_ERROR;
|
|
}
|
|
# 47 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_util.h" 2
|
|
# 80 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_util.h"
|
|
void dump_skb(struct sk_buff *skb) ;
|
|
uint getLowestBit(uint value) ;
|
|
int8_t isTPID(uint16_t eth_type) ;
|
|
int32_t transTPIDtoVPM(uint16_t eth_type) ;
|
|
uint16_t transVPMtoTPID(uint16_t vpm) ;
|
|
unsigned int skb_chksum(const struct sk_buff *skb, int lens) ;
|
|
unsigned int ipv4_checksum(const struct sk_buff *skb, int offset) ;
|
|
int32_t getPppoeSid(struct sk_buff * skb, uint32_t pre_len, uint16_t * sid, uint16_t * ppp_tag) ;
|
|
unsigned int tcp_udp_checksum(const struct sk_buff *skb, int offset, uint16_t tcp_udp_length, uint8_t tcp_udp_protocol) ;
|
|
void get_lut0_mask_key(int index, uint Match[], uint Key[]) ;
|
|
void set_lut0_mask_key(int index, uint Match[], uint Key[]) ;
|
|
int checkIFCResult(int ifc_type, int index) ;
|
|
int write_all_ifc_rule_to_hw(void) ;
|
|
int clear_all_ifc_rules(void) ;
|
|
int clear_all_ifc_actions(void) ;
|
|
|
|
int clear_ifc_rules(int ruleId);
|
|
int ifc_get_rule_from_hw(int ruleId);
|
|
int ifc_get_rule_from_reg(int lut0Idx);
|
|
int ifc_enable(void);
|
|
int ifc_disable(void);
|
|
int ifc_get_ifc_staus(void);
|
|
int ifc_parser_lut0_rule(IFC_LUT0_Format *p_LUT0_Rule, int ruleId);
|
|
void set_lut0_mask_key_to_array(IFC_LUT0_Format *lut0Rule, uint Mask[], uint Key[]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int ifc_dump_lut0_rules(void) ;
|
|
int ifc_dump_lut1_rules(void) ;
|
|
int ifc_dump_all_rules(void) ;
|
|
int ifc_set_lut0_rules(uint ifcIndex, IFC_Mode_t enMode, uint fieldIdx, uint command, uint mask_high, uint mask_low, uint key_high, uint key_low) ;
|
|
int ifc_set_lut1_rules(uint ifcIndex, IFC_Mode_t enMode, uint endFlag, uint fieldIdx, uint command, uint mask, uint key_high, uint key_low) ;
|
|
int ifc_set_action(uint ifcIndex, uint actIdx, IFC_Mode_t enMode, uint value0, uint value1, uint value2, uint value3) ;
|
|
# 68 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c" 2
|
|
# 1 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_api.h" 1
|
|
# 66 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_api.h"
|
|
ecnt_ret_val ecnt_ifc_api_hook(struct ecnt_data *in_data);
|
|
int ifc_api_set_global_enable(struct ecnt_ifc_data *ifc_data);
|
|
int ifc_api_get_global_enable(struct ecnt_ifc_data *ifc_data);
|
|
int ifc_api_set_lut_rule_auto(struct ecnt_ifc_data *ifc_data);
|
|
int ifc_api_set_lut0_rule(struct ecnt_ifc_data *ifc_data);
|
|
int ifc_api_set_lut1_rule(struct ecnt_ifc_data *ifc_data);
|
|
int ifc_api_set_action(struct ecnt_ifc_data *ifc_data);
|
|
int ifc_api_del_lut_rule_auto(struct ecnt_ifc_data *ifc_data);
|
|
# 69 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c" 2
|
|
# 1 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/../fe/en7512/fe_reg_en7512.h" 1
|
|
# 1501 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/../fe/en7512/fe_reg_en7512.h"
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int pse_get_iq_rsv(unsigned int port, unsigned int queue)
|
|
{
|
|
unsigned int tmp_val;
|
|
|
|
set_frame_engine_data((0xBFB50000 + 0x80), (port<<(24))|(queue<<(16)));
|
|
tmp_val = ((get_frame_engine_data((0xBFB50000 + 0x84)) & (0x3FFF<<(16))) >> (16));
|
|
|
|
return tmp_val;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int pse_get_oq_rsv(unsigned int port, unsigned int queue)
|
|
{
|
|
unsigned int tmp_val;
|
|
|
|
set_frame_engine_data((0xBFB50000 + 0x80), (port<<(24))|(queue<<(16)));
|
|
tmp_val = ((get_frame_engine_data((0xBFB50000 + 0x84)) & (0x3FFF<<(0))) >> (0));
|
|
|
|
return tmp_val;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int pse_get_oq_lthd(unsigned int port, unsigned int queue)
|
|
{
|
|
unsigned int tmp_val;
|
|
|
|
set_frame_engine_data((0xBFB50000 + 0x80), (port<<(24))|(queue<<(16)));
|
|
tmp_val = ((get_frame_engine_data((0xBFB50000 + 0x84)) & (0x3<<(30))) >> (30));
|
|
|
|
return tmp_val;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int pse_get_oq_en_by_port(unsigned int port)
|
|
{
|
|
unsigned int tmp_val;
|
|
|
|
set_frame_engine_data((0xBFB50000 + 0x80), port<<(24));
|
|
tmp_val = get_frame_engine_data((0xBFB50000 + 0x88));
|
|
|
|
return tmp_val;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int pse_get_oq_en_by_queue(unsigned int port, unsigned int queue)
|
|
{
|
|
unsigned int tmp_val;
|
|
|
|
set_frame_engine_data((0xBFB50000 + 0x80), port<<(24));
|
|
tmp_val = ((get_frame_engine_data((0xBFB50000 + 0x88)) & 0x1) >> queue);
|
|
|
|
return tmp_val;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int pse_set_iq_rsv(unsigned int port, unsigned int queue, unsigned int val)
|
|
{
|
|
{ uint t = get_frame_engine_data((0xBFB50000 + 0x84)); set_frame_engine_data((0xBFB50000 + 0x84), ((t&~((0x3FFF<<(16))))|((val<<(16))&(0x3FFF<<(16))))); };
|
|
set_frame_engine_data((0xBFB50000 + 0x80), (port<<(24))|(queue<<(16))|(0x1<<(8))|(0x1<<(1)));
|
|
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int pse_set_oq_rsv(unsigned int port, unsigned int queue, unsigned int val)
|
|
{
|
|
{ uint t = get_frame_engine_data((0xBFB50000 + 0x84)); set_frame_engine_data((0xBFB50000 + 0x84), ((t&~((0x3FFF<<(0))))|((val<<(0))&(0x3FFF<<(0))))); };
|
|
set_frame_engine_data((0xBFB50000 + 0x80), (port<<(24))|(queue<<(16))|(0x1<<(8))|(0x1<<(0)));
|
|
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int pse_set_oq_lthd(unsigned int port, unsigned int queue, unsigned int val)
|
|
{
|
|
{ uint t = get_frame_engine_data((0xBFB50000 + 0x84)); set_frame_engine_data((0xBFB50000 + 0x84), ((t&~((0x3<<(30))))|((val<<(30))&(0x3<<(30))))); };
|
|
set_frame_engine_data((0xBFB50000 + 0x80), (port<<(24))|(queue<<(16))|(0x1<<(8))|(0x1<<(3)));
|
|
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int pse_set_oq_en_by_port(unsigned int port, unsigned int val)
|
|
{
|
|
set_frame_engine_data((0xBFB50000 + 0x88), val);
|
|
set_frame_engine_data((0xBFB50000 + 0x80), (port<<(24))|(0x1<<(8))|(0x1<<(2)));
|
|
|
|
return 0;
|
|
}
|
|
|
|
static inline __attribute__((always_inline)) __attribute__((no_instrument_function)) unsigned int pse_set_oq_en_by_queue(unsigned int port, unsigned int queue, unsigned int val)
|
|
{
|
|
unsigned int tmp_val;
|
|
|
|
tmp_val = pse_get_oq_en_by_port(port);
|
|
|
|
if(val)
|
|
tmp_val |= (1<<queue);
|
|
else
|
|
tmp_val &= (~(1<<queue));
|
|
|
|
set_frame_engine_data((0xBFB50000 + 0x88), tmp_val);
|
|
set_frame_engine_data((0xBFB50000 + 0x80), (port<<(24))|(0x1<<(8))|(0x1<<(2)));
|
|
|
|
return 0;
|
|
}
|
|
# 70 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c" 2
|
|
# 92 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c"
|
|
extern int clear_all_ifc_actions(void);
|
|
extern int ifc_set_lut1_rules(uint ifcIndex, IFC_Mode_t enMode, uint endFlag, uint fieldIdx, uint command, uint mask, uint key_high, uint key_low);
|
|
extern int ifc_set_action(uint ifcIndex, uint actIdx, IFC_Mode_t enMode, uint value0, uint value1, uint value2, uint value3);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int ifc_rule_init(void);
|
|
|
|
|
|
|
|
|
|
|
|
int icmp_ring_index=0;
|
|
int icmpv6_ring_index=0;
|
|
# 122 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c"
|
|
static int ifc_rule_init_en751627(void)
|
|
{
|
|
# 150 "/home/work/XX530vUS1/sdk/en7529/modules/private/IFC/ifc_gen.c"
|
|
return 0;
|
|
}
|
|
|
|
static int ifc_rule_init_en7523(void)
|
|
{
|
|
int index = 0,next_index=0;
|
|
int igmp_index = -1;
|
|
int ftp_sync_index = -1;
|
|
int arp_index = -1;
|
|
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, SIPv4, 1, 0, 0, 0xc0a80101);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, DIPv4, 1, 0, 0, 0xc0a801ff);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, IPv4_PROTOCOL, 0, 0xFF, 0, 0x01);
|
|
icmp_ring_index = next_index-1;
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, SIPv4, 0, 0x18, 0, 0xc0a80101);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, SIPv4, 1, 0, 0, 0xc0a80101);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, DIPv4, 0, 0, 0, 0xc0a80101);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, DPORT, 0, 0xFFFF, 0, 0x50);
|
|
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, IPv6_NEXT_HEADER, 0, 0xFF, 0, 0x3a);
|
|
icmpv6_ring_index = next_index-1;
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, IPv4_PROTOCOL, 0, 0xFF, 0, 0x02);
|
|
igmp_index = next_index -1;
|
|
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, SINF, 0, 0, 0, 1);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, IPv4_PROTOCOL, 0, 0xFF, 0, 0x06);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, DIPv4, 1, 0x18, 0, 0xc0a80101);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, DPORT, 0, 0xFFFF, 0, 0x15);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, UDF0+3, 1, 0x0003, 0, 0);
|
|
ftp_sync_index = next_index-1;
|
|
{ uint t = get_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((3>>1)<<2))); set_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((3>>1)<<2)), ((t&~((0x3<<((3&0x1)<<4))))|(((2)<<((3&0x1)<<4))&(0x3<<((3&0x1)<<4))))); };
|
|
{ uint t = get_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((3>>1)<<2))); set_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((3>>1)<<2)), ((t&~((0x3FFF<<(2+((3&0x1)<<4)))))|((12<<(2+((3&0x1)<<4)))&(0x3FFF<<(2+((3&0x1)<<4)))))); };
|
|
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, SPORT, 0, 0xFFFF, 0, 0x222);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, DPORT, 0, 0xFFFF, 0, 0x223);
|
|
|
|
|
|
|
|
next_index = 16;
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, SPORT, 0, 0xFFFF, 0, 0x022A);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, UDF0, 0, 0xFFFF, 0, 0x5254);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, UDF0+1, 0, 0xFFFF, 0, 0x5350);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, UDF0+2, 0, 0xFF00, 0, 0x2F00);
|
|
|
|
{ uint t = get_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((0>>1)<<2))); set_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((0>>1)<<2)), ((t&~((0x3<<((0&0x1)<<4))))|(((2)<<((0&0x1)<<4))&(0x3<<((0&0x1)<<4))))); };
|
|
{ uint t = get_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((0>>1)<<2))); set_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((0>>1)<<2)), ((t&~((0x3FFF<<(2+((0&0x1)<<4)))))|((20<<(2+((0&0x1)<<4)))&(0x3FFF<<(2+((0&0x1)<<4)))))); };
|
|
{ uint t = get_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((1>>1)<<2))); set_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((1>>1)<<2)), ((t&~((0x3<<((1&0x1)<<4))))|(((2)<<((1&0x1)<<4))&(0x3<<((1&0x1)<<4))))); };
|
|
{ uint t = get_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((1>>1)<<2))); set_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((1>>1)<<2)), ((t&~((0x3FFF<<(2+((1&0x1)<<4)))))|((22<<(2+((1&0x1)<<4)))&(0x3FFF<<(2+((1&0x1)<<4)))))); };
|
|
{ uint t = get_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((2>>1)<<2))); set_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((2>>1)<<2)), ((t&~((0x3<<((2&0x1)<<4))))|(((2)<<((2&0x1)<<4))&(0x3<<((2&0x1)<<4))))); };
|
|
{ uint t = get_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((2>>1)<<2))); set_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((2>>1)<<2)), ((t&~((0x3FFF<<(2+((2&0x1)<<4)))))|((24<<(2+((2&0x1)<<4)))&(0x3FFF<<(2+((2&0x1)<<4)))))); };
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, ETYPE, 0, 0xFFFF, 0, 0x0806);
|
|
arp_index = next_index-1;
|
|
|
|
for(index=0; index < next_index; index++)
|
|
{
|
|
if((index == icmpv6_ring_index)||(index == igmp_index)||(index == icmp_ring_index))
|
|
|
|
ifc_set_action((8)+index, 14, IFC_ENABLE, 1, 2, 0, 0);
|
|
else if(index == ftp_sync_index)
|
|
|
|
ifc_set_action((8)+index, 14, IFC_ENABLE, 1, ((3)), 0, 0);
|
|
else if(index == arp_index)
|
|
|
|
ifc_set_action((8)+index, 14, IFC_ENABLE, 1, 7, 0, 0);
|
|
else
|
|
|
|
ifc_set_action((8)+index, 14, IFC_ENABLE, 1, 1, 0, 0);
|
|
}
|
|
|
|
|
|
ifc_set_lut1_rules(30, IFC_ENABLE, 1, DMAC, 0, 0, 0xffff, 0xffffffff);
|
|
ifc_set_action((8)+31, 14, IFC_ENABLE, 1, 8, 0, 0);
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
static int ifc_rule_init_en7580(void)
|
|
{
|
|
int index=0, next_index=0;
|
|
int igmp_ring_index = 0;
|
|
int ftp_sync_index=-1;
|
|
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, SIPv4, 1, 0, 0, 0xc0a80101);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, DIPv4, 1, 0, 0, 0xc0a801ff);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, IPv4_PROTOCOL, 0, 0xFF, 0, 0x01);
|
|
icmp_ring_index = next_index-1;
|
|
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, SIPv4, 0, 0x18, 0, 0xc0a80101);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, SIPv4, 1, 0, 0, 0xc0a80101);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, DIPv4, 0, 0, 0, 0xc0a80101);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, DPORT, 0, 0xFFFF, 0, 0x50);
|
|
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, IPv6_NEXT_HEADER, 0, 0xFF, 0, 0x3a);
|
|
icmpv6_ring_index = next_index-1;
|
|
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, SPORT, 0, 0xFFFF, 0, 0x01F4);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, DPORT, 0, 0xFFFF, 0, 0x01F4);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, ETYPE, 0, 0xFFFF, 0, 0x8021);
|
|
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, ETYPE, 0, 0xFFFF, 0, 0x8863);
|
|
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, ETYPE, 0, 0xFFFF, 0, 0xc021);
|
|
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, SPORT, 0, 0xFFFF, 0, 0x43);
|
|
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, SPORT, 0, 0xFFFF, 0, 0x44);
|
|
|
|
|
|
|
|
next_index = 16;
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, SPORT, 0, 0xFFFF, 0, 0x022A);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, UDF0, 0, 0xFFFF, 0, 0x5254);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, UDF0+1, 0, 0xFFFF, 0, 0x5350);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, UDF0+2, 0, 0xFF00, 0, 0x2F00);
|
|
|
|
{ uint t = get_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((0>>1)<<2))); set_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((0>>1)<<2)), ((t&~((0x3<<((0&0x1)<<4))))|(((2)<<((0&0x1)<<4))&(0x3<<((0&0x1)<<4))))); };
|
|
{ uint t = get_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((0>>1)<<2))); set_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((0>>1)<<2)), ((t&~((0x3FFF<<(2+((0&0x1)<<4)))))|((20<<(2+((0&0x1)<<4)))&(0x3FFF<<(2+((0&0x1)<<4)))))); };
|
|
{ uint t = get_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((1>>1)<<2))); set_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((1>>1)<<2)), ((t&~((0x3<<((1&0x1)<<4))))|(((2)<<((1&0x1)<<4))&(0x3<<((1&0x1)<<4))))); };
|
|
{ uint t = get_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((1>>1)<<2))); set_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((1>>1)<<2)), ((t&~((0x3FFF<<(2+((1&0x1)<<4)))))|((22<<(2+((1&0x1)<<4)))&(0x3FFF<<(2+((1&0x1)<<4)))))); };
|
|
{ uint t = get_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((2>>1)<<2))); set_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((2>>1)<<2)), ((t&~((0x3<<((2&0x1)<<4))))|(((2)<<((2&0x1)<<4))&(0x3<<((2&0x1)<<4))))); };
|
|
{ uint t = get_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((2>>1)<<2))); set_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((2>>1)<<2)), ((t&~((0x3FFF<<(2+((2&0x1)<<4)))))|((24<<(2+((2&0x1)<<4)))&(0x3FFF<<(2+((2&0x1)<<4)))))); };
|
|
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, SINF, 0, 0, 0, 1);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, IPv4_PROTOCOL, 0, 0xFF, 0, 0x06);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, DIPv4, 1, 0x18, 0, 0xc0a80101);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, DPORT, 0, 0xFFFF, 0, 0x15);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, UDF0+3, 1, 0x0003, 0, 0);
|
|
ftp_sync_index = next_index-1;
|
|
{ uint t = get_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((3>>1)<<2))); set_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((3>>1)<<2)), ((t&~((0x3<<((3&0x1)<<4))))|(((2)<<((3&0x1)<<4))&(0x3<<((3&0x1)<<4))))); };
|
|
{ uint t = get_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((3>>1)<<2))); set_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((3>>1)<<2)), ((t&~((0x3FFF<<(2+((3&0x1)<<4)))))|((12<<(2+((3&0x1)<<4)))&(0x3FFF<<(2+((3&0x1)<<4)))))); };
|
|
|
|
|
|
if(!TCSUPPORT_CDS_VAL)
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, DPORT, 0, 0xFFFF, 0, 0x1d7b);
|
|
|
|
|
|
if(!TCSUPPORT_CDS_CT_VAL)
|
|
{
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, IPv4_PROTOCOL, 0, 0xFF, 0, 0x02);
|
|
igmp_ring_index = next_index-1;
|
|
}
|
|
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, ETYPE, 0, 0xFFFF, 0, 0xc223);
|
|
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, DPORT, 0, 0xFFFF, 0, 0x13c4);
|
|
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, DPORT, 0, 0xFFFF, 0, 0x13c5);
|
|
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, SPORT, 0, 0xFFFF, 0, 0x15);
|
|
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, ETYPE, 0, 0xFFFF, 0, 0x893a);
|
|
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, ETYPE, 0, 0xFFFF, 0, 0x88cc);
|
|
|
|
|
|
|
|
for(index=0; index < next_index; index++) {
|
|
if((index==icmp_ring_index) || (index==icmpv6_ring_index) || (index==igmp_ring_index))
|
|
ifc_set_action((8)+index, 14, IFC_ENABLE, 1, 2, 0, 0);
|
|
else if(index==ftp_sync_index)
|
|
ifc_set_action((8)+index, 14, IFC_ENABLE, 1, ((3)), 0, 0);
|
|
else
|
|
ifc_set_action((8)+index, 14, IFC_ENABLE, 1, 1, 0, 0);
|
|
}
|
|
|
|
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 0, SINF, 0, 0xFFFF, 0, 2);
|
|
next_index = ifc_set_lut1_rules(next_index, IFC_ENABLE, 1, SPORT, 0, 0xFFFF, 0, 0x14);
|
|
ifc_set_action((8)+next_index-1, 1, IFC_ENABLE, 5, 1,0, 0);
|
|
|
|
ifc_set_lut1_rules(106, IFC_ENABLE, 0, IPv4_PROTOCOL, 0, 0xFFFF, 0, 0x29);
|
|
ifc_set_lut1_rules(107, IFC_ENABLE, 1, UDF15, 0, 0, 0, 0);
|
|
ifc_set_lut1_rules(108, IFC_ENABLE, 1, IPv4_PROTOCOL, 0, 0xFFFF, 0, 0x29);
|
|
ifc_set_lut1_rules(109, IFC_ENABLE, 0, IPv6_NEXT_HEADER, 0, 0xFFFF, 0, 0x4);
|
|
ifc_set_lut1_rules(110, IFC_ENABLE, 1, UDF15, 0, 0, 0, 0);
|
|
ifc_set_lut1_rules(111, IFC_ENABLE, 1, IPv6_NEXT_HEADER, 0, 0xFFFF, 0, 0x4);
|
|
{ uint t = get_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((15>>1)<<2))); set_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((15>>1)<<2)), ((t&~((0x3<<((15&0x1)<<4))))|(((2)<<((15&0x1)<<4))&(0x3<<((15&0x1)<<4))))); };
|
|
{ uint t = get_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((15>>1)<<2))); set_frame_engine_data((((0xbfb50000) + 0x200)+0x0020+((15>>1)<<2)), ((t&~((0x3FFF<<(2+((15&0x1)<<4)))))|((4<<(2+((15&0x1)<<4)))&(0x3FFF<<(2+((15&0x1)<<4)))))); };
|
|
ifc_set_action((8)+108, 14, IFC_ENABLE, 1, 1, 0, 0);
|
|
ifc_set_action((8)+111, 14, IFC_ENABLE, 1, 1, 0, 0);
|
|
|
|
return 0;
|
|
}
|
|
int ifc_rule_init(void)
|
|
{
|
|
clear_all_ifc_actions();
|
|
|
|
if(0)
|
|
ifc_rule_init_en751627();
|
|
else if(((GET_HIR() == (0xa))))
|
|
ifc_rule_init_en7580();
|
|
else if((GET_HIR() == (0xc)))
|
|
ifc_rule_init_en7523();
|
|
else
|
|
return -1;
|
|
|
|
return 0;
|
|
}
|