arch/sparc/kernel/sys_sparc32.c

Source file repositories/reference/linux-study-clean/arch/sparc/kernel/sys_sparc32.c

File Facts

System
Linux kernel
Corpus path
arch/sparc/kernel/sys_sparc32.c
Extension
.c
Size
7025 bytes
Lines
238
Domain
Architecture Layer
Bucket
arch/sparc
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

if (act) {
		u32 u_handler, u_restorer;

		new_ka.ka_restorer = restorer;
		ret = get_user(u_handler, &act->sa_handler);
		new_ka.sa.sa_handler =  compat_ptr(u_handler);
		ret |= get_compat_sigset(&new_ka.sa.sa_mask, &act->sa_mask);
		ret |= get_user(new_ka.sa.sa_flags, &act->sa_flags);
		ret |= get_user(u_restorer, &act->sa_restorer);
		new_ka.sa.sa_restorer = compat_ptr(u_restorer);
                if (ret)
                	return -EFAULT;
	}

	ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);

	if (!ret && oact) {
		ret = put_user(ptr_to_compat(old_ka.sa.sa_handler), &oact->sa_handler);
		ret |= put_compat_sigset(&oact->sa_mask, &old_ka.sa.sa_mask,
					 sizeof(oact->sa_mask));
		ret |= put_user(old_ka.sa.sa_flags, &oact->sa_flags);
		ret |= put_user(ptr_to_compat(old_ka.sa.sa_restorer), &oact->sa_restorer);
		if (ret)
			ret = -EFAULT;
        }

        return ret;
}

COMPAT_SYSCALL_DEFINE5(pread64, unsigned int, fd, char __user *, ubuf,
			compat_size_t, count, u32, poshi, u32, poslo)
{
	return ksys_pread64(fd, ubuf, count, ((u64)poshi << 32) | poslo);
}

COMPAT_SYSCALL_DEFINE5(pwrite64, unsigned int, fd, char __user *, ubuf,
			compat_size_t, count, u32, poshi, u32, poslo)
{
	return ksys_pwrite64(fd, ubuf, count, ((u64)poshi << 32) | poslo);
}

COMPAT_SYSCALL_DEFINE4(readahead, int, fd, u32, offhi, u32, offlo,
		     compat_size_t, count)
{
	return ksys_readahead(fd, ((u64)offhi << 32) | offlo, count);
}

COMPAT_SYSCALL_DEFINE5(fadvise64, int, fd, u32, offhi, u32, offlo,
			  compat_size_t, len, int, advice)
{
	return ksys_fadvise64_64(fd, ((u64)offhi << 32) | offlo, len, advice);
}

COMPAT_SYSCALL_DEFINE6(fadvise64_64, int, fd, u32, offhi, u32, offlo,
			     u32, lenhi, u32, lenlo, int, advice)
{
	return ksys_fadvise64_64(fd,
				 ((u64)offhi << 32) | offlo,
				 ((u64)lenhi << 32) | lenlo,
				 advice);
}

COMPAT_SYSCALL_DEFINE6(sync_file_range, unsigned int, fd, u32, off_high, u32, off_low,
			u32, nb_high, u32, nb_low, unsigned int, flags)
{
	return ksys_sync_file_range(fd,
				    ((u64)off_high << 32) | off_low,
				    ((u64)nb_high << 32) | nb_low,
				    flags);
}

COMPAT_SYSCALL_DEFINE6(fallocate, int, fd, int, mode, u32, offhi, u32, offlo,
				     u32, lenhi, u32, lenlo)
{
	return ksys_fallocate(fd, mode, ((loff_t)offhi << 32) | offlo,
			      ((loff_t)lenhi << 32) | lenlo);
}

Annotation

Implementation Notes