https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66960

--- Comment #16 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Goswin von Brederlow from comment #15)

> > No.  We only do it for data pushed onto stack by CPU.
> 
> I was thinking of something like:
> 
> __attribute__ ((interrupt("save_regs")))
> void
> f (struct interrupt_frame *frame, uword_t error_code, struct regs regs)
> {
>     kprintf("user SP = %#016x\n", regs.sp);
> }

It is an interesting idea.  But frame and err_code are created by caller,
which is CPU, not by callee.  You want to not only save all original
registers of interrupted process, but also make them available to interrupt
handler.  This won't be supported without significant changes in
infrastructure.

Reply via email to