Changeset 149 for trunk


Ignore:
Timestamp:
Mar 27, 2013, 5:56:17 AM (12 years ago)
Author:
David Azarewicz
Message:

The rest of the last commit

Location:
trunk
Files:
2 added
2 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/include/devhelp.h

    r146 r149  
    1 /* DEVHELP.H - DevHelp header file for Watcom-based device drivers
     1/*
     2 *  devhelp.h  OS/2 device help calls for DD 16-bit development.
    23 *
    3  * Markus Thielen 09/2010:
    4  *    some modifications for OpenWatcom/os2ahci.add
     4 *                          Open Watcom Project
    55 *
    6  * TODO: the Watcom build is broken - the resulting ADD does not work.
     6 * Copyright (c) 2004-2007 The Open Watcom Contributors. All Rights Reserved.
    77 *
    8 */
     8 * This file was copied from the updated DDK.
     9 *
     10 * =========================================================================
     11 */
    912
    1013#ifndef DEVHELP_INCLUDED
     
    2629
    2730typedef struct _PAGELIST {
    28   ULONG    PhysAddr;
    29   ULONG    Size;
     31    ULONG    PhysAddr;
     32    ULONG    Size;
    3033} PAGELIST, __near *NPPAGELIST, __far *PPAGELIST;
    3134
     35typedef ULONG HSpinLock;
     36
     37// Device_Help: dev help offset from INIT
    3238extern PFN Device_Help;
    3339
     40// 11 Jun 07 SHL change from far ptr to dword ptr
     41// MKG - Due to Lars Erdmann comment:
     42// Explanation: "CALL DWORD PTR" calls a far routine indirectly through the
     43// function pointer saved in the address passed to the call (which is
     44// correct since the devhelps use a function pointer) while "CALL FAR PTR"
     45// calls a far routine directly, that is, the address passed to the call is
     46// the far routine address (which is wrong for the devhelp calls).
     47
    3448#define DEVHELP_CALL \
    3549   "call dword ptr [Device_Help]" \
     
    3953   value [ax]
    4054
     55/* This service starts an ABIOS function for the Operating System Transfer
     56 * Convention.
     57 */
    4158USHORT DevHelp_ABIOSCall(USHORT Lid, NPBYTE ReqBlk, USHORT Entry_Type);
    4259#pragma aux DevHelp_ABIOSCall = \
     
    4663   modify exact [ax dl];
    4764
     65/* This service starts an ABIOS common entry point according to the Advanced
     66 * BIOS Transfer Convention.
     67 */
    4868USHORT DevHelp_ABIOSCommonEntry(NPBYTE ReqBlk, USHORT Entry_Type);
    4969#pragma aux DevHelp_ABIOSCommonEntry = \
     
    5272   parm caller [si] [dh] \
    5373   modify exact [ax dl];
     74
     75USHORT DevHelp_AcquireSpinLock(HSpinLock spl);
     76#pragma aux DevHelp_AcquireSpinLock = \
     77   "mov  ax,dx" \
     78   "mov  dl,71h" \
     79   DEVHELP_CALL \
     80   parm caller nomemory [dx bx] \
     81   modify nomemory exact [ax bx cx dx si di];
    5482
    5583USHORT DevHelp_AllocateCtxHook(NPFN HookHandler, PULONG HookHandle);
     
    157185   modify nomemory exact [ax dl];
    158186
     187USHORT DevHelp_CreateSpinLock(HSpinLock FAR * pSpl);
     188#pragma aux DevHelp_CreateSpinLock = \
     189   "mov  ax,dx" \
     190   "mov  dl,79h" \
     191   DEVHELP_CALL \
     192   parm caller [dx bx] \
     193   modify exact [ax bx cx dx si di];
     194
    159195USHORT DevHelp_DeRegister(USHORT MonitorPID, USHORT MonitorHandle, PUSHORT MonitorsLeft);
    160196#pragma aux DevHelp_DeRegister = \
     
    226262   parm caller nomemory [ax] \
    227263   modify nomemory exact [ax dl];
     264
     265USHORT DevHelp_FreeSpinLock(HSpinLock spl);
     266#pragma aux DevHelp_FreeSpinLock = \
     267   "mov  ax,dx" \
     268   "mov  dl,7ah" \
     269   DEVHELP_CALL \
     270   parm caller nomemory [dx bx] \
     271   modify nomemory exact [ax bx cx dx si di];
    228272
    229273USHORT DevHelp_FreePhys(ULONG PhysAddr);
     
    295339#define DHGETDOSV_YIELDFLAG             7                            /*@V76282*/
    296340#define DHGETDOSV_TCYIELDFLAG           8                            /*@V76282*/
     341#define DHGETDOSV_DOSTABLES             9  // Undocumented by IBM, gets the dostables.
    297342#define DHGETDOSV_DOSCODEPAGE           11                           /*@V76282*/
    298343#define DHGETDOSV_INTERRUPTLEV          13
     
    331376   "pop  es" \
    332377   "mov  dl,2Bh" \
    333    "jmp far ptr es:[Device_Help]" \
     378   "jmp dword ptr es:[Device_Help]" \
    334379   parm [es si] [di] \
    335380   modify nomemory exact [];
     
    532577#define WAIT_IS_NOT_INTERRUPTABLE  1
    533578
    534 #define WAIT_INTERRUPTED           0x8003
    535 #define WAIT_TIMED_OUT             0x8001
     579#define WAIT_INTERRUPTED           0x2
     580#define WAIT_TIMED_OUT             0x1
    536581
    537582USHORT DevHelp_ProcBlock(ULONG EventId, ULONG WaitTime, USHORT IntWaitFlag);
     
    541586   "xchg cx,di" \
    542587   "call dword ptr [Device_Help]" \
    543    "jc   error" \
    544    "mov  ax,0"       /* doesn't affect zero flag like sub ax,ax does */ \
    545    "error:" \
     588   "setnz al"                  \
     589   "setc bl"                   \
     590   "inc al"                    \
     591   "neg bl"                    \
     592   "and al,bl"                 \
     593   "xor ah,ah"                 \
    546594   value [ax] \
    547595   parm caller nomemory [ax bx] [di cx] [dh] \
     
    733781   modify exact [ax bx cx di dl es];
    734782
    735 USHORT DevHlp_ResetEventSem(ULONG hEvent, PULONG pNumPosts);
     783USHORT DevHelp_ReleaseSpinLock(HSpinLock spl);
     784#pragma aux DevHelp_ReleaseSpinLock = \
     785   "mov  ax,dx" \
     786   "mov  dl,72h" \
     787   DEVHELP_CALL \
     788   parm caller nomemory [dx bx] \
     789   modify nomemory exact [ax bx cx dx si di];
     790
     791USHORT DevHelp_ResetEventSem(ULONG hEvent, LIN pNumPosts);
    736792#pragma aux DevHelp_ResetEventSem = \
    737793   "mov  eax,[esp]" \
     
    919975USHORT DevHelp_VirtToPhys(PVOID SelOffset, PULONG PhysAddr);
    920976#pragma aux DevHelp_VirtToPhys = \
    921    ";int 3" \
    922977   "push ds" \
    923978   "mov  dl,16h" \
     
    10251080
    10261081USHORT DevHelp_VMProcessToGlobal(ULONG Flags, LIN LinearAddr, ULONG Length, PLIN GlobalLinearAddr);
    1027 #pragma aux DevHelp_ProcessToGlobal = \
     1082#pragma aux DevHelp_VMProcessToGlobal = \
    10281083   "mov  dl,59h" \
    10291084   "mov  eax,[esp]" \
     
    10861141#endif
    10871142
    1088 #endif
    1089 #endif
     1143#endif // end __WATCOMC__
     1144#endif // end DEVHELP_INCLUDED
     1145
Note: See TracChangeset for help on using the changeset viewer.