Back to index

glibc  2.9
Defines | Functions
pt-machine.h File Reference

Go to the source code of this file.


#define PT_EI   extern inline __attribute__ ((always_inline))
#define CURRENT_STACK_FRAME   ({ char *sp; __asm__ ("move.d $sp,%0" : "=rm" (sp)); sp; })


long int testandset (int *spinlock)
int __compare_and_swap (long int *p, long int oldval, long int newval)

Define Documentation

#define CURRENT_STACK_FRAME   ({ char *sp; __asm__ ("move.d $sp,%0" : "=rm" (sp)); sp; })

Definition at line 55 of file pt-machine.h.

#define PT_EI   extern inline __attribute__ ((always_inline))

Definition at line 25 of file pt-machine.h.

Function Documentation

int __compare_and_swap ( long int p,
long int  oldval,
long int  newval 

Definition at line 100 of file pt-machine.h.

  long int ret;

  __asm__ __volatile__ (
       "/* Inline compare & swap */\n"
       "ldq_l %0,%4\n\t"
       "cmpeq %0,%2,%0\n\t"
       "beq %0,2f\n\t"
       "mov %3,%0\n\t"
       "stq_c %0,%1\n\t"
       "beq %0,1b\n\t"
       "/* End compare & swap */"
       : "=&r"(ret), "=m"(*p)
       : "r"(oldval), "r"(newval), "m"(*p)
        : "memory");

  return ret;
long int testandset ( int spinlock)

Definition at line 53 of file pt-machine.h.

  long int ret, temp;

  __asm__ __volatile__(
       "/* Inline spinlock test & set */\n"
       "ldl_l %0,%3\n\t"
       "bne %0,2f\n\t"
       "or $31,1,%1\n\t"
       "stl_c %1,%2\n\t"
       "beq %1,1b\n"
       "/* End spinlock test & set */"
       : "=&r"(ret), "=&r"(temp), "=m"(*spinlock)
       : "m"(*spinlock)
        : "memory");

  return ret;