hosted/pcm/alsa: Use alternate signal stack for the async callback.
commit34b0311d0eb906bd801cc1e9a329ed211b81496f
authorThomas Martitz <kugel@rockbox.org>
Fri, 13 Jan 2012 08:47:01 +0000 (13 09:47 +0100)
committerThomas Martitz <kugel@rockbox.org>
Sat, 21 Jan 2012 17:39:19 +0000 (21 18:39 +0100)
treeb76d82b8ecb94aab048c58d2b6f3c23b57e15b7a
parent109084d5cbaeee26373ecf1b765d9507ccbbe63e
hosted/pcm/alsa: Use alternate signal stack for the async callback.

Signals are by default executed on the user stack, i.e. the stack of
the currently active thread. This has two problems:
1) The stack size of the current stack is likely insufficient (unless
using sigaltstack threads) because our stack sizes are normally
below MINSIGSTKSIZE which is needed to deliver a signal.
2) Some of our asm code does nasty tricks with the stack pointer. When a
signal comes in during this bad things can happen, e.g. random memory
being overwritten or simply a crash.

Using a well defined stack fixes this. This is comparable with the
separate irq stack on native targets.
firmware/target/hosted/pcm-alsa.c