Back to index

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

Go to the source code of this file.

Defines

#define PT_EI   extern inline
#define CURRENT_STACK_FRAME   __builtin_frame_address (0)

Functions

PT_EI long int testandset (int *spinlock)
PT_EI int get_eflags (void)
PT_EI void set_eflags (int newflags)

Define Documentation

#define CURRENT_STACK_FRAME   __builtin_frame_address (0)

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

#define PT_EI   extern inline

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


Function Documentation

PT_EI int get_eflags ( void  )

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

{
  int res;
  __asm__ __volatile__ ("mov psw,%0" : "=d" (res));
  return res;
}

Here is the call graph for this function:

PT_EI void set_eflags ( int  newflags)

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

{
  __asm__ __volatile__ ("mov %0,psw" : : "d" (newflags) : "cc");
}

Here is the call graph for this function:

PT_EI long int testandset ( int spinlock)

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

{
  long int ret = 1;

  /* This won't test&set the entire int, only the least significant
     byte.  I hope this doesn't matter, since we can't do better.  */
  __asm__ __volatile__ ("bset %0, %1; bne 1f; clr %0; 1:" :
                     "+d" (ret), "+m" (*(volatile int *)spinlock));

  return ret;
}

Here is the call graph for this function: