From 985257d30699e9d3970bf7e3497e52671a74330b Mon Sep 17 00:00:00 2001 From: "Jose F. Martinez Pedraza" Date: Thu, 29 Feb 2024 22:44:33 +0000 Subject: [PATCH] Fix #1349, rename pc-rtems to generic-rtems --- docs/OSAL-Configuration-Guide.md | 4 ++-- src/bsp/{pc-rtems => generic-rtems}/CMakeLists.txt | 6 +++--- .../config/default_bsp_rtems_cfg.h | 0 .../{pc-rtems => generic-rtems}/src/bsp_cmdline.c | 4 ++-- .../{pc-rtems => generic-rtems}/src/bsp_cmdline.h | 0 .../{pc-rtems => generic-rtems}/src/bsp_console.c | 2 +- src/bsp/{pc-rtems => generic-rtems}/src/bsp_init.c | 0 .../src/bsp_mount_setupfs.c | 0 .../src/bsp_no_cmdline.c | 0 .../{pc-rtems => generic-rtems}/src/bsp_no_shell.c | 4 ++-- .../{pc-rtems => generic-rtems}/src/bsp_setupfs.h | 0 .../{pc-rtems => generic-rtems}/src/bsp_shell.c | 4 ++-- .../{pc-rtems => generic-rtems}/src/bsp_shell.h | 0 .../{pc-rtems => generic-rtems}/src/bsp_start.c | 14 +++++++------- .../{pc-rtems => generic-rtems}/src/bsp_start.h | 0 .../src/bsp_tarfs_setupfs.c | 0 .../src/genericrtems_bsp_internal.h} | 10 +++++----- 17 files changed, 24 insertions(+), 24 deletions(-) rename src/bsp/{pc-rtems => generic-rtems}/CMakeLists.txt (91%) rename src/bsp/{pc-rtems => generic-rtems}/config/default_bsp_rtems_cfg.h (100%) rename src/bsp/{pc-rtems => generic-rtems}/src/bsp_cmdline.c (97%) rename src/bsp/{pc-rtems => generic-rtems}/src/bsp_cmdline.h (100%) rename src/bsp/{pc-rtems => generic-rtems}/src/bsp_console.c (98%) rename src/bsp/{pc-rtems => generic-rtems}/src/bsp_init.c (100%) rename src/bsp/{pc-rtems => generic-rtems}/src/bsp_mount_setupfs.c (100%) rename src/bsp/{pc-rtems => generic-rtems}/src/bsp_no_cmdline.c (100%) rename src/bsp/{pc-rtems => generic-rtems}/src/bsp_no_shell.c (92%) rename src/bsp/{pc-rtems => generic-rtems}/src/bsp_setupfs.h (100%) rename src/bsp/{pc-rtems => generic-rtems}/src/bsp_shell.c (97%) rename src/bsp/{pc-rtems => generic-rtems}/src/bsp_shell.h (100%) rename src/bsp/{pc-rtems => generic-rtems}/src/bsp_start.c (92%) rename src/bsp/{pc-rtems => generic-rtems}/src/bsp_start.h (100%) rename src/bsp/{pc-rtems => generic-rtems}/src/bsp_tarfs_setupfs.c (100%) rename src/bsp/{pc-rtems/src/pcrtems_bsp_internal.h => generic-rtems/src/genericrtems_bsp_internal.h} (83%) diff --git a/docs/OSAL-Configuration-Guide.md b/docs/OSAL-Configuration-Guide.md index a2c4660a4..9c665adbd 100644 --- a/docs/OSAL-Configuration-Guide.md +++ b/docs/OSAL-Configuration-Guide.md @@ -608,13 +608,13 @@ OS_BSPMain) OSAL supports the RTEMS OS, which can be easily tested without any specific hardware using the QEMU hypervisor/virtualization software. This relies -on using the "pc-rtems" BSP. +on using the "generic-rtems" BSP. Like VxWorks, this requires use of a cross compile toolchain to build applications for this target. Example toolchains can also be found in the NASA cFS project(s). -In particular the OS_SYSTEM_BSPTYPE should be set to "pc-rtems" by the toolchain +In particular the OS_SYSTEM_BSPTYPE should be set to "generic-rtems" by the toolchain to enable this BSP/OS abstraction layer. ### How to run the OSAL Applications on QEMU with RTEMS 4.11 - 5.x diff --git a/src/bsp/pc-rtems/CMakeLists.txt b/src/bsp/generic-rtems/CMakeLists.txt similarity index 91% rename from src/bsp/pc-rtems/CMakeLists.txt rename to src/bsp/generic-rtems/CMakeLists.txt index 5f918f457..2eea908ab 100644 --- a/src/bsp/pc-rtems/CMakeLists.txt +++ b/src/bsp/generic-rtems/CMakeLists.txt @@ -1,6 +1,6 @@ ###################################################################### # -# CMAKE build recipe for PC-RTEMS Board Support Package (BSP) +# CMAKE build recipe for GENERIC-RTEMS Board Support Package (BSP) # ###################################################################### @@ -50,7 +50,7 @@ else () ) endif () -add_library(osal_pc-rtems_impl OBJECT +add_library(osal_generic-rtems_impl OBJECT ${OS_BSP_SRCLIST} ) @@ -61,7 +61,7 @@ target_compile_definitions(osal_public_api INTERFACE _BSD_SOURCE ) -set_property(TARGET osal_pc-rtems_impl PROPERTY OSAL_EXPECTED_OSTYPE "rtems") +set_property(TARGET osal_generic-rtems_impl PROPERTY OSAL_EXPECTED_OSTYPE "rtems") # The list of header files that control configuration set(BSP_RTEMS_CONFIG_FILE_LIST diff --git a/src/bsp/pc-rtems/config/default_bsp_rtems_cfg.h b/src/bsp/generic-rtems/config/default_bsp_rtems_cfg.h similarity index 100% rename from src/bsp/pc-rtems/config/default_bsp_rtems_cfg.h rename to src/bsp/generic-rtems/config/default_bsp_rtems_cfg.h diff --git a/src/bsp/pc-rtems/src/bsp_cmdline.c b/src/bsp/generic-rtems/src/bsp_cmdline.c similarity index 97% rename from src/bsp/pc-rtems/src/bsp_cmdline.c rename to src/bsp/generic-rtems/src/bsp_cmdline.c index 2c99f2c39..60c6219cf 100644 --- a/src/bsp/pc-rtems/src/bsp_cmdline.c +++ b/src/bsp/generic-rtems/src/bsp_cmdline.c @@ -33,7 +33,7 @@ #include #include -#include "pcrtems_bsp_internal.h" +#include "genericrtems_bsp_internal.h" /* * BSP compile-time tuning @@ -106,7 +106,7 @@ void OS_BSP_CmdLine(void) *cmdo = 0; if (strcmp(cmdi, "--batch-mode") == 0) { - OS_BSP_PcRtemsGlobal.BatchMode = true; + OS_BSP_GenericRtemsGlobal.BatchMode = true; } else if (OS_BSP_Global.ArgC < RTEMS_MAX_USER_OPTIONS) { diff --git a/src/bsp/pc-rtems/src/bsp_cmdline.h b/src/bsp/generic-rtems/src/bsp_cmdline.h similarity index 100% rename from src/bsp/pc-rtems/src/bsp_cmdline.h rename to src/bsp/generic-rtems/src/bsp_cmdline.h diff --git a/src/bsp/pc-rtems/src/bsp_console.c b/src/bsp/generic-rtems/src/bsp_console.c similarity index 98% rename from src/bsp/pc-rtems/src/bsp_console.c rename to src/bsp/generic-rtems/src/bsp_console.c index 9bff8aa46..f119f2bfe 100644 --- a/src/bsp/pc-rtems/src/bsp_console.c +++ b/src/bsp/generic-rtems/src/bsp_console.c @@ -27,7 +27,7 @@ #include #include -#include "pcrtems_bsp_internal.h" +#include "genericrtems_bsp_internal.h" #include "bsp-impl.h" /**************************************************************************************** diff --git a/src/bsp/pc-rtems/src/bsp_init.c b/src/bsp/generic-rtems/src/bsp_init.c similarity index 100% rename from src/bsp/pc-rtems/src/bsp_init.c rename to src/bsp/generic-rtems/src/bsp_init.c diff --git a/src/bsp/pc-rtems/src/bsp_mount_setupfs.c b/src/bsp/generic-rtems/src/bsp_mount_setupfs.c similarity index 100% rename from src/bsp/pc-rtems/src/bsp_mount_setupfs.c rename to src/bsp/generic-rtems/src/bsp_mount_setupfs.c diff --git a/src/bsp/pc-rtems/src/bsp_no_cmdline.c b/src/bsp/generic-rtems/src/bsp_no_cmdline.c similarity index 100% rename from src/bsp/pc-rtems/src/bsp_no_cmdline.c rename to src/bsp/generic-rtems/src/bsp_no_cmdline.c diff --git a/src/bsp/pc-rtems/src/bsp_no_shell.c b/src/bsp/generic-rtems/src/bsp_no_shell.c similarity index 92% rename from src/bsp/pc-rtems/src/bsp_no_shell.c rename to src/bsp/generic-rtems/src/bsp_no_shell.c index 5a94ca045..0f4a2bd1b 100644 --- a/src/bsp/pc-rtems/src/bsp_no_shell.c +++ b/src/bsp/generic-rtems/src/bsp_no_shell.c @@ -23,11 +23,11 @@ */ #include -#include "pcrtems_bsp_internal.h" +#include "genericrtems_bsp_internal.h" #include "bsp_shell.h" void OS_BSP_Shell(void) { printf("RTEMS_NO_SHELL:TRUE, shell not implemented"); - OS_BSP_PcRtemsGlobal.BatchMode = true; + OS_BSP_GenericRtemsGlobal.BatchMode = true; } diff --git a/src/bsp/pc-rtems/src/bsp_setupfs.h b/src/bsp/generic-rtems/src/bsp_setupfs.h similarity index 100% rename from src/bsp/pc-rtems/src/bsp_setupfs.h rename to src/bsp/generic-rtems/src/bsp_setupfs.h diff --git a/src/bsp/pc-rtems/src/bsp_shell.c b/src/bsp/generic-rtems/src/bsp_shell.c similarity index 97% rename from src/bsp/pc-rtems/src/bsp_shell.c rename to src/bsp/generic-rtems/src/bsp_shell.c index 369f693b3..ddc834a9a 100644 --- a/src/bsp/pc-rtems/src/bsp_shell.c +++ b/src/bsp/generic-rtems/src/bsp_shell.c @@ -35,7 +35,7 @@ #include #include -#include "pcrtems_bsp_internal.h" +#include "genericrtems_bsp_internal.h" #include "bsp_shell.h" @@ -65,7 +65,7 @@ void OS_BSP_Shell(void) int status; /* Supports command line enable/disable of batch mode */ - if (!OS_BSP_PcRtemsGlobal.BatchMode) + if (!OS_BSP_GenericRtemsGlobal.BatchMode) { printf("RTEMS_NO_SHELL:FALSE, BatchMode:FALSE, shell implemented and initialized"); diff --git a/src/bsp/pc-rtems/src/bsp_shell.h b/src/bsp/generic-rtems/src/bsp_shell.h similarity index 100% rename from src/bsp/pc-rtems/src/bsp_shell.h rename to src/bsp/generic-rtems/src/bsp_shell.h diff --git a/src/bsp/pc-rtems/src/bsp_start.c b/src/bsp/generic-rtems/src/bsp_start.c similarity index 92% rename from src/bsp/pc-rtems/src/bsp_start.c rename to src/bsp/generic-rtems/src/bsp_start.c index 4f88a0240..aca1266c3 100644 --- a/src/bsp/pc-rtems/src/bsp_start.c +++ b/src/bsp/generic-rtems/src/bsp_start.c @@ -35,7 +35,7 @@ #include #include -#include "pcrtems_bsp_internal.h" +#include "genericrtems_bsp_internal.h" #include "bsp_setupfs.h" #include "bsp_shell.h" @@ -53,7 +53,7 @@ /* ** Global variables */ -OS_BSP_PcRtemsGlobalData_t OS_BSP_PcRtemsGlobal; +OS_BSP_GenericRtemsGlobalData_t OS_BSP_GenericRtemsGlobal; void OS_BSP_Setup(void) { @@ -76,7 +76,7 @@ void OS_BSP_Setup(void) */ status = rtems_semaphore_create(rtems_build_name('B', 'S', 'P', '\0'), 1, RTEMS_PRIORITY | RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY, 0, - &OS_BSP_PcRtemsGlobal.AccessMutex); + &OS_BSP_GenericRtemsGlobal.AccessMutex); if (status != RTEMS_SUCCESSFUL) { BSP_DEBUG("rtems_semaphore_create: %s\n", rtems_status_text(status)); @@ -106,7 +106,7 @@ void OS_BSP_Setup(void) void OS_BSP_Lock_Impl(void) { rtems_status_code status; - status = rtems_semaphore_obtain(OS_BSP_PcRtemsGlobal.AccessMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); + status = rtems_semaphore_obtain(OS_BSP_GenericRtemsGlobal.AccessMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (status != RTEMS_SUCCESSFUL) { BSP_DEBUG("rtems_semaphore_obtain: %s\n", rtems_status_text(status)); @@ -120,7 +120,7 @@ void OS_BSP_Lock_Impl(void) void OS_BSP_Unlock_Impl(void) { rtems_status_code status; - status = rtems_semaphore_release(OS_BSP_PcRtemsGlobal.AccessMutex); + status = rtems_semaphore_release(OS_BSP_GenericRtemsGlobal.AccessMutex); if (status != RTEMS_SUCCESSFUL) { BSP_DEBUG("rtems_semaphore_release: %s\n", rtems_status_text(status)); @@ -175,7 +175,7 @@ void OS_BSP_Shutdown_Impl(void) * shell thread will still be active so the user can poke around, read results, * then use a shell command to reboot when ready. */ - while (!OS_BSP_PcRtemsGlobal.BatchMode) + while (!OS_BSP_GenericRtemsGlobal.BatchMode) { printf("\n\nInit thread idle.\nPress for shell or reset machine...\n\n"); rtems_task_suspend(rtems_task_self()); @@ -193,7 +193,7 @@ void OS_BSPMain(void) * Initially clear the global object */ memset(&OS_BSP_Global, 0, sizeof(OS_BSP_Global)); - memset(&OS_BSP_PcRtemsGlobal, 0, sizeof(OS_BSP_PcRtemsGlobal)); + memset(&OS_BSP_GenericRtemsGlobal, 0, sizeof(OS_BSP_GenericRtemsGlobal)); /* * Perform BSP setup - diff --git a/src/bsp/pc-rtems/src/bsp_start.h b/src/bsp/generic-rtems/src/bsp_start.h similarity index 100% rename from src/bsp/pc-rtems/src/bsp_start.h rename to src/bsp/generic-rtems/src/bsp_start.h diff --git a/src/bsp/pc-rtems/src/bsp_tarfs_setupfs.c b/src/bsp/generic-rtems/src/bsp_tarfs_setupfs.c similarity index 100% rename from src/bsp/pc-rtems/src/bsp_tarfs_setupfs.c rename to src/bsp/generic-rtems/src/bsp_tarfs_setupfs.c diff --git a/src/bsp/pc-rtems/src/pcrtems_bsp_internal.h b/src/bsp/generic-rtems/src/genericrtems_bsp_internal.h similarity index 83% rename from src/bsp/pc-rtems/src/pcrtems_bsp_internal.h rename to src/bsp/generic-rtems/src/genericrtems_bsp_internal.h index 8949d5297..186f82756 100644 --- a/src/bsp/pc-rtems/src/pcrtems_bsp_internal.h +++ b/src/bsp/generic-rtems/src/genericrtems_bsp_internal.h @@ -19,11 +19,11 @@ /** * \file * - * Header file for internal data to the PC-RTEMS BSP + * Header file for internal data to the GENERIC-RTEMS BSP */ -#ifndef PCRTEMS_BSP_INTERNAL_H -#define PCRTEMS_BSP_INTERNAL_H +#ifndef GENERICRTEMS_BSP_INTERNAL_H +#define GENERICRTEMS_BSP_INTERNAL_H #include "bsp-impl.h" #include @@ -35,11 +35,11 @@ typedef struct { bool BatchMode; rtems_id AccessMutex; -} OS_BSP_PcRtemsGlobalData_t; +} OS_BSP_GenericRtemsGlobalData_t; /* * Global Data object */ -extern OS_BSP_PcRtemsGlobalData_t OS_BSP_PcRtemsGlobal; +extern OS_BSP_GenericRtemsGlobalData_t OS_BSP_GenericRtemsGlobal; #endif