/
usr
/
src
/
linux-headers-5.15.0-181
/
arch
/
powerpc
/
include
/
asm
/
/usr/src/linux-headers-5.15.0-181/arch/powerpc/include/asm
mkdir
upload
Name
Size
Mode
Actions
book3s/
-
0755
rm
nohash/
-
0755
rm
vdso/
-
0755
rm
8xx_immap.h
14099
0644
edit
dl
rm
accounting.h
908
0644
edit
dl
rm
agp.h
525
0644
edit
dl
rm
archrandom.h
838
0644
edit
dl
rm
asm-compat.h
1882
0644
edit
dl
rm
asm-const.h
468
0644
edit
dl
rm
asm-offsets.h
35
0644
edit
dl
rm
asm-prototypes.h
5130
0644
edit
dl
rm
async_tx.h
908
0644
edit
dl
rm
atomic.h
14267
0644
edit
dl
rm
backlight.h
1115
0644
edit
dl
rm
barrier.h
3977
0644
edit
dl
rm
bitops.h
7913
0644
edit
dl
rm
bootx.h
1142
0644
edit
dl
rm
bpf_perf_event.h
233
0644
edit
dl
rm
btext.h
1006
0644
edit
dl
rm
bug.h
4090
0644
edit
dl
rm
cache.h
2888
0644
edit
dl
rm
cacheflush.h
3851
0644
edit
dl
rm
cell-pmu.h
3496
0644
edit
dl
rm
cell-regs.h
9799
0644
edit
dl
rm
checksum.h
5723
0644
edit
dl
rm
clocksource.h
185
0644
edit
dl
rm
cmpxchg.h
12280
0644
edit
dl
rm
code-patching-asm.h
397
0644
edit
dl
rm
code-patching.h
5443
0644
edit
dl
rm
compat.h
3304
0644
edit
dl
rm
context_tracking.h
245
0644
edit
dl
rm
copro.h
593
0644
edit
dl
rm
cpm.h
25
0644
edit
dl
rm
cpm1.h
21711
0644
edit
dl
rm
cpm2.h
49598
0644
edit
dl
rm
cpufeature.h
998
0644
edit
dl
rm
cpuidle.h
3407
0644
edit
dl
rm
cputable.h
23211
0644
edit
dl
rm
cputhreads.h
3856
0644
edit
dl
rm
cputime.h
3069
0644
edit
dl
rm
cpu_has_feature.h
1339
0644
edit
dl
rm
cpu_setup_power.h
507
0644
edit
dl
rm
crashdump-ppc64.h
624
0644
edit
dl
rm
current.h
680
0644
edit
dl
rm
dbdma.h
3809
0644
edit
dl
rm
dbell.h
4025
0644
edit
dl
rm
dcr-generic.h
930
0644
edit
dl
rm
dcr-mmio.h
1026
0644
edit
dl
rm
dcr-native.h
3859
0644
edit
dl
rm
dcr-regs.h
5846
0644
edit
dl
rm
dcr.h
2108
0644
edit
dl
rm
debug.h
1886
0644
edit
dl
rm
delay.h
3297
0644
edit
dl
rm
device.h
1016
0644
edit
dl
rm
disassemble.h
2189
0644
edit
dl
rm
dma-direct.h
391
0644
edit
dl
rm
dma.h
10725
0644
edit
dl
rm
drmem.h
2970
0644
edit
dl
rm
dtl.h
1515
0644
edit
dl
rm
dt_cpu_ftrs.h
756
0644
edit
dl
rm
edac.h
1105
0644
edit
dl
rm
eeh.h
15367
0644
edit
dl
rm
eeh_event.h
826
0644
edit
dl
rm
ehv_pic.h
963
0644
edit
dl
rm
elf.h
6283
0644
edit
dl
rm
elfnote.h
527
0644
edit
dl
rm
emergency-restart.h
43
0644
edit
dl
rm
emulated_ops.h
2072
0644
edit
dl
rm
epapr_hcalls.h
16827
0644
edit
dl
rm
exception-64e.h
5785
0644
edit
dl
rm
exception-64s.h
4350
0644
edit
dl
rm
exec.h
246
0644
edit
dl
rm
extable.h
1205
0644
edit
dl
rm
fadump-internal.h
4352
0644
edit
dl
rm
fadump.h
1095
0644
edit
dl
rm
fb.h
483
0644
edit
dl
rm
feature-fixups.h
9828
0644
edit
dl
rm
firmware.h
5327
0644
edit
dl
rm
fixmap.h
3723
0644
edit
dl
rm
floppy.h
5111
0644
edit
dl
rm
fsl_85xx_cache_sram.h
812
0644
edit
dl
rm
fsl_gtm.h
1203
0644
edit
dl
rm
fsl_hcalls.h
17615
0644
edit
dl
rm
fsl_lbc.h
10489
0644
edit
dl
rm
fsl_pamu_stash.h
411
0644
edit
dl
rm
fsl_pm.h
1183
0644
edit
dl
rm
fs_pd.h
1046
0644
edit
dl
rm
ftrace.h
3550
0644
edit
dl
rm
futex.h
2246
0644
edit
dl
rm
grackle.h
331
0644
edit
dl
rm
hardirq.h
948
0644
edit
dl
rm
head-64.h
5507
0644
edit
dl
rm
heathrow.h
2595
0644
edit
dl
rm
highmem.h
2079
0644
edit
dl
rm
hmi.h
971
0644
edit
dl
rm
hugetlb.h
2186
0644
edit
dl
rm
hvcall.h
21250
0644
edit
dl
rm
hvconsole.h
790
0644
edit
dl
rm
hvcserver.h
1473
0644
edit
dl
rm
hvsi.h
2850
0644
edit
dl
rm
hw_breakpoint.h
3735
0644
edit
dl
rm
hw_irq.h
11218
0644
edit
dl
rm
hydra.h
2948
0644
edit
dl
rm
i8259.h
361
0644
edit
dl
rm
ibmebus.h
2204
0644
edit
dl
rm
icswx.h
5090
0644
edit
dl
rm
ide.h
586
0644
edit
dl
rm
idle.h
2372
0644
edit
dl
rm
imc-pmu.h
3983
0644
edit
dl
rm
immap_cpm2.h
10749
0644
edit
dl
rm
inst.h
3683
0644
edit
dl
rm
interrupt.h
18353
0644
edit
dl
rm
io-defs.h
3164
0644
edit
dl
rm
io-workarounds.h
1313
0644
edit
dl
rm
io.h
31387
0644
edit
dl
rm
iommu.h
10283
0644
edit
dl
rm
io_event_irq.h
1746
0644
edit
dl
rm
ipic.h
3141
0644
edit
dl
rm
irq.h
1320
0644
edit
dl
rm
irqflags.h
1777
0644
edit
dl
rm
irq_work.h
213
0644
edit
dl
rm
isa-bridge.h
654
0644
edit
dl
rm
jump_label.h
1351
0644
edit
dl
rm
kasan.h
1396
0644
edit
dl
rm
Kbuild
286
0644
edit
dl
rm
kdebug.h
291
0644
edit
dl
rm
kdump.h
1399
0644
edit
dl
rm
kexec.h
4838
0644
edit
dl
rm
kexec_ranges.h
943
0644
edit
dl
rm
keylargo.h
11061
0644
edit
dl
rm
kfence.h
650
0644
edit
dl
rm
kgdb.h
2156
0644
edit
dl
rm
kprobes.h
2815
0644
edit
dl
rm
kup.h
3297
0644
edit
dl
rm
kvm_asm.h
4952
0644
edit
dl
rm
kvm_book3s.h
17220
0644
edit
dl
rm
kvm_book3s_32.h
816
0644
edit
dl
rm
kvm_book3s_64.h
18333
0644
edit
dl
rm
kvm_book3s_asm.h
3777
0644
edit
dl
rm
kvm_book3s_uvmem.h
2738
0644
edit
dl
rm
kvm_booke.h
2233
0644
edit
dl
rm
kvm_booke_hv_asm.h
1960
0644
edit
dl
rm
kvm_fpu.h
2199
0644
edit
dl
rm
kvm_guest.h
566
0644
edit
dl
rm
kvm_host.h
21966
0644
edit
dl
rm
kvm_para.h
752
0644
edit
dl
rm
kvm_ppc.h
36699
0644
edit
dl
rm
libata-portmap.h
249
0644
edit
dl
rm
linkage.h
501
0644
edit
dl
rm
livepatch.h
1140
0644
edit
dl
rm
local.h
3258
0644
edit
dl
rm
lppaca.h
5015
0644
edit
dl
rm
lv1call.h
18555
0644
edit
dl
rm
machdep.h
9630
0644
edit
dl
rm
macio.h
3985
0644
edit
dl
rm
mc146818rtc.h
736
0644
edit
dl
rm
mce.h
6396
0644
edit
dl
rm
mediabay.h
1375
0644
edit
dl
rm
membarrier.h
877
0644
edit
dl
rm
mem_encrypt.h
532
0644
edit
dl
rm
mman.h
1471
0644
edit
dl
rm
mmiowb.h
374
0644
edit
dl
rm
mmu.h
11244
0644
edit
dl
rm
mmu_context.h
9646
0644
edit
dl
rm
mmzone.h
1003
0644
edit
dl
rm
module.h
2284
0644
edit
dl
rm
module.lds.h
95
0644
edit
dl
rm
mpc5xxx.h
439
0644
edit
dl
rm
mpc6xx.h
143
0644
edit
dl
rm
mpc52xx.h
11100
0644
edit
dl
rm
mpc52xx_psc.h
10125
0644
edit
dl
rm
mpc85xx.h
2382
0644
edit
dl
rm
mpc5121.h
3863
0644
edit
dl
rm
mpc8260.h
742
0644
edit
dl
rm
mpic.h
14309
0644
edit
dl
rm
mpic_msgr.h
3441
0644
edit
dl
rm
mpic_timer.h
1183
0644
edit
dl
rm
msi_bitmap.h
867
0644
edit
dl
rm
nmi.h
579
0644
edit
dl
rm
nvram.h
2834
0644
edit
dl
rm
ohare.h
1684
0644
edit
dl
rm
opal-api.h
31680
0644
edit
dl
rm
opal.h
17843
0644
edit
dl
rm
paca.h
8783
0644
edit
dl
rm
page.h
10362
0644
edit
dl
rm
page_32.h
1626
0644
edit
dl
rm
page_64.h
2716
0644
edit
dl
rm
paravirt.h
3881
0644
edit
dl
rm
parport.h
956
0644
edit
dl
rm
pasemi_dma.h
23273
0644
edit
dl
rm
pci-bridge.h
9481
0644
edit
dl
rm
pci.h
3605
0644
edit
dl
rm
percpu.h
815
0644
edit
dl
rm
perf_event.h
1509
0644
edit
dl
rm
perf_event_fsl_emb.h
1252
0644
edit
dl
rm
perf_event_server.h
7104
0644
edit
dl
rm
pgalloc.h
2067
0644
edit
dl
rm
pgtable-be-types.h
2601
0644
edit
dl
rm
pgtable-types.h
1895
0644
edit
dl
rm
pgtable.h
4047
0644
edit
dl
rm
pkeys.h
4279
0644
edit
dl
rm
plpar_wrappers.h
10193
0644
edit
dl
rm
pmac_feature.h
13396
0644
edit
dl
rm
pmac_low_i2c.h
3100
0644
edit
dl
rm
pmac_pfunc.h
8237
0644
edit
dl
rm
pmc.h
1116
0644
edit
dl
rm
pmi.h
1177
0644
edit
dl
rm
pnv-ocxl.h
3069
0644
edit
dl
rm
pnv-pci.h
2432
0644
edit
dl
rm
powernv.h
454
0644
edit
dl
rm
ppc-opcode.h
31419
0644
edit
dl
rm
ppc-pci.h
2282
0644
edit
dl
rm
ppc4xx.h
328
0644
edit
dl
rm
ppc_asm.h
20530
0644
edit
dl
rm
probes.h
1542
0644
edit
dl
rm
processor.h
11898
0644
edit
dl
rm
prom.h
7324
0644
edit
dl
rm
ps3.h
15219
0644
edit
dl
rm
ps3av.h
23422
0644
edit
dl
rm
ps3gpu.h
1928
0644
edit
dl
rm
ps3stor.h
1408
0644
edit
dl
rm
pte-walk.h
2281
0644
edit
dl
rm
ptrace.h
10508
0644
edit
dl
rm
qspinlock.h
2064
0644
edit
dl
rm
qspinlock_paravirt.h
221
0644
edit
dl
rm
reg.h
64465
0644
edit
dl
rm
reg_8xx.h
2867
0644
edit
dl
rm
reg_a2.h
6128
0644
edit
dl
rm
reg_booke.h
33882
0644
edit
dl
rm
reg_fsl_emb.h
3961
0644
edit
dl
rm
rheap.h
2578
0644
edit
dl
rm
rio.h
424
0644
edit
dl
rm
rtas-types.h
2939
0644
edit
dl
rm
rtas.h
12574
0644
edit
dl
rm
runlatch.h
1184
0644
edit
dl
rm
seccomp.h
1043
0644
edit
dl
rm
sections.h
1982
0644
edit
dl
rm
secure_boot.h
476
0644
edit
dl
rm
security_features.h
3509
0644
edit
dl
rm
secvar.h
765
0644
edit
dl
rm
serial.h
473
0644
edit
dl
rm
setjmp.h
400
0644
edit
dl
rm
setup.h
2475
0644
edit
dl
rm
set_memory.h
1160
0644
edit
dl
rm
sfp-machine.h
12676
0644
edit
dl
rm
shmparam.h
206
0644
edit
dl
rm
signal.h
320
0644
edit
dl
rm
simple_spinlock.h
6662
0644
edit
dl
rm
simple_spinlock_types.h
481
0644
edit
dl
rm
slice.h
1121
0644
edit
dl
rm
smp.h
7804
0644
edit
dl
rm
smu.h
19789
0644
edit
dl
rm
sparsemem.h
843
0644
edit
dl
rm
spinlock.h
472
0644
edit
dl
rm
spinlock_types.h
382
0644
edit
dl
rm
spu.h
23963
0644
edit
dl
rm
spu_csa.h
6166
0644
edit
dl
rm
spu_info.h
272
0644
edit
dl
rm
spu_priv1.h
5186
0644
edit
dl
rm
sstep.h
4730
0644
edit
dl
rm
stackprotector.h
788
0644
edit
dl
rm
stacktrace.h
297
0644
edit
dl
rm
string.h
2522
0644
edit
dl
rm
svm.h
652
0644
edit
dl
rm
swab.h
173
0644
edit
dl
rm
swiotlb.h
374
0644
edit
dl
rm
switch_to.h
2966
0644
edit
dl
rm
synch.h
2067
0644
edit
dl
rm
syscall.h
3057
0644
edit
dl
rm
syscalls.h
2189
0644
edit
dl
rm
task_size_32.h
544
0644
edit
dl
rm
task_size_64.h
2390
0644
edit
dl
rm
tce.h
892
0644
edit
dl
rm
termios.h
653
0644
edit
dl
rm
thread_info.h
6166
0644
edit
dl
rm
time.h
2997
0644
edit
dl
rm
timex.h
463
0644
edit
dl
rm
tlb.h
2308
0644
edit
dl
rm
tlbflush.h
271
0644
edit
dl
rm
tm.h
624
0644
edit
dl
rm
topology.h
3536
0644
edit
dl
rm
trace.h
4695
0644
edit
dl
rm
trace_clock.h
372
0644
edit
dl
rm
tsi108.h
3264
0644
edit
dl
rm
tsi108_irq.h
3916
0644
edit
dl
rm
tsi108_pci.h
1191
0644
edit
dl
rm
types.h
822
0644
edit
dl
rm
uaccess.h
14207
0644
edit
dl
rm
udbg.h
2003
0644
edit
dl
rm
uic.h
403
0644
edit
dl
rm
ultravisor-api.h
941
0644
edit
dl
rm
ultravisor.h
2101
0644
edit
dl
rm
uninorth.h
8410
0644
edit
dl
rm
unistd.h
1445
0644
edit
dl
rm
uprobes.h
801
0644
edit
dl
rm
user.h
2192
0644
edit
dl
rm
vas.h
7580
0644
edit
dl
rm
vdso.h
1096
0644
edit
dl
rm
vdso_datapage.h
3570
0644
edit
dl
rm
vermagic.h
490
0644
edit
dl
rm
vga.h
1273
0644
edit
dl
rm
vio.h
4734
0644
edit
dl
rm
vmalloc.h
554
0644
edit
dl
rm
word-at-a-time.h
4878
0644
edit
dl
rm
xics.h
4539
0644
edit
dl
rm
xive-regs.h
5083
0644
edit
dl
rm
xive.h
5191
0644
edit
dl
rm
xmon.h
733
0644
edit
dl
rm
xor.h
1017
0644
edit
dl
rm
xor_altivec.h
683
0644
edit
dl
rm
Edit:
/usr/src/linux-headers-5.15.0-181/arch/powerpc/include/asm/epapr_hcalls.h
(16827B)
/* * ePAPR hcall interface * * Copyright 2008-2011 Freescale Semiconductor, Inc. * * Author: Timur Tabi <timur@freescale.com> * * This file is provided under a dual BSD/GPL license. When using or * redistributing this file, you may do so under either license. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Freescale Semiconductor nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * * ALTERNATIVELY, this software may be distributed under the terms of the * GNU General Public License ("GPL") as published by the Free Software * Foundation, either version 2 of that License or (at your option) any * later version. * * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* A "hypercall" is an "sc 1" instruction. This header file provides C * wrapper functions for the ePAPR hypervisor interface. It is inteded * for use by Linux device drivers and other operating systems. * * The hypercalls are implemented as inline assembly, rather than assembly * language functions in a .S file, for optimization. It allows * the caller to issue the hypercall instruction directly, improving both * performance and memory footprint. */ #ifndef _EPAPR_HCALLS_H #define _EPAPR_HCALLS_H #include <uapi/asm/epapr_hcalls.h> #ifndef __ASSEMBLY__ #include <linux/types.h> #include <linux/errno.h> #include <asm/byteorder.h> /* * Hypercall register clobber list * * These macros are used to define the list of clobbered registers during a * hypercall. Technically, registers r0 and r3-r12 are always clobbered, * but the gcc inline assembly syntax does not allow us to specify registers * on the clobber list that are also on the input/output list. Therefore, * the lists of clobbered registers depends on the number of register * parmeters ("+r" and "=r") passed to the hypercall. * * Each assembly block should use one of the HCALL_CLOBBERSx macros. As a * general rule, 'x' is the number of parameters passed to the assembly * block *except* for r11. * * If you're not sure, just use the smallest value of 'x' that does not * generate a compilation error. Because these are static inline functions, * the compiler will only check the clobber list for a function if you * compile code that calls that function. * * r3 and r11 are not included in any clobbers list because they are always * listed as output registers. * * XER, CTR, and LR are currently listed as clobbers because it's uncertain * whether they will be clobbered. * * Note that r11 can be used as an output parameter. * * The "memory" clobber is only necessary for hcalls where the Hypervisor * will read or write guest memory. However, we add it to all hcalls because * the impact is minimal, and we want to ensure that it's present for the * hcalls that need it. */ /* List of common clobbered registers. Do not use this macro. */ #define EV_HCALL_CLOBBERS "r0", "r12", "xer", "ctr", "lr", "cc", "memory" #define EV_HCALL_CLOBBERS8 EV_HCALL_CLOBBERS #define EV_HCALL_CLOBBERS7 EV_HCALL_CLOBBERS8, "r10" #define EV_HCALL_CLOBBERS6 EV_HCALL_CLOBBERS7, "r9" #define EV_HCALL_CLOBBERS5 EV_HCALL_CLOBBERS6, "r8" #define EV_HCALL_CLOBBERS4 EV_HCALL_CLOBBERS5, "r7" #define EV_HCALL_CLOBBERS3 EV_HCALL_CLOBBERS4, "r6" #define EV_HCALL_CLOBBERS2 EV_HCALL_CLOBBERS3, "r5" #define EV_HCALL_CLOBBERS1 EV_HCALL_CLOBBERS2, "r4" extern bool epapr_paravirt_enabled; extern u32 epapr_hypercall_start[]; #ifdef CONFIG_EPAPR_PARAVIRT int __init epapr_paravirt_early_init(void); #else static inline int epapr_paravirt_early_init(void) { return 0; } #endif /* * We use "uintptr_t" to define a register because it's guaranteed to be a * 32-bit integer on a 32-bit platform, and a 64-bit integer on a 64-bit * platform. * * All registers are either input/output or output only. Registers that are * initialized before making the hypercall are input/output. All * input/output registers are represented with "+r". Output-only registers * are represented with "=r". Do not specify any unused registers. The * clobber list will tell the compiler that the hypercall modifies those * registers, which is good enough. */ /** * ev_int_set_config - configure the specified interrupt * @interrupt: the interrupt number * @config: configuration for this interrupt * @priority: interrupt priority * @destination: destination CPU number * * Returns 0 for success, or an error code. */ static inline unsigned int ev_int_set_config(unsigned int interrupt, uint32_t config, unsigned int priority, uint32_t destination) { register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3"); register uintptr_t r4 __asm__("r4"); register uintptr_t r5 __asm__("r5"); register uintptr_t r6 __asm__("r6"); r11 = EV_HCALL_TOKEN(EV_INT_SET_CONFIG); r3 = interrupt; r4 = config; r5 = priority; r6 = destination; asm volatile("bl epapr_hypercall_start" : "+r" (r11), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6) : : EV_HCALL_CLOBBERS4 ); return r3; } /** * ev_int_get_config - return the config of the specified interrupt * @interrupt: the interrupt number * @config: returned configuration for this interrupt * @priority: returned interrupt priority * @destination: returned destination CPU number * * Returns 0 for success, or an error code. */ static inline unsigned int ev_int_get_config(unsigned int interrupt, uint32_t *config, unsigned int *priority, uint32_t *destination) { register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3"); register uintptr_t r4 __asm__("r4"); register uintptr_t r5 __asm__("r5"); register uintptr_t r6 __asm__("r6"); r11 = EV_HCALL_TOKEN(EV_INT_GET_CONFIG); r3 = interrupt; asm volatile("bl epapr_hypercall_start" : "+r" (r11), "+r" (r3), "=r" (r4), "=r" (r5), "=r" (r6) : : EV_HCALL_CLOBBERS4 ); *config = r4; *priority = r5; *destination = r6; return r3; } /** * ev_int_set_mask - sets the mask for the specified interrupt source * @interrupt: the interrupt number * @mask: 0=enable interrupts, 1=disable interrupts * * Returns 0 for success, or an error code. */ static inline unsigned int ev_int_set_mask(unsigned int interrupt, unsigned int mask) { register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3"); register uintptr_t r4 __asm__("r4"); r11 = EV_HCALL_TOKEN(EV_INT_SET_MASK); r3 = interrupt; r4 = mask; asm volatile("bl epapr_hypercall_start" : "+r" (r11), "+r" (r3), "+r" (r4) : : EV_HCALL_CLOBBERS2 ); return r3; } /** * ev_int_get_mask - returns the mask for the specified interrupt source * @interrupt: the interrupt number * @mask: returned mask for this interrupt (0=enabled, 1=disabled) * * Returns 0 for success, or an error code. */ static inline unsigned int ev_int_get_mask(unsigned int interrupt, unsigned int *mask) { register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3"); register uintptr_t r4 __asm__("r4"); r11 = EV_HCALL_TOKEN(EV_INT_GET_MASK); r3 = interrupt; asm volatile("bl epapr_hypercall_start" : "+r" (r11), "+r" (r3), "=r" (r4) : : EV_HCALL_CLOBBERS2 ); *mask = r4; return r3; } /** * ev_int_eoi - signal the end of interrupt processing * @interrupt: the interrupt number * * This function signals the end of processing for the specified * interrupt, which must be the interrupt currently in service. By * definition, this is also the highest-priority interrupt. * * Returns 0 for success, or an error code. */ static inline unsigned int ev_int_eoi(unsigned int interrupt) { register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3"); r11 = EV_HCALL_TOKEN(EV_INT_EOI); r3 = interrupt; asm volatile("bl epapr_hypercall_start" : "+r" (r11), "+r" (r3) : : EV_HCALL_CLOBBERS1 ); return r3; } /** * ev_byte_channel_send - send characters to a byte stream * @handle: byte stream handle * @count: (input) num of chars to send, (output) num chars sent * @buffer: pointer to a 16-byte buffer * * @buffer must be at least 16 bytes long, because all 16 bytes will be * read from memory into registers, even if count < 16. * * Returns 0 for success, or an error code. */ static inline unsigned int ev_byte_channel_send(unsigned int handle, unsigned int *count, const char buffer[EV_BYTE_CHANNEL_MAX_BYTES]) { register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3"); register uintptr_t r4 __asm__("r4"); register uintptr_t r5 __asm__("r5"); register uintptr_t r6 __asm__("r6"); register uintptr_t r7 __asm__("r7"); register uintptr_t r8 __asm__("r8"); const uint32_t *p = (const uint32_t *) buffer; r11 = EV_HCALL_TOKEN(EV_BYTE_CHANNEL_SEND); r3 = handle; r4 = *count; r5 = be32_to_cpu(p[0]); r6 = be32_to_cpu(p[1]); r7 = be32_to_cpu(p[2]); r8 = be32_to_cpu(p[3]); asm volatile("bl epapr_hypercall_start" : "+r" (r11), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7), "+r" (r8) : : EV_HCALL_CLOBBERS6 ); *count = r4; return r3; } /** * ev_byte_channel_receive - fetch characters from a byte channel * @handle: byte channel handle * @count: (input) max num of chars to receive, (output) num chars received * @buffer: pointer to a 16-byte buffer * * The size of @buffer must be at least 16 bytes, even if you request fewer * than 16 characters, because we always write 16 bytes to @buffer. This is * for performance reasons. * * Returns 0 for success, or an error code. */ static inline unsigned int ev_byte_channel_receive(unsigned int handle, unsigned int *count, char buffer[EV_BYTE_CHANNEL_MAX_BYTES]) { register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3"); register uintptr_t r4 __asm__("r4"); register uintptr_t r5 __asm__("r5"); register uintptr_t r6 __asm__("r6"); register uintptr_t r7 __asm__("r7"); register uintptr_t r8 __asm__("r8"); uint32_t *p = (uint32_t *) buffer; r11 = EV_HCALL_TOKEN(EV_BYTE_CHANNEL_RECEIVE); r3 = handle; r4 = *count; asm volatile("bl epapr_hypercall_start" : "+r" (r11), "+r" (r3), "+r" (r4), "=r" (r5), "=r" (r6), "=r" (r7), "=r" (r8) : : EV_HCALL_CLOBBERS6 ); *count = r4; p[0] = cpu_to_be32(r5); p[1] = cpu_to_be32(r6); p[2] = cpu_to_be32(r7); p[3] = cpu_to_be32(r8); return r3; } /** * ev_byte_channel_poll - returns the status of the byte channel buffers * @handle: byte channel handle * @rx_count: returned count of bytes in receive queue * @tx_count: returned count of free space in transmit queue * * This function reports the amount of data in the receive queue (i.e. the * number of bytes you can read), and the amount of free space in the transmit * queue (i.e. the number of bytes you can write). * * Returns 0 for success, or an error code. */ static inline unsigned int ev_byte_channel_poll(unsigned int handle, unsigned int *rx_count, unsigned int *tx_count) { register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3"); register uintptr_t r4 __asm__("r4"); register uintptr_t r5 __asm__("r5"); r11 = EV_HCALL_TOKEN(EV_BYTE_CHANNEL_POLL); r3 = handle; asm volatile("bl epapr_hypercall_start" : "+r" (r11), "+r" (r3), "=r" (r4), "=r" (r5) : : EV_HCALL_CLOBBERS3 ); *rx_count = r4; *tx_count = r5; return r3; } /** * ev_int_iack - acknowledge an interrupt * @handle: handle to the target interrupt controller * @vector: returned interrupt vector * * If handle is zero, the function returns the next interrupt source * number to be handled irrespective of the hierarchy or cascading * of interrupt controllers. If non-zero, specifies a handle to the * interrupt controller that is the target of the acknowledge. * * Returns 0 for success, or an error code. */ static inline unsigned int ev_int_iack(unsigned int handle, unsigned int *vector) { register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3"); register uintptr_t r4 __asm__("r4"); r11 = EV_HCALL_TOKEN(EV_INT_IACK); r3 = handle; asm volatile("bl epapr_hypercall_start" : "+r" (r11), "+r" (r3), "=r" (r4) : : EV_HCALL_CLOBBERS2 ); *vector = r4; return r3; } /** * ev_doorbell_send - send a doorbell to another partition * @handle: doorbell send handle * * Returns 0 for success, or an error code. */ static inline unsigned int ev_doorbell_send(unsigned int handle) { register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3"); r11 = EV_HCALL_TOKEN(EV_DOORBELL_SEND); r3 = handle; asm volatile("bl epapr_hypercall_start" : "+r" (r11), "+r" (r3) : : EV_HCALL_CLOBBERS1 ); return r3; } /** * ev_idle -- wait for next interrupt on this core * * Returns 0 for success, or an error code. */ static inline unsigned int ev_idle(void) { register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3"); r11 = EV_HCALL_TOKEN(EV_IDLE); asm volatile("bl epapr_hypercall_start" : "+r" (r11), "=r" (r3) : : EV_HCALL_CLOBBERS1 ); return r3; } #ifdef CONFIG_EPAPR_PARAVIRT static inline unsigned long epapr_hypercall(unsigned long *in, unsigned long *out, unsigned long nr) { register unsigned long r0 asm("r0"); register unsigned long r3 asm("r3") = in[0]; register unsigned long r4 asm("r4") = in[1]; register unsigned long r5 asm("r5") = in[2]; register unsigned long r6 asm("r6") = in[3]; register unsigned long r7 asm("r7") = in[4]; register unsigned long r8 asm("r8") = in[5]; register unsigned long r9 asm("r9") = in[6]; register unsigned long r10 asm("r10") = in[7]; register unsigned long r11 asm("r11") = nr; register unsigned long r12 asm("r12"); asm volatile("bl epapr_hypercall_start" : "=r"(r0), "=r"(r3), "=r"(r4), "=r"(r5), "=r"(r6), "=r"(r7), "=r"(r8), "=r"(r9), "=r"(r10), "=r"(r11), "=r"(r12) : "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7), "r"(r8), "r"(r9), "r"(r10), "r"(r11) : "memory", "cc", "xer", "ctr", "lr"); out[0] = r4; out[1] = r5; out[2] = r6; out[3] = r7; out[4] = r8; out[5] = r9; out[6] = r10; out[7] = r11; return r3; } #else static unsigned long epapr_hypercall(unsigned long *in, unsigned long *out, unsigned long nr) { return EV_UNIMPLEMENTED; } #endif static inline long epapr_hypercall0_1(unsigned int nr, unsigned long *r2) { unsigned long in[8] = {0}; unsigned long out[8]; unsigned long r; r = epapr_hypercall(in, out, nr); *r2 = out[0]; return r; } static inline long epapr_hypercall0(unsigned int nr) { unsigned long in[8] = {0}; unsigned long out[8]; return epapr_hypercall(in, out, nr); } static inline long epapr_hypercall1(unsigned int nr, unsigned long p1) { unsigned long in[8] = {0}; unsigned long out[8]; in[0] = p1; return epapr_hypercall(in, out, nr); } static inline long epapr_hypercall2(unsigned int nr, unsigned long p1, unsigned long p2) { unsigned long in[8] = {0}; unsigned long out[8]; in[0] = p1; in[1] = p2; return epapr_hypercall(in, out, nr); } static inline long epapr_hypercall3(unsigned int nr, unsigned long p1, unsigned long p2, unsigned long p3) { unsigned long in[8] = {0}; unsigned long out[8]; in[0] = p1; in[1] = p2; in[2] = p3; return epapr_hypercall(in, out, nr); } static inline long epapr_hypercall4(unsigned int nr, unsigned long p1, unsigned long p2, unsigned long p3, unsigned long p4) { unsigned long in[8] = {0}; unsigned long out[8]; in[0] = p1; in[1] = p2; in[2] = p3; in[3] = p4; return epapr_hypercall(in, out, nr); } #endif /* !__ASSEMBLY__ */ #endif /* _EPAPR_HCALLS_H */
Save
cmd:
run