aruu

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

asm_code.h (622B)


      1 /* struct code: the binary output of a single encoded instruction
      2  * arch-neutral. MAKE_CODE and IM* macros live in arch.h since they
      3  * call into the arch backend */
      4 
      5 #ifndef AS_ASM_CODE_H
      6 #define AS_ASM_CODE_H
      7 
      8 #include "../config.h"
      9 
     10 struct Inst;
     11 
     12 /* max encoded instruction width in bytes */
     13 #if TC_TARGET_ARCH == TC_ARCH_RISCV64
     14 #define ARCH_MAX_CODE_LEN 26
     15 #else
     16 #define ARCH_MAX_CODE_LEN 14
     17 #endif
     18 
     19 #define INST_LONG_OFFSET (1 << 0) /* 32bit offset on jump etc */
     20 
     21 struct Code {
     22   struct Inst  *inst;
     23   char          flag;
     24   char          len;
     25   unsigned char buf[ARCH_MAX_CODE_LEN];
     26 };
     27 
     28 #endif /* AS_ASM_CODE_H */