On Sat, Jan 28, 2012 at 05:17:56PM -0500, Xin Tong wrote: > I am investigating what longjmp is used for in qemu. > > longjmp is used in a couple of places. > > 1. > void cpu_loop_exit(void) > { > env->current_tb = NULL; > longjmp(env->jmp_env, 1); > } > > cpu_loop_exit is called when there is an interrupt_request or exit_request > pending
Yes. > 2. > void cpu_resume_from_signal(CPUState *env1, void *puc) > { > ... > longjmp(env->jmp_env, 1); > } > > cpu_resume_from_signal is called in a couple of places, each of which > suggests something faulty has happened. my guess is that it will get call > when exceptions have occurred in the code cache. Am I right ? Not exactly. `grep -r cpu_resume_from_signal` shows places using cpu_resume_from_signal. Not all of them means something faulty has happened, I think. Regards, chenwj -- Wei-Ren Chen (陳韋任) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667 Homepage: http://people.cs.nctu.edu.tw/~chenwj