diff --git a/README.md b/README.md index b15360f0..850b317f 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,11 @@ This is a collection of APIs abstracting platform specific functionality to be l ## Version History +### Development Build: 1.4.12 + +- Replace 'OS_VolumeTable' with OS_FileSysAddFixedMap() in all PSPs. +- See + ### Development Build: 1.4.11 - Removes non-termination string warnings when building with GCC9. diff --git a/fsw/inc/cfe_psp_configdata.h b/fsw/inc/cfe_psp_configdata.h index 61217bb6..096356df 100644 --- a/fsw/inc/cfe_psp_configdata.h +++ b/fsw/inc/cfe_psp_configdata.h @@ -61,9 +61,6 @@ typedef const struct uint32 PSP_ExceptionLogSize; /**< Size of PSP exception log */ CFE_PSP_MemTable_t *PSP_MemoryTable; /**< Pointer to PSP memory table (forward reference) */ - uint32 OS_VolumeTableSize; /**< Size of OS volume table */ - OS_VolumeInfo_t *OS_VolumeTable; /**< Pointer to OS volume table (forward reference) */ - /** * Number of EEPROM banks on this platform */ @@ -85,11 +82,5 @@ extern Target_PspConfigData GLOBAL_PSP_CONFIGDATA; */ extern CFE_PSP_MemTable_t CFE_PSP_MemoryTable[]; -/** - * Extern reference to the psp volume table - * Allows the actual instantiation to be done outside this module - */ -extern OS_VolumeInfo_t OS_VolumeTable[]; - #endif /* CFE_PSP_CONFIG_H_ */ diff --git a/fsw/mcp750-vxworks/CMakeLists.txt b/fsw/mcp750-vxworks/CMakeLists.txt index b3c54e7e..91bf5d78 100644 --- a/fsw/mcp750-vxworks/CMakeLists.txt +++ b/fsw/mcp750-vxworks/CMakeLists.txt @@ -8,6 +8,5 @@ add_library(psp-${CFE_SYSTEM_PSPNAME}-impl OBJECT src/cfe_psp_start.c src/cfe_psp_support.c src/cfe_psp_timer.c - src/cfe_psp_voltab.c src/cfe_psp_watchdog.c) diff --git a/fsw/mcp750-vxworks/inc/psp_version.h b/fsw/mcp750-vxworks/inc/psp_version.h index baca5dbc..034ed04f 100644 --- a/fsw/mcp750-vxworks/inc/psp_version.h +++ b/fsw/mcp750-vxworks/inc/psp_version.h @@ -35,7 +35,7 @@ */ #define CFE_PSP_IMPL_MAJOR_VERSION 1 #define CFE_PSP_IMPL_MINOR_VERSION 4 -#define CFE_PSP_IMPL_REVISION 11 +#define CFE_PSP_IMPL_REVISION 12 #define CFE_PSP_IMPL_MISSION_REV 0 #endif /* _psp_version_ */ diff --git a/fsw/mcp750-vxworks/src/cfe_psp_start.c b/fsw/mcp750-vxworks/src/cfe_psp_start.c index 509cd016..720c46c7 100644 --- a/fsw/mcp750-vxworks/src/cfe_psp_start.c +++ b/fsw/mcp750-vxworks/src/cfe_psp_start.c @@ -96,6 +96,7 @@ void OS_Application_Startup(void) int TicksPerSecond; uint32 reset_type; uint32 reset_subtype; + uint32 fs_id; char reset_register; int32 Status; @@ -112,6 +113,18 @@ void OS_Application_Startup(void) CFE_PSP_Panic(Status); } + /* + ** Set up the virtual FS mapping for the "/cf" directory + ** On this platform it is will use the CF:0 physical device. + */ + Status = OS_FileSysAddFixedMap(&fs_id, "CF:0", "/cf"); + if (Status != OS_SUCCESS) + { + /* Print for informational purposes -- + * startup can continue, but loads may fail later, depending on config. */ + OS_printf("CFE_PSP: OS_FileSysAddFixedMap() failure: %d\n", (int)Status); + } + /* ** Delay for one second. */ diff --git a/fsw/mcp750-vxworks/src/cfe_psp_voltab.c b/fsw/mcp750-vxworks/src/cfe_psp_voltab.c deleted file mode 100644 index e232561f..00000000 --- a/fsw/mcp750-vxworks/src/cfe_psp_voltab.c +++ /dev/null @@ -1,72 +0,0 @@ -/* -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - -/* -** File : cfe_psp_voltab.c -** Author : Nicholas Yanchik / GSFC Code 582 -** -** PSP Volume table for file systems -*/ - -/**************************************************************************************** - INCLUDE FILES -****************************************************************************************/ -#include "common_types.h" -#include "osapi.h" - -/* -** OSAL volume table. This is the only file in the PSP that still has the -** OS_ naming convention, since it belongs to the OSAL. -*/ -OS_VolumeInfo_t OS_VolumeTable [NUM_TABLE_ENTRIES] = -{ -/* Dev Name Phys Dev Vol Type Volatile? Free? IsMounted? Volname MountPt BlockSz */ - -/* cFE RAM Disk */ -{"/ramdev0", " ", RAM_DISK, true, true, false, " ", " ", 0 }, - -/* cFE non-volatile Disk -- Auto-Mapped to an existing CF disk */ -{"/eedev0", "CF:0", FS_BASED, false, false, true, "CF", "/cf", 512 }, - -/* -** Spare RAM disks to be used for SSR and other RAM disks -*/ -{"/ramdev1", " ", RAM_DISK, true, true, false, " ", " ", 0 }, -{"/ramdev2", " ", RAM_DISK, true, true, false, " ", " ", 0 }, -{"/ramdev3", " ", RAM_DISK, true, true, false, " ", " ", 0 }, -{"/ramdev4", " ", RAM_DISK, true, true, false, " ", " ", 0 }, -{"/ramdev5", " ", RAM_DISK, true, true, false, " ", " ", 0 }, - -/* -** Hard disk mappings -*/ -{"/ssrdev0", "/hd:0/SSR1", FS_BASED, true, true, false, " ", " ", 0 }, -{"/ssrdev1", "/hd:0/SSR2", FS_BASED, true, true, false, " ", " ", 0 }, -{"/ssrdev2", "/hd:0/SSR3", FS_BASED, true, true, false, " ", " ", 0 }, - -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 } - -}; - - - diff --git a/fsw/pc-linux/CMakeLists.txt b/fsw/pc-linux/CMakeLists.txt index fb5a5d5a..bb10d4f0 100644 --- a/fsw/pc-linux/CMakeLists.txt +++ b/fsw/pc-linux/CMakeLists.txt @@ -8,6 +8,5 @@ add_library(psp-${CFE_SYSTEM_PSPNAME}-impl OBJECT src/cfe_psp_start.c src/cfe_psp_support.c src/cfe_psp_timer.c - src/cfe_psp_voltab.c src/cfe_psp_watchdog.c) diff --git a/fsw/pc-linux/inc/psp_version.h b/fsw/pc-linux/inc/psp_version.h index baca5dbc..034ed04f 100644 --- a/fsw/pc-linux/inc/psp_version.h +++ b/fsw/pc-linux/inc/psp_version.h @@ -35,7 +35,7 @@ */ #define CFE_PSP_IMPL_MAJOR_VERSION 1 #define CFE_PSP_IMPL_MINOR_VERSION 4 -#define CFE_PSP_IMPL_REVISION 11 +#define CFE_PSP_IMPL_REVISION 12 #define CFE_PSP_IMPL_MISSION_REV 0 #endif /* _psp_version_ */ diff --git a/fsw/pc-linux/src/cfe_psp_start.c b/fsw/pc-linux/src/cfe_psp_start.c index e409b54a..c9202e4c 100644 --- a/fsw/pc-linux/src/cfe_psp_start.c +++ b/fsw/pc-linux/src/cfe_psp_start.c @@ -160,6 +160,7 @@ void OS_Application_Startup(void) uint32 reset_subtype; int32 time_status; uint32 sys_timebase_id; + uint32 fs_id; int opt = 0; int longIndex = 0; int32 Status; @@ -321,6 +322,18 @@ void OS_Application_Startup(void) sys_timebase_id = 0; } + /* + ** Set up the virtual FS mapping for the "/cf" directory + ** On this platform it is just a local/relative dir of the same name. + */ + Status = OS_FileSysAddFixedMap(&fs_id, "./cf", "/cf"); + if (Status != OS_SUCCESS) + { + /* Print for informational purposes -- + * startup can continue, but loads may fail later, depending on config. */ + OS_printf("CFE_PSP: OS_FileSysAddFixedMap() failure: %d\n", (int)Status); + } + /* ** Initialize the statically linked modules (if any) ** This is only applicable to CMake build - classic build diff --git a/fsw/pc-linux/src/cfe_psp_voltab.c b/fsw/pc-linux/src/cfe_psp_voltab.c deleted file mode 100644 index ef888fd2..00000000 --- a/fsw/pc-linux/src/cfe_psp_voltab.c +++ /dev/null @@ -1,89 +0,0 @@ -/* -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - -/* -** File : cfe_psp_voltab.c -** Author : Nicholas Yanchik / GSFC Code 582 -** -** cFE PSP Volume table for file systems -*/ - -/**************************************************************************************** - INCLUDE FILES -****************************************************************************************/ -#include "common_types.h" -#include "osapi.h" -#include "osconfig.h" - -#ifdef VOLTAB_PATH - -#define VOLTAB_MACRO \ -OS_VolumeInfo_t OS_VolumeTable [NUM_TABLE_ENTRIES] = \ -{ \ -{"/ramdev0", VOLTAB_PATH, FS_BASED, true, true, false, " ", " ", 0 }, \ -{"/cf", VOLTAB_PATH, FS_BASED, false, false, true, "CF", "/cf", 512 }, \ -{"/ramdev1", " ", FS_BASED, true, true, false, " ", " ", 0 }, \ -{"/ramdev2", " ", FS_BASED, true, true, false, " ", " ", 0 }, \ -{"/ramdev3", " ", FS_BASED, true, true, false, " ", " ", 0 }, \ -{"/ramdev4", " ", FS_BASED, true, true, false, " ", " ", 0 }, \ -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, \ -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, \ -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, \ -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, \ -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, \ -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, \ -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, \ -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 } \ -}; - -VOLTAB_MACRO - -#else -/* -** OSAL volume table. This is the only file in the PSP that still has the -** OS_ naming convention, since it belongs to the OSAL. -*/ -OS_VolumeInfo_t OS_VolumeTable [NUM_TABLE_ENTRIES] = -{ -/* Dev Name Phys Dev Vol Type Volatile? Free? IsMounted? Volname MountPt BlockSz */ -{"/ramdev0", "./ram", FS_BASED, true, true, false, " ", " ", 0 }, -{"/ramdev1", "./ram1", FS_BASED, true, true, false, " ", " ", 0 }, -{"/ramdev2", "./ram2", FS_BASED, true, true, false, " ", " ", 0 }, -{"/ramdev3", "./ram3", FS_BASED, true, true, false, " ", " ", 0 }, -{"/ramdev4", "./ram4", FS_BASED, true, true, false, " ", " ", 0 }, - -/* -** The following entry is a "pre-mounted" path to a non-volatile device -*/ -{"/eedev0", "./cf", FS_BASED, false, false, true, "CF", "/cf", 512 }, - -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 } -}; - - -#endif - diff --git a/fsw/pc-rtems/CMakeLists.txt b/fsw/pc-rtems/CMakeLists.txt index c4a21a13..5abbc21a 100644 --- a/fsw/pc-rtems/CMakeLists.txt +++ b/fsw/pc-rtems/CMakeLists.txt @@ -8,6 +8,5 @@ add_library(psp-${CFE_SYSTEM_PSPNAME}-impl OBJECT src/cfe_psp_start.c src/cfe_psp_support.c src/cfe_psp_timer.c - src/cfe_psp_voltab.c src/cfe_psp_watchdog.c) diff --git a/fsw/pc-rtems/inc/psp_version.h b/fsw/pc-rtems/inc/psp_version.h index baca5dbc..034ed04f 100644 --- a/fsw/pc-rtems/inc/psp_version.h +++ b/fsw/pc-rtems/inc/psp_version.h @@ -35,7 +35,7 @@ */ #define CFE_PSP_IMPL_MAJOR_VERSION 1 #define CFE_PSP_IMPL_MINOR_VERSION 4 -#define CFE_PSP_IMPL_REVISION 11 +#define CFE_PSP_IMPL_REVISION 12 #define CFE_PSP_IMPL_MISSION_REV 0 #endif /* _psp_version_ */ diff --git a/fsw/pc-rtems/src/cfe_psp_start.c b/fsw/pc-rtems/src/cfe_psp_start.c index affa2a16..fa23dd85 100644 --- a/fsw/pc-rtems/src/cfe_psp_start.c +++ b/fsw/pc-rtems/src/cfe_psp_start.c @@ -235,6 +235,7 @@ void CFE_PSP_Main(void) { uint32 reset_type; uint32 reset_subtype; + uint32 fs_id; int32 Status; @@ -256,6 +257,17 @@ void CFE_PSP_Main(void) */ CFE_PSP_SetupReservedMemoryMap(); + /* + ** Set up the virtual FS mapping for the "/cf" directory + */ + Status = OS_FileSysAddFixedMap(&fs_id, "/mnt/eeprom", "/cf"); + if (Status != OS_SUCCESS) + { + /* Print for informational purposes -- + * startup can continue, but loads may fail later, depending on config. */ + OS_printf("CFE_PSP: OS_FileSysAddFixedMap() failure: %d\n", (int)Status); + } + /* ** Initialize the statically linked modules (if any) */ diff --git a/fsw/pc-rtems/src/cfe_psp_voltab.c b/fsw/pc-rtems/src/cfe_psp_voltab.c deleted file mode 100644 index ba368f2e..00000000 --- a/fsw/pc-rtems/src/cfe_psp_voltab.c +++ /dev/null @@ -1,66 +0,0 @@ -/* -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - -/* -** File : cfe_psp_voltab.c -** Author : Nicholas Yanchik / GSFC Code 582 -** -** OS Volume table for file systems -*/ - -/**************************************************************************************** - INCLUDE FILES -****************************************************************************************/ -#include "common_types.h" -#include "osapi.h" - - -/* -** volume table. This table has the OS_ name, since it belongs to the OSAL, not the CFE_PSP -*/ -OS_VolumeInfo_t OS_VolumeTable [NUM_TABLE_ENTRIES] = -{ -/* Dev Name Phys Dev Vol Type Volatile? Free? IsMounted? Volname MountPt BlockSz */ - -/* cFE RAM Disk */ -{ "/ramdev0", "/ram", FS_BASED, true, true, false, " ", " ", 512 }, - -/* cFE non-volatile Disk -- Auto-Mapped to an existing CF disk */ -{"/eedev0", "/eeprom", FS_BASED, false, false, true, "CF", "/cf", 512 }, - -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, - -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, - -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 }, -{"unused", "unused", FS_BASED, true, true, false, " ", " ", 0 } - -}; - - - diff --git a/fsw/shared/cfe_psp_configdata.c b/fsw/shared/cfe_psp_configdata.c index 0bd712fb..56112216 100644 --- a/fsw/shared/cfe_psp_configdata.c +++ b/fsw/shared/cfe_psp_configdata.c @@ -45,9 +45,6 @@ Target_PspConfigData GLOBAL_PSP_CONFIGDATA = .PSP_MemTableSize = CFE_PSP_MEM_TABLE_SIZE, .PSP_MemoryTable = CFE_PSP_MemoryTable, - .OS_VolumeTableSize = NUM_TABLE_ENTRIES, - .OS_VolumeTable = OS_VolumeTable, - .HW_NumEepromBanks = CFE_PSP_NUM_EEPROM_BANKS, .PSP_VersionInfo =