[OpenBIOS] [PATCH] sparc32: add sbus-intr>cpu for sun4m

Bob Breuer breuerr at mc.net
Mon Aug 15 16:28:50 CEST 2011


Add an implementation of sbus-intr>cpu for sun4m to map sbus
interrupt levels (1 to 7) into cpu interrupts, and make use of
it for bpp.  Assumes false is the same as -1.

Signed-off-by: Bob Breuer <breuerr at mc.net>
---

Index: arch/sparc32/tree.fs
===================================================================
--- arch/sparc32/tree.fs	(revision 1046)
+++ arch/sparc32/tree.fs	(working copy)
@@ -1,4 +1,16 @@

+\ map sbus intr level to cpu intr
+: sun4m-sbus-intr>cpu
+  \ map 1  2  3  4  5  6  7  other
+  \ to  32 33 35 37 39 3b 3d  0
+  dup 1 7 between if
+  2* dup 2 <> + h# 30 +
+  else
+  drop 0
+  then
+  ;
+['] sun4m-sbus-intr>cpu to sbus-intr>cpu
+
 " /" find-device
   2 encode-int " #address-cells" property
   1 encode-int " #size-cells" property
@@ -61,7 +73,7 @@
 new-device
   " SUNW,bpp" device-name
   h# 4 encode-int h# 0c800000 encode-int encode+ h# 0000001c encode-int encode+ " reg" property
-  h# 33 encode-int 0 encode-int encode+ " intr" property
+  h# 2 sbus-intr>cpu encode-int 0 encode-int encode+ " intr" property
 finish-device
 [THEN]




More information about the OpenBIOS mailing list