Sorry for my previous incomplete email

Hi,

I have another small question. Actually, I am implementing hardware transactional memory support in QEMU. I have implemented the following two helper functions functions in targer-i386/helper.c

void helper_StartTransaction()
void helper_CommitTransaction();

My application looks as follows.
int main()
{
       __asm_volatile("mov %al %al"); //is detected in translation.c and helper_StartTransaction is called
       //add the code here
      __asm_volatile("mov %bl %bl"); //is detected in translation.c and helper_CommitTransaction is called
}

In case a transaction fails, I detect it inside the code for helper_CommitTransaction(), now I need to jump back to the start of transaction. I do it by using setjmp inside helper_StartTransaction and calling longjmp inside CommitTransaction, Code for the two helper functions is as follows

void helper_StartTransaction()
{
    printf("StartTransaction Called\n");
    if(setjmp(env->tm_jmp))
    {
      printf("Transaction restart\");
    }

}

void helper_CommitTransaction()
{
    printf("CommitTransaction Called\n");
    longjmp(env->tm_jmp, 0);
}
 
But this prints "Transaction restart" once and then the program finishes. This means that commit transaction is not called the second time. Could you please tell me what am I doing wrong?

Regards,
Atif
On 4/16/07, Atif Hashmi <atifhashmi@gmail.com> wrote:


On 4/8/07, Eduardo Felipe <edusaper@gmail.com> wrote:

I recommend:

http://fabrice.bellard.free.fr/qemu/user-doc.html

Regards,
Eduardo