aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Kbuild.include10
-rw-r--r--scripts/Makefile.modpost2
-rw-r--r--scripts/kconfig/confdata.c2
-rwxr-xr-xscripts/kernel-doc1
-rw-r--r--scripts/mod/file2alias.c62
5 files changed, 54 insertions, 23 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 2180c88cfe89..bb19c1561f1e 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -77,14 +77,20 @@ cc-option-align = $(subst -functions=0,,\
77 77
78# cc-version 78# cc-version
79# Usage gcc-ver := $(call cc-version, $(CC)) 79# Usage gcc-ver := $(call cc-version, $(CC))
80cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh \ 80cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))
81 $(if $(1), $(1), $(CC)))
82 81
83# cc-ifversion 82# cc-ifversion
84# Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) 83# Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
85cc-ifversion = $(shell if [ $(call cc-version, $(CC)) $(1) $(2) ]; then \ 84cc-ifversion = $(shell if [ $(call cc-version, $(CC)) $(1) $(2) ]; then \
86 echo $(3); fi;) 85 echo $(3); fi;)
87 86
87# ld-option
88# Usage: ldflags += $(call ld-option, -Wl$(comma)--hash-style=both)
89ld-option = $(shell if $(CC) $(1) \
90 -nostdlib -o ldtest$$$$.out -xc /dev/null \
91 > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi; \
92 rm -f ldtest$$$$.out)
93
88### 94###
89# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj= 95# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
90# Usage: 96# Usage:
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index a49550205dcc..0a64688c2b5d 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -40,7 +40,7 @@ include scripts/Kbuild.include
40include scripts/Makefile.lib 40include scripts/Makefile.lib
41 41
42kernelsymfile := $(objtree)/Module.symvers 42kernelsymfile := $(objtree)/Module.symvers
43modulesymfile := $(KBUILD_EXTMOD)/Modules.symvers 43modulesymfile := $(KBUILD_EXTMOD)/Module.symvers
44 44
45# Step 1), find all modules listed in $(MODVERDIR)/ 45# Step 1), find all modules listed in $(MODVERDIR)/
46__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod))) 46__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 2ee48c377b66..a69d8acbf274 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -357,7 +357,7 @@ int conf_read(const char *name)
357 for (e = prop->expr; e; e = e->left.expr) 357 for (e = prop->expr; e; e = e->left.expr)
358 if (e->right.sym->visible != no) 358 if (e->right.sym->visible != no)
359 flags &= e->right.sym->flags; 359 flags &= e->right.sym->flags;
360 sym->flags |= flags & SYMBOL_DEF_USER; 360 sym->flags &= flags | ~SYMBOL_DEF_USER;
361 } 361 }
362 362
363 sym_change_count += conf_warnings || conf_unsaved; 363 sym_change_count += conf_warnings || conf_unsaved;
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index f9460a6218de..c9ca0c23bd91 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1518,6 +1518,7 @@ sub dump_function($$) {
1518 $prototype =~ s/^asmlinkage +//; 1518 $prototype =~ s/^asmlinkage +//;
1519 $prototype =~ s/^inline +//; 1519 $prototype =~ s/^inline +//;
1520 $prototype =~ s/^__inline__ +//; 1520 $prototype =~ s/^__inline__ +//;
1521 $prototype =~ s/__devinit +//;
1521 $prototype =~ s/^#define +//; #ak added 1522 $prototype =~ s/^#define +//; #ak added
1522 $prototype =~ s/__attribute__ \(\([a-z,]*\)\)//; 1523 $prototype =~ s/__attribute__ \(\([a-z,]*\)\)//;
1523 1524
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 37f67c23e11b..44312926b849 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -52,6 +52,23 @@ do { \
52 sprintf(str + strlen(str), "*"); \ 52 sprintf(str + strlen(str), "*"); \
53} while(0) 53} while(0)
54 54
55/**
56 * Check that sizeof(device_id type) are consistent with size of section
57 * in .o file. If in-consistent then userspace and kernel does not agree
58 * on actual size which is a bug.
59 **/
60static void device_id_size_check(const char *modname, const char *device_id,
61 unsigned long size, unsigned long id_size)
62{
63 if (size % id_size || size < id_size) {
64 fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo "
65 "of the size of section __mod_%s_device_table=%lu.\n"
66 "Fix definition of struct %s_device_id "
67 "in mod_devicetable.h\n",
68 modname, device_id, id_size, device_id, size, device_id);
69 }
70}
71
55/* USB is special because the bcdDevice can be matched against a numeric range */ 72/* USB is special because the bcdDevice can be matched against a numeric range */
56/* Looks like "usb:vNpNdNdcNdscNdpNicNiscNipN" */ 73/* Looks like "usb:vNpNdNdcNdscNdpNicNiscNipN" */
57static void do_usb_entry(struct usb_device_id *id, 74static void do_usb_entry(struct usb_device_id *id,
@@ -152,10 +169,8 @@ static void do_usb_table(void *symval, unsigned long size,
152 unsigned int i; 169 unsigned int i;
153 const unsigned long id_size = sizeof(struct usb_device_id); 170 const unsigned long id_size = sizeof(struct usb_device_id);
154 171
155 if (size % id_size || size < id_size) { 172 device_id_size_check(mod->name, "usb", size, id_size);
156 warn("%s ids %lu bad size " 173
157 "(each on %lu)\n", mod->name, size, id_size);
158 }
159 /* Leave last one: it's the terminator. */ 174 /* Leave last one: it's the terminator. */
160 size -= id_size; 175 size -= id_size;
161 176
@@ -434,6 +449,7 @@ static inline int sym_is(const char *symbol, const char *name)
434 449
435static void do_table(void *symval, unsigned long size, 450static void do_table(void *symval, unsigned long size,
436 unsigned long id_size, 451 unsigned long id_size,
452 const char *device_id,
437 void *function, 453 void *function,
438 struct module *mod) 454 struct module *mod)
439{ 455{
@@ -441,10 +457,7 @@ static void do_table(void *symval, unsigned long size,
441 char alias[500]; 457 char alias[500];
442 int (*do_entry)(const char *, void *entry, char *alias) = function; 458 int (*do_entry)(const char *, void *entry, char *alias) = function;
443 459
444 if (size % id_size || size < id_size) { 460 device_id_size_check(mod->name, device_id, size, id_size);
445 warn("%s ids %lu bad size "
446 "(each on %lu)\n", mod->name, size, id_size);
447 }
448 /* Leave last one: it's the terminator. */ 461 /* Leave last one: it's the terminator. */
449 size -= id_size; 462 size -= id_size;
450 463
@@ -476,40 +489,51 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
476 + sym->st_value; 489 + sym->st_value;
477 490
478 if (sym_is(symname, "__mod_pci_device_table")) 491 if (sym_is(symname, "__mod_pci_device_table"))
479 do_table(symval, sym->st_size, sizeof(struct pci_device_id), 492 do_table(symval, sym->st_size,
493 sizeof(struct pci_device_id), "pci",
480 do_pci_entry, mod); 494 do_pci_entry, mod);
481 else if (sym_is(symname, "__mod_usb_device_table")) 495 else if (sym_is(symname, "__mod_usb_device_table"))
482 /* special case to handle bcdDevice ranges */ 496 /* special case to handle bcdDevice ranges */
483 do_usb_table(symval, sym->st_size, mod); 497 do_usb_table(symval, sym->st_size, mod);
484 else if (sym_is(symname, "__mod_ieee1394_device_table")) 498 else if (sym_is(symname, "__mod_ieee1394_device_table"))
485 do_table(symval, sym->st_size, sizeof(struct ieee1394_device_id), 499 do_table(symval, sym->st_size,
500 sizeof(struct ieee1394_device_id), "ieee1394",
486 do_ieee1394_entry, mod); 501 do_ieee1394_entry, mod);
487 else if (sym_is(symname, "__mod_ccw_device_table")) 502 else if (sym_is(symname, "__mod_ccw_device_table"))
488 do_table(symval, sym->st_size, sizeof(struct ccw_device_id), 503 do_table(symval, sym->st_size,
504 sizeof(struct ccw_device_id), "ccw",
489 do_ccw_entry, mod); 505 do_ccw_entry, mod);
490 else if (sym_is(symname, "__mod_serio_device_table")) 506 else if (sym_is(symname, "__mod_serio_device_table"))
491 do_table(symval, sym->st_size, sizeof(struct serio_device_id), 507 do_table(symval, sym->st_size,
508 sizeof(struct serio_device_id), "serio",
492 do_serio_entry, mod); 509 do_serio_entry, mod);
493 else if (sym_is(symname, "__mod_pnp_device_table")) 510 else if (sym_is(symname, "__mod_pnp_device_table"))
494 do_table(symval, sym->st_size, sizeof(struct pnp_device_id), 511 do_table(symval, sym->st_size,
512 sizeof(struct pnp_device_id), "pnp",
495 do_pnp_entry, mod); 513 do_pnp_entry, mod);
496 else if (sym_is(symname, "__mod_pnp_card_device_table")) 514 else if (sym_is(symname, "__mod_pnp_card_device_table"))
497 do_table(symval, sym->st_size, sizeof(struct pnp_card_device_id), 515 do_table(symval, sym->st_size,
516 sizeof(struct pnp_card_device_id), "pnp_card",
498 do_pnp_card_entry, mod); 517 do_pnp_card_entry, mod);
499 else if (sym_is(symname, "__mod_pcmcia_device_table")) 518 else if (sym_is(symname, "__mod_pcmcia_device_table"))
500 do_table(symval, sym->st_size, sizeof(struct pcmcia_device_id), 519 do_table(symval, sym->st_size,
520 sizeof(struct pcmcia_device_id), "pcmcia",
501 do_pcmcia_entry, mod); 521 do_pcmcia_entry, mod);
502 else if (sym_is(symname, "__mod_of_device_table")) 522 else if (sym_is(symname, "__mod_of_device_table"))
503 do_table(symval, sym->st_size, sizeof(struct of_device_id), 523 do_table(symval, sym->st_size,
524 sizeof(struct of_device_id), "of",
504 do_of_entry, mod); 525 do_of_entry, mod);
505 else if (sym_is(symname, "__mod_vio_device_table")) 526 else if (sym_is(symname, "__mod_vio_device_table"))
506 do_table(symval, sym->st_size, sizeof(struct vio_device_id), 527 do_table(symval, sym->st_size,
528 sizeof(struct vio_device_id), "vio",
507 do_vio_entry, mod); 529 do_vio_entry, mod);
508 else if (sym_is(symname, "__mod_i2c_device_table")) 530 else if (sym_is(symname, "__mod_i2c_device_table"))
509 do_table(symval, sym->st_size, sizeof(struct i2c_device_id), 531 do_table(symval, sym->st_size,
532 sizeof(struct i2c_device_id), "i2c",
510 do_i2c_entry, mod); 533 do_i2c_entry, mod);
511 else if (sym_is(symname, "__mod_input_device_table")) 534 else if (sym_is(symname, "__mod_input_device_table"))
512 do_table(symval, sym->st_size, sizeof(struct input_device_id), 535 do_table(symval, sym->st_size,
536 sizeof(struct input_device_id), "input",
513 do_input_entry, mod); 537 do_input_entry, mod);
514} 538}
515 539