diff options
Diffstat (limited to '')
20 files changed, 75 insertions, 139 deletions
diff --git a/cpukit/score/src/ioprintf.c b/cpukit/dev/ioprintf.c index 8ae4213ab1..1f16389b47 100644 --- a/cpukit/score/src/ioprintf.c +++ b/cpukit/dev/ioprintf.c @@ -3,7 +3,7 @@ /** * @file * - * @ingroup RTEMSScoreIO + * @ingroup RTEMSDeviceIO * * @brief This source file contains the implementation of * _IO_Printf(). @@ -38,7 +38,7 @@ #include "config.h" #endif -#include <rtems/score/io.h> +#include <rtems/dev/io.h> int _IO_Printf( IO_Put_char put_char, void *arg, char const *fmt, ... ) { diff --git a/cpukit/score/src/iorelax.c b/cpukit/dev/iorelax.c index 1b155377a9..5fdefac151 100644 --- a/cpukit/score/src/iorelax.c +++ b/cpukit/dev/iorelax.c @@ -3,7 +3,7 @@ /** * @file * - * @ingroup RTEMSScoreIO + * @ingroup RTEMSDeviceIO * * @brief This source file contains the implementation of _IO_Relax(). */ @@ -37,7 +37,7 @@ #include "config.h" #endif -#include <rtems/score/io.h> +#include <rtems/dev/io.h> #include <rtems/score/cpuimpl.h> void _IO_Relax( void ) diff --git a/cpukit/score/src/iovprintf.c b/cpukit/dev/iovprintf.c index 0e8eb0b47b..99b11b691d 100644 --- a/cpukit/score/src/iovprintf.c +++ b/cpukit/dev/iovprintf.c @@ -1,7 +1,7 @@ /** * @file * - * @ingroup RTEMSScoreIO + * @ingroup RTEMSDeviceIO * * @brief This source file contains the implementation of * _IO_Vprintf(). @@ -45,7 +45,7 @@ * @(#)subr_prf.c 8.3 (Berkeley) 1/21/94 */ -#include <rtems/score/io.h> +#include <rtems/dev/io.h> #include <sys/cdefs.h> __FBSDID("$FreeBSD: head/sys/kern/subr_prf.c 336417 2018-07-17 14:56:54Z markj $"); diff --git a/cpukit/score/src/gcovdumpinfo.c b/cpukit/libtest/gcovdumpinfo.c index be00df2db8..87021ad613 100644 --- a/cpukit/score/src/gcovdumpinfo.c +++ b/cpukit/libtest/gcovdumpinfo.c @@ -3,7 +3,7 @@ /** * @file * - * @ingroup RTEMSScoreIO + * @ingroup RTEMSImplGcov * * @brief This source file contains the implementation of _Gcov_Ddump_info(). */ @@ -37,7 +37,7 @@ #include "config.h" #endif -#include <rtems/score/gcov.h> +#include <rtems/test-gcov.h> typedef struct { IO_Put_char put_char; diff --git a/cpukit/score/src/gcovdumpinfobase64.c b/cpukit/libtest/gcovdumpinfobase64.c index b7a9849084..62cd89ac7e 100644 --- a/cpukit/score/src/gcovdumpinfobase64.c +++ b/cpukit/libtest/gcovdumpinfobase64.c @@ -3,7 +3,7 @@ /** * @file * - * @ingroup RTEMSScoreIO + * @ingroup RTEMSImplGcov * * @brief This source file contains the implementation of * _Gcov_Dump_info_base64(). @@ -38,11 +38,13 @@ #include "config.h" #endif -#include <rtems/score/gcov.h> +#include <rtems/test-gcov.h> #include <limits.h> #include <string.h> +#include <rtems/base64.h> + typedef struct { IO_Put_char put_char; void *arg; @@ -77,7 +79,7 @@ static void _Gcov_Base64_encode( int c, void *arg ) if ( index == RTEMS_ARRAY_SIZE( ctx->buf ) - 1 ) { index = 0; - _IO_Base64( + _Base64_Encode( _Gcov_Base64_put_char, ctx, ctx->buf, @@ -100,5 +102,9 @@ void _Gcov_Dump_info_base64( IO_Put_char put_char, void *arg ) ctx.put_char = put_char; ctx.arg = arg; _Gcov_Dump_info( _Gcov_Base64_encode, &ctx ); - _IO_Base64( _Gcov_Base64_put_char, &ctx, ctx.buf, ctx.index, NULL, INT_MAX ); + + if ( ctx.index > 0 ) { + _Base64_Encode( put_char, arg, ctx.buf, ctx.index, NULL, INT_MAX ); + ( *put_char )( '\n', arg ); + } } diff --git a/cpukit/score/src/gcovinfoset.c b/cpukit/libtest/gcovinfoset.c index cb22e8252b..284c993d32 100644 --- a/cpukit/score/src/gcovinfoset.c +++ b/cpukit/libtest/gcovinfoset.c @@ -3,7 +3,7 @@ /** * @file * - * @ingroup RTEMSScoreIO + * @ingroup RTEMSImplGcov * * @brief This source file contains the definition of the gcov information * linker set. @@ -38,6 +38,6 @@ #include "config.h" #endif -#include <rtems/score/gcov.h> +#include <rtems/test-gcov.h> RTEMS_LINKER_ROSET( gcov_info, const struct gcov_info * ); diff --git a/cpukit/score/src/hash.c b/cpukit/score/src/hash.c index dc9143f4c0..0b9f127e54 100644 --- a/cpukit/score/src/hash.c +++ b/cpukit/score/src/hash.c @@ -39,7 +39,7 @@ #include <rtems/score/hash.h> #include <rtems/score/assert.h> -#include <rtems/score/io.h> +#include <rtems/base64.h> #include <limits.h> @@ -64,7 +64,7 @@ void _Hash_Finalize( Hash_Context *context, Hash_Control *hash ) context->hash = hash; context->index = 0; hash->chars[ sizeof( *hash ) - 1 ] = '\0'; - n = _IO_Base64url( + n = _Base64url_Encode( _Hash_Put_char, context, digest, diff --git a/cpukit/score/src/iobase64.c b/cpukit/score/src/iobase64.c deleted file mode 100644 index 27b977c8a0..0000000000 --- a/cpukit/score/src/iobase64.c +++ /dev/null @@ -1,111 +0,0 @@ -/* SPDX-License-Identifier: ISC */ - -/** - * @file - * - * @ingroup RTEMSScoreIO - * - * @brief This source file contains the implementation of - * _IO_Base64() and _IO_Base64url(). - */ - -/* - * Copyright (C) 2020, 2021 embedded brains GmbH & Co. KG - * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001, 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#include <rtems/score/io.h> - -static void -_IO_Put(int c, void *arg, IO_Put_char put_char) -{ - (*put_char)(c, arg); -} - -static int -_IO_Base64_with_encoding(IO_Put_char put_char, void *arg, const void *src, - size_t srclen, const char *wordbreak, int wordlen, const char *encoding) -{ - unsigned int loops = 0; - const unsigned char *in = src; - int out = 0; - - if (wordlen < 4) { - wordlen = 4; - } - - while (srclen > 2) { - _IO_Put(encoding[(in[0]>>2)&0x3f], arg, put_char); - _IO_Put(encoding[((in[0]<<4)&0x30)| - ((in[1]>>4)&0x0f)], arg, put_char); - _IO_Put(encoding[((in[1]<<2)&0x3c)| - ((in[2]>>6)&0x03)], arg, put_char); - _IO_Put(encoding[in[2]&0x3f], arg, put_char); - in += 3; - srclen -= 3; - out += 4; - - loops++; - if (srclen != 0 && - (int)((loops + 1) * 4) >= wordlen) - { - const char *w = wordbreak; - loops = 0; - while (*w != '\0') { - _IO_Put(*w, arg, put_char); - ++w; - ++out; - } - } - } - if (srclen == 2) { - _IO_Put(encoding[(in[0]>>2)&0x3f], arg, put_char); - _IO_Put(encoding[((in[0]<<4)&0x30)| - ((in[1]>>4)&0x0f)], arg, put_char); - _IO_Put(encoding[((in[1]<<2)&0x3c)], arg, put_char); - _IO_Put('=', arg, put_char); - out += 4; - } else if (srclen == 1) { - _IO_Put(encoding[(in[0]>>2)&0x3f], arg, put_char); - _IO_Put(encoding[((in[0]<<4)&0x30)], arg, put_char); - _IO_Put('=', arg, put_char); - _IO_Put('=', arg, put_char); - out += 4; - } - return out; -} - -static const char base64[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; - -int -_IO_Base64(IO_Put_char put_char, void *arg, const void *src, size_t srclen, - const char *wordbreak, int wordlen) -{ - return _IO_Base64_with_encoding(put_char, arg, src, srclen, wordbreak, - wordlen, base64); -} - -static const char base64url[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="; - -int -_IO_Base64url(IO_Put_char put_char, void *arg, const void *src, size_t srclen, - const char *wordbreak, int wordlen) -{ - return _IO_Base64_with_encoding(put_char, arg, src, srclen, wordbreak, - wordlen, base64url); -} diff --git a/cpukit/score/src/isr.c b/cpukit/score/src/isr.c index 75df00e228..7337028b0f 100644 --- a/cpukit/score/src/isr.c +++ b/cpukit/score/src/isr.c @@ -44,6 +44,8 @@ #include <rtems/score/percpu.h> #include <rtems/config.h> +const char * const volatile _ISR_Stack_size_object = _ISR_Stack_size; + void _ISR_Handler_initialization( void ) { uint32_t cpu_max; diff --git a/cpukit/score/src/objectextendinformation.c b/cpukit/score/src/objectextendinformation.c index 414766f219..9a627b1a7c 100644 --- a/cpukit/score/src/objectextendinformation.c +++ b/cpukit/score/src/objectextendinformation.c @@ -59,7 +59,7 @@ Objects_Maximum _Objects_Extend_information( uint32_t index_base; uint32_t index_end; uint32_t index; - Objects_Maximum extend_count; + uint32_t extend_count; Objects_Maximum old_maximum; uint32_t new_maximum; size_t object_block_size; diff --git a/cpukit/score/src/objectinitializeinformation.c b/cpukit/score/src/objectinitializeinformation.c index 3482f2871e..7c1bfd877f 100644 --- a/cpukit/score/src/objectinitializeinformation.c +++ b/cpukit/score/src/objectinitializeinformation.c @@ -42,7 +42,6 @@ #include <rtems/score/objectimpl.h> #include <rtems/score/address.h> #include <rtems/score/chainimpl.h> -#include <rtems/score/interr.h> #include <rtems/score/sysstate.h> void _Objects_Initialize_information( diff --git a/cpukit/score/src/processormaskcopy.c b/cpukit/score/src/processormaskcopy.c index 863bd1574e..3f1c2cf250 100644 --- a/cpukit/score/src/processormaskcopy.c +++ b/cpukit/score/src/processormaskcopy.c @@ -39,7 +39,7 @@ #include "config.h" #endif -#include <rtems/score/processormask.h> +#include <rtems/score/processormaskimpl.h> const Processor_mask _Processor_mask_The_one_and_only = { .__bits[ 0 ] = 1 }; diff --git a/cpukit/score/src/threadchangepriority.c b/cpukit/score/src/threadchangepriority.c index ca49f6f417..78291b7798 100644 --- a/cpukit/score/src/threadchangepriority.c +++ b/cpukit/score/src/threadchangepriority.c @@ -111,6 +111,7 @@ static void _Thread_Priority_action_change( void *arg ) { + (void) arg; _Thread_Set_scheduler_node_priority( priority_aggregation, priority_group_order diff --git a/cpukit/score/src/threadq.c b/cpukit/score/src/threadq.c index e694029a46..3c6d72bd14 100644 --- a/cpukit/score/src/threadq.c +++ b/cpukit/score/src/threadq.c @@ -179,5 +179,7 @@ void _Thread_queue_MP_callout_do_nothing( ) { /* Do nothing */ + (void) the_proxy; + (void) mp_id; } #endif diff --git a/cpukit/score/src/threadqenqueue.c b/cpukit/score/src/threadqenqueue.c index e43efd925b..038c483f65 100644 --- a/cpukit/score/src/threadqenqueue.c +++ b/cpukit/score/src/threadqenqueue.c @@ -400,6 +400,7 @@ void _Thread_queue_Deadlock_status( Thread_Control *the_thread ) void _Thread_queue_Deadlock_fatal( Thread_Control *the_thread ) { + (void) the_thread; _Internal_error( INTERNAL_ERROR_THREAD_QUEUE_DEADLOCK ); } diff --git a/cpukit/score/src/threadqops.c b/cpukit/score/src/threadqops.c index 83e00ca3ae..9a09b4c442 100644 --- a/cpukit/score/src/threadqops.c +++ b/cpukit/score/src/threadqops.c @@ -156,6 +156,8 @@ static void _Thread_queue_FIFO_do_initialize( { Scheduler_Node *scheduler_node; + (void) queue; + (void) queue_context; scheduler_node = _Thread_Scheduler_get_home_node( the_thread ); _Chain_Initialize_node( &scheduler_node->Wait.Priority.Node.Node.Chain ); @@ -291,6 +293,7 @@ static Thread_queue_Priority_queue *_Thread_queue_Priority_queue_by_index( ) { #if defined(RTEMS_SMP) + _Assert( scheduler_index < _Scheduler_Count ); return &heads->Priority[ scheduler_index ]; #else (void) scheduler_index; diff --git a/cpukit/score/src/threadqtimeout.c b/cpukit/score/src/threadqtimeout.c index acb3c1d048..e30a2ffded 100644 --- a/cpukit/score/src/threadqtimeout.c +++ b/cpukit/score/src/threadqtimeout.c @@ -53,6 +53,7 @@ void _Thread_queue_Add_timeout_ticks( { Watchdog_Interval ticks; + (void) queue; ticks = queue_context->Timeout.ticks; if ( ticks != WATCHDOG_NO_TIMEOUT ) { diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c index 16b09a96eb..72326682ca 100644 --- a/cpukit/score/src/threadrestart.c +++ b/cpukit/score/src/threadrestart.c @@ -46,10 +46,8 @@ #include <rtems/score/apimutex.h> #include <rtems/score/assert.h> #include <rtems/score/chainimpl.h> -#include <rtems/score/freechainimpl.h> #include <rtems/score/isrlock.h> #include <rtems/score/schedulerimpl.h> -#include <rtems/score/stackimpl.h> #include <rtems/score/sysstate.h> #include <rtems/score/threadqimpl.h> #include <rtems/score/userextimpl.h> @@ -85,6 +83,7 @@ static Thread_Control *_Thread_Join_flush_filter( { Thread_Join_context *join_context; + (void) queue; join_context = (Thread_Join_context *) queue_context; the_thread->Wait.return_argument = join_context->exit_value; diff --git a/cpukit/score/src/tlsallocsize.c b/cpukit/score/src/tlsallocsize.c index f78239192c..fa28391b83 100644 --- a/cpukit/score/src/tlsallocsize.c +++ b/cpukit/score/src/tlsallocsize.c @@ -10,7 +10,7 @@ */ /* - * Copyright (C) 2014, 2022 embedded brains GmbH & Co. KG + * Copyright (C) 2014, 2023 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -42,14 +42,47 @@ #include <rtems/score/interr.h> #include <rtems/score/thread.h> +extern char _TLS_Data_begin[]; + +extern char _TLS_Data_size[]; + +extern char _TLS_BSS_begin[]; + +extern char _TLS_BSS_size[]; + +extern char _TLS_Size[]; + +/** + * @brief The TLS section alignment. + * + * This symbol is provided by the linker command file as the maximum alignment + * of the .tdata and .tbss sections. The linker ensures that the first TLS + * output section is aligned to the maximum alignment of all TLS output + * sections, see function _bfd_elf_tls_setup() in bfd/elflink.c of the GNU + * Binutils sources. The linker command file must take into account the case + * that the .tdata section is empty and the .tbss section is non-empty. + */ +extern char _TLS_Alignment[]; + +const volatile TLS_Configuration _TLS_Configuration = { + .data_begin = _TLS_Data_begin, + .data_size = _TLS_Data_size, + .bss_begin = _TLS_BSS_begin, + .bss_size = _TLS_BSS_size, + .size = _TLS_Size, + .alignment = _TLS_Alignment +}; + static uintptr_t _TLS_Allocation_size; uintptr_t _TLS_Get_allocation_size( void ) { - uintptr_t size; - uintptr_t allocation_size; + const volatile TLS_Configuration *config; + uintptr_t size; + uintptr_t allocation_size; - size = _TLS_Get_size(); + config = &_TLS_Configuration; + size = (uintptr_t) config->size; if ( size == 0 ) { return 0; @@ -66,7 +99,7 @@ uintptr_t _TLS_Get_allocation_size( void ) * shall meet the stack alignment requirement. */ stack_align = CPU_STACK_ALIGNMENT; - tls_align = RTEMS_ALIGN_UP( (uintptr_t) _TLS_Alignment, stack_align ); + tls_align = RTEMS_ALIGN_UP( (uintptr_t) config->alignment, stack_align ); #ifndef __i386__ /* Reserve space for the dynamic thread vector */ diff --git a/cpukit/score/src/userextiterate.c b/cpukit/score/src/userextiterate.c index 25f0f9658b..cae76d173c 100644 --- a/cpukit/score/src/userextiterate.c +++ b/cpukit/score/src/userextiterate.c @@ -47,8 +47,6 @@ #include <rtems/score/userextimpl.h> -#include <pthread.h> - User_extensions_List _User_extensions_List = { CHAIN_INITIALIZER_EMPTY( _User_extensions_List.Active ), CHAIN_ITERATOR_REGISTRY_INITIALIZER( _User_extensions_List.Iterators ) @@ -120,6 +118,8 @@ void _User_extensions_Thread_begin_visitor( { User_extensions_thread_begin_extension callout = callouts->thread_begin; + (void) arg; + if ( callout != NULL ) { (*callout)( executing ); } |