Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/arm Add support for EABI syscalls.



details:   https://anonhg.NetBSD.org/src/rev/e40fa2dfd5d1
branches:  trunk
changeset: 795181:e40fa2dfd5d1
user:      rjs <rjs%NetBSD.org@localhost>
date:      Thu Apr 03 16:22:20 2014 +0000

description:
Add support for EABI syscalls.

diffstat:

 sys/arch/arm/arm/linux_syscall.c |  29 +++++++++++++++++++++--------
 1 files changed, 21 insertions(+), 8 deletions(-)

diffs (64 lines):

diff -r ef36767949ab -r e40fa2dfd5d1 sys/arch/arm/arm/linux_syscall.c
--- a/sys/arch/arm/arm/linux_syscall.c  Thu Apr 03 15:53:05 2014 +0000
+++ b/sys/arch/arm/arm/linux_syscall.c  Thu Apr 03 16:22:20 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_syscall.c,v 1.25 2013/08/18 07:01:45 matt Exp $  */
+/*     $NetBSD: linux_syscall.c,v 1.26 2014/04/03 16:22:20 rjs Exp $   */
 
 /*-
  * Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.25 2013/08/18 07:01:45 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.26 2014/04/03 16:22:20 rjs Exp $");
 
 #include <sys/device.h>
 #include <sys/errno.h>
@@ -90,6 +90,7 @@
 
 /* ARMLinux has some system calls of its very own. */
 #define LINUX_ARM_NR_BASE      0x9f0000
+#define LINUX_EARM_NR_BASE     0x0f0000
 #define LINUX_SYS_ARMBASE      0x000180 /* Must agree with syscalls.master */
 
 void linux_syscall_intern(struct proc *);
@@ -115,9 +116,15 @@
        register_t *args, rval[2];
 
        code = insn & 0x00ffffff;
-       /* Remap ARM-specific syscalls onto the end of the standard range. */
-       if (code > LINUX_ARM_NR_BASE)
-               code = code - LINUX_ARM_NR_BASE + LINUX_SYS_ARMBASE;
+       if (code == 0) {        /* EABI */
+               code = frame->tf_r7;
+               if (code > LINUX_EARM_NR_BASE)
+                       code = code - LINUX_EARM_NR_BASE + LINUX_SYS_ARMBASE;
+       } else {
+               /* Remap ARM-specific syscalls onto the end of the standard range. */
+               if (code > LINUX_ARM_NR_BASE)
+                       code = code - LINUX_ARM_NR_BASE + LINUX_SYS_ARMBASE;
+       }
        code &= LINUX_SYS_NSYSENT - 1;
 
        /* Linux passes all arguments in order in registers, which is nice. */
@@ -160,9 +167,15 @@
        register_t *args, rval[2];
 
        code = insn & 0x00ffffff;
-       /* Remap ARM-specific syscalls onto the end of the standard range. */
-       if (code > LINUX_ARM_NR_BASE)
-               code = code - LINUX_ARM_NR_BASE + LINUX_SYS_ARMBASE;
+       if (code == 0) {        /* EABI */
+               code = frame->tf_r7;
+               if (code > LINUX_EARM_NR_BASE)
+                       code = code - LINUX_EARM_NR_BASE + LINUX_SYS_ARMBASE;
+       } else {
+               /* Remap ARM-specific syscalls onto the end of the standard range. */
+               if (code > LINUX_ARM_NR_BASE)
+                       code = code - LINUX_ARM_NR_BASE + LINUX_SYS_ARMBASE;
+       }
        code &= LINUX_SYS_NSYSENT - 1;
 
        /* Linux passes all arguments in order in registers, which is nice. */



Home | Main Index | Thread Index | Old Index