Rev | Line | |
---|
[9631] | 1 | /* $Id: os2sel.h,v 1.10 2003-01-06 13:24:20 sandervl Exp $ */
|
---|
[48] | 2 | /*
|
---|
| 3 | *
|
---|
| 4 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
| 5 | *
|
---|
| 6 | */
|
---|
| 7 | #ifndef __OS2SEL_H__
|
---|
| 8 | #define __OS2SEL_H__
|
---|
| 9 |
|
---|
[6997] | 10 |
|
---|
| 11 | #ifdef __cplusplus
|
---|
| 12 | extern "C" {
|
---|
| 13 | #endif
|
---|
| 14 |
|
---|
| 15 |
|
---|
[4075] | 16 | #ifdef __WATCOMC__
|
---|
| 17 | unsigned short GetFS(void);
|
---|
| 18 | #pragma aux GetFS = \
|
---|
| 19 | "mov ax,fs" \
|
---|
| 20 | value [ax] \
|
---|
| 21 | parm nomemory;
|
---|
[48] | 22 |
|
---|
[4075] | 23 | void SetFS(unsigned short sel);
|
---|
| 24 | #pragma aux SetFS = \
|
---|
| 25 | "mov fs,ax" \
|
---|
| 26 | parm [ax];
|
---|
| 27 |
|
---|
| 28 | unsigned short RestoreOS2FS(void);
|
---|
| 29 | #pragma aux RestoreOS2FS = \
|
---|
| 30 | "mov bx, fs" \
|
---|
| 31 | "mov ax, 150bh" \
|
---|
| 32 | "mov fs, ax" \
|
---|
| 33 | value [bx] \
|
---|
| 34 | modify nomemory exact [ax];
|
---|
[9631] | 35 | #endif
|
---|
[4075] | 36 |
|
---|
[9631] | 37 | #ifdef __EMX__
|
---|
| 38 | extern inline unsigned short GetFS(void)
|
---|
| 39 | {
|
---|
| 40 | asm volatile (
|
---|
| 41 | "mov %eax, %fs \n\t"
|
---|
| 42 | );
|
---|
| 43 | }
|
---|
| 44 |
|
---|
| 45 | extern inline void SetFS(unsigned short sel)
|
---|
| 46 | {
|
---|
| 47 | asm volatile (
|
---|
| 48 | "mov %eax,%esp \n\t"
|
---|
| 49 | "mov %fs, %eax \n\t"
|
---|
| 50 | );
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 | extern inline unsigned short RestoreOS2FS(void)
|
---|
| 54 | {
|
---|
| 55 | asm volatile (
|
---|
| 56 | "push 0x150b \n\t"
|
---|
| 57 | "mov %ax, %fs \n\t"
|
---|
| 58 | "pop %fs"
|
---|
| 59 | );
|
---|
| 60 | }
|
---|
| 61 |
|
---|
| 62 |
|
---|
[4075] | 63 | #else
|
---|
[6997] | 64 |
|
---|
| 65 | unsigned short _System GetFS (void);
|
---|
| 66 | unsigned short _System RestoreOS2FS(void);
|
---|
[4077] | 67 | void _System SetFS (unsigned short selector);
|
---|
| 68 | unsigned short _System SetReturnFS (unsigned short selector);
|
---|
[9631] | 69 | //SvL: Checks if thread FS & exception structure are valid
|
---|
| 70 | int _System CheckCurFS(void);
|
---|
[4075] | 71 | #endif
|
---|
| 72 |
|
---|
[6997] | 73 |
|
---|
| 74 |
|
---|
| 75 | #ifdef __cplusplus
|
---|
| 76 | }
|
---|
| 77 | #endif
|
---|
[2544] | 78 |
|
---|
[6997] | 79 |
|
---|
[537] | 80 | #endif //__OS2SEL_H__
|
---|
Note:
See
TracBrowser
for help on using the repository browser.