fix: 把内核恢复成 GitHub 原版
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#ifndef _TOOLS_LINUX_ALIGN_H
|
||||
#define _TOOLS_LINUX_ALIGN_H
|
||||
|
||||
#include <uapi/linux/const.h>
|
||||
|
||||
#define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
|
||||
#define ALIGN_DOWN(x, a) __ALIGN_KERNEL((x) - ((a) - 1), (a))
|
||||
#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
|
||||
|
||||
#endif /* _TOOLS_LINUX_ALIGN_H */
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#ifndef _TOOLS_LINUX_ALIGN_H
|
||||
#define _TOOLS_LINUX_ALIGN_H
|
||||
|
||||
#include <uapi/linux/const.h>
|
||||
|
||||
#define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
|
||||
#define ALIGN_DOWN(x, a) __ALIGN_KERNEL((x) - ((a) - 1), (a))
|
||||
#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
|
||||
|
||||
#endif /* _TOOLS_LINUX_ALIGN_H */
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _TOOLS_LINUX_CACHE_H
|
||||
#define _TOOLS_LINUX_CACHE_H
|
||||
|
||||
#define L1_CACHE_SHIFT 5
|
||||
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
|
||||
|
||||
#define SMP_CACHE_BYTES L1_CACHE_BYTES
|
||||
|
||||
#endif
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _TOOLS_LINUX_CACHE_H
|
||||
#define _TOOLS_LINUX_CACHE_H
|
||||
|
||||
#define L1_CACHE_SHIFT 5
|
||||
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
|
||||
|
||||
#define SMP_CACHE_BYTES L1_CACHE_BYTES
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef _LINUX_CONST_H
|
||||
#define _LINUX_CONST_H
|
||||
|
||||
#include <vdso/const.h>
|
||||
|
||||
#endif /* _LINUX_CONST_H */
|
||||
#ifndef _LINUX_CONST_H
|
||||
#define _LINUX_CONST_H
|
||||
|
||||
#include <vdso/const.h>
|
||||
|
||||
#endif /* _LINUX_CONST_H */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _TOOLS_DEBUGFS_H
|
||||
#define _TOOLS_DEBUGFS_H
|
||||
|
||||
#endif
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _TOOLS_DEBUGFS_H
|
||||
#define _TOOLS_DEBUGFS_H
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef _TOOLS_INCLUDE_LINUX_DELAY_H
|
||||
#define _TOOLS_INCLUDE_LINUX_DELAY_H
|
||||
|
||||
#endif /* _TOOLS_INCLUDE_LINUX_DELAY_H */
|
||||
#ifndef _TOOLS_INCLUDE_LINUX_DELAY_H
|
||||
#define _TOOLS_INCLUDE_LINUX_DELAY_H
|
||||
|
||||
#endif /* _TOOLS_INCLUDE_LINUX_DELAY_H */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef _TOOLS_LINUX_EXPORT_H_
|
||||
#define _TOOLS_LINUX_EXPORT_H_
|
||||
|
||||
#define EXPORT_SYMBOL(sym)
|
||||
#define EXPORT_SYMBOL_GPL(sym)
|
||||
|
||||
#endif
|
||||
#ifndef _TOOLS_LINUX_EXPORT_H_
|
||||
#define _TOOLS_LINUX_EXPORT_H_
|
||||
|
||||
#define EXPORT_SYMBOL(sym)
|
||||
#define EXPORT_SYMBOL_GPL(sym)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef _TOOLS_INCLUDE_LINUX_FTRACE_H
|
||||
#define _TOOLS_INCLUDE_LINUX_FTRACE_H
|
||||
|
||||
#endif /* _TOOLS_INCLUDE_LINUX_FTRACE_H */
|
||||
#ifndef _TOOLS_INCLUDE_LINUX_FTRACE_H
|
||||
#define _TOOLS_INCLUDE_LINUX_FTRACE_H
|
||||
|
||||
#endif /* _TOOLS_INCLUDE_LINUX_FTRACE_H */
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _TOOLS_INCLUDE_LINUX_GFP_H
|
||||
#define _TOOLS_INCLUDE_LINUX_GFP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/gfp_types.h>
|
||||
|
||||
static inline bool gfpflags_allow_blocking(const gfp_t gfp_flags)
|
||||
{
|
||||
return !!(gfp_flags & __GFP_DIRECT_RECLAIM);
|
||||
}
|
||||
|
||||
#endif /* _TOOLS_INCLUDE_LINUX_GFP_H */
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _TOOLS_INCLUDE_LINUX_GFP_H
|
||||
#define _TOOLS_INCLUDE_LINUX_GFP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/gfp_types.h>
|
||||
|
||||
static inline bool gfpflags_allow_blocking(const gfp_t gfp_flags)
|
||||
{
|
||||
return !!(gfp_flags & __GFP_DIRECT_RECLAIM);
|
||||
}
|
||||
|
||||
#endif /* _TOOLS_INCLUDE_LINUX_GFP_H */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef _TOOLS_INCLUDE_LINUX_INTERRUPT_H
|
||||
#define _TOOLS_INCLUDE_LINUX_INTERRUPT_H
|
||||
|
||||
#endif /* _TOOLS_INCLUDE_LINUX_INTERRUPT_H */
|
||||
#ifndef _TOOLS_INCLUDE_LINUX_INTERRUPT_H
|
||||
#define _TOOLS_INCLUDE_LINUX_INTERRUPT_H
|
||||
|
||||
#endif /* _TOOLS_INCLUDE_LINUX_INTERRUPT_H */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _TOOLS_IO_H
|
||||
#define _TOOLS_IO_H
|
||||
|
||||
#endif
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _TOOLS_IO_H
|
||||
#define _TOOLS_IO_H
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#ifndef _TOOLS_INCLUDE_LINUX_LINKAGE_H
|
||||
#define _TOOLS_INCLUDE_LINUX_LINKAGE_H
|
||||
|
||||
#include <linux/export.h>
|
||||
|
||||
#define SYM_FUNC_START(x) .globl x; x:
|
||||
#define SYM_FUNC_END(x)
|
||||
#define SYM_DATA_START(x) .globl x; x:
|
||||
#define SYM_DATA_START_LOCAL(x) x:
|
||||
#define SYM_DATA_END(x)
|
||||
|
||||
#endif /* _TOOLS_INCLUDE_LINUX_LINKAGE_H */
|
||||
#ifndef _TOOLS_INCLUDE_LINUX_LINKAGE_H
|
||||
#define _TOOLS_INCLUDE_LINUX_LINKAGE_H
|
||||
|
||||
#include <linux/export.h>
|
||||
|
||||
#define SYM_FUNC_START(x) .globl x; x:
|
||||
#define SYM_FUNC_END(x)
|
||||
#define SYM_DATA_START(x) .globl x; x:
|
||||
#define SYM_DATA_START_LOCAL(x) x:
|
||||
#define SYM_DATA_END(x)
|
||||
|
||||
#endif /* _TOOLS_INCLUDE_LINUX_LINKAGE_H */
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _LIBLOCKDEP_LINUX_MODULE_H_
|
||||
#define _LIBLOCKDEP_LINUX_MODULE_H_
|
||||
|
||||
#define module_param(name, type, perm)
|
||||
|
||||
static inline bool __is_module_percpu_address(unsigned long addr, unsigned long *can_addr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _LIBLOCKDEP_LINUX_MODULE_H_
|
||||
#define _LIBLOCKDEP_LINUX_MODULE_H_
|
||||
|
||||
#define module_param(name, type, perm)
|
||||
|
||||
static inline bool __is_module_percpu_address(unsigned long addr, unsigned long *can_addr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef _TOOLS_INCLUDE_LINUX_MUTEX_H
|
||||
#define _TOOLS_INCLUDE_LINUX_MUTEX_H
|
||||
|
||||
#endif /* _TOOLS_INCLUDE_LINUX_MUTEX_H */
|
||||
#ifndef _TOOLS_INCLUDE_LINUX_MUTEX_H
|
||||
#define _TOOLS_INCLUDE_LINUX_MUTEX_H
|
||||
|
||||
#endif /* _TOOLS_INCLUDE_LINUX_MUTEX_H */
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _TOOLS_LINUX_PANIC_H
|
||||
#define _TOOLS_LINUX_PANIC_H
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static inline void panic(const char *fmt, ...)
|
||||
{
|
||||
va_list argp;
|
||||
|
||||
va_start(argp, fmt);
|
||||
vfprintf(stderr, fmt, argp);
|
||||
va_end(argp);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
#endif
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _TOOLS_LINUX_PANIC_H
|
||||
#define _TOOLS_LINUX_PANIC_H
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static inline void panic(const char *fmt, ...)
|
||||
{
|
||||
va_list argp;
|
||||
|
||||
va_start(argp, fmt);
|
||||
vfprintf(stderr, fmt, argp);
|
||||
va_end(argp);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _TOOLS_LINUX_PFN_H_
|
||||
#define _TOOLS_LINUX_PFN_H_
|
||||
|
||||
#include <linux/mm.h>
|
||||
|
||||
#define PFN_UP(x) (((x) + PAGE_SIZE - 1) >> PAGE_SHIFT)
|
||||
#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
|
||||
#define PFN_PHYS(x) ((phys_addr_t)(x) << PAGE_SHIFT)
|
||||
#define PHYS_PFN(x) ((unsigned long)((x) >> PAGE_SHIFT))
|
||||
#endif
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _TOOLS_LINUX_PFN_H_
|
||||
#define _TOOLS_LINUX_PFN_H_
|
||||
|
||||
#include <linux/mm.h>
|
||||
|
||||
#define PFN_UP(x) (((x) + PAGE_SIZE - 1) >> PAGE_SHIFT)
|
||||
#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
|
||||
#define PFN_PHYS(x) ((phys_addr_t)(x) << PAGE_SHIFT)
|
||||
#define PHYS_PFN(x) ((unsigned long)((x) >> PAGE_SHIFT))
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef _TOOLS_PERF_LINUX_SCHED_CLOCK_H
|
||||
#define _TOOLS_PERF_LINUX_SCHED_CLOCK_H
|
||||
|
||||
#endif /* _TOOLS_PERF_LINUX_SCHED_CLOCK_H */
|
||||
#ifndef _TOOLS_PERF_LINUX_SCHED_CLOCK_H
|
||||
#define _TOOLS_PERF_LINUX_SCHED_CLOCK_H
|
||||
|
||||
#endif /* _TOOLS_PERF_LINUX_SCHED_CLOCK_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef _TOOLS_PERF_LINUX_SCHED_MM_H
|
||||
#define _TOOLS_PERF_LINUX_SCHED_MM_H
|
||||
|
||||
#define might_alloc(gfp) do { } while (0)
|
||||
|
||||
#endif /* _TOOLS_PERF_LINUX_SCHED_MM_H */
|
||||
#ifndef _TOOLS_PERF_LINUX_SCHED_MM_H
|
||||
#define _TOOLS_PERF_LINUX_SCHED_MM_H
|
||||
|
||||
#define might_alloc(gfp) do { } while (0)
|
||||
|
||||
#endif /* _TOOLS_PERF_LINUX_SCHED_MM_H */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef _TOOLS_PERF_LINUX_SCHED_TASK_H
|
||||
#define _TOOLS_PERF_LINUX_SCHED_TASK_H
|
||||
|
||||
#endif /* _TOOLS_PERF_LINUX_SCHED_TASK_H */
|
||||
#ifndef _TOOLS_PERF_LINUX_SCHED_TASK_H
|
||||
#define _TOOLS_PERF_LINUX_SCHED_TASK_H
|
||||
|
||||
#endif /* _TOOLS_PERF_LINUX_SCHED_TASK_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef _TOOLS_INCLUDE_LINUX_SEQ_FILE_H
|
||||
#define _TOOLS_INCLUDE_LINUX_SEQ_FILE_H
|
||||
|
||||
struct seq_file;
|
||||
|
||||
#endif /* _TOOLS_INCLUDE_LINUX_SEQ_FILE_H */
|
||||
#ifndef _TOOLS_INCLUDE_LINUX_SEQ_FILE_H
|
||||
#define _TOOLS_INCLUDE_LINUX_SEQ_FILE_H
|
||||
|
||||
struct seq_file;
|
||||
|
||||
#endif /* _TOOLS_INCLUDE_LINUX_SEQ_FILE_H */
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1
|
||||
#ifndef __TOOLS_LINUX_ZALLOC_H
|
||||
#define __TOOLS_LINUX_ZALLOC_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
void *zalloc(size_t size);
|
||||
void __zfree(void **ptr);
|
||||
|
||||
#define zfree(ptr) __zfree((void **)(ptr))
|
||||
|
||||
#endif // __TOOLS_LINUX_ZALLOC_H
|
||||
// SPDX-License-Identifier: LGPL-2.1
|
||||
#ifndef __TOOLS_LINUX_ZALLOC_H
|
||||
#define __TOOLS_LINUX_ZALLOC_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
void *zalloc(size_t size);
|
||||
void __zfree(void **ptr);
|
||||
|
||||
#define zfree(ptr) __zfree((void **)(ptr))
|
||||
|
||||
#endif // __TOOLS_LINUX_ZALLOC_H
|
||||
|
||||
Reference in New Issue
Block a user