diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-09-05 13:33:57 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-09-08 07:53:03 +0200 |
commit | 8d30713d42e856def01ac0708847b8b56ca46283 (patch) | |
tree | 2ef3225ed03950fe02b620ffa11a37f7a342c56f /testsuites | |
parent | doc/arm: Update floating point unit support (diff) | |
download | rtems-8d30713d42e856def01ac0708847b8b56ca46283.tar.bz2 |
tmtests/tmcontext01: Improve cache dirty function
Diffstat (limited to 'testsuites')
-rw-r--r-- | testsuites/tmtests/tmcontext01/init.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/testsuites/tmtests/tmcontext01/init.c b/testsuites/tmtests/tmcontext01/init.c index c5162a29a6..444f2afde6 100644 --- a/testsuites/tmtests/tmcontext01/init.c +++ b/testsuites/tmtests/tmcontext01/init.c @@ -44,14 +44,16 @@ static volatile int *main_data; static Context_Control ctx; -static void dirty_data_cache(volatile int *d) +static int dirty_data_cache(volatile int *d, int j) { size_t n = data_size / sizeof(*d); size_t i; for (i = 0; i < n; ++i) { - d[i] = i; + d[i] = i + j; } + + return i + j; } static int prevent_opt_func(int m, int n) @@ -88,7 +90,7 @@ static int call_at_level(int start, int fl, int s, bool dirty) rtems_counter_ticks b; if (dirty) { - dirty_data_cache(main_data); + dirty_data_cache(main_data, fl); rtems_cache_invalidate_entire_instruction(); } @@ -110,9 +112,10 @@ static int call_at_level(int start, int fl, int s, bool dirty) static void load_task(rtems_task_argument arg) { volatile int *load_data = (volatile int *) arg; + int j = (int) rtems_get_current_processor(); while (true) { - dirty_data_cache(load_data); + j = dirty_data_cache(load_data, j); } } |