Skip to content

Commit

Permalink
Merge pull request #433 from nasa/integration-candidate
Browse files Browse the repository at this point in the history
Integration Candidate: 2020-04-15
  • Loading branch information
astrogeco committed Apr 27, 2020
2 parents 5a3dcb7 + 1b36816 commit b27c73b
Show file tree
Hide file tree
Showing 51 changed files with 812 additions and 775 deletions.
63 changes: 42 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,6 @@
cmake_minimum_required(VERSION 2.8.12)
project(OSAL C)

# OSAL_SYSTEM_OSTYPE and OSAL_SYSTEM_BSPTYPE indicate which of the OS packages
# to build. These are required and must be defined. Confirm that this exists
# and error out now if it does not.
if (NOT DEFINED OSAL_SYSTEM_OSTYPE OR
NOT IS_DIRECTORY "${OSAL_SOURCE_DIR}/src/os/${OSAL_SYSTEM_OSTYPE}")
# It is an error if the indicated OSTYPE does not correspond to a subdirectory
# If this is not caught here then a more obfuscated error will occur later.
message("Error: \"${OSAL_SYSTEM_OSTYPE}\" is not a valid OS type")
message(FATAL_ERROR "OSAL_SYSTEM_OSTYPE must be set to the appropriate OS")
endif ()
if (NOT DEFINED OSAL_SYSTEM_BSPTYPE OR
NOT IS_DIRECTORY "${OSAL_SOURCE_DIR}/src/bsp/${OSAL_SYSTEM_BSPTYPE}")
# It is an error if the indicated BSPTYPE does not correspond to a subdirectory
# If this is not caught here then a more obfuscated error will occur later.
message("Error: \"${OSAL_SYSTEM_BSPTYPE}\" is not a valid BSP type")
message(FATAL_ERROR "OSAL_SYSTEM_BSPTYPE must be set to the appropriate BSP")
endif ()

message(STATUS "OSAL Selection: ${OSAL_SYSTEM_OSTYPE}")
message(STATUS "BSP Selection: ${OSAL_SYSTEM_BSPTYPE}")

# The initial set of directories that define the OSAL API
# This is used to initialize the interface include directory property of external targets
Expand All @@ -89,11 +69,26 @@ add_definitions(${OSAL_USER_C_FLAGS})
# This is done early, so that other targets may reference UT_ASSERT_SOURCE_DIR if needed
add_subdirectory(ut_assert)


#
# Step 1:
# Build the BSP layer
#


# OSAL_SYSTEM_BSPTYPE indicate which of the BSP packages
# to build. These is required and must be defined. Confirm that this exists
# and error out now if it does not.
if (NOT DEFINED OSAL_SYSTEM_BSPTYPE OR
NOT IS_DIRECTORY "${OSAL_SOURCE_DIR}/src/bsp/${OSAL_SYSTEM_BSPTYPE}")
# It is an error if the indicated BSPTYPE does not correspond to a subdirectory
# If this is not caught here then a more obfuscated error will occur later.
message("Error: \"${OSAL_SYSTEM_BSPTYPE}\" is not a valid BSP type")
message(FATAL_ERROR "OSAL_SYSTEM_BSPTYPE must be set to the appropriate BSP")
endif ()

message(STATUS "BSP Selection: ${OSAL_SYSTEM_BSPTYPE}")


# The BSP library is a separate target from OSAL and can be used
# independently of the OSAL library and/or in combination with
# UT assert and the OSAL stub library for unit testing.
Expand All @@ -105,6 +100,19 @@ target_include_directories(osal_${OSAL_SYSTEM_BSPTYPE}_impl PRIVATE
${OSAL_SOURCE_DIR}/src/bsp/shared
)

# Confirm that the selected OS is compatible with the selected BSP.
if (DEFINED OSAL_EXPECTED_OSTYPE)
if (NOT DEFINED OSAL_SYSTEM_OSTYPE)
# In the event that OSAL_SYSTEM_OSTYPE was not specified at all,
# implicitly assume the expected OSTYPE.
set(OSAL_SYSTEM_OSTYPE ${OSAL_EXPECTED_OSTYPE})
elseif(NOT OSAL_SYSTEM_OSTYPE STREQUAL OSAL_EXPECTED_OSTYPE)
# Generate a warning about the OSTYPE not being expected.
# Not calling this a fatal error because it could possibly be intended during development
message(WARNING "Mismatched BSP/OS: ${OSAL_SYSTEM_BSPTYPE} implies ${OSAL_EXPECTED_OSTYPE}, but ${OSAL_SYSTEM_OSTYPE} is configured")
endif(NOT DEFINED OSAL_SYSTEM_OSTYPE)
endif (DEFINED OSAL_EXPECTED_OSTYPE)

# Propagate the BSP-specific compile definitions and include directories
# Apply these to the directory-scope COMPILE_DEFINITIONS and INCLUDE_DIRECTORIES
# Note this needs to append to the directory property, not overwrite it.
Expand Down Expand Up @@ -145,6 +153,19 @@ target_include_directories(osal_bsp INTERFACE
# Step 2:
# Build the OSAL layer
#

# OSAL_SYSTEM_OSTYPE indicates which of the OS packages
# to build. If not defined, this may be inferred by the BSP type.
if (NOT DEFINED OSAL_SYSTEM_OSTYPE OR
NOT IS_DIRECTORY "${OSAL_SOURCE_DIR}/src/os/${OSAL_SYSTEM_OSTYPE}")
# It is an error if the indicated OSTYPE does not correspond to a subdirectory
# If this is not caught here then a more obfuscated error will occur later.
message("Error: \"${OSAL_SYSTEM_OSTYPE}\" is not a valid OS type")
message(FATAL_ERROR "OSAL_SYSTEM_OSTYPE must be set to the appropriate OS")
endif ()

message(STATUS "OSAL Selection: ${OSAL_SYSTEM_OSTYPE}")

# The implementation-specific OSAL subdirectory should define
# an OBJECT target named "osal_${OSAL_SYSTEM_OSTYPE}_impl"
add_subdirectory(src/os/${OSAL_SYSTEM_OSTYPE} ${OSAL_SYSTEM_OSTYPE}_impl)
Expand Down
48 changes: 34 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,43 +17,63 @@ This distribution contains:
2. Tests and example applications
3. A directory structure and makefiles to manage it all.

## Version Notes:
- 5.0.12: DEVELOPMENT
## Version History

#### Development Build: 5.0.13
- Added coverage test to `OS_TimerCreate` for `OS_ERR_NAME_TOO_LONG`.
- Externalize enum for `SelectSingle`, ensures that pointers passed to `SelectFd...()` APIs are not null, ensures that pointer to `SelectSingle` is not null.
- Command to run in shell and output to fill will fail with default (not implemented) setting.
- Builds successfully using the inferred OS when only `OSAL_SYSTEM_BSPTYPE` is set. Generates a warning when `OSAL_SYSTEM_BSPTYPE` and `OSAL_SYSTEM_OSTYPE` are both set but are mismatched.
- See https://github.com/nasa/osal/pull/433 for more details

#### Development Build: 5.0.12
- Use the target_include_directories and target_compile_definitions functions from CMake to manage the build flags per target.
- Build implementation components using a separate CMakeLists.txt file rather than aux_source_directory.
- Provide sufficient framework for combining the OSAL BSP, UT BSP, and the CFE PSP and eliminating the duplication/overlap between these items.
- Minor updates (see https://github.com/nasa/osal/pull/417)
- 5.0.11: DEVELOPMENT

#### Development Build: 5.0.11
- The more descriptive return value OS_ERR_NAME_NOT_FOUND (instead of OS_FS_ERROR) will now be returned from the following functions (): OS_rmfs, OS_mount, OS_unmount, OS_FS_GetPhysDriveName
- Wraps OS_ShMem* prototype and unit test wrapper additions in OSAL_OMIT_DEPRECATED
- Minor updates (see https://github.com/nasa/osal/pull/408)
- 5.0.10: DEVELOPMENT

#### Development Build: 5.0.10
- Minor updates (see https://github.com/nasa/osal/pull/401)
- 5.0.9: DEVELOPMENT
- Documentation updates (see https://github.com/nasa/osal/pull/375)
- 5.0.8: DEVELOPMENT

#### Development Build: 5.0.8
- Minor updates (see https://github.com/nasa/osal/pull/369)
- 5.0.7: DEVELOPMENT

#### Development Build: 5.0.7
- Fixes memset bug
- Minor updates (see https://github.com/nasa/osal/pull/361)
- 5.0.6: DEVELOPMENT

#### Development Build: 5.0.6
- Minor updates (see https://github.com/nasa/osal/pull/355)
- 5.0.5: DEVELOPMENT

#### Development Build: 5.0.5
- Fixed osal_timer_UT test failure case
- Minor updates (see https://github.com/nasa/osal/pull/350)
- 5.0.4: DEVELOPMENT

#### Development Build: 5.0.4
- Minor updates (see https://github.com/nasa/osal/pull/334)
- 5.0.3: DEVELOPMENT

#### Development Build: 5.0.3
- Minor updates (see https://github.com/nasa/osal/pull/292)
- 5.0.2: DEVELOPMENT

#### Development Build: 5.0.2
- Bug fixes and minor updates (see https://github.com/nasa/osal/pull/281)
- 5.0.1: DEVELOPMENT

#### Development Build: 5.0.1
- Minor updates (see https://github.com/nasa/osal/pull/264)
- 5.0.0: RELEASE CANDIDATE

#### ***Release Candidate: 5.0.0µ***
- In build verification testing to be considered for official release
- Release documentation in work
- This is a point release from an internal repository
- **4.2.1a OFFICIAL RELEASE**

### ***OFFICIAL RELEASE: 4.2.1a***
- Released under the NOSA license, see [LICENSE](LICENSE)
- See [version description document](OSAL%204.2.1.0%20Version%20Description%20Document.pdf)
- This is a point release from an internal repository
Expand Down
4 changes: 3 additions & 1 deletion src/bsp/mcp750-vxworks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ target_compile_definitions(osal_mcp750-vxworks_impl PUBLIC
"MCP750"
)


# This BSP only works with "vxworks" OS layer.
# Confirming this reduces risk of accidental misconfiguration
set(OSAL_EXPECTED_OSTYPE "vxworks" PARENT_SCOPE)
6 changes: 3 additions & 3 deletions src/bsp/mcp750-vxworks/config/osconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define OS_MAX_MUTEXES 20

/*
** Maximum length for an absolute path name
** Maximum length (including terminator) for an absolute path name
*/
#define OS_MAX_PATH_LEN 64

Expand All @@ -37,7 +37,7 @@


/*
** The maxium length allowed for a object (task,queue....) name
** The maxium length allowed for a object name (task, queue, etc.), including terminating null
*/
#define OS_MAX_API_NAME 20

Expand All @@ -47,7 +47,7 @@
#define OS_MAX_FILE_NAME 20

/*
** These defines are for OS_printf
** Buffer for OS_printf, includes terminator. Longer messages will be truncated
*/
#define OS_BUFFER_SIZE 172
#define OS_BUFFER_MSG_DEPTH 100
Expand Down
5 changes: 5 additions & 0 deletions src/bsp/pc-linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ add_library(osal_pc-linux_impl OBJECT
target_compile_definitions(osal_pc-linux_impl PUBLIC
_XOPEN_SOURCE=600
)


# This BSP only works with "posix" OS layer.
# Confirming this reduces risk of accidental misconfiguration
set(OSAL_EXPECTED_OSTYPE "posix" PARENT_SCOPE)
4 changes: 2 additions & 2 deletions src/bsp/pc-linux/config/osconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define OS_MAX_MUTEXES 20

/*
** Maximum length for an absolute path name
** Maximum length (including terminator) for an absolute path name
*/
#define OS_MAX_PATH_LEN 64

Expand All @@ -36,7 +36,7 @@
#define OS_MAX_LOCAL_PATH_LEN (OS_MAX_PATH_LEN + OS_FS_PHYS_NAME_LEN)

/*
** The maxium length allowed for a object (task,queue....) name
** The maxium length allowed for a object name (task, queue, etc.), including terminating null
*/
#define OS_MAX_API_NAME 20

Expand Down
4 changes: 4 additions & 0 deletions src/bsp/pc-rtems/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ add_library(osal_pc-rtems_impl OBJECT
src/bsp_voltab.c
src/bsp_console.c
)

# This BSP only works with "rtems" OS layer.
# Confirming this reduces risk of accidental misconfiguration
set(OSAL_EXPECTED_OSTYPE "rtems" PARENT_SCOPE)
4 changes: 2 additions & 2 deletions src/bsp/pc-rtems/config/osconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define OS_MAX_MUTEXES 20

/*
** Maximum length for an absolute path name
** Maximum length (including terminator) for an absolute path name
*/
#define OS_MAX_PATH_LEN 64

Expand All @@ -36,7 +36,7 @@
#define OS_MAX_LOCAL_PATH_LEN (OS_MAX_PATH_LEN + OS_FS_PHYS_NAME_LEN)

/*
** The maxium length allowed for a object (task,queue....) name
** The maxium length allowed for a object name (task, queue, etc.), including terminating null
*/
#define OS_MAX_API_NAME 20

Expand Down
Loading

0 comments on commit b27c73b

Please sign in to comment.