From a00dff42cfdf201abe15829baeeb2b6341a0426b Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 12 Dec 2019 06:37:01 +0100 Subject: rtems: Add and use rtems_object_get_local_node() Update #3841. --- cpukit/libcsupport/src/error.c | 2 +- cpukit/libcsupport/src/getpgrp.c | 4 ++-- cpukit/libcsupport/src/getpid.c | 4 ++-- cpukit/libcsupport/src/utsname.c | 8 ++++++-- 4 files changed, 11 insertions(+), 7 deletions(-) (limited to 'cpukit/libcsupport/src') diff --git a/cpukit/libcsupport/src/error.c b/cpukit/libcsupport/src/error.c index 0e65f8929b..7d76327f94 100644 --- a/cpukit/libcsupport/src/error.c +++ b/cpukit/libcsupport/src/error.c @@ -51,7 +51,7 @@ int rtems_verror( #if defined(RTEMS_MULTIPROCESSING) if (_System_state_Is_multiprocessing) - fprintf(stderr, "[%" PRIu32 "] ", _Configuration_MP_table->node); + fprintf(stderr, "[%" PRIu16 "] ", rtems_object_get_local_node()); #endif chars_written += vfprintf(stderr, printf_format, arglist); diff --git a/cpukit/libcsupport/src/getpgrp.c b/cpukit/libcsupport/src/getpgrp.c index 208c7022f7..de372f3e8c 100644 --- a/cpukit/libcsupport/src/getpgrp.c +++ b/cpukit/libcsupport/src/getpgrp.c @@ -3,7 +3,7 @@ #endif #include -#include +#include /* * 4.3.1 Get Process Group IDs, P1003.1b-1993, p. 89 @@ -16,5 +16,5 @@ pid_t getpgrp( void ) * this will always be the local node; */ - return _Objects_Local_node; + return rtems_object_get_local_node(); } diff --git a/cpukit/libcsupport/src/getpid.c b/cpukit/libcsupport/src/getpid.c index 53ab2f4dc8..e17b1f2585 100644 --- a/cpukit/libcsupport/src/getpid.c +++ b/cpukit/libcsupport/src/getpid.c @@ -11,7 +11,7 @@ #include -#include +#include #include /** @@ -19,7 +19,7 @@ */ pid_t getpid( void ) { - return _Objects_Local_node; + return rtems_object_get_local_node(); } #if defined(RTEMS_NEWLIB) && !defined(HAVE__GETPID_R) diff --git a/cpukit/libcsupport/src/utsname.c b/cpukit/libcsupport/src/utsname.c index 8cdd4be536..57ed914aad 100644 --- a/cpukit/libcsupport/src/utsname.c +++ b/cpukit/libcsupport/src/utsname.c @@ -23,7 +23,7 @@ #include #include -#include +#include #include /* @@ -47,7 +47,11 @@ int uname( strncpy( name->sysname, "RTEMS", sizeof(name->sysname) ); - snprintf( name->nodename, sizeof(name->nodename), "Node %" PRId16, _Objects_Local_node ); + snprintf( + name->nodename, + sizeof(name->nodename), + "Node %" PRId16, rtems_object_get_local_node() + ); strncpy( name->release, RTEMS_VERSION, sizeof(name->release) ); -- cgit v1.2.3