~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/mips/kernel/scall64-n32.S

Version: ~ [ linux-5.15-rc1 ] ~ [ linux-5.14.5 ] ~ [ linux-5.13.18 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.66 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.147 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.206 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.246 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.282 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.283 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * This file is subject to the terms and conditions of the GNU General Public
  3  * License.  See the file "COPYING" in the main directory of this archive
  4  * for more details.
  5  *
  6  * Copyright (C) 1995, 96, 97, 98, 99, 2000, 01 by Ralf Baechle
  7  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  8  * Copyright (C) 2001 MIPS Technologies, Inc.
  9  */
 10 #include <linux/errno.h>
 11 #include <asm/asm.h>
 12 #include <asm/asmmacro.h>
 13 #include <asm/irqflags.h>
 14 #include <asm/mipsregs.h>
 15 #include <asm/regdef.h>
 16 #include <asm/stackframe.h>
 17 #include <asm/thread_info.h>
 18 #include <asm/unistd.h>
 19 
 20 #ifndef CONFIG_MIPS32_O32
 21 /* No O32, so define handle_sys here */
 22 #define handle_sysn32 handle_sys
 23 #endif
 24 
 25         .align  5
 26 NESTED(handle_sysn32, PT_SIZE, sp)
 27 #ifndef CONFIG_MIPS32_O32
 28         .set    noat
 29         SAVE_SOME
 30         TRACE_IRQS_ON_RELOAD
 31         STI
 32         .set    at
 33 #endif
 34 
 35         dsubu   t0, v0, __NR_N32_Linux  # check syscall number
 36         sltiu   t0, t0, __NR_N32_Linux_syscalls
 37 
 38 #ifndef CONFIG_MIPS32_O32
 39         ld      t1, PT_EPC(sp)          # skip syscall on return
 40         daddiu  t1, 4                   # skip to next instruction
 41         sd      t1, PT_EPC(sp)
 42 #endif
 43         beqz    t0, not_n32_scall
 44 
 45         sd      a3, PT_R26(sp)          # save a3 for syscall restarting
 46 
 47         li      t1, _TIF_WORK_SYSCALL_ENTRY
 48         LONG_L  t0, TI_FLAGS($28)       # syscall tracing enabled?
 49         and     t0, t1, t0
 50         bnez    t0, n32_syscall_trace_entry
 51 
 52 syscall_common:
 53         dsll    t0, v0, 3               # offset into table
 54         ld      t2, (sysn32_call_table - (__NR_N32_Linux * 8))(t0)
 55 
 56         jalr    t2                      # Do The Real Thing (TM)
 57 
 58         li      t0, -EMAXERRNO - 1      # error?
 59         sltu    t0, t0, v0
 60         sd      t0, PT_R7(sp)           # set error flag
 61         beqz    t0, 1f
 62 
 63         ld      t1, PT_R2(sp)           # syscall number
 64         dnegu   v0                      # error
 65         sd      t1, PT_R0(sp)           # save it for syscall restarting
 66 1:      sd      v0, PT_R2(sp)           # result
 67 
 68         j       syscall_exit_partial
 69 
 70 /* ------------------------------------------------------------------------ */
 71 
 72 n32_syscall_trace_entry:
 73         SAVE_STATIC
 74         move    a0, sp
 75         move    a1, v0
 76         jal     syscall_trace_enter
 77 
 78         bltz    v0, 1f                  # seccomp failed? Skip syscall
 79 
 80         RESTORE_STATIC
 81         ld      v0, PT_R2(sp)           # Restore syscall (maybe modified)
 82         ld      a0, PT_R4(sp)           # Restore argument registers
 83         ld      a1, PT_R5(sp)
 84         ld      a2, PT_R6(sp)
 85         ld      a3, PT_R7(sp)
 86         ld      a4, PT_R8(sp)
 87         ld      a5, PT_R9(sp)
 88 
 89         dsubu   t2, v0, __NR_N32_Linux  # check (new) syscall number
 90         sltiu   t0, t2, __NR_N32_Linux_syscalls
 91         beqz    t0, not_n32_scall
 92 
 93         j       syscall_common
 94 
 95 1:      j       syscall_exit
 96 
 97 not_n32_scall:
 98         /* This is not an n32 compatibility syscall, pass it on to
 99            the n64 syscall handlers.  */
100         j       handle_sys64
101 
102         END(handle_sysn32)
103 
104 #define __SYSCALL(nr, entry)    PTR entry
105         .type   sysn32_call_table, @object
106 EXPORT(sysn32_call_table)
107 #include <asm/syscall_table_64_n32.h>
108 #undef __SYSCALL

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp