0001
0002
0003
0004
0005
0006
0007
0008 function fatal(msg) {
0009 print "Error at line " NR ": " msg > "/dev/stderr"
0010 exit 1
0011 }
0012
0013
0014 /^$/ { next }
0015 /^#/ { next }
0016
0017 BEGIN {
0018 print "#ifndef __ASM_CPUCAPS_H"
0019 print "#define __ASM_CPUCAPS_H"
0020 print ""
0021 print "/* Generated file - do not edit */"
0022 cap_num = 0
0023 print ""
0024 }
0025
0026 /^[vA-Z0-9_]+$/ {
0027 printf("#define ARM64_%-30s\t%d\n", $0, cap_num++)
0028 next
0029 }
0030
0031 END {
0032 printf("#define ARM64_NCAPS\t\t\t\t%d\n", cap_num)
0033 print ""
0034 print "#endif /* __ASM_CPUCAPS_H */"
0035 }
0036
0037
0038 {
0039 fatal("unhandled statement")
0040 }