https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bd5209d9f497e27a01337…
commit bd5209d9f497e27a013371778cef970017fe49c1
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Thu Jun 22 12:11:37 2023 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Jun 25 21:25:06 2023 +0200
[HALX86] These HalpNo* functions are actually _implemented_. Document their purpose.
Remove the misleading comment in HalpNoBusData().
Update the SAL annotations.
---
hal/halx86/include/bus.h | 13 ++++----
hal/halx86/legacy/bus/bushndlr.c | 66 +++++++++++++++++++++++++++-------------
sdk/include/ndk/haltypes.h | 10 +++---
3 files changed, 56 insertions(+), 33 deletions(-)
diff --git a/hal/halx86/include/bus.h b/hal/halx86/include/bus.h
index af61f0fa67c..0481ac3ce99 100644
--- a/hal/halx86/include/bus.h
+++ b/hal/halx86/include/bus.h
@@ -571,13 +571,12 @@ HaliReferenceHandlerForConfigSpace(
ULONG
NTAPI
HalpNoBusData(
- 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_ PVOID Buffer,
+ _In_ ULONG Offset,
+ _In_ ULONG Length);
ULONG
NTAPI
diff --git a/hal/halx86/legacy/bus/bushndlr.c b/hal/halx86/legacy/bus/bushndlr.c
index ba571f588aa..437b6e28a9e 100644
--- a/hal/halx86/legacy/bus/bushndlr.c
+++ b/hal/halx86/legacy/bus/bushndlr.c
@@ -103,42 +103,66 @@ HalpLookupHandler(IN PARRAY Array,
return Handler;
}
+/**
+ * @brief Handler for buses without configuration space.
+ **/
ULONG
NTAPI
-HalpNoBusData(IN PBUS_HANDLER BusHandler,
- IN PBUS_HANDLER RootHandler,
- IN ULONG SlotNumber,
- IN PVOID Buffer,
- IN ULONG Offset,
- IN ULONG Length)
+HalpNoBusData(
+ _In_ PBUS_HANDLER BusHandler,
+ _In_ PBUS_HANDLER RootHandler,
+ _In_ ULONG SlotNumber,
+ _In_ PVOID Buffer,
+ _In_ ULONG Offset,
+ _In_ ULONG Length)
{
- /* Not implemented */
- DPRINT1("STUB GetSetBusData\n");
+ DPRINT1("STUB GetSetBusData(Bus %x:%x.%x)\n",
+ BusHandler->InterfaceType,
+ BusHandler->ConfigurationType,
+ BusHandler->BusNumber);
+
+ /* Just return a dummy value */
return 0;
}
+/**
+ * @brief Handler for buses without configuration space.
+ **/
NTSTATUS
NTAPI
-HalpNoAdjustResourceList(IN PBUS_HANDLER BusHandler,
- IN PBUS_HANDLER RootHandler,
- IN OUT PIO_RESOURCE_REQUIREMENTS_LIST *pResourceList)
+HalpNoAdjustResourceList(
+ _In_ PBUS_HANDLER BusHandler,
+ _In_ PBUS_HANDLER RootHandler,
+ _Inout_ PIO_RESOURCE_REQUIREMENTS_LIST* pResourceList)
{
- DPRINT1("STUB Adjustment\n");
+ DPRINT1("STUB Adjustment(Bus %x:%x.%x)\n",
+ BusHandler->InterfaceType,
+ BusHandler->ConfigurationType,
+ BusHandler->BusNumber);
+
return STATUS_UNSUCCESSFUL;
}
+/**
+ * @brief Handler for buses without configuration space.
+ **/
NTSTATUS
NTAPI
-HalpNoAssignSlotResources(IN PBUS_HANDLER BusHandler,
- IN PBUS_HANDLER RootHandler,
- IN PUNICODE_STRING RegistryPath,
- IN PUNICODE_STRING DriverClassName OPTIONAL,
- IN PDRIVER_OBJECT DriverObject,
- IN PDEVICE_OBJECT DeviceObject OPTIONAL,
- IN ULONG SlotNumber,
- IN OUT PCM_RESOURCE_LIST *AllocatedResources)
+HalpNoAssignSlotResources(
+ _In_ PBUS_HANDLER BusHandler,
+ _In_ PBUS_HANDLER RootHandler,
+ _In_ PUNICODE_STRING RegistryPath,
+ _In_opt_ PUNICODE_STRING DriverClassName,
+ _In_ PDRIVER_OBJECT DriverObject,
+ _In_opt_ PDEVICE_OBJECT DeviceObject,
+ _In_ ULONG SlotNumber,
+ _Inout_ PCM_RESOURCE_LIST* AllocatedResources)
{
- DPRINT1("STUB Assignment\n");
+ DPRINT1("STUB Assignment(Bus %x:%x.%x)\n",
+ BusHandler->InterfaceType,
+ BusHandler->ConfigurationType,
+ BusHandler->BusNumber);
+
return STATUS_NOT_SUPPORTED;
}
diff --git a/sdk/include/ndk/haltypes.h b/sdk/include/ndk/haltypes.h
index e5f2edc48eb..8e850e11c0e 100644
--- a/sdk/include/ndk/haltypes.h
+++ b/sdk/include/ndk/haltypes.h
@@ -104,7 +104,7 @@ NTSTATUS
(NTAPI *PADJUSTRESOURCELIST)(
_In_ PBUS_HANDLER BusHandler,
_In_ PBUS_HANDLER RootHandler,
- _Inout_ PIO_RESOURCE_REQUIREMENTS_LIST *Resources
+ _Inout_ PIO_RESOURCE_REQUIREMENTS_LIST* pResourceList
);
typedef
@@ -113,11 +113,11 @@ NTSTATUS
_In_ PBUS_HANDLER BusHandler,
_In_ PBUS_HANDLER RootHandler,
_In_ PUNICODE_STRING RegistryPath,
- _In_ PUNICODE_STRING DriverClassName,
+ _In_opt_ PUNICODE_STRING DriverClassName,
_In_ PDRIVER_OBJECT DriverObject,
- _In_ PDEVICE_OBJECT DeviceObject,
+ _In_opt_ PDEVICE_OBJECT DeviceObject,
_In_ ULONG SlotNumber,
- _Inout_ PCM_RESOURCE_LIST *AllocatedResources
+ _Inout_ PCM_RESOURCE_LIST* AllocatedResources
);
typedef
@@ -126,7 +126,7 @@ ULONG
_In_ PBUS_HANDLER BusHandler,
_In_ PBUS_HANDLER RootHandler,
_In_ ULONG SlotNumber,
- _Out_ PVOID Buffer,
+ _In_ PVOID Buffer,
_In_ ULONG Offset,
_In_ ULONG Length
);