[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] proposed change in signal handling



Hi,

I propose the following changes:

MiNTLib (sigaction)
- add member sa_action to sa_sigaction
- add flag SA_SIGACTION

This afaik doesn't really affect kernel<>library interaction at all, but rather just allows an alternative set of
parameters for the signal hander.

Kernel
- add members to struct sigcontext:

    ulong   sc_regs[15];
    ulong   sc_fregs[8*3];
    ulong   sc_fctrl[3];
    ushort  sc_mask;

- save/restore register context + sc_mask (which is actually sigact->sa_mask) in sig_mach.c
Signal handler

Normally, this is void handler(int sig).

If SA_SIGACTION is enabled, it should be something like void handler(int sig, int info, sigcontect* sc).

Why?

It's a nice feature in other unixoids, and allows nifty things like threads and other stuff to be implemented
in user mode applications. It also allows application-specific debug output with register contents etc. when things go
bump.

I know I asked for input about this before, but I just try one more time :) I've verified that context switching etc is possible this way, the only thing I'm worried about is FPU context saving/restoring, because I don't know how much is needed. I haven't verified that sa_mask can be saved/restored this way, but I guess it should be possible.

Input - any - is welcome.

-- PeP