Hi Wei-Ren, Thanks for your reply.
According your email, the function "do_interrupt" handle the external interrupt just like keyboard interrupt, and the function "gen_exception" handle the exception just like “SWI”.etc. So the function “gen_exception” seems to be the answer. Any comments are appreciated. BR, Stefan 在 2012年3月29日 下午7:07,陳韋任 <che...@iis.sinica.edu.tw>写道: > > Now I have some probem with the exception handle. I found the funciton > > "do_interrupt" in "target-arm/helper.c" and "gen_exception" in > > "target-arm/translate.c" seems to handle the exceptions. But I am > comfused > > with those two functions, which function will do the really work about > > generating an exception. As my understanding, I think “do_interrupt” > seems > > to do some preparations before enter exceptions just like operate some > > registers and accumulate the exception handler address. And > "gen_exception" > > seems to do the read job to generate a exception. But I'm not sure. > > Interrupt is a "external" source which breaks the current execution flow > of > the CPU. For example, a device might raise an interrupt so that CPU can > know the > device has completed its task. On the other hand, exception is an > "internal" > source which breaks the current execution flow of the CPU. Take divide by > zero > as an example, CPU will detect this error (occurred in the CPU itself). So > depends on what you mean "exception", do_interrupt or gen_exception might > does > the real work. > > 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 >