X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fppc-assem.S;h=3b6e53f374d03bdd8db2be6239080e1b29ca632f;hb=35ab27e7aab71c94aa6be12da15603c7fd87fca8;hp=a8a165cd5445754429c8800f66139bffebb10529;hpb=b119de9cf02b07c8af6e74b6e0bc6860a38c93d8;p=sbcl.git diff --git a/src/runtime/ppc-assem.S b/src/runtime/ppc-assem.S index a8a165c..3b6e53f 100644 --- a/src/runtime/ppc-assem.S +++ b/src/runtime/ppc-assem.S @@ -279,7 +279,26 @@ x: mtlr 0 ; \ #endif - + +/* gas can't parse nnnnLU; redefine */ +#if BACKEND_PAGE_BYTES == 65536 +# undef BACKEND_PAGE_BYTES +# define BACKEND_PAGE_BYTES 65536 +#elif BACKEND_PAGE_BYTES == 4096 +# undef BACKEND_PAGE_BYTES +# define BACKEND_PAGE_BYTES 4096 +#else +# error BACKEND_PAGE_BYTES mismatch +#endif + +#ifdef LISP_FEATURE_SB_SAFEPOINT +/* OAOOM because we don't have the C headers here. */ +# define THREAD_CSP_PAGE_SIZE 4096 + +/* the CSP page sits right before the thread */ +# define THREAD_SAVED_CSP_OFFSET (-THREAD_CSP_PAGE_SIZE) +#endif + .text /* @@ -499,6 +518,11 @@ lra: andi. reg_NL3, reg_ALLOC, flag_PseudoAtomicInterrupted twnei reg_NL3, 0 +#ifdef LISP_FEATURE_SB_SAFEPOINT + /* OK to run GC without stopping this thread from this point on. */ + stw reg_CSP,THREAD_SAVED_CSP_OFFSET(reg_THREAD) +#endif + mr reg_NL3,reg_NARGS #ifdef LISP_FEATURE_DARWIN @@ -541,6 +565,11 @@ lra: #endif li reg_LIP,0 +# ifdef LISP_FEATURE_SB_SAFEPOINT + /* No longer OK to run GC except at safepoints. */ + stw reg_ZERO,THREAD_SAVED_CSP_OFFSET(reg_THREAD) +# endif + /* Atomic ... */ li reg_ALLOC,flag_PseudoAtomic @@ -605,14 +634,27 @@ CSYMBOL(undefined_tramp): /* Point reg_CODE to the header and tag it as function, since the debugger regards a function pointer in reg_CODE which doesn't point to a code object as undefined function. */ - bcl 20,31,.+4 /* get address of the next instruction */ - mflr reg_CODE /* header 1 extra word back from here */ - addi reg_CODE,reg_CODE,-(SIMPLE_FUN_CODE_OFFSET+4) - + /* We are given that reg_LIP points to undefined_tramp by + virtue of the calling convention. */ + addi reg_CODE,reg_LIP,-SIMPLE_FUN_CODE_OFFSET + + /* If we are called with stack arguments (or in a tail-call + scenario), we end up with an allocated stack frame, but the + frame link information is uninitialized. Fix things by + allocating and initializing our stack frame "properly". */ + cmpwi cr0,reg_NARGS,16 + bt gt,1f + addi reg_CSP,reg_CFP,16 + b 2f +1: add reg_CSP,reg_CFP,reg_NARGS +2: stw reg_OCFP,0(reg_CFP) + stw reg_LRA,4(reg_CFP) + + /* Now that the preliminaries are dealt with, actually trap. */ twllei reg_ZERO,trap_Cerror .byte 4 .byte UNDEFINED_FUN_ERROR - .byte 254, sc_DescriptorReg+0x40, 1 /* 140? sparc says sc_descriptorReg */ + .byte 254, sc_DescriptorReg+0x80, 0x2 /* 280 */ /* This stuff is for the continuable error. I don't think there's * any support for it on the lisp side */ .align 2 @@ -663,13 +705,13 @@ CSYMBOL(funcallable_instance_tramp) = . + 1 .globl CSYMBOL(fun_end_breakpoint_trap) .globl CSYMBOL(fun_end_breakpoint_end) - /* Due to pointer verification in MAKE-LISP-OBJ on GENCGC - targets, which includes PPC, this must include its header data - (the offset from the start of the code-object to the LRA). - The code-object header is five words, there are two words of - constants, and the instruction space is doubleword-aligned, - making an offset of eight. This is header data for a widetag, - so shift left eight bits and add. */ + /* Due to pointer verification in MAKE-LISP-OBJ, this must + include its header data (the offset from the start of the + code-object to the LRA). The code-object header is five + words, there are two words of constants, and the instruction + space is doubleword-aligned, making an offset of eight. + This is header data for a widetag, so shift left eight bits + and add. */ .long RETURN_PC_HEADER_WIDETAG + 0x800 /* We are receiving unknown multiple values, thus must deal