aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2016-04-01 14:47:45 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-04-01 14:47:45 +1100
commita56b9aa8e654aa559538694dac539135b942f8e0 (patch)
tree3d58aba067705cc09728675bdc1cd0ef5bf1aba6 /core
parent53402d0f569506f2baf8b2820dc30691a0764833 (diff)
parentd597168a0ea6958955a2a2fc845354059fd057c2 (diff)
downloadskiboot-a56b9aa8e654aa559538694dac539135b942f8e0.zip
skiboot-a56b9aa8e654aa559538694dac539135b942f8e0.tar.gz
skiboot-a56b9aa8e654aa559538694dac539135b942f8e0.tar.bz2
Merge branch 'skiboot-5.2.x' - partial HMI
Diffstat (limited to 'core')
-rw-r--r--core/hmi.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/core/hmi.c b/core/hmi.c
index 5d8020a..1817ab1 100644
--- a/core/hmi.c
+++ b/core/hmi.c
@@ -219,7 +219,7 @@ static struct lock hmi_lock = LOCK_UNLOCKED;
static int queue_hmi_event(struct OpalHMIEvent *hmi_evt, int recover)
{
- uint64_t *hmi_data;
+ size_t num_params;
/* Don't queue up event if recover == -1 */
if (recover == -1)
@@ -232,16 +232,17 @@ static int queue_hmi_event(struct OpalHMIEvent *hmi_evt, int recover)
hmi_evt->disposition = OpalHMI_DISPOSITION_NOT_RECOVERED;
/*
- * V2 of struct OpalHMIEvent is of (4 * 64 bits) size and well packed
+ * V2 of struct OpalHMIEvent is of (5 * 64 bits) size and well packed
* structure. Hence use uint64_t pointer to pass entire structure
- * using 4 params in generic message format.
+ * using 5 params in generic message format. Instead of hard coding
+ * num_params divide the struct size by 8 bytes to get exact
+ * num_params value.
*/
- hmi_data = (uint64_t *)hmi_evt;
+ num_params = ALIGN_UP(sizeof(*hmi_evt), sizeof(u64)) / sizeof(u64);
/* queue up for delivery to host. */
- return opal_queue_msg(OPAL_MSG_HMI_EVT, NULL, NULL,
- hmi_data[0], hmi_data[1], hmi_data[2],
- hmi_data[3]);
+ return _opal_queue_msg(OPAL_MSG_HMI_EVT, NULL, NULL,
+ num_params, (uint64_t *)hmi_evt);
}
static int is_capp_recoverable(int chip_id)