summaryrefslogtreecommitdiffstats
path: root/src/sys/vfs
diff options
context:
space:
mode:
authorDoug Gilbert <dgilbert@us.ibm.com>2012-06-14 15:23:25 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-07-09 13:41:04 -0500
commit434253f2763c99351a8c790f43704cca816ba442 (patch)
tree699483556d5c47a7cb21f87a721ce88ce3d1312b /src/sys/vfs
parente4a23b3b4b8a7906852a39f7fef202f04f374ce6 (diff)
downloadtalos-hostboot-434253f2763c99351a8c790f43704cca816ba442.tar.gz
talos-hostboot-434253f2763c99351a8c790f43704cca816ba442.zip
Mailbox additional error handling for Hardware errors and Invalid messages
RTC: 37990 Change-Id: I8378845ed412490a3bd214ac5198ea1fc9f19664 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1221 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/sys/vfs')
-rw-r--r--src/sys/vfs/vfs_main.C151
1 files changed, 86 insertions, 65 deletions
diff --git a/src/sys/vfs/vfs_main.C b/src/sys/vfs/vfs_main.C
index bc03d3c87..032a35c3f 100644
--- a/src/sys/vfs/vfs_main.C
+++ b/src/sys/vfs/vfs_main.C
@@ -1,25 +1,26 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/sys/vfs/vfs_main.C $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2010 - 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
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/sys/vfs/vfs_main.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
+ */
#include <string.h>
#include <errno.h>
@@ -76,46 +77,66 @@ void vfs_main(void* i_barrier)
while(1)
{
- msg_t* msg = msg_wait(vfsMsgQ);
-
- switch(msg->type)
- {
- case VFS_MSG_REGISTER_MSGQ:
- {
- VfsEntry* e = new VfsEntry();
- strcpy(e->key.key, (char*) msg->extra_data);
- e->msg_q = (msg_q_t) msg->data[0];
- vfsContents.insert(e);
-
- printkd("VFS: Registering %p as %s\n",
- e->msg_q, e->key.key);
- msg_respond(vfsMsgQ, msg);
- }
- break;
-
- case VFS_MSG_RESOLVE_MSGQ:
- {
- VfsEntry::key_type k;
- strcpy(k.key, (char*) msg->extra_data);
- VfsEntry* e = vfsContents.find(k);
- if (NULL == e)
- msg->data[0] = (uint64_t) NULL;
- else
- msg->data[0] = (uint64_t) e->msg_q;
- msg_respond(vfsMsgQ, msg);
- }
- break;
-
- case VFS_MSG_EXEC:
- {
- printkd("VFS: Got exec request of %s\n",
- (const char*)msg->data[0]);
-
- VfsSystemModule* module =
+ msg_t* msg = msg_wait(vfsMsgQ);
+
+ switch(msg->type)
+ {
+ case VFS_MSG_REGISTER_MSGQ:
+ {
+ VfsEntry* e = new VfsEntry();
+ strcpy(e->key.key, (char*) msg->extra_data);
+ e->msg_q = (msg_q_t) msg->data[0];
+ vfsContents.insert(e);
+
+ printkd("VFS: Registering %p as %s\n",
+ e->msg_q, e->key.key);
+ msg_respond(vfsMsgQ, msg);
+ }
+ break;
+
+ case VFS_MSG_REMOVE_MSGQ:
+ {
+ VfsEntry::key_type k;
+ strcpy(k.key, (char*) msg->extra_data);
+ VfsEntry* e = vfsContents.find(k);
+ if(NULL != e)
+ {
+ msg->data[0] = 0; //(uint64_t) e->msg_q;
+ printkd("VFS: Removing msg queue %s\n",e->key.key);
+ vfsContents.erase(e);
+ delete e;
+ }
+ else
+ {
+ msg->data[0] = (uint64_t) (-ENXIO);
+ }
+ msg_respond(vfsMsgQ, msg);
+ }
+ break;
+
+ case VFS_MSG_RESOLVE_MSGQ:
+ {
+ VfsEntry::key_type k;
+ strcpy(k.key, (char*) msg->extra_data);
+ VfsEntry* e = vfsContents.find(k);
+ if (NULL == e)
+ msg->data[0] = (uint64_t) NULL;
+ else
+ msg->data[0] = (uint64_t) e->msg_q;
+ msg_respond(vfsMsgQ, msg);
+ }
+ break;
+
+ case VFS_MSG_EXEC:
+ {
+ printkd("VFS: Got exec request of %s\n",
+ (const char*)msg->data[0]);
+
+ VfsSystemModule* module =
vfs_find_module(VFS_MODULES,
(const char *) msg->data[0]);
- void* fnptr = vfs_start_entrypoint(module);
+ void* fnptr = vfs_start_entrypoint(module);
// child == -ENOENT means module not found in base image
// so send a message to VFS_MSG queue to look in the
@@ -146,13 +167,13 @@ void vfs_main(void* i_barrier)
msg->data[0] = (uint64_t) fnptr;
msg_respond(vfsMsgQ, msg);
}
- }
- break;
+ }
+ break;
- default:
- msg_free(msg);
- break;
- }
+ default:
+ msg_free(msg);
+ break;
+ }
} // end while(1)
}
OpenPOWER on IntegriCloud