From e1d7bf002efda1f6319bd8aa64ad1c9712103d54 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 26 Feb 2014 11:08:31 +0100 Subject: rtems: Add cache size functions Add rtems_cache_get_data_cache_size() and rtems_cache_get_instruction_cache_size(). --- c/src/lib/libcpu/shared/src/cache_manager.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'c/src/lib/libcpu/shared/src/cache_manager.c') diff --git a/c/src/lib/libcpu/shared/src/cache_manager.c b/c/src/lib/libcpu/shared/src/cache_manager.c index 8fa0477748..c55f12c823 100644 --- a/c/src/lib/libcpu/shared/src/cache_manager.c +++ b/c/src/lib/libcpu/shared/src/cache_manager.c @@ -160,6 +160,16 @@ rtems_cache_get_data_line_size( void ) } +size_t +rtems_cache_get_data_cache_size( uint32_t level ) +{ +#if defined(CPU_CACHE_SUPPORT_PROVIDES_CACHE_SIZE_FUNCTIONS) + return _CPU_cache_get_data_cache_size( level ); +#else + return 0; +#endif +} + /* * This function freezes the data cache; cache lines * are not replaced. @@ -275,6 +285,17 @@ rtems_cache_get_instruction_line_size( void ) } +size_t +rtems_cache_get_instruction_cache_size( uint32_t level ) +{ +#if defined(CPU_CACHE_SUPPORT_PROVIDES_CACHE_SIZE_FUNCTIONS) + return _CPU_cache_get_instruction_cache_size( level ); +#else + return 0; +#endif +} + + /* * This function freezes the instruction cache; cache lines * are not replaced. -- cgit v1.2.3