diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/Makefile.fwinst | 10 | ||||
| -rwxr-xr-x | scripts/checkstack.pl | 27 |
2 files changed, 31 insertions, 6 deletions
diff --git a/scripts/Makefile.fwinst b/scripts/Makefile.fwinst index c972c0f54ce0..f63a663de158 100644 --- a/scripts/Makefile.fwinst +++ b/scripts/Makefile.fwinst | |||
| @@ -17,14 +17,15 @@ include $(srctree)/$(obj)/Makefile | |||
| 17 | 17 | ||
| 18 | include scripts/Makefile.host | 18 | include scripts/Makefile.host |
| 19 | 19 | ||
| 20 | mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-m)) | 20 | mod-fw := $(fw-shipped-m) |
| 21 | |||
| 22 | # If CONFIG_FIRMWARE_IN_KERNEL isn't set, then install the | 21 | # If CONFIG_FIRMWARE_IN_KERNEL isn't set, then install the |
| 23 | # firmware for in-kernel drivers too. | 22 | # firmware for in-kernel drivers too. |
| 24 | ifndef CONFIG_FIRMWARE_IN_KERNEL | 23 | ifndef CONFIG_FIRMWARE_IN_KERNEL |
| 25 | mod-fw += $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-y)) | 24 | mod-fw += $(fw-shipped-y) |
| 26 | endif | 25 | endif |
| 27 | 26 | ||
| 27 | installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw)) | ||
| 28 | |||
| 28 | installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all)) | 29 | installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all)) |
| 29 | installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/. | 30 | installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/. |
| 30 | 31 | ||
| @@ -49,7 +50,8 @@ PHONY += __fw_install __fw_modinst FORCE | |||
| 49 | .PHONY: $(PHONY) | 50 | .PHONY: $(PHONY) |
| 50 | 51 | ||
| 51 | __fw_install: $(installed-fw) | 52 | __fw_install: $(installed-fw) |
| 52 | __fw_modinst: $(mod-fw) | 53 | __fw_modinst: $(installed-mod-fw) |
| 54 | __fw_modbuild: $(addprefix $(obj)/,$(mod-fw)) | ||
| 53 | 55 | ||
| 54 | FORCE: | 56 | FORCE: |
| 55 | 57 | ||
diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl index 340ad6920511..3eca62566d6b 100755 --- a/scripts/checkstack.pl +++ b/scripts/checkstack.pl | |||
| @@ -26,12 +26,17 @@ | |||
| 26 | # $& (whole re) matches the complete objdump line with the stack growth | 26 | # $& (whole re) matches the complete objdump line with the stack growth |
| 27 | # $1 (first bracket) matches the size of the stack growth | 27 | # $1 (first bracket) matches the size of the stack growth |
| 28 | # | 28 | # |
| 29 | # $dre is similar, but for dynamic stack redutions: | ||
| 30 | # $& (whole re) matches the complete objdump line with the stack growth | ||
| 31 | # $1 (first bracket) matches the dynamic amount of the stack growth | ||
| 32 | # | ||
| 29 | # use anything else and feel the pain ;) | 33 | # use anything else and feel the pain ;) |
| 30 | my (@stack, $re, $x, $xs); | 34 | my (@stack, $re, $dre, $x, $xs); |
| 31 | { | 35 | { |
| 32 | my $arch = shift; | 36 | my $arch = shift; |
| 33 | if ($arch eq "") { | 37 | if ($arch eq "") { |
| 34 | $arch = `uname -m`; | 38 | $arch = `uname -m`; |
| 39 | chomp($arch); | ||
| 35 | } | 40 | } |
| 36 | 41 | ||
| 37 | $x = "[0-9a-f]"; # hex character | 42 | $x = "[0-9a-f]"; # hex character |
| @@ -46,9 +51,11 @@ my (@stack, $re, $x, $xs); | |||
| 46 | } elsif ($arch =~ /^i[3456]86$/) { | 51 | } elsif ($arch =~ /^i[3456]86$/) { |
| 47 | #c0105234: 81 ec ac 05 00 00 sub $0x5ac,%esp | 52 | #c0105234: 81 ec ac 05 00 00 sub $0x5ac,%esp |
| 48 | $re = qr/^.*[as][du][db] \$(0x$x{1,8}),\%esp$/o; | 53 | $re = qr/^.*[as][du][db] \$(0x$x{1,8}),\%esp$/o; |
| 54 | $dre = qr/^.*[as][du][db] (%.*),\%esp$/o; | ||
| 49 | } elsif ($arch eq 'x86_64') { | 55 | } elsif ($arch eq 'x86_64') { |
| 50 | # 2f60: 48 81 ec e8 05 00 00 sub $0x5e8,%rsp | 56 | # 2f60: 48 81 ec e8 05 00 00 sub $0x5e8,%rsp |
| 51 | $re = qr/^.*[as][du][db] \$(0x$x{1,8}),\%rsp$/o; | 57 | $re = qr/^.*[as][du][db] \$(0x$x{1,8}),\%rsp$/o; |
| 58 | $dre = qr/^.*[as][du][db] (\%.*),\%rsp$/o; | ||
| 52 | } elsif ($arch eq 'ia64') { | 59 | } elsif ($arch eq 'ia64') { |
| 53 | #e0000000044011fc: 01 0f fc 8c adds r12=-384,r12 | 60 | #e0000000044011fc: 01 0f fc 8c adds r12=-384,r12 |
| 54 | $re = qr/.*adds.*r12=-(([0-9]{2}|[3-9])[0-9]{2}),r12/o; | 61 | $re = qr/.*adds.*r12=-(([0-9]{2}|[3-9])[0-9]{2}),r12/o; |
| @@ -85,7 +92,7 @@ my (@stack, $re, $x, $xs); | |||
| 85 | # 0: 00 e8 38 01 LINK 0x4e0; | 92 | # 0: 00 e8 38 01 LINK 0x4e0; |
| 86 | $re = qr/.*[[:space:]]LINK[[:space:]]*(0x$x{1,8})/o; | 93 | $re = qr/.*[[:space:]]LINK[[:space:]]*(0x$x{1,8})/o; |
| 87 | } else { | 94 | } else { |
| 88 | print("wrong or unknown architecture\n"); | 95 | print("wrong or unknown architecture \"$arch\"\n"); |
| 89 | exit | 96 | exit |
| 90 | } | 97 | } |
| 91 | } | 98 | } |
| @@ -141,6 +148,22 @@ while (my $line = <STDIN>) { | |||
| 141 | next if ($size < 100); | 148 | next if ($size < 100); |
| 142 | push @stack, "$intro$size\n"; | 149 | push @stack, "$intro$size\n"; |
| 143 | } | 150 | } |
| 151 | elsif (defined $dre && $line =~ m/$dre/) { | ||
| 152 | my $size = "Dynamic ($1)"; | ||
| 153 | |||
| 154 | next if $line !~ m/^($xs*)/; | ||
| 155 | my $addr = $1; | ||
| 156 | $addr =~ s/ /0/g; | ||
| 157 | $addr = "0x$addr"; | ||
| 158 | |||
| 159 | my $intro = "$addr $func [$file]:"; | ||
| 160 | my $padlen = 56 - length($intro); | ||
| 161 | while ($padlen > 0) { | ||
| 162 | $intro .= ' '; | ||
| 163 | $padlen -= 8; | ||
| 164 | } | ||
| 165 | push @stack, "$intro$size\n"; | ||
| 166 | } | ||
| 144 | } | 167 | } |
| 145 | 168 | ||
| 146 | print sort bysize @stack; | 169 | print sort bysize @stack; |
