DEENESPTFRRUARHIKOZHNL

BSW Multicore Library (Bmc)

ModulBmc (BSW Multicore Library)
BSW-Modul-ID214
Standard-Header#include "Bmc.h"
SWS-SpezifikationAUTOSAR_CP_SWS_BSWMulticoreLibrary.pdf, AUTOSAR_SWS_BSWMulticoreLibrary.pdf
Umfang69 Records · 0 Snippets
ClusterAUTOSAR-Bibliotheken

BSW Multicore Library (Bmc)

AUTOSAR Classic Libraries-Modul BSW Multicore Library (Bmc, Spezifikation: AUTOSAR_CP_SWS_BSWMulticoreLibrary.pdf, AUTOSAR_SWS_BSWMulticoreLibrary.pdf).

Funktionen — Übersicht

Typen — Übersicht

Anforderungen — Übersicht

Funktionen & Typen — Detailansicht

function Bmc_FlagTestAndSet [SWS_Bmc_91003] 📄 PDF

boolean Bmc_FlagTestAndSet(volatile Bmc_AtomicFlagType* Object);

Atomically sets the value pointed to by Object to true.

function Bmc_FlagClear [SWS_Bmc_91004] 📄 PDF

void Bmc_FlagClear(volatile Bmc_AtomicFlagType* Object);

Atomically sets the value pointed to by Object to false.

function Bmc_Load_<TypeMn> [SWS_Bmc_91005] 📄 PDF

<Type> Bmc_Load_<TypeMn>(const volatile <Type>* Object); ⚠️

Atomically loads the value pointed to by Object and returns it.

function Bmc_Store_<TypeMn> [SWS_Bmc_91006] 📄 PDF

void Bmc_Store_<TypeMn>(volatile <Type>* Object, <Type> Desired); ⚠️

Atomically replaces the value pointed to by Object with the value of Desired.

function Bmc_Exchange_<TypeMn> [SWS_Bmc_91007] 📄 PDF

<Type> Bmc_Exchange_<TypeMn>(const volatile <Type>* Object, <Type> Desired); ⚠️

Atomically replaces the value pointed to by Object with the value of Desired and returns the value pointed to by Object immediately before the effects.

function Bmc_CompareExchange_<TypeMn> [SWS_Bmc_91008] 📄 PDF

boolean Bmc_CompareExchange_<TypeMn>(volatile <Type>* Object, <Type>* Expected, <Type> Desired); ⚠️

Atomically compares the value pointed to by Object for equality with that in Expected, and if true, replaces the value pointed to by Object with Desired, and if false, updates the value in Expected with the value pointed to by Object.

function Bmc_FetchAdd_<TypeMn> [SWS_Bmc_91009] 📄 PDF

<Type> Bmc_FetchAdd_<TypeMn>(volatile <Type>* Object, <Type> Operand); ⚠️

Atomically replaces the value pointed to by Object with the result of the addition applied to the value pointed to by Object and the given Operand.

function Bmc_FetchSub_<TypeMn> [SWS_Bmc_91010] 📄 PDF

<Type> Bmc_FetchSub_<TypeMn>(volatile <Type>* Object, <Type> Operand); ⚠️

Atomically replaces the value pointed to by Object with the result of the subtraction applied to the value pointed to by Object and the given Operand.

function Bmc_FetchOr_<TypeMn> [SWS_Bmc_91011] 📄 PDF

<Type> Bmc_FetchOr_<TypeMn>(volatile <Type>* Object, <Type> Operand); ⚠️

Atomically replaces the value pointed to by Object with the result of the or-operation applied to the value pointed to by Object and the given Operand.

function Bmc_FetchXor_<TypeMn> [SWS_Bmc_91012] 📄 PDF

<Type> Bmc_FetchXor_<TypeMn>(volatile <Type>* Object, <Type> Operand); ⚠️

Atomically replaces the value pointed to by Object with the result of the xor-operation applied to the value pointed to by Object and the given Operand.

function Bmc_FetchAnd_<TypeMn> [SWS_Bmc_91013] 📄 PDF

<Type> Bmc_FetchAnd_<TypeMn>(volatile <Type>* Object, <Type> Operand); ⚠️

Atomically replaces the value pointed to by Object with the result of the and-operation applied to the value pointed to by Object and the given Operand.

function Bmc_ThreadFence [SWS_Bmc_91014] 📄 PDF

void Bmc_ThreadFence(void);

Creates a sequentially consistent acquire and release fence. An acquire and release fence instruction prevents the memory reordering of any read or write which precedes it in program order with any read or write which follows it in program order.

function Bmc_Load_u [SWS_Bmc_91019] 📄 PDF

Bmc_AtomicUType Bmc_Load_u(const volatile Bmc_AtomicUType* Object);

Atomically loads the value pointed to by Object and returns it.

function Bmc_Load_s [SWS_Bmc_91020] 📄 PDF

Bmc_AtomicSType Bmc_Load_s(const volatile Bmc_AtomicSType* Object);

Atomically loads the value pointed to by Object and returns it.

function Bmc_Store_u [SWS_Bmc_91021] 📄 PDF

void Bmc_Store_u(volatile Bmc_AtomicUType* Object, Bmc_AtomicUType Desired);

Atomically replaces the value pointed to by Object with the value of Desired.

function Bmc_Store_s [SWS_Bmc_91022] 📄 PDF

void Bmc_Store_s(volatile Bmc_AtomicSType* Object, Bmc_AtomicSType Desired);

Atomically replaces the value pointed to by Object with the value of Desired.

function Bmc_CompareExchange_u [SWS_Bmc_91023] 📄 PDF

boolean Bmc_CompareExchange_u(volatile Bmc_AtomicUType* Object, Bmc_AtomicUType* Expected, Bmc_AtomicUType Desired);

Atomically compares the value pointed to by Object for equality with that in Expected, and if true, replaces the value pointed to by Object with Desired, and if false, updates the value in Expected with the value pointed to by Object.

function Bmc_CompareExchange_s [SWS_Bmc_91024] 📄 PDF

boolean Bmc_CompareExchange_s(volatile Bmc_AtomicSType* Object, Bmc_AtomicSType* Expected, Bmc_AtomicSType Desired);

Atomically compares the value pointed to by Object for equality with that in Expected, and if true, replaces the value pointed to by Object with Desired, and if false, updates the value in Expected with the value pointed to by Object.

function Bmc_Exchange_u [SWS_Bmc_91025] 📄 PDF

Bmc_AtomicUType Bmc_Exchange_u(const volatile Bmc_AtomicUType* Object, Bmc_AtomicUType Desired);

Atomically replaces the value pointed to by Object with the value of Desired and returns the value pointed to by Object immediately before the effects.

function Bmc_Exchange_s [SWS_Bmc_91026] 📄 PDF

Bmc_AtomicSType Bmc_Exchange_s(const volatile Bmc_AtomicSType* Object, Bmc_AtomicSType Desired);

Atomically replaces the value pointed to by Object with the value of Desired and returns the value pointed to by Object immediately before the effects.

function Bmc_FetchAdd_u [SWS_Bmc_91027] 📄 PDF

Bmc_AtomicUType Bmc_FetchAdd_u(volatile Bmc_AtomicUType* Object, Bmc_AtomicUType Operand);

Atomically replaces the value pointed to by Object with the result of the addition applied to the value pointed to by Object and the given Operand.

function Bmc_FetchAdd_s [SWS_Bmc_91028] 📄 PDF

Bmc_AtomicSType Bmc_FetchAdd_s(volatile Bmc_AtomicSType* Object, Bmc_AtomicSType Operand);

Atomically replaces the value pointed to by Object with the result of the addition applied to the value pointed to by Object and the given Operand.

function Bmc_FetchAnd_u [SWS_Bmc_91029] 📄 PDF

Bmc_AtomicUType Bmc_FetchAnd_u(volatile Bmc_AtomicUType* Object, Bmc_AtomicUType Operand);

Atomically replaces the value pointed to by Object with the result of the and-operation applied to the value pointed to by Object and the given Operand.

function Bmc_FetchAnd_s [SWS_Bmc_91030] 📄 PDF

Bmc_AtomicSType Bmc_FetchAnd_s(volatile Bmc_AtomicSType* Object, Bmc_AtomicSType Operand);

Atomically replaces the value pointed to by Object with the result of the and-operation applied to the value pointed to by Object and the given Operand.

function Bmc_FetchOr_u [SWS_Bmc_91031] 📄 PDF

Bmc_AtomicUType Bmc_FetchOr_u(volatile Bmc_AtomicUType* Object, Bmc_AtomicUType Operand);

Atomically replaces the value pointed to by Object with the result of the or-operation applied to the value pointed to by Object and the given Operand.

function Bmc_FetchOr_s [SWS_Bmc_91032] 📄 PDF

Bmc_AtomicSType Bmc_FetchOr_s(volatile Bmc_AtomicSType* Object, Bmc_AtomicSType Operand);

Atomically replaces the value pointed to by Object with the result of the or-operation applied to the value pointed to by Object and the given Operand.

function Bmc_FetchSub_u [SWS_Bmc_91033] 📄 PDF

Bmc_AtomicUType Bmc_FetchSub_u(volatile Bmc_AtomicUType* Object, Bmc_AtomicUType Operand);

Atomically replaces the value pointed to by Object with the result of the subtraction applied to the value pointed to by Object and the given Operand.

function Bmc_FetchSub_s [SWS_Bmc_91034] 📄 PDF

Bmc_AtomicSType Bmc_FetchSub_s(volatile Bmc_AtomicSType* Object, Bmc_AtomicSType Operand);

Atomically replaces the value pointed to by Object with the result of the subtraction applied to the value pointed to by Object and the given Operand.

function Bmc_FetchXor_u [SWS_Bmc_91035] 📄 PDF

Bmc_AtomicUType Bmc_FetchXor_u(volatile Bmc_AtomicUType* Object, Bmc_AtomicUType Operand);

Atomically replaces the value pointed to by Object with the result of the xor-operation applied to the value pointed to by Object and the given Operand.

function Bmc_FetchXor_s [SWS_Bmc_91036] 📄 PDF

Bmc_AtomicSType Bmc_FetchXor_s(volatile Bmc_AtomicSType* Object, Bmc_AtomicSType Operand);

Atomically replaces the value pointed to by Object with the result of the xor-operation applied to the value pointed to by Object and the given Operand.

type Bmc_AtomicUType [SWS_Bmc_91016] 📄 PDF

The type shall be used for all unsigned data items, which are used for Bmc library functions.

type Bmc_AtomicSType [SWS_Bmc_91017] 📄 PDF

The type shall be used for all signed data items, which are used for Bmc library functions.

type Bmc_AtomicFlagType [SWS_Bmc_91018] 📄 PDF

The type shall be used for all Flag data items, which are used for Bmc library functions.

requirement SWS_BMC_00001 [SWS_BMC_00001] 📄 PDF

The Bmc module shall provide the following files: C files Bmc_<name>.c used to implement the library. All C files shall be pre-fixed with 'Bmc_'. The header file Bmc.h provides all public function prototypes and types defined by the Bmc library specification.

requirement SWS_BMC_00002 [SWS_BMC_00002] 📄 PDF

DRAFT No error classification definition – like DET error IDs – shall be supported by library.

requirement SWS_BMC_00003 [SWS_BMC_00003] 📄 PDF

DRAFT Error detection: Functions should check at runtime (both in production and in development code) the value of input parameters, especially cases where erroneous value can bring to fatal error or unpredictable result, if they have the values allowed by the function specification. All the error cases shall be listed in SWS and the function should return a specified value (in SWS) that is not configurable. This value is dependent of the function and the error case so it is determined case by case. If values passed to the library routines are not in valid range, out of boundary condition and out of the function specification, then such errors are not detected in the library routines.

requirement SWS_BMC_00004 [SWS_BMC_00004] 📄 PDF

DRAFT The functions shall not call the DET for error notifica- tion.

requirement SWS_BMC_00005 [SWS_BMC_00005] 📄 PDF

The Bmc library shall not require an initialization phase. A Li- brary function may be called at the very first step of ECU initialization, e.g. even by the OS or EcuM, thus the library shall be ready.

requirement SWS_BMC_00007 [SWS_BMC_00007] 📄 PDF

The Bmc API can be directly called from BSW modules or SWCs. No port definition is required. It is a pure function call.

requirement SWS_BMC_00008 [SWS_BMC_00008] 📄 PDF

Using a library should be documented. If a BSW module or a SWC uses a library, the developer should add an ImplementationDependencyOnArti- fact in the BSW/SWC template. minVersion and maxVersion parameters correspond to the supplier version. In case of an AUTOSAR library, these parameters may be left empty because a SWC or BSW module may rely on a library behavior, not on a sup- plier implementation. However, the SWC or BSW modules shall be compatible with the AUTOSAR platform where they are integrated.

requirement SWS_BMC_00009 [SWS_BMC_00009] 📄 PDF

The Bmc library shall be implemented in a way that the code can be shared among callers in different memory partitions.

requirement SWS_BMC_00010 [SWS_BMC_00010] 📄 PDF

Usage of macros should be avoided. The functions should be declared as functions or inline functions.

requirement SWS_BMC_00011 [SWS_BMC_00011] 📄 PDF

A library function shall not call any BSW modules functions, e.g. the DET. A library function can call other library functions because a library function shall be re-entrant. But other BSW modules functions may not be re-entrant.

requirement SWS_BMC_00012 [SWS_BMC_00012] 📄 PDF

The library, written in the C programming language, should con- form to the MISRA C Standard. Please refer to SWS_BSW_00115 for more details.

requirement SWS_BMC_00013 [SWS_BMC_00013] 📄 PDF

Each AUTOSAR library Module implementation <library> * .c and <library> * .h shall map their code to memory sections using the AUTOSAR memory mapping mechanism.

requirement SWS_BMC_00014 [SWS_BMC_00014] 📄 PDF

Each AUTOSAR library Module implementation <library> * .c that uses AUTOSAR integer data types and/or the standard return type, shall include the header file Std_Types.h .

requirement SWS_BMC_00015 [SWS_BMC_00015] 📄 PDF

All AUTOSAR library Modules should use the AUTOSAR data types (integers, boolean) instead of native C data types unless this library is clearly identified to be compliant only with one platform.

requirement SWS_BMC_00016 [SWS_BMC_00016] 📄 PDF

All AUTOSAR library Modules should avoid direct use of com- piler and platform specific keywords unless this library is clearly identified to be com- pliant only with one platform.

requirement SWS_BMC_00017 [SWS_BMC_00017] 📄 PDF

The Bmc module shall provide the C macros ATOMIC_<TYPEMN>_LOCK_FREE which shall expand to constant expressions suit- able for use in #if preprocessing directives and which indicate the lock-free property of the corresponding atomic types. The implemented macros are listed in Table 8.3.

requirement SWS_BMC_00019 [SWS_BMC_00019] 📄 PDF

The function Bmc_FlagTestAndSet atomically sets the value pointed to by Object to TRUE . It returns this value before the operation, i.e., TRUE , if it was already set and FALSE otherwise.

requirement SWS_BMC_00021 [SWS_BMC_00021] 📄 PDF

The function Bmc_FlagClear atomically sets the value pointed to by Object to FALSE .

requirement SWS_BMC_00023 [SWS_BMC_00023] 📄 PDF

The Bmc_Load_<TypeMn> functions atomically load the value pointed to by Object and return it. The implemented functions are listed in Table 8.4.

requirement SWS_BMC_00025 [SWS_BMC_00025] 📄 PDF

The Bmc_Store_<TypeMn> functions atomically replace the value pointed to by Object with the value of Desired. The implemented functions are listed in Table 8.5.

requirement SWS_BMC_00027 [SWS_BMC_00027] 📄 PDF

The Bmc_Exchange_<TypeMn> functions atomically replace the value pointed to by Object with the value of Desired and return the value pointed to by Object immediately before the effects. The implemented functions are listed in Table 8.6.

requirement SWS_BMC_00029 [SWS_BMC_00029] 📄 PDF

The Bmc_CompareExchange_<TypeMn> functions atomically compare the value pointed to by Object for equality with that in Expected, and if true, replace the value pointed to by Object with Desired, and if false, update the value in Expected with the value pointed to by Object. The implemented functions are listed in Table 8.7.

requirement SWS_BMC_00031 [SWS_BMC_00031] 📄 PDF

The Bmc_FetchAdd_<TypeMn> functions atomically replace the value pointed to by Object with the result of the addition applied to the value pointed to by Object and the given Operand and return the value pointed to by Object immedi- ately before the effects. The implemented functions are listed in Table 8.8.

requirement SWS_BMC_00033 [SWS_BMC_00033] 📄 PDF

The Bmc_FetchSub_<TypeMn> functions atomically replace the value pointed to by Object with the result of the subtraction applied to the value pointed to by Object and the given Operand and return the value pointed to by Object immediately before the effects. The implemented functions are listed in Table 8.9.

requirement SWS_BMC_00035 [SWS_BMC_00035] 📄 PDF

The Bmc_FetchOr_<TypeMn> functions atomically replace the value pointed to by Object with the result of the or-operation applied to the value pointed to by Object and the given Operand and return the value pointed to by Object immedi- ately before the effects. The implemented functions are listed in Table 8.10.

requirement SWS_BMC_00037 [SWS_BMC_00037] 📄 PDF

The Bmc_FetchXor_<TypeMn> functions atomically replace the value pointed to by Object with the result of the xor-operation applied to the value pointed to by Object and the given Operand and return the value pointed to by Object immediately before the effects. The implemented functions are listed in Table 8.11.

requirement SWS_BMC_00039 [SWS_BMC_00039] 📄 PDF

The Bmc_FetchAnd_<TypeMn> functions atomically replace the value pointed to by Object with the result of the and-operation applied to the value pointed to by Object and the given Operand and return the value pointed to by Object immediately before the effects. The implemented functions are listed in Table 8.12.

requirement SWS_BMC_00041 [SWS_BMC_00041] 📄 PDF

The function Bmc_ThreadFence creates a sequentially consis- tent acquire and release fence.

requirement SWS_BMC_00043 [SWS_BMC_00043] 📄 PDF

If source code for caller and callee of Bmc_GetVersionInfo is available, the Bmc library should realize Bmc_GetVersionInfo as a macro defined in the module's header file.

requirement SWS_BMC_00044 [SWS_BMC_00044] 📄 PDF

The standardized common published parameters as required by SRS_BSW_00402 in the General Requirements on Basic Software Modules [3] shall be published within the header file of this module and need to be provided in the BSW Module Description. The according module abbreviation can be found in the List of Basic Software Modules

requirement SWS_BMC_00045 [SWS_BMC_00045] 📄 PDF

The Bmc library shall not have any configuration options that may affect the functional behavior of the routines. I.e. for a given set of input parame- ters, the outputs shall be always the same. For example, the returned value in case of error shall not be configurable.

requirement SWS_BMC_00046 [SWS_BMC_00046] 📄 PDF

All load and store routines shall implicitly make use of the feature explicitly introduced by Bmc_ThreadFence .

requirement SWS_BMC_00047 [SWS_BMC_00047] 📄 PDF

All fetch routines shall implicitly make use of the feature explicitly introduced by Bmc_ThreadFence .

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/CP_MOD_Bmc
Status
unspecified
Version
AUTOSAR/AP/record/CP_MOD_Bmc@rel:R20-11#9e90959a
Content hash
9e90959a
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_BSWMulticoreLibrary.pdf#nameddest=SWS_Bmc_91003

Initialization and status

Returns the version information of this library.

void Bmc_GetVersionInfo(Std_VersionInfoType* Versioninfo);

Services · Fetch…

Atomically replaces the value pointed to by Object with the result of the addition applied to the value pointed to by Object and the given Operand.

Bmc_AtomicSType Bmc_FetchAdd_s(volatile Bmc_AtomicSType* Object, Bmc_AtomicSType Operand);

Atomically replaces the value pointed to by Object with the result of the addition applied to the value pointed to by Object and the given Operand.

<Type> Bmc_FetchAdd_<TypeMn>(volatile <Type>* Object, <Type> Operand); ⚠️

Atomically replaces the value pointed to by Object with the result of the addition applied to the value pointed to by Object and the given Operand.

Bmc_AtomicUType Bmc_FetchAdd_u(volatile Bmc_AtomicUType* Object, Bmc_AtomicUType Operand);

Atomically replaces the value pointed to by Object with the result of the and-operation applied to the value pointed to by Object and the given Operand.

Bmc_AtomicSType Bmc_FetchAnd_s(volatile Bmc_AtomicSType* Object, Bmc_AtomicSType Operand);

Atomically replaces the value pointed to by Object with the result of the and-operation applied to the value pointed to by Object and the given Operand.

<Type> Bmc_FetchAnd_<TypeMn>(volatile <Type>* Object, <Type> Operand); ⚠️

Atomically replaces the value pointed to by Object with the result of the and-operation applied to the value pointed to by Object and the given Operand.

Bmc_AtomicUType Bmc_FetchAnd_u(volatile Bmc_AtomicUType* Object, Bmc_AtomicUType Operand);
Bmc_FetchOr_s function

Atomically replaces the value pointed to by Object with the result of the or-operation applied to the value pointed to by Object and the given Operand.

Bmc_AtomicSType Bmc_FetchOr_s(volatile Bmc_AtomicSType* Object, Bmc_AtomicSType Operand);

Atomically replaces the value pointed to by Object with the result of the or-operation applied to the value pointed to by Object and the given Operand.

<Type> Bmc_FetchOr_<TypeMn>(volatile <Type>* Object, <Type> Operand); ⚠️
Bmc_FetchOr_u function

Atomically replaces the value pointed to by Object with the result of the or-operation applied to the value pointed to by Object and the given Operand.

Bmc_AtomicUType Bmc_FetchOr_u(volatile Bmc_AtomicUType* Object, Bmc_AtomicUType Operand);

Atomically replaces the value pointed to by Object with the result of the subtraction applied to the value pointed to by Object and the given Operand.

Bmc_AtomicSType Bmc_FetchSub_s(volatile Bmc_AtomicSType* Object, Bmc_AtomicSType Operand);

Atomically replaces the value pointed to by Object with the result of the subtraction applied to the value pointed to by Object and the given Operand.

<Type> Bmc_FetchSub_<TypeMn>(volatile <Type>* Object, <Type> Operand); ⚠️

Atomically replaces the value pointed to by Object with the result of the subtraction applied to the value pointed to by Object and the given Operand.

Bmc_AtomicUType Bmc_FetchSub_u(volatile Bmc_AtomicUType* Object, Bmc_AtomicUType Operand);

Atomically replaces the value pointed to by Object with the result of the xor-operation applied to the value pointed to by Object and the given Operand.

Bmc_AtomicSType Bmc_FetchXor_s(volatile Bmc_AtomicSType* Object, Bmc_AtomicSType Operand);

Atomically replaces the value pointed to by Object with the result of the xor-operation applied to the value pointed to by Object and the given Operand.

<Type> Bmc_FetchXor_<TypeMn>(volatile <Type>* Object, <Type> Operand); ⚠️

Atomically replaces the value pointed to by Object with the result of the xor-operation applied to the value pointed to by Object and the given Operand.

Bmc_AtomicUType Bmc_FetchXor_u(volatile Bmc_AtomicUType* Object, Bmc_AtomicUType Operand);

Services · Compare…

Atomically compares the value pointed to by Object for equality with that in Expected, and if true, replaces the value pointed to by Object with Desired, and if false, updates the value in Expected with the value pointed to by Object.

boolean Bmc_CompareExchange_s(volatile Bmc_AtomicSType* Object, Bmc_AtomicSType* Expected, Bmc_AtomicSType Desired);

Atomically compares the value pointed to by Object for equality with that in Expected, and if true, replaces the value pointed to by Object with Desired, and if false, updates the value in Expected with the value pointed to by Object.

boolean Bmc_CompareExchange_<TypeMn>(volatile <Type>* Object, <Type>* Expected, <Type> Desired); ⚠️

Atomically compares the value pointed to by Object for equality with that in Expected, and if true, replaces the value pointed to by Object with Desired, and if false, updates the value in Expected with the value pointed to by Object.

boolean Bmc_CompareExchange_u(volatile Bmc_AtomicUType* Object, Bmc_AtomicUType* Expected, Bmc_AtomicUType Desired);

Services · Exchange…

Atomically replaces the value pointed to by Object with the value of Desired and returns the value pointed to by Object immediately before the effects.

Bmc_AtomicSType Bmc_Exchange_s(const volatile Bmc_AtomicSType* Object, Bmc_AtomicSType Desired);

Atomically replaces the value pointed to by Object with the value of Desired and returns the value pointed to by Object immediately before the effects.

<Type> Bmc_Exchange_<TypeMn>(const volatile <Type>* Object, <Type> Desired); ⚠️

Atomically replaces the value pointed to by Object with the value of Desired and returns the value pointed to by Object immediately before the effects.

Bmc_AtomicUType Bmc_Exchange_u(const volatile Bmc_AtomicUType* Object, Bmc_AtomicUType Desired);

Services · Load…

Bmc_Load_s function

Atomically loads the value pointed to by Object and returns it.

Bmc_AtomicSType Bmc_Load_s(const volatile Bmc_AtomicSType* Object);

Atomically loads the value pointed to by Object and returns it.

<Type> Bmc_Load_<TypeMn>(const volatile <Type>* Object); ⚠️
Bmc_Load_u function

Atomically loads the value pointed to by Object and returns it.

Bmc_AtomicUType Bmc_Load_u(const volatile Bmc_AtomicUType* Object);

Services · Store…

Bmc_Store_s function

Atomically replaces the value pointed to by Object with the value of Desired.

void Bmc_Store_s(volatile Bmc_AtomicSType* Object, Bmc_AtomicSType Desired);

Atomically replaces the value pointed to by Object with the value of Desired.

void Bmc_Store_<TypeMn>(volatile <Type>* Object, <Type> Desired); ⚠️
Bmc_Store_u function

Atomically replaces the value pointed to by Object with the value of Desired.

void Bmc_Store_u(volatile Bmc_AtomicUType* Object, Bmc_AtomicUType Desired);

Services · More

Bmc_FlagClear function

Atomically sets the value pointed to by Object to false.

void Bmc_FlagClear(volatile Bmc_AtomicFlagType* Object);

Atomically sets the value pointed to by Object to true.

boolean Bmc_FlagTestAndSet(volatile Bmc_AtomicFlagType* Object);

Creates a sequentially consistent acquire and release fence. An acquire and release fence instruction prevents the memory reordering of any read or write which precedes it in program order with any read or write which follows it in program order.

void Bmc_ThreadFence(void);

Types

The type shall be used for all Flag data items, which are used for Bmc library functions.

The type shall be used for all signed data items, which are used for Bmc library functions.

The type shall be used for all unsigned data items, which are used for Bmc library functions.

Requirements

SWS_BMC_00001 requirement

The Bmc module shall provide the following files: C files Bmc_<name>.c used to implement the library. All C files shall be pre-fixed with 'Bmc_'. The header file Bmc.h provides all public function prototypes and types defined by the Bmc library specification.

SWS_BMC_00002 requirement

DRAFT No error classification definition – like DET error IDs – shall be supported by library.

SWS_BMC_00003 requirement

DRAFT Error detection: Functions should check at runtime (both in production and in development code) the value of input parameters, especially cases where erroneous value can bring to fatal error or unpredictable result, if they have the values allowed by the function specification. All the error cases shall be listed in SWS and the function should return a specified value (in SWS) that is not configurable. This value is dependent of the function and the error case so it is determined case by case. If values passed to the library routines are not in valid range, out of boundary condition and out of the function specification, then such errors are not detected in the library routines.

SWS_BMC_00004 requirement

DRAFT The functions shall not call the DET for error notifica- tion.

SWS_BMC_00005 requirement

The Bmc library shall not require an initialization phase. A Li- brary function may be called at the very first step of ECU initialization, e.g. even by the OS or EcuM, thus the library shall be ready.

SWS_BMC_00006 requirement

The Bmc library shall not require a shutdown operation phase.

SWS_BMC_00007 requirement

The Bmc API can be directly called from BSW modules or SWCs. No port definition is required. It is a pure function call.

SWS_BMC_00008 requirement

Using a library should be documented. If a BSW module or a SWC uses a library, the developer should add an ImplementationDependencyOnArti- fact in the BSW/SWC template. minVersion and maxVersion parameters correspond to the supplier version. In case of an AUTOSAR library, these parameters may be left empty because a SWC or BSW module may rely on a library behavior, not on a sup- plier implementation. However, the SWC or BSW modules shall be compatible with the AUTOSAR platform where they are integrated.

SWS_BMC_00009 requirement

The Bmc library shall be implemented in a way that the code can be shared among callers in different memory partitions.

SWS_BMC_00010 requirement

Usage of macros should be avoided. The functions should be declared as functions or inline functions.

SWS_BMC_00011 requirement

A library function shall not call any BSW modules functions, e.g. the DET. A library function can call other library functions because a library function shall be re-entrant. But other BSW modules functions may not be re-entrant.

SWS_BMC_00012 requirement

The library, written in the C programming language, should con- form to the MISRA C Standard. Please refer to SWS_BSW_00115 for more details.

SWS_BMC_00013 requirement

Each AUTOSAR library Module implementation <library> * .c and <library> * .h shall map their code to memory sections using the AUTOSAR memory mapping mechanism.

SWS_BMC_00014 requirement

Each AUTOSAR library Module implementation <library> * .c that uses AUTOSAR integer data types and/or the standard return type, shall include the header file Std_Types.h .

SWS_BMC_00015 requirement

All AUTOSAR library Modules should use the AUTOSAR data types (integers, boolean) instead of native C data types unless this library is clearly identified to be compliant only with one platform.

SWS_BMC_00016 requirement

All AUTOSAR library Modules should avoid direct use of com- piler and platform specific keywords unless this library is clearly identified to be com- pliant only with one platform.

SWS_BMC_00017 requirement

The Bmc module shall provide the C macros ATOMIC_<TYPEMN>_LOCK_FREE which shall expand to constant expressions suit- able for use in #if preprocessing directives and which indicate the lock-free property of the corresponding atomic types. The implemented macros are listed in Table 8.3.

SWS_BMC_00019 requirement

The function Bmc_FlagTestAndSet atomically sets the value pointed to by Object to TRUE . It returns this value before the operation, i.e., TRUE , if it was already set and FALSE otherwise.

SWS_BMC_00021 requirement

The function Bmc_FlagClear atomically sets the value pointed to by Object to FALSE .

SWS_BMC_00023 requirement

The Bmc_Load_<TypeMn> functions atomically load the value pointed to by Object and return it. The implemented functions are listed in Table 8.4.

SWS_BMC_00025 requirement

The Bmc_Store_<TypeMn> functions atomically replace the value pointed to by Object with the value of Desired. The implemented functions are listed in Table 8.5.

SWS_BMC_00027 requirement

The Bmc_Exchange_<TypeMn> functions atomically replace the value pointed to by Object with the value of Desired and return the value pointed to by Object immediately before the effects. The implemented functions are listed in Table 8.6.

SWS_BMC_00029 requirement

The Bmc_CompareExchange_<TypeMn> functions atomically compare the value pointed to by Object for equality with that in Expected, and if true, replace the value pointed to by Object with Desired, and if false, update the value in Expected with the value pointed to by Object. The implemented functions are listed in Table 8.7.

SWS_BMC_00031 requirement

The Bmc_FetchAdd_<TypeMn> functions atomically replace the value pointed to by Object with the result of the addition applied to the value pointed to by Object and the given Operand and return the value pointed to by Object immedi- ately before the effects. The implemented functions are listed in Table 8.8.

SWS_BMC_00033 requirement

The Bmc_FetchSub_<TypeMn> functions atomically replace the value pointed to by Object with the result of the subtraction applied to the value pointed to by Object and the given Operand and return the value pointed to by Object immediately before the effects. The implemented functions are listed in Table 8.9.

SWS_BMC_00035 requirement

The Bmc_FetchOr_<TypeMn> functions atomically replace the value pointed to by Object with the result of the or-operation applied to the value pointed to by Object and the given Operand and return the value pointed to by Object immedi- ately before the effects. The implemented functions are listed in Table 8.10.

SWS_BMC_00037 requirement

The Bmc_FetchXor_<TypeMn> functions atomically replace the value pointed to by Object with the result of the xor-operation applied to the value pointed to by Object and the given Operand and return the value pointed to by Object immediately before the effects. The implemented functions are listed in Table 8.11.

SWS_BMC_00039 requirement

The Bmc_FetchAnd_<TypeMn> functions atomically replace the value pointed to by Object with the result of the and-operation applied to the value pointed to by Object and the given Operand and return the value pointed to by Object immediately before the effects. The implemented functions are listed in Table 8.12.

SWS_BMC_00041 requirement

The function Bmc_ThreadFence creates a sequentially consis- tent acquire and release fence.

SWS_BMC_00043 requirement

If source code for caller and callee of Bmc_GetVersionInfo is available, the Bmc library should realize Bmc_GetVersionInfo as a macro defined in the module's header file.

SWS_BMC_00044 requirement

The standardized common published parameters as required by SRS_BSW_00402 in the General Requirements on Basic Software Modules [3] shall be published within the header file of this module and need to be provided in the BSW Module Description. The according module abbreviation can be found in the List of Basic Software Modules

SWS_BMC_00045 requirement

The Bmc library shall not have any configuration options that may affect the functional behavior of the routines. I.e. for a given set of input parame- ters, the outputs shall be always the same. For example, the returned value in case of error shall not be configurable.

SWS_BMC_00046 requirement

All load and store routines shall implicitly make use of the feature explicitly introduced by Bmc_ThreadFence .

SWS_BMC_00047 requirement

All fetch routines shall implicitly make use of the feature explicitly introduced by Bmc_ThreadFence .

SWS_BMC_00999 requirement

These requirements are not applicable to this specification.