aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bpf.h5
-rw-r--r--include/linux/buffer_head.h1
-rw-r--r--include/linux/kernel.h90
-rw-r--r--include/linux/netfilter_bridge/ebtables.h7
-rw-r--r--include/linux/of.h10
-rw-r--r--include/linux/sched/topology.h8
-rw-r--r--include/linux/thread_info.h2
7 files changed, 95 insertions, 28 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 8390859e79e7..f1af7d63d678 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -368,6 +368,11 @@ static inline void __bpf_prog_uncharge(struct user_struct *user, u32 pages)
368{ 368{
369} 369}
370 370
371static inline int bpf_obj_get_user(const char __user *pathname)
372{
373 return -EOPNOTSUPP;
374}
375
371static inline struct net_device *__dev_map_lookup_elem(struct bpf_map *map, 376static inline struct net_device *__dev_map_lookup_elem(struct bpf_map *map,
372 u32 key) 377 u32 key)
373{ 378{
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index c8dae555eccf..446b24cac67d 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -232,6 +232,7 @@ int generic_write_end(struct file *, struct address_space *,
232 loff_t, unsigned, unsigned, 232 loff_t, unsigned, unsigned,
233 struct page *, void *); 233 struct page *, void *);
234void page_zero_new_buffers(struct page *page, unsigned from, unsigned to); 234void page_zero_new_buffers(struct page *page, unsigned from, unsigned to);
235void clean_page_buffers(struct page *page);
235int cont_write_begin(struct file *, struct address_space *, loff_t, 236int cont_write_begin(struct file *, struct address_space *, loff_t,
236 unsigned, unsigned, struct page **, void **, 237 unsigned, unsigned, struct page **, void **,
237 get_block_t *, loff_t *); 238 get_block_t *, loff_t *);
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 0ad4c3044cf9..91189bb0c818 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -44,6 +44,12 @@
44 44
45#define STACK_MAGIC 0xdeadbeef 45#define STACK_MAGIC 0xdeadbeef
46 46
47/**
48 * REPEAT_BYTE - repeat the value @x multiple times as an unsigned long value
49 * @x: value to repeat
50 *
51 * NOTE: @x is not checked for > 0xff; larger values produce odd results.
52 */
47#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x)) 53#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x))
48 54
49/* @a is a power of 2 value */ 55/* @a is a power of 2 value */
@@ -57,6 +63,10 @@
57#define READ 0 63#define READ 0
58#define WRITE 1 64#define WRITE 1
59 65
66/**
67 * ARRAY_SIZE - get the number of elements in array @arr
68 * @arr: array to be sized
69 */
60#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) 70#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
61 71
62#define u64_to_user_ptr(x) ( \ 72#define u64_to_user_ptr(x) ( \
@@ -76,7 +86,15 @@
76#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1) 86#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
77#define round_down(x, y) ((x) & ~__round_mask(x, y)) 87#define round_down(x, y) ((x) & ~__round_mask(x, y))
78 88
89/**
90 * FIELD_SIZEOF - get the size of a struct's field
91 * @t: the target struct
92 * @f: the target struct's field
93 * Return: the size of @f in the struct definition without having a
94 * declared instance of @t.
95 */
79#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) 96#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
97
80#define DIV_ROUND_UP __KERNEL_DIV_ROUND_UP 98#define DIV_ROUND_UP __KERNEL_DIV_ROUND_UP
81 99
82#define DIV_ROUND_DOWN_ULL(ll, d) \ 100#define DIV_ROUND_DOWN_ULL(ll, d) \
@@ -107,7 +125,7 @@
107/* 125/*
108 * Divide positive or negative dividend by positive or negative divisor 126 * Divide positive or negative dividend by positive or negative divisor
109 * and round to closest integer. Result is undefined for negative 127 * and round to closest integer. Result is undefined for negative
110 * divisors if he dividend variable type is unsigned and for negative 128 * divisors if the dividend variable type is unsigned and for negative
111 * dividends if the divisor variable type is unsigned. 129 * dividends if the divisor variable type is unsigned.
112 */ 130 */
113#define DIV_ROUND_CLOSEST(x, divisor)( \ 131#define DIV_ROUND_CLOSEST(x, divisor)( \
@@ -247,13 +265,13 @@ extern int _cond_resched(void);
247 * @ep_ro: right open interval endpoint 265 * @ep_ro: right open interval endpoint
248 * 266 *
249 * Perform a "reciprocal multiplication" in order to "scale" a value into 267 * Perform a "reciprocal multiplication" in order to "scale" a value into
250 * range [0, ep_ro), where the upper interval endpoint is right-open. 268 * range [0, @ep_ro), where the upper interval endpoint is right-open.
251 * This is useful, e.g. for accessing a index of an array containing 269 * This is useful, e.g. for accessing a index of an array containing
252 * ep_ro elements, for example. Think of it as sort of modulus, only that 270 * @ep_ro elements, for example. Think of it as sort of modulus, only that
253 * the result isn't that of modulo. ;) Note that if initial input is a 271 * the result isn't that of modulo. ;) Note that if initial input is a
254 * small value, then result will return 0. 272 * small value, then result will return 0.
255 * 273 *
256 * Return: a result based on val in interval [0, ep_ro). 274 * Return: a result based on @val in interval [0, @ep_ro).
257 */ 275 */
258static inline u32 reciprocal_scale(u32 val, u32 ep_ro) 276static inline u32 reciprocal_scale(u32 val, u32 ep_ro)
259{ 277{
@@ -618,8 +636,8 @@ do { \
618 * trace_printk - printf formatting in the ftrace buffer 636 * trace_printk - printf formatting in the ftrace buffer
619 * @fmt: the printf format for printing 637 * @fmt: the printf format for printing
620 * 638 *
621 * Note: __trace_printk is an internal function for trace_printk and 639 * Note: __trace_printk is an internal function for trace_printk() and
622 * the @ip is passed in via the trace_printk macro. 640 * the @ip is passed in via the trace_printk() macro.
623 * 641 *
624 * This function allows a kernel developer to debug fast path sections 642 * This function allows a kernel developer to debug fast path sections
625 * that printk is not appropriate for. By scattering in various 643 * that printk is not appropriate for. By scattering in various
@@ -629,7 +647,7 @@ do { \
629 * This is intended as a debugging tool for the developer only. 647 * This is intended as a debugging tool for the developer only.
630 * Please refrain from leaving trace_printks scattered around in 648 * Please refrain from leaving trace_printks scattered around in
631 * your code. (Extra memory is used for special buffers that are 649 * your code. (Extra memory is used for special buffers that are
632 * allocated when trace_printk() is used) 650 * allocated when trace_printk() is used.)
633 * 651 *
634 * A little optization trick is done here. If there's only one 652 * A little optization trick is done here. If there's only one
635 * argument, there's no need to scan the string for printf formats. 653 * argument, there's no need to scan the string for printf formats.
@@ -681,7 +699,7 @@ int __trace_printk(unsigned long ip, const char *fmt, ...);
681 * the @ip is passed in via the trace_puts macro. 699 * the @ip is passed in via the trace_puts macro.
682 * 700 *
683 * This is similar to trace_printk() but is made for those really fast 701 * This is similar to trace_printk() but is made for those really fast
684 * paths that a developer wants the least amount of "Heisenbug" affects, 702 * paths that a developer wants the least amount of "Heisenbug" effects,
685 * where the processing of the print format is still too much. 703 * where the processing of the print format is still too much.
686 * 704 *
687 * This function allows a kernel developer to debug fast path sections 705 * This function allows a kernel developer to debug fast path sections
@@ -692,7 +710,7 @@ int __trace_printk(unsigned long ip, const char *fmt, ...);
692 * This is intended as a debugging tool for the developer only. 710 * This is intended as a debugging tool for the developer only.
693 * Please refrain from leaving trace_puts scattered around in 711 * Please refrain from leaving trace_puts scattered around in
694 * your code. (Extra memory is used for special buffers that are 712 * your code. (Extra memory is used for special buffers that are
695 * allocated when trace_puts() is used) 713 * allocated when trace_puts() is used.)
696 * 714 *
697 * Returns: 0 if nothing was written, positive # if string was. 715 * Returns: 0 if nothing was written, positive # if string was.
698 * (1 when __trace_bputs is used, strlen(str) when __trace_puts is used) 716 * (1 when __trace_bputs is used, strlen(str) when __trace_puts is used)
@@ -771,6 +789,12 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
771 t2 min2 = (y); \ 789 t2 min2 = (y); \
772 (void) (&min1 == &min2); \ 790 (void) (&min1 == &min2); \
773 min1 < min2 ? min1 : min2; }) 791 min1 < min2 ? min1 : min2; })
792
793/**
794 * min - return minimum of two values of the same or compatible types
795 * @x: first value
796 * @y: second value
797 */
774#define min(x, y) \ 798#define min(x, y) \
775 __min(typeof(x), typeof(y), \ 799 __min(typeof(x), typeof(y), \
776 __UNIQUE_ID(min1_), __UNIQUE_ID(min2_), \ 800 __UNIQUE_ID(min1_), __UNIQUE_ID(min2_), \
@@ -781,12 +805,31 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
781 t2 max2 = (y); \ 805 t2 max2 = (y); \
782 (void) (&max1 == &max2); \ 806 (void) (&max1 == &max2); \
783 max1 > max2 ? max1 : max2; }) 807 max1 > max2 ? max1 : max2; })
808
809/**
810 * max - return maximum of two values of the same or compatible types
811 * @x: first value
812 * @y: second value
813 */
784#define max(x, y) \ 814#define max(x, y) \
785 __max(typeof(x), typeof(y), \ 815 __max(typeof(x), typeof(y), \
786 __UNIQUE_ID(max1_), __UNIQUE_ID(max2_), \ 816 __UNIQUE_ID(max1_), __UNIQUE_ID(max2_), \
787 x, y) 817 x, y)
788 818
819/**
820 * min3 - return minimum of three values
821 * @x: first value
822 * @y: second value
823 * @z: third value
824 */
789#define min3(x, y, z) min((typeof(x))min(x, y), z) 825#define min3(x, y, z) min((typeof(x))min(x, y), z)
826
827/**
828 * max3 - return maximum of three values
829 * @x: first value
830 * @y: second value
831 * @z: third value
832 */
790#define max3(x, y, z) max((typeof(x))max(x, y), z) 833#define max3(x, y, z) max((typeof(x))max(x, y), z)
791 834
792/** 835/**
@@ -805,8 +848,8 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
805 * @lo: lowest allowable value 848 * @lo: lowest allowable value
806 * @hi: highest allowable value 849 * @hi: highest allowable value
807 * 850 *
808 * This macro does strict typechecking of lo/hi to make sure they are of the 851 * This macro does strict typechecking of @lo/@hi to make sure they are of the
809 * same type as val. See the unnecessary pointer comparisons. 852 * same type as @val. See the unnecessary pointer comparisons.
810 */ 853 */
811#define clamp(val, lo, hi) min((typeof(val))max(val, lo), hi) 854#define clamp(val, lo, hi) min((typeof(val))max(val, lo), hi)
812 855
@@ -816,11 +859,24 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
816 * 859 *
817 * Or not use min/max/clamp at all, of course. 860 * Or not use min/max/clamp at all, of course.
818 */ 861 */
862
863/**
864 * min_t - return minimum of two values, using the specified type
865 * @type: data type to use
866 * @x: first value
867 * @y: second value
868 */
819#define min_t(type, x, y) \ 869#define min_t(type, x, y) \
820 __min(type, type, \ 870 __min(type, type, \
821 __UNIQUE_ID(min1_), __UNIQUE_ID(min2_), \ 871 __UNIQUE_ID(min1_), __UNIQUE_ID(min2_), \
822 x, y) 872 x, y)
823 873
874/**
875 * max_t - return maximum of two values, using the specified type
876 * @type: data type to use
877 * @x: first value
878 * @y: second value
879 */
824#define max_t(type, x, y) \ 880#define max_t(type, x, y) \
825 __max(type, type, \ 881 __max(type, type, \
826 __UNIQUE_ID(min1_), __UNIQUE_ID(min2_), \ 882 __UNIQUE_ID(min1_), __UNIQUE_ID(min2_), \
@@ -834,7 +890,7 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
834 * @hi: maximum allowable value 890 * @hi: maximum allowable value
835 * 891 *
836 * This macro does no typechecking and uses temporary variables of type 892 * This macro does no typechecking and uses temporary variables of type
837 * 'type' to make all the comparisons. 893 * @type to make all the comparisons.
838 */ 894 */
839#define clamp_t(type, val, lo, hi) min_t(type, max_t(type, val, lo), hi) 895#define clamp_t(type, val, lo, hi) min_t(type, max_t(type, val, lo), hi)
840 896
@@ -845,15 +901,17 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
845 * @hi: maximum allowable value 901 * @hi: maximum allowable value
846 * 902 *
847 * This macro does no typechecking and uses temporary variables of whatever 903 * This macro does no typechecking and uses temporary variables of whatever
848 * type the input argument 'val' is. This is useful when val is an unsigned 904 * type the input argument @val is. This is useful when @val is an unsigned
849 * type and min and max are literals that will otherwise be assigned a signed 905 * type and @lo and @hi are literals that will otherwise be assigned a signed
850 * integer type. 906 * integer type.
851 */ 907 */
852#define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi) 908#define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi)
853 909
854 910
855/* 911/**
856 * swap - swap value of @a and @b 912 * swap - swap values of @a and @b
913 * @a: first value
914 * @b: second value
857 */ 915 */
858#define swap(a, b) \ 916#define swap(a, b) \
859 do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0) 917 do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h
index 2c2a5514b0df..528b24c78308 100644
--- a/include/linux/netfilter_bridge/ebtables.h
+++ b/include/linux/netfilter_bridge/ebtables.h
@@ -108,9 +108,10 @@ struct ebt_table {
108 108
109#define EBT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1)) & \ 109#define EBT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1)) & \
110 ~(__alignof__(struct _xt_align)-1)) 110 ~(__alignof__(struct _xt_align)-1))
111extern struct ebt_table *ebt_register_table(struct net *net, 111extern int ebt_register_table(struct net *net,
112 const struct ebt_table *table, 112 const struct ebt_table *table,
113 const struct nf_hook_ops *); 113 const struct nf_hook_ops *ops,
114 struct ebt_table **res);
114extern void ebt_unregister_table(struct net *net, struct ebt_table *table, 115extern void ebt_unregister_table(struct net *net, struct ebt_table *table,
115 const struct nf_hook_ops *); 116 const struct nf_hook_ops *);
116extern unsigned int ebt_do_table(struct sk_buff *skb, 117extern unsigned int ebt_do_table(struct sk_buff *skb,
diff --git a/include/linux/of.h b/include/linux/of.h
index cfc34117fc92..b240ed69dc96 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -734,6 +734,16 @@ static inline struct device_node *of_get_cpu_node(int cpu,
734 return NULL; 734 return NULL;
735} 735}
736 736
737static inline int of_n_addr_cells(struct device_node *np)
738{
739 return 0;
740
741}
742static inline int of_n_size_cells(struct device_node *np)
743{
744 return 0;
745}
746
737static inline int of_property_read_u64(const struct device_node *np, 747static inline int of_property_read_u64(const struct device_node *np,
738 const char *propname, u64 *out_value) 748 const char *propname, u64 *out_value)
739{ 749{
diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h
index d7b6dab956ec..7d065abc7a47 100644
--- a/include/linux/sched/topology.h
+++ b/include/linux/sched/topology.h
@@ -71,14 +71,6 @@ struct sched_domain_shared {
71 atomic_t ref; 71 atomic_t ref;
72 atomic_t nr_busy_cpus; 72 atomic_t nr_busy_cpus;
73 int has_idle_cores; 73 int has_idle_cores;
74
75 /*
76 * Some variables from the most recent sd_lb_stats for this domain,
77 * used by wake_affine().
78 */
79 unsigned long nr_running;
80 unsigned long load;
81 unsigned long capacity;
82}; 74};
83 75
84struct sched_domain { 76struct sched_domain {
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h
index 905d769d8ddc..5f7eeab990fe 100644
--- a/include/linux/thread_info.h
+++ b/include/linux/thread_info.h
@@ -42,7 +42,7 @@ enum {
42#define THREAD_ALIGN THREAD_SIZE 42#define THREAD_ALIGN THREAD_SIZE
43#endif 43#endif
44 44
45#ifdef CONFIG_DEBUG_STACK_USAGE 45#if IS_ENABLED(CONFIG_DEBUG_STACK_USAGE) || IS_ENABLED(CONFIG_DEBUG_KMEMLEAK)
46# define THREADINFO_GFP (GFP_KERNEL_ACCOUNT | __GFP_NOTRACK | \ 46# define THREADINFO_GFP (GFP_KERNEL_ACCOUNT | __GFP_NOTRACK | \
47 __GFP_ZERO) 47 __GFP_ZERO)
48#else 48#else