1 --- libspe2-2.3.0.old/spebase/run.c 2008-10-28 14:43:09.000000000 +0100
2 +++ libspe2-2.3.0/spebase/run.c 2008-10-28 14:44:07.000000000 +0100
8 /*Thread-local variable for use by the debugger*/
9 __thread struct spe_context_info {
13 struct spe_context_info *prev;
14 }*__spe_current_active_context;
19 static void cleanupspeinfo(struct spe_context_info *ctxinfo)
21 struct spe_context_info *tmp = ctxinfo->prev;
22 __spe_current_active_context = tmp;
26 static int issue_isolated_exit(struct spe_context *spe)
33 static inline void freespeinfo()
35 /*Clean up the debug variable*/
36 struct spe_context_info *tmp = __spe_current_active_context->prev;
37 __spe_current_active_context = tmp;
41 int _base_spe_context_run(spe_context_ptr_t spe, unsigned int *entry,
42 unsigned int runflags, void *argp, void *envp,
44 int retval = 0, run_rc;
45 unsigned int run_status, tmp_entry;
46 spe_stop_info_t stopinfo_buf;
48 struct spe_context_info this_context_info __attribute__((cleanup(cleanupspeinfo)));
51 /* If the caller hasn't set a stopinfo buffer, provide a buffer on the
58 /*Leave a trail of breadcrumbs for the debugger to follow */
59 if (!__spe_current_active_context) {
60 __spe_current_active_context = &this_context_info;
63 /*remember the ls-addr*/
64 __spe_current_active_context->spe_id = spe->base_private->fd_spe_dir;
69 /*Remember the npc value*/
70 __spe_current_active_context->npc = tmp_entry;
74 run_rc = spu_run(spe->base_private->fd_spe_dir,
75 &tmp_entry, &run_status);
78 /*Remember the npc value*/
79 __spe_current_active_context->npc = tmp_entry;
80 __spe_current_active_context->status = run_status;
83 DEBUG_PRINTF("spu_run returned run_rc=0x%08x, entry=0x%04x, "
84 "ext_status=0x%04x.\n", run_rc, tmp_entry, run_status);