1 /* Machine-dependent pthreads configuration and inline functions.
3 Copyright (C) 1996,1997,1998,1999,2000,2001, 2004
4 Free Software Foundation, Inc.
5 This file is part of the GNU C Library.
6 Contributed by Alexandre Oliva <aoliva@redhat.com>
7 Based on ../i386/pt-machine.h.
9 The GNU C Library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version.
14 The GNU C Library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Library General Public License for more details.
19 You should have received a copy of the GNU Library General Public
20 License along with the GNU C Library; see the file COPYING.LIB. If not,
21 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. */
25 #define _PT_MACHINE_H 1
29 # define PT_EI extern inline
32 /* Get some notion of the current stack. Need not be exactly the top
33 of the stack, just something somewhere in the current frame. */
34 #define CURRENT_STACK_FRAME __builtin_frame_address (0)
36 /* Spinlock implementation; required. */
38 testandset (int *spinlock
)
42 /* This won't test&set the entire int, only the least significant
43 byte. I hope this doesn't matter, since we can't do better. */
44 __asm__
__volatile__ ("bset %0, %1; bne 1f; clr %0; 1:" :
45 "+d" (ret
), "+m" (*(volatile int *)spinlock
));
55 __asm__
__volatile__ ("mov psw,%0" : "=d" (res
));
61 set_eflags (int newflags
)
63 __asm__
__volatile__ ("mov %0,psw" : : "d" (newflags
) : "cc");
66 #endif /* __ASSEMBLER__ */
68 #endif /* pt-machine.h */