[Cbe-oss-dev] [PATCH 2/2] libspe2: provide debugger hook for isolated load completion
Jeremy Kerr
jk at ozlabs.org
Fri Jul 6 17:21:44 EST 2007
The __spe_context_update_event function is used as a debugger hook, and
is called when regular SPE programs have sucessfully loaded. For
isolated loads, the PPE has no way of telling when the load has
completed.
With an updated loader (which stops with a stop-and-signal status of
0x2206), this patch connects the debugging hook to the completion of an
isolated load event.
Signed-off-by: Jeremy Kerr <jk at ozlabs.org>
---
spebase/run.c | 15 ++++++++++++---
spebase/spebase.h | 1 +
2 files changed, 13 insertions(+), 3 deletions(-)
Index: libspe2/spebase/run.c
===================================================================
--- libspe2.orig/spebase/run.c
+++ libspe2/spebase/run.c
@@ -310,9 +310,18 @@ do_run:
} else if ((stopcode & 0xfff0) == SPE_PROGRAM_ISOLATED_STOP) {
- stopinfo->stop_reason = SPE_ISOLATION_ERROR;
- stopinfo->result.spe_isolation_error = stopcode & 0xf;
- retval = -1;
+ /* 0x2206: isolated app has been loaded by loader;
+ * provide a hook for the debugger to catch this,
+ * and restart
+ */
+ if (stopcode == SPE_PROGRAM_ISO_LOAD_COMPLETE) {
+ __spe_context_update_event();
+ goto do_run;
+ } else {
+ stopinfo->stop_reason = SPE_ISOLATION_ERROR;
+ stopinfo->result.spe_isolation_error =
+ stopcode & 0xf;
+ }
} else if (spe->base_private->flags & SPE_ISOLATE &&
!(run_rc & 0x80)) {
Index: libspe2/spebase/spebase.h
===================================================================
--- libspe2.orig/spebase/spebase.h
+++ libspe2/spebase/spebase.h
@@ -129,6 +129,7 @@ struct spe_context_base_priv {
* Isolated exit codes: 0x220x
*/
#define SPE_PROGRAM_ISOLATED_STOP 0x2200
+#define SPE_PROGRAM_ISO_LOAD_COMPLETE 0x2206
/**
* spe_context: This holds the persistant information of a SPU instance
More information about the cbe-oss-dev
mailing list