Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
e8f023c
Documentation
LICENSES
arch
alpha
arc
arm
arm64
csky
h8300
hexagon
ia64
m68k
microblaze
mips
nds32
nios2
openrisc
parisc
powerpc
boot
configs
crypto
include
asm
book3s
nohash
vdso
8xx_immap.h
Kbuild
accounting.h
agp.h
archrandom.h
asm-compat.h
asm-const.h
asm-offsets.h
asm-prototypes.h
async_tx.h
atomic.h
backlight.h
barrier.h
bitops.h
bootx.h
btext.h
bug.h
bugs.h
cache.h
cacheflush.h
cell-pmu.h
cell-regs.h
checksum.h
clocksource.h
cmpxchg.h
code-patching-asm.h
code-patching.h
compat.h
context_tracking.h
copro.h
cpm.h
cpm1.h
cpm2.h
cpu_has_feature.h
cpu_setup_power.h
cpufeature.h
cpuidle.h
cputable.h
cputhreads.h
cputime.h
crashdump-ppc64.h
current.h
dbdma.h
dbell.h
dcr-generic.h
dcr-mmio.h
dcr-native.h
dcr-regs.h
dcr.h
debug.h
delay.h
device.h
disassemble.h
dma-direct.h
dma.h
drmem.h
dt_cpu_ftrs.h
dtl.h
edac.h
eeh.h
eeh_event.h
ehv_pic.h
elf.h
elfnote.h
emergency-restart.h
emulated_ops.h
epapr_hcalls.h
exception-64e.h
exception-64s.h
exec.h
extable.h
fadump-internal.h
fadump.h
fb.h
feature-fixups.h
firmware.h
fixmap.h
floppy.h
fs_pd.h
fsl_85xx_cache_sram.h
fsl_gtm.h
fsl_hcalls.h
fsl_lbc.h
fsl_pamu_stash.h
fsl_pm.h
ftrace.h
futex.h
grackle.h
hardirq.h
head-64.h
heathrow.h
highmem.h
hmi.h
hugetlb.h
hvcall.h
hvconsole.h
hvcserver.h
hvsi.h
hw_breakpoint.h
hw_irq.h
hydra.h
i8259.h
ibmebus.h
icswx.h
ide.h
idle.h
imc-pmu.h
immap_cpm2.h
inst.h
interrupt.h
io-defs.h
io-workarounds.h
io.h
io_event_irq.h
iommu.h
ipic.h
irq.h
irq_work.h
irqflags.h
isa-bridge.h
jump_label.h
kasan.h
kdebug.h
kdump.h
kexec.h
kexec_ranges.h
keylargo.h
kfence.h
kgdb.h
kprobes.h
kup.h
kvm_asm.h
kvm_book3s.h
kvm_book3s_32.h
kvm_book3s_64.h
kvm_book3s_asm.h
kvm_book3s_uvmem.h
kvm_booke.h
kvm_booke_hv_asm.h
kvm_fpu.h
kvm_guest.h
kvm_host.h
kvm_para.h
kvm_ppc.h
libata-portmap.h
linkage.h
livepatch.h
local.h
lppaca.h
lv1call.h
machdep.h
macio.h
mc146818rtc.h
mce.h
mediabay.h
mem_encrypt.h
membarrier.h
mman.h
mmiowb.h
mmu.h
mmu_context.h
mmzone.h
module.h
module.lds.h
mpc5121.h
mpc52xx.h
mpc52xx_psc.h
mpc5xxx.h
mpc6xx.h
mpc8260.h
mpc85xx.h
mpic.h
mpic_msgr.h
mpic_timer.h
msi_bitmap.h
nmi.h
nvram.h
ohare.h
opal-api.h
opal.h
paca.h
page.h
page_32.h
page_64.h
paravirt.h
parport.h
pasemi_dma.h
pci-bridge.h
pci.h
percpu.h
perf_event.h
perf_event_fsl_emb.h
perf_event_server.h
pgalloc.h
pgtable-be-types.h
pgtable-types.h
pgtable.h
pkeys.h
plpar_wrappers.h
pmac_feature.h
pmac_low_i2c.h
pmac_pfunc.h
pmc.h
pmi.h
pnv-ocxl.h
pnv-pci.h
powernv.h
ppc-opcode.h
ppc-pci.h
ppc4xx.h
ppc_asm.h
probes.h
processor.h
prom.h
ps3.h
ps3av.h
ps3gpu.h
ps3stor.h
pte-walk.h
ptrace.h
qspinlock.h
qspinlock_paravirt.h
reg.h
reg_8xx.h
reg_a2.h
reg_booke.h
reg_fsl_emb.h
rheap.h
rio.h
rtas-types.h
rtas.h
runlatch.h
seccomp.h
sections.h
secure_boot.h
security_features.h
secvar.h
serial.h
set_memory.h
setjmp.h
setup.h
sfp-machine.h
shmparam.h
signal.h
simple_spinlock.h
simple_spinlock_types.h
slice.h
smp.h
smu.h
sparsemem.h
spinlock.h
spinlock_types.h
spu.h
spu_csa.h
spu_info.h
spu_priv1.h
sstep.h
stackprotector.h
stacktrace.h
static_call.h
string.h
svm.h
swab.h
swiotlb.h
switch_to.h
synch.h
syscall.h
syscalls.h
task_size_32.h
task_size_64.h
tce.h
termios.h
thread_info.h
time.h
timex.h
tlb.h
tlbflush.h
tm.h
topology.h
trace.h
trace_clock.h
tsi108.h
tsi108_irq.h
tsi108_pci.h
types.h
uaccess.h
udbg.h
uic.h
ultravisor-api.h
ultravisor.h
uninorth.h
unistd.h
uprobes.h
user.h
vas.h
vdso.h
vdso_datapage.h
vermagic.h
vga.h
vio.h
vmalloc.h
word-at-a-time.h
xics.h
xive-regs.h
xive.h
xmon.h
xor.h
xor_altivec.h
uapi
kernel
kexec
kvm
lib
math-emu
mm
net
perf
platforms
purgatory
sysdev
tools
xmon
Kbuild
Kconfig
Kconfig.debug
Makefile
Makefile.postlink
riscv
s390
sh
sparc
um
x86
xtensa
.gitignore
Kconfig
block
certs
crypto
drivers
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Breadcrumbs
linux
/
arch
/
powerpc
/
include
/
asm
/
syscall.h
Blame
Blame
Latest commit
History
History
115 lines (101 loc) · 2.71 KB
Breadcrumbs
linux
/
arch
/
powerpc
/
include
/
asm
/
syscall.h
Top
File metadata and controls
Code
Blame
115 lines (101 loc) · 2.71 KB
Raw
/* SPDX-License-Identifier: GPL-2.0-only */ /* * Access to user system call parameters and results * * Copyright (C) 2008 Red Hat, Inc. All rights reserved. * * 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/thread_info.h> /* ftrace syscalls requires exporting the sys_call_table */ extern const unsigned long sys_call_table[]; extern const unsigned long compat_sys_call_table[]; static inline int syscall_get_nr(struct task_struct *task, struct pt_regs *regs) { /* * Note that we are returning an int here. That means 0xffffffff, ie. * 32-bit negative 1, will be interpreted as -1 on a 64-bit kernel. * This is important for seccomp so that compat tasks can set r0 = -1 * to reject the syscall. */ if (trap_is_syscall(regs)) return regs->gpr[0]; else return -1; } static inline void syscall_rollback(struct task_struct *task, struct pt_regs *regs) { regs->gpr[3] = regs->orig_gpr3; } static inline long syscall_get_error(struct task_struct *task, struct pt_regs *regs) { if (trap_is_scv(regs)) { unsigned long error = regs->gpr[3]; return IS_ERR_VALUE(error) ? error : 0; } else { /* * If the system call failed, * regs->gpr[3] contains a positive ERRORCODE. */ return (regs->ccr & 0x10000000UL) ? -regs->gpr[3] : 0; } } static inline long syscall_get_return_value(struct task_struct *task, struct pt_regs *regs) { return regs->gpr[3]; } static inline void syscall_set_return_value(struct task_struct *task, struct pt_regs *regs, int error, long val) { if (trap_is_scv(regs)) { regs->gpr[3] = (long) error ?: val; } else { /* * In the general case it's not obvious that we must deal with * CCR here, as the syscall exit path will also do that for us. * However there are some places, eg. the signal code, which * check ccr to decide if the value in r3 is actually an error. */ if (error) { regs->ccr |= 0x10000000L; regs->gpr[3] = error; } else { regs->ccr &= ~0x10000000L; regs->gpr[3] = val; } } } static inline void syscall_get_arguments(struct task_struct *task, struct pt_regs *regs, unsigned long *args) { unsigned long val, mask = -1UL; unsigned int n = 6; if (is_32bit_task()) mask = 0xffffffff; while (n--) { if (n == 0) val = regs->orig_gpr3; else val = regs->gpr[3 + n]; args[n] = val & mask; } } static inline int syscall_get_arch(struct task_struct *task) { if (is_32bit_task()) return AUDIT_ARCH_PPC; else if (IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN)) return AUDIT_ARCH_PPC64LE; else return AUDIT_ARCH_PPC64; } #endif /* _ASM_SYSCALL_H */
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
You can’t perform that action at this time.