]>
git.ipfire.org Git - u-boot.git/blob - board/MAI/bios_emulator/scitech/src/common/aaos2.c
1 /****************************************************************************
3 * SciTech Nucleus Graphics Architecture
5 * Copyright (C) 1991-1998 SciTech Software, Inc.
8 * ======================================================================
9 * |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
11 * |This copyrighted computer code contains proprietary technology |
12 * |owned by SciTech Software, Inc., located at 505 Wall Street, |
13 * |Chico, CA 95928 USA (http://www.scitechsoft.com). |
15 * |The contents of this file are subject to the SciTech Nucleus |
16 * |License; you may *not* use this file or related software except in |
17 * |compliance with the License. You may obtain a copy of the License |
18 * |at http://www.scitechsoft.com/nucleus-license.txt |
20 * |Software distributed under the License is distributed on an |
21 * |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or |
22 * |implied. See the License for the specific language governing |
23 * |rights and limitations under the License. |
25 * |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
26 * ======================================================================
29 * Environment: OS/2 32-bit
31 * Description: OS specific Nucleus Graphics Architecture services for
32 * the OS/2 operating system environments.
34 ****************************************************************************/
37 #define INCL_DOSERRORS
44 /*---------------------------- Global Variables ---------------------------*/
46 static HFILE hSDDHelp
;
47 static ulong outLen
; /* Must not cross 64Kb boundary! */
48 static ulong result
; /* Must not cross 64Kb boundary! */
49 static ibool haveRDTSC
;
51 /*-------------------------- Implementation -------------------------------*/
53 /****************************************************************************
55 This function returns a pointer to the common graphics driver loaded in the
56 helper VxD. The memory for the VxD is shared between all processes via
57 the VxD, so that the VxD, 16-bit code and 32-bit code all see the same
58 state when accessing the graphics binary portable driver.
59 ****************************************************************************/
60 GA_sharedInfo
* NAPI
GA_getSharedInfo(
63 /* Initialise the PM library and connect to our runtime DLL's */
66 /* Open our helper device driver */
67 if (DosOpen(PMHELP_NAME
,&hSDDHelp
,&result
,0,0,
68 FILE_OPEN
, OPEN_SHARE_DENYNONE
| OPEN_ACCESS_READWRITE
,
70 PM_fatalError("Unable to open SDDHELP$ helper device driver!");
71 outLen
= sizeof(result
);
72 DosDevIOCtl(hSDDHelp
,PMHELP_IOCTL
,PMHELP_GETSHAREDINFO
,
74 &result
, outLen
, &outLen
);
77 /* We have found the shared Nucleus packet. Because not all processes
78 * map to SDDPMI.DLL, we need to ensure that we connect to this
79 * DLL so that it gets mapped into our address space (that is
80 * where the shared Nucleus packet is located). Simply doing a
81 * DosLoadModule on it is enough for this.
85 DosLoadModule((PSZ
)buf
,sizeof(buf
),(PSZ
)"SDDPMI.DLL",&hModSDDPMI
);
87 return (GA_sharedInfo
*)result
;
90 /****************************************************************************
92 Nothing special for this OS.
93 ****************************************************************************/
94 ibool NAPI
GA_getSharedExports(
101 /****************************************************************************
103 This function initialises the high precision timing functions for the
104 Nucleus loader library.
105 ****************************************************************************/
106 ibool NAPI
GA_TimerInit(void)
108 if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC
) != 0)
113 /****************************************************************************
115 This function reads the high resolution timer.
116 ****************************************************************************/
117 void NAPI
GA_TimerRead(
118 GA_largeInteger
*value
)
121 _GA_readTimeStamp(value
);
123 DosTmrQueryTime((QWORD
*)value
);