[NDK] Add BIOS call API for amd64
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 11 Feb 2018 15:43:51 +0000 (16:43 +0100)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 15 Aug 2019 12:13:54 +0000 (14:13 +0200)
sdk/include/ndk/halfuncs.h
sdk/include/ndk/haltypes.h

index 03e8698..2086416 100644 (file)
@@ -294,5 +294,48 @@ HalSetTimeIncrement(
     _In_ ULONG Increment
 );
 
-#endif
-#endif
+
+//
+// BIOS call API
+//
+#ifdef _M_AMD64
+
+NTSTATUS
+NTAPI
+x86BiosAllocateBuffer(
+    _In_ ULONG *Size,
+    _In_ USHORT *Segment,
+    _In_ USHORT *Offset);
+
+NTSTATUS
+NTAPI
+x86BiosFreeBuffer(
+    _In_ USHORT Segment,
+    _In_ USHORT Offset);
+
+NTSTATUS
+NTAPI
+x86BiosReadMemory(
+    _In_ USHORT Segment,
+    _In_ USHORT Offset,
+    _Out_writes_bytes_(Size) PVOID Buffer,
+    _In_ ULONG Size);
+
+NTSTATUS
+NTAPI
+x86BiosWriteMemory(
+    _In_ USHORT Segment,
+    _In_ USHORT Offset,
+    _In_reads_bytes_(Size) PVOID Buffer,
+    _In_ ULONG Size);
+
+BOOLEAN
+NTAPI
+x86BiosCall(
+    _In_ ULONG InterruptNumber,
+    _Inout_ PX86_BIOS_REGISTERS Registers);
+
+#endif // _M_AMD64
+
+#endif // NTOS_MODE_USER
+#endif // _HALFUNCS_H
index d27581b..125158b 100644 (file)
@@ -275,6 +275,26 @@ extern PUCHAR NTHALAPI KdComPortInUse;
 //
 #define HAL_IRQ_TRANSLATOR_VERSION 0x0
 
+//
+// BIOS call structure
+//
+#ifdef _M_AMD64
+
+typedef struct _X86_BIOS_REGISTERS
+{
+    ULONG Eax;
+    ULONG Ecx;
+    ULONG Edx;
+    ULONG Ebx;
+    ULONG Ebp;
+    ULONG Esi;
+    ULONG Edi;
+    USHORT SegDs;
+    USHORT SegEs;
+} X86_BIOS_REGISTERS, *PX86_BIOS_REGISTERS;
+
+#endif // _M_AMD64
+
 #endif
 #endif