diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Kbuild.include | 85 | ||||
-rw-r--r-- | scripts/Makefile.headersinst | 2 | ||||
-rw-r--r-- | scripts/gen_initramfs_list.sh | 43 | ||||
-rw-r--r-- | scripts/kallsyms.c | 2 | ||||
-rw-r--r-- | scripts/kconfig/conf.c | 2 | ||||
-rw-r--r-- | scripts/kconfig/confdata.c | 37 | ||||
-rw-r--r-- | scripts/kconfig/gconf.c | 35 | ||||
-rw-r--r-- | scripts/kconfig/gconf.glade | 4 | ||||
-rw-r--r-- | scripts/kconfig/lkc.h | 2 | ||||
-rw-r--r-- | scripts/kconfig/lkc_proto.h | 3 | ||||
-rw-r--r-- | scripts/kconfig/mconf.c | 21 | ||||
-rw-r--r-- | scripts/kconfig/qconf.cc | 18 | ||||
-rw-r--r-- | scripts/kconfig/qconf.h | 3 | ||||
-rw-r--r-- | scripts/kconfig/symbol.c | 3 | ||||
-rw-r--r-- | scripts/kconfig/zconf.tab.c_shipped | 2 | ||||
-rw-r--r-- | scripts/kconfig/zconf.y | 2 | ||||
-rwxr-xr-x | scripts/kernel-doc | 17 | ||||
-rwxr-xr-x | scripts/makelst | 34 | ||||
-rw-r--r-- | scripts/mod/modpost.c | 28 |
19 files changed, 223 insertions, 120 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 4f5ff19..06c1a37 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -1,7 +1,7 @@ #### # kbuild: Generic definitions -# Convinient variables +# Convenient variables comma := , squote := ' empty := @@ -56,30 +56,43 @@ endef # gcc support functions # See documentation in Documentation/kbuild/makefiles.txt +# output directory for tests below +TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/) + +# try-run +# Usage: option = $(call try-run, $(CC)...-o "$$TMP",option-ok,otherwise) +# Exit code chooses option. "$$TMP" is can be used as temporary file and +# is automatically cleaned up. +try-run = $(shell set -e; \ + TMP="$(TMPOUT).$$$$.tmp"; \ + if ($(1)) >/dev/null 2>&1; \ + then echo "$(2)"; \ + else echo "$(3)"; \ + fi; \ + rm -f "$$TMP") + # as-option -# Usage: cflags-y += $(call as-option, -Wa$(comma)-isa=foo,) +# Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,) -as-option = $(shell if $(CC) $(CFLAGS) $(1) -Wa,-Z -c -o /dev/null \ - -xassembler /dev/null > /dev/null 2>&1; then echo "$(1)"; \ - else echo "$(2)"; fi ;) +as-option = $(call try-run,\ + $(CC) $(CFLAGS) $(1) -c -xassembler /dev/null -o "$$TMP",$(1),$(2)) # as-instr -# Usage: cflags-y += $(call as-instr, instr, option1, option2) +# Usage: cflags-y += $(call as-instr,instr,option1,option2) -as-instr = $(shell if echo -e "$(1)" | $(AS) >/dev/null 2>&1 -W -Z -o astest$$$$.out ; \ - then echo "$(2)"; else echo "$(3)"; fi; \ - rm -f astest$$$$.out) +as-instr = $(call try-run,\ + echo -e "$(1)" | $(CC) $(AFLAGS) -c -xassembler -o "$$TMP" -,$(2),$(3)) # cc-option -# Usage: cflags-y += $(call cc-option, -march=winchip-c6, -march=i586) +# Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586) -cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \ - > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) +cc-option = $(call try-run,\ + $(CC) $(CFLAGS) $(1) -S -xc /dev/null -o "$$TMP",$(1),$(2)) # cc-option-yn -# Usage: flag := $(call cc-option-yn, -march=winchip-c6) -cc-option-yn = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \ - > /dev/null 2>&1; then echo "y"; else echo "n"; fi;) +# Usage: flag := $(call cc-option-yn,-march=winchip-c6) +cc-option-yn = $(call try-run,\ + $(CC) $(CFLAGS) $(1) -S -xc /dev/null -o "$$TMP",y,n) # cc-option-align # Prefix align with either -falign or -malign @@ -87,20 +100,19 @@ cc-option-align = $(subst -functions=0,,\ $(call cc-option,-falign-functions=0,-malign-functions=0)) # cc-version -# Usage gcc-ver := $(call cc-version, $(CC)) +# Usage gcc-ver := $(call cc-version,$(CC)) cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC)) # cc-ifversion # Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) -cc-ifversion = $(shell if [ $(call cc-version, $(CC)) $(1) $(2) ]; then \ - echo $(3); fi;) +cc-ifversion = $(shell [ $(call cc-version, $(CC)) $(1) $(2) ] && echo $(3)) # ld-option # Usage: ldflags += $(call ld-option, -Wl$(comma)--hash-style=both) -ld-option = $(shell if $(CC) $(1) \ - -nostdlib -o ldtest$$$$.out -xc /dev/null \ - > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi; \ - rm -f ldtest$$$$.out) +ld-option = $(call try-run,\ + $(CC) $(1) -nostdlib -xc /dev/null -o "$$TMP",$(1),$(2)) + +###### ### # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj= @@ -108,19 +120,25 @@ ld-option = $(shell if $(CC) $(1) \ # $(Q)$(MAKE) $(build)=dir build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj -# Prefix -I with $(srctree) if it is not an absolute path +# Prefix -I with $(srctree) if it is not an absolute path. addtree = $(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1) + # Find all -I options and call addtree flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) -# If quiet is set, only print short version of command +# echo command. +# Short version is used, if $(quiet) equals `quiet_', otherwise full one. +echo-cmd = $(if $($(quiet)cmd_$(1)),\ + echo ' $(call escsq,$($(quiet)cmd_$(1)))$(echo-why)';) + +# printing commands cmd = @$(echo-cmd) $(cmd_$(1)) -# Add $(obj)/ for paths that is not absolute +# Add $(obj)/ for paths that are not absolute objectify = $(foreach o,$(1),$(if $(filter /%,$(o)),$(o),$(obj)/$(o))) ### -# if_changed - execute command if any prerequisite is newer than +# if_changed - execute command if any prerequisite is newer than # target, or command line has changed # if_changed_dep - as if_changed, but uses fixdep to reveal dependencies # including used config symbols @@ -128,16 +146,12 @@ objectify = $(foreach o,$(1),$(if $(filter /%,$(o)),$(o),$(obj)/$(o))) # See Documentation/kbuild/makefiles.txt for more info ifneq ($(KBUILD_NOCMDDEP),1) -# Check if both arguments has same arguments. Result in empty string if equal +# Check if both arguments has same arguments. Result is empty string if equal. # User may override this check using make KBUILD_NOCMDDEP=1 arg-check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \ $(filter-out $(cmd_$@), $(cmd_$(1))) ) endif -# echo command. Short version is $(quiet) equals quiet, otherwise full command -echo-cmd = $(if $($(quiet)cmd_$(1)), \ - echo ' $(call escsq,$($(quiet)cmd_$(1)))$(echo-why)';) - # >'< substitution is for echo to work, # >$< substitution to preserve $ when reloading .cmd file # note: when using inline perl scripts [perl -e '...$$t=1;...'] @@ -148,15 +162,14 @@ make-cmd = $(subst \#,\\\#,$(subst $$,$$$$,$(call escsq,$(cmd_$(1))))) # PHONY targets skipped in both cases. any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^) -# Execute command if command has changed or prerequisitei(s) are updated +# Execute command if command has changed or prerequisite(s) are updated. # if_changed = $(if $(strip $(any-prereq) $(arg-check)), \ @set -e; \ $(echo-cmd) $(cmd_$(1)); \ echo 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd) -# execute the command and also postprocess generated .d dependencies -# file +# Execute the command and also postprocess generated .d dependencies file. if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ), \ @set -e; \ $(echo-cmd) $(cmd_$(1)); \ @@ -165,8 +178,8 @@ if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ), \ mv -f $(dot-target).tmp $(dot-target).cmd) # Usage: $(call if_changed_rule,foo) -# will check if $(cmd_foo) changed, or any of the prequisites changed, -# and if so will execute $(rule_foo) +# Will check if $(cmd_foo) or any of the prerequisites changed, +# and if so will execute $(rule_foo). if_changed_rule = $(if $(strip $(any-prereq) $(arg-check) ), \ @set -e; \ $(rule_$(1))) diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst index 4241e0d..f7b6705 100644 --- a/scripts/Makefile.headersinst +++ b/scripts/Makefile.headersinst @@ -109,7 +109,7 @@ quiet_cmd_mkdir = MKDIR $(patsubst $(INSTALL_HDR_PATH)/%,%,$@) quiet_cmd_gen = GEN $(patsubst $(INSTALL_HDR_PATH)/%,%,$@) cmd_gen = \ FNAME=$(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,%,$@) \ -STUBDEF=__ASM_STUB_`echo $$FNAME | tr a-z. A-Z_`; \ +STUBDEF=__ASM_STUB_`echo $$FNAME | tr a-z.- A-Z__`; \ (echo "/* File autogenerated by 'make headers_install' */" ; \ echo "\#ifndef $$STUBDEF" ; \ echo "\#define $$STUBDEF" ; \ diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh index 4c723fd..43f75d6 100644 --- a/scripts/gen_initramfs_list.sh +++ b/scripts/gen_initramfs_list.sh @@ -1,6 +1,6 @@ #!/bin/bash # Copyright (C) Martin Schlemmer <azarah@nosferatu.za.org> -# Copyright (c) 2006 Sam Ravnborg <sam@ravnborg.org> +# Copyright (C) 2006 Sam Ravnborg <sam@ravnborg.org> # # Released under the terms of the GNU GPL # @@ -17,15 +17,15 @@ cat << EOF Usage: $0 [-o <file>] [-u <uid>] [-g <gid>] {-d | <cpio_source>} ... -o <file> Create gzipped initramfs file named <file> using - gen_init_cpio and gzip + gen_init_cpio and gzip -u <uid> User ID to map to user ID 0 (root). - <uid> is only meaningful if <cpio_source> - is a directory. + <uid> is only meaningful if <cpio_source> + is a directory. -g <gid> Group ID to map to group ID 0 (root). - <gid> is only meaningful if <cpio_source> - is a directory. + <gid> is only meaningful if <cpio_source> + is a directory. <cpio_source> File list or directory for cpio archive. - If <cpio_source> is a .cpio file it will be used + If <cpio_source> is a .cpio file it will be used as direct input to initramfs. -d Output the default cpio list. @@ -36,6 +36,12 @@ to reset the root/group mapping. EOF } +# awk style field access +# $1 - field number; rest is argument string +field() { + shift $1 ; echo $1 +} + list_default_initramfs() { # echo usr/kinit/kinit : @@ -119,22 +125,17 @@ parse() { str="${ftype} ${name} ${location} ${str}" ;; "nod") - local dev_type= - local maj=$(LC_ALL=C ls -l "${location}" | \ - gawk '{sub(/,/, "", $5); print $5}') - local min=$(LC_ALL=C ls -l "${location}" | \ - gawk '{print $6}') - - if [ -b "${location}" ]; then - dev_type="b" - else - dev_type="c" - fi - str="${ftype} ${name} ${str} ${dev_type} ${maj} ${min}" + local dev=`LC_ALL=C ls -l "${location}"` + local maj=`field 5 ${dev}` + local min=`field 6 ${dev}` + maj=${maj%,} + + [ -b "${location}" ] && dev="b" || dev="c" + + str="${ftype} ${name} ${str} ${dev} ${maj} ${min}" ;; "slink") - local target=$(LC_ALL=C ls -l "${location}" | \ - gawk '{print $11}') + local target=`field 11 $(LC_ALL=C ls -l "${location}")` str="${ftype} ${name} ${target} ${str}" ;; *) diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index f359b73..8b809b2 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -265,7 +265,7 @@ static void write_src(void) printf("#define ALGN .align 4\n"); printf("#endif\n"); - printf(".data\n"); + printf("\t.section .rodata, \"a\"\n"); /* Provide proper symbols relocatability by their '_text' * relativeness. The symbol names cannot be used to construct diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 4dcb8867..124b341 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -600,7 +600,7 @@ int main(int ac, char **av) input_mode = ask_silent; valid_stdin = 1; } - } else if (sym_change_count) { + } else if (conf_get_changed()) { name = getenv("KCONFIG_NOSILENTUPDATE"); if (name && *name) { fprintf(stderr, _("\n*** Kernel configuration requires explicit update.\n\n")); diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 66b15ef..664fe29 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -100,7 +100,7 @@ int conf_read_simple(const char *name, int def) in = zconf_fopen(name); if (in) goto load; - sym_change_count++; + sym_add_change_count(1); if (!sym_defconfig_list) return 1; @@ -312,7 +312,7 @@ int conf_read(const char *name) struct expr *e; int i, flags; - sym_change_count = 0; + sym_set_change_count(0); if (conf_read_simple(name, S_DEF_USER)) return 1; @@ -364,7 +364,7 @@ int conf_read(const char *name) sym->flags &= flags | ~SYMBOL_DEF_USER; } - sym_change_count += conf_warnings || conf_unsaved; + sym_add_change_count(conf_warnings || conf_unsaved); return 0; } @@ -432,7 +432,7 @@ int conf_write(const char *name) use_timestamp ? "# " : "", use_timestamp ? ctime(&now) : ""); - if (!sym_change_count) + if (!conf_get_changed()) sym_clear_all_valid(); menu = rootmenu.list; @@ -528,7 +528,7 @@ int conf_write(const char *name) "# configuration written to %s\n" "#\n"), newname); - sym_change_count = 0; + sym_set_change_count(0); return 0; } @@ -765,3 +765,30 @@ int conf_write_autoconf(void) return 0; } + +static int sym_change_count; +static void (*conf_changed_callback)(void); + +void sym_set_change_count(int count) +{ + int _sym_change_count = sym_change_count; + sym_change_count = count; + if (conf_changed_callback && + (bool)_sym_change_count != (bool)count) + conf_changed_callback(); +} + +void sym_add_change_count(int count) +{ + sym_set_change_count(count + sym_change_count); +} + +bool conf_get_changed(void) +{ + return sym_change_count; +} + +void conf_set_changed_callback(void (*fn)(void)) +{ + conf_changed_callback = fn; +} diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index 7b0d3a9..61d8166 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c @@ -38,8 +38,6 @@ static gboolean show_all = FALSE; static gboolean show_debug = FALSE; static gboolean resizeable = FALSE; -static gboolean config_changed = FALSE; - static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n"); @@ -50,6 +48,8 @@ GtkWidget *text_w = NULL; GtkWidget *hpaned = NULL; GtkWidget *vpaned = NULL; GtkWidget *back_btn = NULL; +GtkWidget *save_btn = NULL; +GtkWidget *save_menu_item = NULL; GtkTextTag *tag1, *tag2; GdkColor color; @@ -75,7 +75,7 @@ static void display_tree_part(void); static void update_tree(struct menu *src, GtkTreeIter * dst); static void set_node(GtkTreeIter * node, struct menu *menu, gchar ** row); static gchar **fill_row(struct menu *menu); - +static void conf_changed(void); /* Helping/Debugging Functions */ @@ -224,6 +224,10 @@ void init_main_window(const gchar * glade_file) gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget, show_value); + save_btn = glade_xml_get_widget(xml, "button3"); + save_menu_item = glade_xml_get_widget(xml, "save1"); + conf_set_changed_callback(conf_changed); + style = gtk_widget_get_style(main_wnd); widget = glade_xml_get_widget(xml, "toolbar1"); @@ -512,14 +516,14 @@ static void text_insert_msg(const char *title, const char *message) /* Main Windows Callbacks */ -void on_save1_activate(GtkMenuItem * menuitem, gpointer user_data); +void on_save_activate(GtkMenuItem * menuitem, gpointer user_data); gboolean on_window1_delete_event(GtkWidget * widget, GdkEvent * event, gpointer user_data) { GtkWidget *dialog, *label; gint result; - if (config_changed == FALSE) + if (!conf_get_changed()) return FALSE; dialog = gtk_dialog_new_with_buttons(_("Warning !"), @@ -543,7 +547,7 @@ gboolean on_window1_delete_event(GtkWidget * widget, GdkEvent * event, result = gtk_dialog_run(GTK_DIALOG(dialog)); switch (result) { case GTK_RESPONSE_YES: - on_save1_activate(NULL, NULL); + on_save_activate(NULL, NULL); return FALSE; case GTK_RESPONSE_NO: return FALSE; @@ -621,12 +625,10 @@ void on_load1_activate(GtkMenuItem * menuitem, gpointer user_data) } -void on_save1_activate(GtkMenuItem * menuitem, gpointer user_data) +void on_save_activate(GtkMenuItem * menuitem, gpointer user_data) { if (conf_write(NULL)) text_insert_msg(_("Error"), _("Unable to save configuration !")); - - config_changed = FALSE; } @@ -819,12 +821,6 @@ void on_load_clicked(GtkButton * button, gpointer user_data) } -void on_save_clicked(GtkButton * button, gpointer user_data) -{ - on_save1_activate(NULL, user_data); -} - - void on_single_clicked(GtkButton * button, gpointer user_data) { view_mode = SINGLE_VIEW; @@ -899,7 +895,6 @@ static void renderer_edited(GtkCellRendererText * cell, sym_set_string_value(sym, new_def); - config_changed = TRUE; update_tree(&rootmenu, NULL); gtk_tree_path_free(path); @@ -930,7 +925,6 @@ static void change_sym_value(struct menu *menu, gint col) if (!sym_tristate_within_range(sym, newval)) newval = yes; sym_set_tristate_value(sym, newval); - config_changed = TRUE; if (view_mode == FULL_VIEW) update_tree(&rootmenu, NULL); else if (view_mode == SPLIT_VIEW) { @@ -1633,3 +1627,10 @@ int main(int ac, char *av[]) return 0; } + +static void conf_changed(void) +{ + bool changed = conf_get_changed(); + gtk_widget_set_sensitive(save_btn, changed); + gtk_widget_set_sensitive(save_menu_item, changed); +} diff --git a/scripts/kconfig/gconf.glade b/scripts/kconfig/gconf.glade index f8744ed..803233f 100644 --- a/scripts/kconfig/gconf.glade +++ b/scripts/kconfig/gconf.glade @@ -70,7 +70,7 @@ <property name="tooltip" translatable="yes">Save the config in .config</property> <property name="label" translatable="yes">_Save</property> <property name="use_underline">True</property> - <signal name="activate" handler="on_save1_activate"/> + <signal name="activate" handler="on_save_activate"/> <accelerator key="S" modifiers="GDK_CONTROL_MASK" signal="activate"/> <child internal-child="image"> @@ -380,7 +380,7 @@ <property name="visible_horizontal">True</property> <property name="visible_vertical">True</property> <property name="is_important">False</property> - <signal name="clicked" handler="on_save_clicked"/> + <signal name="clicked" handler="on_save_activate"/> </widget> <packing> <property name="expand">False</property> diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index 2628023..9b2706a 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h @@ -65,6 +65,8 @@ char *zconf_curname(void); /* confdata.c */ char *conf_get_default_confname(void); +void sym_set_change_count(int count); +void sym_add_change_count(int count); /* kconfig_load.c */ void kconfig_load(void); diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h index a263746..1503077 100644 --- a/scripts/kconfig/lkc_proto.h +++ b/scripts/kconfig/lkc_proto.h @@ -5,6 +5,8 @@ P(conf_read,int,(const char *name)); P(conf_read_simple,int,(const char *name, int)); P(conf_write,int,(const char *name)); P(conf_write_autoconf,int,(void)); +P(conf_get_changed,bool,(void)); +P(conf_set_changed_callback, void,(void (*fn)(void))); /* menu.c */ P(rootmenu,struct menu,); @@ -16,7 +18,6 @@ P(menu_get_parent_menu,struct menu *,(struct menu *menu)); /* symbol.c */ P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]); -P(sym_change_count,int,); P(sym_lookup,struct symbol *,(const char *name, int isconst)); P(sym_find,struct symbol *,(const char *name)); diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 08a4c7a..3f9a132 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -890,14 +890,19 @@ int main(int ac, char **av) do { conf(&rootmenu); dialog_clear(); - res = dialog_yesno(NULL, - _("Do you wish to save your " - "new kernel configuration?\n" - "<ESC><ESC> to continue."), - 6, 60); + if (conf_get_changed()) + res = dialog_yesno(NULL, + _("Do you wish to save your " + "new kernel configuration?\n" + "<ESC><ESC> to continue."), + 6, 60); + else + res = -1; } while (res == KEY_ESC); end_dialog(); - if (res == 0) { + + switch (res) { + case 0: if (conf_write(NULL)) { fprintf(stderr, _("\n\n" "Error during writing of the kernel configuration.\n" @@ -905,11 +910,13 @@ int main(int ac, char **av) "\n\n")); return 1; } + case -1: printf(_("\n\n" "*** End of Linux kernel configuration.\n" "*** Execute 'make' to build the kernel or try 'make help'." "\n\n")); - } else { + break; + default: fprintf(stderr, _("\n\n" "Your kernel configuration changes were NOT saved." "\n\n")); diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index f5628c5..c0ae0a7 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -38,6 +38,8 @@ static QApplication *configApp; static ConfigSettings *configSettings; +QAction *ConfigMainWindow::saveAction; + static inline QString qgettext(const char* str) { return QString::fromLocal8Bit(gettext(str)); @@ -915,7 +917,7 @@ void ConfigView::updateListAll(void) } ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name) - : Parent(parent, name), menu(0) + : Parent(parent, name), menu(0), sym(0) { if (name) { configSettings->beginGroup(name); @@ -951,6 +953,7 @@ void ConfigInfoView::setInfo(struct menu *m) if (menu == m) return; menu = m; + sym = NULL; if (!menu) clear(); else @@ -1306,8 +1309,11 @@ ConfigMainWindow::ConfigMainWindow(void) connect(quitAction, SIGNAL(activated()), SLOT(close())); QAction *loadAction = new QAction("Load", QPixmap(xpm_load), "&Load", CTRL+Key_L, this); connect(loadAction, SIGNAL(activated()), SLOT(loadConfig())); - QAction *saveAction = new QAction("Save", QPixmap(xpm_save), "&Save", CTRL+Key_S, this); + saveAction = new QAction("Save", QPixmap(xpm_save), "&Save", CTRL+Key_S, this); connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); + conf_set_changed_callback(conf_changed); + // Set saveAction's initial state + conf_changed(); QAction *saveAsAction = new QAction("Save As...", "Save &As...", 0, this); connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs())); QAction *searchAction = new QAction("Search", "&Search", CTRL+Key_F, this); @@ -1585,7 +1591,7 @@ void ConfigMainWindow::showFullView(void) */ void ConfigMainWindow::closeEvent(QCloseEvent* e) { - if (!sym_change_count) { + if (!conf_get_changed()) { e->accept(); return; } @@ -1658,6 +1664,12 @@ void ConfigMainWindow::saveSettings(void) configSettings->writeSizes("/split2", split2->sizes()); } +void ConfigMainWindow::conf_changed(void) +{ + if (saveAction) + saveAction->setEnabled(conf_get_changed()); +} + void fixup_rootmenu(struct menu *menu) { struct menu *child; diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h index 6a9e3b1..6fc1c5f 100644 --- a/scripts/kconfig/qconf.h +++ b/scripts/kconfig/qconf.h @@ -297,6 +297,9 @@ protected: class ConfigMainWindow : public QMainWindow { Q_OBJECT + + static QAction *saveAction; + static void conf_changed(void); public: ConfigMainWindow(void); public slots: diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index ee225ce..8f06c47 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -30,7 +30,6 @@ struct symbol symbol_yes = { .flags = SYMBOL_VALID, }; -int sym_change_count; struct symbol *sym_defconfig_list; struct symbol *modules_sym; tristate modules_val; @@ -379,7 +378,7 @@ void sym_clear_all_valid(void) for_all_symbols(i, sym) sym->flags &= ~SYMBOL_VALID; - sym_change_count++; + sym_add_change_count(1); if (modules_sym) sym_calc_value(modules_sym); } diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped index 2fb0a4f..d777fe8 100644 --- a/scripts/kconfig/zconf.tab.c_shipped +++ b/scripts/kconfig/zconf.tab.c_shipped @@ -2135,7 +2135,7 @@ void conf_parse(const char *name) sym_check_deps(sym); } - sym_change_count = 1; + sym_set_change_count(1); } const char *zconf_tokenname(int token) diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index ab44feb..04a5864 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -504,7 +504,7 @@ void conf_parse(const char *name) sym_check_deps(sym); } - sym_change_count = 1; + sym_set_change_count(1); } const char *zconf_tokenname(int token) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index df3b272..f50a70f 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1469,6 +1469,7 @@ sub push_parameter($$$) { my $param = shift; my $type = shift; my $file = shift; + my $anon = 0; my $param_name = $param; $param_name =~ s/\[.*//; @@ -1484,9 +1485,20 @@ sub push_parameter($$$) { $param="void"; $parameterdescs{void} = "no arguments"; } + elsif ($type eq "" && ($param eq "struct" or $param eq "union")) + # handle unnamed (anonymous) union or struct: + { + $type = $param; + $param = "{unnamed_" . $param. "}"; + $parameterdescs{$param} = "anonymous\n"; + $anon = 1; + } + # warn if parameter has no description - # (but ignore ones starting with # as these are no parameters - # but inline preprocessor statements + # (but ignore ones starting with # as these are not parameters + # but inline preprocessor statements); + # also ignore unnamed structs/unions; + if (!$anon) { if (!defined $parameterdescs{$param_name} && $param_name !~ /^#/) { $parameterdescs{$param_name} = $undescribed; @@ -1500,6 +1512,7 @@ sub push_parameter($$$) { " No description found for parameter '$param'\n"; ++$warnings; } + } push @parameterlist, $param; $parametertypes{$param} = $type; diff --git a/scripts/makelst b/scripts/makelst index 34bd7239..4fc80f2 100755 --- a/scripts/makelst +++ b/scripts/makelst @@ -1,31 +1,31 @@ -#!/bin/bash +#!/bin/sh # A script to dump mixed source code & assembly # with correct relocations from System.map -# Requires the following lines in Rules.make. -# Author(s): DJ Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com) -# William Stearns <wstearns@pobox.com> +# Requires the following lines in makefile: #%.lst: %.c # $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -g -c -o $*.o $< -# $(TOPDIR)/scripts/makelst $*.o $(TOPDIR)/System.map $(OBJDUMP) +# $(srctree)/scripts/makelst $*.o $(objtree)/System.map $(OBJDUMP) # -# Copyright (C) 2000 IBM Corporation -# Author(s): DJ Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com) +# Copyright (C) 2000 IBM Corporation +# Author(s): DJ Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com) +# William Stearns <wstearns@pobox.com> # -t1=`$3 --syms $1 | grep .text | grep " F " | head -n 1` +# awk style field access +field() { + shift $1 ; echo $1 +} + +t1=`$3 --syms $1 | grep .text | grep -m1 " F "` if [ -n "$t1" ]; then - t2=`echo $t1 | gawk '{ print $6 }'` + t2=`field 6 $t1` if [ ! -r $2 ]; then echo "No System.map" >&2 - t7=0 else t3=`grep $t2 $2` - t4=`echo $t3 | gawk '{ print $1 }'` - t5=`echo $t1 | gawk '{ print $1 }'` - t6=`echo $t4 - $t5 | tr a-f A-F` - t7=`( echo ibase=16 ; echo $t6 ) | bc` + t4=`field 1 $t3` + t5=`field 1 $t1` + t6=`printf "%lu" $((0x$t4 - 0x$t5))` fi -else - t7=0 fi -$3 -r --source --adjust-vma=$t7 $1 +$3 -r --source --adjust-vma=${t6:-0} $1 diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index ac0a582..2aa4762 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -582,9 +582,19 @@ static int strrcmp(const char *s, const char *sub) * tosec = .init.text | .exit.text | .init.data * fromsec = .data * atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one + * + * Pattern 3: + * Some symbols belong to init section but still it is ok to reference + * these from non-init sections as these symbols don't have any memory + * allocated for them and symbol address and value are same. So even + * if init section is freed, its ok to reference those symbols. + * For ex. symbols marking the init section boundaries. + * This pattern is identified by + * refsymname = __init_begin, _sinittext, _einittext **/ static int secref_whitelist(const char *modname, const char *tosec, - const char *fromsec, const char *atsym) + const char *fromsec, const char *atsym, + const char *refsymname) { int f1 = 1, f2 = 1; const char **s; @@ -595,6 +605,14 @@ static int secref_whitelist(const char *modname, const char *tosec, "_ops", "_probe", "_probe_one", + "_console", + NULL + }; + + const char *pat3refsym[] = { + "__init_begin", + "_sinittext", + "_einittext", NULL }; @@ -628,6 +646,11 @@ static int secref_whitelist(const char *modname, const char *tosec, if ((strcmp(fromsec, ".pci_fixup") == 0) && (strcmp(tosec, ".init.text") == 0)) return 1; + + /* Check for pattern 3 */ + for (s = pat3refsym; *s; s++) + if (strcmp(refsymname, *s) == 0) + return 1; } return 0; } @@ -737,7 +760,7 @@ static void warn_sec_mismatch(const char *modname, const char *fromsec, /* check whitelist - we may ignore it */ if (before && secref_whitelist(modname, secname, fromsec, - elf->strtab + before->st_name)) + elf->strtab + before->st_name, refsymname)) return; if (before && after) { @@ -997,6 +1020,7 @@ static int exit_section_ref_ok(const char *name) "__bug_table", /* used by powerpc for BUG() */ ".exitcall.exit", ".eh_frame", + ".parainstructions", ".stab", "__ex_table", ".fixup", |