.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * kernel/ksysfs.c - sysfs attributes in /sys/kernel, which |
---|
3 | 4 | * are not related to any other subsystem |
---|
4 | 5 | * |
---|
5 | 6 | * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org> |
---|
6 | | - * |
---|
7 | | - * This file is release under the GPLv2 |
---|
8 | | - * |
---|
9 | 7 | */ |
---|
10 | 8 | |
---|
11 | 9 | #include <linux/kobject.h> |
---|
.. | .. |
---|
140 | 138 | |
---|
141 | 139 | #endif /* CONFIG_CRASH_CORE */ |
---|
142 | 140 | |
---|
| 141 | +#if defined(CONFIG_PREEMPT_RT) |
---|
| 142 | +static ssize_t realtime_show(struct kobject *kobj, |
---|
| 143 | + struct kobj_attribute *attr, char *buf) |
---|
| 144 | +{ |
---|
| 145 | + return sprintf(buf, "%d\n", 1); |
---|
| 146 | +} |
---|
| 147 | +KERNEL_ATTR_RO(realtime); |
---|
| 148 | +#endif |
---|
| 149 | + |
---|
143 | 150 | /* whether file capabilities are enabled */ |
---|
144 | 151 | static ssize_t fscaps_show(struct kobject *kobj, |
---|
145 | 152 | struct kobj_attribute *attr, char *buf) |
---|
.. | .. |
---|
231 | 238 | &rcu_expedited_attr.attr, |
---|
232 | 239 | &rcu_normal_attr.attr, |
---|
233 | 240 | #endif |
---|
| 241 | +#ifdef CONFIG_PREEMPT_RT |
---|
| 242 | + &realtime_attr.attr, |
---|
| 243 | +#endif |
---|
234 | 244 | NULL |
---|
235 | 245 | }; |
---|
236 | 246 | |
---|
.. | .. |
---|
268 | 278 | return error; |
---|
269 | 279 | } |
---|
270 | 280 | |
---|
271 | | -#ifdef CONFIG_ROCKCHIP_THUNDER_BOOT |
---|
272 | | -pure_initcall(ksysfs_init); |
---|
273 | | -#else |
---|
274 | 281 | core_initcall(ksysfs_init); |
---|
275 | | -#endif |
---|