1.1 --- a/src/sh4/xltcache.c Wed Oct 29 23:51:58 2008 +0000
1.2 +++ b/src/sh4/xltcache.c Mon Dec 22 09:51:11 2008 +0000
1.4 xlat_cache_block_t xlat_new_cache;
1.5 xlat_cache_block_t xlat_new_cache_ptr;
1.6 xlat_cache_block_t xlat_new_create_ptr;
1.8 +#ifdef XLAT_GENERATIONAL_CACHE
1.9 xlat_cache_block_t xlat_temp_cache;
1.10 xlat_cache_block_t xlat_temp_cache_ptr;
1.11 xlat_cache_block_t xlat_old_cache;
1.12 xlat_cache_block_t xlat_old_cache_ptr;
1.15 static void ***xlat_lut;
1.16 static gboolean xlat_initialized = FALSE;
1.19 xlat_initialized = TRUE;
1.20 xlat_new_cache = mmap( NULL, XLAT_NEW_CACHE_SIZE, PROT_EXEC|PROT_READ|PROT_WRITE,
1.21 MAP_PRIVATE|MAP_ANON, -1, 0 );
1.22 + xlat_new_cache_ptr = xlat_new_cache;
1.23 + xlat_new_create_ptr = xlat_new_cache;
1.24 +#ifdef XLAT_GENERATIONAL_CACHE
1.25 xlat_temp_cache = mmap( NULL, XLAT_TEMP_CACHE_SIZE, PROT_EXEC|PROT_READ|PROT_WRITE,
1.26 MAP_PRIVATE|MAP_ANON, -1, 0 );
1.27 xlat_old_cache = mmap( NULL, XLAT_OLD_CACHE_SIZE, PROT_EXEC|PROT_READ|PROT_WRITE,
1.28 MAP_PRIVATE|MAP_ANON, -1, 0 );
1.29 - xlat_new_cache_ptr = xlat_new_cache;
1.30 xlat_temp_cache_ptr = xlat_temp_cache;
1.31 xlat_old_cache_ptr = xlat_old_cache;
1.32 - xlat_new_create_ptr = xlat_new_cache;
1.35 xlat_lut = mmap( NULL, XLAT_LUT_PAGES*sizeof(void *), PROT_READ|PROT_WRITE,
1.36 MAP_PRIVATE|MAP_ANON, -1, 0);
1.37 memset( xlat_lut, 0, XLAT_LUT_PAGES*sizeof(void *) );
1.42 -void xlat_print_free( FILE *out )
1.44 - fprintf( out, "New space: %d\nTemp space: %d\nOld space: %d\n",
1.45 - xlat_new_cache_ptr->size, xlat_temp_cache_ptr->size, xlat_old_cache_ptr->size );
1.49 * Reset the cache structure to its default state
1.52 tmp = NEXT(xlat_new_cache_ptr);
1.55 +#ifdef XLAT_GENERATIONAL_CACHE
1.56 xlat_temp_cache_ptr = xlat_temp_cache;
1.57 xlat_temp_cache_ptr->active = 0;
1.58 xlat_temp_cache_ptr->size = XLAT_TEMP_CACHE_SIZE - 2*sizeof(struct xlat_cache_block);
1.60 tmp = NEXT(xlat_old_cache_ptr);
1.64 for( i=0; i<XLAT_LUT_PAGES; i++ ) {
1.65 if( xlat_lut[i] != NULL ) {
1.66 memset( xlat_lut[i], 0, XLAT_LUT_PAGE_SIZE );
1.71 +#ifdef XLAT_GENERATIONAL_CACHE
1.73 * Promote a block in temp space (or elsewhere for that matter) to old space.
1.75 @@ -392,6 +394,12 @@
1.80 +void xlat_promote_to_temp_space( xlat_cache_block_t block )
1.82 + *block->lut_entry = 0;
1.87 * Returns the next block in the new cache list that can be written to by the
1.89 void xlat_check_integrity( )
1.91 xlat_check_cache_integrity( xlat_new_cache, xlat_new_cache_ptr, XLAT_NEW_CACHE_SIZE );
1.92 +#ifdef XLAT_GENERATIONAL_CACHE
1.93 xlat_check_cache_integrity( xlat_temp_cache, xlat_temp_cache_ptr, XLAT_TEMP_CACHE_SIZE );
1.94 xlat_check_cache_integrity( xlat_old_cache, xlat_old_cache_ptr, XLAT_OLD_CACHE_SIZE );