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

TOMOYO Linux Cross Reference
Linux/arch/blackfin/kernel/sys_bfin.c

Version: ~ [ linux-5.5-rc1 ] ~ [ linux-5.4.2 ] ~ [ linux-5.3.15 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.88 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.158 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.206 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.206 ] ~ [ 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.78 ] ~ [ 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-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ 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  * contains various random system calls that have a non-standard
  3  * calling sequence on the Linux/Blackfin platform.
  4  *
  5  * Copyright 2004-2009 Analog Devices Inc.
  6  *
  7  * Licensed under the GPL-2 or later
  8  */
  9 
 10 #include <linux/spinlock.h>
 11 #include <linux/sem.h>
 12 #include <linux/msg.h>
 13 #include <linux/shm.h>
 14 #include <linux/syscalls.h>
 15 #include <linux/mman.h>
 16 #include <linux/file.h>
 17 #include <linux/fs.h>
 18 #include <linux/uaccess.h>
 19 #include <linux/ipc.h>
 20 #include <linux/unistd.h>
 21 
 22 #include <asm/cacheflush.h>
 23 #include <asm/dma.h>
 24 #include <asm/cachectl.h>
 25 #include <asm/ptrace.h>
 26 
 27 asmlinkage void *sys_sram_alloc(size_t size, unsigned long flags)
 28 {
 29         return sram_alloc_with_lsl(size, flags);
 30 }
 31 
 32 asmlinkage int sys_sram_free(const void *addr)
 33 {
 34         return sram_free_with_lsl(addr);
 35 }
 36 
 37 asmlinkage void *sys_dma_memcpy(void *dest, const void *src, size_t len)
 38 {
 39         return safe_dma_memcpy(dest, src, len);
 40 }
 41 
 42 #if defined(CONFIG_FB) || defined(CONFIG_FB_MODULE)
 43 #include <linux/fb.h>
 44 #include <linux/export.h>
 45 unsigned long get_fb_unmapped_area(struct file *filp, unsigned long orig_addr,
 46         unsigned long len, unsigned long pgoff, unsigned long flags)
 47 {
 48         struct fb_info *info = filp->private_data;
 49         return (unsigned long)info->screen_base;
 50 }
 51 EXPORT_SYMBOL(get_fb_unmapped_area);
 52 #endif
 53 
 54 /* Needed for legacy userspace atomic emulation */
 55 static DEFINE_SPINLOCK(bfin_spinlock_lock);
 56 
 57 #ifdef CONFIG_SYS_BFIN_SPINLOCK_L1
 58 __attribute__((l1_text))
 59 #endif
 60 asmlinkage int sys_bfin_spinlock(int *p)
 61 {
 62         int ret, tmp = 0;
 63 
 64         spin_lock(&bfin_spinlock_lock); /* This would also hold kernel preemption. */
 65         ret = get_user(tmp, p);
 66         if (likely(ret == 0)) {
 67                 if (unlikely(tmp))
 68                         ret = 1;
 69                 else
 70                         put_user(1, p);
 71         }
 72         spin_unlock(&bfin_spinlock_lock);
 73 
 74         return ret;
 75 }
 76 
 77 SYSCALL_DEFINE3(cacheflush, unsigned long, addr, unsigned long, len, int, op)
 78 {
 79         if (is_user_addr_valid(current, addr, len) != 0)
 80                 return -EINVAL;
 81 
 82         if (op & DCACHE)
 83                 blackfin_dcache_flush_range(addr, addr + len);
 84         if (op & ICACHE)
 85                 blackfin_icache_flush_range(addr, addr + len);
 86 
 87         return 0;
 88 }
 89 

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