diff options
Diffstat (limited to 'scripts')
73 files changed, 1523 insertions, 331 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 30816037036e..7484b9d8272f 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
| @@ -24,6 +24,10 @@ depfile = $(subst $(comma),_,$(dot-target).d) | |||
| 24 | basetarget = $(basename $(notdir $@)) | 24 | basetarget = $(basename $(notdir $@)) |
| 25 | 25 | ||
| 26 | ### | 26 | ### |
| 27 | # real prerequisites without phony targets | ||
| 28 | real-prereqs = $(filter-out $(PHONY), $^) | ||
| 29 | |||
| 30 | ### | ||
| 27 | # Escape single quote for use in echo statements | 31 | # Escape single quote for use in echo statements |
| 28 | escsq = $(subst $(squote),'\$(squote)',$1) | 32 | escsq = $(subst $(squote),'\$(squote)',$1) |
| 29 | 33 | ||
| @@ -67,14 +71,10 @@ endef | |||
| 67 | 71 | ||
| 68 | # cc-cross-prefix | 72 | # cc-cross-prefix |
| 69 | # Usage: CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-) | 73 | # Usage: CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-) |
| 70 | # Return first prefix where a prefix$(CC) is found in PATH. | 74 | # Return first <prefix> where a <prefix>gcc is found in PATH. |
| 71 | # If no $(CC) found in PATH with listed prefixes return nothing | 75 | # If no gcc found in PATH with listed prefixes return nothing |
| 72 | cc-cross-prefix = \ | 76 | cc-cross-prefix = $(firstword $(foreach c, $(filter-out -%, $(1)), \ |
| 73 | $(word 1, $(foreach c,$(1), \ | 77 | $(if $(shell which $(c)gcc), $(c)))) |
| 74 | $(shell set -e; \ | ||
| 75 | if (which $(strip $(c))$(CC)) > /dev/null 2>&1 ; then \ | ||
| 76 | echo $(c); \ | ||
| 77 | fi))) | ||
| 78 | 78 | ||
| 79 | # output directory for tests below | 79 | # output directory for tests below |
| 80 | TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/) | 80 | TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/) |
| @@ -134,12 +134,9 @@ cc-option-yn = $(call try-run,\ | |||
| 134 | cc-disable-warning = $(call try-run,\ | 134 | cc-disable-warning = $(call try-run,\ |
| 135 | $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) | 135 | $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) |
| 136 | 136 | ||
| 137 | # cc-version | ||
| 138 | cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC)) | ||
| 139 | |||
| 140 | # cc-ifversion | 137 | # cc-ifversion |
| 141 | # Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) | 138 | # Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) |
| 142 | cc-ifversion = $(shell [ $(cc-version) $(1) $(2) ] && echo $(3) || echo $(4)) | 139 | cc-ifversion = $(shell [ $(CONFIG_GCC_VERSION)0 $(1) $(2)000 ] && echo $(3) || echo $(4)) |
| 143 | 140 | ||
| 144 | # cc-ldoption | 141 | # cc-ldoption |
| 145 | # Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both) | 142 | # Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both) |
diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include index dad5583451af..87ff1dcc6bd5 100644 --- a/scripts/Kconfig.include +++ b/scripts/Kconfig.include | |||
| @@ -27,4 +27,4 @@ cc-option = $(success,$(CC) -Werror $(1) -E -x c /dev/null -o /dev/null) | |||
| 27 | ld-option = $(success,$(LD) -v $(1)) | 27 | ld-option = $(success,$(LD) -v $(1)) |
| 28 | 28 | ||
| 29 | # gcc version including patch level | 29 | # gcc version including patch level |
| 30 | gcc-version := $(shell,$(srctree)/scripts/gcc-version.sh -p $(CC) | sed 's/^0*//') | 30 | gcc-version := $(shell,$(srctree)/scripts/gcc-version.sh $(CC)) |
diff --git a/scripts/Makefile b/scripts/Makefile index feb1f71381d7..9d442ee050bd 100644 --- a/scripts/Makefile +++ b/scripts/Makefile | |||
| @@ -39,7 +39,6 @@ build_unifdef: $(obj)/unifdef | |||
| 39 | subdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins | 39 | subdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins |
| 40 | subdir-$(CONFIG_MODVERSIONS) += genksyms | 40 | subdir-$(CONFIG_MODVERSIONS) += genksyms |
| 41 | subdir-$(CONFIG_SECURITY_SELINUX) += selinux | 41 | subdir-$(CONFIG_SECURITY_SELINUX) += selinux |
| 42 | subdir-$(CONFIG_GDB_SCRIPTS) += gdb | ||
| 43 | 42 | ||
| 44 | # Let clean descend into subdirs | 43 | # Let clean descend into subdirs |
| 45 | subdir- += basic dtc kconfig mod package | 44 | subdir- += basic dtc gdb kconfig mod package |
diff --git a/scripts/Makefile.asm-generic b/scripts/Makefile.asm-generic index a62d2823f6cf..82ad63dcd62b 100644 --- a/scripts/Makefile.asm-generic +++ b/scripts/Makefile.asm-generic | |||
| @@ -12,8 +12,19 @@ all: | |||
| 12 | src := $(subst /generated,,$(obj)) | 12 | src := $(subst /generated,,$(obj)) |
| 13 | -include $(src)/Kbuild | 13 | -include $(src)/Kbuild |
| 14 | 14 | ||
| 15 | # $(generic)/Kbuild lists mandatory-y. Exclude um since it is a special case. | ||
| 16 | ifneq ($(SRCARCH),um) | ||
| 17 | include $(generic)/Kbuild | ||
| 18 | endif | ||
| 19 | |||
| 15 | include scripts/Kbuild.include | 20 | include scripts/Kbuild.include |
| 16 | 21 | ||
| 22 | redundant := $(filter $(mandatory-y) $(generated-y), $(generic-y)) | ||
| 23 | redundant += $(foreach f, $(generic-y), $(if $(wildcard $(srctree)/$(src)/$(f)),$(f))) | ||
| 24 | redundant := $(sort $(redundant)) | ||
| 25 | $(if $(redundant),\ | ||
| 26 | $(warning redundant generic-y found in $(src)/Kbuild: $(redundant))) | ||
| 27 | |||
| 17 | # If arch does not implement mandatory headers, fallback to asm-generic ones. | 28 | # If arch does not implement mandatory headers, fallback to asm-generic ones. |
| 18 | mandatory-y := $(filter-out $(generated-y), $(mandatory-y)) | 29 | mandatory-y := $(filter-out $(generated-y), $(mandatory-y)) |
| 19 | generic-y += $(foreach f, $(mandatory-y), $(if $(wildcard $(srctree)/$(src)/$(f)),,$(f))) | 30 | generic-y += $(foreach f, $(mandatory-y), $(if $(wildcard $(srctree)/$(src)/$(f)),,$(f))) |
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index fd03d60f6c5a..2554a15ecf2b 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
| @@ -63,7 +63,9 @@ ifneq ($(strip $(real-obj-y) $(need-builtin)),) | |||
| 63 | builtin-target := $(obj)/built-in.a | 63 | builtin-target := $(obj)/built-in.a |
| 64 | endif | 64 | endif |
| 65 | 65 | ||
| 66 | ifdef CONFIG_MODULES | ||
| 66 | modorder-target := $(obj)/modules.order | 67 | modorder-target := $(obj)/modules.order |
| 68 | endif | ||
| 67 | 69 | ||
| 68 | # We keep a list of all modules in $(MODVERDIR) | 70 | # We keep a list of all modules in $(MODVERDIR) |
| 69 | 71 | ||
| @@ -104,7 +106,7 @@ modkern_cflags = \ | |||
| 104 | quiet_modtag = $(if $(part-of-module),[M], ) | 106 | quiet_modtag = $(if $(part-of-module),[M], ) |
| 105 | 107 | ||
| 106 | quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ | 108 | quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ |
| 107 | cmd_cc_s_c = $(CC) $(c_flags) $(DISABLE_LTO) -fverbose-asm -S -o $@ $< | 109 | cmd_cc_s_c = $(CC) $(filter-out $(DEBUG_CFLAGS), $(c_flags)) $(DISABLE_LTO) -fverbose-asm -S -o $@ $< |
| 108 | 110 | ||
| 109 | $(obj)/%.s: $(src)/%.c FORCE | 111 | $(obj)/%.s: $(src)/%.c FORCE |
| 110 | $(call if_changed_dep,cc_s_c) | 112 | $(call if_changed_dep,cc_s_c) |
| @@ -118,7 +120,7 @@ $(obj)/%.i: $(src)/%.c FORCE | |||
| 118 | # These mirror gensymtypes_S and co below, keep them in synch. | 120 | # These mirror gensymtypes_S and co below, keep them in synch. |
| 119 | cmd_gensymtypes_c = \ | 121 | cmd_gensymtypes_c = \ |
| 120 | $(CPP) -D__GENKSYMS__ $(c_flags) $< | \ | 122 | $(CPP) -D__GENKSYMS__ $(c_flags) $< | \ |
| 121 | $(GENKSYMS) $(if $(1), -T $(2)) \ | 123 | scripts/genksyms/genksyms $(if $(1), -T $(2)) \ |
| 122 | $(patsubst y,-R,$(CONFIG_MODULE_REL_CRCS)) \ | 124 | $(patsubst y,-R,$(CONFIG_MODULE_REL_CRCS)) \ |
| 123 | $(if $(KBUILD_PRESERVE),-p) \ | 125 | $(if $(KBUILD_PRESERVE),-p) \ |
| 124 | -r $(firstword $(wildcard $(2:.symtypes=.symref) /dev/null)) | 126 | -r $(firstword $(wildcard $(2:.symtypes=.symref) /dev/null)) |
| @@ -312,13 +314,13 @@ $(real-obj-m:.o=.s): modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE) | |||
| 312 | # | 314 | # |
| 313 | # These mirror gensymtypes_c and co above, keep them in synch. | 315 | # These mirror gensymtypes_c and co above, keep them in synch. |
| 314 | cmd_gensymtypes_S = \ | 316 | cmd_gensymtypes_S = \ |
| 315 | (echo "\#include <linux/kernel.h>" ; \ | 317 | { echo "\#include <linux/kernel.h>" ; \ |
| 316 | echo "\#include <asm/asm-prototypes.h>" ; \ | 318 | echo "\#include <asm/asm-prototypes.h>" ; \ |
| 317 | $(CPP) $(a_flags) $< | \ | 319 | $(CPP) $(a_flags) $< | \ |
| 318 | grep "\<___EXPORT_SYMBOL\>" | \ | 320 | grep "\<___EXPORT_SYMBOL\>" | \ |
| 319 | sed 's/.*___EXPORT_SYMBOL[[:space:]]*\([a-zA-Z0-9_]*\)[[:space:]]*,.*/EXPORT_SYMBOL(\1);/' ) | \ | 321 | sed 's/.*___EXPORT_SYMBOL[[:space:]]*\([a-zA-Z0-9_]*\)[[:space:]]*,.*/EXPORT_SYMBOL(\1);/' ; } | \ |
| 320 | $(CPP) -D__GENKSYMS__ $(c_flags) -xc - | \ | 322 | $(CPP) -D__GENKSYMS__ $(c_flags) -xc - | \ |
| 321 | $(GENKSYMS) $(if $(1), -T $(2)) \ | 323 | scripts/genksyms/genksyms $(if $(1), -T $(2)) \ |
| 322 | $(patsubst y,-R,$(CONFIG_MODULE_REL_CRCS)) \ | 324 | $(patsubst y,-R,$(CONFIG_MODULE_REL_CRCS)) \ |
| 323 | $(if $(KBUILD_PRESERVE),-p) \ | 325 | $(if $(KBUILD_PRESERVE),-p) \ |
| 324 | -r $(firstword $(wildcard $(2:.symtypes=.symref) /dev/null)) | 326 | -r $(firstword $(wildcard $(2:.symtypes=.symref) /dev/null)) |
| @@ -394,17 +396,12 @@ $(obj)/%.asn1.c $(obj)/%.asn1.h: $(src)/%.asn1 $(objtree)/scripts/asn1_compiler | |||
| 394 | $(sort $(subdir-obj-y)): $(subdir-ym) ; | 396 | $(sort $(subdir-obj-y)): $(subdir-ym) ; |
| 395 | 397 | ||
| 396 | # | 398 | # |
| 397 | # Rule to compile a set of .o files into one .o file | 399 | # Rule to compile a set of .o files into one .a file (without symbol table) |
| 398 | # | 400 | # |
| 399 | ifdef builtin-target | 401 | ifdef builtin-target |
| 400 | 402 | ||
| 401 | # built-in.a archives are made with no symbol table or index which | ||
| 402 | # makes them small and fast, but unable to be used by the linker. | ||
| 403 | # scripts/link-vmlinux.sh builds an aggregate built-in.a with a symbol | ||
| 404 | # table and index. | ||
| 405 | quiet_cmd_ar_builtin = AR $@ | 403 | quiet_cmd_ar_builtin = AR $@ |
| 406 | cmd_ar_builtin = rm -f $@; \ | 404 | cmd_ar_builtin = rm -f $@; $(AR) rcSTP$(KBUILD_ARFLAGS) $@ $(real-prereqs) |
| 407 | $(AR) rcSTP$(KBUILD_ARFLAGS) $@ $(filter $(real-obj-y), $^) | ||
| 408 | 405 | ||
| 409 | $(builtin-target): $(real-obj-y) FORCE | 406 | $(builtin-target): $(real-obj-y) FORCE |
| 410 | $(call if_changed,ar_builtin) | 407 | $(call if_changed,ar_builtin) |
| @@ -426,16 +423,12 @@ $(modorder-target): $(subdir-ym) FORCE | |||
| 426 | $(Q)(cat /dev/null; $(modorder-cmds)) > $@ | 423 | $(Q)(cat /dev/null; $(modorder-cmds)) > $@ |
| 427 | 424 | ||
| 428 | # | 425 | # |
| 429 | # Rule to compile a set of .o files into one .a file | 426 | # Rule to compile a set of .o files into one .a file (with symbol table) |
| 430 | # | 427 | # |
| 431 | ifdef lib-target | 428 | ifdef lib-target |
| 432 | quiet_cmd_link_l_target = AR $@ | ||
| 433 | |||
| 434 | # lib target archives do get a symbol table and index | ||
| 435 | cmd_link_l_target = rm -f $@; $(AR) rcsTP$(KBUILD_ARFLAGS) $@ $(lib-y) | ||
| 436 | 429 | ||
| 437 | $(lib-target): $(lib-y) FORCE | 430 | $(lib-target): $(lib-y) FORCE |
| 438 | $(call if_changed,link_l_target) | 431 | $(call if_changed,ar) |
| 439 | 432 | ||
| 440 | targets += $(lib-target) | 433 | targets += $(lib-target) |
| 441 | 434 | ||
| @@ -457,6 +450,10 @@ targets += $(obj)/lib-ksyms.o | |||
| 457 | 450 | ||
| 458 | endif | 451 | endif |
| 459 | 452 | ||
| 453 | # NOTE: | ||
| 454 | # Do not replace $(filter %.o,^) with $(real-prereqs). When a single object | ||
| 455 | # module is turned into a multi object module, $^ will contain header file | ||
| 456 | # dependencies recorded in the .*.cmd file. | ||
| 460 | quiet_cmd_link_multi-m = LD [M] $@ | 457 | quiet_cmd_link_multi-m = LD [M] $@ |
| 461 | cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(filter %.o,$^) $(cmd_secanalysis) | 458 | cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(filter %.o,$^) $(cmd_secanalysis) |
| 462 | 459 | ||
diff --git a/scripts/Makefile.gcc-plugins b/scripts/Makefile.gcc-plugins index 35042d96cf5d..5f7df50cfe7a 100644 --- a/scripts/Makefile.gcc-plugins +++ b/scripts/Makefile.gcc-plugins | |||
| @@ -15,6 +15,8 @@ gcc-plugin-$(CONFIG_GCC_PLUGIN_SANCOV) += sancov_plugin.so | |||
| 15 | gcc-plugin-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) += structleak_plugin.so | 15 | gcc-plugin-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) += structleak_plugin.so |
| 16 | gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_VERBOSE) \ | 16 | gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_VERBOSE) \ |
| 17 | += -fplugin-arg-structleak_plugin-verbose | 17 | += -fplugin-arg-structleak_plugin-verbose |
| 18 | gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF) \ | ||
| 19 | += -fplugin-arg-structleak_plugin-byref | ||
| 18 | gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL) \ | 20 | gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL) \ |
| 19 | += -fplugin-arg-structleak_plugin-byref-all | 21 | += -fplugin-arg-structleak_plugin-byref-all |
| 20 | gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) \ | 22 | gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) \ |
diff --git a/scripts/Makefile.host b/scripts/Makefile.host index 0393f75db4d4..a115259b57e7 100644 --- a/scripts/Makefile.host +++ b/scripts/Makefile.host | |||
| @@ -67,13 +67,15 @@ _hostc_flags = $(KBUILD_HOSTCFLAGS) $(HOST_EXTRACFLAGS) \ | |||
| 67 | _hostcxx_flags = $(KBUILD_HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \ | 67 | _hostcxx_flags = $(KBUILD_HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \ |
| 68 | $(HOSTCXXFLAGS_$(basetarget).o) | 68 | $(HOSTCXXFLAGS_$(basetarget).o) |
| 69 | 69 | ||
| 70 | ifeq ($(KBUILD_SRC),) | ||
| 71 | __hostc_flags = $(_hostc_flags) | 70 | __hostc_flags = $(_hostc_flags) |
| 72 | __hostcxx_flags = $(_hostcxx_flags) | 71 | __hostcxx_flags = $(_hostcxx_flags) |
| 73 | else | 72 | |
| 73 | ifeq ($(KBUILD_EXTMOD),) | ||
| 74 | ifneq ($(KBUILD_SRC),) | ||
| 74 | __hostc_flags = -I$(obj) $(call flags,_hostc_flags) | 75 | __hostc_flags = -I$(obj) $(call flags,_hostc_flags) |
| 75 | __hostcxx_flags = -I$(obj) $(call flags,_hostcxx_flags) | 76 | __hostcxx_flags = -I$(obj) $(call flags,_hostcxx_flags) |
| 76 | endif | 77 | endif |
| 78 | endif | ||
| 77 | 79 | ||
| 78 | hostc_flags = -Wp,-MD,$(depfile) $(__hostc_flags) | 80 | hostc_flags = -Wp,-MD,$(depfile) $(__hostc_flags) |
| 79 | hostcxx_flags = -Wp,-MD,$(depfile) $(__hostcxx_flags) | 81 | hostcxx_flags = -Wp,-MD,$(depfile) $(__hostcxx_flags) |
diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan index 6deabedc67fc..6410bd22fe38 100644 --- a/scripts/Makefile.kasan +++ b/scripts/Makefile.kasan | |||
| @@ -27,14 +27,9 @@ else | |||
| 27 | $(call cc-param,asan-globals=1) \ | 27 | $(call cc-param,asan-globals=1) \ |
| 28 | $(call cc-param,asan-instrumentation-with-call-threshold=$(call_threshold)) \ | 28 | $(call cc-param,asan-instrumentation-with-call-threshold=$(call_threshold)) \ |
| 29 | $(call cc-param,asan-stack=$(CONFIG_KASAN_STACK)) \ | 29 | $(call cc-param,asan-stack=$(CONFIG_KASAN_STACK)) \ |
| 30 | $(call cc-param,asan-use-after-scope=1) \ | ||
| 31 | $(call cc-param,asan-instrument-allocas=1) | 30 | $(call cc-param,asan-instrument-allocas=1) |
| 32 | endif | 31 | endif |
| 33 | 32 | ||
| 34 | ifdef CONFIG_KASAN_EXTRA | ||
| 35 | CFLAGS_KASAN += $(call cc-option, -fsanitize-address-use-after-scope) | ||
| 36 | endif | ||
| 37 | |||
| 38 | endif # CONFIG_KASAN_GENERIC | 33 | endif # CONFIG_KASAN_GENERIC |
| 39 | 34 | ||
| 40 | ifdef CONFIG_KASAN_SW_TAGS | 35 | ifdef CONFIG_KASAN_SW_TAGS |
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 12b88d09c3a4..8a1f64f17740 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
| @@ -137,14 +137,14 @@ _c_flags += $(if $(patsubst n%,, \ | |||
| 137 | $(CFLAGS_KCOV)) | 137 | $(CFLAGS_KCOV)) |
| 138 | endif | 138 | endif |
| 139 | 139 | ||
| 140 | # If building the kernel in a separate objtree expand all occurrences | ||
| 141 | # of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/'). | ||
| 142 | |||
| 143 | ifeq ($(KBUILD_SRC),) | ||
| 144 | __c_flags = $(_c_flags) | 140 | __c_flags = $(_c_flags) |
| 145 | __a_flags = $(_a_flags) | 141 | __a_flags = $(_a_flags) |
| 146 | __cpp_flags = $(_cpp_flags) | 142 | __cpp_flags = $(_cpp_flags) |
| 147 | else | 143 | |
| 144 | # If building the kernel in a separate objtree expand all occurrences | ||
| 145 | # of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/'). | ||
| 146 | ifeq ($(KBUILD_EXTMOD),) | ||
| 147 | ifneq ($(KBUILD_SRC),) | ||
| 148 | 148 | ||
| 149 | # -I$(obj) locates generated .h files | 149 | # -I$(obj) locates generated .h files |
| 150 | # $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files | 150 | # $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files |
| @@ -155,6 +155,7 @@ __c_flags = $(if $(obj),$(call addtree,-I$(src)) -I$(obj)) \ | |||
| 155 | __a_flags = $(call flags,_a_flags) | 155 | __a_flags = $(call flags,_a_flags) |
| 156 | __cpp_flags = $(call flags,_cpp_flags) | 156 | __cpp_flags = $(call flags,_cpp_flags) |
| 157 | endif | 157 | endif |
| 158 | endif | ||
| 158 | 159 | ||
| 159 | c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ | 160 | c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ |
| 160 | -include $(srctree)/include/linux/compiler_types.h \ | 161 | -include $(srctree)/include/linux/compiler_types.h \ |
| @@ -230,7 +231,13 @@ $(obj)/%: $(src)/%_shipped | |||
| 230 | # --------------------------------------------------------------------------- | 231 | # --------------------------------------------------------------------------- |
| 231 | 232 | ||
| 232 | quiet_cmd_ld = LD $@ | 233 | quiet_cmd_ld = LD $@ |
| 233 | cmd_ld = $(LD) $(ld_flags) $(filter-out FORCE,$^) -o $@ | 234 | cmd_ld = $(LD) $(ld_flags) $(real-prereqs) -o $@ |
| 235 | |||
| 236 | # Archive | ||
| 237 | # --------------------------------------------------------------------------- | ||
| 238 | |||
| 239 | quiet_cmd_ar = AR $@ | ||
| 240 | cmd_ar = rm -f $@; $(AR) rcsTP$(KBUILD_ARFLAGS) $@ $(real-prereqs) | ||
| 234 | 241 | ||
| 235 | # Objcopy | 242 | # Objcopy |
| 236 | # --------------------------------------------------------------------------- | 243 | # --------------------------------------------------------------------------- |
| @@ -242,7 +249,7 @@ cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@ | |||
| 242 | # --------------------------------------------------------------------------- | 249 | # --------------------------------------------------------------------------- |
| 243 | 250 | ||
| 244 | quiet_cmd_gzip = GZIP $@ | 251 | quiet_cmd_gzip = GZIP $@ |
| 245 | cmd_gzip = cat $(filter-out FORCE,$^) | gzip -n -f -9 > $@ | 252 | cmd_gzip = cat $(real-prereqs) | gzip -n -f -9 > $@ |
| 246 | 253 | ||
| 247 | # DTC | 254 | # DTC |
| 248 | # --------------------------------------------------------------------------- | 255 | # --------------------------------------------------------------------------- |
| @@ -270,7 +277,7 @@ DTC_FLAGS += $(DTC_FLAGS_$(basetarget)) | |||
| 270 | # Generate an assembly file to wrap the output of the device tree compiler | 277 | # Generate an assembly file to wrap the output of the device tree compiler |
| 271 | quiet_cmd_dt_S_dtb= DTB $@ | 278 | quiet_cmd_dt_S_dtb= DTB $@ |
| 272 | cmd_dt_S_dtb= \ | 279 | cmd_dt_S_dtb= \ |
| 273 | ( \ | 280 | { \ |
| 274 | echo '\#include <asm-generic/vmlinux.lds.h>'; \ | 281 | echo '\#include <asm-generic/vmlinux.lds.h>'; \ |
| 275 | echo '.section .dtb.init.rodata,"a"'; \ | 282 | echo '.section .dtb.init.rodata,"a"'; \ |
| 276 | echo '.balign STRUCT_ALIGNMENT'; \ | 283 | echo '.balign STRUCT_ALIGNMENT'; \ |
| @@ -280,7 +287,7 @@ cmd_dt_S_dtb= \ | |||
| 280 | echo '__dtb_$(subst -,_,$(*F))_end:'; \ | 287 | echo '__dtb_$(subst -,_,$(*F))_end:'; \ |
| 281 | echo '.global __dtb_$(subst -,_,$(*F))_end'; \ | 288 | echo '.global __dtb_$(subst -,_,$(*F))_end'; \ |
| 282 | echo '.balign STRUCT_ALIGNMENT'; \ | 289 | echo '.balign STRUCT_ALIGNMENT'; \ |
| 283 | ) > $@ | 290 | } > $@ |
| 284 | 291 | ||
| 285 | $(obj)/%.dtb.S: $(obj)/%.dtb FORCE | 292 | $(obj)/%.dtb.S: $(obj)/%.dtb FORCE |
| 286 | $(call if_changed,dt_S_dtb) | 293 | $(call if_changed,dt_S_dtb) |
| @@ -320,7 +327,7 @@ dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) | |||
| 320 | # append the size as a 32-bit littleendian number as gzip does. | 327 | # append the size as a 32-bit littleendian number as gzip does. |
| 321 | size_append = printf $(shell \ | 328 | size_append = printf $(shell \ |
| 322 | dec_size=0; \ | 329 | dec_size=0; \ |
| 323 | for F in $1; do \ | 330 | for F in $(real-prereqs); do \ |
| 324 | fsize=$$($(CONFIG_SHELL) $(srctree)/scripts/file-size.sh $$F); \ | 331 | fsize=$$($(CONFIG_SHELL) $(srctree)/scripts/file-size.sh $$F); \ |
| 325 | dec_size=$$(expr $$dec_size + $$fsize); \ | 332 | dec_size=$$(expr $$dec_size + $$fsize); \ |
| 326 | done; \ | 333 | done; \ |
| @@ -334,23 +341,20 @@ printf "%08x\n" $$dec_size | \ | |||
| 334 | ) | 341 | ) |
| 335 | 342 | ||
| 336 | quiet_cmd_bzip2 = BZIP2 $@ | 343 | quiet_cmd_bzip2 = BZIP2 $@ |
| 337 | cmd_bzip2 = (cat $(filter-out FORCE,$^) | \ | 344 | cmd_bzip2 = { cat $(real-prereqs) | bzip2 -9 && $(size_append); } > $@ |
| 338 | bzip2 -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ | ||
| 339 | 345 | ||
| 340 | # Lzma | 346 | # Lzma |
| 341 | # --------------------------------------------------------------------------- | 347 | # --------------------------------------------------------------------------- |
| 342 | 348 | ||
| 343 | quiet_cmd_lzma = LZMA $@ | 349 | quiet_cmd_lzma = LZMA $@ |
| 344 | cmd_lzma = (cat $(filter-out FORCE,$^) | \ | 350 | cmd_lzma = { cat $(real-prereqs) | lzma -9 && $(size_append); } > $@ |
| 345 | lzma -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ | ||
| 346 | 351 | ||
| 347 | quiet_cmd_lzo = LZO $@ | 352 | quiet_cmd_lzo = LZO $@ |
| 348 | cmd_lzo = (cat $(filter-out FORCE,$^) | \ | 353 | cmd_lzo = { cat $(real-prereqs) | lzop -9 && $(size_append); } > $@ |
| 349 | lzop -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ | ||
| 350 | 354 | ||
| 351 | quiet_cmd_lz4 = LZ4 $@ | 355 | quiet_cmd_lz4 = LZ4 $@ |
| 352 | cmd_lz4 = (cat $(filter-out FORCE,$^) | \ | 356 | cmd_lz4 = { cat $(real-prereqs) | lz4c -l -c1 stdin stdout && \ |
| 353 | lz4c -l -c1 stdin stdout && $(call size_append, $(filter-out FORCE,$^))) > $@ | 357 | $(size_append); } > $@ |
| 354 | 358 | ||
| 355 | # U-Boot mkimage | 359 | # U-Boot mkimage |
| 356 | # --------------------------------------------------------------------------- | 360 | # --------------------------------------------------------------------------- |
| @@ -392,13 +396,11 @@ quiet_cmd_uimage = UIMAGE $@ | |||
| 392 | # big dictionary would increase the memory usage too much in the multi-call | 396 | # big dictionary would increase the memory usage too much in the multi-call |
| 393 | # decompression mode. A BCJ filter isn't used either. | 397 | # decompression mode. A BCJ filter isn't used either. |
| 394 | quiet_cmd_xzkern = XZKERN $@ | 398 | quiet_cmd_xzkern = XZKERN $@ |
| 395 | cmd_xzkern = (cat $(filter-out FORCE,$^) | \ | 399 | cmd_xzkern = { cat $(real-prereqs) | sh $(srctree)/scripts/xz_wrap.sh && \ |
| 396 | sh $(srctree)/scripts/xz_wrap.sh && \ | 400 | $(size_append); } > $@ |
| 397 | $(call size_append, $(filter-out FORCE,$^))) > $@ | ||
| 398 | 401 | ||
| 399 | quiet_cmd_xzmisc = XZMISC $@ | 402 | quiet_cmd_xzmisc = XZMISC $@ |
| 400 | cmd_xzmisc = (cat $(filter-out FORCE,$^) | \ | 403 | cmd_xzmisc = cat $(real-prereqs) | xz --check=crc32 --lzma2=dict=1MiB > $@ |
| 401 | xz --check=crc32 --lzma2=dict=1MiB) > $@ | ||
| 402 | 404 | ||
| 403 | # ASM offsets | 405 | # ASM offsets |
| 404 | # --------------------------------------------------------------------------- | 406 | # --------------------------------------------------------------------------- |
diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst index ff5ca9817a85..0dae402661f3 100644 --- a/scripts/Makefile.modinst +++ b/scripts/Makefile.modinst | |||
| @@ -23,7 +23,7 @@ quiet_cmd_modules_install = INSTALL $@ | |||
| 23 | mkdir -p $(2) ; \ | 23 | mkdir -p $(2) ; \ |
| 24 | cp $@ $(2) ; \ | 24 | cp $@ $(2) ; \ |
| 25 | $(mod_strip_cmd) $(2)/$(notdir $@) ; \ | 25 | $(mod_strip_cmd) $(2)/$(notdir $@) ; \ |
| 26 | $(mod_sign_cmd) $(2)/$(notdir $@) $(patsubst %,|| true,$(KBUILD_EXTMOD)) && \ | 26 | $(mod_sign_cmd) $(2)/$(notdir $@) $(patsubst %,|| true,$(KBUILD_EXTMOD)) ; \ |
| 27 | $(mod_compress_cmd) $(2)/$(notdir $@) | 27 | $(mod_compress_cmd) $(2)/$(notdir $@) |
| 28 | 28 | ||
| 29 | # Modules built outside the kernel source tree go into extra by default | 29 | # Modules built outside the kernel source tree go into extra by default |
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 7d4af0d0accb..6b7f354f189a 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost | |||
| @@ -77,7 +77,6 @@ modpost = scripts/mod/modpost \ | |||
| 77 | $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \ | 77 | $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \ |
| 78 | $(if $(KBUILD_EXTRA_SYMBOLS), $(patsubst %, -e %,$(KBUILD_EXTRA_SYMBOLS))) \ | 78 | $(if $(KBUILD_EXTRA_SYMBOLS), $(patsubst %, -e %,$(KBUILD_EXTRA_SYMBOLS))) \ |
| 79 | $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ | 79 | $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ |
| 80 | $(if $(CONFIG_DEBUG_SECTION_MISMATCH),,-S) \ | ||
| 81 | $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \ | 80 | $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \ |
| 82 | $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) | 81 | $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) |
| 83 | 82 | ||
| @@ -122,7 +121,7 @@ quiet_cmd_ld_ko_o = LD [M] $@ | |||
| 122 | cmd_ld_ko_o = \ | 121 | cmd_ld_ko_o = \ |
| 123 | $(LD) -r $(KBUILD_LDFLAGS) \ | 122 | $(LD) -r $(KBUILD_LDFLAGS) \ |
| 124 | $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \ | 123 | $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \ |
| 125 | -o $@ $(filter-out FORCE,$^) ; \ | 124 | -o $@ $(real-prereqs) ; \ |
| 126 | $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true) | 125 | $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true) |
| 127 | 126 | ||
| 128 | $(modules): %.ko :%.o %.mod.o FORCE | 127 | $(modules): %.ko :%.o %.mod.o FORCE |
diff --git a/scripts/adjust_autoksyms.sh b/scripts/adjust_autoksyms.sh index 6e6d63957da3..84bf6b500815 100755 --- a/scripts/adjust_autoksyms.sh +++ b/scripts/adjust_autoksyms.sh | |||
| @@ -39,14 +39,7 @@ case "$KBUILD_VERBOSE" in | |||
| 39 | esac | 39 | esac |
| 40 | 40 | ||
| 41 | # We need access to CONFIG_ symbols | 41 | # We need access to CONFIG_ symbols |
| 42 | case "${KCONFIG_CONFIG}" in | 42 | . include/config/auto.conf |
| 43 | */*) | ||
| 44 | . "${KCONFIG_CONFIG}" | ||
| 45 | ;; | ||
| 46 | *) | ||
| 47 | # Force using a file from the current directory | ||
| 48 | . "./${KCONFIG_CONFIG}" | ||
| 49 | esac | ||
| 50 | 43 | ||
| 51 | # Generate a new ksym list file with symbols needed by the current | 44 | # Generate a new ksym list file with symbols needed by the current |
| 52 | # set of modules. | 45 | # set of modules. |
diff --git a/scripts/atomic/atomic-tbl.sh b/scripts/atomic/atomic-tbl.sh new file mode 100755 index 000000000000..81d5c32039dd --- /dev/null +++ b/scripts/atomic/atomic-tbl.sh | |||
| @@ -0,0 +1,186 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # SPDX-License-Identifier: GPL-2.0 | ||
| 3 | # helpers for dealing with atomics.tbl | ||
| 4 | |||
| 5 | #meta_in(meta, match) | ||
| 6 | meta_in() | ||
| 7 | { | ||
| 8 | case "$1" in | ||
| 9 | [$2]) return 0;; | ||
| 10 | esac | ||
| 11 | |||
| 12 | return 1 | ||
| 13 | } | ||
| 14 | |||
| 15 | #meta_has_ret(meta) | ||
| 16 | meta_has_ret() | ||
| 17 | { | ||
| 18 | meta_in "$1" "bBiIfFlR" | ||
| 19 | } | ||
| 20 | |||
| 21 | #meta_has_acquire(meta) | ||
| 22 | meta_has_acquire() | ||
| 23 | { | ||
| 24 | meta_in "$1" "BFIlR" | ||
| 25 | } | ||
| 26 | |||
| 27 | #meta_has_release(meta) | ||
| 28 | meta_has_release() | ||
| 29 | { | ||
| 30 | meta_in "$1" "BFIRs" | ||
| 31 | } | ||
| 32 | |||
| 33 | #meta_has_relaxed(meta) | ||
| 34 | meta_has_relaxed() | ||
| 35 | { | ||
| 36 | meta_in "$1" "BFIR" | ||
| 37 | } | ||
| 38 | |||
| 39 | #find_fallback_template(pfx, name, sfx, order) | ||
| 40 | find_fallback_template() | ||
| 41 | { | ||
| 42 | local pfx="$1"; shift | ||
| 43 | local name="$1"; shift | ||
| 44 | local sfx="$1"; shift | ||
| 45 | local order="$1"; shift | ||
| 46 | |||
| 47 | local base="" | ||
| 48 | local file="" | ||
| 49 | |||
| 50 | # We may have fallbacks for a specific case (e.g. read_acquire()), or | ||
| 51 | # an entire class, e.g. *inc*(). | ||
| 52 | # | ||
| 53 | # Start at the most specific, and fall back to the most general. Once | ||
| 54 | # we find a specific fallback, don't bother looking for more. | ||
| 55 | for base in "${pfx}${name}${sfx}${order}" "${name}"; do | ||
| 56 | file="${ATOMICDIR}/fallbacks/${base}" | ||
| 57 | |||
| 58 | if [ -f "${file}" ]; then | ||
| 59 | printf "${file}" | ||
| 60 | break | ||
| 61 | fi | ||
| 62 | done | ||
| 63 | } | ||
| 64 | |||
| 65 | #gen_ret_type(meta, int) | ||
| 66 | gen_ret_type() { | ||
| 67 | local meta="$1"; shift | ||
| 68 | local int="$1"; shift | ||
| 69 | |||
| 70 | case "${meta}" in | ||
| 71 | [sv]) printf "void";; | ||
| 72 | [bB]) printf "bool";; | ||
| 73 | [aiIfFlR]) printf "${int}";; | ||
| 74 | esac | ||
| 75 | } | ||
| 76 | |||
| 77 | #gen_ret_stmt(meta) | ||
| 78 | gen_ret_stmt() | ||
| 79 | { | ||
| 80 | if meta_has_ret "${meta}"; then | ||
| 81 | printf "return "; | ||
| 82 | fi | ||
| 83 | } | ||
| 84 | |||
| 85 | # gen_param_name(arg) | ||
| 86 | gen_param_name() | ||
| 87 | { | ||
| 88 | # strip off the leading 'c' for 'cv' | ||
| 89 | local name="${1#c}" | ||
| 90 | printf "${name#*:}" | ||
| 91 | } | ||
| 92 | |||
| 93 | # gen_param_type(arg, int, atomic) | ||
| 94 | gen_param_type() | ||
| 95 | { | ||
| 96 | local type="${1%%:*}"; shift | ||
| 97 | local int="$1"; shift | ||
| 98 | local atomic="$1"; shift | ||
| 99 | |||
| 100 | case "${type}" in | ||
| 101 | i) type="${int} ";; | ||
| 102 | p) type="${int} *";; | ||
| 103 | v) type="${atomic}_t *";; | ||
| 104 | cv) type="const ${atomic}_t *";; | ||
| 105 | esac | ||
| 106 | |||
| 107 | printf "${type}" | ||
| 108 | } | ||
| 109 | |||
| 110 | #gen_param(arg, int, atomic) | ||
| 111 | gen_param() | ||
| 112 | { | ||
| 113 | local arg="$1"; shift | ||
| 114 | local int="$1"; shift | ||
| 115 | local atomic="$1"; shift | ||
| 116 | local name="$(gen_param_name "${arg}")" | ||
| 117 | local type="$(gen_param_type "${arg}" "${int}" "${atomic}")" | ||
| 118 | |||
| 119 | printf "${type}${name}" | ||
| 120 | } | ||
| 121 | |||
| 122 | #gen_params(int, atomic, arg...) | ||
| 123 | gen_params() | ||
| 124 | { | ||
| 125 | local int="$1"; shift | ||
| 126 | local atomic="$1"; shift | ||
| 127 | |||
| 128 | while [ "$#" -gt 0 ]; do | ||
| 129 | gen_param "$1" "${int}" "${atomic}" | ||
| 130 | [ "$#" -gt 1 ] && printf ", " | ||
| 131 | shift; | ||
| 132 | done | ||
| 133 | } | ||
| 134 | |||
| 135 | #gen_args(arg...) | ||
| 136 | gen_args() | ||
| 137 | { | ||
| 138 | while [ "$#" -gt 0 ]; do | ||
| 139 | printf "$(gen_param_name "$1")" | ||
| 140 | [ "$#" -gt 1 ] && printf ", " | ||
| 141 | shift; | ||
| 142 | done | ||
| 143 | } | ||
| 144 | |||
| 145 | #gen_proto_order_variants(meta, pfx, name, sfx, ...) | ||
| 146 | gen_proto_order_variants() | ||
| 147 | { | ||
| 148 | local meta="$1"; shift | ||
| 149 | local pfx="$1"; shift | ||
| 150 | local name="$1"; shift | ||
| 151 | local sfx="$1"; shift | ||
| 152 | |||
| 153 | gen_proto_order_variant "${meta}" "${pfx}" "${name}" "${sfx}" "" "$@" | ||
| 154 | |||
| 155 | if meta_has_acquire "${meta}"; then | ||
| 156 | gen_proto_order_variant "${meta}" "${pfx}" "${name}" "${sfx}" "_acquire" "$@" | ||
| 157 | fi | ||
| 158 | if meta_has_release "${meta}"; then | ||
| 159 | gen_proto_order_variant "${meta}" "${pfx}" "${name}" "${sfx}" "_release" "$@" | ||
| 160 | fi | ||
| 161 | if meta_has_relaxed "${meta}"; then | ||
| 162 | gen_proto_order_variant "${meta}" "${pfx}" "${name}" "${sfx}" "_relaxed" "$@" | ||
| 163 | fi | ||
| 164 | } | ||
| 165 | |||
| 166 | #gen_proto_variants(meta, name, ...) | ||
| 167 | gen_proto_variants() | ||
| 168 | { | ||
| 169 | local meta="$1"; shift | ||
| 170 | local name="$1"; shift | ||
| 171 | local pfx="" | ||
| 172 | local sfx="" | ||
| 173 | |||
| 174 | meta_in "${meta}" "fF" && pfx="fetch_" | ||
| 175 | meta_in "${meta}" "R" && sfx="_return" | ||
| 176 | |||
| 177 | gen_proto_order_variants "${meta}" "${pfx}" "${name}" "${sfx}" "$@" | ||
| 178 | } | ||
| 179 | |||
| 180 | #gen_proto(meta, ...) | ||
| 181 | gen_proto() { | ||
| 182 | local meta="$1"; shift | ||
| 183 | for m in $(echo "${meta}" | grep -o .); do | ||
| 184 | gen_proto_variants "${m}" "$@" | ||
| 185 | done | ||
| 186 | } | ||
diff --git a/scripts/atomic/atomics.tbl b/scripts/atomic/atomics.tbl new file mode 100755 index 000000000000..fbee2f6190d9 --- /dev/null +++ b/scripts/atomic/atomics.tbl | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | # name meta args... | ||
| 2 | # | ||
| 3 | # Where meta contains a string of variants to generate. | ||
| 4 | # Upper-case implies _{acquire,release,relaxed} variants. | ||
| 5 | # Valid meta values are: | ||
| 6 | # * B/b - bool: returns bool | ||
| 7 | # * v - void: returns void | ||
| 8 | # * I/i - int: returns base type | ||
| 9 | # * R - return: returns base type (has _return variants) | ||
| 10 | # * F/f - fetch: returns base type (has fetch_ variants) | ||
| 11 | # * l - load: returns base type (has _acquire order variant) | ||
| 12 | # * s - store: returns void (has _release order variant) | ||
| 13 | # | ||
| 14 | # Where args contains list of type[:name], where type is: | ||
| 15 | # * cv - const pointer to atomic base type (atomic_t/atomic64_t/atomic_long_t) | ||
| 16 | # * v - pointer to atomic base type (atomic_t/atomic64_t/atomic_long_t) | ||
| 17 | # * i - base type (int/s64/long) | ||
| 18 | # * p - pointer to base type (int/s64/long) | ||
| 19 | # | ||
| 20 | read l cv | ||
| 21 | set s v i | ||
| 22 | add vRF i v | ||
| 23 | sub vRF i v | ||
| 24 | inc vRF v | ||
| 25 | dec vRF v | ||
| 26 | and vF i v | ||
| 27 | andnot vF i v | ||
| 28 | or vF i v | ||
| 29 | xor vF i v | ||
| 30 | xchg I v i | ||
| 31 | cmpxchg I v i:old i:new | ||
| 32 | try_cmpxchg B v p:old i:new | ||
| 33 | sub_and_test b i v | ||
| 34 | dec_and_test b v | ||
| 35 | inc_and_test b v | ||
| 36 | add_negative b i v | ||
| 37 | add_unless fb v i:a i:u | ||
| 38 | inc_not_zero b v | ||
| 39 | inc_unless_negative b v | ||
| 40 | dec_unless_positive b v | ||
| 41 | dec_if_positive i v | ||
diff --git a/scripts/atomic/check-atomics.sh b/scripts/atomic/check-atomics.sh new file mode 100755 index 000000000000..cfa0c2f71c84 --- /dev/null +++ b/scripts/atomic/check-atomics.sh | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # SPDX-License-Identifier: GPL-2.0 | ||
| 3 | # | ||
| 4 | # Check if atomic headers are up-to-date | ||
| 5 | |||
| 6 | ATOMICDIR=$(dirname $0) | ||
| 7 | ATOMICTBL=${ATOMICDIR}/atomics.tbl | ||
| 8 | LINUXDIR=${ATOMICDIR}/../.. | ||
| 9 | |||
| 10 | echo '' | sha1sum - > /dev/null 2>&1 | ||
| 11 | if [ $? -ne 0 ]; then | ||
| 12 | printf "sha1sum not available, skipping atomic header checks.\n" | ||
| 13 | exit 0 | ||
| 14 | fi | ||
| 15 | |||
| 16 | cat <<EOF | | ||
| 17 | asm-generic/atomic-instrumented.h | ||
| 18 | asm-generic/atomic-long.h | ||
| 19 | linux/atomic-fallback.h | ||
| 20 | EOF | ||
| 21 | while read header; do | ||
| 22 | OLDSUM="$(tail -n 1 ${LINUXDIR}/include/${header})" | ||
| 23 | OLDSUM="${OLDSUM#// }" | ||
| 24 | |||
| 25 | NEWSUM="$(head -n -1 ${LINUXDIR}/include/${header} | sha1sum)" | ||
| 26 | NEWSUM="${NEWSUM%% *}" | ||
| 27 | |||
| 28 | if [ "${OLDSUM}" != "${NEWSUM}" ]; then | ||
| 29 | printf "warning: generated include/${header} has been modified.\n" | ||
| 30 | fi | ||
| 31 | done | ||
| 32 | |||
| 33 | exit 0 | ||
diff --git a/scripts/atomic/fallbacks/acquire b/scripts/atomic/fallbacks/acquire new file mode 100755 index 000000000000..e38871e64db6 --- /dev/null +++ b/scripts/atomic/fallbacks/acquire | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | cat <<EOF | ||
| 2 | static inline ${ret} | ||
| 3 | ${atomic}_${pfx}${name}${sfx}_acquire(${params}) | ||
| 4 | { | ||
| 5 | ${ret} ret = ${atomic}_${pfx}${name}${sfx}_relaxed(${args}); | ||
| 6 | __atomic_acquire_fence(); | ||
| 7 | return ret; | ||
| 8 | } | ||
| 9 | EOF | ||
diff --git a/scripts/atomic/fallbacks/add_negative b/scripts/atomic/fallbacks/add_negative new file mode 100755 index 000000000000..e6f4815637de --- /dev/null +++ b/scripts/atomic/fallbacks/add_negative | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | cat <<EOF | ||
| 2 | /** | ||
| 3 | * ${atomic}_add_negative - add and test if negative | ||
| 4 | * @i: integer value to add | ||
| 5 | * @v: pointer of type ${atomic}_t | ||
| 6 | * | ||
| 7 | * Atomically adds @i to @v and returns true | ||
| 8 | * if the result is negative, or false when | ||
| 9 | * result is greater than or equal to zero. | ||
| 10 | */ | ||
| 11 | static inline bool | ||
| 12 | ${atomic}_add_negative(${int} i, ${atomic}_t *v) | ||
| 13 | { | ||
| 14 | return ${atomic}_add_return(i, v) < 0; | ||
| 15 | } | ||
| 16 | EOF | ||
diff --git a/scripts/atomic/fallbacks/add_unless b/scripts/atomic/fallbacks/add_unless new file mode 100755 index 000000000000..792533885fbf --- /dev/null +++ b/scripts/atomic/fallbacks/add_unless | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | cat << EOF | ||
| 2 | /** | ||
| 3 | * ${atomic}_add_unless - add unless the number is already a given value | ||
| 4 | * @v: pointer of type ${atomic}_t | ||
| 5 | * @a: the amount to add to v... | ||
| 6 | * @u: ...unless v is equal to u. | ||
| 7 | * | ||
| 8 | * Atomically adds @a to @v, if @v was not already @u. | ||
| 9 | * Returns true if the addition was done. | ||
| 10 | */ | ||
| 11 | static inline bool | ||
| 12 | ${atomic}_add_unless(${atomic}_t *v, ${int} a, ${int} u) | ||
| 13 | { | ||
| 14 | return ${atomic}_fetch_add_unless(v, a, u) != u; | ||
| 15 | } | ||
| 16 | EOF | ||
diff --git a/scripts/atomic/fallbacks/andnot b/scripts/atomic/fallbacks/andnot new file mode 100755 index 000000000000..9f3a3216b5e3 --- /dev/null +++ b/scripts/atomic/fallbacks/andnot | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | cat <<EOF | ||
| 2 | static inline ${ret} | ||
| 3 | ${atomic}_${pfx}andnot${sfx}${order}(${int} i, ${atomic}_t *v) | ||
| 4 | { | ||
| 5 | ${retstmt}${atomic}_${pfx}and${sfx}${order}(~i, v); | ||
| 6 | } | ||
| 7 | EOF | ||
diff --git a/scripts/atomic/fallbacks/dec b/scripts/atomic/fallbacks/dec new file mode 100755 index 000000000000..10bbc82be31d --- /dev/null +++ b/scripts/atomic/fallbacks/dec | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | cat <<EOF | ||
| 2 | static inline ${ret} | ||
| 3 | ${atomic}_${pfx}dec${sfx}${order}(${atomic}_t *v) | ||
| 4 | { | ||
| 5 | ${retstmt}${atomic}_${pfx}sub${sfx}${order}(1, v); | ||
| 6 | } | ||
| 7 | EOF | ||
diff --git a/scripts/atomic/fallbacks/dec_and_test b/scripts/atomic/fallbacks/dec_and_test new file mode 100755 index 000000000000..0ce7103b3df2 --- /dev/null +++ b/scripts/atomic/fallbacks/dec_and_test | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | cat <<EOF | ||
| 2 | /** | ||
| 3 | * ${atomic}_dec_and_test - decrement and test | ||
| 4 | * @v: pointer of type ${atomic}_t | ||
| 5 | * | ||
| 6 | * Atomically decrements @v by 1 and | ||
| 7 | * returns true if the result is 0, or false for all other | ||
| 8 | * cases. | ||
| 9 | */ | ||
| 10 | static inline bool | ||
| 11 | ${atomic}_dec_and_test(${atomic}_t *v) | ||
| 12 | { | ||
| 13 | return ${atomic}_dec_return(v) == 0; | ||
| 14 | } | ||
| 15 | EOF | ||
diff --git a/scripts/atomic/fallbacks/dec_if_positive b/scripts/atomic/fallbacks/dec_if_positive new file mode 100755 index 000000000000..c52eacec43c8 --- /dev/null +++ b/scripts/atomic/fallbacks/dec_if_positive | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | cat <<EOF | ||
| 2 | static inline ${ret} | ||
| 3 | ${atomic}_dec_if_positive(${atomic}_t *v) | ||
| 4 | { | ||
| 5 | ${int} dec, c = ${atomic}_read(v); | ||
| 6 | |||
| 7 | do { | ||
| 8 | dec = c - 1; | ||
| 9 | if (unlikely(dec < 0)) | ||
| 10 | break; | ||
| 11 | } while (!${atomic}_try_cmpxchg(v, &c, dec)); | ||
| 12 | |||
| 13 | return dec; | ||
| 14 | } | ||
| 15 | EOF | ||
diff --git a/scripts/atomic/fallbacks/dec_unless_positive b/scripts/atomic/fallbacks/dec_unless_positive new file mode 100755 index 000000000000..8a2578f14268 --- /dev/null +++ b/scripts/atomic/fallbacks/dec_unless_positive | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | cat <<EOF | ||
| 2 | static inline bool | ||
| 3 | ${atomic}_dec_unless_positive(${atomic}_t *v) | ||
| 4 | { | ||
| 5 | ${int} c = ${atomic}_read(v); | ||
| 6 | |||
| 7 | do { | ||
| 8 | if (unlikely(c > 0)) | ||
| 9 | return false; | ||
| 10 | } while (!${atomic}_try_cmpxchg(v, &c, c - 1)); | ||
| 11 | |||
| 12 | return true; | ||
| 13 | } | ||
| 14 | EOF | ||
diff --git a/scripts/atomic/fallbacks/fence b/scripts/atomic/fallbacks/fence new file mode 100755 index 000000000000..82f68fa6931a --- /dev/null +++ b/scripts/atomic/fallbacks/fence | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | cat <<EOF | ||
| 2 | static inline ${ret} | ||
| 3 | ${atomic}_${pfx}${name}${sfx}(${params}) | ||
| 4 | { | ||
| 5 | ${ret} ret; | ||
| 6 | __atomic_pre_full_fence(); | ||
| 7 | ret = ${atomic}_${pfx}${name}${sfx}_relaxed(${args}); | ||
| 8 | __atomic_post_full_fence(); | ||
| 9 | return ret; | ||
| 10 | } | ||
| 11 | EOF | ||
diff --git a/scripts/atomic/fallbacks/fetch_add_unless b/scripts/atomic/fallbacks/fetch_add_unless new file mode 100755 index 000000000000..d2c091db7eae --- /dev/null +++ b/scripts/atomic/fallbacks/fetch_add_unless | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | cat << EOF | ||
| 2 | /** | ||
| 3 | * ${atomic}_fetch_add_unless - add unless the number is already a given value | ||
| 4 | * @v: pointer of type ${atomic}_t | ||
| 5 | * @a: the amount to add to v... | ||
| 6 | * @u: ...unless v is equal to u. | ||
| 7 | * | ||
| 8 | * Atomically adds @a to @v, so long as @v was not already @u. | ||
| 9 | * Returns original value of @v | ||
| 10 | */ | ||
| 11 | static inline ${int} | ||
| 12 | ${atomic}_fetch_add_unless(${atomic}_t *v, ${int} a, ${int} u) | ||
| 13 | { | ||
| 14 | ${int} c = ${atomic}_read(v); | ||
| 15 | |||
| 16 | do { | ||
| 17 | if (unlikely(c == u)) | ||
| 18 | break; | ||
| 19 | } while (!${atomic}_try_cmpxchg(v, &c, c + a)); | ||
| 20 | |||
| 21 | return c; | ||
| 22 | } | ||
| 23 | EOF | ||
diff --git a/scripts/atomic/fallbacks/inc b/scripts/atomic/fallbacks/inc new file mode 100755 index 000000000000..f866b3ad2353 --- /dev/null +++ b/scripts/atomic/fallbacks/inc | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | cat <<EOF | ||
| 2 | static inline ${ret} | ||
| 3 | ${atomic}_${pfx}inc${sfx}${order}(${atomic}_t *v) | ||
| 4 | { | ||
| 5 | ${retstmt}${atomic}_${pfx}add${sfx}${order}(1, v); | ||
| 6 | } | ||
| 7 | EOF | ||
diff --git a/scripts/atomic/fallbacks/inc_and_test b/scripts/atomic/fallbacks/inc_and_test new file mode 100755 index 000000000000..4e2068869f7e --- /dev/null +++ b/scripts/atomic/fallbacks/inc_and_test | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | cat <<EOF | ||
| 2 | /** | ||
| 3 | * ${atomic}_inc_and_test - increment and test | ||
| 4 | * @v: pointer of type ${atomic}_t | ||
| 5 | * | ||
| 6 | * Atomically increments @v by 1 | ||
| 7 | * and returns true if the result is zero, or false for all | ||
| 8 | * other cases. | ||
| 9 | */ | ||
| 10 | static inline bool | ||
| 11 | ${atomic}_inc_and_test(${atomic}_t *v) | ||
| 12 | { | ||
| 13 | return ${atomic}_inc_return(v) == 0; | ||
| 14 | } | ||
| 15 | EOF | ||
diff --git a/scripts/atomic/fallbacks/inc_not_zero b/scripts/atomic/fallbacks/inc_not_zero new file mode 100755 index 000000000000..a7c45c8d107c --- /dev/null +++ b/scripts/atomic/fallbacks/inc_not_zero | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | cat <<EOF | ||
| 2 | /** | ||
| 3 | * ${atomic}_inc_not_zero - increment unless the number is zero | ||
| 4 | * @v: pointer of type ${atomic}_t | ||
| 5 | * | ||
| 6 | * Atomically increments @v by 1, if @v is non-zero. | ||
| 7 | * Returns true if the increment was done. | ||
| 8 | */ | ||
| 9 | static inline bool | ||
| 10 | ${atomic}_inc_not_zero(${atomic}_t *v) | ||
| 11 | { | ||
| 12 | return ${atomic}_add_unless(v, 1, 0); | ||
| 13 | } | ||
| 14 | EOF | ||
diff --git a/scripts/atomic/fallbacks/inc_unless_negative b/scripts/atomic/fallbacks/inc_unless_negative new file mode 100755 index 000000000000..0c266e71dbd4 --- /dev/null +++ b/scripts/atomic/fallbacks/inc_unless_negative | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | cat <<EOF | ||
| 2 | static inline bool | ||
| 3 | ${atomic}_inc_unless_negative(${atomic}_t *v) | ||
| 4 | { | ||
| 5 | ${int} c = ${atomic}_read(v); | ||
| 6 | |||
| 7 | do { | ||
| 8 | if (unlikely(c < 0)) | ||
| 9 | return false; | ||
| 10 | } while (!${atomic}_try_cmpxchg(v, &c, c + 1)); | ||
| 11 | |||
| 12 | return true; | ||
| 13 | } | ||
| 14 | EOF | ||
diff --git a/scripts/atomic/fallbacks/read_acquire b/scripts/atomic/fallbacks/read_acquire new file mode 100755 index 000000000000..75863b5203f7 --- /dev/null +++ b/scripts/atomic/fallbacks/read_acquire | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | cat <<EOF | ||
| 2 | static inline ${ret} | ||
| 3 | ${atomic}_read_acquire(const ${atomic}_t *v) | ||
| 4 | { | ||
| 5 | return smp_load_acquire(&(v)->counter); | ||
| 6 | } | ||
| 7 | EOF | ||
diff --git a/scripts/atomic/fallbacks/release b/scripts/atomic/fallbacks/release new file mode 100755 index 000000000000..3f628a3802d9 --- /dev/null +++ b/scripts/atomic/fallbacks/release | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | cat <<EOF | ||
| 2 | static inline ${ret} | ||
| 3 | ${atomic}_${pfx}${name}${sfx}_release(${params}) | ||
| 4 | { | ||
| 5 | __atomic_release_fence(); | ||
| 6 | ${retstmt}${atomic}_${pfx}${name}${sfx}_relaxed(${args}); | ||
| 7 | } | ||
| 8 | EOF | ||
diff --git a/scripts/atomic/fallbacks/set_release b/scripts/atomic/fallbacks/set_release new file mode 100755 index 000000000000..45bb5e0cfc08 --- /dev/null +++ b/scripts/atomic/fallbacks/set_release | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | cat <<EOF | ||
| 2 | static inline void | ||
| 3 | ${atomic}_set_release(${atomic}_t *v, ${int} i) | ||
| 4 | { | ||
| 5 | smp_store_release(&(v)->counter, i); | ||
| 6 | } | ||
| 7 | EOF | ||
diff --git a/scripts/atomic/fallbacks/sub_and_test b/scripts/atomic/fallbacks/sub_and_test new file mode 100755 index 000000000000..289ef17a2d7a --- /dev/null +++ b/scripts/atomic/fallbacks/sub_and_test | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | cat <<EOF | ||
| 2 | /** | ||
| 3 | * ${atomic}_sub_and_test - subtract value from variable and test result | ||
| 4 | * @i: integer value to subtract | ||
| 5 | * @v: pointer of type ${atomic}_t | ||
| 6 | * | ||
| 7 | * Atomically subtracts @i from @v and returns | ||
| 8 | * true if the result is zero, or false for all | ||
| 9 | * other cases. | ||
| 10 | */ | ||
| 11 | static inline bool | ||
| 12 | ${atomic}_sub_and_test(${int} i, ${atomic}_t *v) | ||
| 13 | { | ||
| 14 | return ${atomic}_sub_return(i, v) == 0; | ||
| 15 | } | ||
| 16 | EOF | ||
diff --git a/scripts/atomic/fallbacks/try_cmpxchg b/scripts/atomic/fallbacks/try_cmpxchg new file mode 100755 index 000000000000..4ed85e2f5378 --- /dev/null +++ b/scripts/atomic/fallbacks/try_cmpxchg | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | cat <<EOF | ||
| 2 | static inline bool | ||
| 3 | ${atomic}_try_cmpxchg${order}(${atomic}_t *v, ${int} *old, ${int} new) | ||
| 4 | { | ||
| 5 | ${int} r, o = *old; | ||
| 6 | r = ${atomic}_cmpxchg${order}(v, o, new); | ||
| 7 | if (unlikely(r != o)) | ||
| 8 | *old = r; | ||
| 9 | return likely(r == o); | ||
| 10 | } | ||
| 11 | EOF | ||
diff --git a/scripts/atomic/gen-atomic-fallback.sh b/scripts/atomic/gen-atomic-fallback.sh new file mode 100755 index 000000000000..1bd7c1707633 --- /dev/null +++ b/scripts/atomic/gen-atomic-fallback.sh | |||
| @@ -0,0 +1,181 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # SPDX-License-Identifier: GPL-2.0 | ||
| 3 | |||
| 4 | ATOMICDIR=$(dirname $0) | ||
| 5 | |||
| 6 | . ${ATOMICDIR}/atomic-tbl.sh | ||
| 7 | |||
| 8 | #gen_template_fallback(template, meta, pfx, name, sfx, order, atomic, int, args...) | ||
| 9 | gen_template_fallback() | ||
| 10 | { | ||
| 11 | local template="$1"; shift | ||
| 12 | local meta="$1"; shift | ||
| 13 | local pfx="$1"; shift | ||
| 14 | local name="$1"; shift | ||
| 15 | local sfx="$1"; shift | ||
| 16 | local order="$1"; shift | ||
| 17 | local atomic="$1"; shift | ||
| 18 | local int="$1"; shift | ||
| 19 | |||
| 20 | local atomicname="${atomic}_${pfx}${name}${sfx}${order}" | ||
| 21 | |||
| 22 | local ret="$(gen_ret_type "${meta}" "${int}")" | ||
| 23 | local retstmt="$(gen_ret_stmt "${meta}")" | ||
| 24 | local params="$(gen_params "${int}" "${atomic}" "$@")" | ||
| 25 | local args="$(gen_args "$@")" | ||
| 26 | |||
| 27 | if [ ! -z "${template}" ]; then | ||
| 28 | printf "#ifndef ${atomicname}\n" | ||
| 29 | . ${template} | ||
| 30 | printf "#define ${atomicname} ${atomicname}\n" | ||
| 31 | printf "#endif\n\n" | ||
| 32 | fi | ||
| 33 | } | ||
| 34 | |||
| 35 | #gen_proto_fallback(meta, pfx, name, sfx, order, atomic, int, args...) | ||
| 36 | gen_proto_fallback() | ||
| 37 | { | ||
| 38 | local meta="$1"; shift | ||
| 39 | local pfx="$1"; shift | ||
| 40 | local name="$1"; shift | ||
| 41 | local sfx="$1"; shift | ||
| 42 | local order="$1"; shift | ||
| 43 | |||
| 44 | local tmpl="$(find_fallback_template "${pfx}" "${name}" "${sfx}" "${order}")" | ||
| 45 | gen_template_fallback "${tmpl}" "${meta}" "${pfx}" "${name}" "${sfx}" "${order}" "$@" | ||
| 46 | } | ||
| 47 | |||
| 48 | #gen_basic_fallbacks(basename) | ||
| 49 | gen_basic_fallbacks() | ||
| 50 | { | ||
| 51 | local basename="$1"; shift | ||
| 52 | cat << EOF | ||
| 53 | #define ${basename}_acquire ${basename} | ||
| 54 | #define ${basename}_release ${basename} | ||
| 55 | #define ${basename}_relaxed ${basename} | ||
| 56 | EOF | ||
| 57 | } | ||
| 58 | |||
| 59 | #gen_proto_order_variants(meta, pfx, name, sfx, atomic, int, args...) | ||
| 60 | gen_proto_order_variants() | ||
| 61 | { | ||
| 62 | local meta="$1"; shift | ||
| 63 | local pfx="$1"; shift | ||
| 64 | local name="$1"; shift | ||
| 65 | local sfx="$1"; shift | ||
| 66 | local atomic="$1" | ||
| 67 | |||
| 68 | local basename="${atomic}_${pfx}${name}${sfx}" | ||
| 69 | |||
| 70 | local template="$(find_fallback_template "${pfx}" "${name}" "${sfx}" "${order}")" | ||
| 71 | |||
| 72 | # If we don't have relaxed atomics, then we don't bother with ordering fallbacks | ||
| 73 | # read_acquire and set_release need to be templated, though | ||
| 74 | if ! meta_has_relaxed "${meta}"; then | ||
| 75 | gen_proto_fallback "${meta}" "${pfx}" "${name}" "${sfx}" "" "$@" | ||
| 76 | |||
| 77 | if meta_has_acquire "${meta}"; then | ||
| 78 | gen_proto_fallback "${meta}" "${pfx}" "${name}" "${sfx}" "_acquire" "$@" | ||
| 79 | fi | ||
| 80 | |||
| 81 | if meta_has_release "${meta}"; then | ||
| 82 | gen_proto_fallback "${meta}" "${pfx}" "${name}" "${sfx}" "_release" "$@" | ||
| 83 | fi | ||
| 84 | |||
| 85 | return | ||
| 86 | fi | ||
| 87 | |||
| 88 | printf "#ifndef ${basename}_relaxed\n" | ||
| 89 | |||
| 90 | if [ ! -z "${template}" ]; then | ||
| 91 | printf "#ifdef ${basename}\n" | ||
| 92 | fi | ||
| 93 | |||
| 94 | gen_basic_fallbacks "${basename}" | ||
| 95 | |||
| 96 | if [ ! -z "${template}" ]; then | ||
| 97 | printf "#endif /* ${atomic}_${pfx}${name}${sfx} */\n\n" | ||
| 98 | gen_proto_fallback "${meta}" "${pfx}" "${name}" "${sfx}" "" "$@" | ||
| 99 | gen_proto_fallback "${meta}" "${pfx}" "${name}" "${sfx}" "_acquire" "$@" | ||
| 100 | gen_proto_fallback "${meta}" "${pfx}" "${name}" "${sfx}" "_release" "$@" | ||
| 101 | gen_proto_fallback "${meta}" "${pfx}" "${name}" "${sfx}" "_relaxed" "$@" | ||
| 102 | fi | ||
| 103 | |||
| 104 | printf "#else /* ${basename}_relaxed */\n\n" | ||
| 105 | |||
| 106 | gen_template_fallback "${ATOMICDIR}/fallbacks/acquire" "${meta}" "${pfx}" "${name}" "${sfx}" "_acquire" "$@" | ||
| 107 | gen_template_fallback "${ATOMICDIR}/fallbacks/release" "${meta}" "${pfx}" "${name}" "${sfx}" "_release" "$@" | ||
| 108 | gen_template_fallback "${ATOMICDIR}/fallbacks/fence" "${meta}" "${pfx}" "${name}" "${sfx}" "" "$@" | ||
| 109 | |||
| 110 | printf "#endif /* ${basename}_relaxed */\n\n" | ||
| 111 | } | ||
| 112 | |||
| 113 | gen_xchg_fallbacks() | ||
| 114 | { | ||
| 115 | local xchg="$1"; shift | ||
| 116 | cat <<EOF | ||
| 117 | #ifndef ${xchg}_relaxed | ||
| 118 | #define ${xchg}_relaxed ${xchg} | ||
| 119 | #define ${xchg}_acquire ${xchg} | ||
| 120 | #define ${xchg}_release ${xchg} | ||
| 121 | #else /* ${xchg}_relaxed */ | ||
| 122 | |||
| 123 | #ifndef ${xchg}_acquire | ||
| 124 | #define ${xchg}_acquire(...) \\ | ||
| 125 | __atomic_op_acquire(${xchg}, __VA_ARGS__) | ||
| 126 | #endif | ||
| 127 | |||
| 128 | #ifndef ${xchg}_release | ||
| 129 | #define ${xchg}_release(...) \\ | ||
| 130 | __atomic_op_release(${xchg}, __VA_ARGS__) | ||
| 131 | #endif | ||
| 132 | |||
| 133 | #ifndef ${xchg} | ||
| 134 | #define ${xchg}(...) \\ | ||
| 135 | __atomic_op_fence(${xchg}, __VA_ARGS__) | ||
| 136 | #endif | ||
| 137 | |||
| 138 | #endif /* ${xchg}_relaxed */ | ||
| 139 | |||
| 140 | EOF | ||
| 141 | } | ||
| 142 | |||
| 143 | cat << EOF | ||
| 144 | // SPDX-License-Identifier: GPL-2.0 | ||
| 145 | |||
| 146 | // Generated by $0 | ||
| 147 | // DO NOT MODIFY THIS FILE DIRECTLY | ||
| 148 | |||
| 149 | #ifndef _LINUX_ATOMIC_FALLBACK_H | ||
| 150 | #define _LINUX_ATOMIC_FALLBACK_H | ||
| 151 | |||
| 152 | EOF | ||
| 153 | |||
| 154 | for xchg in "xchg" "cmpxchg" "cmpxchg64"; do | ||
| 155 | gen_xchg_fallbacks "${xchg}" | ||
| 156 | done | ||
| 157 | |||
| 158 | grep '^[a-z]' "$1" | while read name meta args; do | ||
| 159 | gen_proto "${meta}" "${name}" "atomic" "int" ${args} | ||
| 160 | done | ||
| 161 | |||
| 162 | cat <<EOF | ||
| 163 | #define atomic_cond_read_acquire(v, c) smp_cond_load_acquire(&(v)->counter, (c)) | ||
| 164 | #define atomic_cond_read_relaxed(v, c) smp_cond_load_relaxed(&(v)->counter, (c)) | ||
| 165 | |||
| 166 | #ifdef CONFIG_GENERIC_ATOMIC64 | ||
| 167 | #include <asm-generic/atomic64.h> | ||
| 168 | #endif | ||
| 169 | |||
| 170 | EOF | ||
| 171 | |||
| 172 | grep '^[a-z]' "$1" | while read name meta args; do | ||
| 173 | gen_proto "${meta}" "${name}" "atomic64" "s64" ${args} | ||
| 174 | done | ||
| 175 | |||
| 176 | cat <<EOF | ||
| 177 | #define atomic64_cond_read_acquire(v, c) smp_cond_load_acquire(&(v)->counter, (c)) | ||
| 178 | #define atomic64_cond_read_relaxed(v, c) smp_cond_load_relaxed(&(v)->counter, (c)) | ||
| 179 | |||
| 180 | #endif /* _LINUX_ATOMIC_FALLBACK_H */ | ||
| 181 | EOF | ||
diff --git a/scripts/atomic/gen-atomic-instrumented.sh b/scripts/atomic/gen-atomic-instrumented.sh new file mode 100755 index 000000000000..e09812372b17 --- /dev/null +++ b/scripts/atomic/gen-atomic-instrumented.sh | |||
| @@ -0,0 +1,182 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # SPDX-License-Identifier: GPL-2.0 | ||
| 3 | |||
| 4 | ATOMICDIR=$(dirname $0) | ||
| 5 | |||
| 6 | . ${ATOMICDIR}/atomic-tbl.sh | ||
| 7 | |||
| 8 | #gen_param_check(arg) | ||
| 9 | gen_param_check() | ||
| 10 | { | ||
| 11 | local arg="$1"; shift | ||
| 12 | local type="${arg%%:*}" | ||
| 13 | local name="$(gen_param_name "${arg}")" | ||
| 14 | local rw="write" | ||
| 15 | |||
| 16 | case "${type#c}" in | ||
| 17 | i) return;; | ||
| 18 | esac | ||
| 19 | |||
| 20 | # We don't write to constant parameters | ||
| 21 | [ ${type#c} != ${type} ] && rw="read" | ||
| 22 | |||
| 23 | printf "\tkasan_check_${rw}(${name}, sizeof(*${name}));\n" | ||
| 24 | } | ||
| 25 | |||
| 26 | #gen_param_check(arg...) | ||
| 27 | gen_params_checks() | ||
| 28 | { | ||
| 29 | while [ "$#" -gt 0 ]; do | ||
| 30 | gen_param_check "$1" | ||
| 31 | shift; | ||
| 32 | done | ||
| 33 | } | ||
| 34 | |||
| 35 | # gen_guard(meta, atomic, pfx, name, sfx, order) | ||
| 36 | gen_guard() | ||
| 37 | { | ||
| 38 | local meta="$1"; shift | ||
| 39 | local atomic="$1"; shift | ||
| 40 | local pfx="$1"; shift | ||
| 41 | local name="$1"; shift | ||
| 42 | local sfx="$1"; shift | ||
| 43 | local order="$1"; shift | ||
| 44 | |||
| 45 | local atomicname="arch_${atomic}_${pfx}${name}${sfx}${order}" | ||
| 46 | |||
| 47 | local template="$(find_fallback_template "${pfx}" "${name}" "${sfx}" "${order}")" | ||
| 48 | |||
| 49 | # We definitely need a preprocessor symbol for this atomic if it is an | ||
| 50 | # ordering variant, or if there's a generic fallback. | ||
| 51 | if [ ! -z "${order}" ] || [ ! -z "${template}" ]; then | ||
| 52 | printf "defined(${atomicname})" | ||
| 53 | return | ||
| 54 | fi | ||
| 55 | |||
| 56 | # If this is a base variant, but a relaxed variant *may* exist, then we | ||
| 57 | # only have a preprocessor symbol if the relaxed variant isn't defined | ||
| 58 | if meta_has_relaxed "${meta}"; then | ||
| 59 | printf "!defined(${atomicname}_relaxed) || defined(${atomicname})" | ||
| 60 | fi | ||
| 61 | } | ||
| 62 | |||
| 63 | #gen_proto_order_variant(meta, pfx, name, sfx, order, atomic, int, arg...) | ||
| 64 | gen_proto_order_variant() | ||
| 65 | { | ||
| 66 | local meta="$1"; shift | ||
| 67 | local pfx="$1"; shift | ||
| 68 | local name="$1"; shift | ||
| 69 | local sfx="$1"; shift | ||
| 70 | local order="$1"; shift | ||
| 71 | local atomic="$1"; shift | ||
| 72 | local int="$1"; shift | ||
| 73 | |||
| 74 | local atomicname="${atomic}_${pfx}${name}${sfx}${order}" | ||
| 75 | |||
| 76 | local guard="$(gen_guard "${meta}" "${atomic}" "${pfx}" "${name}" "${sfx}" "${order}")" | ||
| 77 | |||
| 78 | local ret="$(gen_ret_type "${meta}" "${int}")" | ||
| 79 | local params="$(gen_params "${int}" "${atomic}" "$@")" | ||
| 80 | local checks="$(gen_params_checks "$@")" | ||
| 81 | local args="$(gen_args "$@")" | ||
| 82 | local retstmt="$(gen_ret_stmt "${meta}")" | ||
| 83 | |||
| 84 | [ ! -z "${guard}" ] && printf "#if ${guard}\n" | ||
| 85 | |||
| 86 | cat <<EOF | ||
| 87 | static inline ${ret} | ||
| 88 | ${atomicname}(${params}) | ||
| 89 | { | ||
| 90 | ${checks} | ||
| 91 | ${retstmt}arch_${atomicname}(${args}); | ||
| 92 | } | ||
| 93 | #define ${atomicname} ${atomicname} | ||
| 94 | EOF | ||
| 95 | |||
| 96 | [ ! -z "${guard}" ] && printf "#endif\n" | ||
| 97 | |||
| 98 | printf "\n" | ||
| 99 | } | ||
| 100 | |||
| 101 | gen_xchg() | ||
| 102 | { | ||
| 103 | local xchg="$1"; shift | ||
| 104 | local mult="$1"; shift | ||
| 105 | |||
| 106 | cat <<EOF | ||
| 107 | #define ${xchg}(ptr, ...) \\ | ||
| 108 | ({ \\ | ||
| 109 | typeof(ptr) __ai_ptr = (ptr); \\ | ||
| 110 | kasan_check_write(__ai_ptr, ${mult}sizeof(*__ai_ptr)); \\ | ||
| 111 | arch_${xchg}(__ai_ptr, __VA_ARGS__); \\ | ||
| 112 | }) | ||
| 113 | EOF | ||
| 114 | } | ||
| 115 | |||
| 116 | gen_optional_xchg() | ||
| 117 | { | ||
| 118 | local name="$1"; shift | ||
| 119 | local sfx="$1"; shift | ||
| 120 | local guard="defined(arch_${name}${sfx})" | ||
| 121 | |||
| 122 | [ -z "${sfx}" ] && guard="!defined(arch_${name}_relaxed) || defined(arch_${name})" | ||
| 123 | |||
| 124 | printf "#if ${guard}\n" | ||
| 125 | gen_xchg "${name}${sfx}" "" | ||
| 126 | printf "#endif\n\n" | ||
| 127 | } | ||
| 128 | |||
| 129 | cat << EOF | ||
| 130 | // SPDX-License-Identifier: GPL-2.0 | ||
| 131 | |||
| 132 | // Generated by $0 | ||
| 133 | // DO NOT MODIFY THIS FILE DIRECTLY | ||
| 134 | |||
| 135 | /* | ||
| 136 | * This file provides wrappers with KASAN instrumentation for atomic operations. | ||
| 137 | * To use this functionality an arch's atomic.h file needs to define all | ||
| 138 | * atomic operations with arch_ prefix (e.g. arch_atomic_read()) and include | ||
| 139 | * this file at the end. This file provides atomic_read() that forwards to | ||
| 140 | * arch_atomic_read() for actual atomic operation. | ||
| 141 | * Note: if an arch atomic operation is implemented by means of other atomic | ||
| 142 | * operations (e.g. atomic_read()/atomic_cmpxchg() loop), then it needs to use | ||
| 143 | * arch_ variants (i.e. arch_atomic_read()/arch_atomic_cmpxchg()) to avoid | ||
| 144 | * double instrumentation. | ||
| 145 | */ | ||
| 146 | #ifndef _ASM_GENERIC_ATOMIC_INSTRUMENTED_H | ||
| 147 | #define _ASM_GENERIC_ATOMIC_INSTRUMENTED_H | ||
| 148 | |||
| 149 | #include <linux/build_bug.h> | ||
| 150 | #include <linux/kasan-checks.h> | ||
| 151 | |||
| 152 | EOF | ||
| 153 | |||
| 154 | grep '^[a-z]' "$1" | while read name meta args; do | ||
| 155 | gen_proto "${meta}" "${name}" "atomic" "int" ${args} | ||
| 156 | done | ||
| 157 | |||
| 158 | grep '^[a-z]' "$1" | while read name meta args; do | ||
| 159 | gen_proto "${meta}" "${name}" "atomic64" "s64" ${args} | ||
| 160 | done | ||
| 161 | |||
| 162 | for xchg in "xchg" "cmpxchg" "cmpxchg64"; do | ||
| 163 | for order in "" "_acquire" "_release" "_relaxed"; do | ||
| 164 | gen_optional_xchg "${xchg}" "${order}" | ||
| 165 | done | ||
| 166 | done | ||
| 167 | |||
| 168 | for xchg in "cmpxchg_local" "cmpxchg64_local" "sync_cmpxchg"; do | ||
| 169 | gen_xchg "${xchg}" "" | ||
| 170 | printf "\n" | ||
| 171 | done | ||
| 172 | |||
| 173 | gen_xchg "cmpxchg_double" "2 * " | ||
| 174 | |||
| 175 | printf "\n\n" | ||
| 176 | |||
| 177 | gen_xchg "cmpxchg_double_local" "2 * " | ||
| 178 | |||
| 179 | cat <<EOF | ||
| 180 | |||
| 181 | #endif /* _ASM_GENERIC_ATOMIC_INSTRUMENTED_H */ | ||
| 182 | EOF | ||
diff --git a/scripts/atomic/gen-atomic-long.sh b/scripts/atomic/gen-atomic-long.sh new file mode 100755 index 000000000000..c240a7231b2e --- /dev/null +++ b/scripts/atomic/gen-atomic-long.sh | |||
| @@ -0,0 +1,101 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # SPDX-License-Identifier: GPL-2.0 | ||
| 3 | |||
| 4 | ATOMICDIR=$(dirname $0) | ||
| 5 | |||
| 6 | . ${ATOMICDIR}/atomic-tbl.sh | ||
| 7 | |||
| 8 | #gen_cast(arg, int, atomic) | ||
| 9 | gen_cast() | ||
| 10 | { | ||
| 11 | local arg="$1"; shift | ||
| 12 | local int="$1"; shift | ||
| 13 | local atomic="$1"; shift | ||
| 14 | |||
| 15 | [ "${arg%%:*}" = "p" ] || return | ||
| 16 | |||
| 17 | printf "($(gen_param_type "${arg}" "${int}" "${atomic}"))" | ||
| 18 | } | ||
| 19 | |||
| 20 | #gen_args_cast(int, atomic, arg...) | ||
| 21 | gen_args_cast() | ||
| 22 | { | ||
| 23 | local int="$1"; shift | ||
| 24 | local atomic="$1"; shift | ||
| 25 | |||
| 26 | while [ "$#" -gt 0 ]; do | ||
| 27 | local cast="$(gen_cast "$1" "${int}" "${atomic}")" | ||
| 28 | local arg="$(gen_param_name "$1")" | ||
| 29 | printf "${cast}${arg}" | ||
| 30 | [ "$#" -gt 1 ] && printf ", " | ||
| 31 | shift; | ||
| 32 | done | ||
| 33 | } | ||
| 34 | |||
| 35 | #gen_proto_order_variant(meta, pfx, name, sfx, order, atomic, int, arg...) | ||
| 36 | gen_proto_order_variant() | ||
| 37 | { | ||
| 38 | local meta="$1"; shift | ||
| 39 | local name="$1$2$3$4"; shift; shift; shift; shift | ||
| 40 | local atomic="$1"; shift | ||
| 41 | local int="$1"; shift | ||
| 42 | |||
| 43 | local ret="$(gen_ret_type "${meta}" "long")" | ||
| 44 | local params="$(gen_params "long" "atomic_long" "$@")" | ||
| 45 | local argscast="$(gen_args_cast "${int}" "${atomic}" "$@")" | ||
| 46 | local retstmt="$(gen_ret_stmt "${meta}")" | ||
| 47 | |||
| 48 | cat <<EOF | ||
| 49 | static inline ${ret} | ||
| 50 | atomic_long_${name}(${params}) | ||
| 51 | { | ||
| 52 | ${retstmt}${atomic}_${name}(${argscast}); | ||
| 53 | } | ||
| 54 | |||
| 55 | EOF | ||
| 56 | } | ||
| 57 | |||
| 58 | cat << EOF | ||
| 59 | // SPDX-License-Identifier: GPL-2.0 | ||
| 60 | |||
| 61 | // Generated by $0 | ||
| 62 | // DO NOT MODIFY THIS FILE DIRECTLY | ||
| 63 | |||
| 64 | #ifndef _ASM_GENERIC_ATOMIC_LONG_H | ||
| 65 | #define _ASM_GENERIC_ATOMIC_LONG_H | ||
| 66 | |||
| 67 | #include <asm/types.h> | ||
| 68 | |||
| 69 | #ifdef CONFIG_64BIT | ||
| 70 | typedef atomic64_t atomic_long_t; | ||
| 71 | #define ATOMIC_LONG_INIT(i) ATOMIC64_INIT(i) | ||
| 72 | #define atomic_long_cond_read_acquire atomic64_cond_read_acquire | ||
| 73 | #define atomic_long_cond_read_relaxed atomic64_cond_read_relaxed | ||
| 74 | #else | ||
| 75 | typedef atomic_t atomic_long_t; | ||
| 76 | #define ATOMIC_LONG_INIT(i) ATOMIC_INIT(i) | ||
| 77 | #define atomic_long_cond_read_acquire atomic_cond_read_acquire | ||
| 78 | #define atomic_long_cond_read_relaxed atomic_cond_read_relaxed | ||
| 79 | #endif | ||
| 80 | |||
| 81 | #ifdef CONFIG_64BIT | ||
| 82 | |||
| 83 | EOF | ||
| 84 | |||
| 85 | grep '^[a-z]' "$1" | while read name meta args; do | ||
| 86 | gen_proto "${meta}" "${name}" "atomic64" "s64" ${args} | ||
| 87 | done | ||
| 88 | |||
| 89 | cat <<EOF | ||
| 90 | #else /* CONFIG_64BIT */ | ||
| 91 | |||
| 92 | EOF | ||
| 93 | |||
| 94 | grep '^[a-z]' "$1" | while read name meta args; do | ||
| 95 | gen_proto "${meta}" "${name}" "atomic" "int" ${args} | ||
| 96 | done | ||
| 97 | |||
| 98 | cat <<EOF | ||
| 99 | #endif /* CONFIG_64BIT */ | ||
| 100 | #endif /* _ASM_GENERIC_ATOMIC_LONG_H */ | ||
| 101 | EOF | ||
diff --git a/scripts/atomic/gen-atomics.sh b/scripts/atomic/gen-atomics.sh new file mode 100644 index 000000000000..27400b0cd732 --- /dev/null +++ b/scripts/atomic/gen-atomics.sh | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # SPDX-License-Identifier: GPL-2.0 | ||
| 3 | # | ||
| 4 | # Generate atomic headers | ||
| 5 | |||
| 6 | ATOMICDIR=$(dirname $0) | ||
| 7 | ATOMICTBL=${ATOMICDIR}/atomics.tbl | ||
| 8 | LINUXDIR=${ATOMICDIR}/../.. | ||
| 9 | |||
| 10 | cat <<EOF | | ||
| 11 | gen-atomic-instrumented.sh asm-generic/atomic-instrumented.h | ||
| 12 | gen-atomic-long.sh asm-generic/atomic-long.h | ||
| 13 | gen-atomic-fallback.sh linux/atomic-fallback.h | ||
| 14 | EOF | ||
| 15 | while read script header; do | ||
| 16 | ${ATOMICDIR}/${script} ${ATOMICTBL} > ${LINUXDIR}/include/${header} | ||
| 17 | HASH="$(sha1sum ${LINUXDIR}/include/${header})" | ||
| 18 | HASH="${HASH%% *}" | ||
| 19 | printf "// %s\n" "${HASH}" >> ${LINUXDIR}/include/${header} | ||
| 20 | done | ||
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index b737ca9d7204..5b756278df13 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
| @@ -61,7 +61,7 @@ my $codespellfile = "/usr/share/codespell/dictionary.txt"; | |||
| 61 | my $conststructsfile = "$D/const_structs.checkpatch"; | 61 | my $conststructsfile = "$D/const_structs.checkpatch"; |
| 62 | my $typedefsfile = ""; | 62 | my $typedefsfile = ""; |
| 63 | my $color = "auto"; | 63 | my $color = "auto"; |
| 64 | my $allow_c99_comments = 1; | 64 | my $allow_c99_comments = 1; # Can be overridden by --ignore C99_COMMENT_TOLERANCE |
| 65 | 65 | ||
| 66 | sub help { | 66 | sub help { |
| 67 | my ($exitcode) = @_; | 67 | my ($exitcode) = @_; |
| @@ -466,6 +466,16 @@ our $logFunctions = qr{(?x: | |||
| 466 | seq_vprintf|seq_printf|seq_puts | 466 | seq_vprintf|seq_printf|seq_puts |
| 467 | )}; | 467 | )}; |
| 468 | 468 | ||
| 469 | our $allocFunctions = qr{(?x: | ||
| 470 | (?:(?:devm_)? | ||
| 471 | (?:kv|k|v)[czm]alloc(?:_node|_array)? | | ||
| 472 | kstrdup(?:_const)? | | ||
| 473 | kmemdup(?:_nul)?) | | ||
| 474 | (?:\w+)?alloc_skb(?:ip_align)? | | ||
| 475 | # dev_alloc_skb/netdev_alloc_skb, et al | ||
| 476 | dma_alloc_coherent | ||
| 477 | )}; | ||
| 478 | |||
| 469 | our $signature_tags = qr{(?xi: | 479 | our $signature_tags = qr{(?xi: |
| 470 | Signed-off-by:| | 480 | Signed-off-by:| |
| 471 | Co-developed-by:| | 481 | Co-developed-by:| |
| @@ -1011,6 +1021,7 @@ if ($git) { | |||
| 1011 | } | 1021 | } |
| 1012 | 1022 | ||
| 1013 | my $vname; | 1023 | my $vname; |
| 1024 | $allow_c99_comments = !defined $ignore_type{"C99_COMMENT_TOLERANCE"}; | ||
| 1014 | for my $filename (@ARGV) { | 1025 | for my $filename (@ARGV) { |
| 1015 | my $FILE; | 1026 | my $FILE; |
| 1016 | if ($git) { | 1027 | if ($git) { |
| @@ -3037,6 +3048,14 @@ sub process { | |||
| 3037 | $comment = '..'; | 3048 | $comment = '..'; |
| 3038 | } | 3049 | } |
| 3039 | 3050 | ||
| 3051 | # check SPDX comment style for .[chsS] files | ||
| 3052 | if ($realfile =~ /\.[chsS]$/ && | ||
| 3053 | $rawline =~ /SPDX-License-Identifier:/ && | ||
| 3054 | $rawline !~ /^\+\s*\Q$comment\E\s*/) { | ||
| 3055 | WARN("SPDX_LICENSE_TAG", | ||
| 3056 | "Improper SPDX comment style for '$realfile', please use '$comment' instead\n" . $herecurr); | ||
| 3057 | } | ||
| 3058 | |||
| 3040 | if ($comment !~ /^$/ && | 3059 | if ($comment !~ /^$/ && |
| 3041 | $rawline !~ /^\+\Q$comment\E SPDX-License-Identifier: /) { | 3060 | $rawline !~ /^\+\Q$comment\E SPDX-License-Identifier: /) { |
| 3042 | WARN("SPDX_LICENSE_TAG", | 3061 | WARN("SPDX_LICENSE_TAG", |
| @@ -3054,6 +3073,14 @@ sub process { | |||
| 3054 | # check we are in a valid source file if not then ignore this hunk | 3073 | # check we are in a valid source file if not then ignore this hunk |
| 3055 | next if ($realfile !~ /\.(h|c|s|S|sh|dtsi|dts)$/); | 3074 | next if ($realfile !~ /\.(h|c|s|S|sh|dtsi|dts)$/); |
| 3056 | 3075 | ||
| 3076 | # check for using SPDX-License-Identifier on the wrong line number | ||
| 3077 | if ($realline != $checklicenseline && | ||
| 3078 | $rawline =~ /\bSPDX-License-Identifier:/ && | ||
| 3079 | substr($line, @-, @+ - @-) eq "$;" x (@+ - @-)) { | ||
| 3080 | WARN("SPDX_LICENSE_TAG", | ||
| 3081 | "Misplaced SPDX-License-Identifier tag - use line $checklicenseline instead\n" . $herecurr); | ||
| 3082 | } | ||
| 3083 | |||
| 3057 | # line length limit (with some exclusions) | 3084 | # line length limit (with some exclusions) |
| 3058 | # | 3085 | # |
| 3059 | # There are a few types of lines that may extend beyond $max_line_length: | 3086 | # There are a few types of lines that may extend beyond $max_line_length: |
| @@ -5545,7 +5572,8 @@ sub process { | |||
| 5545 | my ($s, $c) = ctx_statement_block($linenr - 3, $realcnt, 0); | 5572 | my ($s, $c) = ctx_statement_block($linenr - 3, $realcnt, 0); |
| 5546 | # print("line: <$line>\nprevline: <$prevline>\ns: <$s>\nc: <$c>\n\n\n"); | 5573 | # print("line: <$line>\nprevline: <$prevline>\ns: <$s>\nc: <$c>\n\n\n"); |
| 5547 | 5574 | ||
| 5548 | if ($s =~ /(?:^|\n)[ \+]\s*(?:$Type\s*)?\Q$testval\E\s*=\s*(?:\([^\)]*\)\s*)?\s*(?:devm_)?(?:[kv][czm]alloc(?:_node|_array)?\b|kstrdup|kmemdup|(?:dev_)?alloc_skb)/) { | 5575 | if ($s =~ /(?:^|\n)[ \+]\s*(?:$Type\s*)?\Q$testval\E\s*=\s*(?:\([^\)]*\)\s*)?\s*$allocFunctions\s*\(/ && |
| 5576 | $s !~ /\b__GFP_NOWARN\b/ ) { | ||
| 5549 | WARN("OOM_MESSAGE", | 5577 | WARN("OOM_MESSAGE", |
| 5550 | "Possible unnecessary 'out of memory' message\n" . $hereprev); | 5578 | "Possible unnecessary 'out of memory' message\n" . $hereprev); |
| 5551 | } | 5579 | } |
| @@ -6196,8 +6224,8 @@ sub process { | |||
| 6196 | } | 6224 | } |
| 6197 | } | 6225 | } |
| 6198 | 6226 | ||
| 6199 | # check for pointless casting of kmalloc return | 6227 | # check for pointless casting of alloc functions |
| 6200 | if ($line =~ /\*\s*\)\s*[kv][czm]alloc(_node){0,1}\b/) { | 6228 | if ($line =~ /\*\s*\)\s*$allocFunctions\b/) { |
| 6201 | WARN("UNNECESSARY_CASTS", | 6229 | WARN("UNNECESSARY_CASTS", |
| 6202 | "unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr); | 6230 | "unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr); |
| 6203 | } | 6231 | } |
| @@ -6205,7 +6233,7 @@ sub process { | |||
| 6205 | # alloc style | 6233 | # alloc style |
| 6206 | # p = alloc(sizeof(struct foo), ...) should be p = alloc(sizeof(*p), ...) | 6234 | # p = alloc(sizeof(struct foo), ...) should be p = alloc(sizeof(*p), ...) |
| 6207 | if ($perl_version_ok && | 6235 | if ($perl_version_ok && |
| 6208 | $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*([kv][mz]alloc(?:_node)?)\s*\(\s*(sizeof\s*\(\s*struct\s+$Lval\s*\))/) { | 6236 | $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*((?:kv|k|v)[mz]alloc(?:_node)?)\s*\(\s*(sizeof\s*\(\s*struct\s+$Lval\s*\))/) { |
| 6209 | CHK("ALLOC_SIZEOF_STRUCT", | 6237 | CHK("ALLOC_SIZEOF_STRUCT", |
| 6210 | "Prefer $3(sizeof(*$1)...) over $3($4...)\n" . $herecurr); | 6238 | "Prefer $3(sizeof(*$1)...) over $3($4...)\n" . $herecurr); |
| 6211 | } | 6239 | } |
| @@ -6368,19 +6396,6 @@ sub process { | |||
| 6368 | } | 6396 | } |
| 6369 | } | 6397 | } |
| 6370 | 6398 | ||
| 6371 | # check for bool bitfields | ||
| 6372 | if ($sline =~ /^.\s+bool\s*$Ident\s*:\s*\d+\s*;/) { | ||
| 6373 | WARN("BOOL_BITFIELD", | ||
| 6374 | "Avoid using bool as bitfield. Prefer bool bitfields as unsigned int or u<8|16|32>\n" . $herecurr); | ||
| 6375 | } | ||
| 6376 | |||
| 6377 | # check for bool use in .h files | ||
| 6378 | if ($realfile =~ /\.h$/ && | ||
| 6379 | $sline =~ /^.\s+bool\s*$Ident\s*(?::\s*d+\s*)?;/) { | ||
| 6380 | CHK("BOOL_MEMBER", | ||
| 6381 | "Avoid using bool structure members because of possible alignment issues - see: https://lkml.org/lkml/2017/11/21/384\n" . $herecurr); | ||
| 6382 | } | ||
| 6383 | |||
| 6384 | # check for semaphores initialized locked | 6399 | # check for semaphores initialized locked |
| 6385 | if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) { | 6400 | if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) { |
| 6386 | WARN("CONSIDER_COMPLETION", | 6401 | WARN("CONSIDER_COMPLETION", |
diff --git a/scripts/clang-version.sh b/scripts/clang-version.sh index e65fbc3079d4..6fabf0695761 100755 --- a/scripts/clang-version.sh +++ b/scripts/clang-version.sh | |||
| @@ -1,14 +1,10 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | # SPDX-License-Identifier: GPL-2.0 | 2 | # SPDX-License-Identifier: GPL-2.0 |
| 3 | # | 3 | # |
| 4 | # clang-version [-p] clang-command | 4 | # clang-version clang-command |
| 5 | # | ||
| 6 | # Prints the compiler version of `clang-command' in a canonical 4-digit form | ||
| 7 | # such as `0500' for clang-5.0 etc. | ||
| 8 | # | ||
| 9 | # With the -p option, prints the patchlevel as well, for example `050001' for | ||
| 10 | # clang-5.0.1 etc. | ||
| 11 | # | 5 | # |
| 6 | # Print the compiler version of `clang-command' in a 5 or 6-digit form | ||
| 7 | # such as `50001' for clang-5.0.1 etc. | ||
| 12 | 8 | ||
| 13 | compiler="$*" | 9 | compiler="$*" |
| 14 | 10 | ||
diff --git a/scripts/coccinelle/free/put_device.cocci b/scripts/coccinelle/free/put_device.cocci new file mode 100644 index 000000000000..7395697e7f19 --- /dev/null +++ b/scripts/coccinelle/free/put_device.cocci | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 | ||
| 2 | /// Find missing put_device for every of_find_device_by_node. | ||
| 3 | /// | ||
| 4 | // Confidence: Moderate | ||
| 5 | // Copyright: (C) 2018-2019 Wen Yang, ZTE. | ||
| 6 | // Comments: | ||
| 7 | // Options: --no-includes --include-headers | ||
| 8 | |||
| 9 | virtual report | ||
| 10 | virtual org | ||
| 11 | |||
| 12 | @search exists@ | ||
| 13 | local idexpression id; | ||
| 14 | expression x,e,e1; | ||
| 15 | position p1,p2; | ||
| 16 | type T,T1,T2,T3; | ||
| 17 | @@ | ||
| 18 | |||
| 19 | id = of_find_device_by_node@p1(x) | ||
| 20 | ... when != e = id | ||
| 21 | if (id == NULL || ...) { ... return ...; } | ||
| 22 | ... when != put_device(&id->dev) | ||
| 23 | when != platform_device_put(id) | ||
| 24 | when != of_dev_put(id) | ||
| 25 | when != if (id) { ... put_device(&id->dev) ... } | ||
| 26 | when != e1 = (T)id | ||
| 27 | when != e1 = &id->dev | ||
| 28 | when != e1 = get_device(&id->dev) | ||
| 29 | when != e1 = (T1)platform_get_drvdata(id) | ||
| 30 | ( | ||
| 31 | return | ||
| 32 | ( id | ||
| 33 | | (T2)dev_get_drvdata(&id->dev) | ||
| 34 | | (T3)platform_get_drvdata(id) | ||
| 35 | ); | ||
| 36 | | return@p2 ...; | ||
| 37 | ) | ||
| 38 | |||
| 39 | @script:python depends on report@ | ||
| 40 | p1 << search.p1; | ||
| 41 | p2 << search.p2; | ||
| 42 | @@ | ||
| 43 | |||
| 44 | coccilib.report.print_report(p2[0], "ERROR: missing put_device; " | ||
| 45 | + "call of_find_device_by_node on line " | ||
| 46 | + p1[0].line | ||
| 47 | + ", but without a corresponding object release " | ||
| 48 | + "within this function.") | ||
| 49 | |||
| 50 | @script:python depends on org@ | ||
| 51 | p1 << search.p1; | ||
| 52 | p2 << search.p2; | ||
| 53 | @@ | ||
| 54 | |||
| 55 | cocci.print_main("of_find_device_by_node", p1) | ||
| 56 | cocci.print_secs("needed put_device", p2) | ||
diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh index 98a7d63a723e..bcdd45df3f51 100755 --- a/scripts/decode_stacktrace.sh +++ b/scripts/decode_stacktrace.sh | |||
| @@ -37,6 +37,13 @@ parse_symbol() { | |||
| 37 | symbol=${symbol#\(} | 37 | symbol=${symbol#\(} |
| 38 | symbol=${symbol%\)} | 38 | symbol=${symbol%\)} |
| 39 | 39 | ||
| 40 | # Strip segment | ||
| 41 | local segment | ||
| 42 | if [[ $symbol == *:* ]] ; then | ||
| 43 | segment=${symbol%%:*}: | ||
| 44 | symbol=${symbol#*:} | ||
| 45 | fi | ||
| 46 | |||
| 40 | # Strip the symbol name so that we could look it up | 47 | # Strip the symbol name so that we could look it up |
| 41 | local name=${symbol%+*} | 48 | local name=${symbol%+*} |
| 42 | 49 | ||
| @@ -84,7 +91,7 @@ parse_symbol() { | |||
| 84 | code=${code//$'\n'/' '} | 91 | code=${code//$'\n'/' '} |
| 85 | 92 | ||
| 86 | # Replace old address with pretty line numbers | 93 | # Replace old address with pretty line numbers |
| 87 | symbol="$name ($code)" | 94 | symbol="$segment$name ($code)" |
| 88 | } | 95 | } |
| 89 | 96 | ||
| 90 | decode_code() { | 97 | decode_code() { |
diff --git a/scripts/dtc/dtx_diff b/scripts/dtc/dtx_diff index 8c4fbad2055e..0d8572008729 100755 --- a/scripts/dtc/dtx_diff +++ b/scripts/dtc/dtx_diff | |||
| @@ -21,6 +21,7 @@ Usage: | |||
| 21 | diff DTx_1 and DTx_2 | 21 | diff DTx_1 and DTx_2 |
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | --annotate synonym for -T | ||
| 24 | -f print full dts in diff (--unified=99999) | 25 | -f print full dts in diff (--unified=99999) |
| 25 | -h synonym for --help | 26 | -h synonym for --help |
| 26 | -help synonym for --help | 27 | -help synonym for --help |
| @@ -28,6 +29,7 @@ Usage: | |||
| 28 | -s SRCTREE linux kernel source tree is at path SRCTREE | 29 | -s SRCTREE linux kernel source tree is at path SRCTREE |
| 29 | (default is current directory) | 30 | (default is current directory) |
| 30 | -S linux kernel source tree is at root of current git repo | 31 | -S linux kernel source tree is at root of current git repo |
| 32 | -T Annotate output .dts with input source file and line (-T -T for more details) | ||
| 31 | -u unsorted, do not sort DTx | 33 | -u unsorted, do not sort DTx |
| 32 | 34 | ||
| 33 | 35 | ||
| @@ -174,6 +176,7 @@ compile_to_dts() { | |||
| 174 | 176 | ||
| 175 | # ----- start of script | 177 | # ----- start of script |
| 176 | 178 | ||
| 179 | annotate="" | ||
| 177 | cmd_diff=0 | 180 | cmd_diff=0 |
| 178 | diff_flags="-u" | 181 | diff_flags="-u" |
| 179 | dtx_file_1="" | 182 | dtx_file_1="" |
| @@ -208,6 +211,14 @@ while [ $# -gt 0 ] ; do | |||
| 208 | shift | 211 | shift |
| 209 | ;; | 212 | ;; |
| 210 | 213 | ||
| 214 | -T | --annotate ) | ||
| 215 | if [ "${annotate}" = "" ] ; then | ||
| 216 | annotate="-T" | ||
| 217 | elif [ "${annotate}" = "-T" ] ; then | ||
| 218 | annotate="-T -T" | ||
| 219 | fi | ||
| 220 | shift | ||
| 221 | ;; | ||
| 211 | -u ) | 222 | -u ) |
| 212 | dtc_sort="" | 223 | dtc_sort="" |
| 213 | shift | 224 | shift |
| @@ -327,7 +338,7 @@ cpp_flags="\ | |||
| 327 | DTC="\ | 338 | DTC="\ |
| 328 | ${DTC} \ | 339 | ${DTC} \ |
| 329 | -i ${srctree}/scripts/dtc/include-prefixes \ | 340 | -i ${srctree}/scripts/dtc/include-prefixes \ |
| 330 | -O dts -qq -f ${dtc_sort} -o -" | 341 | -O dts -qq -f ${dtc_sort} ${annotate} -o -" |
| 331 | 342 | ||
| 332 | 343 | ||
| 333 | # ----- do the diff or decompile | 344 | # ----- do the diff or decompile |
diff --git a/scripts/gcc-plugins/Kconfig b/scripts/gcc-plugins/Kconfig index d45f7f36b859..74271dba4f94 100644 --- a/scripts/gcc-plugins/Kconfig +++ b/scripts/gcc-plugins/Kconfig | |||
| @@ -67,27 +67,59 @@ config GCC_PLUGIN_LATENT_ENTROPY | |||
| 67 | * https://pax.grsecurity.net/ | 67 | * https://pax.grsecurity.net/ |
| 68 | 68 | ||
| 69 | config GCC_PLUGIN_STRUCTLEAK | 69 | config GCC_PLUGIN_STRUCTLEAK |
| 70 | bool "Force initialization of variables containing userspace addresses" | 70 | bool "Zero initialize stack variables" |
| 71 | # Currently STRUCTLEAK inserts initialization out of live scope of | ||
| 72 | # variables from KASAN point of view. This leads to KASAN false | ||
| 73 | # positive reports. Prohibit this combination for now. | ||
| 74 | depends on !KASAN_EXTRA | ||
| 75 | help | 71 | help |
| 76 | This plugin zero-initializes any structures containing a | 72 | While the kernel is built with warnings enabled for any missed |
| 77 | __user attribute. This can prevent some classes of information | 73 | stack variable initializations, this warning is silenced for |
| 78 | exposures. | 74 | anything passed by reference to another function, under the |
| 79 | 75 | occasionally misguided assumption that the function will do | |
| 80 | This plugin was ported from grsecurity/PaX. More information at: | 76 | the initialization. As this regularly leads to exploitable |
| 77 | flaws, this plugin is available to identify and zero-initialize | ||
| 78 | such variables, depending on the chosen level of coverage. | ||
| 79 | |||
| 80 | This plugin was originally ported from grsecurity/PaX. More | ||
| 81 | information at: | ||
| 81 | * https://grsecurity.net/ | 82 | * https://grsecurity.net/ |
| 82 | * https://pax.grsecurity.net/ | 83 | * https://pax.grsecurity.net/ |
| 83 | 84 | ||
| 84 | config GCC_PLUGIN_STRUCTLEAK_BYREF_ALL | 85 | choice |
| 85 | bool "Force initialize all struct type variables passed by reference" | 86 | prompt "Coverage" |
| 86 | depends on GCC_PLUGIN_STRUCTLEAK | 87 | depends on GCC_PLUGIN_STRUCTLEAK |
| 87 | depends on !COMPILE_TEST | 88 | default GCC_PLUGIN_STRUCTLEAK_BYREF_ALL |
| 88 | help | 89 | help |
| 89 | Zero initialize any struct type local variable that may be passed by | 90 | This chooses the level of coverage over classes of potentially |
| 90 | reference without having been initialized. | 91 | uninitialized variables. The selected class will be |
| 92 | zero-initialized before use. | ||
| 93 | |||
| 94 | config GCC_PLUGIN_STRUCTLEAK_USER | ||
| 95 | bool "structs marked for userspace" | ||
| 96 | help | ||
| 97 | Zero-initialize any structures on the stack containing | ||
| 98 | a __user attribute. This can prevent some classes of | ||
| 99 | uninitialized stack variable exploits and information | ||
| 100 | exposures, like CVE-2013-2141: | ||
| 101 | https://git.kernel.org/linus/b9e146d8eb3b9eca | ||
| 102 | |||
| 103 | config GCC_PLUGIN_STRUCTLEAK_BYREF | ||
| 104 | bool "structs passed by reference" | ||
| 105 | help | ||
| 106 | Zero-initialize any structures on the stack that may | ||
| 107 | be passed by reference and had not already been | ||
| 108 | explicitly initialized. This can prevent most classes | ||
| 109 | of uninitialized stack variable exploits and information | ||
| 110 | exposures, like CVE-2017-1000410: | ||
| 111 | https://git.kernel.org/linus/06e7e776ca4d3654 | ||
| 112 | |||
| 113 | config GCC_PLUGIN_STRUCTLEAK_BYREF_ALL | ||
| 114 | bool "anything passed by reference" | ||
| 115 | help | ||
| 116 | Zero-initialize any stack variables that may be passed | ||
| 117 | by reference and had not already been explicitly | ||
| 118 | initialized. This is intended to eliminate all classes | ||
| 119 | of uninitialized stack variable exploits and information | ||
| 120 | exposures. | ||
| 121 | |||
| 122 | endchoice | ||
| 91 | 123 | ||
| 92 | config GCC_PLUGIN_STRUCTLEAK_VERBOSE | 124 | config GCC_PLUGIN_STRUCTLEAK_VERBOSE |
| 93 | bool "Report forcefully initialized variables" | 125 | bool "Report forcefully initialized variables" |
diff --git a/scripts/gcc-plugins/structleak_plugin.c b/scripts/gcc-plugins/structleak_plugin.c index 10292f791e99..e89be8f5c859 100644 --- a/scripts/gcc-plugins/structleak_plugin.c +++ b/scripts/gcc-plugins/structleak_plugin.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | * Options: | 16 | * Options: |
| 17 | * -fplugin-arg-structleak_plugin-disable | 17 | * -fplugin-arg-structleak_plugin-disable |
| 18 | * -fplugin-arg-structleak_plugin-verbose | 18 | * -fplugin-arg-structleak_plugin-verbose |
| 19 | * -fplugin-arg-structleak_plugin-byref | ||
| 19 | * -fplugin-arg-structleak_plugin-byref-all | 20 | * -fplugin-arg-structleak_plugin-byref-all |
| 20 | * | 21 | * |
| 21 | * Usage: | 22 | * Usage: |
| @@ -26,7 +27,6 @@ | |||
| 26 | * $ gcc -fplugin=./structleak_plugin.so test.c -O2 | 27 | * $ gcc -fplugin=./structleak_plugin.so test.c -O2 |
| 27 | * | 28 | * |
| 28 | * TODO: eliminate redundant initializers | 29 | * TODO: eliminate redundant initializers |
| 29 | * increase type coverage | ||
| 30 | */ | 30 | */ |
| 31 | 31 | ||
| 32 | #include "gcc-common.h" | 32 | #include "gcc-common.h" |
| @@ -37,13 +37,18 @@ | |||
| 37 | __visible int plugin_is_GPL_compatible; | 37 | __visible int plugin_is_GPL_compatible; |
| 38 | 38 | ||
| 39 | static struct plugin_info structleak_plugin_info = { | 39 | static struct plugin_info structleak_plugin_info = { |
| 40 | .version = "201607271510vanilla", | 40 | .version = "20190125vanilla", |
| 41 | .help = "disable\tdo not activate plugin\n" | 41 | .help = "disable\tdo not activate plugin\n" |
| 42 | "verbose\tprint all initialized variables\n", | 42 | "byref\tinit structs passed by reference\n" |
| 43 | "byref-all\tinit anything passed by reference\n" | ||
| 44 | "verbose\tprint all initialized variables\n", | ||
| 43 | }; | 45 | }; |
| 44 | 46 | ||
| 47 | #define BYREF_STRUCT 1 | ||
| 48 | #define BYREF_ALL 2 | ||
| 49 | |||
| 45 | static bool verbose; | 50 | static bool verbose; |
| 46 | static bool byref_all; | 51 | static int byref; |
| 47 | 52 | ||
| 48 | static tree handle_user_attribute(tree *node, tree name, tree args, int flags, bool *no_add_attrs) | 53 | static tree handle_user_attribute(tree *node, tree name, tree args, int flags, bool *no_add_attrs) |
| 49 | { | 54 | { |
| @@ -118,6 +123,7 @@ static void initialize(tree var) | |||
| 118 | gimple_stmt_iterator gsi; | 123 | gimple_stmt_iterator gsi; |
| 119 | tree initializer; | 124 | tree initializer; |
| 120 | gimple init_stmt; | 125 | gimple init_stmt; |
| 126 | tree type; | ||
| 121 | 127 | ||
| 122 | /* this is the original entry bb before the forced split */ | 128 | /* this is the original entry bb before the forced split */ |
| 123 | bb = single_succ(ENTRY_BLOCK_PTR_FOR_FN(cfun)); | 129 | bb = single_succ(ENTRY_BLOCK_PTR_FOR_FN(cfun)); |
| @@ -148,11 +154,15 @@ static void initialize(tree var) | |||
| 148 | if (verbose) | 154 | if (verbose) |
| 149 | inform(DECL_SOURCE_LOCATION(var), | 155 | inform(DECL_SOURCE_LOCATION(var), |
| 150 | "%s variable will be forcibly initialized", | 156 | "%s variable will be forcibly initialized", |
| 151 | (byref_all && TREE_ADDRESSABLE(var)) ? "byref" | 157 | (byref && TREE_ADDRESSABLE(var)) ? "byref" |
| 152 | : "userspace"); | 158 | : "userspace"); |
| 153 | 159 | ||
| 154 | /* build the initializer expression */ | 160 | /* build the initializer expression */ |
| 155 | initializer = build_constructor(TREE_TYPE(var), NULL); | 161 | type = TREE_TYPE(var); |
| 162 | if (AGGREGATE_TYPE_P(type)) | ||
| 163 | initializer = build_constructor(type, NULL); | ||
| 164 | else | ||
| 165 | initializer = fold_convert(type, integer_zero_node); | ||
| 156 | 166 | ||
| 157 | /* build the initializer stmt */ | 167 | /* build the initializer stmt */ |
| 158 | init_stmt = gimple_build_assign(var, initializer); | 168 | init_stmt = gimple_build_assign(var, initializer); |
| @@ -184,13 +194,13 @@ static unsigned int structleak_execute(void) | |||
| 184 | if (!auto_var_in_fn_p(var, current_function_decl)) | 194 | if (!auto_var_in_fn_p(var, current_function_decl)) |
| 185 | continue; | 195 | continue; |
| 186 | 196 | ||
| 187 | /* only care about structure types */ | 197 | /* only care about structure types unless byref-all */ |
| 188 | if (TREE_CODE(type) != RECORD_TYPE && TREE_CODE(type) != UNION_TYPE) | 198 | if (byref != BYREF_ALL && TREE_CODE(type) != RECORD_TYPE && TREE_CODE(type) != UNION_TYPE) |
| 189 | continue; | 199 | continue; |
| 190 | 200 | ||
| 191 | /* if the type is of interest, examine the variable */ | 201 | /* if the type is of interest, examine the variable */ |
| 192 | if (TYPE_USERSPACE(type) || | 202 | if (TYPE_USERSPACE(type) || |
| 193 | (byref_all && TREE_ADDRESSABLE(var))) | 203 | (byref && TREE_ADDRESSABLE(var))) |
| 194 | initialize(var); | 204 | initialize(var); |
| 195 | } | 205 | } |
| 196 | 206 | ||
| @@ -232,8 +242,12 @@ __visible int plugin_init(struct plugin_name_args *plugin_info, struct plugin_gc | |||
| 232 | verbose = true; | 242 | verbose = true; |
| 233 | continue; | 243 | continue; |
| 234 | } | 244 | } |
| 245 | if (!strcmp(argv[i].key, "byref")) { | ||
| 246 | byref = BYREF_STRUCT; | ||
| 247 | continue; | ||
| 248 | } | ||
| 235 | if (!strcmp(argv[i].key, "byref-all")) { | 249 | if (!strcmp(argv[i].key, "byref-all")) { |
| 236 | byref_all = true; | 250 | byref = BYREF_ALL; |
| 237 | continue; | 251 | continue; |
| 238 | } | 252 | } |
| 239 | error(G_("unknown option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key); | 253 | error(G_("unknown option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key); |
diff --git a/scripts/gcc-version.sh b/scripts/gcc-version.sh index 11bb909845e7..ae353432539b 100755 --- a/scripts/gcc-version.sh +++ b/scripts/gcc-version.sh | |||
| @@ -1,33 +1,20 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | # SPDX-License-Identifier: GPL-2.0 | 2 | # SPDX-License-Identifier: GPL-2.0 |
| 3 | # | 3 | # |
| 4 | # gcc-version [-p] gcc-command | 4 | # gcc-version gcc-command |
| 5 | # | ||
| 6 | # Prints the gcc version of `gcc-command' in a canonical 4-digit form | ||
| 7 | # such as `0295' for gcc-2.95, `0303' for gcc-3.3, etc. | ||
| 8 | # | ||
| 9 | # With the -p option, prints the patchlevel as well, for example `029503' for | ||
| 10 | # gcc-2.95.3, `030301' for gcc-3.3.1, etc. | ||
| 11 | # | 5 | # |
| 12 | 6 | # Print the gcc version of `gcc-command' in a 5 or 6-digit form | |
| 13 | if [ "$1" = "-p" ] ; then | 7 | # such as `29503' for gcc-2.95.3, `30301' for gcc-3.3.1, etc. |
| 14 | with_patchlevel=1; | ||
| 15 | shift; | ||
| 16 | fi | ||
| 17 | 8 | ||
| 18 | compiler="$*" | 9 | compiler="$*" |
| 19 | 10 | ||
| 20 | if [ ${#compiler} -eq 0 ]; then | 11 | if [ ${#compiler} -eq 0 ]; then |
| 21 | echo "Error: No compiler specified." | 12 | echo "Error: No compiler specified." >&2 |
| 22 | printf "Usage:\n\t$0 <gcc-command>\n" | 13 | printf "Usage:\n\t$0 <gcc-command>\n" >&2 |
| 23 | exit 1 | 14 | exit 1 |
| 24 | fi | 15 | fi |
| 25 | 16 | ||
| 26 | MAJOR=$(echo __GNUC__ | $compiler -E -x c - | tail -n 1) | 17 | MAJOR=$(echo __GNUC__ | $compiler -E -x c - | tail -n 1) |
| 27 | MINOR=$(echo __GNUC_MINOR__ | $compiler -E -x c - | tail -n 1) | 18 | MINOR=$(echo __GNUC_MINOR__ | $compiler -E -x c - | tail -n 1) |
| 28 | if [ "x$with_patchlevel" != "x" ] ; then | 19 | PATCHLEVEL=$(echo __GNUC_PATCHLEVEL__ | $compiler -E -x c - | tail -n 1) |
| 29 | PATCHLEVEL=$(echo __GNUC_PATCHLEVEL__ | $compiler -E -x c - | tail -n 1) | 20 | printf "%d%02d%02d\\n" $MAJOR $MINOR $PATCHLEVEL |
| 30 | printf "%02d%02d%02d\\n" $MAJOR $MINOR $PATCHLEVEL | ||
| 31 | else | ||
| 32 | printf "%02d%02d\\n" $MAJOR $MINOR | ||
| 33 | fi | ||
diff --git a/scripts/gdb/linux/Makefile b/scripts/gdb/linux/Makefile index aba23be985e4..3df395a9c2ce 100644 --- a/scripts/gdb/linux/Makefile +++ b/scripts/gdb/linux/Makefile | |||
| @@ -1,24 +1,25 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | always := gdb-scripts | ||
| 3 | 2 | ||
| 4 | SRCTREE := $(abspath $(srctree)) | ||
| 5 | |||
| 6 | $(obj)/gdb-scripts: | ||
| 7 | ifneq ($(KBUILD_SRC),) | 3 | ifneq ($(KBUILD_SRC),) |
| 8 | $(Q)ln -fsn $(SRCTREE)/$(obj)/*.py $(objtree)/$(obj) | 4 | |
| 5 | symlinks := $(patsubst $(srctree)/$(src)/%,%,$(wildcard $(srctree)/$(src)/*.py)) | ||
| 6 | |||
| 7 | quiet_cmd_symlink = SYMLINK $@ | ||
| 8 | cmd_symlink = ln -fsn $(patsubst $(obj)/%,$(abspath $(srctree))/$(src)/%,$@) $@ | ||
| 9 | |||
| 10 | extra-y += $(symlinks) | ||
| 11 | $(addprefix $(obj)/, $(symlinks)): FORCE | ||
| 12 | $(call if_changed,symlink) | ||
| 13 | |||
| 9 | endif | 14 | endif |
| 10 | @: | ||
| 11 | 15 | ||
| 12 | quiet_cmd_gen_constants_py = GEN $@ | 16 | quiet_cmd_gen_constants_py = GEN $@ |
| 13 | cmd_gen_constants_py = \ | 17 | cmd_gen_constants_py = \ |
| 14 | $(CPP) -E -x c -P $(c_flags) $< > $@ ;\ | 18 | $(CPP) -E -x c -P $(c_flags) $< > $@ ;\ |
| 15 | sed -i '1,/<!-- end-c-headers -->/d;' $@ | 19 | sed -i '1,/<!-- end-c-headers -->/d;' $@ |
| 16 | 20 | ||
| 17 | targets += constants.py | 21 | extra-y += constants.py |
| 18 | $(obj)/constants.py: $(SRCTREE)/$(obj)/constants.py.in FORCE | 22 | $(obj)/constants.py: $(src)/constants.py.in FORCE |
| 19 | $(call if_changed_dep,gen_constants_py) | 23 | $(call if_changed_dep,gen_constants_py) |
| 20 | 24 | ||
| 21 | build_constants_py: $(obj)/constants.py | 25 | clean-files := *.pyc *.pyo |
| 22 | @: | ||
| 23 | |||
| 24 | clean-files := *.pyc *.pyo $(if $(KBUILD_SRC),*.py) $(obj)/constants.py | ||
diff --git a/scripts/gdb/linux/constants.py.in b/scripts/gdb/linux/constants.py.in index 7aad82406422..d3319a80788a 100644 --- a/scripts/gdb/linux/constants.py.in +++ b/scripts/gdb/linux/constants.py.in | |||
| @@ -37,12 +37,12 @@ | |||
| 37 | import gdb | 37 | import gdb |
| 38 | 38 | ||
| 39 | /* linux/fs.h */ | 39 | /* linux/fs.h */ |
| 40 | LX_VALUE(MS_RDONLY) | 40 | LX_VALUE(SB_RDONLY) |
| 41 | LX_VALUE(MS_SYNCHRONOUS) | 41 | LX_VALUE(SB_SYNCHRONOUS) |
| 42 | LX_VALUE(MS_MANDLOCK) | 42 | LX_VALUE(SB_MANDLOCK) |
| 43 | LX_VALUE(MS_DIRSYNC) | 43 | LX_VALUE(SB_DIRSYNC) |
| 44 | LX_VALUE(MS_NOATIME) | 44 | LX_VALUE(SB_NOATIME) |
| 45 | LX_VALUE(MS_NODIRATIME) | 45 | LX_VALUE(SB_NODIRATIME) |
| 46 | 46 | ||
| 47 | /* linux/mount.h */ | 47 | /* linux/mount.h */ |
| 48 | LX_VALUE(MNT_NOSUID) | 48 | LX_VALUE(MNT_NOSUID) |
diff --git a/scripts/gdb/linux/proc.py b/scripts/gdb/linux/proc.py index 0aebd7565b03..2f01a958eb22 100644 --- a/scripts/gdb/linux/proc.py +++ b/scripts/gdb/linux/proc.py | |||
| @@ -114,11 +114,11 @@ def info_opts(lst, opt): | |||
| 114 | return opts | 114 | return opts |
| 115 | 115 | ||
| 116 | 116 | ||
| 117 | FS_INFO = {constants.LX_MS_SYNCHRONOUS: ",sync", | 117 | FS_INFO = {constants.LX_SB_SYNCHRONOUS: ",sync", |
| 118 | constants.LX_MS_MANDLOCK: ",mand", | 118 | constants.LX_SB_MANDLOCK: ",mand", |
| 119 | constants.LX_MS_DIRSYNC: ",dirsync", | 119 | constants.LX_SB_DIRSYNC: ",dirsync", |
| 120 | constants.LX_MS_NOATIME: ",noatime", | 120 | constants.LX_SB_NOATIME: ",noatime", |
| 121 | constants.LX_MS_NODIRATIME: ",nodiratime"} | 121 | constants.LX_SB_NODIRATIME: ",nodiratime"} |
| 122 | 122 | ||
| 123 | MNT_INFO = {constants.LX_MNT_NOSUID: ",nosuid", | 123 | MNT_INFO = {constants.LX_MNT_NOSUID: ",nosuid", |
| 124 | constants.LX_MNT_NODEV: ",nodev", | 124 | constants.LX_MNT_NODEV: ",nodev", |
| @@ -184,7 +184,7 @@ values of that process namespace""" | |||
| 184 | fstype = superblock['s_type']['name'].string() | 184 | fstype = superblock['s_type']['name'].string() |
| 185 | s_flags = int(superblock['s_flags']) | 185 | s_flags = int(superblock['s_flags']) |
| 186 | m_flags = int(vfs['mnt']['mnt_flags']) | 186 | m_flags = int(vfs['mnt']['mnt_flags']) |
| 187 | rd = "ro" if (s_flags & constants.LX_MS_RDONLY) else "rw" | 187 | rd = "ro" if (s_flags & constants.LX_SB_RDONLY) else "rw" |
| 188 | 188 | ||
| 189 | gdb.write( | 189 | gdb.write( |
| 190 | "{} {} {} {}{}{} 0 0\n" | 190 | "{} {} {} {}{}{} 0 0\n" |
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index f75e7bda4889..e17837f1d3f2 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c | |||
| @@ -62,11 +62,11 @@ static int all_symbols = 0; | |||
| 62 | static int absolute_percpu = 0; | 62 | static int absolute_percpu = 0; |
| 63 | static int base_relative = 0; | 63 | static int base_relative = 0; |
| 64 | 64 | ||
| 65 | int token_profit[0x10000]; | 65 | static int token_profit[0x10000]; |
| 66 | 66 | ||
| 67 | /* the table that holds the result of the compression */ | 67 | /* the table that holds the result of the compression */ |
| 68 | unsigned char best_table[256][2]; | 68 | static unsigned char best_table[256][2]; |
| 69 | unsigned char best_table_len[256]; | 69 | static unsigned char best_table_len[256]; |
| 70 | 70 | ||
| 71 | 71 | ||
| 72 | static void usage(void) | 72 | static void usage(void) |
| @@ -80,7 +80,7 @@ static void usage(void) | |||
| 80 | * This ignores the intensely annoying "mapping symbols" found | 80 | * This ignores the intensely annoying "mapping symbols" found |
| 81 | * in ARM ELF files: $a, $t and $d. | 81 | * in ARM ELF files: $a, $t and $d. |
| 82 | */ | 82 | */ |
| 83 | static inline int is_arm_mapping_symbol(const char *str) | 83 | static int is_arm_mapping_symbol(const char *str) |
| 84 | { | 84 | { |
| 85 | return str[0] == '$' && strchr("axtd", str[1]) | 85 | return str[0] == '$' && strchr("axtd", str[1]) |
| 86 | && (str[2] == '\0' || str[2] == '.'); | 86 | && (str[2] == '\0' || str[2] == '.'); |
| @@ -331,7 +331,7 @@ static void write_src(void) | |||
| 331 | unsigned int *markers; | 331 | unsigned int *markers; |
| 332 | char buf[KSYM_NAME_LEN]; | 332 | char buf[KSYM_NAME_LEN]; |
| 333 | 333 | ||
| 334 | printf("#include <asm/types.h>\n"); | 334 | printf("#include <asm/bitsperlong.h>\n"); |
| 335 | printf("#if BITS_PER_LONG == 64\n"); | 335 | printf("#if BITS_PER_LONG == 64\n"); |
| 336 | printf("#define PTR .quad\n"); | 336 | printf("#define PTR .quad\n"); |
| 337 | printf("#define ALGN .balign 8\n"); | 337 | printf("#define ALGN .balign 8\n"); |
| @@ -596,9 +596,6 @@ static void insert_real_symbols_in_table(void) | |||
| 596 | { | 596 | { |
| 597 | unsigned int i, j, c; | 597 | unsigned int i, j, c; |
| 598 | 598 | ||
| 599 | memset(best_table, 0, sizeof(best_table)); | ||
| 600 | memset(best_table_len, 0, sizeof(best_table_len)); | ||
| 601 | |||
| 602 | for (i = 0; i < table_cnt; i++) { | 599 | for (i = 0; i < table_cnt; i++) { |
| 603 | for (j = 0; j < table[i].len; j++) { | 600 | for (j = 0; j < table[i].len; j++) { |
| 604 | c = table[i].sym[j]; | 601 | c = table[i].sym[j]; |
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 181973509a05..7c5dc31c1d95 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile | |||
| @@ -143,11 +143,12 @@ help: | |||
| 143 | 143 | ||
| 144 | # =========================================================================== | 144 | # =========================================================================== |
| 145 | # object files used by all kconfig flavours | 145 | # object files used by all kconfig flavours |
| 146 | common-objs := confdata.o expr.o symbol.o preprocess.o zconf.lex.o zconf.tab.o | 146 | common-objs := confdata.o expr.o lexer.lex.o parser.tab.o preprocess.o \ |
| 147 | symbol.o | ||
| 147 | 148 | ||
| 148 | $(obj)/zconf.lex.o: $(obj)/zconf.tab.h | 149 | $(obj)/lexer.lex.o: $(obj)/parser.tab.h |
| 149 | HOSTCFLAGS_zconf.lex.o := -I$(src) | 150 | HOSTCFLAGS_lexer.lex.o := -I$(src) |
| 150 | HOSTCFLAGS_zconf.tab.o := -I$(src) | 151 | HOSTCFLAGS_parser.tab.o := -I$(src) |
| 151 | 152 | ||
| 152 | # conf: Used for defconfig, oldconfig and related targets | 153 | # conf: Used for defconfig, oldconfig and related targets |
| 153 | hostprogs-y += conf | 154 | hostprogs-y += conf |
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index da89ef788a8d..ef3678c24bab 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c | |||
| @@ -488,7 +488,6 @@ int main(int ac, char **av) | |||
| 488 | const char *progname = av[0]; | 488 | const char *progname = av[0]; |
| 489 | int opt; | 489 | int opt; |
| 490 | const char *name, *defconfig_file = NULL /* gcc uninit */; | 490 | const char *name, *defconfig_file = NULL /* gcc uninit */; |
| 491 | struct stat tmpstat; | ||
| 492 | int no_conf_write = 0; | 491 | int no_conf_write = 0; |
| 493 | 492 | ||
| 494 | tty_stdio = isatty(0) && isatty(1); | 493 | tty_stdio = isatty(0) && isatty(1); |
| @@ -560,18 +559,6 @@ int main(int ac, char **av) | |||
| 560 | name = av[optind]; | 559 | name = av[optind]; |
| 561 | conf_parse(name); | 560 | conf_parse(name); |
| 562 | //zconfdump(stdout); | 561 | //zconfdump(stdout); |
| 563 | if (sync_kconfig) { | ||
| 564 | name = conf_get_configname(); | ||
| 565 | if (stat(name, &tmpstat)) { | ||
| 566 | fprintf(stderr, "***\n" | ||
| 567 | "*** Configuration file \"%s\" not found!\n" | ||
| 568 | "***\n" | ||
| 569 | "*** Please run some configurator (e.g. \"make oldconfig\" or\n" | ||
| 570 | "*** \"make menuconfig\" or \"make xconfig\").\n" | ||
| 571 | "***\n", name); | ||
| 572 | exit(1); | ||
| 573 | } | ||
| 574 | } | ||
| 575 | 562 | ||
| 576 | switch (input_mode) { | 563 | switch (input_mode) { |
| 577 | case defconfig: | 564 | case defconfig: |
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h index 999edb60cd53..8dde65bc3165 100644 --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h | |||
| @@ -172,7 +172,7 @@ struct symbol { | |||
| 172 | * int "BAZ Value" | 172 | * int "BAZ Value" |
| 173 | * range 1..255 | 173 | * range 1..255 |
| 174 | * | 174 | * |
| 175 | * Please, also check zconf.y:print_symbol() when modifying the | 175 | * Please, also check parser.y:print_symbol() when modifying the |
| 176 | * list of property types! | 176 | * list of property types! |
| 177 | */ | 177 | */ |
| 178 | enum prop_type { | 178 | enum prop_type { |
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/lexer.l index b2d0a3b0bce9..c9df1c8b9824 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/lexer.l | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | #include <unistd.h> | 15 | #include <unistd.h> |
| 16 | 16 | ||
| 17 | #include "lkc.h" | 17 | #include "lkc.h" |
| 18 | #include "zconf.tab.h" | 18 | #include "parser.tab.h" |
| 19 | 19 | ||
| 20 | #define YY_DECL static int yylex1(void) | 20 | #define YY_DECL static int yylex1(void) |
| 21 | 21 | ||
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index 531ff7c57d92..d871539e4b45 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h | |||
| @@ -90,7 +90,7 @@ void *xrealloc(void *p, size_t size); | |||
| 90 | char *xstrdup(const char *s); | 90 | char *xstrdup(const char *s); |
| 91 | char *xstrndup(const char *s, size_t n); | 91 | char *xstrndup(const char *s, size_t n); |
| 92 | 92 | ||
| 93 | /* zconf.l */ | 93 | /* lexer.l */ |
| 94 | int yylex(void); | 94 | int yylex(void); |
| 95 | 95 | ||
| 96 | struct gstr { | 96 | struct gstr { |
diff --git a/scripts/kconfig/lxdialog/.gitignore b/scripts/kconfig/lxdialog/.gitignore deleted file mode 100644 index 90b08ff025a6..000000000000 --- a/scripts/kconfig/lxdialog/.gitignore +++ /dev/null | |||
| @@ -1,4 +0,0 @@ | |||
| 1 | # | ||
| 2 | # Generated files | ||
| 3 | # | ||
| 4 | lxdialog | ||
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/parser.y index 60936c76865b..60936c76865b 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/parser.y | |||
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 8be8a70c5542..ce7fc87a49a7 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc | |||
| @@ -1392,6 +1392,8 @@ ConfigMainWindow::ConfigMainWindow(void) | |||
| 1392 | conf_set_changed_callback(conf_changed); | 1392 | conf_set_changed_callback(conf_changed); |
| 1393 | // Set saveAction's initial state | 1393 | // Set saveAction's initial state |
| 1394 | conf_changed(); | 1394 | conf_changed(); |
| 1395 | configname = xstrdup(conf_get_configname()); | ||
| 1396 | |||
| 1395 | QAction *saveAsAction = new QAction("Save &As...", this); | 1397 | QAction *saveAsAction = new QAction("Save &As...", this); |
| 1396 | connect(saveAsAction, SIGNAL(triggered(bool)), SLOT(saveConfigAs())); | 1398 | connect(saveAsAction, SIGNAL(triggered(bool)), SLOT(saveConfigAs())); |
| 1397 | QAction *searchAction = new QAction("&Find", this); | 1399 | QAction *searchAction = new QAction("&Find", this); |
| @@ -1520,17 +1522,29 @@ ConfigMainWindow::ConfigMainWindow(void) | |||
| 1520 | 1522 | ||
| 1521 | void ConfigMainWindow::loadConfig(void) | 1523 | void ConfigMainWindow::loadConfig(void) |
| 1522 | { | 1524 | { |
| 1523 | QString s = QFileDialog::getOpenFileName(this, "", conf_get_configname()); | 1525 | QString str; |
| 1524 | if (s.isNull()) | 1526 | QByteArray ba; |
| 1527 | const char *name; | ||
| 1528 | |||
| 1529 | str = QFileDialog::getOpenFileName(this, "", configname); | ||
| 1530 | if (str.isNull()) | ||
| 1525 | return; | 1531 | return; |
| 1526 | if (conf_read(QFile::encodeName(s))) | 1532 | |
| 1533 | ba = str.toLocal8Bit(); | ||
| 1534 | name = ba.data(); | ||
| 1535 | |||
| 1536 | if (conf_read(name)) | ||
| 1527 | QMessageBox::information(this, "qconf", "Unable to load configuration!"); | 1537 | QMessageBox::information(this, "qconf", "Unable to load configuration!"); |
| 1538 | |||
| 1539 | free(configname); | ||
| 1540 | configname = xstrdup(name); | ||
| 1541 | |||
| 1528 | ConfigView::updateListAll(); | 1542 | ConfigView::updateListAll(); |
| 1529 | } | 1543 | } |
| 1530 | 1544 | ||
| 1531 | bool ConfigMainWindow::saveConfig(void) | 1545 | bool ConfigMainWindow::saveConfig(void) |
| 1532 | { | 1546 | { |
| 1533 | if (conf_write(NULL)) { | 1547 | if (conf_write(configname)) { |
| 1534 | QMessageBox::information(this, "qconf", "Unable to save configuration!"); | 1548 | QMessageBox::information(this, "qconf", "Unable to save configuration!"); |
| 1535 | return false; | 1549 | return false; |
| 1536 | } | 1550 | } |
| @@ -1541,10 +1555,24 @@ bool ConfigMainWindow::saveConfig(void) | |||
| 1541 | 1555 | ||
| 1542 | void ConfigMainWindow::saveConfigAs(void) | 1556 | void ConfigMainWindow::saveConfigAs(void) |
| 1543 | { | 1557 | { |
| 1544 | QString s = QFileDialog::getSaveFileName(this, "", conf_get_configname()); | 1558 | QString str; |
| 1545 | if (s.isNull()) | 1559 | QByteArray ba; |
| 1560 | const char *name; | ||
| 1561 | |||
| 1562 | str = QFileDialog::getSaveFileName(this, "", configname); | ||
| 1563 | if (str.isNull()) | ||
| 1546 | return; | 1564 | return; |
| 1547 | saveConfig(); | 1565 | |
| 1566 | ba = str.toLocal8Bit(); | ||
| 1567 | name = ba.data(); | ||
| 1568 | |||
| 1569 | if (conf_write(name)) { | ||
| 1570 | QMessageBox::information(this, "qconf", "Unable to save configuration!"); | ||
| 1571 | } | ||
| 1572 | conf_write_autoconf(0); | ||
| 1573 | |||
| 1574 | free(configname); | ||
| 1575 | configname = xstrdup(name); | ||
| 1548 | } | 1576 | } |
| 1549 | 1577 | ||
| 1550 | void ConfigMainWindow::searchConfig(void) | 1578 | void ConfigMainWindow::searchConfig(void) |
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h index 41df466e67d9..45bfe9b2b966 100644 --- a/scripts/kconfig/qconf.h +++ b/scripts/kconfig/qconf.h | |||
| @@ -291,6 +291,7 @@ protected: | |||
| 291 | class ConfigMainWindow : public QMainWindow { | 291 | class ConfigMainWindow : public QMainWindow { |
| 292 | Q_OBJECT | 292 | Q_OBJECT |
| 293 | 293 | ||
| 294 | char *configname; | ||
| 294 | static QAction *saveAction; | 295 | static QAction *saveAction; |
| 295 | static void conf_changed(void); | 296 | static void conf_changed(void); |
| 296 | public: | 297 | public: |
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index c5333d251985..3350e498b4ce 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
| @@ -1474,7 +1474,7 @@ sub push_parameter($$$$) { | |||
| 1474 | if (!defined $parameterdescs{$param} && $param !~ /^#/) { | 1474 | if (!defined $parameterdescs{$param} && $param !~ /^#/) { |
| 1475 | $parameterdescs{$param} = $undescribed; | 1475 | $parameterdescs{$param} = $undescribed; |
| 1476 | 1476 | ||
| 1477 | if (show_warnings($type, $declaration_name)) { | 1477 | if (show_warnings($type, $declaration_name) && $param !~ /\./) { |
| 1478 | print STDERR | 1478 | print STDERR |
| 1479 | "${file}:$.: warning: Function parameter or member '$param' not described in '$declaration_name'\n"; | 1479 | "${file}:$.: warning: Function parameter or member '$param' not described in '$declaration_name'\n"; |
| 1480 | ++$warnings; | 1480 | ++$warnings; |
diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl index 6a897788f5a7..ef9e5b2a1614 100755 --- a/scripts/leaking_addresses.pl +++ b/scripts/leaking_addresses.pl | |||
| @@ -97,7 +97,7 @@ Options: | |||
| 97 | --32-bit Scan 32-bit kernel. | 97 | --32-bit Scan 32-bit kernel. |
| 98 | --page-offset-32-bit=o Page offset (for 32-bit kernel 0xABCD1234). | 98 | --page-offset-32-bit=o Page offset (for 32-bit kernel 0xABCD1234). |
| 99 | -d, --debug Display debugging output. | 99 | -d, --debug Display debugging output. |
| 100 | -h, --help, --version Display this help and exit. | 100 | -h, --help Display this help and exit. |
| 101 | 101 | ||
| 102 | Scans the running kernel for potential leaking addresses. | 102 | Scans the running kernel for potential leaking addresses. |
| 103 | 103 | ||
| @@ -108,7 +108,6 @@ EOM | |||
| 108 | GetOptions( | 108 | GetOptions( |
| 109 | 'd|debug' => \$debug, | 109 | 'd|debug' => \$debug, |
| 110 | 'h|help' => \$help, | 110 | 'h|help' => \$help, |
| 111 | 'version' => \$help, | ||
| 112 | 'o|output-raw=s' => \$output_raw, | 111 | 'o|output-raw=s' => \$output_raw, |
| 113 | 'i|input-raw=s' => \$input_raw, | 112 | 'i|input-raw=s' => \$input_raw, |
| 114 | 'suppress-dmesg' => \$suppress_dmesg, | 113 | 'suppress-dmesg' => \$suppress_dmesg, |
| @@ -231,7 +230,7 @@ sub get_kernel_config_option | |||
| 231 | my $tmp_file = "/tmp/tmpkconf"; | 230 | my $tmp_file = "/tmp/tmpkconf"; |
| 232 | 231 | ||
| 233 | if (system("gunzip < /proc/config.gz > $tmp_file")) { | 232 | if (system("gunzip < /proc/config.gz > $tmp_file")) { |
| 234 | dprint "$0: system(gunzip < /proc/config.gz) failed\n"; | 233 | dprint("system(gunzip < /proc/config.gz) failed\n"); |
| 235 | return ""; | 234 | return ""; |
| 236 | } else { | 235 | } else { |
| 237 | @config_files = ($tmp_file); | 236 | @config_files = ($tmp_file); |
| @@ -243,7 +242,7 @@ sub get_kernel_config_option | |||
| 243 | } | 242 | } |
| 244 | 243 | ||
| 245 | foreach my $file (@config_files) { | 244 | foreach my $file (@config_files) { |
| 246 | dprint("parsing config file: %s\n", $file); | 245 | dprint("parsing config file: $file\n"); |
| 247 | $value = option_from_file($option, $file); | 246 | $value = option_from_file($option, $file); |
| 248 | if ($value ne "") { | 247 | if ($value ne "") { |
| 249 | last; | 248 | last; |
| @@ -502,7 +501,7 @@ sub walk | |||
| 502 | next; | 501 | next; |
| 503 | } | 502 | } |
| 504 | 503 | ||
| 505 | dprint "parsing: $path\n"; | 504 | dprint("parsing: $path\n"); |
| 506 | timed_parse_file($path); | 505 | timed_parse_file($path); |
| 507 | } | 506 | } |
| 508 | } | 507 | } |
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index c8cf45362bd6..dc0e8c5a1402 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh | |||
| @@ -3,22 +3,17 @@ | |||
| 3 | # | 3 | # |
| 4 | # link vmlinux | 4 | # link vmlinux |
| 5 | # | 5 | # |
| 6 | # vmlinux is linked from the objects selected by $(KBUILD_VMLINUX_INIT) and | 6 | # vmlinux is linked from the objects selected by $(KBUILD_VMLINUX_OBJS) and |
| 7 | # $(KBUILD_VMLINUX_MAIN) and $(KBUILD_VMLINUX_LIBS). Most are built-in.a files | 7 | # $(KBUILD_VMLINUX_LIBS). Most are built-in.a files from top-level directories |
| 8 | # from top-level directories in the kernel tree, others are specified in | 8 | # in the kernel tree, others are specified in arch/$(ARCH)/Makefile. |
| 9 | # arch/$(ARCH)/Makefile. Ordering when linking is important, and | 9 | # $(KBUILD_VMLINUX_LIBS) are archives which are linked conditionally |
| 10 | # $(KBUILD_VMLINUX_INIT) must be first. $(KBUILD_VMLINUX_LIBS) are archives | 10 | # (not within --whole-archive), and do not require symbol indexes added. |
| 11 | # which are linked conditionally (not within --whole-archive), and do not | ||
| 12 | # require symbol indexes added. | ||
| 13 | # | 11 | # |
| 14 | # vmlinux | 12 | # vmlinux |
| 15 | # ^ | 13 | # ^ |
| 16 | # | | 14 | # | |
| 17 | # +-< $(KBUILD_VMLINUX_INIT) | 15 | # +--< $(KBUILD_VMLINUX_OBJS) |
| 18 | # | +--< init/version.o + more | 16 | # | +--< init/built-in.a drivers/built-in.a mm/built-in.a + more |
| 19 | # | | ||
| 20 | # +--< $(KBUILD_VMLINUX_MAIN) | ||
| 21 | # | +--< drivers/built-in.a mm/built-in.a + more | ||
| 22 | # | | 17 | # | |
| 23 | # +--< $(KBUILD_VMLINUX_LIBS) | 18 | # +--< $(KBUILD_VMLINUX_LIBS) |
| 24 | # | +--< lib/lib.a + more | 19 | # | +--< lib/lib.a + more |
| @@ -44,24 +39,6 @@ info() | |||
| 44 | fi | 39 | fi |
| 45 | } | 40 | } |
| 46 | 41 | ||
| 47 | # Thin archive build here makes a final archive with symbol table and indexes | ||
| 48 | # from vmlinux objects INIT and MAIN, which can be used as input to linker. | ||
| 49 | # KBUILD_VMLINUX_LIBS archives should already have symbol table and indexes | ||
| 50 | # added. | ||
| 51 | # | ||
| 52 | # Traditional incremental style of link does not require this step | ||
| 53 | # | ||
| 54 | # built-in.a output file | ||
| 55 | # | ||
| 56 | archive_builtin() | ||
| 57 | { | ||
| 58 | info AR built-in.a | ||
| 59 | rm -f built-in.a; | ||
| 60 | ${AR} rcsTP${KBUILD_ARFLAGS} built-in.a \ | ||
| 61 | ${KBUILD_VMLINUX_INIT} \ | ||
| 62 | ${KBUILD_VMLINUX_MAIN} | ||
| 63 | } | ||
| 64 | |||
| 65 | # Link of vmlinux.o used for section mismatch analysis | 42 | # Link of vmlinux.o used for section mismatch analysis |
| 66 | # ${1} output file | 43 | # ${1} output file |
| 67 | modpost_link() | 44 | modpost_link() |
| @@ -69,7 +46,7 @@ modpost_link() | |||
| 69 | local objects | 46 | local objects |
| 70 | 47 | ||
| 71 | objects="--whole-archive \ | 48 | objects="--whole-archive \ |
| 72 | built-in.a \ | 49 | ${KBUILD_VMLINUX_OBJS} \ |
| 73 | --no-whole-archive \ | 50 | --no-whole-archive \ |
| 74 | --start-group \ | 51 | --start-group \ |
| 75 | ${KBUILD_VMLINUX_LIBS} \ | 52 | ${KBUILD_VMLINUX_LIBS} \ |
| @@ -88,7 +65,7 @@ vmlinux_link() | |||
| 88 | 65 | ||
| 89 | if [ "${SRCARCH}" != "um" ]; then | 66 | if [ "${SRCARCH}" != "um" ]; then |
| 90 | objects="--whole-archive \ | 67 | objects="--whole-archive \ |
| 91 | built-in.a \ | 68 | ${KBUILD_VMLINUX_OBJS} \ |
| 92 | --no-whole-archive \ | 69 | --no-whole-archive \ |
| 93 | --start-group \ | 70 | --start-group \ |
| 94 | ${KBUILD_VMLINUX_LIBS} \ | 71 | ${KBUILD_VMLINUX_LIBS} \ |
| @@ -99,7 +76,7 @@ vmlinux_link() | |||
| 99 | -T ${lds} ${objects} | 76 | -T ${lds} ${objects} |
| 100 | else | 77 | else |
| 101 | objects="-Wl,--whole-archive \ | 78 | objects="-Wl,--whole-archive \ |
| 102 | built-in.a \ | 79 | ${KBUILD_VMLINUX_OBJS} \ |
| 103 | -Wl,--no-whole-archive \ | 80 | -Wl,--no-whole-archive \ |
| 104 | -Wl,--start-group \ | 81 | -Wl,--start-group \ |
| 105 | ${KBUILD_VMLINUX_LIBS} \ | 82 | ${KBUILD_VMLINUX_LIBS} \ |
| @@ -160,7 +137,6 @@ cleanup() | |||
| 160 | rm -f .tmp_System.map | 137 | rm -f .tmp_System.map |
| 161 | rm -f .tmp_kallsyms* | 138 | rm -f .tmp_kallsyms* |
| 162 | rm -f .tmp_vmlinux* | 139 | rm -f .tmp_vmlinux* |
| 163 | rm -f built-in.a | ||
| 164 | rm -f System.map | 140 | rm -f System.map |
| 165 | rm -f vmlinux | 141 | rm -f vmlinux |
| 166 | rm -f vmlinux.o | 142 | rm -f vmlinux.o |
| @@ -195,14 +171,7 @@ if [ "$1" = "clean" ]; then | |||
| 195 | fi | 171 | fi |
| 196 | 172 | ||
| 197 | # We need access to CONFIG_ symbols | 173 | # We need access to CONFIG_ symbols |
| 198 | case "${KCONFIG_CONFIG}" in | 174 | . include/config/auto.conf |
| 199 | */*) | ||
| 200 | . "${KCONFIG_CONFIG}" | ||
| 201 | ;; | ||
| 202 | *) | ||
| 203 | # Force using a file from the current directory | ||
| 204 | . "./${KCONFIG_CONFIG}" | ||
| 205 | esac | ||
| 206 | 175 | ||
| 207 | # Update version | 176 | # Update version |
| 208 | info GEN .version | 177 | info GEN .version |
| @@ -217,8 +186,6 @@ fi; | |||
| 217 | # final build of init/ | 186 | # final build of init/ |
| 218 | ${MAKE} -f "${srctree}/scripts/Makefile.build" obj=init | 187 | ${MAKE} -f "${srctree}/scripts/Makefile.build" obj=init |
| 219 | 188 | ||
| 220 | archive_builtin | ||
| 221 | |||
| 222 | #link vmlinux.o | 189 | #link vmlinux.o |
| 223 | info LD vmlinux.o | 190 | info LD vmlinux.o |
| 224 | modpost_link vmlinux.o | 191 | modpost_link vmlinux.o |
diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h index 87f1fc9801d7..2339f86126cb 100755 --- a/scripts/mkcompile_h +++ b/scripts/mkcompile_h | |||
| @@ -62,7 +62,7 @@ UTS_TRUNCATE="cut -b -$UTS_LEN" | |||
| 62 | 62 | ||
| 63 | # Generate a temporary compile.h | 63 | # Generate a temporary compile.h |
| 64 | 64 | ||
| 65 | ( echo /\* This file is auto generated, version $VERSION \*/ | 65 | { echo /\* This file is auto generated, version $VERSION \*/ |
| 66 | if [ -n "$CONFIG_FLAGS" ] ; then echo "/* $CONFIG_FLAGS */"; fi | 66 | if [ -n "$CONFIG_FLAGS" ] ; then echo "/* $CONFIG_FLAGS */"; fi |
| 67 | 67 | ||
| 68 | echo \#define UTS_MACHINE \"$ARCH\" | 68 | echo \#define UTS_MACHINE \"$ARCH\" |
| @@ -73,7 +73,7 @@ UTS_TRUNCATE="cut -b -$UTS_LEN" | |||
| 73 | echo \#define LINUX_COMPILE_HOST \"`echo $LINUX_COMPILE_HOST | $UTS_TRUNCATE`\" | 73 | echo \#define LINUX_COMPILE_HOST \"`echo $LINUX_COMPILE_HOST | $UTS_TRUNCATE`\" |
| 74 | 74 | ||
| 75 | echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | grep ' version ' | sed 's/[[:space:]]*$//'`\" | 75 | echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | grep ' version ' | sed 's/[[:space:]]*$//'`\" |
| 76 | ) > .tmpcompile | 76 | } > .tmpcompile |
| 77 | 77 | ||
| 78 | # Only replace the real compile.h if the new one is different, | 78 | # Only replace the real compile.h if the new one is different, |
| 79 | # in order to preserve the timestamp and avoid unnecessary | 79 | # in order to preserve the timestamp and avoid unnecessary |
diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c index 293004499b4d..054405b90ba4 100644 --- a/scripts/mod/devicetable-offsets.c +++ b/scripts/mod/devicetable-offsets.c | |||
| @@ -225,5 +225,11 @@ int main(void) | |||
| 225 | DEVID_FIELD(typec_device_id, svid); | 225 | DEVID_FIELD(typec_device_id, svid); |
| 226 | DEVID_FIELD(typec_device_id, mode); | 226 | DEVID_FIELD(typec_device_id, mode); |
| 227 | 227 | ||
| 228 | DEVID(tee_client_device_id); | ||
| 229 | DEVID_FIELD(tee_client_device_id, uuid); | ||
| 230 | |||
| 231 | DEVID(wmi_device_id); | ||
| 232 | DEVID_FIELD(wmi_device_id, guid_string); | ||
| 233 | |||
| 228 | return 0; | 234 | return 0; |
| 229 | } | 235 | } |
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index a37af7d71973..e17a29ae2e97 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
| @@ -37,6 +37,10 @@ typedef unsigned char __u8; | |||
| 37 | typedef struct { | 37 | typedef struct { |
| 38 | __u8 b[16]; | 38 | __u8 b[16]; |
| 39 | } uuid_le; | 39 | } uuid_le; |
| 40 | typedef struct { | ||
| 41 | __u8 b[16]; | ||
| 42 | } uuid_t; | ||
| 43 | #define UUID_STRING_LEN 36 | ||
| 40 | 44 | ||
| 41 | /* Big exception to the "don't include kernel headers into userspace, which | 45 | /* Big exception to the "don't include kernel headers into userspace, which |
| 42 | * even potentially has different endianness and word sizes, since | 46 | * even potentially has different endianness and word sizes, since |
| @@ -50,6 +54,9 @@ struct devtable { | |||
| 50 | int (*do_entry)(const char *filename, void *symval, char *alias); | 54 | int (*do_entry)(const char *filename, void *symval, char *alias); |
| 51 | }; | 55 | }; |
| 52 | 56 | ||
| 57 | /* Size of alias provided to do_entry functions */ | ||
| 58 | #define ALIAS_SIZE 500 | ||
| 59 | |||
| 53 | /* Define a variable f that holds the value of field f of struct devid | 60 | /* Define a variable f that holds the value of field f of struct devid |
| 54 | * based at address m. | 61 | * based at address m. |
| 55 | */ | 62 | */ |
| @@ -1287,6 +1294,42 @@ static int do_typec_entry(const char *filename, void *symval, char *alias) | |||
| 1287 | return 1; | 1294 | return 1; |
| 1288 | } | 1295 | } |
| 1289 | 1296 | ||
| 1297 | /* Looks like: tee:uuid */ | ||
| 1298 | static int do_tee_entry(const char *filename, void *symval, char *alias) | ||
| 1299 | { | ||
| 1300 | DEF_FIELD(symval, tee_client_device_id, uuid); | ||
| 1301 | |||
| 1302 | sprintf(alias, "tee:%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", | ||
| 1303 | uuid.b[0], uuid.b[1], uuid.b[2], uuid.b[3], uuid.b[4], | ||
| 1304 | uuid.b[5], uuid.b[6], uuid.b[7], uuid.b[8], uuid.b[9], | ||
| 1305 | uuid.b[10], uuid.b[11], uuid.b[12], uuid.b[13], uuid.b[14], | ||
| 1306 | uuid.b[15]); | ||
| 1307 | |||
| 1308 | add_wildcard(alias); | ||
| 1309 | return 1; | ||
| 1310 | } | ||
| 1311 | |||
| 1312 | /* Looks like: wmi:guid */ | ||
| 1313 | static int do_wmi_entry(const char *filename, void *symval, char *alias) | ||
| 1314 | { | ||
| 1315 | int len; | ||
| 1316 | DEF_FIELD_ADDR(symval, wmi_device_id, guid_string); | ||
| 1317 | |||
| 1318 | if (strlen(*guid_string) != UUID_STRING_LEN) { | ||
| 1319 | warn("Invalid WMI device id 'wmi:%s' in '%s'\n", | ||
| 1320 | *guid_string, filename); | ||
| 1321 | return 0; | ||
| 1322 | } | ||
| 1323 | |||
| 1324 | len = snprintf(alias, ALIAS_SIZE, WMI_MODULE_PREFIX "%s", *guid_string); | ||
| 1325 | if (len < 0 || len >= ALIAS_SIZE) { | ||
| 1326 | warn("Could not generate all MODULE_ALIAS's in '%s'\n", | ||
| 1327 | filename); | ||
| 1328 | return 0; | ||
| 1329 | } | ||
| 1330 | return 1; | ||
| 1331 | } | ||
| 1332 | |||
| 1290 | /* Does namelen bytes of name exactly match the symbol? */ | 1333 | /* Does namelen bytes of name exactly match the symbol? */ |
| 1291 | static bool sym_is(const char *name, unsigned namelen, const char *symbol) | 1334 | static bool sym_is(const char *name, unsigned namelen, const char *symbol) |
| 1292 | { | 1335 | { |
| @@ -1303,7 +1346,7 @@ static void do_table(void *symval, unsigned long size, | |||
| 1303 | struct module *mod) | 1346 | struct module *mod) |
| 1304 | { | 1347 | { |
| 1305 | unsigned int i; | 1348 | unsigned int i; |
| 1306 | char alias[500]; | 1349 | char alias[ALIAS_SIZE]; |
| 1307 | 1350 | ||
| 1308 | device_id_check(mod->name, device_id, size, id_size, symval); | 1351 | device_id_check(mod->name, device_id, size, id_size, symval); |
| 1309 | /* Leave last one: it's the terminator. */ | 1352 | /* Leave last one: it's the terminator. */ |
| @@ -1357,6 +1400,8 @@ static const struct devtable devtable[] = { | |||
| 1357 | {"fslmc", SIZE_fsl_mc_device_id, do_fsl_mc_entry}, | 1400 | {"fslmc", SIZE_fsl_mc_device_id, do_fsl_mc_entry}, |
| 1358 | {"tbsvc", SIZE_tb_service_id, do_tbsvc_entry}, | 1401 | {"tbsvc", SIZE_tb_service_id, do_tbsvc_entry}, |
| 1359 | {"typec", SIZE_typec_device_id, do_typec_entry}, | 1402 | {"typec", SIZE_typec_device_id, do_typec_entry}, |
| 1403 | {"tee", SIZE_tee_client_device_id, do_tee_entry}, | ||
| 1404 | {"wmi", SIZE_wmi_device_id, do_wmi_entry}, | ||
| 1360 | }; | 1405 | }; |
| 1361 | 1406 | ||
| 1362 | /* Create MODULE_ALIAS() statements. | 1407 | /* Create MODULE_ALIAS() statements. |
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 26bf886bd168..0b0d1080b1c5 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
| @@ -35,7 +35,6 @@ static int vmlinux_section_warnings = 1; | |||
| 35 | static int warn_unresolved = 0; | 35 | static int warn_unresolved = 0; |
| 36 | /* How a symbol is exported */ | 36 | /* How a symbol is exported */ |
| 37 | static int sec_mismatch_count = 0; | 37 | static int sec_mismatch_count = 0; |
| 38 | static int sec_mismatch_verbose = 1; | ||
| 39 | static int sec_mismatch_fatal = 0; | 38 | static int sec_mismatch_fatal = 0; |
| 40 | /* ignore missing files */ | 39 | /* ignore missing files */ |
| 41 | static int ignore_missing_files; | 40 | static int ignore_missing_files; |
| @@ -1406,8 +1405,6 @@ static void report_sec_mismatch(const char *modname, | |||
| 1406 | char *prl_to; | 1405 | char *prl_to; |
| 1407 | 1406 | ||
| 1408 | sec_mismatch_count++; | 1407 | sec_mismatch_count++; |
| 1409 | if (!sec_mismatch_verbose) | ||
| 1410 | return; | ||
| 1411 | 1408 | ||
| 1412 | get_pretty_name(from_is_func, &from, &from_p); | 1409 | get_pretty_name(from_is_func, &from, &from_p); |
| 1413 | get_pretty_name(to_is_func, &to, &to_p); | 1410 | get_pretty_name(to_is_func, &to, &to_p); |
| @@ -1655,9 +1652,7 @@ static void extable_mismatch_handler(const char* modname, struct elf_info *elf, | |||
| 1655 | 1652 | ||
| 1656 | sec_mismatch_count++; | 1653 | sec_mismatch_count++; |
| 1657 | 1654 | ||
| 1658 | if (sec_mismatch_verbose) | 1655 | report_extable_warnings(modname, elf, mismatch, r, sym, fromsec, tosec); |
| 1659 | report_extable_warnings(modname, elf, mismatch, r, sym, | ||
| 1660 | fromsec, tosec); | ||
| 1661 | 1656 | ||
| 1662 | if (match(tosec, mismatch->bad_tosec)) | 1657 | if (match(tosec, mismatch->bad_tosec)) |
| 1663 | fatal("The relocation at %s+0x%lx references\n" | 1658 | fatal("The relocation at %s+0x%lx references\n" |
| @@ -2433,7 +2428,7 @@ int main(int argc, char **argv) | |||
| 2433 | struct ext_sym_list *extsym_iter; | 2428 | struct ext_sym_list *extsym_iter; |
| 2434 | struct ext_sym_list *extsym_start = NULL; | 2429 | struct ext_sym_list *extsym_start = NULL; |
| 2435 | 2430 | ||
| 2436 | while ((opt = getopt(argc, argv, "i:I:e:mnsST:o:awE")) != -1) { | 2431 | while ((opt = getopt(argc, argv, "i:I:e:mnsT:o:awE")) != -1) { |
| 2437 | switch (opt) { | 2432 | switch (opt) { |
| 2438 | case 'i': | 2433 | case 'i': |
| 2439 | kernel_read = optarg; | 2434 | kernel_read = optarg; |
| @@ -2465,9 +2460,6 @@ int main(int argc, char **argv) | |||
| 2465 | case 's': | 2460 | case 's': |
| 2466 | vmlinux_section_warnings = 0; | 2461 | vmlinux_section_warnings = 0; |
| 2467 | break; | 2462 | break; |
| 2468 | case 'S': | ||
| 2469 | sec_mismatch_verbose = 0; | ||
| 2470 | break; | ||
| 2471 | case 'T': | 2463 | case 'T': |
| 2472 | files_source = optarg; | 2464 | files_source = optarg; |
| 2473 | break; | 2465 | break; |
| @@ -2525,18 +2517,9 @@ int main(int argc, char **argv) | |||
| 2525 | } | 2517 | } |
| 2526 | if (dump_write) | 2518 | if (dump_write) |
| 2527 | write_dump(dump_write); | 2519 | write_dump(dump_write); |
| 2528 | if (sec_mismatch_count) { | 2520 | if (sec_mismatch_count && sec_mismatch_fatal) |
| 2529 | if (!sec_mismatch_verbose) { | 2521 | fatal("modpost: Section mismatches detected.\n" |
| 2530 | warn("modpost: Found %d section mismatch(es).\n" | 2522 | "Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n"); |
| 2531 | "To see full details build your kernel with:\n" | ||
| 2532 | "'make CONFIG_DEBUG_SECTION_MISMATCH=y'\n", | ||
| 2533 | sec_mismatch_count); | ||
| 2534 | } | ||
| 2535 | if (sec_mismatch_fatal) { | ||
| 2536 | fatal("modpost: Section mismatches detected.\n" | ||
| 2537 | "Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n"); | ||
| 2538 | } | ||
| 2539 | } | ||
| 2540 | free(buf.p); | 2523 | free(buf.p); |
| 2541 | 2524 | ||
| 2542 | return err; | 2525 | return err; |
diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 453fecee62f0..2c6de21e5152 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile | |||
| @@ -59,7 +59,7 @@ rpm-pkg: FORCE | |||
| 59 | # binrpm-pkg | 59 | # binrpm-pkg |
| 60 | # --------------------------------------------------------------------------- | 60 | # --------------------------------------------------------------------------- |
| 61 | binrpm-pkg: FORCE | 61 | binrpm-pkg: FORCE |
| 62 | $(MAKE) KBUILD_SRC= | 62 | $(MAKE) -f $(srctree)/Makefile |
| 63 | $(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/binkernel.spec | 63 | $(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/binkernel.spec |
| 64 | +rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \ | 64 | +rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \ |
| 65 | $(UTS_MACHINE) -bb $(objtree)/binkernel.spec | 65 | $(UTS_MACHINE) -bb $(objtree)/binkernel.spec |
| @@ -72,11 +72,11 @@ deb-pkg: FORCE | |||
| 72 | $(call cmd,src_tar,$(KDEB_SOURCENAME)) | 72 | $(call cmd,src_tar,$(KDEB_SOURCENAME)) |
| 73 | origversion=$$(dpkg-parsechangelog -SVersion |sed 's/-[^-]*$$//');\ | 73 | origversion=$$(dpkg-parsechangelog -SVersion |sed 's/-[^-]*$$//');\ |
| 74 | mv $(KDEB_SOURCENAME).tar.gz ../$(KDEB_SOURCENAME)_$${origversion}.orig.tar.gz | 74 | mv $(KDEB_SOURCENAME).tar.gz ../$(KDEB_SOURCENAME)_$${origversion}.orig.tar.gz |
| 75 | +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) -i.git -us -uc | 75 | +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -i.git -us -uc |
| 76 | 76 | ||
| 77 | bindeb-pkg: FORCE | 77 | bindeb-pkg: FORCE |
| 78 | $(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian | 78 | $(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian |
| 79 | +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) -b -nc -uc | 79 | +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -b -nc -uc |
| 80 | 80 | ||
| 81 | intdeb-pkg: FORCE | 81 | intdeb-pkg: FORCE |
| 82 | +$(CONFIG_SHELL) $(srctree)/scripts/package/builddeb | 82 | +$(CONFIG_SHELL) $(srctree)/scripts/package/builddeb |
| @@ -102,7 +102,7 @@ clean-dirs += $(objtree)/snap/ | |||
| 102 | # tarball targets | 102 | # tarball targets |
| 103 | # --------------------------------------------------------------------------- | 103 | # --------------------------------------------------------------------------- |
| 104 | tar%pkg: FORCE | 104 | tar%pkg: FORCE |
| 105 | $(MAKE) KBUILD_SRC= | 105 | $(MAKE) -f $(srctree)/Makefile |
| 106 | $(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@ | 106 | $(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@ |
| 107 | 107 | ||
| 108 | clean-dirs += $(objtree)/tar-install/ | 108 | clean-dirs += $(objtree)/tar-install/ |
diff --git a/scripts/package/builddeb b/scripts/package/builddeb index f43a274f4f1d..b03dd56a4782 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb | |||
| @@ -12,6 +12,18 @@ | |||
| 12 | 12 | ||
| 13 | set -e | 13 | set -e |
| 14 | 14 | ||
| 15 | is_enabled() { | ||
| 16 | grep -q "^$1=y" include/config/auto.conf | ||
| 17 | } | ||
| 18 | |||
| 19 | if_enabled_echo() { | ||
| 20 | if is_enabled "$1"; then | ||
| 21 | echo -n "$2" | ||
| 22 | elif [ $# -ge 3 ]; then | ||
| 23 | echo -n "$3" | ||
| 24 | fi | ||
| 25 | } | ||
| 26 | |||
| 15 | create_package() { | 27 | create_package() { |
| 16 | local pname="$1" pdir="$2" | 28 | local pname="$1" pdir="$2" |
| 17 | 29 | ||
| @@ -62,7 +74,7 @@ parisc|mips|powerpc) | |||
| 62 | installed_image_path="boot/vmlinuz-$version" | 74 | installed_image_path="boot/vmlinuz-$version" |
| 63 | esac | 75 | esac |
| 64 | 76 | ||
| 65 | BUILD_DEBUG="$(grep -s '^CONFIG_DEBUG_INFO=y' $KCONFIG_CONFIG || true)" | 77 | BUILD_DEBUG=$(if_enabled_echo CONFIG_DEBUG_INFO Yes) |
| 66 | 78 | ||
| 67 | # Setup the directory structure | 79 | # Setup the directory structure |
| 68 | rm -rf "$tmpdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" $objtree/debian/files | 80 | rm -rf "$tmpdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" $objtree/debian/files |
| @@ -83,15 +95,15 @@ else | |||
| 83 | fi | 95 | fi |
| 84 | cp "$($MAKE -s -f $srctree/Makefile image_name)" "$tmpdir/$installed_image_path" | 96 | cp "$($MAKE -s -f $srctree/Makefile image_name)" "$tmpdir/$installed_image_path" |
| 85 | 97 | ||
| 86 | if grep -q "^CONFIG_OF_EARLY_FLATTREE=y" $KCONFIG_CONFIG ; then | 98 | if is_enabled CONFIG_OF_EARLY_FLATTREE; then |
| 87 | # Only some architectures with OF support have this target | 99 | # Only some architectures with OF support have this target |
| 88 | if [ -d "${srctree}/arch/$SRCARCH/boot/dts" ]; then | 100 | if [ -d "${srctree}/arch/$SRCARCH/boot/dts" ]; then |
| 89 | $MAKE KBUILD_SRC= INSTALL_DTBS_PATH="$tmpdir/usr/lib/$packagename" dtbs_install | 101 | $MAKE -f $srctree/Makefile INSTALL_DTBS_PATH="$tmpdir/usr/lib/$packagename" dtbs_install |
| 90 | fi | 102 | fi |
| 91 | fi | 103 | fi |
| 92 | 104 | ||
| 93 | if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then | 105 | if is_enabled CONFIG_MODULES; then |
| 94 | INSTALL_MOD_PATH="$tmpdir" $MAKE KBUILD_SRC= modules_install | 106 | INSTALL_MOD_PATH="$tmpdir" $MAKE -f $srctree/Makefile modules_install |
| 95 | rm -f "$tmpdir/lib/modules/$version/build" | 107 | rm -f "$tmpdir/lib/modules/$version/build" |
| 96 | rm -f "$tmpdir/lib/modules/$version/source" | 108 | rm -f "$tmpdir/lib/modules/$version/source" |
| 97 | if [ "$ARCH" = "um" ] ; then | 109 | if [ "$ARCH" = "um" ] ; then |
| @@ -111,16 +123,15 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then | |||
| 111 | done | 123 | done |
| 112 | 124 | ||
| 113 | # resign stripped modules | 125 | # resign stripped modules |
| 114 | MODULE_SIG_ALL="$(grep -s '^CONFIG_MODULE_SIG_ALL=y' $KCONFIG_CONFIG || true)" | 126 | if is_enabled CONFIG_MODULE_SIG_ALL; then |
| 115 | if [ -n "$MODULE_SIG_ALL" ]; then | 127 | INSTALL_MOD_PATH="$tmpdir" $MAKE -f $srctree/Makefile modules_sign |
| 116 | INSTALL_MOD_PATH="$tmpdir" $MAKE KBUILD_SRC= modules_sign | ||
| 117 | fi | 128 | fi |
| 118 | fi | 129 | fi |
| 119 | fi | 130 | fi |
| 120 | 131 | ||
| 121 | if [ "$ARCH" != "um" ]; then | 132 | if [ "$ARCH" != "um" ]; then |
| 122 | $MAKE headers_check KBUILD_SRC= | 133 | $MAKE -f $srctree/Makefile headers_check |
| 123 | $MAKE headers_install KBUILD_SRC= INSTALL_HDR_PATH="$libc_headers_dir/usr" | 134 | $MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH="$libc_headers_dir/usr" |
| 124 | fi | 135 | fi |
| 125 | 136 | ||
| 126 | # Install the maintainer scripts | 137 | # Install the maintainer scripts |
| @@ -129,11 +140,6 @@ fi | |||
| 129 | # make-kpkg sets $INITRD to indicate whether an initramfs is wanted, and | 140 | # make-kpkg sets $INITRD to indicate whether an initramfs is wanted, and |
| 130 | # so do we; recent versions of dracut and initramfs-tools will obey this. | 141 | # so do we; recent versions of dracut and initramfs-tools will obey this. |
| 131 | debhookdir=${KDEB_HOOKDIR:-/etc/kernel} | 142 | debhookdir=${KDEB_HOOKDIR:-/etc/kernel} |
| 132 | if grep -q '^CONFIG_BLK_DEV_INITRD=y' $KCONFIG_CONFIG; then | ||
| 133 | want_initrd=Yes | ||
| 134 | else | ||
| 135 | want_initrd=No | ||
| 136 | fi | ||
| 137 | for script in postinst postrm preinst prerm ; do | 143 | for script in postinst postrm preinst prerm ; do |
| 138 | mkdir -p "$tmpdir$debhookdir/$script.d" | 144 | mkdir -p "$tmpdir$debhookdir/$script.d" |
| 139 | cat <<EOF > "$tmpdir/DEBIAN/$script" | 145 | cat <<EOF > "$tmpdir/DEBIAN/$script" |
| @@ -145,7 +151,7 @@ set -e | |||
| 145 | export DEB_MAINT_PARAMS="\$*" | 151 | export DEB_MAINT_PARAMS="\$*" |
| 146 | 152 | ||
| 147 | # Tell initramfs builder whether it's wanted | 153 | # Tell initramfs builder whether it's wanted |
| 148 | export INITRD=$want_initrd | 154 | export INITRD=$(if_enabled_echo CONFIG_BLK_DEV_INITRD Yes No) |
| 149 | 155 | ||
| 150 | test -d $debhookdir/$script.d && run-parts --arg="$version" --arg="/$installed_image_path" $debhookdir/$script.d | 156 | test -d $debhookdir/$script.d && run-parts --arg="$version" --arg="/$installed_image_path" $debhookdir/$script.d |
| 151 | exit 0 | 157 | exit 0 |
| @@ -158,11 +164,11 @@ done | |||
| 158 | (cd $srctree; find arch/*/include include scripts -type f -o -type l) >> "$objtree/debian/hdrsrcfiles" | 164 | (cd $srctree; find arch/*/include include scripts -type f -o -type l) >> "$objtree/debian/hdrsrcfiles" |
| 159 | (cd $srctree; find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform) >> "$objtree/debian/hdrsrcfiles" | 165 | (cd $srctree; find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform) >> "$objtree/debian/hdrsrcfiles" |
| 160 | (cd $srctree; find $(find arch/$SRCARCH -name include -o -name scripts -type d) -type f) >> "$objtree/debian/hdrsrcfiles" | 166 | (cd $srctree; find $(find arch/$SRCARCH -name include -o -name scripts -type d) -type f) >> "$objtree/debian/hdrsrcfiles" |
| 161 | if grep -q '^CONFIG_STACK_VALIDATION=y' $KCONFIG_CONFIG ; then | 167 | if is_enabled CONFIG_STACK_VALIDATION; then |
| 162 | (cd $objtree; find tools/objtool -type f -executable) >> "$objtree/debian/hdrobjfiles" | 168 | (cd $objtree; find tools/objtool -type f -executable) >> "$objtree/debian/hdrobjfiles" |
| 163 | fi | 169 | fi |
| 164 | (cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f) >> "$objtree/debian/hdrobjfiles" | 170 | (cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f) >> "$objtree/debian/hdrobjfiles" |
| 165 | if grep -q '^CONFIG_GCC_PLUGINS=y' $KCONFIG_CONFIG ; then | 171 | if is_enabled CONFIG_GCC_PLUGINS; then |
| 166 | (cd $objtree; find scripts/gcc-plugins -name \*.so -o -name gcc-common.h) >> "$objtree/debian/hdrobjfiles" | 172 | (cd $objtree; find scripts/gcc-plugins -name \*.so -o -name gcc-common.h) >> "$objtree/debian/hdrobjfiles" |
| 167 | fi | 173 | fi |
| 168 | destdir=$kernel_headers_dir/usr/src/linux-headers-$version | 174 | destdir=$kernel_headers_dir/usr/src/linux-headers-$version |
diff --git a/scripts/package/buildtar b/scripts/package/buildtar index d624a07a4e77..2f66c81e4021 100755 --- a/scripts/package/buildtar +++ b/scripts/package/buildtar | |||
| @@ -56,8 +56,8 @@ dirs=boot | |||
| 56 | # | 56 | # |
| 57 | # Try to install modules | 57 | # Try to install modules |
| 58 | # | 58 | # |
| 59 | if grep -q '^CONFIG_MODULES=y' "${KCONFIG_CONFIG}"; then | 59 | if grep -q '^CONFIG_MODULES=y' include/config/auto.conf; then |
| 60 | make ARCH="${ARCH}" O="${objtree}" KBUILD_SRC= INSTALL_MOD_PATH="${tmpdir}" modules_install | 60 | make ARCH="${ARCH}" -f ${srctree}/Makefile INSTALL_MOD_PATH="${tmpdir}" modules_install |
| 61 | dirs="$dirs lib" | 61 | dirs="$dirs lib" |
| 62 | fi | 62 | fi |
| 63 | 63 | ||
diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian index edcad61fe3cd..8351584cb24e 100755 --- a/scripts/package/mkdebian +++ b/scripts/package/mkdebian | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | set -e | 7 | set -e |
| 8 | 8 | ||
| 9 | is_enabled() { | 9 | is_enabled() { |
| 10 | grep -q "^CONFIG_$1=y" $KCONFIG_CONFIG | 10 | grep -q "^$1=y" include/config/auto.conf |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | if_enabled_echo() { | 13 | if_enabled_echo() { |
| @@ -31,23 +31,23 @@ set_debarch() { | |||
| 31 | x86_64) | 31 | x86_64) |
| 32 | debarch=amd64 ;; | 32 | debarch=amd64 ;; |
| 33 | sparc*) | 33 | sparc*) |
| 34 | debarch=sparc$(if_enabled_echo 64BIT 64) ;; | 34 | debarch=sparc$(if_enabled_echo CONFIG_64BIT 64) ;; |
| 35 | s390*) | 35 | s390*) |
| 36 | debarch=s390x ;; | 36 | debarch=s390x ;; |
| 37 | ppc*) | 37 | ppc*) |
| 38 | if is_enabled 64BIT; then | 38 | if is_enabled CONFIG_64BIT; then |
| 39 | debarch=ppc64$(if_enabled_echo CPU_LITTLE_ENDIAN el) | 39 | debarch=ppc64$(if_enabled_echo CONFIG_CPU_LITTLE_ENDIAN el) |
| 40 | else | 40 | else |
| 41 | debarch=powerpc$(if_enabled_echo SPE spe) | 41 | debarch=powerpc$(if_enabled_echo CONFIG_SPE spe) |
| 42 | fi | 42 | fi |
| 43 | ;; | 43 | ;; |
| 44 | parisc*) | 44 | parisc*) |
| 45 | debarch=hppa ;; | 45 | debarch=hppa ;; |
| 46 | mips*) | 46 | mips*) |
| 47 | if is_enabled CPU_LITTLE_ENDIAN; then | 47 | if is_enabled CONFIG_CPU_LITTLE_ENDIAN; then |
| 48 | debarch=mips$(if_enabled_echo 64BIT 64)$(if_enabled_echo CPU_MIPSR6 r6)el | 48 | debarch=mips$(if_enabled_echo CONFIG_64BIT 64)$(if_enabled_echo CONFIG_CPU_MIPSR6 r6)el |
| 49 | elif is_enabled CPU_MIPSR6; then | 49 | elif is_enabled CONFIG_CPU_MIPSR6; then |
| 50 | debarch=mips$(if_enabled_echo 64BIT 64)r6 | 50 | debarch=mips$(if_enabled_echo CONFIG_64BIT 64)r6 |
| 51 | else | 51 | else |
| 52 | debarch=mips | 52 | debarch=mips |
| 53 | fi | 53 | fi |
| @@ -55,8 +55,8 @@ set_debarch() { | |||
| 55 | aarch64|arm64) | 55 | aarch64|arm64) |
| 56 | debarch=arm64 ;; | 56 | debarch=arm64 ;; |
| 57 | arm*) | 57 | arm*) |
| 58 | if is_enabled AEABI; then | 58 | if is_enabled CONFIG_AEABI; then |
| 59 | debarch=arm$(if_enabled_echo VFP hf el) | 59 | debarch=arm$(if_enabled_echo CONFIG_VFP hf el) |
| 60 | else | 60 | else |
| 61 | debarch=arm | 61 | debarch=arm |
| 62 | fi | 62 | fi |
| @@ -64,10 +64,10 @@ set_debarch() { | |||
| 64 | openrisc) | 64 | openrisc) |
| 65 | debarch=or1k ;; | 65 | debarch=or1k ;; |
| 66 | sh) | 66 | sh) |
| 67 | if is_enabled CPU_SH3; then | 67 | if is_enabled CONFIG_CPU_SH3; then |
| 68 | debarch=sh3$(if_enabled_echo CPU_BIG_ENDIAN eb) | 68 | debarch=sh3$(if_enabled_echo CONFIG_CPU_BIG_ENDIAN eb) |
| 69 | elif is_enabled CPU_SH4; then | 69 | elif is_enabled CONFIG_CPU_SH4; then |
| 70 | debarch=sh4$(if_enabled_echo CPU_BIG_ENDIAN eb) | 70 | debarch=sh4$(if_enabled_echo CONFIG_CPU_BIG_ENDIAN eb) |
| 71 | fi | 71 | fi |
| 72 | ;; | 72 | ;; |
| 73 | esac | 73 | esac |
| @@ -132,8 +132,12 @@ else | |||
| 132 | echo >&2 "Install lsb-release or set \$KDEB_CHANGELOG_DIST explicitly" | 132 | echo >&2 "Install lsb-release or set \$KDEB_CHANGELOG_DIST explicitly" |
| 133 | fi | 133 | fi |
| 134 | 134 | ||
| 135 | mkdir -p debian/ | 135 | mkdir -p debian/source/ |
| 136 | echo "1.0" > debian/source/format | ||
| 137 | |||
| 136 | echo $debarch > debian/arch | 138 | echo $debarch > debian/arch |
| 139 | extra_build_depends=", $(if_enabled_echo CONFIG_UNWINDER_ORC libelf-dev)" | ||
| 140 | extra_build_depends="$extra_build_depends, $(if_enabled_echo CONFIG_SYSTEM_TRUSTED_KEYRING libssl-dev:native)" | ||
| 137 | 141 | ||
| 138 | # Generate a simple changelog template | 142 | # Generate a simple changelog template |
| 139 | cat <<EOF > debian/changelog | 143 | cat <<EOF > debian/changelog |
| @@ -170,7 +174,7 @@ Source: $sourcename | |||
| 170 | Section: kernel | 174 | Section: kernel |
| 171 | Priority: optional | 175 | Priority: optional |
| 172 | Maintainer: $maintainer | 176 | Maintainer: $maintainer |
| 173 | Build-Depends: bc, kmod, cpio | 177 | Build-Depends: bc, kmod, cpio, bison, flex | flex:native $extra_build_depends |
| 174 | Homepage: http://www.kernel.org/ | 178 | Homepage: http://www.kernel.org/ |
| 175 | 179 | ||
| 176 | Package: $packagename | 180 | Package: $packagename |
| @@ -205,13 +209,15 @@ EOF | |||
| 205 | cat <<EOF > debian/rules | 209 | cat <<EOF > debian/rules |
| 206 | #!$(command -v $MAKE) -f | 210 | #!$(command -v $MAKE) -f |
| 207 | 211 | ||
| 212 | srctree ?= . | ||
| 213 | |||
| 208 | build: | 214 | build: |
| 209 | \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \ | 215 | \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \ |
| 210 | KBUILD_BUILD_VERSION=${revision} KBUILD_SRC= | 216 | KBUILD_BUILD_VERSION=${revision} -f \$(srctree)/Makefile |
| 211 | 217 | ||
| 212 | binary-arch: | 218 | binary-arch: |
| 213 | \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \ | 219 | \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \ |
| 214 | KBUILD_BUILD_VERSION=${revision} KBUILD_SRC= intdeb-pkg | 220 | KBUILD_BUILD_VERSION=${revision} -f \$(srctree)/Makefile intdeb-pkg |
| 215 | 221 | ||
| 216 | clean: | 222 | clean: |
| 217 | rm -rf debian/*tmp debian/files | 223 | rm -rf debian/*tmp debian/files |
| @@ -219,5 +225,6 @@ clean: | |||
| 219 | 225 | ||
| 220 | binary: binary-arch | 226 | binary: binary-arch |
| 221 | EOF | 227 | EOF |
| 228 | chmod +x debian/rules | ||
| 222 | 229 | ||
| 223 | exit 0 | 230 | exit 0 |
diff --git a/scripts/spdxcheck.py b/scripts/spdxcheck.py index e559c6294c39..4fe392e507fb 100755 --- a/scripts/spdxcheck.py +++ b/scripts/spdxcheck.py | |||
| @@ -175,7 +175,13 @@ class id_parser(object): | |||
| 175 | self.lines_checked += 1 | 175 | self.lines_checked += 1 |
| 176 | if line.find("SPDX-License-Identifier:") < 0: | 176 | if line.find("SPDX-License-Identifier:") < 0: |
| 177 | continue | 177 | continue |
| 178 | expr = line.split(':')[1].replace('*/', '').strip() | 178 | expr = line.split(':')[1].strip() |
| 179 | # Remove trailing comment closure | ||
| 180 | if line.strip().endswith('*/'): | ||
| 181 | expr = expr.rstrip('*/').strip() | ||
| 182 | # Special case for SH magic boot code files | ||
| 183 | if line.startswith('LIST \"'): | ||
| 184 | expr = expr.rstrip('\"').strip() | ||
| 179 | self.parse(expr) | 185 | self.parse(expr) |
| 180 | self.spdx_valid += 1 | 186 | self.spdx_valid += 1 |
| 181 | # | 187 | # |
diff --git a/scripts/spelling.txt b/scripts/spelling.txt index 517d0c3f83df..86b87332b9e5 100644 --- a/scripts/spelling.txt +++ b/scripts/spelling.txt | |||
| @@ -10,6 +10,8 @@ | |||
| 10 | abandonning||abandoning | 10 | abandonning||abandoning |
| 11 | abigious||ambiguous | 11 | abigious||ambiguous |
| 12 | abitrate||arbitrate | 12 | abitrate||arbitrate |
| 13 | abnornally||abnormally | ||
| 14 | abnrormal||abnormal | ||
| 13 | abord||abort | 15 | abord||abort |
| 14 | aboslute||absolute | 16 | aboslute||absolute |
| 15 | abov||above | 17 | abov||above |
| @@ -107,6 +109,7 @@ ambigious||ambiguous | |||
| 107 | amoung||among | 109 | amoung||among |
| 108 | amout||amount | 110 | amout||amount |
| 109 | amplifer||amplifier | 111 | amplifer||amplifier |
| 112 | amplifyer||amplifier | ||
| 110 | an union||a union | 113 | an union||a union |
| 111 | an user||a user | 114 | an user||a user |
| 112 | an userspace||a userspace | 115 | an userspace||a userspace |
| @@ -145,6 +148,7 @@ artillary||artillery | |||
| 145 | asign||assign | 148 | asign||assign |
| 146 | asser||assert | 149 | asser||assert |
| 147 | assertation||assertion | 150 | assertation||assertion |
| 151 | assertting||asserting | ||
| 148 | assiged||assigned | 152 | assiged||assigned |
| 149 | assigment||assignment | 153 | assigment||assignment |
| 150 | assigments||assignments | 154 | assigments||assignments |
| @@ -168,6 +172,8 @@ attachement||attachment | |||
| 168 | attched||attached | 172 | attched||attached |
| 169 | attemps||attempts | 173 | attemps||attempts |
| 170 | attemping||attempting | 174 | attemping||attempting |
| 175 | attepmpt||attempt | ||
| 176 | attnetion||attention | ||
| 171 | attruibutes||attributes | 177 | attruibutes||attributes |
| 172 | authentification||authentication | 178 | authentification||authentication |
| 173 | automaticaly||automatically | 179 | automaticaly||automatically |
| @@ -217,6 +223,7 @@ boardcast||broadcast | |||
| 217 | borad||board | 223 | borad||board |
| 218 | boundry||boundary | 224 | boundry||boundary |
| 219 | brievely||briefly | 225 | brievely||briefly |
| 226 | broadcase||broadcast | ||
| 220 | broadcat||broadcast | 227 | broadcat||broadcast |
| 221 | bufufer||buffer | 228 | bufufer||buffer |
| 222 | cacluated||calculated | 229 | cacluated||calculated |
| @@ -234,6 +241,7 @@ cancle||cancel | |||
| 234 | capabilites||capabilities | 241 | capabilites||capabilities |
| 235 | capabilty||capability | 242 | capabilty||capability |
| 236 | capabitilies||capabilities | 243 | capabitilies||capabilities |
| 244 | capablity||capability | ||
| 237 | capatibilities||capabilities | 245 | capatibilities||capabilities |
| 238 | capapbilities||capabilities | 246 | capapbilities||capabilities |
| 239 | caputure||capture | 247 | caputure||capture |
| @@ -274,6 +282,7 @@ clared||cleared | |||
| 274 | closeing||closing | 282 | closeing||closing |
| 275 | clustred||clustered | 283 | clustred||clustered |
| 276 | coexistance||coexistence | 284 | coexistance||coexistence |
| 285 | colescing||coalescing | ||
| 277 | collapsable||collapsible | 286 | collapsable||collapsible |
| 278 | colorfull||colorful | 287 | colorfull||colorful |
| 279 | comand||command | 288 | comand||command |
| @@ -290,6 +299,7 @@ comsumer||consumer | |||
| 290 | comsuming||consuming | 299 | comsuming||consuming |
| 291 | compability||compatibility | 300 | compability||compatibility |
| 292 | compaibility||compatibility | 301 | compaibility||compatibility |
| 302 | comparsion||comparison | ||
| 293 | compatability||compatibility | 303 | compatability||compatibility |
| 294 | compatable||compatible | 304 | compatable||compatible |
| 295 | compatibiliy||compatibility | 305 | compatibiliy||compatibility |
| @@ -303,6 +313,7 @@ completly||completely | |||
| 303 | complient||compliant | 313 | complient||compliant |
| 304 | componnents||components | 314 | componnents||components |
| 305 | compoment||component | 315 | compoment||component |
| 316 | comppatible||compatible | ||
| 306 | compres||compress | 317 | compres||compress |
| 307 | compresion||compression | 318 | compresion||compression |
| 308 | comression||compression | 319 | comression||compression |
| @@ -368,6 +379,8 @@ decsribed||described | |||
| 368 | decription||description | 379 | decription||description |
| 369 | dectected||detected | 380 | dectected||detected |
| 370 | defailt||default | 381 | defailt||default |
| 382 | deferal||deferral | ||
| 383 | deffered||deferred | ||
| 371 | defferred||deferred | 384 | defferred||deferred |
| 372 | definate||definite | 385 | definate||definite |
| 373 | definately||definitely | 386 | definately||definitely |
| @@ -400,6 +413,7 @@ descritptor||descriptor | |||
| 400 | desctiptor||descriptor | 413 | desctiptor||descriptor |
| 401 | desriptor||descriptor | 414 | desriptor||descriptor |
| 402 | desriptors||descriptors | 415 | desriptors||descriptors |
| 416 | desination||destination | ||
| 403 | destionation||destination | 417 | destionation||destination |
| 404 | destoried||destroyed | 418 | destoried||destroyed |
| 405 | destory||destroy | 419 | destory||destroy |
| @@ -426,7 +440,9 @@ diffrent||different | |||
| 426 | differenciate||differentiate | 440 | differenciate||differentiate |
| 427 | diffrentiate||differentiate | 441 | diffrentiate||differentiate |
| 428 | difinition||definition | 442 | difinition||definition |
| 443 | dimention||dimension | ||
| 429 | dimesions||dimensions | 444 | dimesions||dimensions |
| 445 | dispalying||displaying | ||
| 430 | diplay||display | 446 | diplay||display |
| 431 | directon||direction | 447 | directon||direction |
| 432 | direectly||directly | 448 | direectly||directly |
| @@ -442,6 +458,7 @@ disbled||disabled | |||
| 442 | disconnet||disconnect | 458 | disconnet||disconnect |
| 443 | discontinous||discontinuous | 459 | discontinous||discontinuous |
| 444 | disharge||discharge | 460 | disharge||discharge |
| 461 | disnabled||disabled | ||
| 445 | dispertion||dispersion | 462 | dispertion||dispersion |
| 446 | dissapears||disappears | 463 | dissapears||disappears |
| 447 | distiction||distinction | 464 | distiction||distinction |
| @@ -456,6 +473,7 @@ dorp||drop | |||
| 456 | dosen||doesn | 473 | dosen||doesn |
| 457 | downlad||download | 474 | downlad||download |
| 458 | downlads||downloads | 475 | downlads||downloads |
| 476 | droped||dropped | ||
| 459 | druing||during | 477 | druing||during |
| 460 | dynmaic||dynamic | 478 | dynmaic||dynamic |
| 461 | eanable||enable | 479 | eanable||enable |
| @@ -471,6 +489,7 @@ elementry||elementary | |||
| 471 | eletronic||electronic | 489 | eletronic||electronic |
| 472 | embeded||embedded | 490 | embeded||embedded |
| 473 | enabledi||enabled | 491 | enabledi||enabled |
| 492 | enble||enable | ||
| 474 | enchanced||enhanced | 493 | enchanced||enhanced |
| 475 | encorporating||incorporating | 494 | encorporating||incorporating |
| 476 | encrupted||encrypted | 495 | encrupted||encrypted |
| @@ -479,6 +498,9 @@ encryptio||encryption | |||
| 479 | endianess||endianness | 498 | endianess||endianness |
| 480 | enhaced||enhanced | 499 | enhaced||enhanced |
| 481 | enlightnment||enlightenment | 500 | enlightnment||enlightenment |
| 501 | enqueing||enqueuing | ||
| 502 | entires||entries | ||
| 503 | entites||entities | ||
| 482 | entrys||entries | 504 | entrys||entries |
| 483 | enocded||encoded | 505 | enocded||encoded |
| 484 | enterily||entirely | 506 | enterily||entirely |
| @@ -498,6 +520,8 @@ etsbalishment||establishment | |||
| 498 | excecutable||executable | 520 | excecutable||executable |
| 499 | exceded||exceeded | 521 | exceded||exceeded |
| 500 | excellant||excellent | 522 | excellant||excellent |
| 523 | execeeded||exceeded | ||
| 524 | execeeds||exceeds | ||
| 501 | exeed||exceed | 525 | exeed||exceed |
| 502 | existance||existence | 526 | existance||existence |
| 503 | existant||existent | 527 | existant||existent |
| @@ -506,6 +530,7 @@ exlcude||exclude | |||
| 506 | exlcusive||exclusive | 530 | exlcusive||exclusive |
| 507 | exmaple||example | 531 | exmaple||example |
| 508 | expecially||especially | 532 | expecially||especially |
| 533 | experies||expires | ||
| 509 | explicite||explicit | 534 | explicite||explicit |
| 510 | explicitely||explicitly | 535 | explicitely||explicitly |
| 511 | explict||explicit | 536 | explict||explicit |
| @@ -521,6 +546,7 @@ extracter||extractor | |||
| 521 | faield||failed | 546 | faield||failed |
| 522 | falied||failed | 547 | falied||failed |
| 523 | faild||failed | 548 | faild||failed |
| 549 | failded||failed | ||
| 524 | failer||failure | 550 | failer||failure |
| 525 | faill||fail | 551 | faill||fail |
| 526 | failied||failed | 552 | failied||failed |
| @@ -540,6 +566,7 @@ fetaure||feature | |||
| 540 | fetaures||features | 566 | fetaures||features |
| 541 | fileystem||filesystem | 567 | fileystem||filesystem |
| 542 | fimware||firmware | 568 | fimware||firmware |
| 569 | firmare||firmware | ||
| 543 | firware||firmware | 570 | firware||firmware |
| 544 | finanize||finalize | 571 | finanize||finalize |
| 545 | findn||find | 572 | findn||find |
| @@ -574,6 +601,7 @@ funtions||functions | |||
| 574 | furthur||further | 601 | furthur||further |
| 575 | futhermore||furthermore | 602 | futhermore||furthermore |
| 576 | futrue||future | 603 | futrue||future |
| 604 | gauage||gauge | ||
| 577 | gaurenteed||guaranteed | 605 | gaurenteed||guaranteed |
| 578 | generiously||generously | 606 | generiously||generously |
| 579 | genereate||generate | 607 | genereate||generate |
| @@ -645,6 +673,7 @@ independed||independent | |||
| 645 | indiate||indicate | 673 | indiate||indicate |
| 646 | indicat||indicate | 674 | indicat||indicate |
| 647 | inexpect||inexpected | 675 | inexpect||inexpected |
| 676 | inferface||interface | ||
| 648 | infomation||information | 677 | infomation||information |
| 649 | informatiom||information | 678 | informatiom||information |
| 650 | informations||information | 679 | informations||information |
| @@ -662,14 +691,17 @@ initialiazation||initialization | |||
| 662 | initializiation||initialization | 691 | initializiation||initialization |
| 663 | initialze||initialize | 692 | initialze||initialize |
| 664 | initialzed||initialized | 693 | initialzed||initialized |
| 694 | initialzing||initializing | ||
| 665 | initilization||initialization | 695 | initilization||initialization |
| 666 | initilize||initialize | 696 | initilize||initialize |
| 667 | inofficial||unofficial | 697 | inofficial||unofficial |
| 668 | inrerface||interface | 698 | inrerface||interface |
| 669 | insititute||institute | 699 | insititute||institute |
| 700 | instace||instance | ||
| 670 | instal||install | 701 | instal||install |
| 671 | instanciate||instantiate | 702 | instanciate||instantiate |
| 672 | instanciated||instantiated | 703 | instanciated||instantiated |
| 704 | insufficent||insufficient | ||
| 673 | inteface||interface | 705 | inteface||interface |
| 674 | integreated||integrated | 706 | integreated||integrated |
| 675 | integrety||integrity | 707 | integrety||integrity |
| @@ -684,6 +716,8 @@ intermittant||intermittent | |||
| 684 | internel||internal | 716 | internel||internal |
| 685 | interoprability||interoperability | 717 | interoprability||interoperability |
| 686 | interuupt||interrupt | 718 | interuupt||interrupt |
| 719 | interupt||interrupt | ||
| 720 | interupts||interrupts | ||
| 687 | interrface||interface | 721 | interrface||interface |
| 688 | interrrupt||interrupt | 722 | interrrupt||interrupt |
| 689 | interrup||interrupt | 723 | interrup||interrupt |
| @@ -699,11 +733,14 @@ intialization||initialization | |||
| 699 | intialized||initialized | 733 | intialized||initialized |
| 700 | intialize||initialize | 734 | intialize||initialize |
| 701 | intregral||integral | 735 | intregral||integral |
| 736 | intrerrupt||interrupt | ||
| 702 | intrrupt||interrupt | 737 | intrrupt||interrupt |
| 703 | intterrupt||interrupt | 738 | intterrupt||interrupt |
| 704 | intuative||intuitive | 739 | intuative||intuitive |
| 705 | inavlid||invalid | 740 | inavlid||invalid |
| 706 | invaid||invalid | 741 | invaid||invalid |
| 742 | invaild||invalid | ||
| 743 | invailid||invalid | ||
| 707 | invald||invalid | 744 | invald||invalid |
| 708 | invalde||invalid | 745 | invalde||invalid |
| 709 | invalide||invalid | 746 | invalide||invalid |
| @@ -712,6 +749,7 @@ invalud||invalid | |||
| 712 | invididual||individual | 749 | invididual||individual |
| 713 | invokation||invocation | 750 | invokation||invocation |
| 714 | invokations||invocations | 751 | invokations||invocations |
| 752 | ireelevant||irrelevant | ||
| 715 | irrelevent||irrelevant | 753 | irrelevent||irrelevant |
| 716 | isnt||isn't | 754 | isnt||isn't |
| 717 | isssue||issue | 755 | isssue||issue |
| @@ -747,6 +785,7 @@ loobpack||loopback | |||
| 747 | loosing||losing | 785 | loosing||losing |
| 748 | losted||lost | 786 | losted||lost |
| 749 | machinary||machinery | 787 | machinary||machinery |
| 788 | maibox||mailbox | ||
| 750 | maintainance||maintenance | 789 | maintainance||maintenance |
| 751 | maintainence||maintenance | 790 | maintainence||maintenance |
| 752 | maintan||maintain | 791 | maintan||maintain |
| @@ -758,14 +797,19 @@ managable||manageable | |||
| 758 | managment||management | 797 | managment||management |
| 759 | mangement||management | 798 | mangement||management |
| 760 | manoeuvering||maneuvering | 799 | manoeuvering||maneuvering |
| 800 | manufaucturing||manufacturing | ||
| 761 | mappping||mapping | 801 | mappping||mapping |
| 762 | matchs||matches | 802 | matchs||matches |
| 763 | mathimatical||mathematical | 803 | mathimatical||mathematical |
| 764 | mathimatic||mathematic | 804 | mathimatic||mathematic |
| 765 | mathimatics||mathematics | 805 | mathimatics||mathematics |
| 806 | maximium||maximum | ||
| 766 | maxium||maximum | 807 | maxium||maximum |
| 767 | mechamism||mechanism | 808 | mechamism||mechanism |
| 768 | meetign||meeting | 809 | meetign||meeting |
| 810 | memeory||memory | ||
| 811 | memmber||member | ||
| 812 | memoery||memory | ||
| 769 | ment||meant | 813 | ment||meant |
| 770 | mergable||mergeable | 814 | mergable||mergeable |
| 771 | mesage||message | 815 | mesage||message |
| @@ -779,6 +823,7 @@ migrateable||migratable | |||
| 779 | milliseonds||milliseconds | 823 | milliseonds||milliseconds |
| 780 | minium||minimum | 824 | minium||minimum |
| 781 | minimam||minimum | 825 | minimam||minimum |
| 826 | miniumum||minimum | ||
| 782 | minumum||minimum | 827 | minumum||minimum |
| 783 | misalinged||misaligned | 828 | misalinged||misaligned |
| 784 | miscelleneous||miscellaneous | 829 | miscelleneous||miscellaneous |
| @@ -839,6 +884,7 @@ occurence||occurrence | |||
| 839 | occure||occurred | 884 | occure||occurred |
| 840 | occured||occurred | 885 | occured||occurred |
| 841 | occuring||occurring | 886 | occuring||occurring |
| 887 | offser||offset | ||
| 842 | offet||offset | 888 | offet||offset |
| 843 | offloded||offloaded | 889 | offloded||offloaded |
| 844 | omited||omitted | 890 | omited||omitted |
| @@ -855,6 +901,7 @@ optmizations||optimizations | |||
| 855 | orientatied||orientated | 901 | orientatied||orientated |
| 856 | orientied||oriented | 902 | orientied||oriented |
| 857 | orignal||original | 903 | orignal||original |
| 904 | originial||original | ||
| 858 | otherise||otherwise | 905 | otherise||otherwise |
| 859 | ouput||output | 906 | ouput||output |
| 860 | oustanding||outstanding | 907 | oustanding||outstanding |
| @@ -874,6 +921,7 @@ packege||package | |||
| 874 | packge||package | 921 | packge||package |
| 875 | packtes||packets | 922 | packtes||packets |
| 876 | pakage||package | 923 | pakage||package |
| 924 | paket||packet | ||
| 877 | pallette||palette | 925 | pallette||palette |
| 878 | paln||plan | 926 | paln||plan |
| 879 | paramameters||parameters | 927 | paramameters||parameters |
| @@ -886,6 +934,8 @@ paramters||parameters | |||
| 886 | parmaters||parameters | 934 | parmaters||parameters |
| 887 | particuarly||particularly | 935 | particuarly||particularly |
| 888 | particularily||particularly | 936 | particularily||particularly |
| 937 | partion||partition | ||
| 938 | partions||partitions | ||
| 889 | partiton||partition | 939 | partiton||partition |
| 890 | pased||passed | 940 | pased||passed |
| 891 | passin||passing | 941 | passin||passing |
| @@ -897,10 +947,12 @@ peice||piece | |||
| 897 | pendantic||pedantic | 947 | pendantic||pedantic |
| 898 | peprocessor||preprocessor | 948 | peprocessor||preprocessor |
| 899 | perfoming||performing | 949 | perfoming||performing |
| 950 | peripherial||peripheral | ||
| 900 | permissons||permissions | 951 | permissons||permissions |
| 901 | peroid||period | 952 | peroid||period |
| 902 | persistance||persistence | 953 | persistance||persistence |
| 903 | persistant||persistent | 954 | persistant||persistent |
| 955 | phoneticly||phonetically | ||
| 904 | plalform||platform | 956 | plalform||platform |
| 905 | platfoem||platform | 957 | platfoem||platform |
| 906 | platfrom||platform | 958 | platfrom||platform |
| @@ -915,6 +967,7 @@ posible||possible | |||
| 915 | positon||position | 967 | positon||position |
| 916 | possibilites||possibilities | 968 | possibilites||possibilities |
| 917 | powerfull||powerful | 969 | powerfull||powerful |
| 970 | pramater||parameter | ||
| 918 | preamle||preamble | 971 | preamle||preamble |
| 919 | preample||preamble | 972 | preample||preamble |
| 920 | preapre||prepare | 973 | preapre||prepare |
| @@ -976,6 +1029,7 @@ psudo||pseudo | |||
| 976 | psuedo||pseudo | 1029 | psuedo||pseudo |
| 977 | psychadelic||psychedelic | 1030 | psychadelic||psychedelic |
| 978 | pwoer||power | 1031 | pwoer||power |
| 1032 | queing||queuing | ||
| 979 | quering||querying | 1033 | quering||querying |
| 980 | randomally||randomly | 1034 | randomally||randomly |
| 981 | raoming||roaming | 1035 | raoming||roaming |
| @@ -1004,6 +1058,7 @@ refering||referring | |||
| 1004 | refernces||references | 1058 | refernces||references |
| 1005 | refernnce||reference | 1059 | refernnce||reference |
| 1006 | refrence||reference | 1060 | refrence||reference |
| 1061 | registed||registered | ||
| 1007 | registerd||registered | 1062 | registerd||registered |
| 1008 | registeration||registration | 1063 | registeration||registration |
| 1009 | registeresd||registered | 1064 | registeresd||registered |
| @@ -1018,6 +1073,7 @@ regulamentations||regulations | |||
| 1018 | reigstration||registration | 1073 | reigstration||registration |
| 1019 | releated||related | 1074 | releated||related |
| 1020 | relevent||relevant | 1075 | relevent||relevant |
| 1076 | reloade||reload | ||
| 1021 | remoote||remote | 1077 | remoote||remote |
| 1022 | remore||remote | 1078 | remore||remote |
| 1023 | removeable||removable | 1079 | removeable||removable |
| @@ -1036,19 +1092,23 @@ requried||required | |||
| 1036 | requst||request | 1092 | requst||request |
| 1037 | reregisteration||reregistration | 1093 | reregisteration||reregistration |
| 1038 | reseting||resetting | 1094 | reseting||resetting |
| 1095 | reseved||reserved | ||
| 1039 | reseverd||reserved | 1096 | reseverd||reserved |
| 1040 | resizeable||resizable | 1097 | resizeable||resizable |
| 1041 | resouce||resource | 1098 | resouce||resource |
| 1042 | resouces||resources | 1099 | resouces||resources |
| 1043 | resoures||resources | 1100 | resoures||resources |
| 1044 | responce||response | 1101 | responce||response |
| 1102 | resrouce||resource | ||
| 1045 | ressizes||resizes | 1103 | ressizes||resizes |
| 1046 | ressource||resource | 1104 | ressource||resource |
| 1047 | ressources||resources | 1105 | ressources||resources |
| 1048 | restesting||retesting | 1106 | restesting||retesting |
| 1107 | resumbmitting||resubmitting | ||
| 1049 | retransmited||retransmitted | 1108 | retransmited||retransmitted |
| 1050 | retreived||retrieved | 1109 | retreived||retrieved |
| 1051 | retreive||retrieve | 1110 | retreive||retrieve |
| 1111 | retreiving||retrieving | ||
| 1052 | retrive||retrieve | 1112 | retrive||retrieve |
| 1053 | retuned||returned | 1113 | retuned||returned |
| 1054 | reudce||reduce | 1114 | reudce||reduce |
| @@ -1120,6 +1180,7 @@ sleeped||slept | |||
| 1120 | softwares||software | 1180 | softwares||software |
| 1121 | speach||speech | 1181 | speach||speech |
| 1122 | specfic||specific | 1182 | specfic||specific |
| 1183 | specfield||specified | ||
| 1123 | speciefied||specified | 1184 | speciefied||specified |
| 1124 | specifc||specific | 1185 | specifc||specific |
| 1125 | specifed||specified | 1186 | specifed||specified |
| @@ -1142,7 +1203,10 @@ staion||station | |||
| 1142 | standardss||standards | 1203 | standardss||standards |
| 1143 | standartization||standardization | 1204 | standartization||standardization |
| 1144 | standart||standard | 1205 | standart||standard |
| 1206 | standy||standby | ||
| 1207 | stardard||standard | ||
| 1145 | staticly||statically | 1208 | staticly||statically |
| 1209 | statuss||status | ||
| 1146 | stoped||stopped | 1210 | stoped||stopped |
| 1147 | stoping||stopping | 1211 | stoping||stopping |
| 1148 | stoppped||stopped | 1212 | stoppped||stopped |
| @@ -1227,12 +1291,14 @@ tipically||typically | |||
| 1227 | timeing||timing | 1291 | timeing||timing |
| 1228 | timout||timeout | 1292 | timout||timeout |
| 1229 | tmis||this | 1293 | tmis||this |
| 1294 | toogle||toggle | ||
| 1230 | torerable||tolerable | 1295 | torerable||tolerable |
| 1231 | traking||tracking | 1296 | traking||tracking |
| 1232 | tramsmitted||transmitted | 1297 | tramsmitted||transmitted |
| 1233 | tramsmit||transmit | 1298 | tramsmit||transmit |
| 1234 | tranasction||transaction | 1299 | tranasction||transaction |
| 1235 | tranfer||transfer | 1300 | tranfer||transfer |
| 1301 | transcevier||transceiver | ||
| 1236 | transciever||transceiver | 1302 | transciever||transceiver |
| 1237 | transferd||transferred | 1303 | transferd||transferred |
| 1238 | transfered||transferred | 1304 | transfered||transferred |
| @@ -1267,6 +1333,7 @@ unfortunatelly||unfortunately | |||
| 1267 | unifiy||unify | 1333 | unifiy||unify |
| 1268 | uniterrupted||uninterrupted | 1334 | uniterrupted||uninterrupted |
| 1269 | unintialized||uninitialized | 1335 | unintialized||uninitialized |
| 1336 | unitialized||uninitialized | ||
| 1270 | unkmown||unknown | 1337 | unkmown||unknown |
| 1271 | unknonw||unknown | 1338 | unknonw||unknown |
| 1272 | unknow||unknown | 1339 | unknow||unknown |
| @@ -1291,7 +1358,9 @@ unsuccessfull||unsuccessful | |||
| 1291 | unsuported||unsupported | 1358 | unsuported||unsupported |
| 1292 | untill||until | 1359 | untill||until |
| 1293 | unuseful||useless | 1360 | unuseful||useless |
| 1361 | unvalid||invalid | ||
| 1294 | upate||update | 1362 | upate||update |
| 1363 | upsupported||unsupported | ||
| 1295 | usefule||useful | 1364 | usefule||useful |
| 1296 | usefull||useful | 1365 | usefull||useful |
| 1297 | usege||usage | 1366 | usege||usage |
diff --git a/scripts/ver_linux b/scripts/ver_linux index a6c728db05ce..810e608baa24 100755 --- a/scripts/ver_linux +++ b/scripts/ver_linux | |||
| @@ -13,6 +13,8 @@ BEGIN { | |||
| 13 | system("uname -a") | 13 | system("uname -a") |
| 14 | printf("\n") | 14 | printf("\n") |
| 15 | 15 | ||
| 16 | vernum = "[0-9]+([.]?[0-9]+)+" | ||
| 17 | |||
| 16 | printversion("GNU C", version("gcc -dumpversion")) | 18 | printversion("GNU C", version("gcc -dumpversion")) |
| 17 | printversion("GNU Make", version("make --version")) | 19 | printversion("GNU Make", version("make --version")) |
| 18 | printversion("Binutils", version("ld -v")) | 20 | printversion("Binutils", version("ld -v")) |
| @@ -34,7 +36,7 @@ BEGIN { | |||
| 34 | while (getline <"/proc/self/maps" > 0) { | 36 | while (getline <"/proc/self/maps" > 0) { |
| 35 | if (/libc.*\.so$/) { | 37 | if (/libc.*\.so$/) { |
| 36 | n = split($0, procmaps, "/") | 38 | n = split($0, procmaps, "/") |
| 37 | if (match(procmaps[n], /[0-9]+([.]?[0-9]+)+/)) { | 39 | if (match(procmaps[n], vernum)) { |
| 38 | ver = substr(procmaps[n], RSTART, RLENGTH) | 40 | ver = substr(procmaps[n], RSTART, RLENGTH) |
| 39 | printversion("Linux C Library", ver) | 41 | printversion("Linux C Library", ver) |
| 40 | break | 42 | break |
| @@ -70,7 +72,7 @@ BEGIN { | |||
| 70 | function version(cmd, ver) { | 72 | function version(cmd, ver) { |
| 71 | cmd = cmd " 2>&1" | 73 | cmd = cmd " 2>&1" |
| 72 | while (cmd | getline > 0) { | 74 | while (cmd | getline > 0) { |
| 73 | if (match($0, /[0-9]+([.]?[0-9]+)+/)) { | 75 | if (match($0, vernum)) { |
| 74 | ver = substr($0, RSTART, RLENGTH) | 76 | ver = substr($0, RSTART, RLENGTH) |
| 75 | break | 77 | break |
| 76 | } | 78 | } |
