184 Commits
Author SHA1 Message Date
Ahmed Arif 63deca5a96 [ACPI][UEFI] Use bootloader-provided ACPI root pointer in OSL (#8980)
Fix ACPI table discovery on the UEFI boot path by teaching the ACPI OSL
to use the loader-provided ACPI root table information instead of relying
only on legacy BIOS RSDP scanning:

- Build a synthetic RSDP from the ACPI BIOS configuration node
  populated by the bootloader
- Fallback to the old scan only if that data is unavailable
- Keep full 64-bit physical addresses when mapping ACPI tables
- Improve failure diagnostics if initialization still fails

This lets ACPICA initialize from the UEFI-provided RSDT/XSDT path.
CORE-11954

So QEMU Q35 on UEFI is now able to discover ACPI tables through the loader-
provided root table path, which fixes 0x7B INACCESSIBLE_BOOT_DEVICE bugcheck:

https://github.com/user-attachments/assets/25d4d9c9-4197-496b-84f9-e5642c65809d
2026-07-09 01:40:17 +03:00
Timo Kreuzer 151c67ebfc [ROSTESTS] Implement automatic test discovery
This uses the START_TEST macro to create test entries in a ".test" section in the binary.
2026-05-15 16:50:48 +00:00
Timo Kreuzer 1cf31524d5 [REACTOS] Stop using non-conforming swprintf / vswprintf
Use the underscored versions instead.
2026-05-07 06:27:58 +00:00
Justin Miller 20494b84ef [PCIX] PciComputeNewCurrentSettings skip CmResourceSharedDeviceExclusive (#8464) 2026-04-01 09:29:34 +00:00
Timo Kreuzer aa1cac9d22 [ACPI] Apply consistent indentation (tabs)
Fixes GCC 13 warning about misleading indentation.

C:/ReactOS/reactos/drivers/bus/acpi/busmgr/utils.c: In function 'acpi_evaluate_reference':
C:/ReactOS/reactos/drivers/bus/acpi/busmgr/utils.c:367:5: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
  367 |     if (buffer.Pointer)
      |     ^~
In file included from C:/ReactOS/reactos/drivers/bus/acpi/acpica/include/acpi.h:70,
                 from C:/ReactOS/reactos/drivers/bus/acpi/precomp.h:6,
                 from C:/ReactOS/reactos/drivers/bus/acpi/busmgr/utils.c:26:
C:/ReactOS/reactos/drivers/bus/acpi/acpica/include/acoutput.h:496:41: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  496 | #define return_ACPI_STATUS(s)           return(s)
      |                                         ^~~~~~
C:/ReactOS/reactos/drivers/bus/acpi/busmgr/utils.c:370:9: note: in expansion of macro 'return_ACPI_STATUS'
  370 |         return_ACPI_STATUS(status);
      |         ^~~~~~~~~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer f4436f549f [ACPICA][UDFS][BTRFS] Fix MSVC warning C4319
"warning C4319: '~': zero extending 'uint32_t' to 'uint64_t' of greater size"
Fixes build with VS 2026.
2025-11-26 21:39:16 +02:00
Justin MillerandStanislav Motylkov 18f9a03338 [PCIX] Fix a few easy bugs (#8443)
* [PCIX] Fix the weird text corruption in PciGetDescriptionMessage

* [PCIX] Return the buffer to the caller PciQueryBusInformation


Co-authored-by: Stanislav Motylkov <[email protected]>
2025-11-03 10:52:19 -08:00
8aab5a9b24 [ACPI_NEW] Minimal to build
Co-authored-by: Hermès BÉLUSCA - MAÏTO <[email protected]>
Co-authored-by: Dmitry Borisov <[email protected]>
2025-06-19 20:32:11 -07:00
Daniil Tatianin 156fead517 [ACPI_NEW] Import uACPI 2.1.1 2025-06-19 20:32:11 -07:00
Eric Kohl bec50f65f4 [ACPI] Report a docking device to the system 2025-06-08 16:47:45 +02:00
Timo Kreuzer e431470ff9 [REACTOS] Fix build with VS 17.14.2 / CL 19.44.35207.1 2025-05-31 09:51:33 +00:00
Dmitry Borisov 45b928f8bc [ACPI] Remove section assignment from IOCTL handlers (#7829)
Fix a bug introduced in 5070e8960a.

CORE-17256

- These handlers must be memory resident. Otherwise,
  this would cause a page fault that needs to be resolved.
  Low-level storage drivers could evaluate ACPI control
  methods while the device's IRP queue has been paused.

- Minor code enhancements.
2025-05-05 22:42:11 +02:00
Hermès Bélusca-Maïto 111c8cc62a [REACTOS] Usage improvements for some RtlFindMessage invocations (#6023)
Use `RT_MESSAGETABLE` and `MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL)`
instead of hardcoding their values.
2025-04-08 20:19:54 +02:00
Justin Miller a8da29e888 [ACPI] Move CMBATT and COMPBATT out of the acpi directory (#7599)
Move these out of ACPI in preparation for ACPI_NEW so they keep their juicy commit history.
Also both ACPIs can coexist for awhile as I don't see the old driver getting removed anytime soon.
2025-01-29 00:49:35 -08:00
George Bișoc a97fcf19ec [CMBATT] Minor improvements to estimated battery time code
- Declare CMBATT_DISCHARGE_TIME and CMBATT_CAPACITY_BOGUS constructs
- Determine if the battery was already discharging and if not, update the time when it's being discharged
- Fix the condition where it checks if the battery has been discharging for quite some time
- Default the time to BATTERY_UNKNOWN_TIME if querying the estimated battery time request fails or if the battery has just started discharging not over 15 seconds

CORE-18969
CORE-19452
2025-01-12 20:00:14 +01:00
George Bișoc 13b394c1a7 [COMPBATT] Document COMPBATT_BATTERY_DATA and COMPBATT_DEVICE_EXTENSION structures
CORE-18969
CORE-19452
CORE-19888
2025-01-08 23:20:09 +01:00
George Bișoc f58f37e944 [COMPBATT] Document the newly added code 2025-01-08 23:20:09 +01:00
George Bișoc 65b29fe533 [COMPBATT] Update the top headers and relicense the driver as MIT 2025-01-08 23:20:09 +01:00
George Bișoc c439c5849b [COMPBATT] Implement CompBattGetEstimatedTime 2025-01-08 23:20:08 +01:00
George Bișoc a6d4998c6c [COMPBATT] Implement CompBattQueryStatus and CompBattSetStatusNotify 2025-01-08 23:20:08 +01:00
George Bișoc ee9914c712 [COMPBATT] Implement the battery monitor IRP worker 2025-01-08 23:20:08 +01:00
George Bișoc 6a06db09ca [COMPBATT] Use FALSE for BOOLEANs on BatteryIoctl, not integers 2025-01-08 23:20:08 +01:00
George Bișoc c944116833 [COMPBATT] Use the allocated battery IRPs as tags when acquiring I/O remove lock 2025-01-08 23:20:07 +01:00
George Bișoc 95f062bf0d [COMPBATT] Use the documented debug switches
Use the debug switches that are documented and have a name rather than some cryptic values with no meaning or some shit.
2025-01-08 23:20:07 +01:00
George Bișoc c6bdbefdc4 [COMPBATT] Use the non-constant variant of UNICODE_STRING for the battery name 2025-01-08 23:20:07 +01:00
George Bișoc 28bb8c6ff7 [COMPBATT] Assign a memory allocation tag for the I/O remove lock
IoInitializeRemoveLock expects an allocation tag to be provided when it allocates debug data in the kernel.
Passing 0 leads to a bunch of ASSERTs in the kernel as such data is allocated by ExAllocatePoolWithTag of which a tag has to be supplied, it's not optional.
2025-01-08 23:20:07 +01:00
George Bișoc 3346301777 [COMPBATT] Pass NULL for the work item context, not 0
It expects an arbitrary pointer, do the right thing!
2025-01-08 23:20:06 +01:00
George Bișoc 8b5423aa60 [COMPBATT] Annotate all functions with SAL2 2025-01-08 23:20:06 +01:00
George Bișoc f9ea9220d8 [COMPBATT] Remove the useless WaitFlag field in the code which is never used 2025-01-08 23:20:06 +01:00
George Bișoc 04cd478035 [COMPBATT] Prepare the base foundation for the header file
- Introduce some new constructs
- Annotate the function prototypes with SAL2
- Re-structure & remove some useless fields in COMPBATT_DEVICE_EXTENSION and COMPBATT_BATTERY_DATA
2025-01-08 23:19:56 +01:00
Eric Kohl 5c4fcd99d6 [CMBATT] Fix two comments 2025-01-05 21:43:06 +01:00
George Bișoc faf6123150 [CMBATT] Implement support for the _BIX method
_BIX is basically _BIF but with more information added, such as cycle count, measurement capacity accuracy and whatnot.
Starting with ACPI 4.0 _BIF is rendered obsolete and as a matter of fact a lot of modern hardware fill their ACPI machine data to _BIX.

ReactOS must go forward and beyond, compatibility with _BIF is kept. NOTE that a machine can ONLY support one battery static information method!

CORE-18969
CORE-19452
2025-01-02 18:21:33 +01:00
George Bișoc f3dd15ad64 [CMBATT] Grab the design voltage after the BIF data gets copied
There was a risk of accessing invalid data as the design voltage was grabbed before the read BIF data was copied into the device extension.
2024-12-16 22:09:02 +01:00
George Bișoc ea8315ba56 [CMBATT] Convert power statistics from mAh to mWh
ReactOS (like any other OSes) expects power data to be represented in milliwatts per hour, not in milliamps per hour.
Currently CMBATT defaults the stats to unknown values, if that's the case, and there are a bunch of machines that do report their data from _BIF ACPI method in ampere.

CORE-18969
CORE-19452
2024-12-16 17:33:51 +01:00
Hervé Poussineau 2d3f3a1613 [COMPBATT] Use BATTERY_TAG_INVALID instead 0 when applicable 2024-11-20 21:47:13 +01:00
Hervé Poussineau 05ae94092e [COMPBATT] Free device-related memory only if we failed
Otherwise, we just inserted in the BatteryList this device, and we will
probably crash later when accessing it.
2024-11-20 21:47:13 +01:00
Hervé Poussineau 2323dbcb4f [COMPBATT] Keep incoming Status on unknown IOCTL 2024-11-20 21:47:13 +01:00
Hervé Poussineau 81860b482a [CMBATT] Fix battery Tag
0 (ie BATTERY_TAG_INVALID) is not a valid battery tag.
First battery must have a tag of 1.
2024-11-12 21:26:42 +01:00
Dmitry Borisov 10b08aa2bb [ISAPNP] Detect I/O ports at runtime (#7411)
Improve the driver's portability.
CORE-17977
2024-10-07 16:10:08 +02:00
Hervé Poussineau 30ac80f36b [CMBATT] Implement CmBattVerifyStaticInfo 2024-08-12 11:56:18 +02:00
Hervé Poussineau 2ff683fa33 [CMBATT] Remove useless fields in device extension
Information is already present in BifData, and those fields were never filled.
2024-08-12 11:56:18 +02:00
Hervé Poussineau 359e73d055 [CMBATT] Implement CmBattGetBifData/CmBattGetBstData 2024-08-12 11:56:18 +02:00
Dmitry Borisov fdc1d96dc1 [ISAPNP] Make sure that APCs are disabled before acquiring a lock
Note: We could just use a fast mutex instead
2024-08-03 17:08:44 +06:00
Dmitry Borisov 6091dde0d3 [ISAPNP] Improvements around hardware access helpers
- Reimplement WriteWord using the WriteByte helper.
- Remove inline qualifiers from the bus read and write functions.
  This code path is considered "cold" and using an inline for it is overkill.
- Don't apply the IRQL restrictions to our PnP state transition helpers.
  They are only called at IRQL below dispatch level.
2024-08-03 17:08:43 +06:00
Dmitry Borisov 2981e63a31 [ISAPNP] Refactor the configuration code
- Remove useless checks
- Increase code readability
2024-08-03 17:08:43 +06:00
Dmitry Borisov 76ec8411a4 [ISAPNP] Fix parsing of complex resource data
- Properly handle the case when the dependent function is placed
  after fixed resources
- Initialize the version and revision fields of resource lists
- Improve validation of resource data
- Add more debug prints

CORE-18562
2024-08-03 17:08:43 +06:00
Dmitry Borisov c1d7087352 [ISAPNP] Fix the reported length of the memory I/O ranges
CORE-18562
2024-08-03 17:08:43 +06:00
Dmitry Borisov 9b7f34601a [ISAPNP] Force clear the upper reserved bits on fixed I/O descriptors
CORE-18562
2024-08-03 17:08:43 +06:00
Dmitry Borisov 991dbeff53 [ISAPNP] Fix the truncation of 32-bit configuration I/O reads
CORE-18562
2024-08-03 17:08:43 +06:00
Dmitry Borisov b36d9bd9c1 [ISAPNP_UNITTEST] Add unit tests exercising device discovery and device resources functionality
CORE-18562
2024-08-03 17:08:43 +06:00