9os

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 0aa651f4ddda82892dbb6d01c4c0631aadd90606
parent 8f6427c306c22e4356821f1a7194466670d0866c
Author: Dimitris Papastamos <dimitris.papastamos@arm.com>
Date:   Thu, 22 Nov 2018 09:02:37 +0000

Merge "[arch/amd64] Unify all the crt"
Diffstat:
March/amd64/Makefile | 4++--
Darch/amd64/crt-dragonfly.s | 2--
Darch/amd64/crt-linux.s | 2--
Darch/amd64/crt-netbsd.s | 12------------
Darch/amd64/crt-openbsd.s | 12------------
Darch/amd64/crt-posix.s | 19-------------------
Aarch/amd64/crt.s | 37+++++++++++++++++++++++++++++++++++++
7 files changed, 39 insertions(+), 49 deletions(-)

diff --git a/arch/amd64/Makefile b/arch/amd64/Makefile @@ -2,13 +2,13 @@ PROJECTDIR = ../.. include $(PROJECTDIR)/scripts/rules.mk -ROMOBJS = crt-$(SYS).o \ +ROMOBJS = crt.o \ arch.o \ rom.o \ bss.o \ $(SRCDIR)/romfw/builtin.o \ -RAMOBJS = crt-$(SYS).o \ +RAMOBJS = crt.o \ arch.o \ ram.o \ bss.o \ diff --git a/arch/amd64/crt-dragonfly.s b/arch/amd64/crt-dragonfly.s @@ -1,2 +0,0 @@ - .file "crt-dragonfly.s" - .include "crt-posix.s" diff --git a/arch/amd64/crt-linux.s b/arch/amd64/crt-linux.s @@ -1,2 +0,0 @@ - .file "crt-linux.s" - .include "crt-posix.s" diff --git a/arch/amd64/crt-netbsd.s b/arch/amd64/crt-netbsd.s @@ -1,12 +0,0 @@ - .file "crt-netbsd.s" - - .section ".note.netbsd.ident", "a" - .p2align 2 - - .long 7 - .long 4 - .long 1 - .ascii "NetBSD\0\0" - .long 800000000 - - .include "crt-posix.s" diff --git a/arch/amd64/crt-openbsd.s b/arch/amd64/crt-openbsd.s @@ -1,12 +0,0 @@ - .file "crt-openbsd.s" - - .section ".note.openbsd.ident", "a" - .p2align 2 - .long 8 - .long 4 - .long 1 - .ascii "OpenBSD\0" - .long 0 - .p2align 2 - - .include "crt-posix.s" diff --git a/arch/amd64/crt-posix.s b/arch/amd64/crt-posix.s @@ -1,19 +0,0 @@ - .bss - .globl _environ -_environ: - .quad 0 - - .text - .global _start -_start: - movq %rsp,%rbp - - /* load argc, argv, envp from stack */ - movq (%rbp),%rdi /* argc */ - leaq 8(%rbp),%rsi /* argv */ - leaq 16(%rbp,%rax,8),%rcx /* envp = argv + 8*argc + 8 */ - movq %rdx,_environ - - call main - movl %eax,%edi - jmp exit diff --git a/arch/amd64/crt.s b/arch/amd64/crt.s @@ -0,0 +1,37 @@ + .section ".note.openbsd.ident", "a" + .p2align 2 + .long 8 + .long 4 + .long 1 + .ascii "OpenBSD\0" + .long 0 + .p2align 2 + + .section ".note.netbsd.ident", "a" + .p2align 2 + + .long 7 + .long 4 + .long 1 + .ascii "NetBSD\0\0" + .long 800000000 + + .bss + .globl _environ +_environ: + .quad 0 + + .text + .global _start +_start: + movq %rsp,%rbp + + /* load argc, argv, envp from stack */ + movq (%rbp),%rdi /* argc */ + leaq 8(%rbp),%rsi /* argv */ + leaq 16(%rbp,%rax,8),%rcx /* envp = argv + 8*argc + 8 */ + movq %rdx,_environ + + call main + movl %eax,%edi + jmp exit