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
4c8c3c7
Documentation
LICENSES
arch
alpha
arc
arm
arm64
csky
hexagon
ia64
loongarch
m68k
microblaze
mips
alchemy
ar7
ath25
ath79
bcm47xx
bcm63xx
bmips
boot
cavium-octeon
cobalt
configs
crypto
dec
fw
generic
include
ingenic
jazz
kernel
syscalls
.gitignore
Makefile
access-helper.h
asm-offsets.c
bmips_5xxx_init.S
bmips_vec.S
branch.c
cacheinfo.c
cevt-bcm1480.c
cevt-ds1287.c
cevt-gt641xx.c
cevt-r4k.c
cevt-sb1250.c
cevt-txx9.c
cmpxchg.c
cps-vec-ns16550.S
cps-vec.S
cpu-probe.c
cpu-r3k-probe.c
crash.c
crash_dump.c
csrc-bcm1480.c
csrc-ioasic.c
csrc-r4k.c
csrc-sb1250.c
early_printk.c
early_printk_8250.c
elf.c
entry.S
fpu-probe.c
fpu-probe.h
ftrace.c
genex.S
gpio_txx9.c
head.S
i8253.c
idle.c
irq-gt641xx.c
irq-msc01.c
irq.c
irq_txx9.c
jump_label.c
kgdb.c
kprobes.c
linux32.c
machine_kexec.c
mcount.S
mips-cm.c
mips-cpc.c
mips-mt-fpaff.c
mips-mt.c
mips-r2-to-r6-emul.c
module.c
octeon_switch.S
perf_event.c
perf_event_mipsxx.c
perf_regs.c
pm-cps.c
pm.c
probes-common.h
proc.c
process.c
prom.c
ptrace.c
ptrace32.c
r2300_fpu.S
r2300_switch.S
r4k-bugs64.c
r4k_fpu.S
r4k_switch.S
relocate.c
relocate_kernel.S
reset.c
rtlx-cmp.c
rtlx-mt.c
rtlx.c
scall32-o32.S
scall64-n32.S
scall64-n64.S
scall64-o32.S
segment.c
setup.c
signal-common.h
signal.c
signal32.c
signal_n32.c
signal_o32.c
smp-bmips.c
smp-cmp.c
smp-cps.c
smp-mt.c
smp-up.c
smp.c
spinlock_test.c
spram.c
stacktrace.c
sync-r4k.c
syscall.c
sysrq.c
time.c
topology.c
traps.c
unaligned.c
uprobes.c
vdso.c
vmlinux.lds.S
vpe-cmp.c
vpe-mt.c
vpe.c
watch.c
kvm
lantiq
lib
loongson2ef
loongson32
loongson64
math-emu
mm
mti-malta
n64
net
pci
pic32
power
ralink
rb532
sgi-ip22
sgi-ip27
sgi-ip30
sgi-ip32
sibyte
sni
tools
txx9
vdso
Kbuild
Kbuild.platforms
Kconfig
Kconfig.debug
Makefile
Makefile.postlink
nios2
openrisc
parisc
powerpc
riscv
s390
sh
sparc
um
x86
xtensa
.gitignore
Kconfig
block
certs
crypto
drivers
fs
include
init
io_uring
ipc
kernel
lib
mm
net
rust
samples
scripts
security
sound
tools
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Breadcrumbs
linux
/
arch
/
mips
/
kernel
/
rtlx-cmp.c
Blame
Blame
Latest commit
History
History
124 lines (99 loc) · 2.66 KB
Breadcrumbs
linux
/
arch
/
mips
/
kernel
/
rtlx-cmp.c
Top
File metadata and controls
Code
Blame
124 lines (99 loc) · 2.66 KB
Raw
/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved. * Copyright (C) 2013 Imagination Technologies Ltd. */ #include <linux/device.h> #include <linux/fs.h> #include <linux/err.h> #include <linux/wait.h> #include <linux/sched.h> #include <linux/smp.h> #include <asm/mips_mt.h> #include <asm/vpe.h> #include <asm/rtlx.h> #include <trace/events/ipi.h> static int major; static void rtlx_interrupt(void) { int i; struct rtlx_info *info; struct rtlx_info **p = vpe_get_shared(aprp_cpu_index()); if (p == NULL || *p == NULL) return; info = *p; if (info->ap_int_pending == 1 && smp_processor_id() == 0) { for (i = 0; i < RTLX_CHANNELS; i++) { wake_up(&channel_wqs[i].lx_queue); wake_up(&channel_wqs[i].rt_queue); } info->ap_int_pending = 0; } } void _interrupt_sp(void) { smp_send_reschedule(aprp_cpu_index()); } int __init rtlx_module_init(void) { struct device *dev; int i, err; if (!cpu_has_mipsmt) { pr_warn("VPE loader: not a MIPS MT capable processor\n"); return -ENODEV; } if (num_possible_cpus() - aprp_cpu_index() < 1) { pr_warn("No TCs reserved for AP/SP, not initializing RTLX.\n" "Pass maxcpus=<n> argument as kernel argument\n"); return -ENODEV; } major = register_chrdev(0, RTLX_MODULE_NAME, &rtlx_fops); if (major < 0) { pr_err("rtlx_module_init: unable to register device\n"); return major; } /* initialise the wait queues */ for (i = 0; i < RTLX_CHANNELS; i++) { init_waitqueue_head(&channel_wqs[i].rt_queue); init_waitqueue_head(&channel_wqs[i].lx_queue); atomic_set(&channel_wqs[i].in_open, 0); mutex_init(&channel_wqs[i].mutex); dev = device_create(mt_class, NULL, MKDEV(major, i), NULL, "%s%d", RTLX_MODULE_NAME, i); if (IS_ERR(dev)) { while (i--) device_destroy(mt_class, MKDEV(major, i)); err = PTR_ERR(dev); goto out_chrdev; } } /* set up notifiers */ rtlx_notify.start = rtlx_starting; rtlx_notify.stop = rtlx_stopping; vpe_notify(aprp_cpu_index(), &rtlx_notify); if (cpu_has_vint) { aprp_hook = rtlx_interrupt; } else { pr_err("APRP RTLX init on non-vectored-interrupt processor\n"); err = -ENODEV; goto out_class; } return 0; out_class: for (i = 0; i < RTLX_CHANNELS; i++) device_destroy(mt_class, MKDEV(major, i)); out_chrdev: unregister_chrdev(major, RTLX_MODULE_NAME); return err; } void __exit rtlx_module_exit(void) { int i; for (i = 0; i < RTLX_CHANNELS; i++) device_destroy(mt_class, MKDEV(major, i)); unregister_chrdev(major, RTLX_MODULE_NAME); aprp_hook = NULL; }
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
116
117
118
119
120
121
122
123
124
You can’t perform that action at this time.