[Skiboot] [PATCH] slw: Use macros while handling opal_config_cpu_idle_state paramters

Shreyas B. Prabhu shreyas at linux.vnet.ibm.com
Tue Apr 14 12:17:34 AEST 2015


Use macros identical to ones used in the linux-kernel while handling
opal_config_cpu_idle_state parameters.

Signed-off-by: Shreyas B. Prabhu <shreyas at linux.vnet.ibm.com>
Cc: mpe at ellerman.id.au
Cc: stewart at linux.vnet.ibm.com
---
 hw/slw.c           | 6 +++---
 include/opal-api.h | 7 +++++++
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/hw/slw.c b/hw/slw.c
index 458560c..cf8faa6 100644
--- a/hw/slw.c
+++ b/hw/slw.c
@@ -1011,14 +1011,14 @@ static void fast_sleep_exit(void)
 static int64_t opal_config_cpu_idle_state(uint64_t state, uint64_t enter)
 {
 	/* Only fast-sleep for now */
-	if (state != 1)
+	if (state != OPAL_CONFIG_IDLE_FASTSLEEP)
 		return OPAL_PARAMETER;	
 
 	switch(enter) {
-	case 1:
+	case OPAL_CONFIG_IDLE_APPLY:
 		fast_sleep_enter();
 		break;
-	case 0:
+	case OPAL_CONFIG_IDLE_UNDO:
 		fast_sleep_exit();
 		break;
 	default:
diff --git a/include/opal-api.h b/include/opal-api.h
index 1698311..ebed1bc 100644
--- a/include/opal-api.h
+++ b/include/opal-api.h
@@ -173,6 +173,13 @@
 #define OPAL_PM_WINKLE_ENABLED		0x00040000
 #define OPAL_PM_SLEEP_ENABLED_ER1	0x00080000 /* with workaround */
 
+/*
+ * OPAL_CONFIG_CPU_IDLE_STATE parameters
+ */
+#define OPAL_CONFIG_IDLE_FASTSLEEP     1
+#define OPAL_CONFIG_IDLE_UNDO          0
+#define OPAL_CONFIG_IDLE_APPLY         1
+
 #ifndef __ASSEMBLY__
 
 /* Other enums */
-- 
1.9.3



More information about the Skiboot mailing list