blob: dcc0132a7dd2ac0259d44f766424825a66a042bb [file] [log] [blame]
Alexandre Julliarde2abbb11995-03-19 17:39:39 +00001/*
2 * Selector definitions
3 *
4 * Copyright 1995 Alexandre Julliard
5 */
6
Alexandre Julliard234bc241994-12-10 13:02:28 +00007#ifndef __WINE_SELECTORS_H
8#define __WINE_SELECTORS_H
9
Jim Aston2e1cafa1999-03-14 16:35:05 +000010#include "windef.h"
Alexandre Julliarde2abbb11995-03-19 17:39:39 +000011#include "ldt.h"
Alexandre Julliard234bc241994-12-10 13:02:28 +000012
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000013extern WORD SELECTOR_AllocBlock( const void *base, DWORD size,
Alexandre Julliarda3960291999-02-26 11:11:13 +000014 enum seg_type type, BOOL is32bit,
15 BOOL readonly );
Alexandre Julliard284c9b91999-04-11 15:07:13 +000016extern WORD SELECTOR_ReallocBlock( WORD sel, const void *base, DWORD size );
Alexandre Julliardc7c217b1998-04-13 12:21:30 +000017extern void SELECTOR_MoveBlock( WORD sel, const void *new_base );
Alexandre Julliard8cc3a5e1996-08-11 15:49:51 +000018extern void SELECTOR_FreeBlock( WORD sel, WORD count );
Alexandre Julliard234bc241994-12-10 13:02:28 +000019
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +000020#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 Julliard9ea19e51997-01-01 17:29:55 +000041
Alexandre Julliard234bc241994-12-10 13:02:28 +000042#endif /* __WINE_SELECTORS_H */