12 #include <linux/sysctl.h>
15 #include <asm/uaccess.h>
17 static const char frv_cache_wback[] =
"wback";
18 static const char frv_cache_wthru[] =
"wthru";
20 static void frv_change_dcache_mode(
unsigned long newmode)
22 unsigned long flags, hsr0;
30 asm volatile(
" dcef @(gr0,gr0),#1 \n"
50 void __user *
buffer,
size_t *lenp,
61 if (len <= 1 || len >
sizeof(buff) - 1)
67 if (buff[len - 1] ==
'\n')
72 if (
strcmp(buff, frv_cache_wback) == 0) {
78 if (
strcmp(buff, frv_cache_wthru) == 0) {
96 memcpy(buff, frv_cache_wthru,
sizeof(frv_cache_wthru) - 1);
97 buff[
sizeof(frv_cache_wthru) - 1] =
'\n';
98 len =
sizeof(frv_cache_wthru);
101 memcpy(buff, frv_cache_wback,
sizeof(frv_cache_wback) - 1);
102 buff[
sizeof(frv_cache_wback) - 1] =
'\n';
103 len =
sizeof(frv_cache_wback);
124 static int procctl_frv_pin_cxnr(
ctl_table *table,
int write,
125 void __user *buffer,
size_t *lenp,
136 if (len <= 1 || len >
sizeof(buff) - 1)
142 if (buff[len - 1] ==
'\n')
143 buff[len - 1] =
'\0';
180 .procname =
"cache-mode",
184 .proc_handler = procctl_frv_cachemode,
188 .procname =
"pin-cxnr",
192 .proc_handler = procctl_frv_pin_cxnr
202 static struct ctl_table frv_dir_table[] =
215 static int __init frv_sysctl_init(
void)