Commit b3594732 authored by Julian Kranz's avatar Julian Kranz

Gdrr

- Updated Gdrr CLI example
parent 28af3bd8
......@@ -758,5 +758,4 @@ JNICALL Java_rnati_NativeInterface_decodeAndTranslateNative(JNIEnv *env,
return gdrr_convert(r, &config);
}
}
}
......@@ -35,6 +35,234 @@ static gdrr_sem_id_t *virt_t(void *closure, __word t) {
printf("=> id {t=%lu}\n", t);
return NULL;
}
static gdrr_sem_id_t *sem_ip(void *closure) {
printf("=> sem_ip\n");
return NULL;
}
static gdrr_sem_id_t *sem_flags(void *closure) {
printf("=> sem_flags\n");
return NULL;
}
static gdrr_sem_id_t *sem_mxcsr(void *closure) {
printf("=> sem_mxcsr\n");
return NULL;
}
static gdrr_sem_id_t *sem_ax(void *closure) {
printf("=> sem_ax\n");
return NULL;
}
static gdrr_sem_id_t *sem_bx(void *closure) {
printf("=> sem_bx\n");
return NULL;
}
static gdrr_sem_id_t *sem_cx(void *closure) {
printf("=> sem_cx\n");
return NULL;
}
static gdrr_sem_id_t *sem_dx(void *closure) {
printf("=> sem_dx\n");
return NULL;
}
static gdrr_sem_id_t *sem_si(void *closure) {
printf("=> sem_si\n");
return NULL;
}
static gdrr_sem_id_t *sem_di(void *closure) {
printf("=> sem_di\n");
return NULL;
}
static gdrr_sem_id_t *sem_sp(void *closure) {
printf("=> sem_sp\n");
return NULL;
}
static gdrr_sem_id_t *sem_bp(void *closure) {
printf("=> sem_bp\n");
return NULL;
}
static gdrr_sem_id_t *sem_r8(void *closure) {
printf("=> sem_r8\n");
return NULL;
}
static gdrr_sem_id_t *sem_r9(void *closure) {
printf("=> sem_r9\n");
return NULL;
}
static gdrr_sem_id_t *sem_r10(void *closure) {
printf("=> sem_r10\n");
return NULL;
}
static gdrr_sem_id_t *sem_r11(void *closure) {
printf("=> sem_r11\n");
return NULL;
}
static gdrr_sem_id_t *sem_r12(void *closure) {
printf("=> sem_r12\n");
return NULL;
}
static gdrr_sem_id_t *sem_r13(void *closure) {
printf("=> sem_r13\n");
return NULL;
}
static gdrr_sem_id_t *sem_r14(void *closure) {
printf("=> sem_r14\n");
return NULL;
}
static gdrr_sem_id_t *sem_r15(void *closure) {
printf("=> sem_r15\n");
return NULL;
}
static gdrr_sem_id_t *sem_cs(void *closure) {
printf("=> sem_cs\n");
return NULL;
}
static gdrr_sem_id_t *sem_ds(void *closure) {
printf("=> sem_ds\n");
return NULL;
}
static gdrr_sem_id_t *sem_ss(void *closure) {
printf("=> sem_ss\n");
return NULL;
}
static gdrr_sem_id_t *sem_es(void *closure) {
printf("=> sem_es\n");
return NULL;
}
static gdrr_sem_id_t *sem_fs(void *closure) {
printf("=> sem_fs\n");
return NULL;
}
static gdrr_sem_id_t *sem_gs(void *closure) {
printf("=> sem_gs\n");
return NULL;
}
static gdrr_sem_id_t *sem_st0(void *closure) {
printf("=> sem_st0\n");
return NULL;
}
static gdrr_sem_id_t *sem_st1(void *closure) {
printf("=> sem_st1\n");
return NULL;
}
static gdrr_sem_id_t *sem_st2(void *closure) {
printf("=> sem_st2\n");
return NULL;
}
static gdrr_sem_id_t *sem_st3(void *closure) {
printf("=> sem_st3\n");
return NULL;
}
static gdrr_sem_id_t *sem_st4(void *closure) {
printf("=> sem_st4\n");
return NULL;
}
static gdrr_sem_id_t *sem_st5(void *closure) {
printf("=> sem_st5\n");
return NULL;
}
static gdrr_sem_id_t *sem_st6(void *closure) {
printf("=> sem_st6\n");
return NULL;
}
static gdrr_sem_id_t *sem_st7(void *closure) {
printf("=> sem_st7\n");
return NULL;
}
static gdrr_sem_id_t *sem_mm0(void *closure) {
printf("=> sem_mm0\n");
return NULL;
}
static gdrr_sem_id_t *sem_mm1(void *closure) {
printf("=> sem_mm1\n");
return NULL;
}
static gdrr_sem_id_t *sem_mm2(void *closure) {
printf("=> sem_mm2\n");
return NULL;
}
static gdrr_sem_id_t *sem_mm3(void *closure) {
printf("=> sem_mm3\n");
return NULL;
}
static gdrr_sem_id_t *sem_mm4(void *closure) {
printf("=> sem_mm4\n");
return NULL;
}
static gdrr_sem_id_t *sem_mm5(void *closure) {
printf("=> sem_mm5\n");
return NULL;
}
static gdrr_sem_id_t *sem_mm6(void *closure) {
printf("=> sem_mm6\n");
return NULL;
}
static gdrr_sem_id_t *sem_mm7(void *closure) {
printf("=> sem_mm7\n");
return NULL;
}
static gdrr_sem_id_t *sem_xmm0(void *closure) {
printf("=> sem_xmm0\n");
return NULL;
}
static gdrr_sem_id_t *sem_xmm1(void *closure) {
printf("=> sem_xmm1\n");
return NULL;
}
static gdrr_sem_id_t *sem_xmm2(void *closure) {
printf("=> sem_xmm2\n");
return NULL;
}
static gdrr_sem_id_t *sem_xmm3(void *closure) {
printf("=> sem_xmm3\n");
return NULL;
}
static gdrr_sem_id_t *sem_xmm4(void *closure) {
printf("=> sem_xmm4\n");
return NULL;
}
static gdrr_sem_id_t *sem_xmm5(void *closure) {
printf("=> sem_xmm5\n");
return NULL;
}
static gdrr_sem_id_t *sem_xmm6(void *closure) {
printf("=> sem_xmm6\n");
return NULL;
}
static gdrr_sem_id_t *sem_xmm7(void *closure) {
printf("=> sem_xmm7\n");
return NULL;
}
static gdrr_sem_id_t *sem_xmm8(void *closure) {
printf("=> sem_xmm8\n");
return NULL;
}
static gdrr_sem_id_t *sem_xmm9(void *closure) {
printf("=> sem_xmm9\n");
return NULL;
}
static gdrr_sem_id_t *sem_xmm10(void *closure) {
printf("=> sem_xmm10\n");
return NULL;
}
static gdrr_sem_id_t *sem_xmm11(void *closure) {
printf("=> sem_xmm11\n");
return NULL;
}
static gdrr_sem_id_t *sem_xmm12(void *closure) {
printf("=> sem_xmm12\n");
return NULL;
}
static gdrr_sem_id_t *sem_xmm13(void *closure) {
printf("=> sem_xmm13\n");
return NULL;
}
static gdrr_sem_id_t *sem_xmm14(void *closure) {
printf("=> sem_xmm14\n");
return NULL;
}
static gdrr_sem_id_t *sem_xmm15(void *closure) {
printf("=> sem_xmm15\n");
return NULL;
}
// sem_address
static gdrr_sem_address_t *sem_address(void *closure, __word size, gdrr_sem_linear_t *address) {
......@@ -230,7 +458,6 @@ int main (int argc, char** argv) {
__char blob[15];
char fmt[1024];
__word sz = 15;
__obj insn;
int i,c;
for (i=0;i<sz;i++) {
int x = fscanf(stdin,"%x",&c);
......@@ -242,8 +469,10 @@ int main (int argc, char** argv) {
}
blob[i] = c & 0xff;
}
done:
__decode(__decode__,blob,i,&insn);
done:;
__obj state = __createState(blob, i, 0, 0);
__obj insn = __runMonadicNoArg(__decode__, &state);
if (___isNil(insn))
__fatal("decode failed");
else {
......@@ -252,7 +481,7 @@ done:
printf("---------------------------\n");
__obj r = __translate(__translate__,insn);
__obj r = __runMonadicOneArg(__translate__, &state, insn);
if(___isNil(r))
__fatal("translate failed");
else {
......@@ -268,6 +497,63 @@ done:
config.callbacks.sem_id.virt_lts = &virt_lts;
config.callbacks.sem_id.virt_ltu = &virt_ltu;
config.callbacks.sem_id.virt_t = &virt_t;
config.callbacks.arch.x86.sem_id.sem_ip = &sem_ip;
config.callbacks.arch.x86.sem_id.sem_flags = &sem_flags;
config.callbacks.arch.x86.sem_id.sem_mxcsr = &sem_mxcsr;
config.callbacks.arch.x86.sem_id.sem_ax = &sem_ax;
config.callbacks.arch.x86.sem_id.sem_bx = &sem_bx;
config.callbacks.arch.x86.sem_id.sem_cx = &sem_cx;
config.callbacks.arch.x86.sem_id.sem_dx = &sem_dx;
config.callbacks.arch.x86.sem_id.sem_si = &sem_si;
config.callbacks.arch.x86.sem_id.sem_di = &sem_di;
config.callbacks.arch.x86.sem_id.sem_sp = &sem_sp;
config.callbacks.arch.x86.sem_id.sem_bp = &sem_bp;
config.callbacks.arch.x86.sem_id.sem_r8 = &sem_r8;
config.callbacks.arch.x86.sem_id.sem_r9 = &sem_r9;
config.callbacks.arch.x86.sem_id.sem_r10 = &sem_r10;
config.callbacks.arch.x86.sem_id.sem_r11 = &sem_r11;
config.callbacks.arch.x86.sem_id.sem_r12 = &sem_r12;
config.callbacks.arch.x86.sem_id.sem_r13 = &sem_r13;
config.callbacks.arch.x86.sem_id.sem_r14 = &sem_r14;
config.callbacks.arch.x86.sem_id.sem_r15 = &sem_r15;
config.callbacks.arch.x86.sem_id.sem_cs = &sem_cs;
config.callbacks.arch.x86.sem_id.sem_ds = &sem_ds;
config.callbacks.arch.x86.sem_id.sem_ss = &sem_ss;
config.callbacks.arch.x86.sem_id.sem_es = &sem_es;
config.callbacks.arch.x86.sem_id.sem_fs = &sem_fs;
config.callbacks.arch.x86.sem_id.sem_gs = &sem_gs;
config.callbacks.arch.x86.sem_id.sem_st0 = &sem_st0;
config.callbacks.arch.x86.sem_id.sem_st1 = &sem_st1;
config.callbacks.arch.x86.sem_id.sem_st2 = &sem_st2;
config.callbacks.arch.x86.sem_id.sem_st3 = &sem_st3;
config.callbacks.arch.x86.sem_id.sem_st4 = &sem_st4;
config.callbacks.arch.x86.sem_id.sem_st5 = &sem_st5;
config.callbacks.arch.x86.sem_id.sem_st6 = &sem_st6;
config.callbacks.arch.x86.sem_id.sem_st7 = &sem_st7;
config.callbacks.arch.x86.sem_id.sem_mm0 = &sem_mm0;
config.callbacks.arch.x86.sem_id.sem_mm1 = &sem_mm1;
config.callbacks.arch.x86.sem_id.sem_mm2 = &sem_mm2;
config.callbacks.arch.x86.sem_id.sem_mm3 = &sem_mm3;
config.callbacks.arch.x86.sem_id.sem_mm4 = &sem_mm4;
config.callbacks.arch.x86.sem_id.sem_mm5 = &sem_mm5;
config.callbacks.arch.x86.sem_id.sem_mm6 = &sem_mm6;
config.callbacks.arch.x86.sem_id.sem_mm7 = &sem_mm7;
config.callbacks.arch.x86.sem_id.sem_xmm0 = &sem_xmm0;
config.callbacks.arch.x86.sem_id.sem_xmm1 = &sem_xmm1;
config.callbacks.arch.x86.sem_id.sem_xmm2 = &sem_xmm2;
config.callbacks.arch.x86.sem_id.sem_xmm3 = &sem_xmm3;
config.callbacks.arch.x86.sem_id.sem_xmm4 = &sem_xmm4;
config.callbacks.arch.x86.sem_id.sem_xmm5 = &sem_xmm5;
config.callbacks.arch.x86.sem_id.sem_xmm6 = &sem_xmm6;
config.callbacks.arch.x86.sem_id.sem_xmm7 = &sem_xmm7;
config.callbacks.arch.x86.sem_id.sem_xmm8 = &sem_xmm8;
config.callbacks.arch.x86.sem_id.sem_xmm9 = &sem_xmm9;
config.callbacks.arch.x86.sem_id.sem_xmm10 = &sem_xmm10;
config.callbacks.arch.x86.sem_id.sem_xmm11 = &sem_xmm11;
config.callbacks.arch.x86.sem_id.sem_xmm12 = &sem_xmm12;
config.callbacks.arch.x86.sem_id.sem_xmm13 = &sem_xmm13;
config.callbacks.arch.x86.sem_id.sem_xmm14 = &sem_xmm14;
config.callbacks.arch.x86.sem_id.sem_xmm15 = &sem_xmm15;
config.callbacks.sem_address.sem_address = &sem_address;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment