0.9.17.8:
[sbcl.git] / src / runtime / sparc-assem.S
index 804497f..c856cc9 100644 (file)
@@ -1,12 +1,16 @@
 #define _ASM
 
-#define FUNCDEF(x)     .type x,@function
+#include "sparc-funcdef.h"
 
 #define LANGUAGE_ASSEMBLY
 #include "lispregs.h"
 #include "globals.h"
 #include "sbcl.h"
-
+#include "genesis/closure.h"
+#include "genesis/funcallable-instance.h"
+#include "genesis/fdefn.h"
+#include "genesis/static-symbols.h"
+#include "genesis/simple-fun.h"        
 
 #define load(sym, reg) \
         sethi %hi(sym), reg; ld [reg+%lo(sym)], reg
@@ -16,7 +20,6 @@
 /* FIXME */
 #define FRAMESIZE 0x48
 #define ST_FLUSH_WINDOWS 0x03
-#define PSEUDO_ATOMIC_TRAP_NUMBER 64
        .seg    "text"
         .global call_into_lisp
        FUNCDEF(call_into_lisp)
@@ -61,11 +64,7 @@ call_into_lisp:
        sub     reg_ALLOC, 4, reg_ALLOC
        andcc   reg_ALLOC, 3, reg_ZERO
        
-       /* OK, this is ridiculous. We badly urgently need this to be
-       centralized, because that's now _three_ places where this
-       number is used. CSR, 2002-02-09 */
-
-       tne     64
+       tne     PSEUDO_ATOMIC_TRAP
         /* Pass in the args. */
         sll     %i2, 2, reg_NARGS
         mov     %i1, reg_CFP
@@ -113,7 +112,7 @@ lra:
         /* Were we interrupted? */
        sub     reg_ALLOC, 4, reg_ALLOC
        andcc   reg_ALLOC, 3, reg_ZERO
-       tne     PSEUDO_ATOMIC_TRAP_NUMBER
+       tne     PSEUDO_ATOMIC_TRAP
 
         /* Back to C we go. */
        ld      [%sp+FRAMESIZE-4], %i7
@@ -153,7 +152,7 @@ call_into_c:
         /* Were we interrupted? */
        sub     reg_ALLOC, 4, reg_ALLOC
        andcc   reg_ALLOC, 3, reg_ZERO
-       tne     PSEUDO_ATOMIC_TRAP_NUMBER
+       tne     PSEUDO_ATOMIC_TRAP
 
         /* Into C we go. */
         call    reg_CFUNC
@@ -191,7 +190,7 @@ call_into_c:
         /* No longer atomic. */
        sub     reg_ALLOC, 4, reg_ALLOC
        andcc   reg_ALLOC, 3, reg_ZERO
-       tne     PSEUDO_ATOMIC_TRAP_NUMBER
+       tne     PSEUDO_ATOMIC_TRAP
 
         /* Reset the lisp stack. */
         /* Note: OCFP is in one of the locals, it gets preserved across C. */
@@ -202,6 +201,8 @@ call_into_c:
         ret
         nop
 
+/* Lisp calling convention. notice the first .byte line.
+ */            
         .global undefined_tramp
        FUNCDEF(undefined_tramp)
         .align  8
@@ -224,6 +225,8 @@ undefined_tramp = . + 1
        jmp     reg_CODE+SIMPLE_FUN_CODE_OFFSET
        nop
 
+/* Lisp calling convention. Notice the first .byte line.
+ */            
        .global closure_tramp
        FUNCDEF(closure_tramp)
        .align  8
@@ -240,7 +243,21 @@ closure_tramp = . + 1
        jmp     reg_CODE+SIMPLE_FUN_CODE_OFFSET
        nop
 
-
+       .global funcallable_instance_tramp
+       FUNCDEF(funcallable_instance_tramp)
+       .align 8
+       .word SIMPLE_FUN_HEADER_WIDETAG
+funcallable_instance_tramp = . + 1
+       .word funcallable_instance_tramp
+       .word NIL
+       .word NIL
+       .word NIL
+       .word NIL
+
+       ld      [reg_LEXENV+FUNCALLABLE_INSTANCE_FUNCTION_OFFSET], reg_LEXENV
+       ld      [reg_LEXENV+CLOSURE_FUN_OFFSET], reg_CODE
+       jmp     reg_CODE+SIMPLE_FUN_CODE_OFFSET
+       nop
 /*
  * Function-end breakpoint magic.
  */
@@ -271,9 +288,9 @@ fun_end_breakpoint_trap:
        .global fun_end_breakpoint_end
 fun_end_breakpoint_end:
 
-       .global flush_icache
-       FUNCDEF(flush_icache)
-flush_icache:
+       .global sparc_flush_icache
+       FUNCDEF(sparc_flush_icache)
+sparc_flush_icache:
         add %o0,%o1,%o2
 1:      iflush %o0                     ! flush instruction cache
         add %o0,8,%o0