This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 005/114] Add crt0.S and syscall.S implementation for arm-phoenix.


From: Kuba Sejdak <jakub.sejdak@phoesys.com>

---
 newlib/libc/sys/phoenix/machine/arm/crt0.S    | 41 ++++++++++++++++++++++++
 newlib/libc/sys/phoenix/machine/arm/syscall.S | 46 +++++++++++++++++++++++++++
 2 files changed, 87 insertions(+)
 create mode 100644 newlib/libc/sys/phoenix/machine/arm/crt0.S
 create mode 100644 newlib/libc/sys/phoenix/machine/arm/syscall.S

diff --git a/newlib/libc/sys/phoenix/machine/arm/crt0.S b/newlib/libc/sys/phoenix/machine/arm/crt0.S
new file mode 100644
index 0000000..4643831
--- /dev/null
+++ b/newlib/libc/sys/phoenix/machine/arm/crt0.S
@@ -0,0 +1,41 @@
+/* Copyright (C) 2012-2016 Phoenix Systems (http://www.phoesys.com/).
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+	.syntax	unified
+	.section	.text, "ax"
+	.global		_start
+	.global		main
+	.global		exit
+	.global		environ
+
+	.align	4
+
+_start:
+	/* Ignore return address passed on the top of stack. */
+	pop		{lr}
+	ldmfd	sp,	{r0-r2}
+	ldr		r3,	=environ
+	str		r2,	[r3]
+
+	/* Align stack. */
+	bic		sp,	#0x00000007
+	ldr		lr,	=main
+	blx		lr
+	ldr		lr,	=exit
+	blx		lr
+	
\ No newline at end of file
diff --git a/newlib/libc/sys/phoenix/machine/arm/syscall.S b/newlib/libc/sys/phoenix/machine/arm/syscall.S
new file mode 100644
index 0000000..433823b
--- /dev/null
+++ b/newlib/libc/sys/phoenix/machine/arm/syscall.S
@@ -0,0 +1,46 @@
+/* Copyright (C) 2012-2016 Phoenix Systems (http://www.phoesys.com/).
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+	.thumb
+	.syntax	unified
+	.section	.text, "ax"
+	.global		_syscall5
+	.global		_syscall3
+	.global		hal_cpuRestoreCtx
+
+	.type _syscall5, %function
+	.func _syscall5
+
+_syscall5:
+	push	{r4, r5}
+	ldr		r4,	[sp, #8]
+	ldr		r5,	[sp, #12]
+	svc		#255
+	pop		{r4, r5}
+	bx		lr
+	.endfunc
+
+	.type _syscall3, %function
+	.func _syscall3
+
+_syscall3:
+	svc		#255
+	bx		lr
+	.endfunc
+
+	.end
-- 
2.5.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]