summaryrefslogtreecommitdiff
path: root/src/wiz_mmuhack.c
blob: f2204d6a0b9561703f0e147281a02e45c5ba9f03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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;
}