1
0
Files
kernel-49/arch/ia64/include/asm/syscall.h
Greg Kroah-Hartman 6da7d59d98 Merge 4.9.264 into android-4.9-q
Changes in 4.9.264
	net: fec: ptp: avoid register access when ipg clock is disabled
	powerpc/4xx: Fix build errors from mfdcr()
	atm: eni: dont release is never initialized
	atm: lanai: dont run lanai_dev_close if not open
	ixgbe: Fix memleak in ixgbe_configure_clsu32
	net: tehuti: fix error return code in bdx_probe()
	sun/niu: fix wrong RXMAC_BC_FRM_CNT_COUNT count
	nfs: fix PNFS_FLEXFILE_LAYOUT Kconfig default
	NFS: Correct size calculation for create reply length
	net: wan: fix error return code of uhdlc_init()
	atm: uPD98402: fix incorrect allocation
	atm: idt77252: fix null-ptr-dereference
	u64_stats,lockdep: Fix u64_stats_init() vs lockdep
	nfs: we don't support removing system.nfs4_acl
	ia64: fix ia64_syscall_get_set_arguments() for break-based syscalls
	ia64: fix ptrace(PTRACE_SYSCALL_INFO_EXIT) sign
	x86/tlb: Flush global mappings when KAISER is disabled
	squashfs: fix inode lookup sanity checks
	squashfs: fix xattr id and id lookup sanity checks
	arm64: dts: ls1043a: mark crypto engine dma coherent
	bus: omap_l3_noc: mark l3 irqs as IRQF_NO_THREAD
	macvlan: macvlan_count_rx() needs to be aware of preemption
	net: dsa: bcm_sf2: Qualify phydev->dev_flags based on port
	e1000e: add rtnl_lock() to e1000_reset_task
	e1000e: Fix error handling in e1000_set_d0_lplu_state_82571
	net/qlcnic: Fix a use after free in qlcnic_83xx_get_minidump_template
	can: c_can_pci: c_can_pci_remove(): fix use-after-free
	can: c_can: move runtime PM enable/disable to c_can_platform
	can: m_can: m_can_do_rx_poll(): fix extraneous msg loss warning
	mac80211: fix rate mask reset
	net: cdc-phonet: fix data-interface release on probe failure
	RDMA/cxgb4: Fix adapter LE hash errors while destroying ipv6 listening server
	ACPI: scan: Rearrange memory allocation in acpi_device_add()
	ACPI: scan: Use unique number for instance_no
	perf auxtrace: Fix auxtrace queue conflict
	idr: add ida_is_empty
	futex: Use smp_store_release() in mark_wake_futex()
	futex,rt_mutex: Introduce rt_mutex_init_waiter()
	futex: Rework futex_lock_pi() to use rt_mutex_*_proxy_lock()
	futex: Drop hb->lock before enqueueing on the rtmutex
	futex: Avoid freeing an active timer
	futex,rt_mutex: Fix rt_mutex_cleanup_proxy_lock()
	futex: Handle early deadlock return correctly
	futex: Fix (possible) missed wakeup
	locking/futex: Allow low-level atomic operations to return -EAGAIN
	arm64: futex: Bound number of LDXR/STXR loops in FUTEX_WAKE_OP
	futex: Prevent robust futex exit race
	futex: Fix incorrect should_fail_futex() handling
	futex: Handle transient "ownerless" rtmutex state correctly
	can: dev: Move device back to init netns on owning netns delete
	net: sched: validate stab values
	net: qrtr: fix a kernel-infoleak in qrtr_recvmsg()
	mac80211: fix double free in ibss_leave
	xen-blkback: don't leak persistent grants from xen_blkbk_map()
	Linux 4.9.264

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I8c5617c1f82aa378e3ba19d43879065e15457edd
2021-04-12 16:50:41 +03:00

89 lines
2.1 KiB
C

/*
* Access to user system call parameters and results
*
* Copyright (C) 2008 Intel Corp. Shaohua Li <shaohua.li@intel.com>
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU General Public License v.2.
*
* See asm-generic/syscall.h for descriptions of what we must do here.
*/
#ifndef _ASM_SYSCALL_H
#define _ASM_SYSCALL_H 1
#include <uapi/linux/audit.h>
#include <linux/sched.h>
#include <linux/err.h>
static inline long syscall_get_nr(struct task_struct *task,
struct pt_regs *regs)
{
if ((long)regs->cr_ifs < 0) /* Not a syscall */
return -1;
return regs->r15;
}
static inline void syscall_rollback(struct task_struct *task,
struct pt_regs *regs)
{
/* do nothing */
}
static inline long syscall_get_error(struct task_struct *task,
struct pt_regs *regs)
{
return regs->r10 == -1 ? -regs->r8:0;
}
static inline long syscall_get_return_value(struct task_struct *task,
struct pt_regs *regs)
{
return regs->r8;
}
static inline void syscall_set_return_value(struct task_struct *task,
struct pt_regs *regs,
int error, long val)
{
if (error) {
/* error < 0, but ia64 uses > 0 return value */
regs->r8 = -error;
regs->r10 = -1;
} else {
regs->r8 = val;
regs->r10 = 0;
}
}
extern void ia64_syscall_get_set_arguments(struct task_struct *task,
struct pt_regs *regs, unsigned int i, unsigned int n,
unsigned long *args, int rw);
static inline void syscall_get_arguments(struct task_struct *task,
struct pt_regs *regs,
unsigned int i, unsigned int n,
unsigned long *args)
{
BUG_ON(i + n > 6);
ia64_syscall_get_set_arguments(task, regs, i, n, args, 0);
}
static inline void syscall_set_arguments(struct task_struct *task,
struct pt_regs *regs,
unsigned int i, unsigned int n,
unsigned long *args)
{
BUG_ON(i + n > 6);
ia64_syscall_get_set_arguments(task, regs, i, n, args, 1);
}
static inline int syscall_get_arch(void)
{
return AUDIT_ARCH_IA64;
}
#endif /* _ASM_SYSCALL_H */