root/include/asm/segment.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. get_fs_byte
  2. get_fs_word
  3. get_fs_long
  4. put_fs_byte
  5. put_fs_word
  6. put_fs_long
  7. get_fs
  8. get_ds
  9. set_fs

   1 extern inline unsigned char get_fs_byte(const char * addr)
     /* [previous][next][first][last][top][bottom][index][help] */
   2 {
   3         unsigned register char _v;
   4 
   5         __asm__ ("movb %%fs:%1,%0":"=r" (_v):"m" (*addr));
   6         return _v;
   7 }
   8 
   9 extern inline unsigned short get_fs_word(const unsigned short *addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  10 {
  11         unsigned short _v;
  12 
  13         __asm__ ("movw %%fs:%1,%0":"=r" (_v):"m" (*addr));
  14         return _v;
  15 }
  16 
  17 extern inline unsigned long get_fs_long(const unsigned long *addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  18 {
  19         unsigned long _v;
  20 
  21         __asm__ ("movl %%fs:%1,%0":"=r" (_v):"m" (*addr)); \
  22         return _v;
  23 }
  24 
  25 extern inline void put_fs_byte(char val,char *addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  26 {
  27 __asm__ ("movb %0,%%fs:%1"::"r" (val),"m" (*addr));
  28 }
  29 
  30 extern inline void put_fs_word(short val,short * addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  31 {
  32 __asm__ ("movw %0,%%fs:%1"::"r" (val),"m" (*addr));
  33 }
  34 
  35 extern inline void put_fs_long(unsigned long val,unsigned long * addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  36 {
  37 __asm__ ("movl %0,%%fs:%1"::"r" (val),"m" (*addr));
  38 }
  39 
  40 /*
  41  * Someone who knows GNU asm better than I should double check the followig.
  42  * It seems to work, but I don't know if I'm doing something subtly wrong.
  43  * --- TYT, 11/24/91
  44  */
  45 
  46 extern inline unsigned long get_fs() 
     /* [previous][next][first][last][top][bottom][index][help] */
  47 {
  48         unsigned short _v;
  49         __asm__("mov %%fs,%%ax":"=a" (_v):);
  50         return _v;
  51 }
  52 
  53 extern inline unsigned long get_ds() 
     /* [previous][next][first][last][top][bottom][index][help] */
  54 {
  55         unsigned short _v;
  56         __asm__("mov %%ds,%%ax":"=a" (_v):);
  57         return _v;
  58 }
  59 
  60 extern inline void set_fs(unsigned long val)
     /* [previous][next][first][last][top][bottom][index][help] */
  61 {
  62         __asm__("mov %0,%%fs"::"a" ((unsigned short) val));
  63 }
  64 
  65 

/* [previous][next][first][last][top][bottom][index][help] */