Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/csu/arch/powerpc Add powerpc64 support



details:   https://anonhg.NetBSD.org/src/rev/709e7791cb38
branches:  trunk
changeset: 793846:709e7791cb38
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Feb 27 16:47:48 2014 +0000

description:
Add powerpc64 support

diffstat:

 lib/csu/arch/powerpc/crt0.S   |  11 ++++++++++-
 lib/csu/arch/powerpc/crtend.S |  28 ++++++++++++++++++++++------
 lib/csu/arch/powerpc/crti.S   |  42 ++++++++++++++++++++++++++++++++++++++----
 lib/csu/arch/powerpc/crtn.S   |  12 +++++++++++-
 4 files changed, 81 insertions(+), 12 deletions(-)

diffs (194 lines):

diff -r 74158ff7bf28 -r 709e7791cb38 lib/csu/arch/powerpc/crt0.S
--- a/lib/csu/arch/powerpc/crt0.S       Thu Feb 27 16:00:32 2014 +0000
+++ b/lib/csu/arch/powerpc/crt0.S       Thu Feb 27 16:47:48 2014 +0000
@@ -29,25 +29,34 @@
 
 #include <powerpc/asm.h>
 
-RCSID("$NetBSD: crt0.S,v 1.4 2011/07/02 20:16:09 matt Exp $")
+RCSID("$NetBSD: crt0.S,v 1.5 2014/02/27 16:47:48 matt Exp $")
 
 STRONG_ALIAS(_start,__start)
 
        .hidden ___start
 
+#ifndef _LP64
        .weak   _SDA_BASE_
+#endif
 
 ENTRY_NOPROFILE(__start)
+#ifndef _LP64
        bcl     20,31,1f
 1:
        mflr    %r11
        /* SVR4 ABI says small data is in r13 */
        addis   %r13,%r11,_SDA_BASE_-1b@ha
        addi    %r13,%r13,_SDA_BASE_-1b@l
+#endif
 
        mr      %r3,%r7         /* cleanup */
        mr      %r4,%r6         /* obj */
        mr      %r5,%r8         /* ps_strings */
 
+#ifdef _LP64
+       b       .___start
+       nop
+#else
        b       ___start
+#endif
 END(__start)
diff -r 74158ff7bf28 -r 709e7791cb38 lib/csu/arch/powerpc/crtend.S
--- a/lib/csu/arch/powerpc/crtend.S     Thu Feb 27 16:00:32 2014 +0000
+++ b/lib/csu/arch/powerpc/crtend.S     Thu Feb 27 16:47:48 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crtend.S,v 1.2 2013/06/27 21:24:39 matt Exp $  */
+/*     $NetBSD: crtend.S,v 1.3 2014/02/27 16:47:48 matt Exp $  */
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -30,26 +30,42 @@
 
 #include <powerpc/asm.h>
 
-RCSID("$NetBSD: crtend.S,v 1.2 2013/06/27 21:24:39 matt Exp $")
+RCSID("$NetBSD: crtend.S,v 1.3 2014/02/27 16:47:48 matt Exp $")
 
        .section        .ctors, "aw", @progbits
-       .p2align 2
+       .p2align P2SZREG
        .global         __CTOR_LIST_END__
        .hidden         __CTOR_LIST_END__
 __CTOR_LIST_END__:
+#ifdef _LP64
+       .quad 0
+#else
        .long 0
+#endif
 
        .section        .dtors, "aw", @progbits
-       .p2align 2
+       .p2align P2SZREG
        .global         __DTOR_LIST_END__
        .hidden         __DTOR_LIST_END__
 __DTOR_LIST_END__:
+#ifdef _LP64
+       .quad 0
+#else
        .long 0
+#endif
 
        .section        .eh_frame, "a", @progbits
-       .p2align 2
+       .p2align P2SZREG
+#ifdef _LP64
+       .quad 0
+#else
        .long 0
+#endif
 
        .section        .jcr, "aw", @progbits
-       .p2align 2
+       .p2align P2SZREG
+#ifdef _LP64
+       .quad 0
+#else
        .long 0
+#endif
diff -r 74158ff7bf28 -r 709e7791cb38 lib/csu/arch/powerpc/crti.S
--- a/lib/csu/arch/powerpc/crti.S       Thu Feb 27 16:00:32 2014 +0000
+++ b/lib/csu/arch/powerpc/crti.S       Thu Feb 27 16:47:48 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: crti.S,v 1.1 2011/02/08 02:02:25 matt Exp $ */
+/* $NetBSD: crti.S,v 1.2 2014/02/27 16:47:48 matt Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -31,20 +31,54 @@
 
 #include <powerpc/asm.h>
 
-RCSID("$NetBSD: crti.S,v 1.1 2011/02/08 02:02:25 matt Exp $")
+RCSID("$NetBSD: crti.S,v 1.2 2014/02/27 16:47:48 matt Exp $")
 
 #include "sysident.S"
 
+       .globl  _init
+       .type   _init,@function
        .section ".init", "ax", @progbits
-       .align 2; .globl _init; .type _init,@function
+       .align  P2SZREG
+#ifdef _LP64
+       .globl  ._init
+       .pushsection ".opd", "aw"
+       .align  3
+_init: .quad   ._init,.TOC.@tocbase,0
+       .size   _init, (3*SZREG)
+       .popsection
+._init:
+#else
 _init:
+#endif
        mflr    %r0
+#ifdef _LP64
+       stlongu %r1, -(6*SZREG)(%r1)
+       stlong  %r0, (2*SZREG)(%r1)
+#else
        stw     %r0, (1*SZREG)(%r1)
        stwu    %r1, -(4*SZREG)(%r1)
+#endif
 
+       .globl _fini
+       .type   _fini,@function
        .section ".fini", "ax", @progbits
-       .align 2; .globl _fini; .type _fini,@function
+       .align  P2SZREG
+#ifdef _LP64
+       .globl  ._fini
+       .pushsection ".opd", "aw"
+       .align  3
+_fini: .quad   ._fini,.TOC.@tocbase,0
+       .size   _fini, (3*SZREG)
+       .popsection
+._fini:
+#else
 _fini:
+#endif
        mflr    %r0
+#ifdef _LP64
+       stlongu %r1, -(6*SZREG)(%r1)
+       stlong  %r0, (2*SZREG)(%r1)
+#else
        stw     %r0, (1*SZREG)(%r1)
        stwu    %r1, -(4*SZREG)(%r1)
+#endif
diff -r 74158ff7bf28 -r 709e7791cb38 lib/csu/arch/powerpc/crtn.S
--- a/lib/csu/arch/powerpc/crtn.S       Thu Feb 27 16:00:32 2014 +0000
+++ b/lib/csu/arch/powerpc/crtn.S       Thu Feb 27 16:47:48 2014 +0000
@@ -29,16 +29,26 @@
 
 #include <powerpc/asm.h>
 
-RCSID("$NetBSD: crtn.S,v 1.1 2011/02/08 02:02:25 matt Exp $")
+RCSID("$NetBSD: crtn.S,v 1.2 2014/02/27 16:47:48 matt Exp $")
 
        .section ".init", "ax", @progbits
+#ifdef _LP64
+       ldreg   %r0, (2*SZREG)(%r1)
+       addi    %r1, %r1, (6*SZREG)
+#else
        addi    %r1, %r1, (4*SZREG)
        lwz     %r0, (1*SZREG)(%r1)
+#endif
        mtlr    %r0
        blr
 
        .section ".fini", "ax", @progbits
+#ifdef _LP64
+       ldreg   %r0, (2*SZREG)(%r1)
+       addi    %r1, %r1, (6*SZREG)
+#else
        addi    %r1, %r1, (4*SZREG)
        lwz     %r0, (1*SZREG)(%r1)
+#endif
        mtlr    %r0
        blr



Home | Main Index | Thread Index | Old Index