xref: /linux/arch/sparc/kernel/setup.c (revision 20bed0d6ff62d985fe8222958825504b8aad4e88)
1 // SPDX-License-Identifier: GPL-2.0
2 
3 #include <asm/setup.h>
4 #include <linux/sysctl.h>
5 #include <linux/panic.h>
6 #include <linux/printk.h>
7 
8 static const struct ctl_table sparc_sysctl_table[] = {
9 	{
10 		.procname	= "reboot-cmd",
11 		.data		= reboot_command,
12 		.maxlen		= 256,
13 		.mode		= 0644,
14 		.proc_handler	= proc_dostring,
15 	},
16 	{
17 		.procname	= "stop-a",
18 		.data		= &stop_a_enabled,
19 		.maxlen		= sizeof(int),
20 		.mode		= 0644,
21 		.proc_handler	= proc_dointvec,
22 	},
23 	{
24 		.procname	= "scons-poweroff",
25 		.data		= &scons_pwroff,
26 		.maxlen		= sizeof(int),
27 		.mode		= 0644,
28 		.proc_handler	= proc_dointvec,
29 	},
30 #ifdef CONFIG_SPARC64
31 	{
32 		.procname	= "tsb-ratio",
33 		.data		= &sysctl_tsb_ratio,
34 		.maxlen		= sizeof(int),
35 		.mode		= 0644,
36 		.proc_handler	= proc_dointvec,
37 	},
38 #endif
39 };
40 
41 void arch_do_panic(void)
42 {
43 	/* Make sure the user can actually press Stop-A (L1-A) */
44 	stop_a_enabled = 1;
45 	pr_emerg("Press Stop-A (L1-A) from sun keyboard or send break\n"
46 		 "twice on console to return to the boot prom\n");
47 }
48 
49 static int __init init_sparc_sysctls(void)
50 {
51 	register_sysctl_init("kernel", sparc_sysctl_table);
52 	return 0;
53 }
54 
55 arch_initcall(init_sparc_sysctls);
56