Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi acpi: Add acpi_dsd_bool helper
details: https://anonhg.NetBSD.org/src/rev/7855a1b2d8d5
branches: trunk
changeset: 359552:7855a1b2d8d5
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sun Jan 09 14:28:23 2022 +0000
description:
acpi: Add acpi_dsd_bool helper
diffstat:
sys/dev/acpi/acpi_util.c | 17 +++++++++++++++--
sys/dev/acpi/acpi_util.h | 3 ++-
2 files changed, 17 insertions(+), 3 deletions(-)
diffs (55 lines):
diff -r fdfbf60b6020 -r 7855a1b2d8d5 sys/dev/acpi/acpi_util.c
--- a/sys/dev/acpi/acpi_util.c Sun Jan 09 14:06:00 2022 +0000
+++ b/sys/dev/acpi/acpi_util.c Sun Jan 09 14:28:23 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_util.c,v 1.29 2021/12/31 13:15:00 jmcneill Exp $ */
+/* $NetBSD: acpi_util.c,v 1.30 2022/01/09 14:28:23 jmcneill Exp $ */
/*-
* Copyright (c) 2003, 2007, 2021 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_util.c,v 1.29 2021/12/31 13:15:00 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_util.c,v 1.30 2022/01/09 14:28:23 jmcneill Exp $");
#include <sys/param.h>
#include <sys/kmem.h>
@@ -1018,6 +1018,19 @@
return rv;
}
+ACPI_STATUS
+acpi_dsd_bool(ACPI_HANDLE handle, const char *prop, bool *val)
+{
+ ACPI_STATUS rv;
+ ACPI_INTEGER ival;
+
+ rv = acpi_dsd_integer(handle, prop, &ival);
+ if (ACPI_SUCCESS(rv)) {
+ *val = ival != 0;
+ }
+
+ return rv;
+}
/*
diff -r fdfbf60b6020 -r 7855a1b2d8d5 sys/dev/acpi/acpi_util.h
--- a/sys/dev/acpi/acpi_util.h Sun Jan 09 14:06:00 2022 +0000
+++ b/sys/dev/acpi/acpi_util.h Sun Jan 09 14:28:23 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_util.h,v 1.11 2021/02/05 17:12:43 thorpej Exp $ */
+/* $NetBSD: acpi_util.h,v 1.12 2022/01/09 14:28:23 jmcneill Exp $ */
/*-
* Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -98,6 +98,7 @@
ACPI_STATUS acpi_dsd_integer(ACPI_HANDLE, const char *, ACPI_INTEGER *);
ACPI_STATUS acpi_dsd_string(ACPI_HANDLE, const char *, char **);
+ACPI_STATUS acpi_dsd_bool(ACPI_HANDLE, const char *, bool *);
ACPI_STATUS acpi_dsm(ACPI_HANDLE, uint8_t *, ACPI_INTEGER,
ACPI_INTEGER, const ACPI_OBJECT *, ACPI_OBJECT **);
Home |
Main Index |
Thread Index |
Old Index