qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Regarding tcg_gen_helper


From: Aravind Prakash
Subject: [Qemu-devel] Regarding tcg_gen_helper
Date: Wed, 24 Mar 2010 00:41:25 -0400

Hello,
My name is Aravind. I am working on a project which involves inserting code to call one of my functions.
This is what it looks like:

//The function to be called.
void log_entry(int reg, int data)
{
      printf("REG access\n");
      printf("Data got REG = %d and data = "" reg, data);
      fprintf(logfileptr, "Register = %d, Data = "" reg, data);
}

static inline void gen_reg_log(int reg, int data)
{
//This is effectively calling tcg_gen_helper64 without the sizemask
        TCGv_ptr fn;
      TCGArg args[2];
       fn = tcg_const_ptr((tcg_target_long)log_entry);
      args[0] = GET_TCGV_I64(reg);
      args[1] = GET_TCGV_I64(data);
      tcg_gen_callN(&tcg_ctx, fn, 0, 0, 0, 2, args);
      tcg_temp_free_ptr(fn);
}

When I run this, I get a segfault. I do not know where to proceed. Any suggestions will be appreciated.

Thanks,
Aravind.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]