#158487 - ingramb - Thu Jun 12, 2008 5:19 am
I have code (more or less) like this:
***
NeoSystem.h
typedef struct {
u32 val0;
u32 val1;
u32 val2;
...
} TNeoContext;
register TNeoContext* g_neo asm("r7");
***
NeoSystem.c
TNeoContext g_neoContext;
//call this at program start
void init() { g_neo = &g_neoContext; }
int systemOpen(const char* szFile)
{
u32 testVal = g_neo->val0;
int fd = open(szFile, O_RDONLY);
ASSERT(testVal == g_neo->val0); //!!!!!!! this fails!
return fd;
}
On my max media dock, everything is fine. On my ninjapass x9, the above ASSERT fails. Somewhere inside open, the value of g_neoContext is changing. I've moved g_neoContext back and forth between DTCM and main ram, and get the exact same behavior. So the value getting corrupted does not depend on a specific memory address. What else could be going wrong?
***
NeoSystem.h
typedef struct {
u32 val0;
u32 val1;
u32 val2;
...
} TNeoContext;
register TNeoContext* g_neo asm("r7");
***
NeoSystem.c
TNeoContext g_neoContext;
//call this at program start
void init() { g_neo = &g_neoContext; }
int systemOpen(const char* szFile)
{
u32 testVal = g_neo->val0;
int fd = open(szFile, O_RDONLY);
ASSERT(testVal == g_neo->val0); //!!!!!!! this fails!
return fd;
}
On my max media dock, everything is fine. On my ninjapass x9, the above ASSERT fails. Somewhere inside open, the value of g_neoContext is changing. I've moved g_neoContext back and forth between DTCM and main ram, and get the exact same behavior. So the value getting corrupted does not depend on a specific memory address. What else could be going wrong?