From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pierre AUBERT Date: Fri, 29 Nov 2002 13:04:03 +0100 Subject: [U-Boot-Users] PPC: problem with syscalls References: <3DE60E99.1DB09169@staubli.com> Message-ID: <3DE757B3.F88ACDBA@staubli.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Pierre AUBERT wrote: > Hello everybody, > > I've a problem with examples/timer.c. I've tried to launch it on my > mpc860t board, if I start the timer and if I > press a key after one or more interrupts occured, the u-boot crashes. > The problem is that an interrupt handler > uses a system call (mon_printf) while the main loop is inside a system > call (mon_getc). During a system call, > the LR and SRRx are saved at a fixed location (0xcf4, 0xcf8 and 0xcfc) > then the return address of the mon_printf > in the main loop is overridden by the return address of the mon_getc in > the interrupt handler. To avoid this problem, > I think that we need to use a stack to store the return addresses (and > the SRRx) of the system calls. > Dear Wolfgang, Please find attached a patch fixing the problem described above. A little stack (located between the end of the syscall exception handler and the beginning of the following exception) is used to save the LR and SRRx. With this patch, examples/timer is running fine. Best regards. CHANGELOG: * Patch by Pierre Aubert , 28 Nov 2002 Fix nested syscalls bug in standalone applications. -------------- next part -------------- A non-text attachment was scrubbed... Name: syscalls.patch Type: application/octet-stream Size: 7657 bytes Desc: not available Url : http://lists.denx.de/pipermail/u-boot/attachments/20021129/736d50b2/attachment.obj