<br><tt><font size=2>libspe2: pass npc by value to callback handler<br>
<br>
The SPE npc value isn't updated by the callback code, so we don't need<br>
to pass a pointer to it to handle_library_callback.<br>
<br>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org><br>
Signed-off-by: Kanna Shimizu <kannas@us.ibm.com><br>
<br>
Index: libspe2/spebase/lib_builtin.c<br>
===================================================================<br>
--- libspe2.orig/spebase/lib_builtin.c<br>
+++ libspe2/spebase/lib_builtin.c<br>
@@ -135,7 +135,8 @@ int _base_spe_callback_handler_update(vo<br>
return
0;<br>
}<br>
<br>
-int handle_library_callback(struct spe_context * spe, int callnum, unsigned
int * npc)<br>
+int handle_library_callback(struct spe_context *spe, int callnum,<br>
+
unsigned
int npc)<br>
{<br>
int
(*handler)(void *, unsigned int);<br>
int
rc;<br>
@@ -149,7 +150,7 @@ int handle_library_callback(struct spe_c<br>
<br>
handler=handlers[callnum];<br>
<br>
-
rc = handler(spe->base_private->mem_mmap_base, *npc);<br>
+
rc = handler(spe->base_private->mem_mmap_base, npc);<br>
if
(rc) {<br>
DEBUG_PRINTF ("SPE library call unsupported.\n");<br>
errno=ENOSYS;<br>
Index: libspe2/spebase/lib_builtin.h<br>
===================================================================<br>
--- libspe2.orig/spebase/lib_builtin.h<br>
+++ libspe2/spebase/lib_builtin.h<br>
@@ -25,6 +25,7 @@<br>
#define MAX_CALLNUM 255<br>
#define RESERVED 4<br>
<br>
-extern int handle_library_callback(struct spe_context * spe, int callnum,
unsigned int * npc);<br>
+extern int handle_library_callback(struct spe_context *spe, int callnum,<br>
+
unsigned
int npc);<br>
<br>
#endif<br>
Index: libspe2/spebase/run.c<br>
===================================================================<br>
--- libspe2.orig/spebase/run.c<br>
+++ libspe2/spebase/run.c<br>
@@ -250,7 +250,7 @@ do_run:<br>
/*
execute library callback */<br>
DEBUG_PRINTF("SPE
library call: %d\n", callback_number);<br>
callback_rc
= handle_library_callback(spe,<br>
-
callback_number, entry);<br>
+
callback_number, *entry);<br>
<br>
if
(callback_rc) {<br>
/* library callback failed; set errno and<br>
</font></tt>