summaryrefslogtreecommitdiffstats
path: root/cpukit/libmisc
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-05 08:16:05 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-09 08:06:46 +0200
commitf9219db2a95c8285d1be22092572b4236bfe6488 (patch)
treec168ac7fdf7458cea6d7146584b2adb38d47f6a1 /cpukit/libmisc
parentrtems: Add rtems_scheduler_get_processor() (diff)
downloadrtems-f9219db2a95c8285d1be22092572b4236bfe6488.tar.bz2
rtems: Add rtems_scheduler_get_processor_maximum()
Add rtems_scheduler_get_processor_maximum() as a replacement for rtems_get_processor_count(). The rtems_get_processor_count() is a bit orphaned. Adopt it by the Scheduler Manager. The count is also misleading, since the processor set may have gaps and the actual count of online processors may be less than the value returned by rtems_get_processor_count(). Update #3732.
Diffstat (limited to 'cpukit/libmisc')
-rw-r--r--cpukit/libmisc/capture/capture.c6
-rw-r--r--cpukit/libmisc/capture/capture_support.c2
-rw-r--r--cpukit/libmisc/cpuuse/cpuusagereset.c2
-rw-r--r--cpukit/libmisc/stackchk/check.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/cpukit/libmisc/capture/capture.c b/cpukit/libmisc/capture/capture.c
index 6accd509e7..bba7d91396 100644
--- a/cpukit/libmisc/capture/capture.c
+++ b/cpukit/libmisc/capture/capture.c
@@ -599,7 +599,7 @@ rtems_capture_open (uint32_t size, rtems_capture_timestamp timestamp RTEMS_UNU
return RTEMS_RESOURCE_IN_USE;
}
- count = rtems_get_processor_count();
+ count = rtems_scheduler_get_processor_maximum();
if (capture_per_cpu == NULL) {
capture_per_cpu = calloc( count, sizeof( *capture_per_cpu ) );
}
@@ -686,7 +686,7 @@ rtems_capture_close (void)
}
capture_controls = NULL;
- for (cpu=0; cpu < rtems_get_processor_count(); cpu++) {
+ for (cpu=0; cpu < rtems_scheduler_get_processor_maximum(); cpu++) {
if (capture_records_on_cpu(cpu).buffer)
rtems_capture_buffer_destroy( &capture_records_on_cpu(cpu) );
@@ -788,7 +788,7 @@ rtems_capture_flush (bool prime)
else
capture_flags_global &= ~RTEMS_CAPTURE_OVERFLOW;
- for (cpu=0; cpu < rtems_get_processor_count(); cpu++) {
+ for (cpu=0; cpu < rtems_scheduler_get_processor_maximum(); cpu++) {
RTEMS_INTERRUPT_LOCK_REFERENCE( lock, &(capture_lock_on_cpu( cpu )) )
rtems_interrupt_lock_context lock_context_per_cpu;
diff --git a/cpukit/libmisc/capture/capture_support.c b/cpukit/libmisc/capture/capture_support.c
index 60006e7dd8..4af8822c79 100644
--- a/cpukit/libmisc/capture/capture_support.c
+++ b/cpukit/libmisc/capture/capture_support.c
@@ -268,7 +268,7 @@ rtems_capture_print_trace_records (int total, bool csv)
rtems_capture_time last_time = 0;
int i;
- cpus = rtems_get_processor_count ();
+ cpus = rtems_scheduler_get_processor_maximum ();
per_cpu = calloc (cpus, sizeof(*per_cpu));
if (per_cpu == NULL)
diff --git a/cpukit/libmisc/cpuuse/cpuusagereset.c b/cpukit/libmisc/cpuuse/cpuusagereset.c
index 507044a7ee..455651e19f 100644
--- a/cpukit/libmisc/cpuuse/cpuusagereset.c
+++ b/cpukit/libmisc/cpuuse/cpuusagereset.c
@@ -56,7 +56,7 @@ void rtems_cpu_usage_reset( void )
_TOD_Get_uptime( &CPU_usage_Uptime_at_last_reset );
- cpu_count = rtems_get_processor_count();
+ cpu_count = rtems_scheduler_get_processor_maximum();
for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) {
Per_CPU_Control *cpu = _Per_CPU_Get_by_index( cpu_index );
diff --git a/cpukit/libmisc/stackchk/check.c b/cpukit/libmisc/stackchk/check.c
index ce7d1a08cb..a3f9a1d21e 100644
--- a/cpukit/libmisc/stackchk/check.c
+++ b/cpukit/libmisc/stackchk/check.c
@@ -477,7 +477,7 @@ void rtems_stack_checker_report_usage_with_plugin(
RTEMS_DECONST( rtems_printer *, printer )
);
- cpu_max = rtems_get_processor_count();
+ cpu_max = rtems_scheduler_get_processor_maximum();
for ( cpu_index = 0; cpu_index < cpu_max; ++cpu_index ) {
Stack_check_Dump_interrupt_stack_usage(