2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: boot/freeldr/freeldr/arch/i386/ntoskrnl.c
5 * PURPOSE: NTOS glue routines for the MINIHAL library
6 * PROGRAMMERS: Hervé Poussineau <hpoussin@reactos.org>
9 /* INCLUDES ******************************************************************/
13 /* For KeStallExecutionProcessor */
14 #if defined(_M_IX86) || defined(_M_AMD64)
15 #include <arch/pc/pcbios.h>
18 /* FUNCTIONS *****************************************************************/
27 memset(Event
, 0, sizeof(*Event
));
33 IN PKSPIN_LOCK SpinLock
)
40 IN PKSPIN_LOCK SpinLock
)
47 IN ULONG MaxIncrement
,
48 IN ULONG MinIncrement
)
55 IN
struct _LOADER_PARAMETER_BLOCK
*LoaderBlock
,
56 IN PSTRING NtDeviceName
,
57 OUT PUCHAR NtSystemPath
,
58 OUT PSTRING NtSystemPathString
)
64 IoSetPartitionInformation(
65 IN PDEVICE_OBJECT DeviceObject
,
67 IN ULONG PartitionNumber
,
68 IN ULONG PartitionType
)
70 return STATUS_NOT_IMPLEMENTED
;
76 * IoReadPartitionTable(
77 * IN PDEVICE_OBJECT DeviceObject,
78 * IN ULONG SectorSize,
79 * IN BOOLEAN ReturnRecognizedPartitions,
80 * OUT PDRIVE_LAYOUT_INFORMATION *PartitionBuffer);
82 * See boot/freeldr/freeldr/disk/partition.c
87 IoWritePartitionTable(
88 IN PDEVICE_OBJECT DeviceObject
,
90 IN ULONG SectorsPerTrack
,
91 IN ULONG NumberOfHeads
,
92 IN PDRIVE_LAYOUT_INFORMATION PartitionBuffer
)
94 return STATUS_NOT_IMPLEMENTED
;
99 KeStallExecutionProcessor(
100 IN ULONG MicroSeconds
)
102 #if defined(_M_IX86) || defined(_M_AMD64)
107 // BIOS - WAIT (AT,PS)
110 // CX:DX = interval in microseconds
112 // CF clear if successful (wait interval elapsed)
113 // CF set on error or AH=83h wait already in progress
114 // AH = status (see #00496)
116 // Note: The resolution of the wait period is 977 microseconds on
117 // many systems because many BIOSes use the 1/1024 second fast
118 // interrupt from the AT real-time clock chip which is available on INT 70;
119 // because newer BIOSes may have much more precise timers available, it is
120 // not possible to use this function accurately for very short delays unless
121 // the precise behavior of the BIOS is known (or found through testing)
125 usec_this
= MicroSeconds
;
127 if (usec_this
> 4000000)
133 Regs
.w
.cx
= usec_this
>> 16;
134 Regs
.w
.dx
= usec_this
& 0xffff;
135 Int386(0x15, &Regs
, &Regs
);
137 MicroSeconds
-= usec_this
;