Skip to content

Commit

Permalink
Fix nasa#1349, rename pc-rtems to generic-rtems
Browse files Browse the repository at this point in the history
  • Loading branch information
pepepr08 committed Feb 29, 2024
1 parent 4833980 commit 985257d
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions docs/OSAL-Configuration-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# CMAKE build recipe for PC-RTEMS Board Support Package (BSP)
# CMAKE build recipe for GENERIC-RTEMS Board Support Package (BSP)
#
######################################################################

Expand Down Expand Up @@ -50,7 +50,7 @@ else ()
)
endif ()

add_library(osal_pc-rtems_impl OBJECT
add_library(osal_generic-rtems_impl OBJECT
${OS_BSP_SRCLIST}
)

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <bsp.h>
#include <rtems.h>

#include "pcrtems_bsp_internal.h"
#include "genericrtems_bsp_internal.h"

/*
* BSP compile-time tuning
Expand Down Expand Up @@ -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)
{
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <sys/types.h>
#include <sys/wait.h>

#include "pcrtems_bsp_internal.h"
#include "genericrtems_bsp_internal.h"
#include "bsp-impl.h"

/****************************************************************************************
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
*/

#include <stdio.h>
#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;
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <rtems/shell.h>
#include <rtems/rtl/dlfcn-shell.h>

#include "pcrtems_bsp_internal.h"
#include "genericrtems_bsp_internal.h"

#include "bsp_shell.h"

Expand Down Expand Up @@ -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");

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <rtems/bdbuf.h>
#include <rtems/error.h>

#include "pcrtems_bsp_internal.h"
#include "genericrtems_bsp_internal.h"

#include "bsp_setupfs.h"
#include "bsp_shell.h"
Expand All @@ -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)
{
Expand All @@ -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));
Expand Down Expand Up @@ -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));
Expand All @@ -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));
Expand Down Expand Up @@ -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 <enter> for shell or reset machine...\n\n");
rtems_task_suspend(rtems_task_self());
Expand All @@ -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 -
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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 <rtems.h>
Expand All @@ -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

0 comments on commit 985257d

Please sign in to comment.