Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Selector definitions |
| 3 | * |
| 4 | * Copyright 1995 Alexandre Julliard |
| 5 | */ |
| 6 | |
Alexandre Julliard | 234bc24 | 1994-12-10 13:02:28 +0000 | [diff] [blame] | 7 | #ifndef __WINE_SELECTORS_H |
| 8 | #define __WINE_SELECTORS_H |
| 9 | |
Jim Aston | 2e1cafa | 1999-03-14 16:35:05 +0000 | [diff] [blame] | 10 | #include "windef.h" |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame] | 11 | #include "ldt.h" |
Alexandre Julliard | 234bc24 | 1994-12-10 13:02:28 +0000 | [diff] [blame] | 12 | |
Alexandre Julliard | d7d4fdf | 1995-12-26 15:05:24 +0000 | [diff] [blame] | 13 | extern WORD SELECTOR_AllocBlock( const void *base, DWORD size, |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 14 | enum seg_type type, BOOL is32bit, |
| 15 | BOOL readonly ); |
Alexandre Julliard | 284c9b9 | 1999-04-11 15:07:13 +0000 | [diff] [blame] | 16 | extern WORD SELECTOR_ReallocBlock( WORD sel, const void *base, DWORD size ); |
Alexandre Julliard | c7c217b | 1998-04-13 12:21:30 +0000 | [diff] [blame] | 17 | extern void SELECTOR_MoveBlock( WORD sel, const void *new_base ); |
Alexandre Julliard | 8cc3a5e | 1996-08-11 15:49:51 +0000 | [diff] [blame] | 18 | extern void SELECTOR_FreeBlock( WORD sel, WORD count ); |
Alexandre Julliard | 234bc24 | 1994-12-10 13:02:28 +0000 | [diff] [blame] | 19 | |
Alexandre Julliard | a0b2b1d | 1997-11-16 17:38:29 +0000 | [diff] [blame] | 20 | #ifdef __i386__ |
| 21 | # define __GET_SEG(seg,res) __asm__( "movw %%" seg ",%w0" : "=r" (res) ) |
| 22 | # define __SET_SEG(seg,val) __asm__( "movw %w0,%%" seg : : "r" (val) ) |
| 23 | #else /* __i386__ */ |
| 24 | # define __GET_SEG(seg,res) ((res) = 0) |
| 25 | # define __SET_SEG(seg,val) /* nothing */ |
| 26 | #endif /* __i386__ */ |
| 27 | |
| 28 | #define GET_CS(cs) __GET_SEG("cs",cs) |
| 29 | #define GET_DS(ds) __GET_SEG("ds",ds) |
| 30 | #define GET_ES(es) __GET_SEG("es",es) |
| 31 | #define GET_FS(fs) __GET_SEG("fs",fs) |
| 32 | #define GET_GS(gs) __GET_SEG("gs",gs) |
| 33 | #define GET_SS(ss) __GET_SEG("ss",ss) |
| 34 | |
| 35 | #define SET_CS(cs) __SET_SEG("cs",cs) |
| 36 | #define SET_DS(ds) __SET_SEG("ds",ds) |
| 37 | #define SET_ES(es) __SET_SEG("es",es) |
| 38 | #define SET_FS(fs) __SET_SEG("fs",fs) |
| 39 | #define SET_GS(gs) __SET_SEG("gs",gs) |
| 40 | #define SET_SS(ss) __SET_SEG("ss",ss) |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 41 | |
Alexandre Julliard | 234bc24 | 1994-12-10 13:02:28 +0000 | [diff] [blame] | 42 | #endif /* __WINE_SELECTORS_H */ |