From 26c142e5ad4a63ad42baa17159c1821afe473a00 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 17 Apr 2015 12:05:16 +0200 Subject: score: Refactor SMP cache manager support --- testsuites/smptests/smpcache01/init.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'testsuites/smptests') diff --git a/testsuites/smptests/smpcache01/init.c b/testsuites/smptests/smpcache01/init.c index 01d6e1ea7f..7ad2ef9199 100644 --- a/testsuites/smptests/smpcache01/init.c +++ b/testsuites/smptests/smpcache01/init.c @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -26,17 +27,6 @@ CPU_STRUCTURE_ALIGNMENT static int data_to_flush[1024]; #define WORKER_PRIORITY 100 -typedef void (*Cache_manager_Function_ptr)(const void *d_addr, size_t n_bytes); - -void -_Cache_manager_Send_smp_msg( - const size_t setsize, - const cpu_set_t *set, - Cache_manager_Function_ptr func, - const void * addr, - size_t size - ); - typedef struct { SMP_barrier_Control barrier; uint32_t count[CPU_COUNT]; @@ -51,10 +41,9 @@ static void function_to_flush( void ) /* Does nothing. Used to give a pointer to instruction address space. */ } -static void test_cache_message( const void *d_addr, size_t n_bytes ) +static void test_cache_message( void *arg ) { - rtems_test_assert(n_bytes == 123); - rtems_test_assert(d_addr == 0); + rtems_test_assert(arg == &ctx); ctx.count[rtems_get_current_processor()]++; } @@ -111,7 +100,7 @@ static void test_func_test( size_t set_size, cpu_set_t *cpu_set, ctx.count[rtems_get_current_processor()] = 0; _SMP_barrier_Wait( &ctx.barrier, bs, rtems_get_processor_count() ); - _Cache_manager_Send_smp_msg( set_size, cpu_set, test_cache_message, 0, 123 ); + _SMP_Multicast_action( set_size, cpu_set, test_cache_message, &ctx ); _SMP_barrier_Wait( &ctx.barrier, bs, rtems_get_processor_count() ); @@ -129,7 +118,7 @@ static void test_func_isrdisabled_test( size_t set_size, cpu_set_t *cpu_set, _SMP_barrier_Wait( &ctx.barrier, bs, rtems_get_processor_count() ); - _Cache_manager_Send_smp_msg( set_size, cpu_set, test_cache_message, 0, 123 ); + _SMP_Multicast_action( set_size, cpu_set, test_cache_message, &ctx ); _SMP_barrier_Wait( &ctx.barrier, bs, rtems_get_processor_count() ); @@ -149,7 +138,7 @@ static void test_func_giant_taken_test( size_t set_size, cpu_set_t *cpu_set, _SMP_barrier_Wait( &ctx.barrier, bs, rtems_get_processor_count() ); - _Cache_manager_Send_smp_msg( set_size, cpu_set, test_cache_message, 0, 123 ); + _SMP_Multicast_action( set_size, cpu_set, test_cache_message, &ctx ); _SMP_barrier_Wait( &ctx.barrier, bs, rtems_get_processor_count() ); -- cgit v1.2.3