int mem_fd;
int mem_fd_gpclk;
+int gayle_emulation_enabled = 1;
void *gpio_map;
void *gpclk_map;
}
-int main() {
+int main(int argc, char *argv[]) {
int g;
const struct sched_param priority = {99};
+ // Some command line switch stuffles
+ for (g = 1; g < argc; g++) {
+ if (strcmp(argv[g], "--disable-gayle") == 0) {
+ gayle_emulation_enabled = 0;
+ }
+ }
+
sched_setscheduler(0, SCHED_FIFO, &priority);
mlockall(MCL_CURRENT); // lock in memory to keep us from paging out
}
}
- if (address > GAYLEBASE && address < GAYLEBASE + GAYLESIZE) {
- return readGayleB(address);
+ if (gayle_emulation_enabled) {
+ if (address > GAYLEBASE && address < GAYLEBASE + GAYLESIZE) {
+ return readGayleB(address);
+ }
}
address &=0xFFFFFF;
}
}
- if (address > GAYLEBASE && address < GAYLEBASE + GAYLESIZE) {
- return readGayle(address);
+ if (gayle_emulation_enabled) {
+ if (address > GAYLEBASE && address < GAYLEBASE + GAYLESIZE) {
+ return readGayle(address);
+ }
}
// if (address < 0xffffff) {
}
}
- if (address > GAYLEBASE && address < GAYLEBASE + GAYLESIZE) {
- return readGayleL(address);
+ if (gayle_emulation_enabled) {
+ if (address > GAYLEBASE && address < GAYLEBASE + GAYLESIZE) {
+ return readGayleL(address);
+ }
}
// if (address < 0xffffff) {
return;
}
- if (address > GAYLEBASE && address < GAYLEBASE + GAYLESIZE) {
- writeGayleB(address, value);
- return;
+ if (gayle_emulation_enabled) {
+ if (address > GAYLEBASE && address < GAYLEBASE + GAYLESIZE) {
+ writeGayleB(address, value);
+ return;
+ }
}
/*
if (address == 0xbfe001) {
return;
}
- if (address > GAYLEBASE && address < GAYLEBASE + GAYLESIZE) {
- writeGayle(address, value);
- return;
+ if (gayle_emulation_enabled) {
+ if (address > GAYLEBASE && address < GAYLEBASE + GAYLESIZE) {
+ writeGayle(address, value);
+ return;
+ }
}
// if (address < 0xffffff) {
return;
}
- if (address > GAYLEBASE && address < GAYLEBASE + GAYLESIZE) {
- writeGayleL(address, value);
+ if (gayle_emulation_enabled) {
+ if (address > GAYLEBASE && address < GAYLEBASE + GAYLESIZE) {
+ writeGayleL(address, value);
+ }
}
// if (address < 0xffffff) {