Here is the SPE code.
Code: Select all
int main(unsigned long long spe_id, unsigned long long)
{
ioutput(CALLTYPE_NORMAL, OUT_S|OUT_L|OUT_D, COLOR_NO_COLOR, "MD5 pack %d sent to SPE...", packnum);
start_md5_hash(xd, packnum);
return 0;
}
"The fourth and fifth arguments are argp and envp. These are used at SPE program startup to pass arguments and environment information to the SPE program (this is the same as the same parameters in libspe1's spe_create_thread)."
I found this from http://www.ibm.com/developerworks/library/pa-libspe2/
Unfortunately i'm still having difficulty as the (correct me if i'm wrong) example code doesn't pass anything to the spe:
Code: Select all
#include <sys/send_to_ppe.h>
/* Type declarations */
typedef unsigned int spe_offset_t;
typedef struct {
spe_offset_t str; /* Input param */
int length; /* Output param */
} my_strlen_param_t;
/* Function declarations */
int my_strlen(char *str);
/* Callback Stub */
int my_strlen(char *str) {
my_strlen_param_t params = { (spe_offset_t)str, 0 };
__send_to_ppe(0x2110, 0, ¶ms);
return params.length;
}
/* Example Usage */
int main(unsigned long long spe_id, unsigned long long argp, unsigned long long envp) {
char *my_str = "Hello there!";
printf("The length of '%s' is %d\n", my_str, my_strlen(my_str));
return 0;
}
Any help is appreciated. Thanks