changeset 134:42ca337f6e4b

program interrupt handler now puts the machine into a disabled wait state, fixed a type
author Jonathan Pevarnek <pevarnj@gmail.com>
date Mon, 12 Sep 2011 10:29:08 -0400
parents d1e835a25f28
children 8a9f090e4747
files arch/except.c arch/progint.h
diffstat 2 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/arch/except.c	Sun Sep 11 23:39:30 2011 -0400
+++ b/arch/except.c	Mon Sep 12 10:29:08 2011 -0400
@@ -15,6 +15,16 @@
 }
 
 void prog_int_handler() {
-	putline("PIA\n", 4); //just so I know this has been called
-	die();
+	Psw *psw = PROGINT_TMP;
+	__builtin_memset(psw, 0, sizeof(Psw)); //I am going to use the builtin ones
+	                                       //for a bit longer while I think
+	psw->w = 1;
+	psw->ea = 1;
+	psw->ba = 1;
+	psw->ptr = 0xd1e;
+	asm volatile(
+		"lpswe %0\n"
+		: /* no output */
+		: "m" (*PROGINT_TMP)
+	);
 }
--- a/arch/progint.h	Sun Sep 11 23:39:30 2011 -0400
+++ b/arch/progint.h	Mon Sep 12 10:29:08 2011 -0400
@@ -2,12 +2,14 @@
 #define __PROGINT_H
 
 #define PROGINT_REG_LOC 0x300
+#define PROGINT_TMP_LOC 0x300 + 16*sizeof(u64)
+#define PROGINT_TMP ((struct psw*) PROGINT_TMP_LOC)
 
 #define PROGINT_PSW_OLD 0x150
 #define PROGINT_PSW_NEW 0x1D0
 
 #define PROGINT_STACK 0x300000
 #define PROGINT_STACK_SHIFT 0x30
-#define PROGINT_STACK_STIFT_OFFSET 16
+#define PROGINT_STACK_SHIFT_OFFSET 16
 
 #endif