hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/kernel/ksysfs.c
....@@ -1,11 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * kernel/ksysfs.c - sysfs attributes in /sys/kernel, which
34 * are not related to any other subsystem
45 *
56 * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
6
- *
7
- * This file is release under the GPLv2
8
- *
97 */
108
119 #include <linux/kobject.h>
....@@ -140,6 +138,15 @@
140138
141139 #endif /* CONFIG_CRASH_CORE */
142140
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
+
143150 /* whether file capabilities are enabled */
144151 static ssize_t fscaps_show(struct kobject *kobj,
145152 struct kobj_attribute *attr, char *buf)
....@@ -231,6 +238,9 @@
231238 &rcu_expedited_attr.attr,
232239 &rcu_normal_attr.attr,
233240 #endif
241
+#ifdef CONFIG_PREEMPT_RT
242
+ &realtime_attr.attr,
243
+#endif
234244 NULL
235245 };
236246
....@@ -268,8 +278,4 @@
268278 return error;
269279 }
270280
271
-#ifdef CONFIG_ROCKCHIP_THUNDER_BOOT
272
-pure_initcall(ksysfs_init);
273
-#else
274281 core_initcall(ksysfs_init);
275
-#endif