diff -r -u5 -N -x CVS -x '*~' -x '.#*' clean/ecos/packages/hal/powerpc/mpc8xx/current/include/var_cache.h devo/ecos/packages/hal/powerpc/mpc8xx/current/include/var_cache.h --- clean/ecos/packages/hal/powerpc/mpc8xx/current/include/var_cache.h 2006-03-02 15:02:45.180068800 +0000 +++ devo/ecos/packages/hal/powerpc/mpc8xx/current/include/var_cache.h 2006-03-02 15:02:08.176860800 +0000 @@ -427,7 +427,33 @@ // Invalidate cache lines in the given range without writing to memory. //#define HAL_ICACHE_INVALIDATE( _base_ , _size_ ) //----------------------------------------------------------------------------- +// This is used by the flash driver, we need a version that +// disables the interrupts so that it cannot get interrupted + +#define HAL_FLASH_CACHES_OFF(_d_, _i_) \ + CYG_MACRO_START \ + _i_ = 0; /* avoids warning */ \ + unsigned long __state; \ + HAL_DISABLE_INTERRUPTS(__state); \ + HAL_DCACHE_IS_ENABLED(_d_); \ + HAL_DCACHE_SYNC(); \ + HAL_DCACHE_INVALIDATE_ALL(); \ + HAL_DCACHE_DISABLE(); \ + HAL_ICACHE_INVALIDATE_ALL(); \ + HAL_RESTORE_INTERRUPTS(__state); \ + CYG_MACRO_END + +#define HAL_FLASH_CACHES_ON(_d_, _i_) \ + CYG_MACRO_START \ + unsigned long __state; \ + HAL_DISABLE_INTERRUPTS(__state); \ + if (_d_) HAL_DCACHE_ENABLE(); \ + HAL_RESTORE_INTERRUPTS(__state); \ + CYG_MACRO_END + + +//----------------------------------------------------------------------------- #endif // ifndef CYGONCE_VAR_CACHE_H // End of var_cache.h