Changeset 10004 for trunk/include/os2sel.h
- Timestamp:
- Apr 10, 2003, 12:26:25 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/os2sel.h
r9969 r10004 1 /* $Id: os2sel.h,v 1.1 2 2003-04-02 11:02:34sandervl Exp $ */1 /* $Id: os2sel.h,v 1.13 2003-04-10 10:26:23 sandervl Exp $ */ 2 2 /* 3 3 * … … 38 38 static inline unsigned short GetFS(void) 39 39 { 40 asm volatile (41 "mov %fs, %ax \n\t"42 );40 int __res; 41 __asm__ __volatile__("mov %%fs, %%eax" : "=a" (__res)); 42 return(__res); 43 43 } 44 44 45 45 static inline void SetFS(unsigned short sel) 46 46 { 47 __asm__ __volatile__("mov w %%ax,%%fs" : : "a" (sel));47 __asm__ __volatile__("mov %%eax,%%fs" : : "a" (sel)); 48 48 } 49 49 50 static inline unsigned short RestoreOS2FS(void)50 static inline int RestoreOS2FS(void) 51 51 { 52 asm volatile ( 53 "push $0x0150b \n\t" 54 "movw %fs,%ax \n\t" 55 "pop %fs" 56 ); 52 int __res, xx = 0x0150b; 53 54 __asm__ __volatile__( 55 "mov %%fs,%0 \n\t" 56 "mov %1,%%fs \n\t" 57 : "=&r" (__res) : "r" (xx)); 58 return(__res); 57 59 } 58 60
Note:
See TracChangeset
for help on using the changeset viewer.