aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-frv
ModeNameSize
-rw-r--r--Kbuild130logstatsplainblame
-rw-r--r--a.out.h188logstatsplainblame
-rw-r--r--atomic.h9076logstatsplainblame
-rw-r--r--auxvec.h54logstatsplainblame
-rw-r--r--ax88796.h751logstatsplainblame
-rw-r--r--bitops.h7106logstatsplainblame
-rw-r--r--bug.h1293logstatsplainblame
-rw-r--r--bugs.h445logstatsplainblame
-rw-r--r--busctl-regs.h2071logstatsplainblame
-rw-r--r--byteorder.h290logstatsplainblame
-rw-r--r--cache.h727logstatsplainblame
-rw-r--r--cacheflush.h3082logstatsplainblame
-rw-r--r--checksum.h4672logstatsplainblame
-rw-r--r--cpu-irqs.h2654logstatsplainblame
-rw-r--r--cpumask.h109logstatsplainblame
-rw-r--r--cputime.h109logstatsplainblame
-rw-r--r--current.h685logstatsplainblame
-rw-r--r--delay.h1313logstatsplainblame
-rw-r--r--device.h129logstatsplainblame
-rw-r--r--div64.h31logstatsplainblame
-rw-r--r--dm9000.h1151logstatsplainblame
-rw-r--r--dma-mapping.h5223logstatsplainblame
-rw-r--r--dma.h3717logstatsplainblame
-rw-r--r--elf.h5410logstatsplainblame
-rw-r--r--emergency-restart.h149logstatsplainblame
-rw-r--r--errno.h102logstatsplainblame
-rw-r--r--fcntl.h31logstatsplainblame
-rw-r--r--fpu.h222logstatsplainblame
-rw-r--r--futex.h334logstatsplainblame
-rw-r--r--gdb-stub.h4462logstatsplainblame
-rw-r--r--gpio-regs.h3724logstatsplainblame
-rw-r--r--hardirq.h901logstatsplainblame
-rw-r--r--highmem.h5361logstatsplainblame
-rw-r--r--hw_irq.h484logstatsplainblame
-rw-r--r--ide.h1190logstatsplainblame
-rw-r--r--init.h340logstatsplainblame
-rw-r--r--io.h9345logstatsplainblame
-rw-r--r--ioctl.h31logstatsplainblame
-rw-r--r--ioctls.h2458logstatsplainblame
-rw-r--r--ipc.h29logstatsplainblame
-rw-r--r--ipcbuf.h629logstatsplainblame
-rw-r--r--irc-regs.h1825logstatsplainblame
-rw-r--r--irq.h846logstatsplainblame
-rw-r--r--irq_regs.h764logstatsplainblame
-rw-r--r--kmap_types.h641logstatsplainblame
-rw-r--r--linkage.h114logstatsplainblame
-rw-r--r--local.h101logstatsplainblame
-rw-r--r--math-emu.h6493logstatsplainblame
-rw-r--r--mb-regs.h7109logstatsplainblame
-rw-r--r--mb86943a.h1763logstatsplainblame
-rw-r--r--mb93091-fpga-irqs.h1084logstatsplainblame
-rw-r--r--mb93093-fpga-irqs.h789logstatsplainblame
-rw-r--r--mb93493-irqs.h1728logstatsplainblame
-rw-r--r--mb93493-regs.h12759logstatsplainblame
-rw-r--r--mc146818rtc.h485logstatsplainblame
-rw-r--r--mem-layout.h2035logstatsplainblame
-rw-r--r--mman.h614logstatsplainblame
-rw-r--r--mmu.h1320logstatsplainblame
-rw-r--r--mmu_context.h1381logstatsplainblame
-rw-r--r--module.h699logstatsplainblame
-rw-r--r--msgbuf.h980logstatsplainblame
-rw-r--r--mutex.h308logstatsplainblame
-rw-r--r--namei.h295logstatsplainblame
-rw-r--r--page.h2421logstatsplainblame
-rw-r--r--param.h436logstatsplainblame
-rw-r--r--pci.h3762logstatsplainblame
-rw-r--r--percpu.h108logstatsplainblame
-rw-r--r--pgalloc.h1712logstatsplainblame
-rw-r--r--pgtable.h17703logstatsplainblame
-rw-r--r--poll.h386logstatsplainblame
-rw-r--r--posix_types.h1948logstatsplainblame
-rw-r--r--processor.h4120logstatsplainblame
-rw-r--r--ptrace.h2566logstatsplainblame
-rw-r--r--registers.h6909logstatsplainblame
-rw-r--r--resource.h114logstatsplainblame
-rw-r--r--scatterlist.h942logstatsplainblame
-rw-r--r--sections.h1266logstatsplainblame
-rw-r--r--segment.h1107logstatsplainblame
-rw-r--r--semaphore.h3590logstatsplainblame
-rw-r--r--sembuf.h697logstatsplainblame
-rw-r--r--serial-regs.h1670logstatsplainblame
-rw-r--r--serial.h378logstatsplainblame
-rw-r--r--setup.h697logstatsplainblame
-rw-r--r--shmbuf.h1161logstatsplainblame
-rw-r--r--shmparam.h144logstatsplainblame
-rw-r--r--sigcontext.h803logstatsplainblame
-rw-r--r--siginfo.h204logstatsplainblame
-rw-r--r--signal.h3491logstatsplainblame
-rw-r--r--smp.h100logstatsplainblame
-rw-r--r--socket.h1167logstatsplainblame
-rw-r--r--sockios.h285logstatsplainblame
-rw-r--r--spinlock.h516logstatsplainblame
-rw-r--r--spr-regs.h17852logstatsplainblame
-rw-r--r--stat.h2224logstatsplainblame
-rw-r--r--statfs.h106logstatsplainblame
-rw-r--r--string.h1427logstatsplainblame
-rw-r--r--suspend.h537logstatsplainblame
-rw-r--r--system.h5260logstatsplainblame
-rw-r--r--termbits.h4256logstatsplainblame
-rw-r--r--termios.h2058logstatsplainblame
-rw-r--r--thread_info.h4415logstatsplainblame
-rw-r--r--timer-regs.h3719logstatsplainblame
-rw-r--r--timex.h408logstatsplainblame
-rw-r--r--tlb.h510logstatsplainblame
-rw-r--r--tlbflush.h2088logstatsplainblame
-rw-r--r--topology.h216logstatsplainblame
-rw-r--r--types.h1456logstatsplainblame
-rw-r--r--uaccess.h8430logstatsplainblame
-rw-r--r--ucontext.h242logstatsplainblame
-rw-r--r--unaligned.h5639logstatsplainblame
-rw-r--r--unistd.h10333logstatsplainblame
-rw-r--r--user.h3372logstatsplainblame
-rw-r--r--vga.h464logstatsplainblame
-rw-r--r--virtconvert.h1118logstatsplainblame
-rw-r--r--xor.h29logstatsplainblame
pan> unsigned long start, unsigned long end) { *prev = vma; if (vma->vm_flags & (VM_LOCKED|VM_HUGETLB|VM_PFNMAP)) return -EINVAL; if (unlikely(vma->vm_flags & VM_NONLINEAR)) { struct zap_details details = { .nonlinear_vma = vma, .last_index = ULONG_MAX, }; zap_page_range(vma, start, end - start, &details); } else zap_page_range(vma, start, end - start, NULL); return 0; } /* * Application wants to free up the pages and associated backing store. * This is effectively punching a hole into the middle of a file. * * NOTE: Currently, only shmfs/tmpfs is supported for this operation. * Other filesystems return -ENOSYS. */ static long madvise_remove(struct vm_area_struct *vma, struct vm_area_struct **prev, unsigned long start, unsigned long end) { struct address_space *mapping; loff_t offset, endoff; int error; *prev = NULL; /* tell sys_madvise we drop mmap_sem */ if (vma->vm_flags & (VM_LOCKED|VM_NONLINEAR|VM_HUGETLB)) return -EINVAL; if (!vma->vm_file || !vma->vm_file->f_mapping || !vma->vm_file->f_mapping->host) { return -EINVAL; } if ((vma->vm_flags & (VM_SHARED|VM_WRITE)) != (VM_SHARED|VM_WRITE)) return -EACCES; mapping = vma->vm_file->f_mapping; offset = (loff_t)(start - vma->vm_start) + ((loff_t)vma->vm_pgoff << PAGE_SHIFT); endoff = (loff_t)(end - vma->vm_start - 1) + ((loff_t)vma->vm_pgoff << PAGE_SHIFT); /* vmtruncate_range needs to take i_mutex and i_alloc_sem */ up_read(&current->mm->mmap_sem); error = vmtruncate_range(mapping->host, offset, endoff); down_read(&current->mm->mmap_sem); return error; } static long madvise_vma(struct vm_area_struct *vma, struct vm_area_struct **prev, unsigned long start, unsigned long end, int behavior) { long error; switch (behavior) { case MADV_DOFORK: if (vma->vm_flags & VM_IO) { error = -EINVAL; break; } case MADV_DONTFORK: case MADV_NORMAL: case MADV_SEQUENTIAL: case MADV_RANDOM: error = madvise_behavior(vma, prev, start, end, behavior); break; case MADV_REMOVE: error = madvise_remove(vma, prev, start, end); break; case MADV_WILLNEED: error = madvise_willneed(vma, prev, start, end); break; case MADV_DONTNEED: error = madvise_dontneed(vma, prev, start, end); break; default: BUG(); break; } return error; } static int madvise_behavior_valid(int behavior) { switch (behavior) { case MADV_DOFORK: case MADV_DONTFORK: case MADV_NORMAL: case MADV_SEQUENTIAL: case MADV_RANDOM: case MADV_REMOVE: case MADV_WILLNEED: case MADV_DONTNEED: return 1; default: return 0; } } /* * The madvise(2) system call. * * Applications can use madvise() to advise the kernel how it should * handle paging I/O in this VM area. The idea is to help the kernel * use appropriate read-ahead and caching techniques. The information * provided is advisory only, and can be safely disregarded by the * kernel without affecting the correct operation of the application. * * behavior values: * MADV_NORMAL - the default behavior is to read clusters. This * results in some read-ahead and read-behind. * MADV_RANDOM - the system should read the minimum amount of data * on any access, since it is unlikely that the appli- * cation will need more than what it asks for. * MADV_SEQUENTIAL - pages in the given range will probably be accessed * once, so they can be aggressively read ahead, and * can be freed soon after they are accessed. * MADV_WILLNEED - the application is notifying the system to read * some pages ahead. * MADV_DONTNEED - the application is finished with the given range, * so the kernel can free resources associated with it. * MADV_REMOVE - the application wants to free up the given range of * pages and associated backing store. * * return values: * zero - success * -EINVAL - start + len < 0, start is not page-aligned, * "behavior" is not a valid value, or application * is attempting to release locked or shared pages. * -ENOMEM - addresses in the specified range are not currently * mapped, or are outside the AS of the process. * -EIO - an I/O error occurred while paging in data. * -EBADF - map exists, but area maps something that isn't a file. * -EAGAIN - a kernel resource was temporarily unavailable. */ SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior) { unsigned long end, tmp; struct vm_area_struct * vma, *prev; int unmapped_error = 0; int error = -EINVAL; int write; size_t len; if (!madvise_behavior_valid(behavior)) return error; write = madvise_need_mmap_write(behavior); if (write) down_write(&current->mm->mmap_sem); else down_read(&current->mm->mmap_sem); if (start & ~PAGE_MASK) goto out; len = (len_in + ~PAGE_MASK) & PAGE_MASK; /* Check to see whether len was rounded up from small -ve to zero */ if (len_in && !len) goto out; end = start + len; if (end < start) goto out; error = 0; if (end == start) goto out; /* * If the interval [start,end) covers some unmapped address * ranges, just ignore them, but return -ENOMEM at the end. * - different from the way of handling in mlock etc. */ vma = find_vma_prev(current->mm, start, &prev); if (vma && start > vma->vm_start) prev = vma; for (;;) { /* Still start < end. */ error = -ENOMEM; if (!vma) goto out; /* Here start < (end|vma->vm_end). */ if (start < vma->vm_start) { unmapped_error = -ENOMEM; start = vma->vm_start; if (start >= end) goto out; } /* Here vma->vm_start <= start < (end|vma->vm_end) */ tmp = vma->vm_end; if (end < tmp) tmp = end; /* Here vma->vm_start <= start < tmp <= (end|vma->vm_end). */ error = madvise_vma(vma, &prev, start, tmp, behavior); if (error) goto out; start = tmp; if (prev && start < prev->vm_end) start = prev->vm_end; error = unmapped_error; if (start >= end) goto out; if (prev) vma = prev->vm_next; else /* madvise_remove dropped mmap_sem */ vma = find_vma(current->mm, start); } out: if (write) up_write(&current->mm->mmap_sem); else up_read(&current->mm->mmap_sem); return error; }