VOID EisaInvalidateCache ( IN PVOID Address, IN ULONG Length ) { ULONG CacheSize; ULONG CacheLineSize; if ( !Length ) // invalidate entire cache ? { // yes, get cache sizes and invalidate GetDCacheSize( (ULONG)&CacheSize, (ULONG)&CacheLineSize ); FlushInvalidateDCacheIndex( (PVOID)KSEG0_BASE, CacheSize ); GetICacheSize( (ULONG)&CacheSize, (ULONG)&CacheLineSize ); InvalidateICacheIndex( (PVOID)KSEG0_BASE, CacheSize ); return; // return to caller } // // User specified a specific address to invalidate. So take the users // starting virtual address and size and invalidate both instruction and // data caches. // Address = (PVOID)((ULONG)Address & 0x1FFFFFFF | KSEG0_BASE); FlushInvalidateDCacheIndex( Address, Length ); InvalidateICacheIndex( Address, Length ); return; // return to caller }
VOID EisaFlushCache ( IN PVOID Address, IN ULONG Length ) { ULONG CacheSize; ULONG CacheLineSize; if ( !Length ) // flush entire cache ? { // yes, get cache sizes and flush GetDCacheSize( (ULONG)&CacheSize, (ULONG)&CacheLineSize ); FlushInvalidateDCacheIndex( (PVOID)KSEG0_BASE, CacheSize ); return; // return to caller } // // User specified a specific address to flush. So take the users starting // virtual address and size and flush data cache. // Address = (PVOID)((ULONG)Address & 0x1FFFFFFF | KSEG0_BASE); FlushInvalidateDCacheIndex( Address, Length ); return; // return }
OP_STATUS Context_Manager::GetNewFileNameCopy(OpStringS &name, const uni_char* ext, OpFileFolder &folder, BOOL session_only #if defined __OEM_EXTENDED_CACHE_MANAGEMENT && defined __OEM_OPERATOR_CACHE_MANAGEMENT ,BOOL useOperatorCache #endif ) { #ifdef _DEBUG_URLMAN_CHECK Check(); #endif if(context_id != 0) { #ifdef DISK_CACHE_SUPPORT folder = (cache_loc != OPFILE_ABSOLUTE_FOLDER ? cache_loc : OPFILE_CACHE_FOLDER); #else folder = OPFILE_ABSOLUTE_FOLDER; #endif } else { folder = ( #if defined __OEM_EXTENDED_CACHE_MANAGEMENT && defined __OEM_OPERATOR_CACHE_MANAGEMENT useOperatorCache ? OPFILE_OCACHE_FOLDER : #endif OPFILE_CACHE_FOLDER); } name.Empty(); #ifdef SEARCH_ENGINE_CACHE return url_store->AppendFileName(&name, GetDCacheSize(), session_only #if defined __OEM_EXTENDED_CACHE_MANAGEMENT && defined __OEM_OPERATOR_CACHE_MANAGEMENT , useOperatorCache #endif ); #else IncFileStr(); #ifdef CACHE_MULTIPLE_FOLDERS if(enable_directories) RETURN_IF_ERROR(GetNameWithFolders(name, session_only, file_str)); else #endif // CACHE_MULTIPLE_FOLDERS RETURN_IF_ERROR(name.Set(file_str)); while (true) { OpFile file; OP_STATUS op_err = file.Construct(name.CStr(), folder); if (OpStatus::IsSuccess(op_err)) { #ifdef URL_CHECK_CACHE_FILES BOOL exists = FALSE; RETURN_IF_ERROR(file.Exists(exists)); if (exists) { if(name.CStr()) name[0]=0; // Faster than Empty() IncFileStr(); #ifdef CACHE_MULTIPLE_FOLDERS if(enable_directories) RETURN_IF_ERROR(GetNameWithFolders(name, session_only, file_str)); else #endif // CACHE_MULTIPLE_FOLDERS RETURN_IF_ERROR(name.Set(file_str)); } else { RETURN_IF_ERROR(file.Open(OPFILE_WRITE)); file.Close(); break; } #else //URL_CHECK_CACHE_FILES break; #endif //URL_CHECK_CACHE_FILES } else if(OpStatus::IsMemoryError(op_err)) return op_err; } return OpStatus::OK; #endif // SEARCH_ENGINE_CACHE }