From 9828310a1bba1c1c2dffa7ae8866b648e26c2039 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 11 Dec 2007 10:28:45 -0700 Subject: Collect some global vars in a single struct. --- src/mesa/pipe/cell/spu/main.c | 17 +++++++++++------ src/mesa/pipe/cell/spu/main.h | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'src/mesa/pipe/cell/spu') diff --git a/src/mesa/pipe/cell/spu/main.c b/src/mesa/pipe/cell/spu/main.c index 83880bc906..6a77e3e9fa 100644 --- a/src/mesa/pipe/cell/spu/main.c +++ b/src/mesa/pipe/cell/spu/main.c @@ -44,7 +44,7 @@ helpful headers: /opt/ibm/cell-sdk/prototype/sysroot/usr/include/libmisc.h */ -struct cell_init_info init; +volatile struct cell_init_info init; struct framebuffer fb; @@ -238,17 +238,21 @@ main_loop(void) +/** + * SPE entrypoint. + * Note: example programs declare params as 'unsigned long long' but + * that doesn't work. + */ int -main(unsigned long long speid, - unsigned long long argp, - unsigned long long envp) +main(unsigned long speid, unsigned long argp) { int tag = 0; + (void) speid; + DefaultTag = 1; - (void) speid; - (void) envp; + printf("SPU: main() speid=%lu\n", speid); mfc_get(&init, /* dest */ (unsigned int) argp, /* src */ @@ -258,6 +262,7 @@ main(unsigned long long speid, 0 /* rid */); wait_on_mask( 1 << tag ); + main_loop(); return 0; diff --git a/src/mesa/pipe/cell/spu/main.h b/src/mesa/pipe/cell/spu/main.h index 882be7f1c5..8c2796387f 100644 --- a/src/mesa/pipe/cell/spu/main.h +++ b/src/mesa/pipe/cell/spu/main.h @@ -34,7 +34,7 @@ #include "pipe/cell/common.h" -extern struct cell_init_info init; +extern volatile struct cell_init_info init; struct framebuffer { void *start; -- cgit v1.2.3