Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: pre-cxx
Fetching contributors…

Cannot retrieve contributors at this time

file 38 lines (31 sloc) 1.071 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
#ifndef __BT_H__
#define __BT_H__

#define MAX_BYTES_PER_INSTRUCTION 24
#define MAX_FRAG_SIZE 10
#define PC_CHECK_SIZE 12
#define CCBUFF_PROLOGUE_SIZE 26
#define CCBUFF_EPILOGUE_SIZE 11
#define CCBUFF_MAX_SIZE (MAX_BYTES_PER_INSTRUCTION * \
MAX_FRAG_SIZE \
+ CCBUFF_EPILOGUE_SIZE \
+ CCBUFF_PROLOGUE_SIZE \
+ PC_CHECK_SIZE)
#define PGSIZE 0x1000

typedef struct _decode_frag {
    byteptr start_pc;
    bdecode insts[MAX_FRAG_SIZE];
    bool tail;
    uint8_t ninsts;
} decode_frag;

typedef struct _compiled_frag {
    byteptr start_pc;
    struct _compiled_frag *hash_next;
    uint8_t *code;
} compiled_frag;

typedef struct _fault_entry {
    uint8_t *eip;
    byteptr pc;
} fault_entry;

#define HASH_PC(pc) (((pc) >> 2) & 0xFF)

void bt_run(beta_cpu *cpu);

#endif
Something went wrong with that request. Please try again.