hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/x86/tools/gen-insn-attr-x86.awk
....@@ -362,6 +362,9 @@
362362 END {
363363 if (awkchecked != "")
364364 exit 1
365
+
366
+ print "#ifndef __BOOT_COMPRESSED\n"
367
+
365368 # print escape opcode map's array
366369 print "/* Escape opcode map array */"
367370 print "const insn_attr_t * const inat_escape_tables[INAT_ESC_MAX + 1]" \
....@@ -388,6 +391,51 @@
388391 for (j = 0; j < max_lprefix; j++)
389392 if (atable[i,j])
390393 print " ["i"]["j"] = "atable[i,j]","
391
- print "};"
394
+ print "};\n"
395
+
396
+ print "#else /* !__BOOT_COMPRESSED */\n"
397
+
398
+ print "/* Escape opcode map array */"
399
+ print "static const insn_attr_t *inat_escape_tables[INAT_ESC_MAX + 1]" \
400
+ "[INAT_LSTPFX_MAX + 1];"
401
+ print ""
402
+
403
+ print "/* Group opcode map array */"
404
+ print "static const insn_attr_t *inat_group_tables[INAT_GRP_MAX + 1]"\
405
+ "[INAT_LSTPFX_MAX + 1];"
406
+ print ""
407
+
408
+ print "/* AVX opcode map array */"
409
+ print "static const insn_attr_t *inat_avx_tables[X86_VEX_M_MAX + 1]"\
410
+ "[INAT_LSTPFX_MAX + 1];"
411
+ print ""
412
+
413
+ print "static void inat_init_tables(void)"
414
+ print "{"
415
+
416
+ # print escape opcode map's array
417
+ print "\t/* Print Escape opcode map array */"
418
+ for (i = 0; i < geid; i++)
419
+ for (j = 0; j < max_lprefix; j++)
420
+ if (etable[i,j])
421
+ print "\tinat_escape_tables["i"]["j"] = "etable[i,j]";"
422
+ print ""
423
+
424
+ # print group opcode map's array
425
+ print "\t/* Print Group opcode map array */"
426
+ for (i = 0; i < ggid; i++)
427
+ for (j = 0; j < max_lprefix; j++)
428
+ if (gtable[i,j])
429
+ print "\tinat_group_tables["i"]["j"] = "gtable[i,j]";"
430
+ print ""
431
+ # print AVX opcode map's array
432
+ print "\t/* Print AVX opcode map array */"
433
+ for (i = 0; i < gaid; i++)
434
+ for (j = 0; j < max_lprefix; j++)
435
+ if (atable[i,j])
436
+ print "\tinat_avx_tables["i"]["j"] = "atable[i,j]";"
437
+
438
+ print "}"
439
+ print "#endif"
392440 }
393441