This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Corrected patch for _exit.c
- From: Michael Snyder <msnyder at redhat dot com>
- To: newlib at sources dot redhat dot com
- Date: Wed, 29 Jan 2003 17:31:26 -0800
- Subject: Corrected patch for _exit.c
- Organization: Red Hat, Inc.
Sorry, the patch I sent earlier was buggy: here's a fixed one.
2003-01-29 Michael Snyder <msnyder@redhat.com>
* libc/sys/h8300hms/_exit.c (_exit, __exit): Slip a magic cookie
into registers r1 and r2, so that the simulator can distinguish
this trap from a breakpoint trap. Copied from libgloss.
Index: _exit.c
===================================================================
RCS file: /cvs/cvsfiles/devo/newlib/libc/sys/h8300hms/_exit.c,v
retrieving revision 1.3
diff -p -r1.3 _exit.c
*** _exit.c 1996/03/11 19:29:04 1.3
--- _exit.c 2003/01/30 01:29:51
*************** void
*** 10,16 ****
_DEFUN (_exit,(rc),
int rc)
{
! short rc2 = rc << 8;
asm("mov.w %0,r0\n\tsleep" : : "r" (rc2) : "r0");
}
--- 10,22 ----
_DEFUN (_exit,(rc),
int rc)
{
! short rc2;
!
! rc2 = 0xdead;
! asm("mov.w %0,r1" : : "r" (rc2) : "r1");
! rc2 = 0xbeef;
! asm("mov.w %0,r2" : : "r" (rc2) : "r2");
! rc2 = rc << 8;
asm("mov.w %0,r0\n\tsleep" : : "r" (rc2) : "r0");
}
*************** void
*** 18,23 ****
_DEFUN (__exit,(rc),
int rc)
{
! short rc2 = rc << 8;
asm("mov.w %0,r0\n\tsleep" : : "r" (rc2) : "r0");
}
--- 24,35 ----
_DEFUN (__exit,(rc),
int rc)
{
! short rc2;
!
! rc2 = 0xdead;
! asm("mov.w %0,r1" : : "r" (rc2) : "r1");
! rc2 = 0xbeef;
! asm("mov.w %0,r2" : : "r" (rc2) : "r2");
! rc2 = rc << 8;
asm("mov.w %0,r0\n\tsleep" : : "r" (rc2) : "r0");
}