Annotation of linux/include/asm/segment.h, revision 1.1.1.4

1.1       root        1: extern inline unsigned char get_fs_byte(const char * addr)
                      2: {
                      3:        unsigned register char _v;
                      4: 
1.1.1.4 ! root        5:        __asm__ ("movb %%fs:%1,%0":"=q" (_v):"m" (*addr));
1.1       root        6:        return _v;
                      7: }
                      8: 
                      9: extern inline unsigned short get_fs_word(const unsigned short *addr)
                     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)
                     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)
                     26: {
1.1.1.4 ! root       27: __asm__ ("movb %0,%%fs:%1"::"q" (val),"m" (*addr));
1.1       root       28: }
                     29: 
                     30: extern inline void put_fs_word(short val,short * addr)
                     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)
                     36: {
                     37: __asm__ ("movl %0,%%fs:%1"::"r" (val),"m" (*addr));
                     38: }
1.1.1.2   root       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
1.1.1.4 ! root       44:  * [ nothing wrong here, Linus: I just changed the ax to be any reg ]
1.1.1.2   root       45:  */
                     46: 
                     47: extern inline unsigned long get_fs() 
                     48: {
                     49:        unsigned short _v;
1.1.1.4 ! root       50:        __asm__("mov %%fs,%0":"=r" (_v):);
1.1.1.2   root       51:        return _v;
                     52: }
                     53: 
                     54: extern inline unsigned long get_ds() 
                     55: {
                     56:        unsigned short _v;
1.1.1.4 ! root       57:        __asm__("mov %%ds,%0":"=r" (_v):);
1.1.1.2   root       58:        return _v;
                     59: }
                     60: 
                     61: extern inline void set_fs(unsigned long val)
                     62: {
1.1.1.4 ! root       63:        __asm__("mov %0,%%fs"::"r" ((unsigned short) val));
1.1.1.2   root       64: }
                     65: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.