Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163448610
D56803.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D56803.id.diff
View Options
diff --git a/sys/dev/acpica/acpi_spmc.c b/sys/dev/acpica/acpi_spmc.c
--- a/sys/dev/acpica/acpi_spmc.c
+++ b/sys/dev/acpica/acpi_spmc.c
@@ -34,6 +34,9 @@
NULL
};
+/* Conversion of an index to a mask. */
+#define IDX_TO_BIT(idx) (1ull << (idx))
+
enum intel_dsm_index {
DSM_ENUM_FUNCTIONS = 0,
DSM_GET_DEVICE_CONSTRAINTS = 1,
@@ -172,6 +175,12 @@
struct acpi_spmc_constraint *constraints;
};
+static bool
+supports_function(const struct dsm_desc *const dsm, const int function_index)
+{
+ return ((dsm->supported_functions & IDX_TO_BIT(function_index)) != 0);
+}
+
static bool
has_dsm(const struct acpi_spmc_softc *const sc, const int dsm_bit)
{
@@ -617,8 +626,7 @@
acpi_spmc_run_dsm(dev, &dsm_amd, AMD_DSM_EXIT_NOTIF);
if (has_dsm(sc, DSM_MS)) {
acpi_spmc_run_dsm(dev, &dsm_ms, DSM_EXIT_NOTIF);
- if (dsm_ms.supported_functions &
- (1 << DSM_MODERN_TURN_ON_DISPLAY))
+ if (supports_function(&dsm_ms, DSM_MODERN_TURN_ON_DISPLAY))
acpi_spmc_run_dsm(dev, &dsm_ms,
DSM_MODERN_TURN_ON_DISPLAY);
acpi_spmc_run_dsm(dev, &dsm_ms, DSM_MODERN_EXIT_NOTIF);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 24, 7:16 AM (10 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33015323
Default Alt Text
D56803.id.diff (1 KB)
Attached To
Mode
D56803: acpi_spmc(4): Introduce supports_function()
Attached
Detach File
Event Timeline
Log In to Comment