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

TOMOYO Linux Cross Reference
Linux/arch/nds32/kernel/sys_nds32.c

Version: ~ [ linux-5.8-rc5 ] ~ [ linux-5.7.8 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.51 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.132 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.188 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.230 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.230 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ 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 // SPDX-License-Identifier: GPL-2.0
  2 // Copyright (C) 2005-2017 Andes Technology Corporation
  3 
  4 #include <linux/syscalls.h>
  5 #include <linux/uaccess.h>
  6 
  7 #include <asm/cachectl.h>
  8 #include <asm/proc-fns.h>
  9 #include <asm/fpu.h>
 10 #include <asm/fp_udfiex_crtl.h>
 11 
 12 SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
 13                unsigned long, prot, unsigned long, flags,
 14                unsigned long, fd, unsigned long, pgoff)
 15 {
 16         if (pgoff & (~PAGE_MASK >> 12))
 17                 return -EINVAL;
 18 
 19         return sys_mmap_pgoff(addr, len, prot, flags, fd,
 20                               pgoff >> (PAGE_SHIFT - 12));
 21 }
 22 
 23 SYSCALL_DEFINE4(fadvise64_64_wrapper,int, fd, int, advice, loff_t, offset,
 24                                          loff_t, len)
 25 {
 26         return sys_fadvise64_64(fd, offset, len, advice);
 27 }
 28 
 29 SYSCALL_DEFINE3(cacheflush, unsigned int, start, unsigned int, end, int, cache)
 30 {
 31         struct vm_area_struct *vma;
 32         bool flushi = true, wbd = true;
 33 
 34         vma = find_vma(current->mm, start);
 35         if (!vma)
 36                 return -EFAULT;
 37         switch (cache) {
 38         case ICACHE:
 39                 wbd = false;
 40                 break;
 41         case DCACHE:
 42                 flushi = false;
 43                 break;
 44         case BCACHE:
 45                 break;
 46         default:
 47                 return -EINVAL;
 48         }
 49         cpu_cache_wbinval_range_check(vma, start, end, flushi, wbd);
 50 
 51         return 0;
 52 }
 53 
 54 SYSCALL_DEFINE2(fp_udfiex_crtl, unsigned int, cmd, unsigned int, act)
 55 {
 56 #if IS_ENABLED(CONFIG_SUPPORT_DENORMAL_ARITHMETIC)
 57         int old_udf_iex;
 58 
 59         if (!used_math()) {
 60                 load_fpu(&init_fpuregs);
 61                 current->thread.fpu.UDF_IEX_trap = init_fpuregs.UDF_IEX_trap;
 62                 set_used_math();
 63         }
 64 
 65         old_udf_iex = current->thread.fpu.UDF_IEX_trap;
 66         act &= (FPCSR_mskUDFE | FPCSR_mskIEXE);
 67 
 68         switch (cmd) {
 69         case DISABLE_UDF_IEX_TRAP:
 70                 current->thread.fpu.UDF_IEX_trap &= ~act;
 71                 break;
 72         case ENABLE_UDF_IEX_TRAP:
 73                 current->thread.fpu.UDF_IEX_trap |= act;
 74                 break;
 75         case GET_UDF_IEX_TRAP:
 76                 break;
 77         default:
 78                 return -EINVAL;
 79         }
 80         return old_udf_iex;
 81 #else
 82         return -ENOTSUPP;
 83 #endif
 84 }
 85 

~ [ 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