+/*
+ * (C) GraÅžvydas "notaz" Ignotas, 2009-2010
+ *
+ * This work is licensed under the terms of any of these licenses
+ * (at your option):
+ * - GNU GPL, version 2 or later.
+ * - GNU LGPL, version 2.1 or later.
+ * - MAME license.
+ * See the COPYING file in the top-level directory.
+ */
+
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
{
volatile unsigned short *memregs;
volatile unsigned int *memregl;
- static gp2x_soc_t ret = -1;
+ static gp2x_soc_t ret = -2;
int pollux_chipname[0x30/4 + 1];
char *pollux_chipname_c = (char *)pollux_chipname;
int memdev;
int i;
- if (ret != -1)
+ if ((int)ret != -2)
/* already detected */
return ret;
if (memdev == -1)
{
perror("open(/dev/mem)");
+ ret = -1;
return -1;
}
{
perror("mmap(memregs)");
close(memdev);
+ ret = -1;
return -1;
}
memregl = (volatile void *)memregs;