Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/csu/arch/alpha Add crtstuff for alpha. Compile tested o...
details: https://anonhg.NetBSD.org/src/rev/5898f482ac3b
branches: trunk
changeset: 787894:5898f482ac3b
user: matt <matt%NetBSD.org@localhost>
date: Thu Jul 11 16:40:27 2013 +0000
description:
Add crtstuff for alpha. Compile tested only.
diffstat:
lib/csu/arch/alpha/Makefile.inc | 3 ++
lib/csu/arch/alpha/crt0.S | 54 ++++++++++++++++++++++++++++++++++++++++
lib/csu/arch/alpha/crtbegin.h | 50 +++++++++++++++++++++++++++++++++++++
lib/csu/arch/alpha/crtend.S | 55 +++++++++++++++++++++++++++++++++++++++++
lib/csu/arch/alpha/crti.S | 55 +++++++++++++++++++++++++++++++++++++++++
lib/csu/arch/alpha/crtn.S | 45 +++++++++++++++++++++++++++++++++
6 files changed, 262 insertions(+), 0 deletions(-)
diffs (286 lines):
diff -r e712187dc9d6 -r 5898f482ac3b lib/csu/arch/alpha/Makefile.inc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/csu/arch/alpha/Makefile.inc Thu Jul 11 16:40:27 2013 +0000
@@ -0,0 +1,3 @@
+# $NetBSD: Makefile.inc,v 1.1 2013/07/11 16:40:27 matt Exp $
+
+CPPFLAGS+= -I${ARCHDIR} -DELFSIZE=64
diff -r e712187dc9d6 -r 5898f482ac3b lib/csu/arch/alpha/crt0.S
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/csu/arch/alpha/crt0.S Thu Jul 11 16:40:27 2013 +0000
@@ -0,0 +1,54 @@
+/* $NetBSD: crt0.S,v 1.1 2013/07/11 16:40:27 matt Exp $ */
+
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 <alpha/asm.h>
+
+RCSID("$NetBSD: crt0.S,v 1.1 2013/07/11 16:40:27 matt Exp $")
+
+STRONG_ALIAS(_start,__start)
+
+/*
+ * Assumes kernel (or ld_elf.so) passes the following parameters to
+ * user-space in registers:
+ *
+ * a0 stack pointer
+ * a1 cleanup
+ * a2 Obj_Entry
+ * a3 ps_strings
+ */
+
+LEAF(__start, 4)
+ LDGP(pv)
+ mov a1, a0 /* cleanup */
+ mov a2, a1 /* Obj_Entry */
+ mov a3, a2 /* ps_strings */
+ CALL(___start)
+END(__start)
diff -r e712187dc9d6 -r 5898f482ac3b lib/csu/arch/alpha/crtbegin.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/csu/arch/alpha/crtbegin.h Thu Jul 11 16:40:27 2013 +0000
@@ -0,0 +1,50 @@
+/* $NetBSD: crtbegin.h,v 1.1 2013/07/11 16:40:27 matt Exp $ */
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 <sys/cdefs.h>
+#include <alpha/asm.h>
+
+/* Assume we need to reload our GP. */
+__asm( ".pushsection .init"
+"\n\t" "br $29, 1f"
+"\n\t" "1: ldgp $29, 0($29)"
+"\n\t" "unop"
+"\n\t" "jsr $26, __do_global_ctors_aux"
+"\n\t" ".p2align 3"
+"\n\t" ".popsection");
+
+/* Assume we need to reload our GP. */
+__asm( ".pushsection .fini"
+"\n\t" "br $29, 1f"
+"\n\t" "1: ldgp $29, 0($29)"
+"\n\t" "unop"
+"\n\t" "jsr $26, __do_global_dtors_aux"
+"\n\t" ".p2align 3"
+"\n\t" ".popsection");
diff -r e712187dc9d6 -r 5898f482ac3b lib/csu/arch/alpha/crtend.S
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/csu/arch/alpha/crtend.S Thu Jul 11 16:40:27 2013 +0000
@@ -0,0 +1,55 @@
+/* $NetBSD: crtend.S,v 1.1 2013/07/11 16:40:27 matt Exp $ */
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 <alpha/asm.h>
+
+RCSID("$NetBSD: crtend.S,v 1.1 2013/07/11 16:40:27 matt Exp $")
+
+ .section .ctors, "aw", @progbits
+ .p2align 3
+ .global __CTOR_LIST_END__
+ .hidden __CTOR_LIST_END__
+__CTOR_LIST_END__:
+ .word 0
+
+ .section .dtors, "aw", @progbits
+ .p2align 3
+ .global __DTOR_LIST_END__
+ .hidden __DTOR_LIST_END__
+__DTOR_LIST_END__:
+ .word 0
+
+ .section .eh_frame, "a", @progbits
+ .p2align 3
+ .word 0
+
+ .section .jcr, "aw", @progbits
+ .p2align 3
+ .word 0
diff -r e712187dc9d6 -r 5898f482ac3b lib/csu/arch/alpha/crti.S
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/csu/arch/alpha/crti.S Thu Jul 11 16:40:27 2013 +0000
@@ -0,0 +1,55 @@
+/* $NetBSD: crti.S,v 1.1 2013/07/11 16:40:27 matt Exp $ */
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 <alpha/asm.h>
+
+RCSID("$NetBSD: crti.S,v 1.1 2013/07/11 16:40:27 matt Exp $")
+
+#include "sysident.S"
+
+ .section ".init", "ax", @progbits
+ .global _init
+ .type _init, @function
+_init:
+ LDGP(pv)
+ lda sp, -32(sp)
+ stq ra, 0(sp)
+ stq gp, 8(sp)
+ .p2align 5
+
+ .section ".fini", "ax", @progbits
+ .global _fini
+ .type _fini, @function
+_fini:
+ LDGP(pv)
+ lda sp, -32(sp)
+ stq ra, 0(sp)
+ stq gp, 8(sp)
+ .p2align 5
diff -r e712187dc9d6 -r 5898f482ac3b lib/csu/arch/alpha/crtn.S
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/csu/arch/alpha/crtn.S Thu Jul 11 16:40:27 2013 +0000
@@ -0,0 +1,45 @@
+/* $NetBSD: crtn.S,v 1.1 2013/07/11 16:40:27 matt Exp $ */
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 <alpha/asm.h>
+
+RCSID("$NetBSD: crtn.S,v 1.1 2013/07/11 16:40:27 matt Exp $")
+
+ .section ".init", "ax", @progbits
+ ldq gp, 8(sp)
+ ldq ra, 0(sp)
+ lda sp, 32(sp)
+ RET
+
+ .section ".fini", "ax", @progbits
+ ldq gp, 8(sp)
+ ldq ra, 0(sp)
+ lda sp, 32(sp)
+ RET
Home |
Main Index |
Thread Index |
Old Index