ignore fault

This commit is contained in:
Robin Müller 2022-10-24 15:41:29 +02:00
parent 2df66c9304
commit 4db124c680
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
3 changed files with 12 additions and 24 deletions

View File

@ -31,9 +31,8 @@ LocalPool::LocalPool(object_id_t setObjectId, const LocalPoolConfig& poolConfig,
LocalPool::~LocalPool() = default;
ReturnValue_t LocalPool::addData(store_address_t* storageId, const uint8_t* data, size_t size,
bool ignoreFault) {
ReturnValue_t status = reserveSpace(size, storageId, ignoreFault);
ReturnValue_t LocalPool::addData(store_address_t* storageId, const uint8_t* data, size_t size) {
ReturnValue_t status = reserveSpace(size, storageId);
if (status == returnvalue::OK) {
write(*storageId, data, size);
}
@ -49,8 +48,8 @@ ReturnValue_t LocalPool::getData(store_address_t packetId, const uint8_t** packe
}
ReturnValue_t LocalPool::getFreeElement(store_address_t* storageId, const size_t size,
uint8_t** pData, bool ignoreFault) {
ReturnValue_t status = reserveSpace(size, storageId, ignoreFault);
uint8_t** pData) {
ReturnValue_t status = reserveSpace(size, storageId);
if (status == returnvalue::OK) {
*pData = &store[storageId->poolIndex][getRawPosition(*storageId)];
} else {
@ -167,7 +166,7 @@ void LocalPool::clearStore() {
}
}
ReturnValue_t LocalPool::reserveSpace(size_t size, store_address_t* storeId, bool ignoreFault) {
ReturnValue_t LocalPool::reserveSpace(size_t size, store_address_t* storeId) {
ReturnValue_t status = getSubPoolIndex(size, &storeId->poolIndex);
if (status != returnvalue::OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1

View File

@ -86,11 +86,9 @@ class LocalPool : public SystemObject, public StorageManagerIF {
/**
* Documentation: See StorageManagerIF.h
*/
ReturnValue_t addData(store_address_t* storeId, const uint8_t* data, size_t size,
bool ignoreFault) override;
ReturnValue_t addData(store_address_t* storeId, const uint8_t* data, size_t size) override;
ReturnValue_t getFreeElement(store_address_t* storeId, size_t size, uint8_t** pData,
bool ignoreFault) override;
ReturnValue_t getFreeElement(store_address_t* storeId, size_t size, uint8_t** pData) override;
ReturnValue_t getData(store_address_t storeId, const uint8_t** packet_ptr, size_t* size) override;
@ -135,7 +133,6 @@ class LocalPool : public SystemObject, public StorageManagerIF {
// the fully qualified path with the using directive.
using StorageManagerIF::getFreeElement;
using StorageManagerIF::getData;
using StorageManagerIF::addData;
using StorageManagerIF::modifyData;
protected:
@ -146,7 +143,7 @@ class LocalPool : public SystemObject, public StorageManagerIF {
* @return - returnvalue::OK on success,
* - the return codes of #getPoolIndex or #findEmpty otherwise.
*/
virtual ReturnValue_t reserveSpace(size_t size, store_address_t* address, bool ignoreFault);
virtual ReturnValue_t reserveSpace(size_t size, store_address_t* address);
private:
/**
@ -190,6 +187,8 @@ class LocalPool : public SystemObject, public StorageManagerIF {
std::vector<std::vector<size_type>> sizeLists =
std::vector<std::vector<size_type>>(NUMBER_OF_SUBPOOLS);
bool ignoreFault = false;
//! A variable to determine whether higher n pools are used if
//! the store is full.
bool spillsToHigherPools = false;

View File

@ -66,12 +66,7 @@ class StorageManagerIF {
* @return Returns @returnvalue::OK if data was added.
* @returnvalue::FAILED if data could not be added, storageId is unchanged then.
*/
virtual ReturnValue_t addData(store_address_t* storageId, const uint8_t* data, size_t size,
bool ignoreFault) = 0;
virtual ReturnValue_t addData(store_address_t* storageId, const uint8_t* data, size_t size) {
return addData(storageId, data, size, false);
}
virtual ReturnValue_t addData(store_address_t* storageId, const uint8_t* data, size_t size) = 0;
/**
* @brief With deleteData, the storageManager frees the memory region
@ -186,12 +181,7 @@ class StorageManagerIF {
* @return Returns @returnvalue::OK if data was added.
* @returnvalue::FAILED if data could not be added, storageId is unchanged then.
*/
virtual ReturnValue_t getFreeElement(store_address_t* storageId, size_t size, uint8_t** dataPtr,
bool ignoreFault) = 0;
virtual ReturnValue_t getFreeElement(store_address_t* storageId, size_t size, uint8_t** dataPtr) {
return getFreeElement(storageId, size, dataPtr, false);
}
virtual ReturnValue_t getFreeElement(store_address_t* storageId, size_t size, uint8_t** dataPtr) = 0;
[[nodiscard]] virtual bool hasDataAtId(store_address_t storeId) const = 0;