92
92
* sys_pipe() is the normal C calling standard for creating
93
93
* a pipe. It's not the way unix traditionally does this, though.
95
asmlinkage int sparc_pipe(struct pt_regs *regs)
95
asmlinkage long sparc_pipe(struct pt_regs *regs)
295
295
unsigned long old_len, unsigned long new_len,
296
296
unsigned long flags, unsigned long new_addr)
298
struct vm_area_struct *vma;
299
298
unsigned long ret = -EINVAL;
300
if (ARCH_SUN4C_SUN4) {
301
if (old_len > 0x20000000 || new_len > 0x20000000)
303
if (addr < 0xe0000000 && addr + old_len > 0x20000000)
306
if (old_len > TASK_SIZE - PAGE_SIZE ||
307
new_len > TASK_SIZE - PAGE_SIZE)
300
if (unlikely(sparc_mmap_check(addr, old_len)))
302
if (unlikely(sparc_mmap_check(new_addr, new_len)))
309
304
down_write(¤t->mm->mmap_sem);
310
if (flags & MREMAP_FIXED) {
311
if (ARCH_SUN4C_SUN4 &&
312
new_addr < 0xe0000000 &&
313
new_addr + new_len > 0x20000000)
315
if (new_addr + new_len > TASK_SIZE - PAGE_SIZE)
317
} else if ((ARCH_SUN4C_SUN4 && addr < 0xe0000000 &&
318
addr + new_len > 0x20000000) ||
319
addr + new_len > TASK_SIZE - PAGE_SIZE) {
320
unsigned long map_flags = 0;
321
struct file *file = NULL;
324
if (!(flags & MREMAP_MAYMOVE))
327
vma = find_vma(current->mm, addr);
329
if (vma->vm_flags & VM_SHARED)
330
map_flags |= MAP_SHARED;
334
new_addr = get_unmapped_area(file, addr, new_len,
335
vma ? vma->vm_pgoff : 0,
338
if (new_addr & ~PAGE_MASK)
340
flags |= MREMAP_FIXED;
342
305
ret = do_mremap(addr, old_len, new_len, flags, new_addr);
344
306
up_write(¤t->mm->mmap_sem);