Removed dependencies on the internals of the CLASS structure.
[wine/multimedia.git] / include / selectors.h
blob7949126fddf1aa940eadc8c4e2c5b692e392d6ab
1 /*
2 * Selector definitions
4 * Copyright 1995 Alexandre Julliard
5 */
7 #ifndef __WINE_SELECTORS_H
8 #define __WINE_SELECTORS_H
10 #include "windef.h"
11 #include "ldt.h"
13 extern WORD SELECTOR_AllocBlock( const void *base, DWORD size, unsigned char flags );
14 extern WORD SELECTOR_ReallocBlock( WORD sel, const void *base, DWORD size );
15 extern void SELECTOR_FreeBlock( WORD sel );
17 #ifdef __i386__
18 # ifdef __GNUC__
19 # define __DEFINE_GET_SEG(seg) \
20 extern inline unsigned short __get_##seg(void) \
21 { unsigned short res; __asm__("movw %%" #seg ",%w0" : "=r"(res)); return res; }
22 # define __DEFINE_SET_SEG(seg) \
23 extern inline void __set_##seg(int val) { __asm__("movw %w0,%%" #seg : : "r" (val)); }
24 # else /* __GNUC__ */
25 # define __DEFINE_GET_SEG(seg) extern unsigned short __get_##seg(void);
26 # define __DEFINE_SET_SEG(seg) extern void __set_##seg(unsigned int);
27 # endif /* __GNUC__ */
28 #else /* __i386__ */
29 # define __DEFINE_GET_SEG(seg) static inline unsigned short __get_##seg(void) { return 0; }
30 # define __DEFINE_SET_SEG(seg) /* nothing */
31 #endif /* __i386__ */
33 __DEFINE_GET_SEG(cs)
34 __DEFINE_GET_SEG(ds)
35 __DEFINE_GET_SEG(es)
36 __DEFINE_GET_SEG(fs)
37 __DEFINE_GET_SEG(gs)
38 __DEFINE_GET_SEG(ss)
39 __DEFINE_SET_SEG(fs)
40 __DEFINE_SET_SEG(gs)
42 #endif /* __WINE_SELECTORS_H */