31 lines
792 B
C
31 lines
792 B
C
#ifndef __SMCC_ASM_RISCV32_H__
|
|
#define __SMCC_ASM_RISCV32_H__
|
|
|
|
#include <lib/core.h>
|
|
#include <lib/utils/ds/vector.h>
|
|
#include <lib/utils/symtab/symtab.h>
|
|
#include "riscv32_def.h"
|
|
#include "symtab_asm.h"
|
|
|
|
typedef struct rotated_instr {
|
|
u32_t address;
|
|
symasm_entry_t target;
|
|
rv32_instr_t instr;
|
|
} rotated_instr_t;
|
|
|
|
typedef struct rv32_prog {
|
|
strpool_t* strpool;
|
|
symtab_asm_t symtab;
|
|
u32_t text_base_address;
|
|
vector_header(text, u32_t);
|
|
u32_t data_base_address;
|
|
vector_header(data, iptr_t);
|
|
vector_header(rinstrs, rotated_instr_t);
|
|
} rv32_prog_t;
|
|
|
|
void init_rv32_prog(rv32_prog_t* prog, strpool_t* strpool);
|
|
int emit_rv32_instr(rv32_prog_t* prog, rv32_instr_t *instr, u32_t idx, symasm_entry_t *target);
|
|
// int gen_rv32_instr(rv32_prog_t* prog);
|
|
|
|
#endif
|