aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/tools
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@redhat.com>2009-08-21 15:43:16 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2009-08-26 20:32:50 -0400
commit69d991f32152283cbc373136fa45bbb152b32048 (patch)
tree48c77986a08e2c8348d861df08e57ce3ddd32dd0 /arch/x86/tools
parent8d7d14fb27818eb08ebedf9f4a6e286970fe9977 (diff)
x86: Check awk features before generating inat-tables.c
Check some awk mandatory features to generate inat-tables.c that old mawk doesn't support. Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com> Cc: Jim Keniston <jkenisto@us.ibm.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Avi Kivity <avi@redhat.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Frank Ch. Eigler <fche@redhat.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Jason Baron <jbaron@redhat.com> Cc: K.Prasad <prasad@linux.vnet.ibm.com> Cc: Lai Jiangshan <laijs@cn.fujitsu.com> Cc: Li Zefan <lizf@cn.fujitsu.com> Cc: Przemysław Pawełczyk <przemyslaw@pawelczyk.it> Cc: Roland McGrath <roland@redhat.com> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Tom Zanussi <tzanussi@gmail.com> Cc: Vegard Nossum <vegard.nossum@gmail.com> LKML-Reference: <20090821194316.12478.57394.stgit@localhost.localdomain> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'arch/x86/tools')
-rw-r--r--arch/x86/tools/gen-insn-attr-x86.awk20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/x86/tools/gen-insn-attr-x86.awk b/arch/x86/tools/gen-insn-attr-x86.awk
index 93b62c92d044..19ba096b7dd1 100644
--- a/arch/x86/tools/gen-insn-attr-x86.awk
+++ b/arch/x86/tools/gen-insn-attr-x86.awk
@@ -4,7 +4,25 @@
4# 4#
5# Usage: awk -f gen-insn-attr-x86.awk x86-opcode-map.txt > inat-tables.c 5# Usage: awk -f gen-insn-attr-x86.awk x86-opcode-map.txt > inat-tables.c
6 6
7# Awk implementation sanity check
8function check_awk_implement() {
9 if (!match("abc", "[[:lower:]]+"))
10 return "Your awk doesn't support charactor-class."
11 if (sprintf("%x", 0) != "0")
12 return "Your awk has a printf-format problem."
13 return ""
14}
15
7BEGIN { 16BEGIN {
17 # Implementation error checking
18 awkchecked = check_awk_implement()
19 if (awkchecked != "") {
20 print "Error: " awkchecked > "/dev/stderr"
21 print "Please try to use gawk." > "/dev/stderr"
22 exit 1
23 }
24
25 # Setup generating tables
8 print "/* x86 opcode map generated from x86-opcode-map.txt */" 26 print "/* x86 opcode map generated from x86-opcode-map.txt */"
9 print "/* Do not change this code. */" 27 print "/* Do not change this code. */"
10 ggid = 1 28 ggid = 1
@@ -293,6 +311,8 @@ function convert_operands(opnd, i,imm,mod)
293} 311}
294 312
295END { 313END {
314 if (awkchecked != "")
315 exit 1
296 # print escape opcode map's array 316 # print escape opcode map's array
297 print "/* Escape opcode map array */" 317 print "/* Escape opcode map array */"
298 print "const insn_attr_t const *inat_escape_tables[INAT_ESC_MAX + 1]" \ 318 print "const insn_attr_t const *inat_escape_tables[INAT_ESC_MAX + 1]" \