summaryrefslogtreecommitdiff
path: root/src/wiz_mmuhack.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wiz_mmuhack.c')
-rw-r--r--src/wiz_mmuhack.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/wiz_mmuhack.c b/src/wiz_mmuhack.c
new file mode 100644
index 0000000..f2204d6
--- /dev/null
+++ b/src/wiz_mmuhack.c
@@ -0,0 +1,28 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <linux/fb.h>
+#include <unistd.h>
+#include <stropts.h>
+#include <string.h>
+#include <errno.h>
+
+void wiz_mmuhack(int mem_fd)
+{
+ int mmufd = open("/dev/mmuhack", O_RDWR);
+
+
+ if(mmufd < 0) {
+ printf ("Installing NK's kernel module for Squidge MMU Hack...\n");
+ system("/sbin/insmod mmuhack.ko");
+ mmufd = open("/dev/mmuhack", O_RDWR);
+ }
+ if(mmufd < 0) return 0;
+
+ close(mmufd);
+ return 1;
+}
+