[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Stack and interrupt question
Mikael, thank you for your quick answer, but if the stack is expanded
automatically, how can I know when the stack is full? And what is the
maximum size for the stack?
Mikael Starvik wrote:
>The default stack size in user space is 1 page of memory (8KB) but
>it is expanded automatically when needed.
>You can't really use interrupts in user space applications. Instead
>you must have a kernel driver that puts the application to sleep until
>the interrupt arrives. The application can then use e.g read() or
>select() to wait for the driver to wake it up.
>The easiest example I can think of is arch/cris/drivers/sync_serial.c.
>In sync_serial_read() you'll find a interruptible_sleep_on which
>will put the application to sleep until the interrupt occurs if
>it reads in blocking mode. In tr_interrupt() you'll find the
>corresponding wake_up_interruptible that will wake it up again.
>From: firstname.lastname@example.org">mailto:email@example.com] On Behalf Of Daniel Fraile Vergel
>Sent: Thursday, September 09, 2004 11:10 AM
>Subject: Stack and interrupt question
> I noticed some strange behavior with functions arguments in my software. I think it could be due to a stack problem.
>What is the default stack size? How do I change this size?. I'm using 2.4.22 linux version, and Developer Board 82 Release 1.92 tools.
>At the moment my software interact with external devices polling them. I'm planning to change this, and use interrupts instead of polling.
>Unfortunately I don't know much about interruptions in C using the developer board. I really appreciate if someone could me send some basic
>example code or point me to a good tutorial.
Daniel Fraile i Vergel
WDM Optical NEtworks SYStems
c/ Francesc Vila Nave 11, Poligon Industrial Can Magi
08190 Sant Cugat del VallÚs (Barcelona) - SPAIN
Tel. + 34 93 590 11 49
fax + 34 93 590 11 57