linux/arch/x86
Jonathan Nieder 23637568ad x86: Fix kprobes build with non-gawk awk
The instruction attribute table generator fails when run by mawk
or original-awk:

 $ mawk -f arch/x86/tools/gen-insn-attr-x86.awk \
	arch/x86/lib/x86-opcode-map.txt > /dev/null
 Semantic error at 240: Second IMM error
 $ echo $?
 1

Line 240 contains "c8: ENTER Iw,Ib", which indicates that this
instruction has two immediate operands, the second of which is
one byte.  The script loops through the immediate operands using
a for loop.

Unfortunately, there is no guarantee in awk that a for (variable
in array) loop will return the indices in increasing order.
Internally, both original-awk and mawk iterate over a hash table
for this purpose, and both implementations happen to produce the
index 2 before 1.  The supposed second immediate operand is more
than one byte wide, producing the error.

So loop over the indices in increasing order instead.  As a
side-effect, with mawk this means the silly two-entry hash table
never has to be built.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by Masami Hiramatsu <mhiramat@redhat.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20091213220437.GA27718@progeny.tock>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-12-15 20:35:49 +01:00
..
boot x86: Regex support and known-movable symbols for relocs, fix _end 2009-12-14 13:55:20 -08:00
configs
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2009-12-01 15:16:22 +08:00
ia32 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2009-12-08 07:55:01 -08:00
include/asm Merge branch 'x86/asm' into x86/urgent 2009-12-15 20:33:28 +01:00
kernel Merge branch 'x86/mce' into x86/urgent 2009-12-15 20:33:53 +01:00
kvm x86: i8254.c: Add pr_fmt(fmt) 2009-12-10 08:57:50 +01:00
lguest lguest: move panic notifier registration to its expected place. 2009-09-23 22:26:44 +09:30
lib x86, msr: Add support for non-contiguous cpumasks 2009-12-11 10:59:21 -08:00
math-emu
mm x86: Fix build warning in arch/x86/mm/mmio-mod.c 2009-12-14 08:55:43 +01:00
oprofile perf: Do the big rename: Performance Counters -> Performance Events 2009-09-21 14:28:04 +02:00
pci const: mark struct vm_struct_operations 2009-09-27 11:39:25 -07:00
power hw-breakpoints: Rewrite the hw-breakpoints layer on top of perf events 2009-11-08 15:34:42 +01:00
tools x86: Fix kprobes build with non-gawk awk 2009-12-15 20:35:49 +01:00
vdso sysctl x86: Remove dead binary sysctl support 2009-11-12 02:05:04 -08:00
video
xen Merge branch 'bugfix' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen 2009-12-10 09:35:02 -08:00
Kbuild
Kconfig Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-08 13:38:11 -08:00
Kconfig.cpu Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-08 13:27:33 -08:00
Kconfig.debug Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-05 15:32:03 -08:00
Makefile Merge branch 'perf/core' into perf/probes 2009-11-17 10:17:47 +01:00
Makefile_32.cpu Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-08 13:38:11 -08:00