summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/cell/spu
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-12-02 15:23:51 -0700
committerBrian <brian.paul@tungstengraphics.com>2007-12-02 15:23:51 -0700
commit88b715b049efa81f4021d642a963b58113a875cf (patch)
treeace902bbc0480836b8d1e17cfb37528c5715db0f /src/mesa/pipe/cell/spu
parent233c374d02a99ecd0c2ddc6f11f305ae8783fc97 (diff)
Initial Cell driver infrastructure.
No real code yet. Just stand-ins and make/build infrastructure.
Diffstat (limited to 'src/mesa/pipe/cell/spu')
-rw-r--r--src/mesa/pipe/cell/spu/Makefile42
-rw-r--r--src/mesa/pipe/cell/spu/main.c29
-rw-r--r--src/mesa/pipe/cell/spu/tri.c9
-rw-r--r--src/mesa/pipe/cell/spu/tri.h4
4 files changed, 84 insertions, 0 deletions
diff --git a/src/mesa/pipe/cell/spu/Makefile b/src/mesa/pipe/cell/spu/Makefile
new file mode 100644
index 0000000000..00f931e1c1
--- /dev/null
+++ b/src/mesa/pipe/cell/spu/Makefile
@@ -0,0 +1,42 @@
+# Gallium3D Cell driver: PPU code
+
+# This makefile builds the g3d_spu.a file that's linked into the
+# PPU code/library.
+
+
+TOP = ../../../../..
+include $(TOP)/configs/linux-cell
+
+
+PROG = g3d
+
+PROG_SPU = $(PROG)_spu
+PROG_SPU_A = $(PROG)_spu.a
+PROG_SPU_EMBED_O = $(PROG)_spu-embed.o
+
+
+SPU_OBJECTS = main.o tri.o
+
+
+# The .a file will be linked into the main/PPU executable
+default: $(PROG_SPU_A)
+
+$(PROG_SPU_A): $(PROG_SPU_EMBED_O)
+ $(SPU_AR) $(SPU_AR_FLAGS) $(PROG_SPU_A) $(PROG_SPU_EMBED_O)
+
+$(PROG_SPU_EMBED_O): $(PROG_SPU)
+ $(SPU_EMBED) $(SPU_EMBED_FLAGS) $(PROG_SPU) $(PROG_SPU) $(PROG_SPU_EMBED_O)
+
+$(PROG_SPU): $(SPU_OBJECTS)
+ $(SPU_CC) -o $(PROG_SPU) $(SPU_OBJECTS) $(SPU_LFLAGS)
+
+
+main.o: main.c
+ $(SPU_CC) $(SPU_CFLAGS) -c main.c
+
+tri.o: tri.c
+ $(SPU_CC) $(SPU_CFLAGS) -c tri.c
+
+
+clean:
+ rm -f *.o *.a *.d $(PROG_SPU)
diff --git a/src/mesa/pipe/cell/spu/main.c b/src/mesa/pipe/cell/spu/main.c
new file mode 100644
index 0000000000..e8d5fdccbf
--- /dev/null
+++ b/src/mesa/pipe/cell/spu/main.c
@@ -0,0 +1,29 @@
+/* main.c for cell SPU code */
+
+
+#include <stdio.h>
+#include <libmisc.h>
+#include <spu_mfcio.h>
+
+#include "tri.h"
+#include "pipe/cell/common.h"
+
+
+static struct init_info init;
+
+
+int
+main(unsigned long long speid,
+ unsigned long long argp,
+ unsigned long long envp)
+{
+ int tag = 0;
+
+ mfc_get(&init, (unsigned int) argp, sizeof(struct init_info), tag, 0, 0);
+
+ printf("Enter spu main(): init.foo=%d\n", init.foo);
+
+ draw_triangle(0, 1, 2);
+
+ return 0;
+}
diff --git a/src/mesa/pipe/cell/spu/tri.c b/src/mesa/pipe/cell/spu/tri.c
new file mode 100644
index 0000000000..949c3b4c8e
--- /dev/null
+++ b/src/mesa/pipe/cell/spu/tri.c
@@ -0,0 +1,9 @@
+
+#include "tri.h"
+
+void
+draw_triangle(int v1, int v2, int v3)
+{
+
+
+}
diff --git a/src/mesa/pipe/cell/spu/tri.h b/src/mesa/pipe/cell/spu/tri.h
new file mode 100644
index 0000000000..6a915de60d
--- /dev/null
+++ b/src/mesa/pipe/cell/spu/tri.h
@@ -0,0 +1,4 @@
+
+
+extern void
+draw_triangle(int v1, int v2, int v3);