Index: arch/ppc32/Makefile.inc
===================================================================
--- arch/ppc32/Makefile.inc	(revision d9e11ff2ca99628fcd951c1b400d7056854f195b)
+++ arch/ppc32/Makefile.inc	(revision 8b1439e8e30b99c70043159c1395344827b7e749)
@@ -64,4 +64,6 @@
 	arch/$(ARCH)/src/asm.S \
 	arch/$(ARCH)/src/cpu/cpu.c \
+	arch/$(ARCH)/src/proc/scheduler.c \
+	arch/$(ARCH)/src/drivers/cuda.c \
 	arch/$(ARCH)/src/mm/as.c \
 	arch/$(ARCH)/src/mm/frame.c \
Index: arch/ppc32/include/asm.h
===================================================================
--- arch/ppc32/include/asm.h	(revision d9e11ff2ca99628fcd951c1b400d7056854f195b)
+++ arch/ppc32/include/asm.h	(revision 8b1439e8e30b99c70043159c1395344827b7e749)
@@ -47,5 +47,5 @@
 		"mfmsr %0\n"
 		"mfmsr %1\n"
-		"ori %1, %1, 1 << 15\n"
+//		"ori %1, %1, 1 << 15\n"
 		"mtmsr %1\n"
 		: "=r" (v), "=r" (tmp)
Index: arch/ppc32/include/drivers/cuda.h
===================================================================
--- arch/ppc32/include/drivers/cuda.h	(revision 8b1439e8e30b99c70043159c1395344827b7e749)
+++ arch/ppc32/include/drivers/cuda.h	(revision 8b1439e8e30b99c70043159c1395344827b7e749)
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2006 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __CUDA_H__
+#define __CUDA_H__
+
+
+#endif
Index: arch/ppc32/src/asm.S
===================================================================
--- arch/ppc32/src/asm.S	(revision d9e11ff2ca99628fcd951c1b400d7056854f195b)
+++ arch/ppc32/src/asm.S	(revision 8b1439e8e30b99c70043159c1395344827b7e749)
@@ -31,11 +31,7 @@
 .text
 
-.global cpu_halt
 .global cpu_sleep
 .global memsetb
 .global memcpy
-
-cpu_halt:
-	b cpu_halt
 
 cpu_sleep:
Index: arch/ppc32/src/drivers/cuda.c
===================================================================
--- arch/ppc32/src/drivers/cuda.c	(revision 8b1439e8e30b99c70043159c1395344827b7e749)
+++ arch/ppc32/src/drivers/cuda.c	(revision 8b1439e8e30b99c70043159c1395344827b7e749)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2006 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <arch/drivers/cuda.h>
+#include <arch/asm.h>
+
+#define CUDA_PACKET 0x01
+#define CUDA_POWERDOWN 0x0a
+
+#define RS 0x200
+#define B (0 * RS)
+#define A (1 * RS)
+#define SR (10 * RS)
+#define ACR (11 * RS)
+
+#define SR_OUT 0x10
+#define TACK 0x10
+#define TIP 0x20
+
+
+static volatile __u8 *cuda = (__u8 *) 0xf2000000;
+
+
+static void cuda_packet(const __u8 data)
+{
+	cuda[B] = cuda[B] | TIP;
+	cuda[ACR] = cuda[ACR] | SR_OUT;
+	cuda[SR] = CUDA_PACKET;
+	cuda[B] = cuda[B] & ~TIP;
+	
+	cuda[ACR] = cuda[ACR] | SR_OUT;
+	cuda[SR] = data;
+	cuda[B] = cuda[B] | TACK;
+	
+	cuda[B] = cuda[B] | TIP;
+}
+
+
+void cpu_halt(void) {
+	cuda_packet(CUDA_POWERDOWN);
+	
+	cpu_sleep();
+}
Index: arch/ppc32/src/dummy.s
===================================================================
--- arch/ppc32/src/dummy.s	(revision d9e11ff2ca99628fcd951c1b400d7056854f195b)
+++ arch/ppc32/src/dummy.s	(revision 8b1439e8e30b99c70043159c1395344827b7e749)
@@ -31,27 +31,20 @@
 .global asm_delay_loop
 .global userspace
-.global before_thread_runs_arch
-.global after_thread_ran_arch
-.global dummy
-.global fpu_init
-.global fpu_enable
-.global fpu_disable
 .global tlb_invalidate_all
 .global tlb_invalidate_asid
 .global tlb_invalidate_pages
 
-before_thread_runs_arch:
-after_thread_ran_arch:
+tlb_invalidate_all:
+	b tlb_invalidate_all
+
+tlb_invalidate_asid:
+	b tlb_invalidate_asid
+
+tlb_invalidate_pages:
+	b tlb_invalidate_pages
+
 userspace:
+	b userspace
+
 asm_delay_loop:
-fpu_init:
-fpu_enable:	
-fpu_disable:	
-tlb_invalidate_all:
-tlb_invalidate_asid:
-tlb_invalidate_pages:
-
-
-dummy:
-0:
-	b 0b
+	b asm_delay_loop
Index: arch/ppc32/src/fpu_context.S
===================================================================
--- arch/ppc32/src/fpu_context.S	(revision d9e11ff2ca99628fcd951c1b400d7056854f195b)
+++ arch/ppc32/src/fpu_context.S	(revision 8b1439e8e30b99c70043159c1395344827b7e749)
@@ -34,4 +34,7 @@
 .global fpu_context_save
 .global fpu_context_restore
+.global fpu_init
+.global fpu_enable
+.global fpu_disable
 
 .macro FPU_CONTEXT_STORE r
@@ -92,2 +95,11 @@
 	
 	blr
+
+fpu_init:
+	blr
+
+fpu_enable:
+	blr
+
+fpu_disable:
+	blr
Index: arch/ppc32/src/proc/scheduler.c
===================================================================
--- arch/ppc32/src/proc/scheduler.c	(revision 8b1439e8e30b99c70043159c1395344827b7e749)
+++ arch/ppc32/src/proc/scheduler.c	(revision 8b1439e8e30b99c70043159c1395344827b7e749)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2006 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <proc/scheduler.h>
+
+void before_thread_runs_arch(void)
+{
+}
+
+void after_thread_ran_arch(void)
+{
+}
