xref: /reactos/hal/halx86/legacy/bus/cmosbus.c (revision 7e1510eb)
1 /*
2  * PROJECT:     ReactOS HAL
3  * LICENSE:     GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE:     CMOS bus data handlers
5  * COPYRIGHT:   Copyright 2023 Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
6  */
7 
8 /* INCLUDES *******************************************************************/
9 
10 #include <hal.h>
11 
12 /* PRIVATE FUNCTIONS **********************************************************/
13 
14 ULONG
15 NTAPI
HalpcGetCmosData(_In_ PBUS_HANDLER BusHandler,_In_ PBUS_HANDLER RootHandler,_In_ ULONG SlotNumber,_Out_writes_bytes_ (Length)PVOID Buffer,_In_ ULONG Offset,_In_ ULONG Length)16 HalpcGetCmosData(
17     _In_ PBUS_HANDLER BusHandler,
18     _In_ PBUS_HANDLER RootHandler,
19     _In_ ULONG SlotNumber,
20     _Out_writes_bytes_(Length) PVOID Buffer,
21     _In_ ULONG Offset,
22     _In_ ULONG Length)
23 {
24     UNREFERENCED_PARAMETER(RootHandler);
25 
26     /* CMOS reads do not support offsets */
27     if (Offset != 0)
28         return 0;
29 
30     return HalpGetCmosData(BusHandler->BusNumber,
31                            SlotNumber,
32                            Buffer,
33                            Length);
34 }
35 
36 ULONG
37 NTAPI
HalpcSetCmosData(_In_ PBUS_HANDLER BusHandler,_In_ PBUS_HANDLER RootHandler,_In_ ULONG SlotNumber,_In_reads_bytes_ (Length)PVOID Buffer,_In_ ULONG Offset,_In_ ULONG Length)38 HalpcSetCmosData(
39     _In_ PBUS_HANDLER BusHandler,
40     _In_ PBUS_HANDLER RootHandler,
41     _In_ ULONG SlotNumber,
42     _In_reads_bytes_(Length) PVOID Buffer,
43     _In_ ULONG Offset,
44     _In_ ULONG Length)
45 {
46     UNREFERENCED_PARAMETER(RootHandler);
47 
48     /* CMOS writes do not support offsets */
49     if (Offset != 0)
50         return 0;
51 
52     return HalpSetCmosData(BusHandler->BusNumber,
53                            SlotNumber,
54                            Buffer,
55                            Length);
56 }
57 
58 /* EOF */
59