[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 05/12] spapr_pci: add get/set-power-level RTAS interfa
From: |
Michael Roth |
Subject: |
[Qemu-ppc] [PATCH 05/12] spapr_pci: add get/set-power-level RTAS interfaces |
Date: |
Mon, 18 Aug 2014 19:21:51 -0500 |
From: Nathan Fontenot <address@hidden>
Signed-off-by: Nathan Fontenot <address@hidden>
Signed-off-by: Michael Roth <address@hidden>
---
hw/ppc/spapr_pci.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 23a3477..f007dd6 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -511,6 +511,27 @@ static void rtas_set_indicator(PowerPCCPU *cpu,
sPAPREnvironment *spapr,
rtas_st(rets, 0, RTAS_OUT_SUCCESS);
}
+static void rtas_set_power_level(PowerPCCPU *cpu, sPAPREnvironment *spapr,
+ uint32_t token, uint32_t nargs,
+ target_ulong args, uint32_t nret,
+ target_ulong rets)
+{
+ /* we currently only use a single, "live insert" powerdomain for
+ * hotplugged/dlpar'd resources, so the power is always live/full (100)
+ */
+ rtas_st(rets, 0, RTAS_OUT_SUCCESS);
+ rtas_st(rets, 1, 100);
+}
+
+static void rtas_get_power_level(PowerPCCPU *cpu, sPAPREnvironment *spapr,
+ uint32_t token, uint32_t nargs,
+ target_ulong args, uint32_t nret,
+ target_ulong rets)
+{
+ rtas_st(rets, 0, RTAS_OUT_SUCCESS);
+ rtas_st(rets, 1, 100);
+}
+
static int pci_spapr_swizzle(int slot, int pin)
{
return (slot + pin) % PCI_NUM_PINS;
@@ -1175,6 +1196,10 @@ void spapr_pci_rtas_init(void)
}
spapr_rtas_register(RTAS_SET_INDICATOR, "set-indicator",
rtas_set_indicator);
+ spapr_rtas_register(RTAS_SET_POWER_LEVEL, "set-power-level",
+ rtas_set_power_level);
+ spapr_rtas_register(RTAS_GET_POWER_LEVEL, "get-power-level",
+ rtas_get_power_level);
}
static void spapr_pci_register_types(void)
--
1.9.1
- [Qemu-ppc] [PATCH 03/12] spapr: add helper to retrieve a PHB/device DrcEntry, (continued)
[Qemu-ppc] [PATCH 05/12] spapr_pci: add get/set-power-level RTAS interfaces,
Michael Roth <=
[Qemu-ppc] [PATCH 07/12] spapr_pci: add ibm, configure-connector RTAS interface, Michael Roth, 2014/08/18
[Qemu-ppc] [PATCH 12/12] spapr_pci: emit hotplug add/remove events during hotplug, Michael Roth, 2014/08/18
[Qemu-ppc] [PATCH 11/12] spapr_events: event-scan RTAS interface, Michael Roth, 2014/08/18
[Qemu-ppc] [PATCH 09/12] spapr_pci: enable basic hotplug operations, Michael Roth, 2014/08/18