mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 23:23:13 +00:00
score: Fix C/C++ compatibility issue
Only use CPU_Per_CPU_control if it contains at least one filed. In GNU C empty structures have a size of zero. In C++ structures have a non-zero size. In case CPU_PER_CPU_CONTROL_SIZE is defined to zero, then this structure is not used anymore. Close #2789.
This commit is contained in:
@@ -241,10 +241,6 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
/**@{**/
|
/**@{**/
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
/* There is no CPU specific per-CPU state */
|
|
||||||
} CPU_Per_CPU_control;
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
#if defined(ARM_MULTILIB_ARCH_V4)
|
#if defined(ARM_MULTILIB_ARCH_V4)
|
||||||
uint32_t register_cpsr;
|
uint32_t register_cpsr;
|
||||||
|
|||||||
@@ -388,10 +388,6 @@ extern "C" {
|
|||||||
|
|
||||||
#ifndef ASM
|
#ifndef ASM
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
/* There is no CPU specific per-CPU state */
|
|
||||||
} CPU_Per_CPU_control;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup CPUContext Processor Dependent Context Management
|
* @defgroup CPUContext Processor Dependent Context Management
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -838,9 +838,6 @@ void _CPU_Context_Initialize(
|
|||||||
#define CPU_TIMESTAMP_USE_INT64 TRUE
|
#define CPU_TIMESTAMP_USE_INT64 TRUE
|
||||||
#define CPU_TIMESTAMP_USE_INT64_INLINE FALSE
|
#define CPU_TIMESTAMP_USE_INT64_INLINE FALSE
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
/* There is no CPU specific per-CPU state */
|
|
||||||
} CPU_Per_CPU_control;
|
|
||||||
#endif /* ASM */
|
#endif /* ASM */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -142,10 +142,6 @@ extern "C" {
|
|||||||
|
|
||||||
#ifndef ASM
|
#ifndef ASM
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
/* There is no CPU specific per-CPU state */
|
|
||||||
} CPU_Per_CPU_control;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Basic integer context for the i386 family.
|
* Basic integer context for the i386 family.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -380,10 +380,6 @@ extern "C" {
|
|||||||
|
|
||||||
/* may need to put some structures here. */
|
/* may need to put some structures here. */
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
/* There is no CPU specific per-CPU state */
|
|
||||||
} CPU_Per_CPU_control;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup CPUContext Processor Dependent Context Management
|
* @defgroup CPUContext Processor Dependent Context Management
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -403,10 +403,6 @@ extern "C" {
|
|||||||
|
|
||||||
/* may need to put some structures here. */
|
/* may need to put some structures here. */
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
/* There is no CPU specific per-CPU state */
|
|
||||||
} CPU_Per_CPU_control;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup CPUContext Processor Dependent Context Management
|
* @defgroup CPUContext Processor Dependent Context Management
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -125,10 +125,6 @@ extern "C" {
|
|||||||
|
|
||||||
/* structures */
|
/* structures */
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
/* There is no CPU specific per-CPU state */
|
|
||||||
} CPU_Per_CPU_control;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Basic integer context for the m68k family.
|
* Basic integer context for the m68k family.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -383,10 +383,6 @@ extern "C" {
|
|||||||
|
|
||||||
#ifndef ASM
|
#ifndef ASM
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
/* There is no CPU specific per-CPU state */
|
|
||||||
} CPU_Per_CPU_control;
|
|
||||||
|
|
||||||
/* WARNING: If this structure is modified, the constants in cpu.h must be updated. */
|
/* WARNING: If this structure is modified, the constants in cpu.h must be updated. */
|
||||||
#if (__mips == 1) || (__mips == 32)
|
#if (__mips == 1) || (__mips == 32)
|
||||||
#define __MIPS_REGISTER_TYPE uint32_t
|
#define __MIPS_REGISTER_TYPE uint32_t
|
||||||
|
|||||||
@@ -319,10 +319,6 @@ extern "C" {
|
|||||||
|
|
||||||
/* may need to put some structures here. */
|
/* may need to put some structures here. */
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
/* There is no CPU specific per-CPU state */
|
|
||||||
} CPU_Per_CPU_control;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Contexts
|
* Contexts
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -111,10 +111,6 @@ extern "C" {
|
|||||||
|
|
||||||
#ifndef ASM
|
#ifndef ASM
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
/* There is no CPU specific per-CPU state */
|
|
||||||
} CPU_Per_CPU_control;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Thread register context.
|
* @brief Thread register context.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -478,7 +478,11 @@ extern "C" {
|
|||||||
* @brief The CPU specific per-CPU control.
|
* @brief The CPU specific per-CPU control.
|
||||||
*
|
*
|
||||||
* The CPU port can place here all state information that must be available and
|
* The CPU port can place here all state information that must be available and
|
||||||
* maintained for each CPU in the system.
|
* maintained for each processor in the system. This structure must contain at
|
||||||
|
* least one field for C/C++ compatibility. In GNU C empty structures have a
|
||||||
|
* size of zero. In C++ structures have a non-zero size. In case
|
||||||
|
* CPU_PER_CPU_CONTROL_SIZE is defined to zero, then this structure is not
|
||||||
|
* used.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* CPU specific per-CPU state */
|
/* CPU specific per-CPU state */
|
||||||
|
|||||||
@@ -818,9 +818,6 @@ void _CPU_Context_Initialize(
|
|||||||
#define CPU_TIMESTAMP_USE_INT64 TRUE
|
#define CPU_TIMESTAMP_USE_INT64 TRUE
|
||||||
#define CPU_TIMESTAMP_USE_INT64_INLINE FALSE
|
#define CPU_TIMESTAMP_USE_INT64_INLINE FALSE
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
/* There is no CPU specific per-CPU state */
|
|
||||||
} CPU_Per_CPU_control;
|
|
||||||
#endif /* ASM */
|
#endif /* ASM */
|
||||||
|
|
||||||
#define CPU_SIZEOF_POINTER 4
|
#define CPU_SIZEOF_POINTER 4
|
||||||
|
|||||||
@@ -247,10 +247,6 @@ extern "C" {
|
|||||||
|
|
||||||
#ifndef ASM
|
#ifndef ASM
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
/* There is no CPU specific per-CPU state */
|
|
||||||
} CPU_Per_CPU_control;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Non-volatile context according to E500ABIUG, EABI and 32-bit TLS (according
|
* Non-volatile context according to E500ABIUG, EABI and 32-bit TLS (according
|
||||||
* to "Power Architecture 32-bit Application Binary Interface Supplement 1.0 -
|
* to "Power Architecture 32-bit Application Binary Interface Supplement 1.0 -
|
||||||
|
|||||||
@@ -285,10 +285,6 @@ extern "C" {
|
|||||||
|
|
||||||
/* may need to put some structures here. */
|
/* may need to put some structures here. */
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
/* There is no CPU specific per-CPU state */
|
|
||||||
} CPU_Per_CPU_control;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Contexts
|
* Contexts
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -217,10 +217,6 @@ extern "C" {
|
|||||||
|
|
||||||
#ifndef ASM
|
#ifndef ASM
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
/* There is no CPU specific per-CPU state */
|
|
||||||
} CPU_Per_CPU_control;
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint64_t l0;
|
uint64_t l0;
|
||||||
uint64_t l1;
|
uint64_t l1;
|
||||||
|
|||||||
@@ -373,10 +373,6 @@ extern "C" {
|
|||||||
|
|
||||||
#define CPU_PER_CPU_CONTROL_SIZE 0
|
#define CPU_PER_CPU_CONTROL_SIZE 0
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
/* There is no CPU specific per-CPU state */
|
|
||||||
} CPU_Per_CPU_control;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup CPUContext Processor Dependent Context Management
|
* @defgroup CPUContext Processor Dependent Context Management
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -231,10 +231,12 @@ typedef struct {
|
|||||||
* This structure is used to hold per core state information.
|
* This structure is used to hold per core state information.
|
||||||
*/
|
*/
|
||||||
typedef struct Per_CPU_Control {
|
typedef struct Per_CPU_Control {
|
||||||
|
#if CPU_PER_CPU_CONTROL_SIZE > 0
|
||||||
/**
|
/**
|
||||||
* @brief CPU port specific control.
|
* @brief CPU port specific control.
|
||||||
*/
|
*/
|
||||||
CPU_Per_CPU_control cpu_per_cpu;
|
CPU_Per_CPU_control cpu_per_cpu;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) || \
|
#if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) || \
|
||||||
(CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE)
|
(CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE)
|
||||||
|
|||||||
@@ -64,10 +64,12 @@ RTEMS_STATIC_ASSERT(
|
|||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
RTEMS_STATIC_ASSERT(
|
#if CPU_PER_CPU_CONTROL_SIZE > 0
|
||||||
|
RTEMS_STATIC_ASSERT(
|
||||||
sizeof( CPU_Per_CPU_control ) == CPU_PER_CPU_CONTROL_SIZE,
|
sizeof( CPU_Per_CPU_control ) == CPU_PER_CPU_CONTROL_SIZE,
|
||||||
CPU_PER_CPU_CONTROL_SIZE
|
CPU_PER_CPU_CONTROL_SIZE
|
||||||
);
|
);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined( RTEMS_SMP )
|
#if defined( RTEMS_SMP )
|
||||||
RTEMS_STATIC_ASSERT(
|
RTEMS_STATIC_ASSERT(
|
||||||
|
|||||||
Reference in New Issue
Block a user