summaryrefslogtreecommitdiffstats
path: root/private/mvdm/dpmi32/xlathlp.h
blob: 2f5f7e11c06019d9fdffb54a46705a462c69ba1b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*++

Copyright (c) 1992  Microsoft Corporation

Module Name:

    xlathlp.h

Abstract:

    This module contains helper macros for the api translation

Author:

    Dave Hastings (daveh) 24-Nov-1992

Revision History:

--*/

#define DPMI_EXEC_INT(x)    DpmiSwitchToDosxStack(FALSE);   \
                            DpmiPushRmInt(x);               \
                            host_simulate();                \
                            DpmiSwitchFromDosxStack();

//
// VOID
// DPMI_FLAT_TO_SEGMENTED(
//     PUCHAR buffer,
//     PUSHORT seg,
//     PUSHORT off
// )

#define DPMI_FLAT_TO_SEGMENTED(buffer, seg, off) {  \
    *seg = (USHORT)(((ULONG)buffer-IntelBase) >> 4);            \
    *off = (USHORT)(((ULONG)buffer-IntelBase) & 0xf);           \
}


#define SELECTOR_TO_INTEL_LINEAR_ADDRESS(sel) \
    (FlatAddress[(sel & ~7) / sizeof(LDT_ENTRY)] - IntelBase)