Commit 92763b80 authored by alex@thinkpad's avatar alex@thinkpad
Browse files

fio-ml: FIO_ReadFile wrapper to warn about caching issues

not sure how to handle it automatically - clean_d_cache before is not enough
adding another clean_d_cache afterwards appears to fix it, but it's risky
sed -i.bak '/ FIO_ReadFile/_FIO_ReadFile/' */stubs.S

--HG--
branch : cache-fixes
parent 442adb770727
......@@ -44,7 +44,7 @@ NSTUB( 0x833C, additional_version)
NSTUB(0xFF1D9620, FIO_CloseFile) // might be good (dumps=1, score=1e+02)
NSTUB(0xFF1DA5F0, FIO_FindClose) // might be good (dumps=1, score=69)
NSTUB(0xFF1DA510, FIO_FindNextEx) // might be good (dumps=1, score=50)
NSTUB(0xFF1D93D0, FIO_ReadFile) // might be good (dumps=1, score=87)
NSTUB(0xFF1D93D0, _FIO_ReadFile) // might be good (dumps=1, score=87)
NSTUB(0xFF1D9480, FIO_SeekSkipFile) /* present on 5D3.113, EOSM.202 */
NSTUB(0xFF1D9570, _FIO_WriteFile) // might be good (dumps=1, score=65)
NSTUB(0xFF1D9E5C, _FIO_CreateDirectory) // might be good (dumps=1, score=13)
......
......@@ -48,7 +48,7 @@ NSTUB( 0x150FC, additional_version) /** Find the additio
NSTUB(0xFF196494, FIO_CloseFile)
NSTUB(0xFF1975A4, FIO_FindClose) // called with ret_FIO_FindFirstEx after finishing the dir scanning loop
NSTUB(0xFF1974A4, FIO_FindNextEx)
NSTUB(0xFF196724, FIO_ReadFile)
NSTUB(0xFF196724, _FIO_ReadFile)
NSTUB(0xFF1967D4, FIO_SeekSkipFile)
NSTUB(0xFF1968D4, _FIO_WriteFile)
NSTUB(0xFF196CF8, _FIO_CreateDirectory)
......
......@@ -53,7 +53,7 @@ NSTUB( 0xFF3C, additional_version) // d
NSTUB(0xFF982590, FIO_CloseFile) // d
NSTUB(0xFF9836A0, FIO_FindClose) // called with ret_FIO_FindFirstEx after finishing the dir scanning loop
NSTUB(0xFF9835A0, FIO_FindNextEx) // d
NSTUB(0xFF982820, FIO_ReadFile) // d
NSTUB(0xFF982820, _FIO_ReadFile) // d
NSTUB(0xFF9828D0, FIO_SeekSkipFile)
NSTUB(0xFF9829D0, _FIO_WriteFile) // d
NSTUB(0xFF982DF4, _FIO_CreateDirectory)
......
......@@ -53,7 +53,7 @@ NSTUB( 0x15094, additional_version)
NSTUB(0xFF1C69EC, FIO_CloseFile)
NSTUB(0xFF1C7934, FIO_FindClose) // called with ret_FIO_FindFirstEx after finishing the dir scanning loop
NSTUB(0xFF1C7854, FIO_FindNextEx)
NSTUB(0xFF1C679C, FIO_ReadFile)
NSTUB(0xFF1C679C, _FIO_ReadFile)
NSTUB(0xFF1C684C, FIO_SeekSkipFile)
NSTUB(0xFF1C693C, _FIO_WriteFile)
NSTUB(0xFF1C71A0, _FIO_CreateDirectory)
......
......@@ -44,7 +44,7 @@ NSTUB( 0x13428, additional_version)
NSTUB(0xFF9AAD10, FIO_CloseFile)
NSTUB(0xFF9ABE20, FIO_FindClose)
NSTUB(0xFF9ABD20, FIO_FindNextEx)
NSTUB(0xFF9AAFA0, FIO_ReadFile)
NSTUB(0xFF9AAFA0, _FIO_ReadFile)
NSTUB(0xFF9AB050, FIO_SeekSkipFile)
NSTUB(0xFF9AB150, _FIO_WriteFile)
NSTUB(0xFF9AB574, _FIO_CreateDirectory)
......
......@@ -44,7 +44,7 @@ NSTUB( 0x468B8, additional_version)
NSTUB(0xFF309D38, FIO_CloseFile)
NSTUB(0xFF30AD30, FIO_FindClose) // proper name: FindClose
NSTUB(0xFF30AC50, FIO_FindNextEx)
NSTUB(0xFF309AE8, FIO_ReadFile)
NSTUB(0xFF309AE8, _FIO_ReadFile)
NSTUB(0xFF309B98, FIO_SeekSkipFile)
NSTUB(0xFF309C88, _FIO_WriteFile)
NSTUB(0xFF30A594, _FIO_CreateDirectory)
......
......@@ -58,7 +58,7 @@ NSTUB( 0x46910, additional_version) // GuiDataStorage
NSTUB(0xFF30E814, FIO_CloseFile)
NSTUB(0xFF30F80C, FIO_FindClose) // proper name: FindClose
NSTUB(0xFF30F72C, FIO_FindNextEx)
NSTUB(0xFF30E5C4, FIO_ReadFile)
NSTUB(0xFF30E5C4, _FIO_ReadFile)
NSTUB(0xFF30E674, FIO_SeekSkipFile)
NSTUB(0xFF30E764, _FIO_WriteFile)
NSTUB(0xFF30F070, _FIO_CreateDirectory)
......
......@@ -62,7 +62,7 @@ NSTUB( 0x82E0, additional_version)
NSTUB(0xFF1E66B4, FIO_CloseFile)
NSTUB(0xFF1E7684, FIO_FindClose) // called with ret_FIO_FindFirstEx after finishing the dir scanning loop
NSTUB(0xFF1E75A4, FIO_FindNextEx)
NSTUB(0xFF1E6464, FIO_ReadFile)
NSTUB(0xFF1E6464, _FIO_ReadFile)
NSTUB(0xFF1E6514, FIO_SeekSkipFile)
NSTUB(0xFF1E6604, _FIO_WriteFile)
NSTUB(0xFF1E6EF0, _FIO_CreateDirectory)
......
......@@ -51,7 +51,7 @@ NSTUB( 0x250D4, additional_version)
NSTUB(0xFF1CA3FC, FIO_CloseFile)
NSTUB(0xFF1CB3CC, FIO_FindClose) // called with ret_FIO_FindFirstEx after finishing the dir scanning loop
NSTUB(0xFF1CB2EC, FIO_FindNextEx)
NSTUB(0xFF1CA1AC, FIO_ReadFile)
NSTUB(0xFF1CA1AC, _FIO_ReadFile)
NSTUB(0xFF1CA25C, FIO_SeekSkipFile) /* present on 5D3.113, EOSM.202 */
NSTUB(0xFF1CA34C, _FIO_WriteFile)
NSTUB(0xFF1CAC38, _FIO_CreateDirectory)
......@@ -59,7 +59,7 @@ NSTUB(0xFF1CA058, _FIO_CreateFile)
NSTUB(0xFF1CB1F8, _FIO_FindFirstEx)
NSTUB(0xFF1CA578, _FIO_GetFileSize)
NSTUB(0xFF1C9F9C, _FIO_OpenFile)
NSTUB(0xFF1CA104, _FIO_RemoveFile) // after _FIO_CreateFile, before FIO_ReadFile
NSTUB(0xFF1CA104, _FIO_RemoveFile) // after _FIO_CreateFile, before_FIO_ReadFile
NSTUB(0xFF1CAA70, _FIO_RenameFile)
/** GUI **/
......
......@@ -48,7 +48,7 @@ NSTUB(0xFF0C5430, init_task)
NSTUB(0xFF34290C, FIO_CloseFile) // from Indy
NSTUB(0xFF343904, FIO_FindClose) // proper name: FindClose
NSTUB(0xFF343824, FIO_FindNextEx)
NSTUB(0xFF3426BC, FIO_ReadFile)
NSTUB(0xFF3426BC, _FIO_ReadFile)
NSTUB(0xFF34276C, FIO_SeekSkipFile) /* took relative offset of 700D entry points and compared them to 650Ds. Tests are OK. */
NSTUB(0xFF34285C, _FIO_WriteFile) // from Indy
NSTUB(0xFF343168, _FIO_CreateDirectory)
......
......@@ -48,7 +48,7 @@ NSTUB(0xFF0C5438, init_task)
NSTUB(0xFF33297C, FIO_CloseFile)
NSTUB(0xFF333974, FIO_FindClose) // proper name: FindClose
NSTUB(0xFF333894, FIO_FindNextEx)
NSTUB(0xFF33272C, FIO_ReadFile)
NSTUB(0xFF33272C, _FIO_ReadFile)
NSTUB(0xFF3327DC, FIO_SeekSkipFile)
NSTUB(0xFF3328CC, _FIO_WriteFile)
NSTUB(0xFF3331D8, _FIO_CreateDirectory)
......
......@@ -47,7 +47,7 @@ NSTUB( 0x26CE8, additional_version)
NSTUB(0xFF34545C, FIO_CloseFile)
NSTUB(0xFF346454, FIO_FindClose) // FindClose
NSTUB(0xFF346374, FIO_FindNextEx)
NSTUB(0xFF34520C, FIO_ReadFile)
NSTUB(0xFF34520C, _FIO_ReadFile)
NSTUB(0xFF3452BC, FIO_SeekSkipFile)
NSTUB(0xFF3453AC, _FIO_WriteFile)
NSTUB(0xFF345CB8, _FIO_CreateDirectory)
......
......@@ -45,7 +45,7 @@ NSTUB( 0x16FB8, additional_version)
NSTUB(0xFF1FC684, FIO_CloseFile)
NSTUB(0xFF1FD554, FIO_FindClose) // AJ__switch_0x1A50_n_calls_fstOpenDir
NSTUB(0xFF1FD42C, FIO_FindNextEx)
NSTUB(0xFF1FC434, FIO_ReadFile)
NSTUB(0xFF1FC434, _FIO_ReadFile)
NSTUB(0xFF1FC4E4, FIO_SeekSkipFile)
NSTUB(0xFF1FC5D4, _FIO_WriteFile)
NSTUB(0xFF1FCCF4, _FIO_CreateDirectory) // not sure. g3gg0: confirmed by caller 'ctgDirCreate'
......
......@@ -42,7 +42,7 @@ NSTUB(0xFF812B4C, init_task)
// NSTUB( ???, FIO_CloseFile) /* present on 7D.203, 500D.111, 60D.111, 6D.113, 5D3.113, 50D.109, 5D2.212, 600D.102, 650D.104, 550D.109, 1100D.105, EOSM.202, 700D.113 */
// NSTUB( ???, FIO_FindClose) /* present on 7D.203, 500D.111, 60D.111, 6D.113, 5D3.113, 50D.109, 5D2.212, 600D.102, 650D.104, 550D.109, 1100D.105, EOSM.202, 700D.113 */
// NSTUB( ???, FIO_FindNextEx) /* present on 7D.203, 500D.111, 60D.111, 6D.113, 5D3.113, 50D.109, 5D2.212, 600D.102, 650D.104, 550D.109, 1100D.105, EOSM.202, 700D.113 */
// NSTUB( ???, FIO_ReadFile) /* present on 7D.203, 500D.111, 60D.111, 6D.113, 5D3.113, 50D.109, 5D2.212, 600D.102, 650D.104, 550D.109, 1100D.105, EOSM.202, 700D.113 */
// NSTUB( ???, _FIO_ReadFile) /* present on 7D.203, 500D.111, 60D.111, 6D.113, 5D3.113, 50D.109, 5D2.212, 600D.102, 650D.104, 550D.109, 1100D.105, EOSM.202, 700D.113 */
// NSTUB( ???, FIO_SeekSkipFile) /* present on 5D3.113, EOSM.202 */
// NSTUB( ???, _FIO_WriteFile) /* present on 7D.203, 500D.111, 60D.111, 6D.113, 5D3.113, 50D.109, 5D2.212, 600D.102, 650D.104, 550D.109, 1100D.105, EOSM.202, 700D.113 */
// NSTUB( ???, _FIO_CreateDirectory) /* present on 7D.203, 500D.111, 60D.111, 6D.113, 5D3.113, 50D.109, 5D2.212, 600D.102, 650D.104, 550D.109, 1100D.105, EOSM.202, 700D.113 */
......
......@@ -44,7 +44,7 @@ NSTUB(0xFF0C5484, init_task)
NSTUB(0xFF3468F4, FIO_CloseFile)
NSTUB(0xFF3478EC, FIO_FindClose) // proper name: FindClose
NSTUB(0xFF34780C, FIO_FindNextEx)
NSTUB(0xFF3466A4, FIO_ReadFile)
NSTUB(0xFF3466A4, _FIO_ReadFile)
NSTUB(0xFF346754, FIO_SeekSkipFile)
NSTUB(0xFF346844, _FIO_WriteFile)
NSTUB(0xFF347150, _FIO_CreateDirectory)
......
......@@ -505,9 +505,22 @@ FILE* FIO_CreateFile(const char* name)
return _FIO_CreateFileEx(new_name);
}
/* Canon stub */
/* Canon stubs */
extern int _FIO_ReadFile( FILE* stream, void* ptr, size_t count );
extern int _FIO_WriteFile( FILE* stream, const void* ptr, size_t count );
int FIO_ReadFile( FILE* stream, void* ptr, size_t count )
{
if (ptr == CACHEABLE(ptr))
{
/* this appears to work most of the time, but not always */
/* proper solution: use fio_malloc */
ASSERT(0);
}
return _FIO_ReadFile(stream, ptr, count);
}
int FIO_WriteFile( FILE* stream, const void* ptr, size_t count )
{
/* we often assumed that the FIO routines will somehow care for buffers being still in cache.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment