aruu

[MIRROR] Actual replacement for Busybox | suckless
git clone https://git.daat.foo/aruu.git
Log | Files | Refs | README | LICENSE

backend.c (1377B)


      1 /* x64 arch backend: ties together tables, parser, encoder, and resolver */
      2 
      3 #include "../../../config.h"
      4 #include "arch.h"
      5 
      6 /* raw_op_table, parse_inst_table, parse_operand */
      7 #include "inst.h"
      8 #include "parse_asm.h"
      9 
     10 /* table and function declarations from x64 backend sources */
     11 extern const char                 *kRawOpTable[];
     12 extern const struct ParseInstTable kParseInstTable[];
     13 extern unsigned int
     14 parse_operand(struct ParseInfo *info, unsigned int opr_flag, struct Operand *operand);
     15 extern void          assemble_inst(struct Inst *inst, struct ParseInfo *info, struct Code *code);
     16 extern void          make_code(struct Inst *inst, struct Code *code, unsigned char *buf, int len);
     17 extern unsigned char x64_scan_prefix(struct ParseInfo *info);
     18 extern void          x64_resolve_code_reloc(
     19     struct IR          *ir,
     20     struct SectionInfo *section,
     21     uint64_t            address,
     22     uint64_t            start_address,
     23     struct Table       *label_table,
     24     struct Vector      *unresolved,
     25     int                *size_upgraded
     26 );
     27 
     28 const struct arch_backend arch = {
     29     .raw_op_table       = kRawOpTable,
     30     .parse_inst_table   = kParseInstTable,
     31     .scan_prefix        = x64_scan_prefix,
     32     .parse_operand      = parse_operand,
     33     .assemble_inst      = assemble_inst,
     34     .make_code          = make_code,
     35     .resolve_code_reloc = x64_resolve_code_reloc,
     36 };