From 89745fe4721df317d2efeb10ff19b902303da9bd Mon Sep 17 00:00:00 2001 From: "Najumon B.A" Date: Fri, 2 Feb 2024 19:15:31 +0530 Subject: [PATCH] lib: acpi: update shell and test app with the modifed resource struct update shell and test app with the modifed resource struct such as acpi_irq_resource and acpi_mmio_resource Signed-off-by: Najumon B.A --- lib/acpi/acpi_shell.c | 6 ++++++ tests/lib/acpi/integration/src/main.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/lib/acpi/acpi_shell.c b/lib/acpi/acpi_shell.c index aae237232d..e8981e2c4a 100644 --- a/lib/acpi/acpi_shell.c +++ b/lib/acpi/acpi_shell.c @@ -279,6 +279,8 @@ static int get_acpi_dev_resource(const struct shell *sh, size_t argc, char **arg struct acpi_dev *dev; struct acpi_irq_resource irq_res; struct acpi_mmio_resource mmio_res; + uint16_t irqs[CONFIG_ACPI_IRQ_VECTOR_MAX]; + struct acpi_reg_base reg_base[CONFIG_ACPI_MMIO_ENTRIES_MAX]; if (argc < 3) { return -EINVAL; @@ -293,6 +295,8 @@ static int get_acpi_dev_resource(const struct shell *sh, size_t argc, char **arg if (dev->path) { shell_print(sh, "Device Path: %s", dev->path); + mmio_res.mmio_max = ARRAY_SIZE(reg_base); + mmio_res.reg_base = reg_base; if (!acpi_device_mmio_get(dev, &mmio_res)) { shell_print(sh, "Device MMIO resources"); @@ -304,6 +308,8 @@ static int get_acpi_dev_resource(const struct shell *sh, size_t argc, char **arg } } + irq_res.irq_vector_max = ARRAY_SIZE(irqs); + irq_res.irqs = irqs; if (!acpi_device_irq_get(dev, &irq_res)) { shell_print(sh, "Device IRQ resources"); diff --git a/tests/lib/acpi/integration/src/main.c b/tests/lib/acpi/integration/src/main.c index 3b1dab9cae..04b376bf3d 100644 --- a/tests/lib/acpi/integration/src/main.c +++ b/tests/lib/acpi/integration/src/main.c @@ -49,6 +49,8 @@ ZTEST(acpi, test_resource_enum) struct acpi_dev *dev; struct acpi_irq_resource irq_res; struct acpi_mmio_resource mmio_res; + uint16_t irqs[CONFIG_ACPI_IRQ_VECTOR_MAX]; + struct acpi_reg_base reg_base[CONFIG_ACPI_MMIO_ENTRIES_MAX]; int ret; Z_TEST_SKIP_IFNDEF(APCI_TEST_DEV); @@ -57,10 +59,14 @@ ZTEST(acpi, test_resource_enum) zassert_not_null(dev, "Failed to get acpi device with given HID"); + mmio_res.mmio_max = ARRAY_SIZE(reg_base); + mmio_res.reg_base = reg_base; ret = acpi_device_mmio_get(dev, &mmio_res); zassert_ok(ret, "Failed to get MMIO resources"); + irq_res.irq_vector_max = ARRAY_SIZE(irqs); + irq_res.irqs = irqs; ret = acpi_device_irq_get(dev, &irq_res); zassert_ok(ret, "Failed to get IRQ resources");