Skip to content

Commit

Permalink
Merge pull request nasa#690 from nasa/integration-candidate
Browse files Browse the repository at this point in the history
OSAL Integration Candidate: 2020-12-22
  • Loading branch information
astrogeco authored Dec 18, 2020
2 parents 9407cdf + 7214d38 commit d698a4d
Show file tree
Hide file tree
Showing 430 changed files with 7,790 additions and 5,510 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ The autogenerated OSAL user's guide can be viewed at <https://github.com/nasa/cF

## Version History

### Development Build: 5.1.0-rc1+dev132

- Convert the OSAL Configuration Guide from docx and pdf to a markdown file.
- Test Tasks do not run at 100%. Move all definitions and instantiations out of the core-test header file and reuse the already-existing single task definition.
- Break up `osapi-os-*.h` files into units that correspond to the implementation units. Kept old header file names for compatibility.
- Reworks the POSIX global lock implementation. Does not change the POSIX signal mask when locking/unlocking the global.
- Fixes a race condition.
- Adds a condition variable to the global lock structure. improves handling of tasks competing for access to the same object.
- No longer changing signal masks repeatedly/unexpectedly. May be relevant to some BSP/driver developers.
- Checks return of sysconf for error and reports them. Only sets PageSize on success. If sysconf fails it provides a mechanism to avoid error propagation.
- Uses `errno` instead of status return from `clock_getres` with `strerror` reporting.
- Adds support for VxWorks 7
- See <https://github.com/nasa/osal/pull/690>

### Development Build: 5.1.0-rc1+dev109

- Add support for RTEMS 5.1 in the OSAL and provides defines and necessary ifdefs so RTEMS 4.11 can continue to be supported.
Expand Down
47 changes: 47 additions & 0 deletions default_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,53 @@
#
##########################################################################

##############################################################
# Argument/Bug-checking options
##############################################################

# OSAL_CONFIG_BUGCHECK_DISABLE
# ----------------------------------
#
# Disable/compile-out the "bugcheck" macro
#
# The bugcheck macro is used to validate the inputs to functions and/or
# assert on other conditions that should _always_ be true. If any of these
# conditions ever evaluate as false, it indicates a bug in the code -
# either in the OSAL or the application which invoked OSAL.
#
# If set FALSE (default), then the OSAL bugcheck macro will evaluate its
# boolean conditional and generate an action if that conditional evaulates
# false. (The specific action to take is configured via a different
# directive -- see OSAL_CONFIG_BUGCHECK_STRICT).
#
# These extra bug checks do consume a slight bit of code+data space as
# well as some runtime CPU cycles on every call, depending on the conditions
# being tested.
#
# Once the application has reached a sufficient level of stability and
# confidence is obtained that these bug checks are not possible to be
# triggered, this directive may be set TRUE which disables the bug checks
# completely - rendering these statements as no-ops.
#
set(OSAL_CONFIG_BUGCHECK_DISABLE FALSE)


# OSAL_CONFIG_BUGCHECK_STRICT
# ----------------------------------
#
# Select a strict implementation for the "bugcheck" macro
#
# If set FALSE (default), then the OSAL bugcheck macro will generate a
# debug message and return an error code if the conditional evaluates
# as false. This is a soft error - the application will get the
# error code and keep running.
#
# If set to TRUE, then any failure of any bugcheck macro is considered
# fatal and will trigger an abort(). On many platforms this will
# generate an abnormal application exit with a core file for debugging.
#
set(OSAL_CONFIG_BUGCHECK_STRICT FALSE)


##############################################################
# Code/Feature Selection Options for the OSAL implementation
Expand Down
869 changes: 869 additions & 0 deletions doc/OSAL-Configuration-Guide.md

Large diffs are not rendered by default.

Binary file removed doc/OSAL-Configuration-guide.doc
Binary file not shown.
Binary file removed doc/OSAL-Configuration-guide.pdf
Binary file not shown.
63 changes: 37 additions & 26 deletions osconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,38 +20,41 @@

/**
* \brief Configuration file Operating System Abstraction Layer
*
*
* The specific definitions in this file may only be modified
* by setting the respective OSAL configuration options in the CMake
* build.
* by setting the respective OSAL configuration options in the CMake
* build.
*
* Any direct modifications to the generated copy will
* be overwritten each time CMake executes.
* be overwritten each time CMake executes.
*
* \note This file was automatically generated by CMake from
* @CMAKE_CURRENT_SOURCE_DIR@/default_config.cmake
*/

#ifndef INCLUDE_OSCONFIG_H_
#define INCLUDE_OSCONFIG_H_

/*
* OSAL feature selection options from build config
#ifndef OSCONFIG_H
#define OSCONFIG_H

/*
* OSAL feature selection options from build config
*/
#cmakedefine OSAL_CONFIG_INCLUDE_DYNAMIC_LOADER
#cmakedefine OSAL_CONFIG_INCLUDE_NETWORK
#cmakedefine OSAL_CONFIG_INCLUDE_STATIC_LOADER
#cmakedefine OSAL_CONFIG_INCLUDE_NETWORK
#cmakedefine OSAL_CONFIG_INCLUDE_STATIC_LOADER
#cmakedefine OSAL_CONFIG_INCLUDE_SHELL
#cmakedefine OSAL_CONFIG_DEBUG_PRINTF
#cmakedefine OSAL_CONFIG_DEBUG_PERMISSIVE_MODE
#cmakedefine OSAL_CONFIG_DEBUG_PRINTF
#cmakedefine OSAL_CONFIG_DEBUG_PERMISSIVE_MODE

/*
#cmakedefine OSAL_CONFIG_BUGCHECK_DISABLE
#cmakedefine OSAL_CONFIG_BUGCHECK_STRICT

/*
* OSAL resource limits from build config
*
* (These are prefixed with OS_ for compatibility
* with existing code referencing these symbols)
*/

/**
* \brief The maximum number of to support
*
Expand Down Expand Up @@ -140,8 +143,8 @@

/**
* \brief The maximum length of OSAL file names
*
* This limit applies specifically to the file name portion, not the
*
* This limit applies specifically to the file name portion, not the
* directory portion, of a path name.
*
* Based on the OSAL_CONFIG_MAX_FILE_NAME configuration option
Expand Down Expand Up @@ -175,14 +178,14 @@
* \brief The maximum size of the socket address structure
*
* This is part of the Socket API, and should be set large enough to hold
* the largest address type in use on the target system.
* the largest address type in use on the target system.
*
* Based on the OSAL_CONFIG_SOCKADDR_MAX_LEN configuration option
*/
#define OS_SOCKADDR_MAX_LEN @OSAL_CONFIG_SOCKADDR_MAX_LEN@

/**
* \brief The maximum size of output produced by a single OS_printf()
* \brief The maximum size of output produced by a single OS_printf()
*
* Based on the OSAL_CONFIG_PRINTF_BUFFER_SIZE configuration option
*/
Expand Down Expand Up @@ -234,7 +237,7 @@
#define OS_QUEUE_MAX_DEPTH @OSAL_CONFIG_QUEUE_MAX_DEPTH@

/**
* \brief The name of the temporary file used to store shell commands
* \brief The name of the temporary file used to store shell commands
*
* This configuration is only applicable if shell support is enabled, and
* only necessary/relevant on some OS implementations.
Expand All @@ -251,14 +254,14 @@
*
* Based on the OSAL_CONFIG_PRINTF_CONSOLE_NAME configuration option
*/
#define OS_PRINTF_CONSOLE_NAME "@OSAL_CONFIG_PRINTF_CONSOLE_NAME@"
#define OS_PRINTF_CONSOLE_NAME "@OSAL_CONFIG_PRINTF_CONSOLE_NAME@"

/*
/*
* OSAL fixed resource limits
*
* The resource limits here are not user-configurable, but
* may be changed in a future revision of OSAL, so it is
* still present in osconfig.h along with the others.
* may be changed in a future revision of OSAL, so it is
* still present in osconfig.h along with the others.
*/

/**
Expand All @@ -269,11 +272,19 @@
#define OS_MAX_CONSOLES 1

/**
* \brief The system-specific file extension used on loadable module files
* \brief The system-specific file extension used on loadable module files
*
* Fixed value based on system selection, not user configurable.
*/
#define OS_MODULE_FILE_EXTENSION "@CMAKE_SHARED_LIBRARY_SUFFIX@"

/*
** Length of a Device and Volume name
*/
#define OS_FS_DEV_NAME_LEN 32 /**< Device name length */
#define OS_FS_PHYS_NAME_LEN 64 /**< Physical drive name length */
#define OS_FS_VOL_NAME_LEN 32 /**< Volume name length */


#endif /* OSCONFIG_H */

#endif /* INCLUDE_OSCONFIG_H_ */
2 changes: 2 additions & 0 deletions src/bsp/generic-linux/src/bsp_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
* OSAL BSP debug console abstraction
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
Expand Down
1 change: 1 addition & 0 deletions src/bsp/generic-linux/src/bsp_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* 2005/07/26 A. Cudmore | Initial version for linux
*/

#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
Expand Down
6 changes: 4 additions & 2 deletions src/bsp/generic-linux/src/generic_linux_bsp_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
#ifndef GENERIC_LINUX_BSP_INTERNAL_H_
#define GENERIC_LINUX_BSP_INTERNAL_H_

#include "osapi.h"
#include "osapi-common.h"
#include "osapi-bsp.h"
#include "osapi-error.h"
#include "bsp-impl.h"

/*
Expand All @@ -44,4 +46,4 @@ typedef struct
*/
extern OS_BSP_GenericLinuxGlobalData_t OS_BSP_GenericLinuxGlobal;

#endif /* GENERIC_LINUX_BSP_INTERNAL_H_ */
#endif /* GENERIC_LINUX_BSP_INTERNAL_H */
3 changes: 1 addition & 2 deletions src/bsp/generic-vxworks/src/generic_vxworks_bsp_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
/*
** OSAL includes
*/
#include "osapi.h"
#include "bsp-impl.h"

#endif /* GENERIC_VXWORKS_BSP_INTERNAL_H_ */
#endif /* GENERIC_VXWORKS_BSP_INTERNAL_H */
7 changes: 3 additions & 4 deletions src/bsp/pc-rtems/src/pcrtems_bsp_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@
* Header file for internal data to the PC-RTEMS BSP
*/

#ifndef _PCRTEMS_BSP_INTERNAL_H_
#define _PCRTEMS_BSP_INTERNAL_H_
#ifndef PCRTEMS_BSP_INTERNAL_H
#define PCRTEMS_BSP_INTERNAL_H

/*
** OSAL includes
*/
#include "osapi.h"
#include "bsp-impl.h"

/*
Expand Down Expand Up @@ -74,4 +73,4 @@ typedef struct
*/
extern OS_BSP_PcRtemsGlobalData_t OS_BSP_PcRtemsGlobal;

#endif /* _PCRTEMS_BSP_INTERNAL_H_ */
#endif /* PCRTEMS_BSP_INTERNAL_H */
12 changes: 8 additions & 4 deletions src/bsp/shared/inc/bsp-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@
* BSP-provided console or debug terminal device.
*/

#ifndef _osapi_bsp_impl_
#define _osapi_bsp_impl_
#ifndef BSP_IMPL_H
#define BSP_IMPL_H

#include "osapi.h"
#include <stdio.h>

#include "osapi-common.h"
#include "osapi-bsp.h"
#include "osapi-error.h"

/*
* A set of simplified console control options
Expand Down Expand Up @@ -151,4 +155,4 @@ void OS_BSP_Shutdown_Impl(void);
/*********************
END bsp-impl.h
*********************/
#endif /* _osapi_bsp_impl_ */
#endif /* BSP_IMPL_H */
2 changes: 1 addition & 1 deletion src/bsp/shared/src/bsp_default_app_run.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* which will override this default.
*/

#include "osapi.h"
#include "osapi-common.h"
#include "bsp-impl.h"

/*
Expand Down
1 change: 0 additions & 1 deletion src/bsp/shared/src/bsp_default_app_startup.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
*/

#include <stdlib.h>
#include "osapi.h"

#include "bsp-impl.h"

Expand Down
2 changes: 1 addition & 1 deletion src/bsp/shared/src/bsp_default_symtab.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* which will override this default.
*/

#include "osapi.h"
#include "osapi-module.h"
#include "bsp-impl.h"

OS_static_symbol_record_t OS_STATIC_SYMBOL_TABLE[] = {
Expand Down
11 changes: 9 additions & 2 deletions src/os/inc/common_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
* Assumes make file has defined processor family
*/

#ifndef _common_types_
#define _common_types_
#ifndef COMMON_TYPES_H
#define COMMON_TYPES_H

#ifdef __cplusplus
extern "C"
Expand Down Expand Up @@ -123,6 +123,13 @@ extern "C"
*/
typedef uint32 osal_objtype_t;

/**
* @brief General purpose OSAL callback function
*
* This may be used by multiple APIS
*/
typedef void (*OS_ArgCallback_t)(osal_id_t object_id, void *arg);

#ifndef NULL /* pointer to nothing */
#define NULL ((void *)0)
#endif
Expand Down
Loading

0 comments on commit d698a4d

Please sign in to comment.