/[hurd]/hurd/libthreads/i386/cthreads.h
ViewVC logotype

Diff of /hurd/libthreads/i386/cthreads.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by mib, Tue Oct 6 18:31:16 1992 UTC revision 1.2 by roland, Mon May 27 02:50:10 2002 UTC
# Line 1  Line 1 
1  /*  /*
2   * Mach Operating System   * Mach Operating System
3   * Copyright (c) 1991,1990 Carnegie Mellon University   * Copyright (c) 1993,1991,1990 Carnegie Mellon University
4   * All Rights Reserved.   * All Rights Reserved.
5   *   *
6   * Permission to use, copy, modify and distribute this software and its   * Permission to use, copy, modify and distribute this software and its
# Line 26  Line 26 
26  /*  /*
27   * HISTORY   * HISTORY
28   * $Log$   * $Log$
29   * Revision 1.1  1992/10/06 18:31:16  mib   * Revision 1.2  2002/05/27 02:50:10  roland
30   * entered into RCS   * 2002-05-26  Roland McGrath  <roland@frob.com>
31   *   *
32     *      Changes merged from CMU MK83a version:
33     *      * cthreads.h, options.h: Various cleanups.
34     *      * call.c, cthread_data.c, sync.c, mig_support.c: Likewise.
35     *      * i386/cthreads.h, i386/thread.c, i386/lock.s: Likewise.
36     *      * cthread_internals.h: Add decls for internal functions.
37     *      (struct cproc): Use vm_offset_t for stack_base and stack_size members.
38     *      Use natural_t for context member.
39     *      * cprocs.c: Use prototypes for all defns.
40     *      * cthreads.c: Likewise.
41     *      (cthread_exit): Cast any_t to integer_t before int.
42     *
43     * Revision 2.9  93/01/24  13:24:58  danner
44     *      Move ! in spin_try_lock to give the compiler
45     *      a fighting chance.
46     *      [92/11/19            rvb]
47     *
48     * Revision 2.8  93/01/14  18:05:09  danner
49     *      asm -> __asm__
50     *      [93/01/10            danner]
51     *
52   * Revision 2.7  92/01/03  20:36:59  dbg   * Revision 2.7  92/01/03  20:36:59  dbg
53   *      Add volatile to spin_lock_t.  Change spin_unlock and   *      Add volatile to spin_lock_t.  Change spin_unlock and
54   *      spin_try_lock definitions back to memory operands, but rely on   *      spin_try_lock definitions back to memory operands, but rely on
# Line 69  typedef volatile int spin_lock_t; Line 89  typedef volatile int spin_lock_t;
89    
90  #define spin_unlock(p) \  #define spin_unlock(p) \
91          ({  register int _u__ ; \          ({  register int _u__ ; \
92              asm volatile("xorl %0, %0; \n\              __asm__ volatile("xorl %0, %0; \n\
93                            xchgl %0, %1" \                            xchgl %0, %1" \
94                          : "=&r" (_u__), "=m" (*(p)) ); \                          : "=&r" (_u__), "=m" (*(p)) ); \
95              0; })              0; })
96    
97  #define spin_try_lock(p)\  #define spin_try_lock(p)\
98          ({  boolean_t _r__; \          (!({  boolean_t _r__; \
99              asm volatile("movl $1, %0; \n\              __asm__ volatile("movl $1, %0; \n\
100                            xchgl %0, %1" \                            xchgl %0, %1" \
101                          : "=&r" (_r__), "=m" (*(p)) ); \                          : "=&r" (_r__), "=m" (*(p)) ); \
102              !_r__; })              _r__; }))
103    
104  #define cthread_sp() \  #define cthread_sp() \
105          ({  int _sp__; \          ({  int _sp__; \
106              asm("movl %%esp, %0" \              __asm__("movl %%esp, %0" \
107                : "=g" (_sp__) ); \                : "=g" (_sp__) ); \
108              _sp__; })              _sp__; })
109    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26