diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-10-27 12:59:09 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-11-15 08:56:53 +0100 |
commit | 240a1f79b1fcb58b9ae7bfc393e1f890e4492683 (patch) | |
tree | 92c47fa4899b2f0a8306e32bc18d66fbbf6b216f /testsuites | |
parent | score: Do not shadow parameter (diff) | |
download | rtems-240a1f79b1fcb58b9ae7bfc393e1f890e4492683.tar.bz2 |
score: Introduce CPU budget operations
This patch set replaces the CPU budget algorithm enumeration with a set of CPU
budget operations which implement a particular CPU budget algorithm. This
helps to hide the CPU budget algorithm implementation details from the general
thread handling. The CPU budget callouts are turned into CPU budget
operations. This slightly reduces the size of the thread control block.
All schedulers used the default scheduler tick implementation. The tick
scheduler operation is removed and the CPU budget operations are directly used
in _Watchdog_Tick() if the executing thread uses a CPU budget algorithm. This
is performance improvement for all threads which do not use a CPU budget
algorithm (default behaviour).
Diffstat (limited to 'testsuites')
-rw-r--r-- | testsuites/sptests/sptimecounter01/init.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/testsuites/sptests/sptimecounter01/init.c b/testsuites/sptests/sptimecounter01/init.c index dc601d7acb..23671e3ac8 100644 --- a/testsuites/sptests/sptimecounter01/init.c +++ b/testsuites/sptests/sptimecounter01/init.c @@ -23,6 +23,7 @@ #include <bsp/bootcard.h> #include <rtems/score/timecounterimpl.h> +#include <rtems/score/percpu.h> #include <rtems/score/todimpl.h> #include <rtems/timecounter.h> #include <rtems/bsd.h> @@ -42,6 +43,8 @@ typedef struct { static test_context test_instance; +static Thread_Control executing; + static uint32_t test_get_timecount(struct timecounter *tc) { test_context *ctx; @@ -106,12 +109,17 @@ void boot_card(const char *cmdline) struct bintime bt; struct timeval tv; struct timespec ts; + Per_CPU_Control *cpu_self; ctx = &test_instance; tc = &ctx->tc; TEST_BEGIN(); + cpu_self = _Per_CPU_Get(); + cpu_self->executing = &executing; + cpu_self->heir = &executing; + assert(time(NULL) == TOD_SECONDS_1970_THROUGH_1988); rtems_bsd_bintime(&bt); |