Index: head/lib/libc/powerpc/gen/_ctx_start.S =================================================================== --- head/lib/libc/powerpc/gen/_ctx_start.S (revision 272361) +++ head/lib/libc/powerpc/gen/_ctx_start.S (revision 272362) @@ -1,45 +1,46 @@ /* * Copyright (c) 2004 Suleiman Souhlal * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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 __FBSDID("$FreeBSD$"); .globl CNAME(_ctx_done) .globl CNAME(abort) ENTRY(_ctx_start) mtlr %r14 blrl /* branch to start function */ mr %r3,%r15 /* pass pointer to ucontext as argument */ bl PIC_PLT(CNAME(_ctx_done)) /* branch to ctxt completion func */ /* * we should never return from the * above branch. */ bl PIC_PLT(CNAME(abort)) /* abort */ + END(_cts_start) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/powerpc/gen/_setjmp.S =================================================================== --- head/lib/libc/powerpc/gen/_setjmp.S (revision 272361) +++ head/lib/libc/powerpc/gen/_setjmp.S (revision 272362) @@ -1,72 +1,74 @@ /*- * Copyright (c) 2002 Peter Grehan. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. */ /* $NetBSD: _setjmp.S,v 1.1 1997/03/29 20:55:53 thorpej Exp $ */ #include __FBSDID("$FreeBSD$"); /* * C library -- _setjmp, _longjmp * * _longjmp(a,v) * will generate a "return(v?v:1)" from the last call to * _setjmp(a) * by restoring registers from the stack. * The previous signal state is NOT restored. * * jmpbuf layout: * +------------+ * | unused | * +------------+ * | unused | * | | * | (4 words) | * | | * +------------+ * | saved regs | * | ... | */ ENTRY(_setjmp) mflr %r11 mfcr %r12 mr %r10,%r1 mr %r9,%r2 stmw %r9,20(%r3) li %r3,0 blr +END(_setjmp) ENTRY(_longjmp) lmw %r9,20(%r3) mtlr %r11 mtcr %r12 mr %r1,%r10 or. %r3,%r4,%r4 bnelr li %r3,1 blr +END(_longjmp) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/powerpc/gen/eabi.S =================================================================== --- head/lib/libc/powerpc/gen/eabi.S (revision 272361) +++ head/lib/libc/powerpc/gen/eabi.S (revision 272362) @@ -1,33 +1,34 @@ /* * Copyright (c) 2011 Marcel Moolenaar * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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 __FBSDID("$FreeBSD$"); ENTRY(__eabi) blr +END(__eabi) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/powerpc/gen/fabs.S =================================================================== --- head/lib/libc/powerpc/gen/fabs.S (revision 272361) +++ head/lib/libc/powerpc/gen/fabs.S (revision 272362) @@ -1,37 +1,38 @@ /* * Copyright (c) 2004 Peter Grehan. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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 __FBSDID("$FreeBSD$"); /* * double fabs(double) */ ENTRY(fabs) fabs %f1,%f1 blr +END(fabs) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/powerpc/gen/setjmp.S =================================================================== --- head/lib/libc/powerpc/gen/setjmp.S (revision 272361) +++ head/lib/libc/powerpc/gen/setjmp.S (revision 272362) @@ -1,90 +1,92 @@ /*- * Copyright (c) 2002 Peter Grehan. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. */ /* $NetBSD: setjmp.S,v 1.3 1998/10/03 12:30:38 tsubai Exp $ */ #include __FBSDID("$FreeBSD$"); #include /* * C library -- setjmp, longjmp * * longjmp(a,v) * will generate a "return(v?v:1)" from the last call to * setjmp(a) * by restoring registers from the stack. * The previous signal state is restored. * * jmpbuf layout: * +------------+ * | unused | * +------------+ * | sig state | * | | * | (4 words) | * | | * +------------+ * | saved regs | * | ... | */ ENTRY(setjmp) mr %r6,%r3 li %r3,1 /* SIG_BLOCK, but doesn't matter */ /* since set == NULL */ li %r4,0 /* set = NULL */ mr %r5,%r6 /* &oset */ addi %r5,%r5,4 li %r0, SYS_sigprocmask /*sigprocmask(SIG_BLOCK, NULL, &oset)*/ sc /*assume no error XXX */ mflr %r11 /* r11 <- link reg */ mfcr %r12 /* r12 <- condition reg */ mr %r10,%r1 /* r10 <- stackptr */ mr %r9,%r2 /* r9 <- global ptr */ stmw %r9,20(%r6) li %r3,0 /* return (0) */ blr +END(setjmp) WEAK_REFERENCE(CNAME(__longjmp), longjmp) ENTRY(__longjmp) lmw %r9,20(%r3) /* restore regs */ mr %r6,%r4 /* save val param */ mtlr %r11 /* r11 -> link reg */ mtcr %r12 /* r12 -> condition reg */ mr %r1,%r10 /* r10 -> stackptr */ mr %r4,%r3 li %r3,3 /* SIG_SETMASK */ addi %r4,%r4,4 /* &set */ li %r5,0 /* oset = NULL */ li %r0,SYS_sigprocmask /* sigprocmask(SIG_SET, &set, NULL) */ sc /* assume no error XXX */ or. %r3,%r6,%r6 bnelr li %r3,1 blr +END(__longjmp) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/powerpc/gen/sigsetjmp.S =================================================================== --- head/lib/libc/powerpc/gen/sigsetjmp.S (revision 272361) +++ head/lib/libc/powerpc/gen/sigsetjmp.S (revision 272362) @@ -1,98 +1,100 @@ /*- * Copyright (c) 2002 Peter Grehan. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. */ /* $NetBSD: sigsetjmp.S,v 1.4 1998/10/03 12:30:38 tsubai Exp $ */ #include __FBSDID("$FreeBSD$"); /* * C library -- sigsetjmp, siglongjmp * * siglongjmp(a,v) * will generate a "return(v?v:1)" from the last call to * sigsetjmp(a, savemask) * by restoring registers from the stack. * The previous signal state is restored if savemask is non-zero * * jmpbuf layout: * +------------+ * | savemask | * +------------+ * | sig state | * | | * | (4 words) | * | | * +------------+ * | saved regs | * | ... | */ #include ENTRY(sigsetjmp) mr %r6,%r3 stw %r4,0(%r3) or. %r7,%r4,%r4 beq 1f li %r3,1 /* SIG_BLOCK, but doesn't matter */ /* since set == NULL */ li %r4,0 /* set = NULL */ mr %r5,%r6 /* &oset */ addi %r5,%r5,4 li %r0, SYS_sigprocmask /* sigprocmask(SIG_BLOCK, NULL, &oset)*/ sc /* assume no error XXX */ 1: mflr %r11 mfcr %r12 mr %r10,%r1 mr %r9,%r2 stmw %r9,20(%r6) li %r3,0 blr +END(sigsetjmp) ENTRY(siglongjmp) lmw %r9,20(%r3) lwz %r7,0(%r3) mr %r6,%r4 mtlr %r11 mtcr %r12 mr %r1,%r10 or. %r7,%r7,%r7 beq 1f mr %r4,%r3 li %r3,3 /* SIG_SETMASK */ addi %r4,%r4,4 /* &set */ li %r5,0 /* oset = NULL */ li %r0,SYS_sigprocmask /* sigprocmask(SIG_SET, &set, NULL) */ sc /* assume no error XXX */ 1: or. %r3,%r6,%r6 bnelr li %r3,1 blr +END(siglongjmp) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/powerpc/sys/brk.S =================================================================== --- head/lib/libc/powerpc/sys/brk.S (revision 272361) +++ head/lib/libc/powerpc/sys/brk.S (revision 272362) @@ -1,75 +1,76 @@ /*- * Copyright (c) 2002 Peter Grehan. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. */ /* $NetBSD: brk.S,v 1.9 2000/06/26 06:25:43 kleink Exp $ */ #include __FBSDID("$FreeBSD$"); #include "SYS.h" .globl HIDENAME(curbrk) .globl HIDENAME(minbrk) .globl CNAME(_end) .data HIDENAME(minbrk): .long CNAME(_end) .text ENTRY(brk) #ifdef PIC mflr %r10 bl _GLOBAL_OFFSET_TABLE_@local-4 mflr %r9 mtlr %r10 lwz %r5,HIDENAME(minbrk)@got(%r9) lwz %r6,0(%r5) #else lis %r5,HIDENAME(minbrk)@ha lwz %r6,HIDENAME(minbrk)@l(%r5) #endif cmplw %r6,%r3 /* if (minbrk <= r3) */ bgt 0f mr %r6,%r3 /* r6 = r3 */ 0: mr %r3,%r6 /* new break value */ li %r0,SYS_break sc /* assume, that r5 is kept */ bso 1f #ifdef PIC lwz %r7,HIDENAME(curbrk)@got(%r9) stw %r6,0(%r7) #else lis %r7,HIDENAME(curbrk)@ha /* record new break */ stw %r6,HIDENAME(curbrk)@l(%r7) #endif blr /* return 0 */ 1: b PIC_PLT(HIDENAME(cerror)) +END(brk) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/powerpc/sys/exect.S =================================================================== --- head/lib/libc/powerpc/sys/exect.S (revision 272361) +++ head/lib/libc/powerpc/sys/exect.S (revision 272362) @@ -1,41 +1,42 @@ /*- * Copyright (c) 2002 Peter Grehan. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. */ /* $NetBSD: exect.S,v 1.3 1998/05/25 15:28:03 ws Exp $ */ #include __FBSDID("$FreeBSD$"); #include "SYS.h" ENTRY(exect) li %r0,SYS_execve sc bso 1f blr 1: b PIC_PLT(HIDENAME(cerror)) +END(exect) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/powerpc/sys/pipe.S =================================================================== --- head/lib/libc/powerpc/sys/pipe.S (revision 272361) +++ head/lib/libc/powerpc/sys/pipe.S (revision 272362) @@ -1,45 +1,46 @@ /*- * Copyright (c) 2002 Peter Grehan. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. */ /* $NetBSD: pipe.S,v 1.6 2000/09/28 08:38:54 kleink Exp $ */ #include __FBSDID("$FreeBSD$"); #include "SYS.h" ENTRY(pipe) mr %r5,%r3 /* save pointer */ li %r0,SYS_pipe sc /* r5 is preserved */ bso 1f stw %r3,0(%r5) /* success, store fds */ stw %r4,4(%r5) li %r3,0 blr /* and return 0 */ 1: b PIC_PLT(HIDENAME(cerror)) +END(pipe) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/powerpc/sys/ptrace.S =================================================================== --- head/lib/libc/powerpc/sys/ptrace.S (revision 272361) +++ head/lib/libc/powerpc/sys/ptrace.S (revision 272362) @@ -1,60 +1,61 @@ /*- * Copyright (c) 2002 Peter Grehan. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. */ /* $NetBSD: ptrace.S,v 1.3 2000/02/23 20:16:57 kleink Exp $ */ #include __FBSDID("$FreeBSD$"); #include "SYS.h" ENTRY(ptrace) mflr %r0 stwu %r1,-32(%r1) stw %r0,36(%r1) stw %r3,8(%r1) stw %r4,12(%r1) stw %r5,16(%r1) stw %r6,20(%r1) bl PIC_PLT(CNAME(__error)) li %r7,0 stw %r7,0(%r3) lwz %r3,8(%r1) lwz %r4,12(%r1) lwz %r5,16(%r1) lwz %r0,36(%r1) lwz %r6,20(%r1) mtlr %r0 la %r1,32(%r1) li %r0,SYS_ptrace sc bso 1f blr 1: b PIC_PLT(HIDENAME(cerror)) +END(ptrace) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/powerpc/sys/sbrk.S =================================================================== --- head/lib/libc/powerpc/sys/sbrk.S (revision 272361) +++ head/lib/libc/powerpc/sys/sbrk.S (revision 272362) @@ -1,72 +1,73 @@ /*- * Copyright (c) 2002 Peter Grehan. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. */ /* $NetBSD: sbrk.S,v 1.8 2000/06/26 06:25:44 kleink Exp $ */ #include __FBSDID("$FreeBSD$"); #include "SYS.h" .globl HIDENAME(curbrk) .globl CNAME(_end) .data HIDENAME(curbrk): .long CNAME(_end) .text ENTRY(sbrk) #ifdef PIC mflr %r10 bl _GLOBAL_OFFSET_TABLE_@local-4 mflr %r5 mtlr %r10 lwz %r5,HIDENAME(curbrk)@got(%r5) lwz %r6,0(%r5) #else lis %r5,HIDENAME(curbrk)@ha lwz %r6,HIDENAME(curbrk)@l(%r5) /* r6 = old break */ #endif cmpwi %r3,0 /* sbrk(0) - return curbrk */ beq 1f add %r3,%r3,%r6 mr %r7,%r3 /* r7 = new break */ li %r0,SYS_break sc /* break(new_break) */ bso 2f #ifdef PIC stw %r7,0(%r5) #else stw %r7,HIDENAME(curbrk)@l(%r5) /* record new break */ #endif 1: mr %r3,%r6 /* set return value */ blr 2: b PIC_PLT(HIDENAME(cerror)) +END(sbrk) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/powerpc64/gen/_ctx_start.S =================================================================== --- head/lib/libc/powerpc64/gen/_ctx_start.S (revision 272361) +++ head/lib/libc/powerpc64/gen/_ctx_start.S (revision 272362) @@ -1,50 +1,51 @@ /* * Copyright (c) 2004 Suleiman Souhlal * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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 __FBSDID("$FreeBSD$"); .globl CNAME(_ctx_done) .globl CNAME(abort) ENTRY(_ctx_start) ld %r2,8(%r14) ld %r14,0(%r14) mtlr %r14 blrl /* branch to start function */ mr %r3,%r15 /* pass pointer to ucontext as argument */ nop bl CNAME(_ctx_done) /* branch to ctxt completion func */ /* * we should never return from the * above branch. */ nop bl CNAME(abort) /* abort */ nop + END(_ctx_start) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/powerpc64/gen/_setjmp.S =================================================================== --- head/lib/libc/powerpc64/gen/_setjmp.S (revision 272361) +++ head/lib/libc/powerpc64/gen/_setjmp.S (revision 272362) @@ -1,117 +1,119 @@ /*- * Copyright (c) 2002 Peter Grehan. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. */ /* $NetBSD: _setjmp.S,v 1.1 1997/03/29 20:55:53 thorpej Exp $ */ #include __FBSDID("$FreeBSD$"); /* * C library -- _setjmp, _longjmp * * _longjmp(a,v) * will generate a "return(v?v:1)" from the last call to * _setjmp(a) * by restoring registers from the stack. * The previous signal state is NOT restored. * * jmpbuf layout: * +------------+ * | unused | * +------------+ * | unused | * | | * | (4 words) | * | | * +------------+ * | saved regs | * | ... | */ ENTRY(_setjmp) mflr %r11 mfcr %r12 mr %r10,%r1 mr %r9,%r2 std %r9,40 + 0*8(%r3) std %r10,40 + 1*8(%r3) std %r11,40 + 2*8(%r3) std %r12,40 + 3*8(%r3) std %r13,40 + 4*8(%r3) std %r14,40 + 5*8(%r3) std %r15,40 + 6*8(%r3) std %r16,40 + 7*8(%r3) std %r17,40 + 8*8(%r3) std %r18,40 + 9*8(%r3) std %r19,40 + 10*8(%r3) std %r20,40 + 11*8(%r3) std %r21,40 + 12*8(%r3) std %r22,40 + 13*8(%r3) std %r23,40 + 14*8(%r3) std %r24,40 + 15*8(%r3) std %r25,40 + 16*8(%r3) std %r26,40 + 17*8(%r3) std %r27,40 + 18*8(%r3) std %r28,40 + 19*8(%r3) std %r29,40 + 20*8(%r3) std %r30,40 + 21*8(%r3) std %r31,40 + 22*8(%r3) li %r3,0 blr +END(_setjmp) ENTRY(_longjmp) ld %r9,40 + 0*8(%r3) ld %r10,40 + 1*8(%r3) ld %r11,40 + 2*8(%r3) ld %r12,40 + 3*8(%r3) ld %r14,40 + 5*8(%r3) ld %r15,40 + 6*8(%r3) ld %r16,40 + 7*8(%r3) ld %r17,40 + 8*8(%r3) ld %r18,40 + 9*8(%r3) ld %r19,40 + 10*8(%r3) ld %r20,40 + 11*8(%r3) ld %r21,40 + 12*8(%r3) ld %r22,40 + 13*8(%r3) ld %r23,40 + 14*8(%r3) ld %r24,40 + 15*8(%r3) ld %r25,40 + 16*8(%r3) ld %r26,40 + 17*8(%r3) ld %r27,40 + 18*8(%r3) ld %r28,40 + 19*8(%r3) ld %r29,40 + 20*8(%r3) ld %r30,40 + 21*8(%r3) ld %r31,40 + 22*8(%r3) mtlr %r11 mtcr %r12 mr %r2,%r9 mr %r1,%r10 or. %r3,%r4,%r4 bnelr li %r3,1 blr +END(_longjmp) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/powerpc64/gen/fabs.S =================================================================== --- head/lib/libc/powerpc64/gen/fabs.S (revision 272361) +++ head/lib/libc/powerpc64/gen/fabs.S (revision 272362) @@ -1,37 +1,38 @@ /* * Copyright (c) 2004 Peter Grehan. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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 __FBSDID("$FreeBSD$"); /* * double fabs(double) */ ENTRY(fabs) fabs %f1,%f1 blr +END(fabs) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/powerpc64/gen/setjmp.S =================================================================== --- head/lib/libc/powerpc64/gen/setjmp.S (revision 272361) +++ head/lib/libc/powerpc64/gen/setjmp.S (revision 272362) @@ -1,136 +1,138 @@ /*- * Copyright (c) 2002 Peter Grehan. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. */ /* $NetBSD: setjmp.S,v 1.3 1998/10/03 12:30:38 tsubai Exp $ */ #include __FBSDID("$FreeBSD$"); #include /* * C library -- setjmp, longjmp * * longjmp(a,v) * will generate a "return(v?v:1)" from the last call to * setjmp(a) * by restoring registers from the stack. * The previous signal state is restored. * * jmpbuf layout: * +------------+ * | unused | * +------------+ * | sig state | * | | * | (4 words) | * | | * +------------+ * | saved regs | * | ... | */ ENTRY(setjmp) mr %r6,%r3 li %r3,1 /* SIG_BLOCK, but doesn't matter */ /* since set == NULL */ li %r4,0 /* set = NULL */ mr %r5,%r6 /* &oset */ addi %r5,%r5,4 li %r0, SYS_sigprocmask /*sigprocmask(SIG_BLOCK, NULL, &oset)*/ sc /*assume no error XXX */ mflr %r11 /* r11 <- link reg */ mfcr %r12 /* r12 <- condition reg */ mr %r10,%r1 /* r10 <- stackptr */ mr %r9,%r2 /* r9 <- global ptr */ std %r9,40 + 0*8(%r6) std %r10,40 + 1*8(%r6) std %r11,40 + 2*8(%r6) std %r12,40 + 3*8(%r6) std %r13,40 + 4*8(%r6) std %r14,40 + 5*8(%r6) std %r15,40 + 6*8(%r6) std %r16,40 + 7*8(%r6) std %r17,40 + 8*8(%r6) std %r18,40 + 9*8(%r6) std %r19,40 + 10*8(%r6) std %r20,40 + 11*8(%r6) std %r21,40 + 12*8(%r6) std %r22,40 + 13*8(%r6) std %r23,40 + 14*8(%r6) std %r24,40 + 15*8(%r6) std %r25,40 + 16*8(%r6) std %r26,40 + 17*8(%r6) std %r27,40 + 18*8(%r6) std %r28,40 + 19*8(%r6) std %r29,40 + 20*8(%r6) std %r30,40 + 21*8(%r6) std %r31,40 + 22*8(%r6) li %r3,0 /* return (0) */ blr +END(setjmp) WEAK_REFERENCE(__longjmp, longjmp) ENTRY(__longjmp) ld %r9,40 + 0*8(%r3) ld %r10,40 + 1*8(%r3) ld %r11,40 + 2*8(%r3) ld %r12,40 + 3*8(%r3) ld %r14,40 + 5*8(%r3) ld %r15,40 + 6*8(%r3) ld %r16,40 + 7*8(%r3) ld %r17,40 + 8*8(%r3) ld %r18,40 + 9*8(%r3) ld %r19,40 + 10*8(%r3) ld %r20,40 + 11*8(%r3) ld %r21,40 + 12*8(%r3) ld %r22,40 + 13*8(%r3) ld %r23,40 + 14*8(%r3) ld %r24,40 + 15*8(%r3) ld %r25,40 + 16*8(%r3) ld %r26,40 + 17*8(%r3) ld %r27,40 + 18*8(%r3) ld %r28,40 + 19*8(%r3) ld %r29,40 + 20*8(%r3) ld %r30,40 + 21*8(%r3) ld %r31,40 + 22*8(%r3) mr %r6,%r4 /* save val param */ mtlr %r11 /* r11 -> link reg */ mtcr %r12 /* r12 -> condition reg */ mr %r2,%r9 /* r9 -> global ptr */ mr %r1,%r10 /* r10 -> stackptr */ mr %r4,%r3 li %r3,3 /* SIG_SETMASK */ addi %r4,%r4,4 /* &set */ li %r5,0 /* oset = NULL */ li %r0,SYS_sigprocmask /* sigprocmask(SIG_SET, &set, NULL) */ sc /* assume no error XXX */ or. %r3,%r6,%r6 bnelr li %r3,1 blr +END(__longjmp) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/powerpc64/gen/sigsetjmp.S =================================================================== --- head/lib/libc/powerpc64/gen/sigsetjmp.S (revision 272361) +++ head/lib/libc/powerpc64/gen/sigsetjmp.S (revision 272362) @@ -1,145 +1,147 @@ /*- * Copyright (c) 2002 Peter Grehan. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. */ /* $NetBSD: sigsetjmp.S,v 1.4 1998/10/03 12:30:38 tsubai Exp $ */ #include __FBSDID("$FreeBSD$"); /* * C library -- sigsetjmp, siglongjmp * * siglongjmp(a,v) * will generate a "return(v?v:1)" from the last call to * sigsetjmp(a, savemask) * by restoring registers from the stack. * The previous signal state is restored if savemask is non-zero * * jmpbuf layout: * +------------+ * | savemask | * +------------+ * | sig state | * | | * | (4 words) | * | | * +------------+ * | saved regs | * | ... | */ #include ENTRY(sigsetjmp) mr %r6,%r3 stw %r4,0(%r3) or. %r7,%r4,%r4 beq 1f li %r3,1 /* SIG_BLOCK, but doesn't matter */ /* since set == NULL */ li %r4,0 /* set = NULL */ mr %r5,%r6 /* &oset */ addi %r5,%r5,4 li %r0, SYS_sigprocmask /* sigprocmask(SIG_BLOCK, NULL, &oset)*/ sc /* assume no error XXX */ 1: mflr %r11 mfcr %r12 mr %r10,%r1 mr %r9,%r2 std %r9,40 + 0*8(%r6) std %r10,40 + 1*8(%r6) std %r11,40 + 2*8(%r6) std %r12,40 + 3*8(%r6) std %r13,40 + 4*8(%r6) std %r14,40 + 5*8(%r6) std %r15,40 + 6*8(%r6) std %r16,40 + 7*8(%r6) std %r17,40 + 8*8(%r6) std %r18,40 + 9*8(%r6) std %r19,40 + 10*8(%r6) std %r20,40 + 11*8(%r6) std %r21,40 + 12*8(%r6) std %r22,40 + 13*8(%r6) std %r23,40 + 14*8(%r6) std %r24,40 + 15*8(%r6) std %r25,40 + 16*8(%r6) std %r26,40 + 17*8(%r6) std %r27,40 + 18*8(%r6) std %r28,40 + 19*8(%r6) std %r29,40 + 20*8(%r6) std %r30,40 + 21*8(%r6) std %r31,40 + 22*8(%r6) li %r3,0 blr +END(sigsetjmp) ENTRY(siglongjmp) ld %r9,40 + 0*8(%r3) ld %r10,40 + 1*8(%r3) ld %r11,40 + 2*8(%r3) ld %r12,40 + 3*8(%r3) ld %r14,40 + 5*8(%r3) ld %r15,40 + 6*8(%r3) ld %r16,40 + 7*8(%r3) ld %r17,40 + 8*8(%r3) ld %r18,40 + 9*8(%r3) ld %r19,40 + 10*8(%r3) ld %r20,40 + 11*8(%r3) ld %r21,40 + 12*8(%r3) ld %r22,40 + 13*8(%r3) ld %r23,40 + 14*8(%r3) ld %r24,40 + 15*8(%r3) ld %r25,40 + 16*8(%r3) ld %r26,40 + 17*8(%r3) ld %r27,40 + 18*8(%r3) ld %r28,40 + 19*8(%r3) ld %r29,40 + 20*8(%r3) ld %r30,40 + 21*8(%r3) ld %r31,40 + 22*8(%r3) lwz %r7,0(%r3) mr %r6,%r4 mtlr %r11 mtcr %r12 mr %r2,%r9 mr %r1,%r10 or. %r7,%r7,%r7 beq 1f mr %r4,%r3 li %r3,3 /* SIG_SETMASK */ addi %r4,%r4,4 /* &set */ li %r5,0 /* oset = NULL */ li %r0,SYS_sigprocmask /* sigprocmask(SIG_SET, &set, NULL) */ sc /* assume no error XXX */ 1: or. %r3,%r6,%r6 bnelr li %r3,1 blr +END(siglongjmp) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/powerpc64/sys/brk.S =================================================================== --- head/lib/libc/powerpc64/sys/brk.S (revision 272361) +++ head/lib/libc/powerpc64/sys/brk.S (revision 272362) @@ -1,73 +1,74 @@ /*- * Copyright (c) 2002 Peter Grehan. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. */ /* $NetBSD: brk.S,v 1.9 2000/06/26 06:25:43 kleink Exp $ */ #include __FBSDID("$FreeBSD$"); #include "SYS.h" .globl HIDENAME(curbrk) .globl HIDENAME(minbrk) .globl CNAME(_end) .data .align 3 HIDENAME(minbrk): .llong CNAME(_end) .text ENTRY(brk) addis %r6,%r2,HIDENAME(minbrk)@toc@ha ld %r6,HIDENAME(minbrk)@toc@l(%r6) cmpld %r6,%r3 /* if (minbrk <= r3) */ bgt 0f mr %r6,%r3 /* r6 = r3 */ 0: mr %r3,%r6 /* new break value */ li %r0,SYS_break sc /* assume, that r5 is kept */ bso 1f /* record new break */ addis %r7,%r2,HIDENAME(curbrk)@toc@ha std %r6,HIDENAME(curbrk)@toc@l(%r7) blr /* return 0 */ 1: mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) bl HIDENAME(cerror) nop ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr +END(brk) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/powerpc64/sys/exect.S =================================================================== --- head/lib/libc/powerpc64/sys/exect.S (revision 272361) +++ head/lib/libc/powerpc64/sys/exect.S (revision 272362) @@ -1,49 +1,50 @@ /*- * Copyright (c) 2002 Peter Grehan. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. */ /* $NetBSD: exect.S,v 1.3 1998/05/25 15:28:03 ws Exp $ */ #include __FBSDID("$FreeBSD$"); #include "SYS.h" ENTRY(exect) li %r0,SYS_execve sc bso 1f blr 1: mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) bl HIDENAME(cerror) nop ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr +END(exect) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/powerpc64/sys/pipe.S =================================================================== --- head/lib/libc/powerpc64/sys/pipe.S (revision 272361) +++ head/lib/libc/powerpc64/sys/pipe.S (revision 272362) @@ -1,53 +1,54 @@ /*- * Copyright (c) 2002 Peter Grehan. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. */ /* $NetBSD: pipe.S,v 1.6 2000/09/28 08:38:54 kleink Exp $ */ #include __FBSDID("$FreeBSD$"); #include "SYS.h" ENTRY(pipe) mr %r5,%r3 /* save pointer */ li %r0,SYS_pipe sc /* r5 is preserved */ bso 1f stw %r3,0(%r5) /* success, store fds */ stw %r4,4(%r5) li %r3,0 blr /* and return 0 */ 1: mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) bl HIDENAME(cerror) nop ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr +END(pipe) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/powerpc64/sys/ptrace.S =================================================================== --- head/lib/libc/powerpc64/sys/ptrace.S (revision 272361) +++ head/lib/libc/powerpc64/sys/ptrace.S (revision 272362) @@ -1,67 +1,68 @@ /*- * Copyright (c) 2002 Peter Grehan. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. */ /* $NetBSD: ptrace.S,v 1.3 2000/02/23 20:16:57 kleink Exp $ */ #include __FBSDID("$FreeBSD$"); #include "SYS.h" ENTRY(ptrace) mflr %r0 std %r0,16(%r1) stdu %r1,-80(%r1) stw %r3,48(%r1) stw %r4,52(%r1) std %r5,56(%r1) stw %r6,64(%r1) bl CNAME(__error) nop li %r7,0 stw %r7,0(%r3) lwz %r3,48(%r1) lwz %r4,52(%r1) ld %r5,56(%r1) lwz %r6,64(%r1) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 li %r0,SYS_ptrace sc bso 1f blr 1: stdu %r1,-48(%r1) /* lr already saved */ bl HIDENAME(cerror) nop ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr +END(ptrace) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/powerpc64/sys/sbrk.S =================================================================== --- head/lib/libc/powerpc64/sys/sbrk.S (revision 272361) +++ head/lib/libc/powerpc64/sys/sbrk.S (revision 272362) @@ -1,68 +1,69 @@ /*- * Copyright (c) 2002 Peter Grehan. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. */ /* $NetBSD: sbrk.S,v 1.8 2000/06/26 06:25:44 kleink Exp $ */ #include __FBSDID("$FreeBSD$"); #include "SYS.h" .globl HIDENAME(curbrk) .globl CNAME(_end) .data .align 3 HIDENAME(curbrk): .llong CNAME(_end) .text ENTRY(sbrk) addis %r5,%r2,HIDENAME(curbrk)@toc@ha addi %r5,%r5,HIDENAME(curbrk)@toc@l ld %r6,0(%r5) /* r6 = old break */ cmpdi %r3,0 /* sbrk(0) - return curbrk */ beq 1f add %r3,%r3,%r6 mr %r7,%r3 /* r7 = new break */ li %r0,SYS_break sc /* break(new_break) */ bso 2f std %r7,0(%r5) 1: mr %r3,%r6 /* set return value */ blr 2: mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) bl HIDENAME(cerror) nop ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr +END(sbrk) .section .note.GNU-stack,"",%progbits