Index: trunk/src/emx/include/os2emx.h
===================================================================
--- trunk/src/emx/include/os2emx.h	(revision 715)
+++ trunk/src/emx/include/os2emx.h	(revision 716)
@@ -231,4 +231,30 @@
 typedef unsigned long ULONG;
 typedef ULONG *PULONG;
+
+#ifndef INCL_LONGLONG_STRUCTS
+
+typedef long long LONGLONG;
+typedef LONGLONG *PLONGLONG;
+
+typedef unsigned long long ULONGLONG;
+typedef ULONGLONG *PULONGLONG;
+
+#else
+
+typedef struct _LONGLONG
+{
+    ULONG   ulLo;
+    LONG    ulHi;
+} LONGLONG;
+typedef LONGLONG *PLONGLONG;
+
+typedef struct _ULONGLONG
+{
+    ULONG   ulLo;
+    ULONG   ulHi;
+} ULONGLONG;
+typedef ULONGLONG *PULONGLONG;
+
+#endif
 
 typedef VOID *PVOID;
@@ -1165,4 +1191,5 @@
 #define fSET			(fPERM|PAG_COMMIT|PAG_DECOMMIT|PAG_DEFAULT)
 
+ULONG APIENTRY DosAliasMem (CPVOID pv, ULONG cb, PPVOID ppvAlias, ULONG fl);
 ULONG APIENTRY DosAllocMem (PPVOID pBaseAddress, ULONG ulObjectSize,
     ULONG ulAllocationFlags);
@@ -1177,4 +1204,5 @@
 ULONG APIENTRY DosQueryMem (CPVOID pBaseAddress, PULONG pulRegionSize,
     PULONG pulAllocationFlags);
+ULONG APIENTRY DosQueryMemState (CPVOID pv, PULONG cb, PULONG pfl);
 ULONG APIENTRY DosSetMem (CPVOID pBaseAddress, ULONG ulRegionSize,
     ULONG ulAttributeFlags);
@@ -1237,4 +1265,7 @@
 #define FIL_QUERYEASIZE			2
 #define FIL_QUERYEASFROMLIST		3
+#define FIL_STANDARDL			11
+#define FIL_QUERYEASIZEL		12
+#define FIL_QUERYEASFROMLISTL		13
 #define FIL_QUERYFULLNAME		5 /* DosQueryPathInfo */
 
@@ -1242,4 +1273,5 @@
 #define FILE_CURRENT			1
 #define FILE_END			2
+#define FILE_SECTOR                     0x8000
 
 #define FILE_NORMAL			0x0000
@@ -1297,4 +1329,10 @@
 #define HDIR_SYSTEM			1
 #define HDIR_CREATE			((HDIR)-1)
+
+#define LISTIO_READ			0x0004
+#define LISTIO_WRITE			0x0008
+
+#define LISTIO_ORDERED			0x0001
+#define LISTIO_UNORDERED		0x0002
 
 #define MUST_HAVE_READONLY	(FILE_READONLY	| (FILE_READONLY  << 8))
@@ -1329,4 +1367,5 @@
 #define OPEN_FLAGS_DASD		       0x8000
 #define OPEN_FLAGS_NONSPOOLED	       0x40000
+#define OPEN_SHARE_DENYLEGACY	       0x10000000
 #define OPEN_FLAGS_PROTECTED_HANDLE    0x40000000
 
@@ -1557,4 +1596,11 @@
 typedef FILELOCK *PFILELOCK;
 
+typedef struct _FILELOCKL     /* flock */
+{
+  LONGLONG lOffset;
+  LONGLONG lRange;
+} FILELOCKL;
+typedef FILELOCKL  *PFILELOCKL;
+
 typedef struct _FILESTATUS
 {
@@ -1615,4 +1661,33 @@
 typedef FILESTATUS4 *PFILESTATUS4;
 
+typedef struct _FILESTATUS3L
+{
+   FDATE    fdateCreation;
+   FTIME    ftimeCreation;
+   FDATE    fdateLastAccess;
+   FTIME    ftimeLastAccess;
+   FDATE    fdateLastWrite;
+   FTIME    ftimeLastWrite;
+   LONGLONG cbFile;
+   LONGLONG cbFileAlloc;
+   ULONG    attrFile;
+} FILESTATUS3L;
+typedef FILESTATUS3L *PFILESTATUS3L;
+
+typedef struct _FILESTATUS4L
+{
+   FDATE    fdateCreation;
+   FTIME    ftimeCreation;
+   FDATE    fdateLastAccess;
+   FTIME    ftimeLastAccess;
+   FDATE    fdateLastWrite;
+   FTIME    ftimeLastWrite;
+   LONGLONG cbFile;
+   LONGLONG cbFileAlloc;
+   ULONG    attrFile;
+   ULONG    cbList;
+} FILESTATUS4L;
+typedef FILESTATUS4L  *PFILESTATUS4L;
+
 typedef struct _FSALLOCATE
 {
@@ -1671,6 +1746,36 @@
 typedef FSINFO *PFSINFO;
 
+typedef struct _LISTIO_CB
+{
+  HFILE    hFile;
+  ULONG    CmdFlag;
+  LONG     Offset;
+  PVOID    pBuffer;
+  ULONG    NumBytes;
+  ULONG    Actual;
+  ULONG    RetCode;
+  ULONG    Reserved;
+  ULONG    Reserved2[3];
+  ULONG    Reserved3[2];
+} LISTIO;
+typedef LISTIO *PLISTIO;
+
+typedef struct _LISTIO_CBL
+{
+  HFILE     hFile;
+  ULONG     CmdFlag;
+  LONGLONG  Offset;
+  PVOID     pBuffer;
+  ULONG     NumBytes;
+  ULONG     Actual;
+  ULONG     RetCode;
+  ULONG     Reserved;
+  ULONG     Reserved2[3];
+  ULONG     Reserved3[2];
+} LISTIOL;
+typedef LISTIOL *PLISTIOL;
 
 ULONG APIENTRY DosCancelLockRequest (HFILE hFile, __const__ FILELOCK *pfl);
+ULONG APIENTRY DosCancelLockRequestL (HFILE hFile, __const__ FILELOCKL *pfl);
 ULONG APIENTRY DosClose (HFILE hFile);
 ULONG APIENTRY DosCopy (PCSZ pszSource, PCSZ pszTarget, ULONG ulOption);
@@ -1695,7 +1800,12 @@
     PVOID pParmList, ULONG ulParmLengthMax, PULONG pulParmLength,
     ULONG ulFunction, PCSZ pszRouteName, HFILE hFile, ULONG ulMethod);
+ULONG APIENTRY DosListIO (ULONG ulCmdMode, ULONG cEntries, PLISTIO pListIO);
+ULONG APIENTRY DosListIOL (ULONG ulCmdMode, ULONG cEntries, PLISTIOL pListIO);
 ULONG APIENTRY DosMove (PCSZ pszOldName, PCSZ pszNewName);
 ULONG APIENTRY DosOpen (PCSZ pszFileName, PHFILE phFile, PULONG pulAction,
     ULONG ulFileSize, ULONG ulAttribute, ULONG ulOpenFlags, ULONG ulOpenMode,
+    PEAOP2 pEABuf);
+ULONG APIENTRY DosOpenL (PCSZ pszFileName, PHFILE phFile, PULONG pulAction,
+    LONGLONG llFileSize, ULONG ulAttribute, ULONG ulOpenFlags, ULONG ulOpenMode,
     PEAOP2 pEABuf);
 ULONG APIENTRY DosProtectClose (HFILE hFile, FHLOCK fhFileHandleLockID);
@@ -1704,6 +1814,9 @@
     ULONG ulInfoLevel, FHLOCK fhFileHandleLockID);
 ULONG APIENTRY DosProtectOpen (PCSZ pszFileName, PHFILE phFile, PULONG pulAction,
-    ULONG ulFileSize, ULONG ulAttribute, ULONG ulOpenFlags, ULONG ulOpenMode,
+    ULONG cbFile, ULONG ulAttribute, ULONG ulOpenFlags, ULONG ulOpenMode,
     PEAOP2 pEABuf, PFHLOCK pfhFileHandleLockID);
+ULONG APIENTRY DosProtectOpenL (PCSZ pszFileName, PHFILE phFile, PULONG pulAction,
+    LONGLONG cbFile, ULONG ulAttribute, ULONG flOpenFlags, ULONG flOpenMode,
+    PEAOP2 peaop2, PFHLOCK pfhFileHandleLockID);
 ULONG APIENTRY DosProtectQueryFHState (HFILE hFile, PULONG pulMode,
     FHLOCK fhFileHandleLockID);
@@ -1717,9 +1830,16 @@
     ULONG ulInfoLength, FHLOCK fhFileHandleLockID);
 ULONG APIENTRY DosProtectSetFileLocks (HFILE hFile, __const__ FILELOCK *pflUnlock,
-    __const__ FILELOCK *pflLock, ULONG ulTimeout, ULONG ulFlags,
+    __const__ FILELOCK *pflLock, ULONG ulTimeout, ULONG flFlags,
+    FHLOCK fhFileHandleLockID);
+ULONG APIENTRY DosProtectSetFileLocksL (HFILE hFile, __const__ FILELOCKL *pflUnlock,
+    __const__ FILELOCKL *pflLock, ULONG ulTimeout, ULONG flFlags,
     FHLOCK fhFileHandleLockID);
 ULONG APIENTRY DosProtectSetFilePtr (HFILE hFile, LONG lOffset, ULONG ulOrigin,
     PULONG pulPos, FHLOCK fhFileHandleLockID);
-ULONG APIENTRY DosProtectSetFileSize (HFILE hFile, ULONG ulSize,
+ULONG APIENTRY DosProtectSetFilePtrL (HFILE hFile, LONGLONG llOffset, ULONG ulOrigin,
+    PLONGLONG pllPos, FHLOCK fhFileHandleLockID);
+ULONG APIENTRY DosProtectSetFileSize (HFILE hFile, ULONG cbSize,
+    FHLOCK fhFileHandleLockID);
+ULONG APIENTRY DosProtectSetFileSizeL (HFILE hFile, LONGLONG cbSize,
     FHLOCK fhFileHandleLockID);
 ULONG APIENTRY DosProtectWrite (HFILE hFile, CPVOID pBuffer, ULONG ulLength,
@@ -1748,6 +1868,10 @@
 ULONG APIENTRY DosSetFileLocks (HFILE hFile, __const__ FILELOCK *pflUnlock,
     __const__ FILELOCK *pflLock, ULONG ulTimeout, ULONG ulFlags);
+ULONG APIENTRY DosSetFileLocksL (HFILE hFile, __const__ FILELOCKL *pflUnlock,
+    __const__ FILELOCKL *pflLock, ULONG ulTimeout, ULONG flFlags);
 ULONG APIENTRY DosSetFilePtr (HFILE hFile, LONG lOffset, ULONG ulOrigin, PULONG pulPos);
-ULONG APIENTRY DosSetFileSize (HFILE hFile, ULONG ulSize);
+ULONG APIENTRY DosSetFilePtrL (HFILE hFile, LONGLONG llOffset, ULONG ulOrigin, PLONGLONG pllPos);
+ULONG APIENTRY DosSetFileSize (HFILE hFile, ULONG cbSize);
+ULONG APIENTRY DosSetFileSizeL (HFILE hFile, LONGLONG cbSize);
 ULONG APIENTRY DosSetFSInfo (ULONG ulDrive, ULONG ulInfoLevel, PVOID pBuf,
     ULONG ulBufLength);
@@ -2576,4 +2700,7 @@
 #if defined (INCL_DOSPROCESS)
 
+#define AFNTY_THREAD		0
+#define AFNTY_SYSTEM		1
+
 #define CREATE_READY		0
 #define CREATE_SUSPENDED	1
@@ -2677,8 +2804,26 @@
 typedef FNEXITLIST *PFNEXITLIST;
 
+typedef struct _MPAFFINITY
+{
+  ULONG         mask[2];
+} MPAFFINITY;
+typedef MPAFFINITY *PMPAFFINITY;
+
+typedef struct _THREADCREATE
+{
+  ULONG         cbSize;
+  PTID          pTid;
+  PFNTHREAD     pfnStart;
+  ULONG         lParam;
+  ULONG         lFlag;
+  PBYTE         pStack;
+  ULONG         cbStack;
+} THREADCREATE;
+typedef THREADCREATE *PTHREADCREATE;
 
 ULONG APIENTRY DosAllocThreadLocalMemory (ULONG cb, PULONG *p);
 ULONG APIENTRY DosCreateThread (PTID ptidThreadID, PFNTHREAD pfnThreadAddr,
     ULONG ulThreadArg, ULONG ulFlags, ULONG ulStackSize);
+ULONG APIENTRY DosCreateThread2 (PTHREADCREATE ptc);
 ULONG APIENTRY DosEnterCritSec (VOID);
 ULONG APIENTRY DosExecPgm (PCHAR pObjname, LONG lObjnameLength, ULONG ulFlagS,
@@ -2690,6 +2835,8 @@
 ULONG APIENTRY DosKillProcess (ULONG ulAction, PID pid);
 ULONG APIENTRY DosKillThread (TID tid);
+ULONG APIENTRY DosQueryThreadAffinity (ULONG ulScope, PMPAFFINITY pAffinity);
 ULONG APIENTRY DosResumeThread (TID tid);
 ULONG APIENTRY DosSetPriority (ULONG ulScope, ULONG ulClass, LONG lDelta, ULONG ulID);
+ULONG APIENTRY DosSetThreadAffinity (PMPAFFINITY pAffinity);
 ULONG APIENTRY DosSleep (ULONG ulInterval);
 ULONG APIENTRY DosSuspendThread (TID tid);
@@ -2724,4 +2871,15 @@
 				   FAPPTYP_PHYSDRV | FAPPTYP_VIRTDRV | \
 				   FAPPTYP_PROTDLL | FAPPTYP_32BIT))
+
+#ifdef INCL_DOSFILEMGR
+
+#define EAT_APPTYP_PMAPI        0
+#define EAT_APPTYP_DOS          1
+#define EAT_APPTYP_PMW          2
+#define EAT_APPTYP_NOPMW        3
+#define EAT_APPTYP_EXETYPE      3
+#define EAT_APPTYP_RESERVED     ~(EAT_APPTYP_EXETYPE)
+
+#endif /* INCL_DOSFILEMGR */
 
 #endif /* INCL_DOSSESMGR || INCL_DOSFILEMGR */
@@ -2818,4 +2976,6 @@
 #define DCMW_WAIT_ANY		0x02
 #define DCMW_WAIT_ALL		0x04
+#define DCE_POSTONE		0x0800
+#define DCE_AUTORESET		0x1000
 
 #define SEM_INDEFINITE_WAIT	((ULONG)-1)
@@ -3195,5 +3355,5 @@
 #endif /* INCL_DOSMISC */
 
-/* ---------------------------- TIMERS ------------------------------------ */
+/* ----------------------------- TIME ------------------------------------- */
 
 #if defined (INCL_DOSDATETIME) || !defined (INCL_NOCOMMON)
@@ -3232,4 +3392,66 @@
 #if defined (INCL_DOSPROFILE)
 
+#define PROF_ORDINAL                133
+
+#define PROF_SYSTEM                 0
+#define PROF_USER                   1
+#define PROF_USEDD                  2
+#define PROF_KERNEL                 4
+#define PROF_VERBOSE                8
+#define PROF_ENABLE                 16
+
+#define PROF_ALLOC                  0
+#define PROF_CLEAR                  1
+#define PROF_ON                     2
+#define PROF_OFF                    3
+#define PROF_DUMP                   4
+#define PROF_FREE                   5
+
+#define PROF_SHIFT                  2
+
+#define PROF_MOD_NAME_SIZE          10
+
+#define PROF_END_OF_DATA            13
+
+#define PADSHORT                    USHORT pad_sh
+#define PADCHAR                     UCHAR  pad_ch
+
+#define QS_PROCESS                  0x0001
+#define QS_SEMAPHORE                0x0002
+#define QS_MTE                      0x0004
+#define QS_FILESYS                  0x0008
+#define QS_SHMEMORY                 0x0010
+#define QS_DISK                     0x0020
+#define QS_HWCONFIG                 0x0040
+#define QS_NAMEDPIPE                0x0080
+#define QS_THREAD                   0x0100
+#define QS_MODVER                   0x0200
+#define QS_SUPPORTED                (QS_PROCESS|QS_SEMAPHORE|QS_MTE|QS_FILESYS|QS_SHMEMORY|QS_MODVER)
+
+#define QS_END                      0L
+
+#define QS_SYSSEM_WAITING           0x01
+#define QS_SYSSEM_MUXWAITING        0x02
+#define QS_SYSSEM_OWNER_DIED        0x04
+#define QS_SYSSEM_EXCLUSIVE         0x08
+#define QS_SYSSEM_NAME_CLEANUP      0x10
+#define QS_SYSSEM_THREAD_OWNER_DIED 0x20
+#define QS_SYSSEM_EXITLIST_OWNER    0x40
+
+#define QS_DC_SEM_SHARED            0x0001
+#define QS_DCMW_WAIT_ANY            0x0002
+#define QS_DCMW_WAIT_ALL            0x0004
+#define QS_DCM_MUTEX_SEM            0x0008
+#define QS_DCE_EVENT_SEM            0x0010
+#define QS_DCMW_MUX_SEM             0x0020
+#define QS_DC_SEM_PM                0x0040
+#define QS_DE_POSTED                0x0040
+#define QS_DM_OWNER_DIED            0x0080
+#define QS_DMW_MTX_MUX              0x0100
+#define QS_DHO_SEM_OPEN             0x0200
+#define QS_DE_16BIT_MW              0x0400
+#define QS_DCE_POSTONE              0x0800
+#define QS_DCE_AUTORESET            0x1000
+
 typedef struct _QWORD
 {
@@ -3239,4 +3461,217 @@
 typedef QWORD *PQWORD;
 
+typedef struct _QSGREC
+{
+  ULONG         cThrds;
+  ULONG         c32SSem;
+  ULONG         cMFTNodes;
+} QSGREC;
+typedef QSGREC qsGrec_t;
+
+typedef struct _QSTREC
+{
+  ULONG         RecType;
+  USHORT        tid;
+  USHORT        slot;
+  ULONG         sleepid;
+  ULONG         priority;
+  ULONG         systime;
+  ULONG         usertime;
+  UCHAR         state;
+  PADCHAR;
+  PADSHORT;
+} QSTREC;
+typedef QSTREC qsTrec_t;
+
+typedef struct _QSPREC
+{
+  ULONG         RecType;
+  QSTREC       *pThrdRec;
+  USHORT        pid;
+  USHORT        ppid;
+  ULONG         type;
+  ULONG         stat;
+  ULONG         sgid;
+  USHORT        hMte;
+  USHORT        cTCB;
+  ULONG         c32PSem;
+  VOID         *p32SemRec;
+  USHORT        c16Sem;
+  USHORT        cLib;
+  USHORT        cShrMem;
+  USHORT        cFH;
+  USHORT       *p16SemRec;
+  USHORT       *pLibRec;
+  USHORT       *pShrMemRec;
+  USHORT       *pFSRec;
+} QSPREC;
+typedef QSPREC qsPrec_t;
+
+typedef struct _QSS16REC
+{
+  ULONG         NextRec;
+  USHORT        SysSemOwner;
+  UCHAR         SysSemFlag;
+  UCHAR         SysSemRefCnt;
+  UCHAR         SysSemProcCnt;
+  UCHAR         SysSemPad;
+  USHORT        pad_sh;
+  USHORT        SemPtr;
+  CHAR          SemName;
+} QSS16REC;
+typedef QSS16REC qsS16rec_t;
+
+typedef struct _QSS16HEADREC
+{
+  ULONG         SRecType;
+  ULONG         SpNextRec;
+  ULONG         S32SemRec;
+  ULONG         S16TblOff;
+  ULONG         pSem16Rec;
+} QSS16HEADREC;
+typedef QSS16HEADREC qsS16Headrec_t;
+
+typedef struct _QSMREC
+{
+  ULONG         MemNextRec;
+  USHORT        hmem;
+  USHORT        sel;
+  USHORT        refcnt;
+  CHAR          Memname;
+} QSMREC;
+typedef QSMREC qsMrec_t;
+
+typedef struct _QSOPENQ
+{
+  USHORT        pidOpener;
+  USHORT        OpenCt;
+} QSOPENQ;
+
+typedef struct _QSEVENT
+{
+  ULONG        *pMuxQ;
+  USHORT        PostCt;
+} QSEVENT;
+
+typedef struct _QSMUTEX
+{
+  ULONG        *pMuxQ;
+  USHORT        ReqCt;
+  USHORT        SlotNum;
+} QSMUTEX;
+
+typedef struct _QSMUX
+{
+  VOID         *pSemRec;
+  USHORT        cSemRec;
+  USHORT        WaitCt;
+} QSMUX;
+
+typedef union _QSHUN
+{
+  QSEVENT       qsSEvt;
+  QSMUTEX       qsSMtx;
+  QSMUX         qsSMux;
+} QSHUN;
+
+typedef struct _QSS32REC
+{
+  PVOID        *pNextRec;
+  USHORT        flags;
+  PADSHORT;
+  UCHAR        *pName;
+  QSHUN         qsh;
+  ULONG         blockid;
+  USHORT        index;
+  USHORT        OpenCt;
+  QSOPENQ       OpenQ[1];
+} QSS32REC;
+typedef QSS32REC qsS32rec_t;
+
+typedef struct _QSLOBJREC
+{
+  ULONG         oaddr;
+  ULONG         osize;
+  ULONG         oflags;
+} QSLOBJREC;
+typedef QSLOBJREC qsLObjrec_t;
+
+typedef struct _QSLREC
+{
+  PVOID        *pNextRec;
+  USHORT        hmte;
+  USHORT        fFlat;
+  ULONG         ctImpMod;
+  ULONG         ctObj;
+  QSLOBJREC    *pObjInfo;
+  UCHAR        *pName;
+} QSLREC;
+typedef QSLREC qsLrec_t;
+
+typedef struct _QSEXLREC
+{
+  struct _QSEXLREC *next;
+  USHORT        hndmod;
+  USHORT        pid;
+  USHORT        type;
+  ULONG         refcnt;
+  ULONG         segcnt;
+  VOID         *_reserved_;
+  UCHAR        *name;
+  ULONG         ModuleVersion;
+  UCHAR        *ShortModName;
+  ULONG         modref;
+} QSEXLREC;
+typedef QSEXLREC qsExLrec_t;
+
+#pragma pack(1)
+typedef struct _QSSFT
+{
+  USHORT        sfn;
+  USHORT        refcnt;
+  USHORT        flags;
+  USHORT        flags2;
+  USHORT        mode;
+  USHORT        mode2;
+  ULONG         size;
+  USHORT        hVPB;
+  USHORT        attr;
+  PADSHORT;
+} QSSFT;
+#pragma pack()
+typedef QSSFT qsSft_t;
+
+typedef struct _QSFREC
+{
+  ULONG         RecType;
+  PVOID        *pNextRec;
+  ULONG         ctSft;
+  QSSFT        *pSft;
+} QSFREC;
+typedef QSFREC qsFrec_t;
+
+typedef struct _QSPTRREC
+{
+  QSGREC       *pGlobalRec;
+  QSPREC       *pProcRec;
+  QSS16HEADREC *p16SemRec;
+  QSS32REC     *p32SemRec;
+  QSMREC       *pMemRec;
+  QSLREC       *pLibRec;
+  QSMREC       *pShrMemRec;
+  QSFREC       *pFSRec;
+} QSPTRREC;
+typedef QSPTRREC qsPtrRec_t;
+
+ULONG APIENTRY DosAliasPerfCtrs (ULONG ulRangeType, ULONG ulInfo,
+    PBYTE *ppbRangeStart, ULONG *pulRangeSize);
+ULONG APIENTRY DosConfigurePerf (ULONG ulEntityType, ULONG ulConfigType,
+    ULONG ulInfo1, ULONG ulInfo2, PCSZ  pszConfigSpec, BOOL32 fExclude);
+ULONG APIENTRY DosDeconPerf (VOID);
+ULONG APIENTRY DosPerfSysCall (ULONG ulCommand, ULONG ulParm1, ULONG ulParm2,
+    ULONG ulParm3);
+ULONG APIENTRY DosQuerySysState (ULONG ulEntityList, ULONG ulEntityLevel,
+    PID pid, TID tid, PVOID pvDataBuf, ULONG cbBuf);
+ULONG APIENTRY DosRegisterPerfCtrs (PBYTE pbDataBlk, PBYTE pbTextBlk, ULONG flFlags);
 ULONG APIENTRY DosTmrQueryFreq (PULONG pulTmrFreq);
 ULONG APIENTRY DosTmrQueryTime (PQWORD pqwTmrTime);
@@ -3264,4 +3699,27 @@
 
 #endif /* INCL_DOSMVDM */
+
+/* --------------------------- SPINLOCKS ---------------------------------- */
+
+#if defined(INCL_DOSSPINLOCK)
+
+#define PROC_OFFLINE            0
+#define PROC_ONLINE             1
+
+typedef ULONG HSPINLOCK;
+typedef HSPINLOCK  *PHSPINLOCK;
+
+ULONG APIENTRY DosCreateSpinLock (PHSPINLOCK pHandle);
+ULONG APIENTRY DosFreeSpinLock (HSPINLOCK hSpinLock);
+ULONG APIENTRY DosGetProcessorStatus (ULONG ulProcNum, PULONG pStatus);
+ULONG APIENTRY DosGetProcessorStatus (ULONG ulProcid, PULONG pulStatus);
+ULONG APIENTRY DosPerfSysCall (ULONG ulCommand, ULONG ulParm1, ULONG ulParm2, ULONG ulParm3);
+ULONG APIENTRY DosSetProcessorStatus (ULONG ulProcNum, ULONG pStatus);
+ULONG APIENTRY DosSetProcessorStatus (ULONG ulProcid, ULONG ulStatus);
+ULONG APIENTRY DosTestPSD (PCSZ pszPSDFileName);
+VOID  APIENTRY DosAcquireSpinLock (HSPINLOCK hSpinLock);
+VOID  APIENTRY DosReleaseSpinLock (HSPINLOCK hSpinLock);
+
+#endif
 
 /* --------------------------- DEBUGGING ---------------------------------- */
@@ -3302,4 +3760,9 @@
 #define DBG_C_LinToSel			30
 #define DBG_C_SelToLin			31
+#define DBG_C_RegisterSemList           32
+#define DBG_C_Attach                    33
+#define DBG_C_Detach                    34
+#define DBG_C_RegDebug                  35
+#define DBG_C_QueryDebug                36
 
 #define DBG_N_Success			0
@@ -3344,4 +3807,12 @@
 #define DBG_X_LAST_CHANCE		0x00000002
 #define DBG_X_STACK_INVALID		0x00000003
+
+#define JIT_REG_INHERIT                 0x00010000
+#define JIT_REG_NOINHERIT               0x00020000
+#define JIT_REG_DETACH                  0x00030000
+#define JIT_REG_FG                      0x00040000
+
+#define DBGQ_JIT_GLOBAL                 0x10000000
+#define DBGQ_JIT_PERPROC                0x20000000
 
 typedef struct _TStat
@@ -3439,7 +3910,9 @@
 #define SIS_MEC_TABLE			1
 #define SIS_SYS_LOG			2
+#define SIS_PERF_MEC_TABLE		3
 
 #define SPU_DISABLESUPPRESSION		0
 #define SPU_ENABLESUPPRESSION		1
+#define SPU_NOLOGCHANGE			2
 
 ULONG APIENTRY DosDumpProcess (ULONG ulFlag, ULONG ulDrive, PID pid);
