mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 15:15:44 +00:00
score: Add CPU_USE_LIBC_INIT_FINI_ARRAY
This introduces the CPU_USE_LIBC_INIT_FINI_ARRAY define for use by CPU ports to determine which global constructor and destructor methods are used instead of placing architecture defines where they shouldn't be. Close #4018
This commit is contained in:
committed by
Sebastian Huber
parent
37c36def7a
commit
48dd7b8c2e
@@ -17,11 +17,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
/* FIXME: These defines are a blatant hack */
|
|
||||||
|
|
||||||
#if defined(__USE_INIT_FINI__)
|
#if defined(__USE_INIT_FINI__)
|
||||||
#if defined(__ARM_EABI__) || defined(__riscv) \
|
#if CPU_USE_LIBC_INIT_FINI_ARRAY == TRUE
|
||||||
|| defined(__or1k__) || defined(__or1knd__)
|
|
||||||
#define FINI_SYMBOL __libc_fini_array
|
#define FINI_SYMBOL __libc_fini_array
|
||||||
#else
|
#else
|
||||||
#define FINI_SYMBOL _fini
|
#define FINI_SYMBOL _fini
|
||||||
|
|||||||
@@ -153,6 +153,8 @@
|
|||||||
|
|
||||||
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
||||||
|
|
||||||
|
#define CPU_USE_LIBC_INIT_FINI_ARRAY TRUE
|
||||||
|
|
||||||
#define CPU_MAXIMUM_PROCESSORS 32
|
#define CPU_MAXIMUM_PROCESSORS 32
|
||||||
|
|
||||||
#ifdef ARM_MULTILIB_HAS_THREAD_ID_REGISTER
|
#ifdef ARM_MULTILIB_HAS_THREAD_ID_REGISTER
|
||||||
|
|||||||
@@ -507,6 +507,8 @@ void _CPU_Context_Initialize(
|
|||||||
|
|
||||||
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
||||||
|
|
||||||
|
#define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
|
||||||
|
|
||||||
/* functions */
|
/* functions */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -445,6 +445,8 @@ void _CPU_Context_Initialize(
|
|||||||
|
|
||||||
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
||||||
|
|
||||||
|
#define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
|
||||||
|
|
||||||
#endif /* ASM */
|
#endif /* ASM */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -503,6 +503,8 @@ extern void _CPU_Fatal_halt(uint32_t source, uint32_t error)
|
|||||||
|
|
||||||
/* end of Fatal Error manager macros */
|
/* end of Fatal Error manager macros */
|
||||||
|
|
||||||
|
#define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Bitfield handler macros
|
* Bitfield handler macros
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -628,6 +628,8 @@ extern char _gp[];
|
|||||||
|
|
||||||
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
||||||
|
|
||||||
|
#define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
|
||||||
|
|
||||||
/* functions */
|
/* functions */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -433,6 +433,8 @@ void *_CPU_Thread_Idle_body( uintptr_t ignored );
|
|||||||
|
|
||||||
/* end of Fatal Error manager macros */
|
/* end of Fatal Error manager macros */
|
||||||
|
|
||||||
|
#define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Bitfield handler macros
|
* Bitfield handler macros
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -740,6 +740,8 @@ extern void mips_break( int error );
|
|||||||
|
|
||||||
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
||||||
|
|
||||||
|
#define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
|
||||||
|
|
||||||
/* functions */
|
/* functions */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -427,6 +427,8 @@ uint32_t _CPU_ISR_Get_level( void );
|
|||||||
|
|
||||||
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
||||||
|
|
||||||
|
#define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
|
||||||
|
|
||||||
/* functions */
|
/* functions */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ extern "C" {
|
|||||||
|
|
||||||
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
||||||
|
|
||||||
|
#define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
|
||||||
|
|
||||||
#define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 0
|
#define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 0
|
||||||
|
|
||||||
#define CPU_MAXIMUM_PROCESSORS 32
|
#define CPU_MAXIMUM_PROCESSORS 32
|
||||||
|
|||||||
@@ -249,6 +249,13 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
#define CPU_MAXIMUM_PROCESSORS 32
|
#define CPU_MAXIMUM_PROCESSORS 32
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The following define determines whether or not this CPU port will use
|
||||||
|
* libc global constructors and destructors instead of _init/_fini functions
|
||||||
|
* depending on .ctors and .dtors linker sections.
|
||||||
|
*/
|
||||||
|
#define CPU_USE_LIBC_INIT_FINI_ARRAY TRUE
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Processor defined structures required for cpukit/score.
|
* Processor defined structures required for cpukit/score.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -435,6 +435,8 @@ void _CPU_Context_Initialize(
|
|||||||
|
|
||||||
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
||||||
|
|
||||||
|
#define CPU_USE_LIBC_INIT_FINI_ARRAY TRUE
|
||||||
|
|
||||||
#endif /* ASM */
|
#endif /* ASM */
|
||||||
|
|
||||||
#define CPU_SIZEOF_POINTER 4
|
#define CPU_SIZEOF_POINTER 4
|
||||||
|
|||||||
@@ -805,6 +805,9 @@ void _CPU_Context_Initialize(
|
|||||||
#endif /* ASM */
|
#endif /* ASM */
|
||||||
|
|
||||||
#ifndef ASM
|
#ifndef ASM
|
||||||
|
|
||||||
|
#define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
|
||||||
|
|
||||||
/* Bitfield handler macros */
|
/* Bitfield handler macros */
|
||||||
|
|
||||||
#define CPU_USE_GENERIC_BITFIELD_CODE FALSE
|
#define CPU_USE_GENERIC_BITFIELD_CODE FALSE
|
||||||
|
|||||||
@@ -219,6 +219,8 @@ extern void _CPU_Fatal_halt(uint32_t source, uint32_t error) RTEMS_NO_RETURN;
|
|||||||
|
|
||||||
#define CPU_USE_GENERIC_BITFIELD_DATA TRUE
|
#define CPU_USE_GENERIC_BITFIELD_DATA TRUE
|
||||||
|
|
||||||
|
#define CPU_USE_LIBC_INIT_FINI_ARRAY TRUE
|
||||||
|
|
||||||
#define CPU_MAXIMUM_PROCESSORS 32
|
#define CPU_MAXIMUM_PROCESSORS 32
|
||||||
|
|
||||||
typedef uint16_t Priority_bit_map_Word;
|
typedef uint16_t Priority_bit_map_Word;
|
||||||
|
|||||||
@@ -535,6 +535,8 @@ void _CPU_Context_Initialize(
|
|||||||
|
|
||||||
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
||||||
|
|
||||||
|
#define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
|
||||||
|
|
||||||
/* functions */
|
/* functions */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -917,6 +917,8 @@ extern void _CPU_Fatal_halt(uint32_t source, uint32_t error)
|
|||||||
|
|
||||||
/* end of Fatal Error manager macros */
|
/* end of Fatal Error manager macros */
|
||||||
|
|
||||||
|
#define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
|
||||||
|
|
||||||
/* Bitfield handler macros */
|
/* Bitfield handler macros */
|
||||||
|
|
||||||
#if ( SPARC_HAS_BITSCAN == 0 )
|
#if ( SPARC_HAS_BITSCAN == 0 )
|
||||||
|
|||||||
@@ -801,6 +801,8 @@ void _CPU_Context_Initialize(
|
|||||||
|
|
||||||
/* end of Fatal Error manager macros */
|
/* end of Fatal Error manager macros */
|
||||||
|
|
||||||
|
#define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
|
||||||
|
|
||||||
/* Bitfield handler macros */
|
/* Bitfield handler macros */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -493,6 +493,8 @@ void _CPU_Context_Initialize(
|
|||||||
|
|
||||||
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
||||||
|
|
||||||
|
#define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
|
||||||
|
|
||||||
/* functions */
|
/* functions */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -242,6 +242,8 @@ void _CPU_Context_Initialize(
|
|||||||
|
|
||||||
/* end of Fatal Error manager macros */
|
/* end of Fatal Error manager macros */
|
||||||
|
|
||||||
|
#define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
|
||||||
|
|
||||||
/* Bitfield handler macros */
|
/* Bitfield handler macros */
|
||||||
|
|
||||||
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
|
||||||
|
|||||||
@@ -28,9 +28,13 @@
|
|||||||
* Conditional magic to determine what style of C++ constructor
|
* Conditional magic to determine what style of C++ constructor
|
||||||
* initialization this target and compiler version uses.
|
* initialization this target and compiler version uses.
|
||||||
*/
|
*/
|
||||||
|
RTEMS_STATIC_ASSERT(
|
||||||
|
CPU_USE_LIBC_INIT_FINI_ARRAY == TRUE
|
||||||
|
|| CPU_USE_LIBC_INIT_FINI_ARRAY == FALSE,
|
||||||
|
CPU_USE_LIBC_INIT_FINI_ARRAY
|
||||||
|
);
|
||||||
#if defined(__USE_INIT_FINI__)
|
#if defined(__USE_INIT_FINI__)
|
||||||
#if defined(__ARM_EABI__) || defined(__riscv) \
|
#if CPU_USE_LIBC_INIT_FINI_ARRAY == TRUE
|
||||||
|| defined(__or1k__) || defined(__or1knd__)
|
|
||||||
#define INIT_NAME __libc_init_array
|
#define INIT_NAME __libc_init_array
|
||||||
#else
|
#else
|
||||||
#define INIT_NAME _init
|
#define INIT_NAME _init
|
||||||
|
|||||||
Reference in New Issue
Block a user