From f18958ffa2cfa4b8090ae3108e904c7ad8f322fd Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 11 Feb 2018 16:43:51 +0100 Subject: [PATCH] [NDK] Add BIOS call API for amd64 --- sdk/include/ndk/halfuncs.h | 47 ++++++++++++++++++++++++++++++++++++-- sdk/include/ndk/haltypes.h | 20 ++++++++++++++++ 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/sdk/include/ndk/halfuncs.h b/sdk/include/ndk/halfuncs.h index 03e869887a2..2086416f000 100644 --- a/sdk/include/ndk/halfuncs.h +++ b/sdk/include/ndk/halfuncs.h @@ -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 diff --git a/sdk/include/ndk/haltypes.h b/sdk/include/ndk/haltypes.h index d27581b83fc..125158b4210 100644 --- a/sdk/include/ndk/haltypes.h +++ b/sdk/include/ndk/haltypes.h @@ -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 -- 2.17.1