/* $Id: cache.c,v 1.4 2000/01/25 00:11:38 prumpf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1999 Helge Deller (07-13-1999) * Copyright (C) 1999 SuSE GmbH Nuernberg * Copyright (C) 2000 Philipp Rumpf (prumpf@tux.org) * * Cache and TLB management * */ #include #include #include #include #include #include #include #include struct pdc_cache_info cache_info; #ifndef __LP64__ static struct pdc_btlb_info btlb_info; #endif void __flush_page_to_ram(unsigned long address) { __flush_dcache_range(address, PAGE_SIZE); __flush_icache_range(address, PAGE_SIZE); } void flush_data_cache(void) { register unsigned long base = cache_info.dc_base; register unsigned long count = cache_info.dc_count; register unsigned long loop = cache_info.dc_loop; register unsigned long stride = cache_info.dc_stride; register unsigned long addr; register long i, j; for(i=0,addr=base; i>8, btlb_info.fixed_range_info.num_i, btlb_info.fixed_range_info.num_d, btlb_info.fixed_range_info.num_comb, btlb_info.variable_range_info.num_i, btlb_info.variable_range_info.num_d, btlb_info.variable_range_info.num_comb ); } #endif return p - buffer; } void __init cache_init(void) { if(pdc_cache_info(&cache_info)<0) panic("cache_init: pdc_cache_info failed"); #if 0 printk("ic_size %lx dc_size %lx it_size %lx pdc_cache_info %d*long pdc_cache_cf %d\n", cache_info.ic_size, cache_info.dc_size, cache_info.it_size, sizeof (struct pdc_cache_info) / sizeof (long), sizeof (struct pdc_cache_cf) ); #endif #ifndef __LP64__ if(pdc_btlb_info(&btlb_info)<0) { memset(&btlb_info, 0, sizeof btlb_info); } #endif }