summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorDoug Gilbert <dgilbert@us.ibm.com>2012-11-21 17:36:02 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-12-14 10:46:50 -0600
commit468f784bbdb2176387a4f1f9ad3f0b10d15ad918 (patch)
tree7bfe554931935f1c0fe74914d1a44f229097afe5 /src/lib
parentdf8e246c1afd3c5e63a7cead8db40b7b0fc0837a (diff)
downloadtalos-hostboot-468f784bbdb2176387a4f1f9ad3f0b10d15ad918.tar.gz
talos-hostboot-468f784bbdb2176387a4f1f9ad3f0b10d15ad918.zip
Switch Interrupt Presenter to get ICPBAR value from an attribute
Change-Id: I5d95f3e3e2d803f07c7d8f3bf2d8ee522e1b4519 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2406 Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com> Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/syscall_msg.C105
1 files changed, 54 insertions, 51 deletions
diff --git a/src/lib/syscall_msg.C b/src/lib/syscall_msg.C
index b35f6eef1..907edf19a 100644
--- a/src/lib/syscall_msg.C
+++ b/src/lib/syscall_msg.C
@@ -1,30 +1,29 @@
-/* IBM_PROLOG_BEGIN_TAG
- * This is an automatically generated prolog.
- *
- * $Source: src/lib/syscall_msg.C $
- *
- * IBM CONFIDENTIAL
- *
- * COPYRIGHT International Business Machines Corp. 2010-2012
- *
- * 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_TAG
- */
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/lib/syscall_msg.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2010,2012 */
+/* */
+/* 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 otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
#include <sys/msg.h>
-#include <sys/interrupt.h>
#include <sys/syscall.h>
#include <sys/vfs.h>
+#include <errno.h>
#include <string.h>
@@ -44,30 +43,34 @@ int msg_q_register(msg_q_t q, const char* name)
{
if (0 == strcmp(VFS_ROOT, name))
{
- return (int64_t)_syscall2(MSGQ_REGISTER_ROOT,
- reinterpret_cast<void*>(MSGQ_ROOT_VFS),
- q);
- }
- else if (0 == strcmp(INTR_MSGQ, name))
- {
return (int64_t)_syscall2(MSGQ_REGISTER_ROOT,
- reinterpret_cast<void*>(MSGQ_ROOT_INTR),
+ reinterpret_cast<void*>(MSGQ_ROOT_VFS),
q);
}
else
{
- msg_q_t vfsQ = (msg_q_t)_syscall1(MSGQ_RESOLVE_ROOT,
- reinterpret_cast<void*>(MSGQ_ROOT_VFS));
- msg_t* msg = msg_allocate();
- msg->type = VFS_MSG_REGISTER_MSGQ;
- msg->data[0] = (uint64_t) q;
- msg->extra_data = (void*) name;
- int rc = msg_sendrecv(vfsQ, msg);
- msg_free(msg);
- return rc;
+ msg_q_t vfsQ = (msg_q_t)_syscall1(MSGQ_RESOLVE_ROOT,
+ reinterpret_cast<void*>(MSGQ_ROOT_VFS));
+ msg_t* msg = msg_allocate();
+ msg->type = VFS_MSG_REGISTER_MSGQ;
+ msg->data[0] = (uint64_t) q;
+ msg->extra_data = (void*) name;
+ int rc = msg_sendrecv(vfsQ, msg);
+ msg_free(msg);
+ return rc;
}
}
+int msg_intr_q_register(msg_q_t q, uint64_t i_ipc_base_addr)
+{
+ int rc = (int64_t)_syscall3(MSGQ_REGISTER_ROOT,
+ reinterpret_cast<void*>(MSGQ_ROOT_INTR),
+ q,
+ reinterpret_cast<void*>(i_ipc_base_addr));
+
+ return rc;
+}
+
int msg_q_remove(const char * name)
{
msg_q_t vfsQ = (msg_q_t)_syscall1(MSGQ_RESOLVE_ROOT,
@@ -85,25 +88,25 @@ msg_q_t msg_q_resolve(const char* name)
{
if (0 == strcmp(VFS_ROOT, name))
{
- return (msg_q_t)_syscall1(MSGQ_RESOLVE_ROOT,
+ return (msg_q_t)_syscall1(MSGQ_RESOLVE_ROOT,
reinterpret_cast<void*>(MSGQ_ROOT_VFS));
}
- else if (0 == strcmp(INTR_MSGQ, name))
+ else if (0 == strcmp(VFS_ROOT_MSG_INTR, name))
{
return (msg_q_t)_syscall1(MSGQ_RESOLVE_ROOT,
reinterpret_cast<void*>(MSGQ_ROOT_INTR));
}
else
{
- msg_q_t vfsQ = (msg_q_t)_syscall1(MSGQ_RESOLVE_ROOT,
- reinterpret_cast<void*>(MSGQ_ROOT_VFS));
- msg_t* msg = msg_allocate();
- msg->type = VFS_MSG_RESOLVE_MSGQ;
- msg->extra_data = (void*) name;
- msg_sendrecv(vfsQ, msg);
- msg_q_t rc = (msg_q_t) msg->data[0];
- msg_free(msg);
- return rc;
+ msg_q_t vfsQ = (msg_q_t)_syscall1(MSGQ_RESOLVE_ROOT,
+ reinterpret_cast<void*>(MSGQ_ROOT_VFS));
+ msg_t* msg = msg_allocate();
+ msg->type = VFS_MSG_RESOLVE_MSGQ;
+ msg->extra_data = (void*) name;
+ msg_sendrecv(vfsQ, msg);
+ msg_q_t rc = (msg_q_t) msg->data[0];
+ msg_free(msg);
+ return rc;
}
}
OpenPOWER on IntegriCloud