gp2x_memregs[0x3B48>>1] = ((yes&1) << 7) | (bank & 0x03);\r
}\r
\r
+static void proc_set(const char *path, const char *val)\r
+{\r
+ FILE *f;\r
+ char tmp[16];\r
+\r
+ f = fopen(path, "w");\r
+ if (f == NULL) {\r
+ printf("failed to open: %s\n", path);\r
+ return;\r
+ }\r
+\r
+ fprintf(f, "0\n");\r
+ fclose(f);\r
+\r
+ printf("\"%s\" is set to: ", path);\r
+ f = fopen(path, "r");\r
+ if (f == NULL) {\r
+ printf("(open failed)\n");\r
+ return;\r
+ }\r
+\r
+ fgets(tmp, sizeof(tmp), f);\r
+ printf("%s", tmp);\r
+ fclose(f);\r
+}\r
\r
\r
/* common */\r
/* init usb joys -GnoStiC */\r
gp2x_usbjoy_init();\r
\r
+ /* disable Linux read-ahead */\r
+ proc_set("/proc/sys/vm/max-readahead", "0\n");\r
+ proc_set("/proc/sys/vm/min-readahead", "0\n");\r
+\r
printf("exitting init()\n"); fflush(stdout);\r
}\r
\r