| 1 | /* $Id: OS2KSEL.h,v 1.1 2001-09-26 03:52:36 bird Exp $
|
|---|
| 2 | *
|
|---|
| 3 | * Selector Manager prototypes, structures and definitions.
|
|---|
| 4 | *
|
|---|
| 5 | * Copyright (c) 2001 knut st. osmundsen (kosmunds@csc.com)
|
|---|
| 6 | *
|
|---|
| 7 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 8 | *
|
|---|
| 9 | */
|
|---|
| 10 | #ifndef _OS2KSEL_h_
|
|---|
| 11 | #define _OS2KSEL_h_
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 | /**
|
|---|
| 15 | * Converts 16:32 address to FLAT 32-bits address.
|
|---|
| 16 | * @returns Flat 32-bits address.
|
|---|
| 17 | * -1 on error.
|
|---|
| 18 | * @param ulOffset Offset.
|
|---|
| 19 | * @param usSel Selector.
|
|---|
| 20 | */
|
|---|
| 21 | extern PVOID KRNLCALL SELVirtToLin(ULONG ulOffset, USHORT usSel);
|
|---|
| 22 | extern PVOID KRNLCALL OrgSELVirtToLin(ULONG ulOffset, USHORT usSel);
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 | /**
|
|---|
| 26 | * Converts selector to linar address.
|
|---|
| 27 | * @returns Flat 32-bits address.
|
|---|
| 28 | * -1 on error.
|
|---|
| 29 | * @param usSel Selector.
|
|---|
| 30 | */
|
|---|
| 31 | extern PVOID KRNLCALL SELConvertToLinear(USHORT usSel, PPTDA pPTDA);
|
|---|
| 32 | extern PVOID KRNLCALL OrgSELConvertToLinear(USHORT usSel, PPTDA pPTDA);
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 | /**
|
|---|
| 36 | * Converts a 32-bit flat pointer to an selector if possible.
|
|---|
| 37 | * @returns Selector (eax), offset (edx).
|
|---|
| 38 | * @param pv Flat 32-bit address.
|
|---|
| 39 | * @param ulRPL Requested privilege level of the selector.
|
|---|
| 40 | * @param hPTDA PTDA handle. NULLHANDLE means current PTDA.
|
|---|
| 41 | */
|
|---|
| 42 | extern USHORT KRNLCALL SELConvertToSelector(PVOID pv, ULONG ulRPL, HPTDA hPTDA);
|
|---|
| 43 | extern USHORT KRNLCALL OrgSELConvertToSelector(PVOID pv, ULONG ulRPL, HPTDA hPTDA);
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 | /**
|
|---|
| 47 | * Allocates a GDT selector.
|
|---|
| 48 | * @returns OS2 return code. (I.e. NO_ERROR on success.)
|
|---|
| 49 | * @param pusSel Where to put the selector on successful return.
|
|---|
| 50 | */
|
|---|
| 51 | extern ULONG KRNLCALL SELAllocGDT(PUSHORT pusSel);
|
|---|
| 52 | extern ULONG KRNLCALL OrgSELAllocGDT(PUSHORT pusSel);
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 | #endif
|
|---|
| 56 |
|
|---|