score: Move context validation declarations

The context validation support functions _CPU_Context_validate() and
_CPU_Context_volatile_clobber() are used only by one test program
(spcontext01).  Move the function declarations to the CPU port
implementation header file.
This commit is contained in:
Sebastian Huber
2018-07-20 07:56:43 +02:00
parent 248ca7ad40
commit 42f2fdfd4e
39 changed files with 202 additions and 204 deletions

View File

@@ -493,10 +493,6 @@ void _CPU_Context_restore( Context_Control *new_context )
#define _CPU_Start_multitasking _ARMV7M_Start_multitasking
#endif
void _CPU_Context_volatile_clobber( uintptr_t pattern );
void _CPU_Context_validate( uintptr_t pattern );
#ifdef RTEMS_SMP
uint32_t _CPU_SMP_Initialize( void );

View File

@@ -102,6 +102,10 @@ static inline struct Per_CPU_Control *_ARM_Get_current_per_CPU_control( void )
#endif /* ARM_MULTILIB_ARCH_V4 */
void _CPU_Context_volatile_clobber( uintptr_t pattern );
void _CPU_Context_validate( uintptr_t pattern );
#ifdef __cplusplus
}
#endif

View File

@@ -819,18 +819,6 @@ void _CPU_Context_restore_fp(
Context_Control_fp **fp_context_ptr
);
static inline void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
static inline void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
/** @} */
/* FIXME */

View File

@@ -25,6 +25,18 @@
extern "C" {
#endif
RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
RTEMS_INLINE_ROUTINE void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
#ifdef __cplusplus
}
#endif

View File

@@ -754,18 +754,6 @@ static inline unsigned int CPU_swap_u32(
#define CPU_swap_u16( value ) \
(((value&0xff) << 8) | ((value >> 8)&0xff))
static inline void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
static inline void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
typedef uint32_t CPU_Counter_ticks;
uint32_t _CPU_Counter_frequency( void );

View File

@@ -25,6 +25,18 @@
extern "C" {
#endif
RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
RTEMS_INLINE_ROUTINE void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
#ifdef __cplusplus
}
#endif

View File

@@ -674,18 +674,6 @@ void _CPU_Context_restore_fp(
} while (0)
#endif
static inline void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
static inline void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
void _CPU_Exception_frame_print( const CPU_Exception_frame *frame );
typedef uint32_t CPU_Counter_ticks;

View File

@@ -25,6 +25,18 @@
extern "C" {
#endif
RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
RTEMS_INLINE_ROUTINE void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
#ifdef __cplusplus
}
#endif

View File

@@ -854,18 +854,6 @@ void _CPU_Context_restore_fp(
Context_Control_fp **fp_context_ptr
);
static inline void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
static inline void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
/** @} */
/* FIXME */

View File

@@ -25,6 +25,18 @@
extern "C" {
#endif
RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
RTEMS_INLINE_ROUTINE void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
#ifdef __cplusplus
}
#endif

View File

@@ -803,18 +803,6 @@ void _CPU_Context_restore(
Context_Control *new_context
) RTEMS_NO_RETURN;
static inline void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
static inline void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
/* FIXME */
typedef CPU_Interrupt_frame CPU_Exception_frame;

View File

@@ -25,6 +25,18 @@
extern "C" {
#endif
RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
RTEMS_INLINE_ROUTINE void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
#ifdef __cplusplus
}
#endif

View File

@@ -635,18 +635,6 @@ void _CPU_Context_restore_fp(
Context_Control_fp **fp_context_ptr
);
static inline void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
static inline void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
/**
* This method prints the CPU exception frame.
*

View File

@@ -25,6 +25,18 @@
extern "C" {
#endif
RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
RTEMS_INLINE_ROUTINE void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
#ifdef __cplusplus
}
#endif

View File

@@ -871,18 +871,6 @@ void _CPU_Context_restore_fp(
Context_Control_fp **fp_context_ptr
);
static inline void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
static inline void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
void _CPU_Exception_frame_print( const CPU_Exception_frame *frame );
/* The following routine swaps the endian format of an unsigned int.

View File

@@ -25,6 +25,18 @@
extern "C" {
#endif
RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
RTEMS_INLINE_ROUTINE void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
#ifdef __cplusplus
}
#endif

View File

@@ -685,18 +685,6 @@ void _CPU_Context_restore_fp(
Context_Control_fp **fp_context_ptr
);
static inline void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
static inline void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
/**
* @brief The set of registers that specifies the complete processor state.
*

View File

@@ -25,6 +25,18 @@
extern "C" {
#endif
RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
RTEMS_INLINE_ROUTINE void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
#ifdef __cplusplus
}
#endif

View File

@@ -324,10 +324,6 @@ void _CPU_Context_restore(
Context_Control *new_context
) RTEMS_NO_RETURN;
void _CPU_Context_volatile_clobber( uintptr_t pattern );
void _CPU_Context_validate( uintptr_t pattern );
void _CPU_Exception_frame_print( const CPU_Exception_frame *frame );
static inline uint32_t CPU_swap_u32( uint32_t value )

View File

@@ -25,6 +25,10 @@
extern "C" {
#endif
void _CPU_Context_volatile_clobber( uintptr_t pattern );
void _CPU_Context_validate( uintptr_t pattern );
#ifdef __cplusplus
}
#endif

View File

@@ -1144,37 +1144,6 @@ void _CPU_Context_restore_fp(
Context_Control_fp **fp_context_ptr
);
/**
* @ingroup CPUContext
*
* @brief Clobbers all volatile registers with values derived from the pattern
* parameter.
*
* This function is used only in test sptests/spcontext01.
*
* @param[in] pattern Pattern used to generate distinct register values.
*
* @see _CPU_Context_validate().
*/
void _CPU_Context_volatile_clobber( uintptr_t pattern );
/**
* @ingroup CPUContext
*
* @brief Initializes and validates the CPU context with values derived from
* the pattern parameter.
*
* This function will not return if the CPU context remains consistent. In
* case this function returns the CPU port is broken.
*
* This function is used only in test sptests/spcontext01.
*
* @param[in] pattern Pattern used to generate distinct register values.
*
* @see _CPU_Context_volatile_clobber().
*/
void _CPU_Context_validate( uintptr_t pattern );
/**
* @brief The set of registers that specifies the complete processor state.
*

View File

@@ -73,6 +73,37 @@ register struct Per_CPU_Control *_CPU_Per_CPU_current asm( "rX" );
*/
#define _CPU_Get_thread_executing() ( _CPU_Per_CPU_current->executing )
/**
* @ingroup CPUContext
*
* @brief Clobbers all volatile registers with values derived from the pattern
* parameter.
*
* This function is used only in test sptests/spcontext01.
*
* @param[in] pattern Pattern used to generate distinct register values.
*
* @see _CPU_Context_validate().
*/
void _CPU_Context_volatile_clobber( uintptr_t pattern );
/**
* @ingroup CPUContext
*
* @brief Initializes and validates the CPU context with values derived from
* the pattern parameter.
*
* This function will not return if the CPU context remains consistent. In
* case this function returns the CPU port is broken.
*
* This function is used only in test sptests/spcontext01.
*
* @param[in] pattern Pattern used to generate distinct register values.
*
* @see _CPU_Context_volatile_clobber().
*/
void _CPU_Context_validate( uintptr_t pattern );
#ifdef __cplusplus
}
#endif

View File

@@ -744,10 +744,6 @@ void _CPU_Context_restore_fp(
*
*/
void _CPU_Context_volatile_clobber( uintptr_t pattern );
void _CPU_Context_validate( uintptr_t pattern );
static inline unsigned int CPU_swap_u32(
unsigned int value
)

View File

@@ -25,6 +25,10 @@
extern "C" {
#endif
void _CPU_Context_volatile_clobber( uintptr_t pattern );
void _CPU_Context_validate( uintptr_t pattern );
#ifdef __cplusplus
}
#endif

View File

@@ -996,10 +996,6 @@ void _CPU_Context_restore_fp(
Context_Control_fp **fp_context_ptr
);
void _CPU_Context_volatile_clobber( uintptr_t pattern );
void _CPU_Context_validate( uintptr_t pattern );
#ifdef RTEMS_SMP
uint32_t _CPU_SMP_Initialize( void );

View File

@@ -238,6 +238,10 @@ static inline struct Per_CPU_Control *_PPC_Get_current_per_CPU_control( void )
#endif /* RTEMS_SMP */
void _CPU_Context_volatile_clobber( uintptr_t pattern );
void _CPU_Context_validate( uintptr_t pattern );
#ifdef __cplusplus
}
#endif

View File

@@ -358,10 +358,6 @@ static inline uint32_t CPU_swap_u32(
#define CPU_swap_u16( value ) \
(((value&0xff) << 8) | ((value >> 8)&0xff))
void _CPU_Context_volatile_clobber( uintptr_t pattern );
void _CPU_Context_validate( uintptr_t pattern );
typedef uint32_t CPU_Counter_ticks;
uint32_t _CPU_Counter_frequency( void );

View File

@@ -321,6 +321,10 @@ static inline struct Per_CPU_Control *_RISCV_Get_current_per_CPU_control( void )
#endif /* RTEMS_SMP */
void _CPU_Context_volatile_clobber( uintptr_t pattern );
void _CPU_Context_validate( uintptr_t pattern );
#ifdef __cplusplus
}
#endif

View File

@@ -661,18 +661,6 @@ void _CPU_Context_restore_fp(
Context_Control_fp **fp_context_ptr
);
static inline void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
static inline void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
/* FIXME */
typedef CPU_Interrupt_frame CPU_Exception_frame;

View File

@@ -25,6 +25,18 @@
extern "C" {
#endif
RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
RTEMS_INLINE_ROUTINE void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
#ifdef __cplusplus
}
#endif

View File

@@ -1068,10 +1068,6 @@ void _CPU_Context_restore(
} while ( 0 )
#endif
void _CPU_Context_volatile_clobber( uintptr_t pattern );
void _CPU_Context_validate( uintptr_t pattern );
typedef struct {
uint32_t trap;
CPU_Interrupt_frame *isf;

View File

@@ -146,6 +146,10 @@ register struct Per_CPU_Control *_SPARC_Per_CPU_current __asm__( "g6" );
#define _CPU_Get_thread_executing() ( _SPARC_Per_CPU_current->executing )
void _CPU_Context_volatile_clobber( uintptr_t pattern );
void _CPU_Context_validate( uintptr_t pattern );
#ifdef __cplusplus
}
#endif

View File

@@ -946,18 +946,6 @@ void _CPU_Context_restore_fp(
Context_Control_fp **fp_context_ptr
);
static inline void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
static inline void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
/* FIXME */
typedef CPU_Interrupt_frame CPU_Exception_frame;

View File

@@ -25,6 +25,18 @@
extern "C" {
#endif
RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
RTEMS_INLINE_ROUTINE void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
#ifdef __cplusplus
}
#endif

View File

@@ -759,18 +759,6 @@ void _CPU_Context_restore_fp(
);
#endif
static inline void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
static inline void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
/** @} */
/* FIXME */

View File

@@ -25,6 +25,18 @@
extern "C" {
#endif
RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
RTEMS_INLINE_ROUTINE void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
#ifdef __cplusplus
}
#endif

View File

@@ -249,22 +249,6 @@ void _CPU_Context_restore_fp(
Context_Control_fp **fp_context_ptr
);
static inline void _CPU_Context_volatile_clobber( uintptr_t pattern );
static inline void _CPU_Context_validate( uintptr_t pattern );
static inline void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
static inline void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
typedef struct {
uint32_t processor_state_register;
uint32_t integer_registers [1];

View File

@@ -42,6 +42,18 @@ static inline void outport_byte(uint16_t port, uint8_t val)
__asm__ volatile ( "outb %0, %1" : : "a" (val), "Nd" (port) );
}
RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
{
/* TODO */
}
RTEMS_INLINE_ROUTINE void _CPU_Context_validate( uintptr_t pattern )
{
while (1) {
/* TODO */
}
}
#ifdef __cplusplus
}
#endif

View File

@@ -16,7 +16,9 @@
#include "config.h"
#endif
#include "tmacros.h"
#include <rtems/score/cpuimpl.h>
#include <tmacros.h>
const char rtems_test_name[] = "SPCONTEXT 1";