[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC V2 PATCH 07/11] hw/acpi: Add ACPI GED support for the sleep event
From: |
Annie Li |
Subject: |
[RFC V2 PATCH 07/11] hw/acpi: Add ACPI GED support for the sleep event |
Date: |
Fri, 27 Sep 2024 14:39:02 -0400 |
From: Miguel Luis <miguel.luis@oracle.com>
Add support for ACPI GED sleep event on the ACPI device interface so that
HW-reduced systems can enable guests to sleep.
Signed-off-by: Miguel Luis <miguel.luis@oracle.com>
---
hw/acpi/generic_event_device.c | 9 +++++++++
include/hw/acpi/generic_event_device.h | 1 +
2 files changed, 10 insertions(+)
diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c
index 15b4c3ebbf..934bc65476 100644
--- a/hw/acpi/generic_event_device.c
+++ b/hw/acpi/generic_event_device.c
@@ -13,6 +13,7 @@
#include "qapi/error.h"
#include "hw/acpi/acpi.h"
#include "hw/acpi/generic_event_device.h"
+#include "hw/acpi/control_method_device.h"
#include "hw/irq.h"
#include "hw/mem/pc-dimm.h"
#include "hw/mem/nvdimm.h"
@@ -26,6 +27,7 @@ static const uint32_t ged_supported_events[] = {
ACPI_GED_PWR_DOWN_EVT,
ACPI_GED_NVDIMM_HOTPLUG_EVT,
ACPI_GED_CPU_HOTPLUG_EVT,
+ ACPI_GED_SLEEP_EVT,
};
/*
@@ -121,6 +123,11 @@ void build_ged_aml(Aml *table, const char *name,
HotplugHandler *hotplug_dev,
aml_notify(aml_name("\\_SB.NVDR"),
aml_int(0x80)));
break;
+ case ACPI_GED_SLEEP_EVT:
+ aml_append(if_ctx,
+ aml_notify(aml_name(ACPI_SLEEP_BUTTON_DEVICE),
+ aml_int(0x80)));
+ break;
default:
/*
* Please make sure all the events in ged_supported_events[]
@@ -295,6 +302,8 @@ static void acpi_ged_send_event(AcpiDeviceIf *adev,
AcpiEventStatusBits ev)
sel = ACPI_GED_MEM_HOTPLUG_EVT;
} else if (ev & ACPI_POWER_DOWN_STATUS) {
sel = ACPI_GED_PWR_DOWN_EVT;
+ } else if (ev & ACPI_SLEEP_STATUS) {
+ sel = ACPI_GED_SLEEP_EVT;
} else if (ev & ACPI_NVDIMM_HOTPLUG_STATUS) {
sel = ACPI_GED_NVDIMM_HOTPLUG_EVT;
} else if (ev & ACPI_CPU_HOTPLUG_STATUS) {
diff --git a/include/hw/acpi/generic_event_device.h
b/include/hw/acpi/generic_event_device.h
index 40af3550b5..9d7496669a 100644
--- a/include/hw/acpi/generic_event_device.h
+++ b/include/hw/acpi/generic_event_device.h
@@ -98,6 +98,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(AcpiGedState, ACPI_GED)
#define ACPI_GED_PWR_DOWN_EVT 0x2
#define ACPI_GED_NVDIMM_HOTPLUG_EVT 0x4
#define ACPI_GED_CPU_HOTPLUG_EVT 0x8
+#define ACPI_GED_SLEEP_EVT 0x10
typedef struct GEDState {
MemoryRegion evt;
--
2.43.5
- [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button, Annie Li, 2024/09/27
- [RFC V2 PATCH 01/11] acpi: hmp/qmp: Add hmp/qmp support for system_sleep, Annie Li, 2024/09/27
- [RFC V2 PATCH 03/11] test/acpi: allow DSDT table changes, Annie Li, 2024/09/27
- [RFC V2 PATCH 04/11] acpi: Support Control Method sleep button for x86, Annie Li, 2024/09/27
- [RFC V2 PATCH 05/11] tests/acpi: Update DSDT tables for Control method sleep button, Annie Li, 2024/09/27
- [RFC V2 PATCH 02/11] acpi: Implement control method sleep button, Annie Li, 2024/09/27
- [RFC V2 PATCH 06/11] acpi: Send the GPE event of suspend and wakeup for x86, Annie Li, 2024/09/27
- [RFC V2 PATCH 07/11] hw/acpi: Add ACPI GED support for the sleep event,
Annie Li <=
- [RFC V2 PATCH 08/11] tests/acpi: allow FACP and DSDT table changes for arm/virt, Annie Li, 2024/09/27
- [RFC V2 PATCH 09/11] hw/arm: enable sleep support for arm/virt, Annie Li, 2024/09/27
- [RFC V2 PATCH 10/11] tests/acpi: Update FACP and DSDT tables for sleep button, Annie Li, 2024/09/27
- [RFC V2 PATCH 11/11] arm/virt: enable sleep support, Annie Li, 2024/09/27