About the exception ipc reply

Adam Lackorzynski adam at os.inf.tu-dresden.de
Fri Oct 16 11:05:27 CEST 2009


Hi Cheng,

On Thu Oct 15, 2009 at 13:57:32 +0800, Guanghui, Cheng wrote:
> 	BUT. I have a problem about my code when i fixing the stack of main thread. 
> The correct code which could work well is like this:
> utcb = l4_utcb_get();
> eip = utcb->exc.eip;
> esp = utcb->exc.esp;
> utcb->values[12] = (l4_umword_t)(do_irq);
> esp_loc = 1024 - (esp - (l4_umword_t)stack)/4;
> stack[esp_loc - 1] = eip;
> l4_msgtag ...
> l4_ipc_send_tag
> 	In the code above i only reset the next stack with return address (old eip). 
> But it seems i can't reset the new stack pointer like 
> utcb->values[15] = esp - 4
> 	In my opinion it should do  but if i did it can't work. It seems some tricky 
> here. Can you tell me why it is like this?
> 	Additinally, i tried this way about handling interrupt  with interrupt number  
> like this:
> 	void do_irq(int irq)
> 	it can't work either.

Please refer to the attached modified version of your program. It's a
bit more tricky than that, regs also need to be saved etc...


Adam
-- 
Adam                 adam at os.inf.tu-dresden.de
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.c
Type: text/x-csrc
Size: 3738 bytes
Desc: not available
URL: <http://os.inf.tu-dresden.de/pipermail/l4-hackers/attachments/20091016/9c2f6f43/attachment.c>


More information about the l4-hackers mailing list