summaryrefslogtreecommitdiffstats
path: root/src/include/kernel/intmsghandler.H
diff options
context:
space:
mode:
authorDoug Gilbert <dgilbert@us.ibm.com>2011-11-04 12:12:01 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-01-05 11:06:04 -0600
commit7de0708eac63bb81786c2a5e794c5d6fbef069c4 (patch)
treeb47aeb4c9827851d61b44d5cb922704f73257693 /src/include/kernel/intmsghandler.H
parent048789fdce6b406de3b7149f8171afd63eea1829 (diff)
downloadtalos-hostboot-7de0708eac63bb81786c2a5e794c5d6fbef069c4.tar.gz
talos-hostboot-7de0708eac63bb81786c2a5e794c5d6fbef069c4.zip
Interrupt presenter implementation
Change-Id: If6b499d819b71298b8a64e096e1eb83c639ad645 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/517 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/kernel/intmsghandler.H')
-rw-r--r--src/include/kernel/intmsghandler.H99
1 files changed, 99 insertions, 0 deletions
diff --git a/src/include/kernel/intmsghandler.H b/src/include/kernel/intmsghandler.H
new file mode 100644
index 000000000..52eadde27
--- /dev/null
+++ b/src/include/kernel/intmsghandler.H
@@ -0,0 +1,99 @@
+// IBM_PROLOG_BEGIN_TAG
+// This is an automatically generated prolog.
+//
+// $Source: src/include/kernel/intmsghandler.H $
+//
+// IBM CONFIDENTIAL
+//
+// COPYRIGHT International Business Machines Corp. 2011
+//
+// p1
+//
+// Object Code Only (OCO) source materials
+// Licensed Internal Code Source Materials
+// IBM HostBoot Licensed Internal Code
+//
+// The source code for this program is not published or other-
+// wise divested of its trade secrets, irrespective of what has
+// been deposited with the U.S. Copyright Office.
+//
+// Origin: 30
+//
+// IBM_PROLOG_END
+#ifndef __KERNEL_INTERRUPTMSGHDLR_H
+#define __KERNEL_INTERRUPTMSGHDLR_H
+
+#include <stdint.h>
+#include <kernel/types.h>
+#include <kernel/msghandler.H>
+#include <kernel/msg.H>
+
+/**
+ * @class InterruptMsgHdlr
+ * @brief Class to handle sending a message to user space for
+ * an External Interrupt.
+ *
+ * This class extends from the base MessageHandler so the base send/receive
+ * message functions can be utilized. It overrides how to handle the message
+ * responses
+ */
+class InterruptMsgHdlr : public MessageHandler
+{
+ public:
+
+ // Notes:
+ // All external interrupts are routed to one cpu core
+ // External Interrupts are only processed one at a time
+ // So we don't need a spinlock
+ /**
+ * Constructor
+ */
+ InterruptMsgHdlr(MessageQueue * i_msgQ)
+ : MessageHandler(NULL,i_msgQ) {} // TODO need splinlock?
+
+ /**
+ * Destructor.
+ */
+ virtual ~InterruptMsgHdlr() {};
+
+ /**
+ * Handle response to 'send message'
+ *
+ * @param[in] i_type - The message type previously sent.
+ * @param[in] i_key - The key value for the received message.
+ * @param[in] i_task - The deferred task.
+ * @param[in] i_rc - The response rc from userspace.
+ *
+ * @return HandleResult - The desired behavior on the 'recv message'
+ * interface for this <key, task> pair.
+ */
+ virtual HandleResult handleResponse(msg_sys_types_t i_type,void* i_key,
+ task_t* i_task,int i_rc);
+
+
+ /**
+ * Create the InterruptMsgHdlr to handle external interrupts
+ * @param[in] i_msgQ The message queue
+ */
+ static void create(MessageQueue * i_msgQ);
+
+ /**
+ * Handle an external interrupt from HW
+ */
+ static void handleInterrupt();
+
+ /**
+ * Add cpu core - set up the external interrupt registers
+ * @param[in] i_pir The cpu id of the core to to set-up
+ * @note should be called when ever a new core becomes active
+ */
+ static void addCpuCore(uint64_t i_pir);
+
+ private:
+
+ static InterruptMsgHdlr * cv_instance;
+};
+
+
+#endif
+
OpenPOWER on IntegriCloud