[HALX86] Implement HalpcGetCmosData and HalpcSetCmosData.

This commit is contained in:
Hermès Bélusca-Maïto 2023-06-19 17:51:31 +02:00
parent 0c16bcd4e8
commit 7e1510eb9c
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
3 changed files with 60 additions and 50 deletions

View file

@ -101,10 +101,11 @@ HalpGetCmosData(
ULONG
NTAPI
HalpSetCmosData(IN ULONG BusNumber,
IN ULONG SlotNumber,
IN PVOID Buffer,
IN ULONG Length)
HalpSetCmosData(
_In_ ULONG BusNumber,
_In_ ULONG SlotNumber,
_In_reads_bytes_(Length) PVOID Buffer,
_In_ ULONG Length)
{
PUCHAR Ptr = (PUCHAR)Buffer;
ULONG Address = SlotNumber;

View file

@ -427,17 +427,15 @@ HalpGetCmosData(
_In_ ULONG BusNumber,
_In_ ULONG SlotNumber,
_Out_writes_bytes_(Length) PVOID Buffer,
_In_ ULONG Length
);
_In_ ULONG Length);
ULONG
NTAPI
HalpSetCmosData(
IN ULONG BusNumber,
IN ULONG SlotNumber,
IN PVOID Buffer,
IN ULONG Length
);
_In_ ULONG BusNumber,
_In_ ULONG SlotNumber,
_In_reads_bytes_(Length) PVOID Buffer,
_In_ ULONG Length);
CODE_SEG("INIT")
VOID
@ -584,24 +582,22 @@ HalpNoBusData(
ULONG
NTAPI
HalpcGetCmosData(
IN PBUS_HANDLER BusHandler,
IN PBUS_HANDLER RootHandler,
IN ULONG SlotNumber,
IN PVOID Buffer,
IN ULONG Offset,
IN ULONG Length
);
_In_ PBUS_HANDLER BusHandler,
_In_ PBUS_HANDLER RootHandler,
_In_ ULONG SlotNumber,
_Out_writes_bytes_(Length) PVOID Buffer,
_In_ ULONG Offset,
_In_ ULONG Length);
ULONG
NTAPI
HalpcSetCmosData(
IN PBUS_HANDLER BusHandler,
IN PBUS_HANDLER RootHandler,
IN ULONG SlotNumber,
IN PVOID Buffer,
IN ULONG Offset,
IN ULONG Length
);
_In_ PBUS_HANDLER BusHandler,
_In_ PBUS_HANDLER RootHandler,
_In_ ULONG SlotNumber,
_In_reads_bytes_(Length) PVOID Buffer,
_In_ ULONG Offset,
_In_ ULONG Length);
BOOLEAN
NTAPI

View file

@ -1,45 +1,58 @@
/*
* PROJECT: ReactOS HAL
* LICENSE: GPL - See COPYING in the top level directory
* FILE: hal/halx86/legacy/bus/cmosbus.c
* PURPOSE:
* PROGRAMMERS: Stefan Ginsberg (stefan.ginsberg@reactos.org)
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: CMOS bus data handlers
* COPYRIGHT: Copyright 2023 Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
*/
/* INCLUDES *******************************************************************/
#include <hal.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* PRIVATE FUNCTIONS **********************************************************/
ULONG
NTAPI
HalpcGetCmosData(IN PBUS_HANDLER BusHandler,
IN PBUS_HANDLER RootHandler,
IN ULONG SlotNumber,
IN PVOID Buffer,
IN ULONG Offset,
IN ULONG Length)
HalpcGetCmosData(
_In_ PBUS_HANDLER BusHandler,
_In_ PBUS_HANDLER RootHandler,
_In_ ULONG SlotNumber,
_Out_writes_bytes_(Length) PVOID Buffer,
_In_ ULONG Offset,
_In_ ULONG Length)
{
UNIMPLEMENTED_DBGBREAK("CMOS GetData\n");
UNREFERENCED_PARAMETER(RootHandler);
/* CMOS reads do not support offsets */
if (Offset != 0)
return 0;
return HalpGetCmosData(BusHandler->BusNumber,
SlotNumber,
Buffer,
Length);
}
ULONG
NTAPI
HalpcSetCmosData(IN PBUS_HANDLER BusHandler,
IN PBUS_HANDLER RootHandler,
IN ULONG SlotNumber,
IN PVOID Buffer,
IN ULONG Offset,
IN ULONG Length)
HalpcSetCmosData(
_In_ PBUS_HANDLER BusHandler,
_In_ PBUS_HANDLER RootHandler,
_In_ ULONG SlotNumber,
_In_reads_bytes_(Length) PVOID Buffer,
_In_ ULONG Offset,
_In_ ULONG Length)
{
UNIMPLEMENTED_DBGBREAK("CMOS SetData\n");
UNREFERENCED_PARAMETER(RootHandler);
/* CMOS writes do not support offsets */
if (Offset != 0)
return 0;
return HalpSetCmosData(BusHandler->BusNumber,
SlotNumber,
Buffer,
Length);
}
/* EOF */