Autosar Sws Os
Autosar Sws Os
AUTOSAR CP R21-11
Specification of Operating
Document Title System
Document Owner AUTOSAR
Document Responsibility AUTOSAR
Document Identification No 34
Disclaimer
This work (specification and/or software implementation) and the material contained in
it, as released by AUTOSAR, is for the purpose of information only. AUTOSAR and the
companies that have contributed to it shall not be liable for any use of the work.
The material contained in this work is protected by copyright and other types of intel-
lectual property rights. The commercial exploitation of the material contained in this
work requires a license to such intellectual property rights.
This work may be utilized or reproduced without any modification, in any form or by
any means, for informational purposes only. For any other purpose, no part of the work
may be utilized or reproduced, in any form or by any means, without permission in
writing from the publisher.
The work has been developed for automotive applications only. It has neither been
developed, nor tested for non-automotive applications.
The word AUTOSAR and the AUTOSAR logo are registered trademarks.
Table of Contents
1 Introduction and functional overview 15
7 Functional specification 37
7.1 Core OS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
7.1.1 Background & Rationale . . . . . . . . . . . . . . . . . . . . 37
7.1.2 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . 37
7.1.2.1 Restrictions on OSEK OS . . . . . . . . . . . . . . . 38
7.1.2.2 Undefined Behaviour in OSEK OS . . . . . . . . . . 38
7.1.2.3 Extensions to OSEK OS . . . . . . . . . . . . . . . . 39
7.2 Software Free Running Timer . . . . . . . . . . . . . . . . . . . . . . . 39
7.3 ScheduleTables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
7.3.1 Background & Rationale . . . . . . . . . . . . . . . . . . . . 40
7.3.2 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . 41
7.3.2.1 Structure of a ScheduleTable . . . . . . . . . . . . 41
7.3.2.2 Constraints on Expiry Points . . . . . . . . . . . . . . 41
7.9.3.1 Requirements . . . . . . . . . . . . . . . . . . . . . . 81
7.9.4 Multi-Core start-up concept . . . . . . . . . . . . . . . . . . . 82
7.9.4.1 Requirements . . . . . . . . . . . . . . . . . . . . . . 84
7.9.5 Cores under control of the AUTOSAR OS . . . . . . . . . . . 85
7.9.5.1 Requirements . . . . . . . . . . . . . . . . . . . . . . 85
7.9.6 Cores which are not controlled by the AUTOSAR OS . . . . 85
7.9.6.1 Requirements . . . . . . . . . . . . . . . . . . . . . . 86
7.9.7 Multi-Core shutdown concept . . . . . . . . . . . . . . . . . . 86
7.9.7.1 Synchronized shutdown concept . . . . . . . . . . . 86
7.9.7.2 Individual shutdown concept . . . . . . . . . . . . . . 87
7.9.7.3 Shutdown in case of fatal internal errors . . . . . . . 87
7.9.8 OS service functionality (overview) . . . . . . . . . . . . . . . 88
7.9.9 GetTaskID . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
7.9.10 Interrupt disabling . . . . . . . . . . . . . . . . . . . . . . . . 90
7.9.10.1 Requirements . . . . . . . . . . . . . . . . . . . . . . 90
7.9.11 Task activation . . . . . . . . . . . . . . . . . . . . . . . . . 90
7.9.11.1 Requirements . . . . . . . . . . . . . . . . . . . . . . 91
7.9.12 Task Chaining . . . . . . . . . . . . . . . . . . . . . . . . . . 91
7.9.12.1 Requirements . . . . . . . . . . . . . . . . . . . . . . 91
7.9.13 Event setting . . . . . . . . . . . . . . . . . . . . . . . . . . 91
7.9.13.1 Requirements . . . . . . . . . . . . . . . . . . . . . . 92
7.9.14 Activating additional cores . . . . . . . . . . . . . . . . . . . 92
7.9.15 Start of the OS . . . . . . . . . . . . . . . . . . . . . . . . . . 92
7.9.15.1 Requirements . . . . . . . . . . . . . . . . . . . . . . 93
7.9.16 Task termination . . . . . . . . . . . . . . . . . . . . . . . . 93
7.9.16.1 Requirements . . . . . . . . . . . . . . . . . . . . . . 93
7.9.17 Termination of OS-Applications . . . . . . . . . . . . . . . . . 94
7.9.17.1 Requirements . . . . . . . . . . . . . . . . . . . . . . 94
7.9.18 Shutdown of the OS . . . . . . . . . . . . . . . . . . . . . . . 94
7.9.18.1 Requirements . . . . . . . . . . . . . . . . . . . . . . 94
7.9.19 Waiting for Events . . . . . . . . . . . . . . . . . . . . . . . 95
7.9.19.1 Requirements . . . . . . . . . . . . . . . . . . . . . . 95
7.9.20 Calling trusted functions . . . . . . . . . . . . . . . . . . . . . 95
7.9.20.1 Requirements . . . . . . . . . . . . . . . . . . . . . . 95
7.9.21 Invoking reschedule . . . . . . . . . . . . . . . . . . . . . . . 96
7.9.21.1 Requirements . . . . . . . . . . . . . . . . . . . . . . 96
7.9.22 Resource handling . . . . . . . . . . . . . . . . . . . . . . . 96
7.9.23 The CoreID . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
7.9.23.1 Requirements . . . . . . . . . . . . . . . . . . . . . . 97
7.9.24 Counters, background & rationale . . . . . . . . . . . . . . 97
7.9.25 Multi-Core restrictions on Counters . . . . . . . . . . . . . . 98
7.9.25.1 Requirements . . . . . . . . . . . . . . . . . . . . . . 98
7.9.26 Synchronization of Counters . . . . . . . . . . . . . . . . . 99
7.9.27 Alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
7.9.27.1 Requirements . . . . . . . . . . . . . . . . . . . . . . 100
7.9.28 ScheduleTables . . . . . . . . . . . . . . . . . . . . . . . . 101
4
Abbreviation Description
HW Hardware
ID Identifier
IOC Inter OS-Application communicator
ISR Interrupt Service Routine
LE A locatable entity is a distinct piece of software that has the same effect
regardless of which core it is located.
MC Multi-Core
MCU Microcontroller Unit
ME Mutual exclusion
MPU Memory Protection Unit
NMI Non maskable interrupt
OIL OSEK Implementation Language
OS Operating System
OSEK/VDX Offene Systeme und deren Schnittstellen für die Elektronik im Kraftfahrzeug
RTE Run-Time Environment
RTOS Real Time Operating System
SC Single-Core
SLA Software Layered Architecture
SW Software
SWC Software Component
SWFRT Software FreeRunningTimer
Term Definition
Access Right An indication that an object (e.g. Task, ISR, hook function) of an OS-Application has the permission
of access or manipulation with respect to memory, OS services or (set of) OS objects.
Cardinality The number of items in a set.
Counter An operating system object that registers a count in ticks. There are two types of counters:
Hardware A Counter that is advanced by hardware (e.g. timer). The count value is
Counter maintained by the peripheral "in hardware".
Software A Counter which is incremented by making the IncrementCounter API call
Counter (see [SWS_Os_00399]). The count value is maintained by the operating system
"in software".
Deadline The time at which a Task/Category 2 ISR must reach a certain point during its execution defined by
system design relative to the stimulus that triggered activation. See figure 2.1
5
4
Term Definition
Delay The number of ticks between two adjacent expiry points on a ScheduleTable.
A pair of expiry points X and Y are said to be adjacent when:
• There is no expiry point Z such that X.Offset < Z.Offset < Y.Offset. In this case the Delay =
Y.Offset-X.Offset
• X and Y are the Final Expiry Point and the Initial Expiry Point respectively. In this case Delay
= (Duration-X.Offset)+Y.Offset
When used in the text, Delay is a relative number of ticks measured from a specified expiry point.
For example: X.Delay is the delay from X to the next expiry point.
Deviation The minimum number of ticks between the current position on an explicitly synchronized
ScheduleTable and the value of the synchronization count modulo the duration of the
ScheduleTable.
Duration The number of ticks from a notional zero at which a ScheduleTable wraps.
Execution Time Tasks: The net time a Task spends in the RUNNING state without entering the SUSPENDED or
WAITING state excluding all preemptions due to ISRs which preempt the Task. An extended Task
executing the WaitEvent API call to wait on an Event which is already set notionally enters the
WAITING state. For multiple activated basic Tasks the net time is per activation of a Task.
ISRs: The net time from the first to the last instruction of the user provided Category 2 interrupt
handler excluding all preemptions due to higher priority ISRs executing in preference.
Execution time includes the time spent in the error, pretask and posttask hooks and the time spent
making OS service calls.
Execution Budget Maximum permitted execution time for a Task/ISR.
Expiry Point The offset on a ScheduleTable, measured from zero, at which the OS activates Tasks and/or
sets Events.
Initial Expiry The expiry point with the smallest offset
Point
Final Expiry The expiry point with the largest offset
Point
Hook Function A Hook function is implemented by the user and invoked by the operating system in the case of
certain incidents. In order to react to these on system or application level, there are two kinds of
hook functions
Application- Hook functions within the scope of an individual OS-Application.
specific
System-specific Hook functions within the scope of the complete system (in general provided by
the integrator).
Initial Offset The smallest expiry point offset on a ScheduleTable. This can be zero.
Interarrival Time Basic Tasks: The time between successively entering the READY state from the SUSPENDED state.
Activation of a Task always represents a new arrival. This applies in the case of multiple activations,
even if an existing instance of the Task is in the RUNNING or READY state.
Extended Tasks: The time between successively entering the READY state from the SUSPENDED or
WAITING states. Setting an Event for a Task in the WAITING state represents a new arrival if the
Task is waiting on the Event. Waiting for an Event in the RUNNING state which is already set
represents a new arrival.
ISRs: The time between successive occurrences of an interrupt.
See figure 2.1
Interrupt Lock Time The time for which a Task/ISR executes with Category 1 interrupts disabled/suspended and/or
Category 2 interrupts disabled/suspended .
Interrupt Source Enable The switch which enables a specific interrupt source in the hardware.
Interrupt Vector Table Conceptually, the interrupt vector table contains the mapping from hardware interrupt requests to
(software) interrupt service routines. The real content of the Interrupt Vector Table is very hardware
specific, e.g. it can contain the start addresses of the interrupt service routines.
Final Delay The difference between the Final Expiry Point offset and the duration on a ScheduleTable in ticks.
This value defines the delay from the Final Expiry Point to the logical end of the ScheduleTable
for single-shot and "nexted" ScheduleTables.
5
4
Term Definition
Forced OS-Application The operating system frees all system objects, e.g. forcibly terminates Tasks, disables interrupts,
Termination etc., which are associated to the OS-Application. OS-Application and internal variables are
potentially left in an undefined state.
Forced Termination The OS terminates the Task/Category 2 ISR and does "unlock" it’s held resources. For details see
[SWS_Os_00108] and [SWS_Os_00109].
Linker File File containing linking settings for the linker. The syntax of the linker file depends on the specific
linker and, consequently, definitions are stored "linker-specific" in the linker file.
Lock Budget Maximum permitted Interrupt Lock Time or Resource Lock Time.
Master core A master core is a core from which the AUTOSAR system is bootstrapped.
Memory Protection Unit A Memory Protection Unit (MPU) enables memory partitioning with individual protection attributes.
This is distinct from a Memory Management Unit (MMU) that provides a mapping between virtual
addresses and physical memory locations at runtime.
Note that some devices may realize the functionality of an MPU in an MMU.
Mode Describes the permissions available on a processor.
Privileged In general, in "privileged mode" unrestricted access is available to memory as
well as the underlying hardware.
Non-privileged In "non-privileged mode" access is restricted.
Modulus The number of ticks required to complete a full wrap of an OSEK Counter. This is equal to
OsCounterMaxAllowedValue +1 ticks of the Counter.
OS-Application A collection of OS objects
Trusted An OS-Application that may be executed in privileged mode and may have
unrestricted access to the API and hardware resources. Only trusted
applications can provide trusted functions.
Non-trusted An OS-Application that is executed in non-privileged mode has restricted access
to the API and hardware resources.
OS object Object that belongs to a single OS-Application: Task, ISR, Alarm, Event, ScheduleTable,
Resource, Trustedfunction, Counter, application-specific hook.
OS Service OS services are the API of the operating system.
Protection Error Systematic error in the software of an OS-Application.
Memory access A protection error caused by access to an address in a manner for which no
violation access right exists.
Timing fault A protection error that violates the timing protection.
Illegal service A protection error that violates the service protection, e.g. unauthorized call to
OS service.
Hardware division by zero, illegal instruction etc.
exception
Resource Lock Time The time an OSEK Resource is held by a Task/ISR (excluding the preemptions of the Task/ISR
by higher prior Tasks/ISRs).
Response Time The time between a Task/ISR being made ready to execute and generating a specified response.
The time includes all preemptions. See figure 2.1
Restart an An OS-Application can be restarted after self-termination or being forcibly terminated because of a
OS-Application protection error. When an OS-Application is restarted, the OS activates the configured
OsRestartTask.
Scalability Class The features of the OS (e.g. Memory Protection or Timing Protection), described by this document,
can be grouped together to customize the operating system to the needs of the application. There
are 4 defined groups of features which are named scalability classes. For details see Chapter 7.11
ScheduleTable Encapsulation of a statically defined set of expiry points.
Section Part of an object file in which instructions or data are combined to form a unit (contiguous address
space in memory allocated for data or code). A section in an object file (object file format) has a
name and a size.
From the linker perspective, two different sides can be distinguished:
5
4
Term Definition
Input section memory section in an input object file of the linker.
Output section memory section in an output object file of the linker.
Set (of OS objects) This document uses the term set, indicating a collection of the same type of OS objects, in the strict
mathematical sense, i.e.:
- a set contains zero or more OS objects (this means a set can be empty)
- the OS objects in the set are unique (this means there cannot be duplicate OS objects in the set)
Spinlock A spinlock is a locking mechanism where the Task waits in a loop (spins) repeatedly checking for a
shared variable to become a certain value.
The value indicates whether the lock is free or not. In Multi-Core systems the comparison and
changing of the variable typically requires an atomic operation.
As the Task remains active but is not doing anything useful, a spinlock is a busy waiting mechanism
Spinlock variable A spinlock variable is a shared variable used by a spinlock to indicate whether a spinlock is free or
occupied.
Symbol Address label that can be imported/used by software modules and resolved by the linker. The
precise syntax of the labels is linker-specific. Here, these address labels are used to identify the
start and end of memory sections.
Start symbol Tags the start of a memory section
End symbol Tags the end of a memory section
Synchronization of Synchronization with a synchronization Counter is achieved, if the expiry points of the
ScheduleTables with ScheduleTable are processed within an absolute deviation from the synchronization Counter
a synchronization that is smaller than or equal to a precision threshold.
Counter
Synchronization The "Synchronization Counter", distinct from an OS Counter object, is an external Counter,
Counter external to the OS, against which expiry points of a ScheduleTable are synchronized
Task A Task is the object which executes (user) code and which is managed by the OS. E.g. the OS
switches between different Tasks (schedules). There are 2 types of Tasks; for more details see [2].
Basic Task A Task which cannot block by itself. This means that it cannot wait for (OS)
Event(s).
Extended Task A Task which can block by itself and wait for (OS) Event(s).
Time Frame The minimum inter-arrival time for a Task/ISR.
Trustedfunction A service provided by a trusted OS-Application that can be used by other OS-Applications (trusted
or non-trusted).
Worst case execution The longest possible execution time.
time (WCET)
Write access Storing a value in a register or memory location. All memory accesses that have the consequence
of writing (e.g. reads that have the side effect of writing to a memory location) are treated as write
accesses.
3 Related documentation
[8] ISO 17356-6: Road vehicles – Open interface for embedded automotive applica-
tions – Part 6: OSEK/VDX Implementation Language (OIL)
[9] Specification of AUTOSAR Run-Time Interface
AUTOSAR_SWS_ClassicPlatformARTI
[10] Specification of RTE Software
AUTOSAR_SWS_RTE
[11] Software Component Template
AUTOSAR_TPS_SoftwareComponentTemplate
[12] Specification of Memory Mapping
AUTOSAR_SWS_MemoryMapping
4.2 Terminology
The specification uses the following operators when requirements specify multiple
terms:
• NOT : negation of a single term e.g. NOT Weekend
• AND : conjunction of two terms e.g. Weekend AND Saturday
• OR : disjunction of two terms e.g. Monday OR Tuesday
A requirement comprising multiple terms is evaluated left to right. The precedence
rules are:
• Highest Precedence NOT
• Lowest Precedence AND OR
The expression NOT X AND Y means (NOT X) AND (Y)
Where operators of the same precedence are used in the same sentence, commas are
used to disambiguate. The expression X AND Y, OR Z means (X AND Y) OR Z.
There are currently several existing and suggested HW-architectures1 for Multi-Core
microprocessors. There is considerable variation in the features offered by these ar-
chitectures. Therefore this section attempts to capture a common set of architectural
features required for Multi-Core.
Hardware assumptions shall remain assumptions and shall not become official
AUTOSAR requirements.
• Shared RAM is available to all cores; at least all cores can share a substantial
part of the memory.
1
In this context "architecture" encompasses: the connections between cores and memory, and to
peripherals and how interrupts work.
• Flash shall be shared between all cores at least. However, performance can be
improved if Flash/RAM can be partitioned so that there are separate pathways
from cores to Flash.
• A single address space is assumed, at least in the shared parts of the memory
address space.
• The AUTOSAR Multi-Core architecture shall be capable to run on systems that
do and do not support memory protection. If memory protection exists, all cores
are covered by a hardware-based memory protection.
4.6 Limitations
4.6.1 Hardware
The core AUTOSAR operating system assumes free access to hardware resources,
which are managed by the OS itself. This includes, but is not limited to, the following
hardware:
• interrupt control registers
• processor status words
• stack pointer(s)
Specific (extended) features of the core operating system extend the requirements on
hardware resource. The following list outlines the features that have requirements on
the hardware. Systems that do not use these OS features do not have these hardware
requirements.
• Memory Protection: A hardware memory protection unit is required. All memory
accesses that have the consequence of writing (e.g. reads that have the side
effect of writing to a memory location) shall be treated as writes.
• Time Protection: Timer Hardware for monitoring execution times and arrival rates.
• Privileged and non-privileged modes on the MCU: to protect the OS against in-
ternal corruption caused by writes to OS controlled registers. This mode must
not allow OS-Applications to circumvent protection (e.g. write registers which
govern memory protection, write to processor status word etc.). The privileged
mode must be under full control of the protected OS which uses the mode inter-
nally and to transfer control back and forth from a non-trusted OS-Application to
a trusted OS-Application. The microprocessor must support a controlled means
which moves a processor into this privileged mode.
• Local/Global Time Synchronization: A global time source is needed.
In general hardware failures in the processor are not detected by the operating system.
In the event of hardware failure, correct operation of the OS cannot be guaranteed.
The resources managed by a specific OS implementation have to be defined within the
appropriate configuration file of the OS.
The API of the operating system is defined as C function calls or macros. If other
languages are used, they must adapt to the C interface.
4.6.3 Miscellaneous
The operating system does not provide services for dynamic memory management.
The code file structure of the Operating System module is not fixed, besides the re-
quirements in the [6, General SRS].
The IOC generator generates an additional header file Ioc.h. Users of the Ioc.h shall
include the Ioc.h file. If an implementation of the IOC requires additional header files, it
is free to include them. The header files are self-contained, that means they will include
all other header files, which they require.
To support ARTI based debugging and tracing, all source files with ARTI hook macros
shall include an "arti.h" file. This file (along with the corresponding arti.c file) will be
provided by the ARTI hook implementer, i.e. the tracing tool. When building the final
executable, the linker will pull in the compiled arti.c file, too.
The usage of the ARTI hook macros is configurable. If the OS is configured to not
use ARTI, the inclusion of "arti.h" may be omitted, and the ARTI hooks macros may be
expanded to empty macros (nothing).
6 Requirements Tracing
The following tables reference the requirements specified in [6, SRS BSW General], [7,
SRS FreeRunningTimer] and [1, SRS OS] and links to the fulfillment of these. Please
note that if column “Satisfied by” is empty for a specific requirement this means that
this requirement is not fulfilled by this document.
7 Functional specification
7.1 Core OS
The OSEK/VDX Operating System [2] is widely used in the automotive industry and
has been proven in use in all classes of ECUs found in modern vehicles. The concepts
that OSEK OS has introduced are widely understood and the automotive industry has
many years of collective experience in engineering OSEK OS based systems.
OSEK OS is an event-triggered operating system. This provides high flexibility in the
design and maintenance of AUTOSAR based systems. Event triggering gives free-
dom for the selection of the events to drive scheduling at runtime, for example angular
rotation, local time source, global time source, error occurrence etc.
For these reasons the core functionality of the AUTOSAR OS shall be based upon the
OSEK OS. In particular OSEK OS provides the following features to support concepts
in AUTOSAR:
• fixed priority-based scheduling
• facilities for handling interrupts
• only interrupts with higher priority than Tasks
• some protection against incorrect use of OS services
• a startup interface through StartOS and the StartupHook
• a shutdown interface through ShutdownOS and the ShutdownHook
OSEK OS provides many features in addition to these. Readers should consult the
specification [2] for details.
Basing AUTOSAR OS on OSEK OS means that legacy applications will be backward
compatible - i.e. applications written for OSEK OS will run on AUTOSAR OS. However,
some of the features introduced by AUTOSAR OS require restrictions on the use of
existing OSEK OS features or extend existing OSEK OS features.
7.1.2 Requirements
[SWS_Os_00001] dThe Operating System module shall provide an API that is back-
ward compatible with the OSEK OS API [2].c(SRS_Os_00097)
It is too inefficient to achieve timing and memory protection for alarm callbacks. They
are therefore not allowed in specific scalability classes ([SWS_Os_00242])
[SWS_Os_00242] dThe Operating System module shall only allow Alarm Callbacks
in Scalability Class 1.c()
OSEK OS is required to provide functionality to handle inter-task (internal) communi-
cation according to the OSEK COM specification when internal communication only
is required in the system. In AUTOSAR, internal communication is provided by the
AUTOSAR RTE or by AUTOSAR COM at least one of which will be present for all
AUTOSAR ECUs.
AUTOSAR OS, when used in an AUTOSAR system, therefore does not need to support
internal communication.
An OSEK OS must implement internal communication if the symbol LOCALMES-
SAGESONLY is defined. AUTOSAR OS can deprecate the need to implement OSEK
COM functionality and maintain compatibility with OSEK suite of specifications by
ensuring that AUTOSAR OS always exists in an environment where LOCALMES-
SAGESONLY is undefined.
OSEK OS has one special Resource called RES_SCHEDULER. This Resource has 2
specific aspects:
1. It is always present in the system, even if it is not configured. This means that the
RES_SCHEDULER is always known by the OS.
2. It has always the highest Task priority. This means a Task which allocates this
Resource cannot be preempted by other Tasks.
Since special cases are always hard to handle (e.g. in this case with respect to timing
protection) AUTOSAR OS handles RES_SCHEDULER as any other Resource. This
means that the RES_SCHEDULER is not automatically created.
Note that on multi-core systems the scheduling happens per core. Chapter 7.9.22
contains more information regarding handling of Resources in such systems.
In OSEK OS users must declare Operating System objects with specific macros (e.g.
DeclareTask(), . . . ) An AUTOSAR OS implementation shall not depend on such
declarations and shall (for backwards compatibility) supply macros without functionality.
There are a number of cases where the behaviour of OSEK OS is undefined. These
cases represent a barrier to portability. AUTOSAR OS tightens the OSEK OS specifi-
cation by defining the required behaviour.
[SWS_Os_00299] dThe Operating System module shall provide the services Dis-
ableAllInterrupts, EnableAllInterrupts, SuspendAllInterrupts, Re-
sumeAllInterrupts prior to calling StartOS and after calling ShutdownOS.c
(SRS_Os_11018)
It is assumed that the static variables of the functions mentioned in [SWS_Os_00299]
are initialized.
[SWS_Os_00301] dThe Operating System module shall provide the ability to incre-
ment a software Counter as an alternative action on alarm expiry.c(SRS_Os_11021)
The Operating System module provides API service IncrementCounter (see
[SWS_Os_00399]) to increment a software Counter.
[SWS_Os_00476] dThe Operating System module shall allow to automatically start
preconfigured absolute alarms during the start of the Operating System.c()
[SWS_Os_00476] is an extension to OSEK OS which allows this only for relative
alarms.
[SWS_Os_00566] dThe Operating System API shall check in extended mode all
pointer arguments for a NULL pointer and return E_OS_PARAM_POINTER in extended
status if such an argument is NULL.c()
hardware timer ticks if Counter is driven by hardware or the software ticks when user
drives Counter).
The Operating System module provides API service GetElapsedValue (see
[SWS_Os_00392]) to get the number of ticks between the current tick value and a
previously read tick value.
[SWS_Os_00384] dThe Operating System module shall adjust the read out values of
hardware timers (which drive counters) in such that the lowest value is zero and con-
secutive reads return an increasing count value until the timer wraps at its modulus.c
(SRS_Frt_00030, SRS_Frt_00031)
7.3 ScheduleTables
7.3.2 Requirements
There is no use case for an empty expiry point, so each one must define at least one
action.
[SWS_Os_00407] dAn expiry point shall activate at least one Task OR set at least one
event.c()
The OS needs to know the order in which expiry points are processed. It is therefore
necessary to ensure that the expiry points on a ScheduleTable can be totally or-
dered. This is guaranteed by forcing each expiry point on a ScheduleTable to have
a unique offset.
[SWS_Os_00442] dEach expiry point on a given ScheduleTable shall have a unique
offset.c()
[SWS_Os_00002] dThe Operating System module shall process each expiry point on
a ScheduleTable from the Initial Expiry Point to the Final Expiry Point in order of
increasing offset.c(SRS_Os_00098)
[SWS_Os_00007] dThe Operating System module shall permit multiple Sched-
uleTables to be processed concurrently.c(SRS_Os_00098)
[SWS_Os_00409] dA ScheduleTable of the Operating System module shall be
driven by exactly one Counter.c()
[SWS_Os_00410] dThe Operating System module shall be able to process at least
one ScheduleTable per Counter at any given time.c()
[SWS_Os_00411] dThe Operating System module shall make use of ticks so that one
tick on the Counter corresponds to one tick on the ScheduleTable.c()
It is possible to activate a Task and set (one or more unique) Events for the same
Task at the same expiry point. The ordering of Task activations and event settings
performed from the expiry point could lead to different implementations exhibiting differ-
ent behaviour (for example, activating a suspended Task and then setting and event on
the Task would succeed but if the ordering was reversed then the event setting would
fail). To prevent such non-determinism, it is necessary to enforce a strict ordering of
actions on the expiry point.
[SWS_Os_00412] dIf an expiry point contains actions to activate a Task and to set one
or several Event(s) of the same Task, then the Operating System module shall pro-
cess this Task activation before the related Event(s) are set. No further assumptions
about the order for the processing of expiry points can be made.c()
A ScheduleTable always has a defined state and the following figure illustrates the
different states (for a non-synchronized ScheduleTable) and the transitions between
them.
If a ScheduleTable is not active - this means that is not processed by the Op-
erating System - the state is SCHEDULETABLE_STOPPED. After starting a Sched-
uleTables enters the SCHEDULETABLE_RUNNING state where the OS processes the
expiry points. If the service to switch a ScheduleTable is called a ScheduleTable
enters the SCHEDULETABLE_NEXT state and waits until the "current" ScheduleTable
ends.
A ScheduleTable may or may not repeat after the final expiry point is processed.
This allows two types of behaviour:
1. single-shot - the ScheduleTable processes each expiry point in sequence and
then stops at the end. This is useful for triggering a phased sequence of actions
in response to some trigger
2. repeating - the ScheduleTable processes each expiry point in turn, after pro-
cessing the final expiry point, it loops back to the initial expire point. This is useful
for building applications that perform repeated processing or system which need
to synchronize processing to a driver source.
A repeating ScheduleTable means that each expiry point is repeated at a period
equal to the ScheduleTable duration.
[SWS_Os_00413] dThe ScheduleTable shall be configurable as either single-shot
or repeating.c()
The application is responsible for starting and stopping the processing of a Sched-
uleTable.
The Operating System module provides the service StartScheduleTableAbs (see
[SWS_Os_00358]) to start the processing of a ScheduleTable at an absolute value
"Start" on the underlying Counter. (The Initial Expiry Point has to be processed when
the value of the underlying Counter equals Start + InitialOffset).
The Operating System module provides the service StartScheduleTableRel (see
[SWS_Os_00347]) to start the processing of a ScheduleTable at "Offset" relative to
the "Now" value on the underlying Counter (The Initial Expiry Point shall be processed
when the value of the underlying Counter equals Now + Offset + InitialOffset).
The figure below illustrates the two different methods for a ScheduleTable driven
by a Counter with a modulus of 65536 (i.e. an OsCounterMaxAllowedValue =
65535).
The absolute time at which the Initial Expiry Point on a ScheduleTable is processed
is under user control. However, if the ScheduleTable repeats then it is not guaran-
teed that the absolute count value at which the initial expiry point was first processed
is the same count value at which it is subsequently processed. This is because the
duration of the ScheduleTable need not be equal to the Counter modulus.
In many cases it may be important that ScheduleTable expiry points are processed
at specific absolute values of the underlying Counter. This is called synchronization.
Typical use-cases include:
• Synchronization of expiry points to degrees of angular rotation for motor manage-
ment
• Synchronizing the computation to a global (network) time base. Note that in
AUTOSAR, the Operating System does not provide a global (network) time
source because
1. a global time may not be needed in many cases
2. other AUTOSAR modules, most notably FlexRay, provide this independently
to the Operating System
3. if the Operating System is required to synchronize to multiple global (net-
work) time sources (for example when building a gateway between two time-
triggered networks) the Operating System cannot be the source of a unique
global time.
AUTOSAR OS provides support for synchronization in two ways:
• implicit synchronization - the Counter driving the ScheduleTable is the
Counter with which synchronization is required. This is typically how syn-
chronization with time-triggered networking technologies (e.g. FlexRay, TTP) is
achieved - the underlying hardware manages network time synchronization and
simply presents time as an output/compare timer interface to the Operating Sys-
tem. The following figure shows the possible states for ScheduleTables with
implicit synchronization.
Figure 7.5: States of an explicit synchronized ScheduleTable (not all conditions for
transitions are shown in the picture)
7.4.2 Requirements
[SWS_Os_00013] dThe Operating System module shall provide the ability to synchro-
nize the processing of ScheduleTable to known Counter values.c(SRS_Os_11002)
The Operating System module does not need to provide any additional support for
implicit synchronization of ScheduleTables. However, it is necessary to constrain
configuration and runtime control of the ScheduleTable so that ticks on the config-
ured ScheduleTable can be aligned with ticks on the Counter. This requires the
range of the ScheduleTable to be identical to the range of the Counter (the equality
of tick resolution of each is guaranteed by the requirements on the ScheduleTable /
Counter interaction):
[SWS_Os_00429] dA ScheduleTable of the Operating System module that is im-
plicitly synchronized shall have a Duration equal to OsCounterMaxAllowedValue +
1 of its associated OSEK OS Counter.c()
7.4.2.2.1 Startup
The Operating System module must be told the value of the synchronization Counter.
Since the ScheduleTable duration is equal to the modulus of the synchronization
Counter, the Operating System module can use this to determine the drift between
the current count value on the ScheduleTable time and the synchronization count
and decide whether (or not) any action to achieve synchronization is required.
The Operating System module provides the service SyncScheduleTable (see
[SWS_Os_00199]) to provide the ScheduleTable with a synchronization count and
start synchronization.
The Operating System module uses the synchronization count to support (re-
)synchronization of a ScheduleTable at each expiry point by calculating an adjust-
ment to the delay to the next expiry point. This provides faster re-synchronization of
the ScheduleTable than doing the action on the final expiry point.
[SWS_Os_00206] dWhen a new synchronization count is provided, the Operating Sys-
tem module shall calculate the current deviation between the explicitly synchronized
scheduled table and the synchronization count.c(SRS_Os_11002)
It is meaningless to try and synchronize an explicitly synchronized ScheduleTable
before a synchronization count is provided.
[SWS_Os_00417] dThe Operating System module shall start to synchronize an explic-
itly synchronized ScheduleTable after a synchronization count is provided AND shall
continue to adjust expiry points until synchronized.c()
[SWS_Os_00418] dThe Operating System module shall set the state of an explicitly
synchronized ScheduleTable to "running and synchronous" if the deviation is less
than or equal to the configured OsScheduleTblExplicitPrecision threshold.c()
[SWS_Os_00419] dThe Operating System module shall set the state of an explicitly
synchronized ScheduleTable to "running" if the deviation is greater than the config-
ured OsScheduleTblExplicitPrecision threshold.c()
[SWS_Os_00420] dIF the deviation is non-zero AND the next expiry point is adjustable
AND the table is behind the sync Counter (TableTicksAheadOfSyncCounter <= Ta-
bleTicksBehindOfSyncCounter) THEN the OS shall set the next EP to expire delay -
min(MaxShorten, Deviation) ticks from the current expiry.c()
[SWS_Os_00421] dIF the deviation is non-zero AND the next expiry point is adjustable
AND the table is ahead of the sync Counter (TableTicksAheadOfSyncCounter > Ta-
bleTicksBehindOfSyncCounter) THEN the OS shall set the next EP to expire delay +
min(MaxLengthen, Deviation) ticks from the current expiry.c()
Figure 7.8 shows explicit synchronization of a ScheduleTable. It assumes the fol-
lowing:
• EP1-3 have OsScheduleTableMaxLengthen=2
• EP1-3 have OsScheduleTableMaxShorten =1
On processors that do not provide any memory protection hardware it may still be
necessary to provide a "best effort with available resources" scheme for detectable
classes of memory faults. Stack monitoring will identify where a Task or ISR has
exceeded a specified stack usage at context switch time. This may mean that there
is considerable time between the system being in error and that fault being detected.
Similarly, the error may have been cleared at the point the fault is notified (the stack
may be less than the specified size when the context switch occurs).
It is not usually sufficient to simply monitor the entire stack space for the system be-
cause it is not necessarily the Task/ISR that was executing that used more than stack
space than required - it could be a lower priority object that was pre-empted.
Significant debugging time can be saved by letting the Operating System correctly
identify the Task/Category 2 ISR in error.
Note that for systems using an MPU and scalability class 3 or 4 a stack overflow may
cause a memory exception before the stack monitoring is able to detect the fault.
7.5.2 Requirements
7.6 OS-Application
OS-Applications have a state which defines the scope of accessibility of its Operating
System objects from other OS-Applications. Each OS-Application is always in one of
the following states:
• Active and accessible (APPLICATION_ACCESSIBLE): Operating System objects
may be accessed from other OS-Applications. This is the default state at startup.
• Currently in restart phase (APPLICATION_RESTARTING). Operating System ob-
jects cannot be accessed from other OS-Applications. State is valid until the
OS-Application calls AllowAccess.
• Terminated and not accessible (APPLICATION_TERMINATED): Operating Sys-
tem objects cannot be accessed from other OS-Applications. State will not
change.
The following figure shows the states and the possible transitions:
7.6.2 Requirements
Memory protection will only be possible on processors that provide hardware support
for memory protection.
The memory protection scheme is based on the (data, code and stack) sections of the
executable program.
Stack: An OS-Application comprises a number of Tasks and ISRs. The stack for
these objects, by definition, belongs only to the owner object and there is therefore no
need to share stack data between objects, even if those objects belong to the same
OS-Application.
Memory protection for the stacks of Tasks and ISRs is useful mainly for two reasons:
1. Provide a more immediate detection of stack overflow and underflow for the Task
or ISR than can be achieved with stack monitoring
2. Provide protection between constituent parts of and OS-Application, for example
to satisfy some safety constraints.
Data: OS-Applications can have private data sections and Tasks/ISRs can have pri-
vate data sections. OS-Application’s private data sections are shared by all Tasks/
ISRs belonging to that OS-Application.
Code: Code sections are either private to an OS-Application or can be shared between
all OS-Applications (to use shared libraries). In the case where code protection is not
used, executing incorrect code will eventually result in a memory, timing or service
violation.
7.7.1.2 Requirements
Code Sections
[SWS_Os_00027] dThe Operating System module may provide an OS-Application the
ability to protect its code sections against executing by non-trusted OS-Applications.c()
[SWS_Os_00081] dThe Operating System module shall provide the ability to provide
shared library code in sections that are executable by all OS-Applications.c(SRS_Os_-
11007)
Peripherals
[SWS_Os_00209] dIf OsTrustedApplicationWithProtection == FALSE then
the Operating System module shall permit trusted OS-Applications read and write ac-
cess to peripherals.c()
[SWS_Os_00083] dThe Operating System module shall allow non-trusted OS-
Applications to write to their assigned peripherals only (incl. reads that have the side
effect of writing to a memory location).c()
Memory Access Violation
[SWS_Os_00044] dIf a memory access violation is detected, the Oper-
ating System module shall call the ProtectionHook with status code
E_OS_PROTECTION_MEMORY.c(SRS_Os_11013)
A timing fault in a real-time system occurs when a Task or interrupt misses its deadline
at runtime.
AUTOSAR OS does not offer deadline monitoring for timing protection. Deadline mon-
itoring is insufficient to correctly identify the Task/ISR causing a timing fault in an
AUTOSAR system. When a deadline is violated this may be due to a timing fault in-
troduced by an unrelated Task/ISR that interferes/blocks for too long. The fault in this
case lies with the unrelated Task/ISR and this will propagate through the system until
a Task/ISR misses its deadline. The Task/ISR that misses a deadline is therefore not
necessarily the Task/ISR that has failed at runtime, it is simply the earliest point that
a timing fault is detected.
If action is taken based on a missed deadline identified with deadline monitoring this
would potentially use false evidence of error to terminate a correct OS-Application in
favor of allowing an incorrect OS-Application to continue running. The problem is best
illustrated by example. Consider a system with the following configuration:
Assuming that all Tasks are ready to run at time zero, the following execution trace
would be expected and all Tasks would meet their respective deadlines.
Now consider the case when Tasks A and B behave incorrectly. The figure below
shows both Task A and Task B executing for longer than specified and Task B arriving
2 ticks earlier than specified. Both Tasks A and B meet their deadlines. Task C
however, behaves correctly but it fails to meet its deadline because of the incorrect
execution of Tasks A and B. This is fault propagation - a fault in an unrelated part of
the system is causing a correctly functioning part of the system to fail.
Whether a Task or ISR meets its deadline in a fixed priority preemptive operating
system like AUTOSAR OS is determined by the following factors:
• the execution time of Task/ISRs in the system
• the blocking time that Task/ISRs suffers from lower priority Tasks/ISRs locking
shared resources or disabling interrupts
• the interarrival rate of Task/ISRs in the system
For safe and accurate timing protection it is necessary for the operating system to
control these factors at runtime to ensure that Tasks/ISRs can meet their respective
deadlines.
AUTOSAR OS prevents timing errors from (1) by using execution time protection to
guarantee a statically configured upper bound, called the Execution Budget, on the
execution time of:
• Tasks
• Category 2 ISRs
AUTOSAR OS prevents timing errors from (2) by using locking time protection to guar-
antee a statically configured upper bound, called the Lock Budget, on the time that:
• Resources are held by Tasks/Category 2 ISRs
• OS interrupts are suspended by Tasks/Category 2 ISRs
• ALL interrupts are suspended/disabled by Tasks/Category 2 ISRs
AUTOSAR OS prevents timing errors from (3) by using inter-arrival time protection to
guarantee a statically configured lower bound, called the Time Frame, on the time
between:
• A Task being permitted to transition into the READY state due to:
– Activation (the transition from the SUSPENDED to the READY state)
– Release (the transition from the WAITING to the READY state)
• A Category 2 ISR arriving. An arrival occurs when the Category 2 ISR is recog-
nized by the OS
Inter-arrival time protection for basic Tasks controls the time between successive ac-
tivations, irrespective of whether activations are queued or not. In the case of queued
activations, activating a basic Task which is in the READY or RUNNING state is a new
activation because it represents the activation of a new instance of the Task. Inter-
arrival time protection therefore interacts with queued activation to control the rate at
which the queue is filled.
Inter-arrival time protection for extended Tasks controls the time between successive
activations and releases. When a Task is in the WAITING state and multiple Events
are set with a single call to SetEvent this represents a single release. When a Task
waits for one or more Events which are already set this represents a notional Wait/
Release/Start transition and therefore is considered as a new release.
The following figure shows how execution time protection and inter-arrival time protec-
tion interact with the task state transition model for AUTOSAR OS.
Figure 7.13: Time protection interaction with the task state transition model
Notes:
1. Inter-arrival time enforcement on Category 2 ISRs can be used to protect an
ECU from a "babbling idiot" source of interrupts (e.g. a CAN controller taking an
interrupt each time a frame is received from another ECU on the network).
2. Timing protection only applies to Tasks or Category 2 ISRs. There is no pro-
tection for Category 1 ISRs. If timing protection error occurs during a category 1
ISR, consistency of the Operating System module cannot be guaranteed. There-
fore we discourage timing protection in systems with category 1 interrupts.
3. Timing protection does not apply before the Operating System module is started.
4. In the case of trusted OS-Applications it is essential that all timing information
is correct, otherwise the system may fail at run-time. For a non-trusted OS-
Application, timing protection can be used to enforce timing boundaries between
executable objects.
7.7.2.2 Requirements
[SWS_Os_00466] dIf an attempt is made to activate a Task before the end of an Os-
TaskTimeFrame then the Operating System module shall not perform the activation
AND shall call the ProtectionHook with E_OS_PROTECTION_ARRIVAL.c()
[SWS_Os_00467] dIf an attempt is made to release a Task before the end of an
OsTaskTimeFrame then the Operating System module shall not perform the release
AND shall call the ProtectionHook with E_OS_PROTECTION_ARRIVAL AND the
event shall be set.c()
Timing Protection: ISRs
[SWS_Os_00210] dIf a Category 2 ISR’s OsIsrExecutionBudget is reached
then the Operating System module shall call the ProtectionHook with
E_OS_PROTECTION_TIME.c(SRS_Os_11013)
[SWS_Os_00474] dThe Operating System module shall reset an ISR’s OsIsrExecu-
tionBudget when the ISR returns control to the OS or terminates.c(SRS_Os_11008)
[SWS_Os_00470] dThe Operating System module shall limit the inter-arrival time of
Category 2 ISRs to one per OsIsrTimeFrame.c(SRS_Os_11008)
[SWS_Os_00471] dThe Operating System module shall measure the start of an Os-
IsrTimeFrame from the point at which it recognizes the interrupt (i.e. in the Operating
System interrupt wrapper).c(SRS_Os_11008)
[SWS_Os_00048] dIf Category 2 interrupt occurs before the end of the OsIsrTime-
Frame then the Operating System module shall not execute the user provided ISR
AND shall call the ProtectionHook with E_OS_PROTECTION_ARRIVAL.c(SRS_-
Os_11008)
Timing Protection: Resource Locking and Interrupt Disabling
[SWS_Os_00033] dIf a Task/Category 2 ISR holds an OSEK Resource
and exceeds the OsTaskResourceLockBudget (or OsIsrResourceLockBud-
get) , the Operating System module shall call the ProtectionHook with
E_OS_PROTECTION_LOCKED.c(SRS_Os_11008, SRS_Os_11013, SRS_Os_11014)
[SWS_Os_00037] dIf a Task/Category 2 ISR disables interrupts (via Suspend/Dis-
able|All/OS|Interrupts()) and exceeds the configured OsIsrAllInterruptLock-
Budget (or OsIsrOsInterruptLockBudget or OsTaskAllInterruptLockBud-
get or OsTaskOsInterruptLockBudget) the Operating System module shall call
the ProtectionHook with E_OS_PROTECTION_LOCKED.c(SRS_Os_11008, SRS_-
Os_11013, SRS_Os_11014)
Depending on the real hardware support this could mean that DisableAllInter-
rupts and SuspendAllInterrupts disable not all interrupts (e.g. all interrupts
except of the interrupt used for timing protection) or that the usage of Category 1 ISRs
- which bypass the Operating System (and also the timing protection) - is limited some-
how.
The implementation has to document such implementation specific behaviour (e.g. the
limitations when timing protection is used).
As OS-Applications can interact with the Operating System module through services,
it is essential that the service calls will not corrupt the Operating System module itself.
Service Protection guards against such corruption at runtime.
There are a number of cases to consider with Service Protection: An OS-Application
makes an API call
1. with an invalid handle or out of range value.
2. in the wrong context, e.g. calling ActivateTask in the StartupHook.
3. or fails to make an API call that results in the OSEK OS being left in an undefined
state, e.g. it terminates without a ReleaseResource call
4. that impacts on the behaviour of every other OS-Application in the system, e.g.
ShutdownOS
5. to manipulate Operating System objects that belong to another OS-Application
(to which it does not have the necessary permissions), e.g. an OS-Application
tries to execute ActivateTask on a Task it does not own.
The OSEK OS already provides some service protection through the status codes
returned from service calls and this will provide the basis for service protection. This
means that service protection will only apply for the extended status of OSEK OS.
However, OSEK OS does not cover all the cases outlined above. The following sections
describe - besides the mandatory extended status - the additional protection require-
ments to be applied in each of these cases.
The current OSEK OS service calls already return E_OS_ID on invalid objects (i.e.
objects not defined in the OIL file) and E_OS_VALUE for out of range values (e.g. setting
an alarm cycle time less than OsCounterMinCycle).
7.7.3.2.2 Requirements
The current OSEK OS defines the valid calling context for service calls (see [2]), how-
ever protects against only a small set of these invalid calls, e.g. calling Terminate-
Task from a Category 2 ISR.
Task
Cat1 ISR
Cat2 ISR
ErrorHook
PreTaskHook
PostTaskHook
StartupHook
ShutdownHook
Alarm Callback
ProtectionHook
Service
ActivateTask OK OK
ActivateTaskAsyn OK OK
TerminateTask OK C
ChainTask OK C
Schedule OK C
GetTaskID OK OK OK OK OK OK
GetTaskState OK OK OK OK OK
DisableAllInterrupts OK OK OK OK OK OK OK OK OK OK
EnableAllInterrupts OK OK OK OK OK OK OK OK OK OK
SuspendAllInterrupts OK OK OK OK OK OK OK OK OK OK
ResumeAllInterrupts OK OK OK OK OK OK OK OK OK OK
SuspendOSInterrupts OK OK OK OK OK OK OK OK OK OK
ResumeOSInterrupts OK OK OK OK OK OK OK OK OK OK
GetResource OK OK
ReleaseResource OK OK
SetEvent OK OK
SetEventAsyn OK OK
5
4
ClearEvent OK C
GetEvent OK OK OK OK OK
WaitEvent OK C
GetAlarmBase OK OK OK OK OK
GetAlarm OK OK OK OK OK
SetRelAlarm OK OK
SetAbsAlarm OK OK
CancelAlarm OK OK
GetActiveApplicationMode OK OK OK OK OK OK OK
StartOS
ShutdownOS OK OK OK OK
GetApplicationID OK OK OK OK OK OK OK OK
GetISRID OK OK OK OK
CallTrustedFunction OK OK
CheckISRMemoryAccess OK OK OK OK
CheckTaskMemoryAccess OK OK OK OK
CheckObjectAccess OK OK OK OK
CheckObjectOwnership OK OK OK OK
StartScheduleTableRel OK OK
StartScheduleTableAbs OK OK
StopScheduleTable OK OK
NextScheduleTable OK OK
StartScheduleTableSynchron OK OK
SyncScheduleTable OK OK
GetScheduleTableStatus OK OK
SetScheduleTableAsync OK OK
IncrementCounter OK OK
GetCounterValue OK OK
GetElapsedValue OK OK
TerminateApplication OK OK OK1
AllowAccess OK OK
GetApplicationState OK OK OK OK OK OK OK OK
ControlIdle OK OK
GetCurrentApplicationID OK OK OK OK OK OK OK OK
ReadPeripheral8 OK OK
ReadPeripheral16 OK OK
ReadPeripheral32 OK OK
WritePeripheral8 OK OK
WritePeripheral16 OK OK
WritePeripheral32 OK OK
ModifyPeripheral8 OK OK
ModifyPeripheral16 OK OK
ModifyPeripheral32 OK OK
DisableInterruptSource OK OK
EnableInterruptSource OK OK
ClearPendingInterrupt OK OK
1
Only in case of self termination.
In the table above "C" indicates that validity is only "Checked in Extended status by
E_OS_CALLEVEL" .
7.7.3.3.2 Requirements
[SWS_Os_00088] dIf an OS-Application makes a service call from the wrong con-
text AND is currently not inside a Category 1 ISR the Operating System module shall
not perform the requested action (the service call shall have no effect) and return
E_OS_CALLEVEL or the "invalid value" of the service.c(SRS_Os_11009, SRS_Os_-
11013)
7.7.3.4.2 Requirements
The Operating System service calls available are restricted according to the calling
context (see 7.7.3.3). In a protected system, additional constraints need to be placed to
prevent non-trusted OS-Applications executing API calls that can have a global effect
on the system. Each level of restriction is a proper subset of the previous level as
shown in the figure below.
7.7.3.5.2 Requirements
7.7.3.6.1 Background
Section 7.7.3.2 stated that E_OS_ID is returned by OSEK OS service calls when the
object is invalid. Under the protection scheme a service call can be invalid because
the caller does not have valid permissions for the object (a new meaning for multi-OS-
Application systems).
This is a similar case to an object not being accessible in OSEK OS (for example, when
a Task tries to get a Resource which exists in the system but has not been configured
as used by the Task).
7.7.3.6.2 Requirements
Where a processor supports privileged and non-privileged mode it is usually the case
that certain registers, and the instructions to modify those registers, are inaccessible
outside the privileged mode.
On such hardware, executing the Operating System module in privileged mode and
Tasks/ISRs in non-privileged mode protects the registers fundamental to Operating
System module operation from inadvertent corruption by the objects executing in non-
privileged mode. The Operating System module’s services will need to execute in
privileged mode as they will need to modify the registers that are protected outside this
mode.
The Operating System module can use the control registers of the MPU, timer unit(s),
interrupt controller, etc. and therefore it is necessary to protect those registers against
non-trusted OS-Applications.
7.7.4.2 Requirements
[SWS_Os_00058] dIf supported by hardware, the Operating System module shall ex-
ecute non-trusted OS-Applications in non-privileged mode.c()
[SWS_Os_00096] dAs far as supported by hardware, the Operating System module
shall not allow non-trusted OS-Applications to access control registers managed by the
Operating System module.c(SRS_Os_11011)
[SWS_Os_00245] dIf an instruction exception occurs (e.g. division by
zero) the Operating System module shall call the protection hook with
E_OS_PROTECTION_EXCEPTION.c(SRS_Os_11011)
When the Operating System module is running non-trusted OS-Applications, the Oper-
ating System module’s treatment of interrupt entry and hook routines must be carefully
managed.
Interrupt handling: Where the MCU supports different modes (as discussed in this
section) ISRs will require the Operating System module to do extra work in the ISR()
wrapper. ISRs will typically be entered in privileged mode. If the handler is part of a
non-trusted OS-Application then the ISR() wrapper must make sure that a switch to
non-privileged mode occurs before the handler executes.
The Operating System software specification does not provide support for non-trusted
services.
7.7.5.2 Requirements
[SWS_Os_00451] dThe Operating System module shall allow exporting services from
trusted OS-Applications.c()
The Operating System module provides the service CallTrustedFunction (see
[SWS_Os_00097]) to call a trusted function from a (trusted or non-trusted) OS-
Application.
[SWS_Os_00100] dIf CallTrustedFunction is called and the called trusted func-
tion is not configured the Operating System module shall call the ErrorHook with
E_OS_SERVICEID.c()
The Operating System module provides the services CheckISRMemoryAccess and
CheckTaskMemoryAccess (see [SWS_Os_00512] and [SWS_Os_00513]) for OS-
Applications to check if a memory region is write/read/execute accessible from a Task/
Category 2 ISR and also return information if the memory region is part of the stack
space.
The Operating System can detect protection errors based on statically configured in-
formation on what the constituent parts of an OS-Application can do at runtime. See
section 7.7.
Unlike monitoring, protection facilities will trap the erroneous state at the point the error
occurs, resulting in the shortest possible time between transition into an erroneous
state and detection of the fault. The different kinds of protection errors are described
in the glossary. If a protection error occurs before the Operating System module is
started the behaviour is not defined. If a protection error happens during shutdown,
e.g. in the application-specific shutdown hook, an endless loop between the shutdown
service and the protection hook may occur.
In the case of a protection error, the Operating System module calls a user provided
ProtectionHook for the notification of protection errors at runtime. The Protec-
tionHook runs in the context of the Operating System module and must therefore be
trusted code.
The Operating System module itself needs only to detect an error and provide the abil-
ity to act. The ProtectionHook can select one out of four options the Operating
System module provides, which will be performed after returning from the Protec-
tionHook, depending on the return value of the ProtectionHook. The options are:
1. do nothing
2. forcibly terminate the faulty Task/Category 2 ISR
3. forcibly terminate all Tasks and ISRs in the faulty OS-Application
• without restart of the OS-Application
• with restart of the OS-Application
4. shutdown the Operating System module.
Requirements [SWS_Os_00243] and [SWS_Os_00244] define the order of the default
reaction if no faulty Task/Category 2 ISR or OS-Application can be found, e.g. in the
system specific hook routines. Also OS-Applications are only mandatory in Scalability
Classes 3 and 4, therefore in other Scalability Classes OS-Applications need not be
defined.
Note that forcibly terminating interrupts is handled differently in "forcibly terminate the
faulty ISR" and "forcibly terminate the OS-Application". If a faulty ISR is forcibly ter-
minated, the current invocation of the ISR is terminated. A subsequent invocation is
allowed. If the OS-Application is forcibly terminated, then the interrupt source is also
disabled, preventing subsequent interrupts.
Notes regarding the return value PRO_IGNORE
The meaning of "do nothing" (PRO_IGNORE) means that the error reaction is ignored.
The PRO_IGNORE is only allowed in specific situations (currently: arrival rate errors).
After the error is detected (e.g. as specified in [SWS_Os_00466] or [SWS_Os_00467])
the protection hook is called. If the hook returns with PRO_IGNORE the OS does con-
tinue its normal operation. If a service call was the root cause of the violation (e.g.
an ActivateTask) and protection hook returns PRO_IGNORE the service call shall
continue its operation (e.g. to activate a Task) and return E_OK (if successful and
possible).
Example 1: A Task calls ActivateTask(B) and causes an arrival rate violation. The
activation is not performed ([SWS_Os_00466]) and protection hook is called. When
returning PRO_IGNORE the OS continues and the ActivateTask service activates B
and returns E_OK.
Example 2: A Task A calls SetEvent for Task B (which currently waits for the event).
The OS detects ([SWS_Os_00467]) an arrival rate violation and performs a call of
the protection hook. When the call returns with PRO_IGNORE, the SetEvent service
continues and sets the event. Task B changes to READY state and a rescheduling
might happen. The SetEvent service call will return E_OK to Task A.
7.8.2 Requirements
2
The reason for this case is that the Task which is supervised is not necessary active (and can not
be e.g. terminated) and it can be that the caller of the activation is the real problem.
To reduce the memory footprint all cores should use the same code base. Sometimes
it can be beneficial to spend some more ROM/Flash, e.g. to use a local ROM, and
"double" parts of the code to get faster ROM/Flash access.
7.9.1.1 Requirements
7.9.2 Scheduling
The priority of the Tasks drives the scheduling. Since multiple cores run truly parallel,
several Tasks can execute at the same time.
Figure 7.15: Priorities are assigned to Tasks. The cores schedule independently from
each other. The Tasks T2, T3 and T5 are executed in true parallelism. Tasks with the
same priority on the same core will be executed in order of activation; Tasks with the
same priority on different cores may not be executed in the order of activation, since the
cores schedule independent from each other.
The OS can be entered on each core in parallel. This optimizes scalability towards
multiple cores. The cores schedule independently. This implies that the schedule on
one core does not consider the scheduling on the other cores3 . A low priority Task on
one core may run in parallel with a high priority Task on another core.
Tasks and ISRs cannot dynamically change cores by means of the scheduling algo-
rithm.
7.9.2.1 Requirements
A locatable entity is an entity that has to be located entirely on one core. The assign-
ment of LEs to cores is defined at configuration time (OsApplicationCoreRef).
In this release of the AUTOSAR standard OS-Applications shall be the LEs. Because
every Task has to run on some core, the usage of OS-Applications becomes obligatory
in AUTOSAR R4.0 for Multi-Core systems. BSW modules are not allowed to ignore OS-
Applications, even if they do not use any protection mechanisms. This is independent
from the SC class.
As is stated in the AUTOSAR Specification of the Operating System, if OS-Applications
are used, all Tasks, ISR etc. must belong to an OS-Application. This implies, that no
AUTOSAR software exists outside of an OS-Application in Multi-Core systems.
On single-core systems OS-Applications are available only for SC3 and SC4 because
the mechanism is used to support memory protection and implies the usage of ex-
tended mode. In Multi-core systems OS-Applications are always available independent
of memory protection and on SC1 standard mode shall be possible.
7.9.3.1 Requirements
[SWS_Os_00570] dAll Tasks that are assigned to the same OS-Application shall exe-
cute on the same core.c(SRS_Os_80003, SRS_Os_80005)
[SWS_Os_00571] dAll ISRs that are assigned to the same OS-Application shall exe-
cute on the same core.c(SRS_Os_80003, SRS_Os_80005)
3
This also applies to Tasks with the same priority, bound to different cores. It also means that non-
preemptive Tasks cannot be preempted on the core they are running, but Tasks on other cores can run
in parallel.
[SWS_Os_00572] dISR balancing (if supported by the HW) shall be switched off at
boot time by the OS.c(SRS_Os_80005, SRS_Os_80006)
[SWS_Os_00764] dThe OS module shall support OS-Applications in case of Multi-
Core also for SC1 and SC2.c()
[SWS_Os_00763] dIn an SC1 system standard mode shall be possible.c()
[SWS_Os_00573] dThe binding of OS-Applications to cores shall be configured within
the OS-Application container.c(SRS_Os_80003, SRS_Os_80005)
A new configuration item: OsApplicationCoreRef within the OS-Application con-
tainer shall be used to define the core to which the OS-Application is bound. The OS
generator will map the configuration parameter "CORE" to a certain core, so that all
OS-Applications with the same configuration parameter reside on the same core.
The way cores are started depends heavily on the hardware. Typically the hardware
only starts one core, referred as the master core, while the other cores (slaves) remain
in halt state until they are activated by the software.
In contrast to such a master-slave system other boot concepts with cores that start
independently from each other are conceivable. However it is possible to emulate
master-slave behavior on such systems by software.
The AUTOSAR Multi-Core OS specification requires a system with master-slave start-
up behavior, either supported directly by the hardware or emulated in software. The
master core is defined to be the core that requires no software activation, whereas a
slave core requires activation by software.
In Multi-Core configurations, each slave core that is used by AUTOSAR must be acti-
vated before StartOS is entered on the core. Depending on the hardware, it may be
possible to only activate a subset of the available cores from the master. The slave
cores might activate additional cores before calling StartOS. All cores that belong to
the AUTOSAR system have to be activated by the designated AUTOSAR API function.
Additionally, the StartOS function has to be called on all these cores.
If a core is activated it executes some HW and compiler specific operations, before the
"main" function is called. In case the same "main" function is executed on each core,
the cores have to be differentiated by their specific core Id within the function.
Example:
1 void main ()
2 {
3 StatusType rv;
4
5 /* ... */
6
7 switch (GetCoreID())
8 {
9
10 case OS_CORE_ID_MASTER:
11 /* ... */
12
13 StartCore(OS_CORE_ID_0, &rv);
14 StartOS(OSDEFAULTAPPMODE);
15 break;
16
17 case OS_CORE_ID_0:
18 /* ... */
19
20 StartCore(OS_CORE_ID_1, &rv);
21 StartOS(DONOTCARE);
22 break;
23
24 otherwise:
25
26 StartOS(DONOTCARE);
27
28 }
29 }
StartOS synchronizes all cores twice. The first synchronization point is located before
the StartupHooks are executed, the second after the OS-Application specific Star-
tupHooks have finished and before the scheduler is started. The exact point where the
second synchronization occurs depends on the implementation, but it shall be before
the scheduling is started. This release of the AUTOSAR specification does not support
timeouts during the synchronization phase. Cores that are activated with StartCore
but do not call StartOS may cause the system to hang. It is in the responsibility of the
integrator to avoid such behavior.
As shown in figure 7.16, the StartupHook is called on every core right after the first
synchronization. However, there is only one StartupHook in the system. If, for exam-
ple, core-individual functionality must be executed during StartupHook the GetCor-
eID function can be used to discriminate the individual cores. After the global Star-
tupHook has finished each core performs the StartupHooks of its OS-Applications .
Since OS-Applications are bound to cores the OS-Application specific StartupHooks
are executed only on the core to which the corresponding OS-Application is bound.
Figure 7.16: This figure shows an example of an initialization process with 4 cores
7.9.4.1 Requirements
The AUTOSAR OS controls several cores as stated above. It need not control all cores
of a µC, however. The maximum number of controlled cores shall be configured within
the OsOS section of the configuration.
The AUTOSAR OS API provides a StartCore function to start the cores under its
control. The StartCore function takes a scalar value parameter of type CoreIdType,
specifying the core that shall be started. StartCore can be called more than once on
the master core and also on slave cores. Each core can only be started once, however.
For example:
1 StartusType rv1, rv2;
2 StartCore(OS_CORE_ID_1, &rv1);
3 StartCore(OS_CORE_ID_2, &rv2);
4 if (rv1 != E_OK) || (rv2 != E_OK)
5 EnterPanicMode();
6 StartOS(OSDEFAULTAPPMODE);
The StartOS function shall be called on all cores that have been activated by Start-
Core. It is not allowed to call StartCore from a core that has already called StartOS.
Cores that belong to the AUTOSAR system shall be started by the designated
AUTOSAR OS API service StartCore.
7.9.5.1 Requirements
The function StartNonAutosarCore can be used both before and after StartOS.
It is provided to activate cores that are controlled by another OS or no OS at all,
AUTOSAR functions shall not be called on these cores, otherwise the behavior is un-
specified.
7.9.6.1 Requirements
AUTOSAR supports two shutdown concepts, the synchronized shutdown and the in-
dividual shutdown concept. While the synchronized shutdown is triggered by the new
API function ShutdownAllCores, the individual shutdown is invoked by the existing
API function ShutdownOS.
If a Task with the proper rights calls ShutdownAllCores, a signal is sent to all other
cores to induce the shutdown procedure. Once the shutdown procedure has started
on a core, interrupts and Tasks are not further processed, and no scheduling will take
place, therefore it makes no sense to activate any Task, however no error will be
generated. It is in the responsibility of the application developer/system integrator to
make sure that any preparations for shutdown on application and basic software level
are completed before calling ShutdownAllCores (e.g. by means of the ECU state
manager).
During the shutdown procedure every core executes its OS-Application specific Shut-
downHook functions, followed by a synchronization point. After all cores have reached
the synchronization point the global ShutdownHook function is executed by all cores
in parallel.
If a Task calls ShutdownOS the OS will be shut down on the core on which Shut-
downOS has been called. Every core shall be able to invoke ShutdownOS . Similar to
StartOS this function will shutdown the individual core. To shutdown the whole ECU
ShutdownOS has to be called on every core. The function will not return.
Individual shutdown is not supported in AUTOSAR R4.x (AUTOSAR mode manage-
ment will not use it).
In multicore systems it can happen that a fatal internal OS error is detected only on
one core. In such cases a local shutdown of that core does not make sense.
[SWS_Os_00762] dIn cases where the OS detects a fatal internal error all cores shall
be shut down.c()
Within this chapter we describe which existing single core AUTOSAR OS functionality
has been extended. The following table gives an overview of all standard OS API
functions. The column "Multi-Core support" contains one of the following values:
• Extended: The function that has been extended substantially to support special
Multi-Core functionality.
• Adapted: the function required some minor changes but basically remains un-
changed.
• Unchanged: the behavior of the function has not changed.
• New: the function is a new AUTOSAR OS API-function.
Service Multi-Core support Annotation
ActivateTask Extended Cross core use shall be supported.
AllowAccess Unchanged Works only on the same core.
CallTrustedFunction Adapted Function must be bound to the same core.
CancelAlarm Extended Cross core use shall be supported.
ChainTask Extended Cross core use shall be supported.
CheckISRMemoryAccess Unchanged
CheckObjectAccess Unchanged
CheckObjectOwnership Unchanged
CheckTASKMemoryAccess Unchanged
ClearEvent Unchanged
ControlIdle Unchanged Is allowed to be called from any core.
DisableAllInterrupts Unchanged Works only on the same core.
EnableAllInterrupts Unchanged Works only on the same core.
GetActiveApplicationMode Unchanged
GetAlarm Extended Cross core use shall be supported.
GetAlarmBase Extended Cross core use shall be supported.
GetApplicationID Unchanged
GetApplicationState Extended Cross core use shall be supported.
GetCoreID New ID of the current core.
GetCounterValue Adapted Cross core is not allowed.
GetElapsedValue Adapted Cross core is not allowed.
GetEvent Unchanged
GetISRID Unchanged
GetNumberOfActivatedCores New Number of cores running the AUTOSAR OS.
GetResource Adapted Nestable with spinlocks.
GetScheduleTableStatus Extended Cross core use shall be supported.
GetSpinlock New Occupy a spinlock.
GetTaskID Unchanged Works only on the same core.
GetTaskState Extended Cross core use shall be supported.
IncrementCounter Adapted Cross core is not allowed.
NextScheduleTable Unchanged
5
4
Service Multi-Core support Annotation
ReleaseResource Adapted Nestable with spinlocks.
ReleaseSpinlock New Release a spinlock.
ResumeAllInterrupts Unchanged Works only on the same core.
ResumeOSInterrupts Unchanged Works only on the same core.
Schedule Adapted Check for unreleased spinlocks
SetAbsAlarm Extended Cross core use shall be supported
SetEvent Extended Cross core use shall be supported.
SetRelAlarm Extended Cross core use shall be supported
SetScheduleTableAsync Unchanged
ShutdownAllCores New Synchronized shutdown.
ShutdownOS Extended Support for MC systems
StartCore New Start additional core
StartOS Extended Support for MC systems
StartNonAutosarCore New Start additional core
StartScheduleTableAbs Extended Cross core use shall be supported.
StartScheduleTableRel Extended Cross core use shall be supported.
StartScheduleTableSynchron Unchanged
StopScheduleTable Extended Cross core use shall be supported.
SuspendAllInterrupts Unchanged Works only on the same core
SuspendOSInterrupts Unchanged Works only on the same core
SyncScheduleTable Unchanged
TerminateApplication Extended Check for unreleased spinlocks. Cross core use shall be
supported.
TerminateTask Adapted Check for unreleased spinlocks
TryToGetSpinlock New Try to occupy a spinlock
WaitEvent Adapted Check for unreleased spinlocks
Service Task Cat1 Cat2 Error Pre Post Startup Shut- Alarm Pro-
ISR ISR Hook Task Task Hook down Call- tec-
Hook Hook Hook back tion-
Hook
GetNumberOfActivated- Ok Ok
Cores
GetCoreID Ok Ok Ok Ok Ok Ok Ok Ok Ok Ok
StartCore
StartNonAutosarCore Ok
GetSpinlock Ok Ok
ReleaseSpinlock Ok Ok
TryToGetSpinlock Ok Ok
GetNumberOfActivated- Ok Ok
Cores
ShutdownAllCores Ok Ok Ok Ok
[SWS_Os_00589] dAll functions that are not allowed to operate cross core shall re-
turn E_OS_CORE in extended status if called with parameters that require a cross core
operation.c(SRS_Os_80013)
7.9.9 GetTaskID
GetTaskID can be called both from Task and Category 2 ISR level. When called from
an interrupt routine, on Single-Core systems, GetTaskID returns either the interrupted
Task or indicates that no Task is running. On Multi-Core systems it
• indicates that no Task is running on the core or,
• returns the ID of the interrupted Task on the core.
Note: All types of interrupts can only be disabled on the local core. This implies that
the interrupt flags on other cores remain in their current state. Scheduling continues
on the other cores. Running ISRs on other cores continue executing.
7.9.10.1 Requirements
Task activation shall be extended to work across cores. This document will not specify
any implementation details. This functions timing behavior can be slower when working
7.9.11.1 Requirements
Task chaining shall be extended to work across cores. This document will not specify
any implementation details. This function’s timing behavior can be slower when work-
ing across cores. If a Task has to be activated on another core, a scheduling decision
is necessary on that core. If the core has not been activated, an error is generated.
7.9.12.1 Requirements
SetEvent shall be extended to work across cores. This document will not specify any
implementation details. This function’s timing behavior can be slower when working
across cores. If the core has not been activated, an error is generated.
7.9.13.1 Requirements
4
This is the application mode of the Operating System and shall not be confused by other application
modes defined in the AUTOSAR mode management.
7.9.15.1 Requirements
7.9.16.1 Requirements
If TerminateTask (or ChainTask) is called while the calling Task holds a spinlock,
the behavior is undefined in standard status.
[SWS_Os_00612] dIn extended status TerminateTask / ChainTask shall return
with an error (E_OS_SPINLOCK), which can be evaluated in the application.c(SRS_-
Os_80021)
[SWS_Os_00613] dSpinlocks occupied by Tasks that are terminated in response to a
protection hook shall be automatically released. This applies also to the case in which
an OS-Application is terminated.c(SRS_Os_80021)
Similar to Tasks an OS-Application cannot be terminated while any of its Tasks occupy
a spinlock. In such cases, the lock is automatically released. To avoid an avalanche of
error handling, no calls to the ErrorHook are made.
It might be possible that TerminateApplication(A) is called in parallel from differ-
ent cores. The implementation has to support such a call pattern by executing the first
arriving call of TerminateApplication(A)and ignoring any subsequent calls until
the termination is completed.
7.9.17.1 Requirements
Every core shall be able to invoke shutdown by using the ShutdownOS function. By
calling ShutdownOS only the calling core will enter the shutdown procedure.
If the user wants to shutdown all cores (more or less in parallel) ShutdownAllCores
shall be used. ShutdownOS and ShutdownAllCores will not return.
The OS service ShutdownOS is not used by the AUTOSAR mode management in
AUTOSAR R4.0. The function is offered for users that run the OS on cores without
RTE and without mode management.
7.9.18.1 Requirements
The Event waiting mechanism must be adapted to the new Multi-Core spinlock func-
tionality:
A Task might be de-scheduled when calling WaitEvent, in which case it would not
be able to release the spinlock. WaitEvent must therefore check if the calling Task
holds a spinlock. As with Resources, spinlocks cannot be occupied by Tasks in wait
state.
7.9.19.1 Requirements
7.9.20.1 Requirements
The Schedule API service must be adapted to the new Multi-Core spinlock function-
ality in the same manner as WaitEvent.
A Task shall not actively force a de-scheduling while it occupies spinlocks.
7.9.21.1 Requirements
The GetResource function allows mutual exclusion between Tasks on the same core.
The OS generator shall check offline that the Tasks are not on different cores.(see
7.9.30) and the GetResource function will check this requirement online.
The priority ceiling protocol (used by GetResource) temporarily changes the priority
of a Task. Such an approach fails on Multi-Core systems as the priorities are local to
each core. Therefore the ceiling protocol is not sufficient to protect a critical section
against access from different cores.
[SWS_Os_00801] dIf Spinlocks and Resources are locked by a Task/ISR they have
to be unlocked in strict LIFO order. ReleaseResource shall return E_OS_NOFUNC
if the unlock order is violated. No other functionality shall be performed.c(SRS_Os_-
80021)
[SWS_Os_00851] dIf OsUseResScheduler is TRUE, the OS generation tool shall
create a virtual instance of RES_SCHEDULER for each configured core.c()
[SWS_Os_00852] dIt shall be possible for tasks running on different cores to occupy
their own instance of RES_SCHEDULER at the same time.c()
[SWS_Os_00853] dThe ceiling priority of each instance of RES_SCHEDULER shall pre-
vent the execution of any other task on the core on which it is occupied but shall have
no effect on the scheduling on any other core.c()
[SWS_Os_00854] dIf OsUseResScheduler is FALSE AND the configuration contains
a resource called RES_SCHEDULER, the configured resource shall behave the same as
any other configured resource.c()
[SWS_Os_00855] dIt shall be possible to configure a LINKED resource that links to
RES_SCHEDULER. In a multi-core configuration with OsUseResScheduler=TRUE,
the linkage shall be to the instance of RES_SCHEDULER on the core to which the
LINKED resource is assigned.c()
Every HW assigns a unique physical Id to a core. The physical core Id is the only
way to distinguish between cores. The physical core Ids of a µC are not necessarily
consecutive and do not necessarily start with zero.
The SW requires a mechanism to identify a core, e.g. to use core specific variables.
Because the physical core Id usually cannot be used as a direct array index for core
specific variables, a logical CoreID is necessary to map physical core Ids to array
indexes. In the SW it is not necessary to know the physical core Id, the logical CoreID
is sufficient.
The mapping of OS-Applications and other SW objects to cores is specified in the
configuration files. All such mappings shall be HW independent and therefore shall not
be based on the physical core Id but on the logical CoreID.
The function GetCoreID internally maps the physical core Id to the logical CoreID.
The mapping is implementation specific. GetCoreID can be either a C function or a
macro.
7.9.23.1 Requirements
The AUTOSAR OS can only increment Counters on the core on which it resides.
A Counter which is assigned to an OS-Application X cannot be incremented by an
OS-Application Y if X and Y are assigned to different cores.
7.9.25.1 Requirements
• The core which is incrementing the Counter has to check if Alarms which are
based on the Counter have expired. Handling of expired Alarms is more com-
plex when different cores manipulate the same Alarms, because mutual exclu-
sion becomes necessary.
7.9.27 Alarms
The Alarm mechanism of the AUTOSAR Operating System provides services to acti-
vate Tasks, set Events, increment Counters, or call an Alarm call-back (OsAlarm-
CallbackName).
As stated above, Alarms can only be bound to a Counter which resides on the same
core. Tasks can be activated and Events can be set with an Alarm action regardless
of the core to which the Task is bound. The access rights defined by OS-Applications
have to be respected, however. Additionally it shall be allowed to manipulate Alarms
when they are bound to other cores. The API-services SetRelAlarm, SetAbsAlarm,
and CancelAlarm can be used to manipulate parameters of Alarms on other cores.
7.9.27.1 Requirements
7.9.28 ScheduleTables
7.9.28.1 Requirements
With the Multi-Core concept, a new mechanism is needed to support mutual exclusion
for Tasks on different cores. This new mechanism shall not be used between Tasks
on the same core because it makes no sense. In such cases the AUTOSAR Operating
System returns an error.
A SpinlockType, which is similar to OSEK’s ResourceType, shall be used. Spinlocks
are configured offline.
A spinlock is a busy waiting mechanism that polls a (lock) variable until it becomes
available. Typically, this requires an atomic test and set functionality, the details of
which are implementation specific.
Figure 7.20: A deadlock situation caused by interference, the high priority Task spins
indefinitely because the low priority Task has occupied the spinlock. In such cases the
second GetSpinlock call will return with an error.
A user can protect a Task against such a situation by, for example, rapping the spinlock
with SuspendAllInterrupts, so that it cannot be interfered by other Tasks. The
OS can do this automatically for the caller - see OsSpinlockLockMethod.
A second deadlock situation can be created by nested spinlocks calls, as illustrated in
figure 7.21.
Figure 7.21: This figure shows a typical deadlock caused by two spinlocks taken in
different order by Tasks on two different cores
This figure 7.22 shows an example in which two Tasks have access to a set of spin-
locks S1 – S6. It is allowed to occupy the spinlocks in the predefined order and it is
allowed to skip spinlocks. If multiple spinlocks are occupied at the same time, locking
and unlocking has to occur in strict LIFO order
The spinlock mechanism is not deadlock free by itself. The order in which spinlocks
from Tasks/ISRs are requested has to be mentioned in the configuration description.
If a Task occupies a spinlock, scheduling shall be restricted.
Note: AUTOSAR does not prescribe which algorithms are used to implement spinlocks.
Since users may want to analyze the timing behavior (e.g. lock times) an implementa-
tion shall document the real behavior.
7.9.29.1 Requirements
7.9.30.1 Requirements
[SWS_Os_00662] dThe OS generator tool shall return with an error if it detects a Re-
source referred to by any Tasks or ISRs assigned to different cores.c(SRS_Os_-
80021)
[SWS_Os_00663] dThe OS generator tool shall return with an error if an Alarm is
assigned to a Counter on a different core.c(SRS_Os_80013)
[SWS_Os_00664] dThe OS generator tool shall return with an error if a Counter on a
different core shall be incremented as an Alarm action.c(SRS_Os_80013)
[SWS_Os_00665] dThe OS generator tool shall return with an error if a Sched-
uleTable is assigned to a Counter on a different core.c(SRS_Os_80013)
[SWS_Os_00666] dThe OS generator tool shall return with an error if the linked list of
spinlocks is not free of cycles.c(SRS_Os_80021)
[SWS_Os_00667] dThe OS generator tool shall check the assignment of OsAppli-
cations (including the Tasks assigned to the OsApplication) to cores and return
an error in case any of these cores does not exist.c(SRS_Os_80005)
Before scheduling starts the AUTOSAR Operating System5 activates all auto-start ob-
jects that are configured. This mechanism shall work similar on a Multi-Core system.
Before scheduling starts, the Multi-Core OS shall activate all configured auto-start ob-
jects on the respective core. Due to the fact that OS-Applications are defined as the
locatable entity no further configuration container is required. Auto-start objects are
already configured as part of an OS-Application.
7.9.31.1 Requirements
5
StartOs
There are use cases where 1 to N IOC code instances needs to be generated on top of
the OS code which is used by multiple different Software Clusters. As those Software
Clusters use different IOC configurations, as a consequence the OS code shall not
include any code depending on a specific IOC configuration.
To ensure compatibility between IOC and OS code, there is still a dependency in that it
is necessary to use the same OS configuration for the generation of the different IOC
code Instances. Furthermore, the OS and IOC code should be generated from an OS
Generator coming from the same vendor.
[SWS_Os_00671] dThe IOC implementation shall be part of the Operating System
The IOC is a third type of communication, in addition to
• Intra OS-Application communication: Always handled within the RTE
• Inter ECU communication: Already available via well-defined interfaces to the
communication stack (COM)
c(SRS_Os_80020)
IOC mode: This is the mode where the OS generator is invoked with a configuration
parameter to generate the IOC code only.
OS mode: This is the mode where the OS generator is invoked with a configuration
parameter to generate the OS code only.
Default mode: This is the current behavior where the IOC code is generated along
with OS code.
[SWS_Os_00831] DRAFT dThe OS Generator shall provide configuration parameters
allowing IOC communication code ("IOC mode") to be generated separately from OS
code (("OS mode").c(SRS_Os_80020)
[SWS_Os_00831] means that the OS Generator shall be able to produce only OS code
or only IOC code in a single invocation.
[SWS_Os_00832] DRAFT dThe Operating System in the Host Software Cluster shall
be able to handle multiple IOC code Instances related to different Software Clusters.c
(SRS_Os_80020)
[SWS_Os_00833] DRAFT dWhen the OS generator is invoked in "OS mode" it shall
only generate the OS code. Thereby the OS code shall not include any code that
depends on a specific IOC configuration, because different Clusters will use different
IOC configurations with the same OS code.c(SRS_Os_80020)
Please note that it is mandatory to use the same OS configuration for the generation
of the different IOC instances to ensure compatibility between the IOC and OS code.
[SWS_Os_00834] DRAFT dWhen the OS generator is invoked in "IOC mode" it shall
only generate the IOC code. Thereby the name of the C module containing the gener-
ated IOC code shall be Ioc.c and the name of the header file containing the generated
IOC APIs shall be Ioc.h.c(SRS_Os_80020)
Requirements [SWS_Os_00833] and [SWS_Os_00834] ensure that OS and IOC can
be generated independently from each other but linked together while building the ECU
instance /Machine. ()
[SWS_Os_00835] DRAFT dIf the IOC is configured, there shall be a function IocInit
responsible for the initialization of the data structures of the IOC.c(SRS_Os_80020)
Memory protection boundaries are a characteristic of OS-Applications and special
communication mechanisms are needed to cross them. Multi-Core systems may also
need additional measures to make communication between cores safe.
All AUTOSAR software, both BSW and software components, must belong to an OS-
Application (see 7.9.3), but not necessarily to the same one. It is expected that the
BSW will be trusted code, but it shall be defined as one or more OS-Applications.
The IOC provides communication services between OS-Applications and in particular
over core boundaries in Multi-Core systems. Because the cross-core communication
is always an inter-OS-Application communication, the two mechanisms are combined.
An inter OS-Application communication may not necessarily require a cross core com-
munication, however.
Communication between OS-Applications is expected to be more frequent than inter
ECU communication. This would be the case when existing; closely related Software
Components and their runnable entities are distributed to two or more cores to increase
system performance. Meeting timing constraints is expected to become more difficult,
when runnables which have been designed to run on a single core are distributed over
several cores.
In systems with only one core, the IOC can be omitted completely, if just one OS-
Application is available, or if no OS-Application uses memory protection mechanisms.
The IOC does not provide standardized support for measurement of IOC channels.
The IOC provides communication services which can be accessed by clients which
need to communicate across OS-Application boundaries on the same ECU or Software
Cluster.
The RTE uses IOC services to communicate across such boundaries. All communica-
tion must be routed through the RTE on sender (or client) and on receiver (or server)
side.
Direct access to IOC services by clients other than the RTE is currently not supported,
but possible, if the client (e.g. a CDD) provides a hand written or generated IOC Con-
figuration Description as specified and specific callback functions if necessary. Only
sender/receiver communication is supported however by the IOC.
Software Components and/or BSW modules located in the same OS-Application (and
hence on the same core) should not communicate by invoking IOC services. This
would be less efficient than communication via RTE only. However, in case of IOC
supported N:1 communication, if not all of the senders and the receiver are in the
same OS-Application the IOC must be used.
To keep the RTE as hardware independent as possible, all inter OS-Application and
inter core communication mechanisms and implementation variants are encapsulated
in the IOC. The IOC internal functionality is dependent on hardware architecture prop-
erties, in particular on the memory architecture.
The IOC has to guarantee data consistency in inter OS-Application and inter core
(Multi-Core systems) communication, this means in particular:
• In queued communication the sequential order of communication operations shall
remain unchanged. In the N:1 communication case, the order of the messages
from the different sources is a property of the implementation.
• The content of all data sent in one communication operation shall remain un-
changed, i.e. each communication operation shall be treated as atomic opera-
tion.
• The lock mechanism (interrupt locks; spinlocks; lock free implementation; ...)
which is used by the IOC to guarantee the data consistency is not standardized.
7.10.3.1 Communication
The IOC provides sender-receiver (signal passing) communication only. The RTE (or
adapted BSW modules in a future release of this specification) translates Client-Server
invocations and response transmissions into Sender-Receiver communication.
1:1, N:1 and N:M (unqueued only) communication are supported by the IOC.
The IOC allows the transfer of one data item per atomic communication operation. A
data item can either be a value for atomic basic data types or a reference for complex
data structures. The data structure must be implemented as a single memory block,
however. This way the data item can be transmitted in one piece. The IOC does not
need to know the internal data structure. The basic memory address and length (which
can be calculated from the type of the data item) is sufficient. The IOC does, e.g., not
support a conversion of endianness between cores.
Transferring more than one data item in one operation is also supported for 1:1 com-
munication only. In this case several types and memory addresses have to be used by
the IOC function. The advantage compared to sequential IOC calls is that mechanisms
to open memory protection boundaries and to notify the receiver have to be executed
just once. Additionally, all data items are guaranteed to be consistent, because they
are transferred in one atomic operation.
The IOC provides both, unqueued (Last-is-Best, data semantics) or queued (First-In-
First-Out, event semantics) communication operations. If present, the IOC internal
queue has a configurable length.
Each atomic communication operation gets specified individually by its own descrip-
tion block in a Configuration Description with regard to sender, receiver, data type(s),
notification, and queuing.
7.10.3.2 Notification
The IOC optionally notifies the receiver as soon as the transferred data is available
for access on the receiver side, by calling a configured callback function which gets
provided by the user of the communication.
The interface between RTE and IOC shall be similar to the interface between Software
Components and the RTE, i.e. by generating specific interfaces for each communica-
tion operation instead of providing a generic API.
This supports optimization methods (like function inlining or replacing function calls
by macros) much better than standardized interfaces. Most of the optimization can
be performed offline at code generation time instead of consuming valuable real-time
resources.
There is a unique set of IOC service APIs (at least to send and receive data) for each
data communication specified in the IOC Configuration Description. Each service API
gets generated and can be identified by a unique Id for each data communication. In
case of N:1 communication, each sender must use its own API.
The same IOC service API and hence the same 1:1 communication can get used by
more than one runnable inside the same SWC both on sender and on receiver side.
However, the IOC functions are not reentrant, because otherwise e.g. spinlock errors
could occur in case the IOC uses spinlocks in Multi-Core systems. The same IOC API
must therefore only be called sequentially. This is no problem, if all runnable entities
are scheduled within the same Task, otherwise the caller is responsible to guarantee
that the same IOC API is not called again before it returns from a different invocation.
Software Components may access the IOC only via RTE. Only the RTE decides which
communication services to use to support the communication needs of Software Com-
ponents.
Direct access to IOC services by BSW modules is not supported, but allowed for CDDs
and other modules, if unavoidable. The clients have to provides a hand written or
generated IOC Configuration Description as specified. In case of notification of the
receiver, a specific callback function has to be specified and provided by the client.
Only sender/receiver communication is supported however by the IOC.
Data element specific interfaces between RTE and IOC require extensive code genera-
tion. Instead of generating the IOC together with the RTE, a sequential code generation
process is used, to separate generic RTE code generation and hardware dependent
IOC code generation as much as possible. The following steps shall be performed:
• Step 1: Specify all information about the allocation of Software Components to
OS-Applications and cores in the ECU Configuration Description file.
• Step 2: Generate the RTE. The RTE generator creates data element specific IOC
services calls and the corresponding IOC Configuration Description blocks (XML
format) to specify the communication relations for each data element.
• Step 3: Generate the IOC code, according to the IOC Configuration Description
(Step 2) while considering the hardware description files. Additionally, generate a
header file (Ioc.h) for inclusion in RTE.c to provide definitions, function prototypes
and macros.
This section describes two typical use cases that show how the IOC can support com-
munication between OS-Applications. In both examples the OS-Applications are lo-
cated on different cores of a Multi-Core system.
One Software Component sends data items in event semantics (queued) to another
Software Component located on a different core. A runnable entity on the receiver side
is invoked periodically (e.g. by an Alarm) and receives the data via RTE (see figure
7.24).
Because the communication crosses core boundaries, the RTE invokes the IOC to
transfer the data from core 0 to core 1.
On the sending side, the
Rte_Send_<port>_<item> (..., <data>)
call is mapped to an
IocSend_<Id> (<data>)
call.
In this example, the IocSend service writes the data into a buffer, located in a shared
memory area which can get read by the receiver via the IOC.
On the receiving side, the receiving runnable gets invoked periodically. The
Rte_Receive_<port>_<item> (..., <data>)
call is mapped to an
IocReceive_<Id> (<data>)
call to read data from the IOC internal queue. An additional queue within the RTE is
not necessary for 1:1 communication.
The IOC generator generates all the send and receive functions. The functions might
be defined as macros for optimization purposes.
This kind of port to port communication without notification is suitable for:
• Sender/receiver communication
• Queued or unqueued communication
• 1:1 communication.
One Software Component invokes a service operation that is provided by another Soft-
ware Component located on a different core. A runnable entity on the receiver side is
activated to calculate the result (see figure 7.25).
The RTE realizes the service on client side by mapping the client/server call to a
sender/receiver communication. Because the communication crosses core bound-
aries, the RTE uses the IOC to transfer the data from Core 0 to Core 1.
On the sending side, the
Rte_Call_<port>_<op> (..., <data>)
call is mapped to a
IocSend_<Id> (<data>)
call to transmit the parameters over the IOC to the core hosting the server runnable.
After writing the data into the IOC internal queue buffer, the Rte_Call function uses
an OS call to notify the receiver by activating the server Task on the receiving core.
This Task is provided by the RTE. This Task body is responsible for reading the data
from the IOC buffer by calling IocReceive function and for forwarding the data to the
server runnable. Depending on the return value of the IOC function, the IocReceive
and server runnable calls might be repeated several times to empty the IOC internal
queued buffer (if specified).
The result of the service on Core 1 is transferred back to the client on Core 0 in a
similar way. The communication path of the result is not displayed in figure 7.25.
This kind of port to port communication with notification by the RTE is suitable for:
• Sender/receiver communication with notification
• Client/server communication. In this case the RTE has to provide services to
map the server call into 1:1 sender/receiver communication for the server call
and another sender/receiver communication to return the result to the client
• Queued or unqueued communication
• 1:1 communication, if the receiver does not poll for data periodically (In this case,
the solution in example 1 might have been more suitable)
• N:1 communication.
Some features are not supported by the first release of this specification, but might get
added in a later release:
• In the future, the IOC will handle direct and efficient communication among BSW
modules or between BSW modules and Software Components (via the RTE)
located in different OS applications. Additional support of direct access from
BSW modules to IOC services will be added.
• Other notification options (like activation of a specified Task on receiver side)
might be added later to the IOC.
In order to customize the operating system to the needs of the user and to take full
advantage of the processor features the operating system can be scaled according to
the following scalability classes
Feature De- Scala- Scala- Scala- Scala- Hardware requirements
scribed bility bility bility bility
in Class 1 Class 2 Class 3 Class 4
Section
OSEK OS (all 7.1 Yes Yes Yes Yes
conformance classes)
Counter Interface 8.4.17 Yes Yes Yes Yes
SWFRT Interface 8.4.18, Yes Yes Yes Yes
8.4.19
ScheduleTables 7.3 Yes Yes Yes Yes
Stack Monitoring 7.5 Yes Yes Yes Yes
ProtectionHook 7.8 Yes Yes Yes
Timing Protection 7.7.2 Yes Yes Timer(s) with high priority interrupt
Global 7.4 Yes Yes Global time source
Time/Synchronization
Support
Memory Protection 7.7.1, Yes Yes MPU
7.7.4
OS-Applications 7.6, Yes Yes
7.12
Service Protection 7.7.3 Yes Yes
CallTrustedFunc- 7.7.5 Yes Yes (Non-)privileged Modes
tion
Table 7.4: Scalability classes
4
Minimum number of 2 8 2 8
ScheduleTables supported
Minimum number of 0 0 2 2
OS-Applications supported
Minimum number of software 8 8 8 8
Counters supported
7.11.2 Requirements
Hook routines as defined in OSEK OS run at the level of the Operating System module
and therefore can only belong to the trusted environment. Furthermore, these hook
routines are global to the system (system-specific) and will probably be supplied by the
ECU integrator.
In AUTOSAR however, each OS-Application may have the need to execute application
specific code e.g. initialize some hardware in its own additional (application-specific)
startup hook. These are called application specific hook routines. In general the appli-
cation specific hooks have the same properties as the hook routines described in the
OSEK OS specification. Differences are described below.
7.12.2 Requirements
[SWS_Os_00439] dThe Operating System module shall provide the OSEK error
macros (OSError...()) to all configured error hooks AND there shall be two (like
in OIL) global configuration parameters to switch these macros on or off.c()
StartupHook
On some MCU architectures, there are memory mapped hardware registers (peripheral
area), which are only accessible in specific modes (e.g. in privileged mode). As long
as a Tasks/ISRs is running with full hardware access they can directly access these
registers. If memory protection is used by the Operating System, Task/ISRs of non-
trusted Os-Applications cannot access such registers directly because this would be
recognized as a memory violation by the Operating System.
To allow access to such registers even from non-trusted applications the Operating
Systems offers the following APIs to read, write and modify registers:
• ReadPeripheral8
• ReadPeripheral16
• ReadPeripheral32
• WritePeripheral8
• WritePeripheral16
• WritePeripheral32
• ModifyPeripheral8
• ModifyPeripheral16
• ModifyPeripheral32
In order to control the access to the registers the access has to be configured for each
OsApplication. By this the Os can check during run-time if a caller has sufficient
rights.
7.13.2 Requirements
The Operating System needs to guarantee the scheduling, wherefore it needs to be the
only component which accesses the interrupt controller. Therefore it provides to other
BSW/CDD components the interfaces DisableInterruptSource, EnableInter-
ruptSource and ClearPendingInterrupt to give access to the interrupt control
registers of category 2 ISRs.
The pair of DisableInterruptSource/EnableInterruptSource may be used
for two different purposes:
1. A specific interrupt should be masked for a short time (potentially to avoid data con-
sistency problems). A masked request shall be served afterwards, once the interrupt
source gets enabled again.
2. Interrupt requests of a specific source should be ignored for a specific time (poten-
tially a longer time e.g. while the CAN driver sleeps). After enabling the source, only
new requests should be considered.
7.14.2 Requirements
[SWS_Os_00808] dThe Operating System shall provide for each category 2 interrupt
source (OsIsrCategory == CATEGORY_2) the APIs DisableInterruptSource,
EnableInterruptSource and ClearPendingInterrupt.c(SRS_Os_11011)
DisableInterruptSource/EnableInterruptSource does not support nested
calls.
[SWS_Os_00809] dNested calls of interrupt source control API
The Operating System shall return E_OS_NOFUNC (in EXTENDED status) in case Dis-
ableInterruptSource is called for an interrupt source which is already disabled or
EnableInterruptSource is called for an interrupt source which is already enabled.c
(SRS_Os_11011)
[SWS_Os_00810] dError handling of interrupt source control API
If the Operating System detects an error while executing a DisableInterrupt-
Source, EnableInterruptSource and ClearPendingInterrupt the OS shall
return the appropriate StatusType and call the ErrorHook. Otherwise E_OK shall
be returned.c(SRS_Os_11011)
[SWS_Os_00811] dA call of EnableInterruptSource shall enable the requested
interrupt source by modifying the interrupt controller registers. Additionally it shall clear
the interrupt pending flag.c(SRS_Os_11011)
4
Type of error Related error code Error value
Deadlock situation due to interference E_OS_INTERFERENCE_DEADLOCK Assigned by
implementation
A Task or Category 2 ISR exceeds its execution E_OS_PROTECTION_TIME Assigned by
time budget implementation
A service of the OS is called inside an interrupt E_OS_DISABLEDINT Assigned by
disable/enable pair. implementation
A Task/Category 2 ISR arrives before its E_OS_PROTECTION_ARRIVAL Assigned by
timeframe has expired implementation
c()
It describes a set of attributes for system objects and a method for interpreting the
data obtained. The types defined in the section are specified to allow the debugger
to determine the target memory access method as well as the best way of displaying
the retrieved data. In most cases the information that the user will require to see is a
textual description of an attribute rather than the actual value read from the variable.
An example of this is as follows; when a user requests the current state of a Task he
will expect to see something like RUNNING, WAITING, READY or SUSPENDED, instead
of the actual numeric value that is used by the OS to represent this information inter-
nally. For this reason a mapping is specified, which allows a kernel manufacturer to
describe how an internal OS value must be mapped to a descriptive value.
• ArtiOs
• ArtiHwCore
• ArtiOsAlarm
• ArtiOsContext
• ArtiOsIsr
• ArtiOsResource
• ArtiOsMessageContainer
• ArtiOsStack
• ArtiOsTask
These objects are declared in Arti containers with definitions named "*Class". The
instances of these objects are placed in the same Arti container with definitions named
"*Instance".
Such an implementation will generate one hook for all the possible combinations of
_className, _eventName and _contextName and pass only parameters instance_id
and event_value at run-time.
The parameters’ meanings are described in the following.
• _contextName Token, literal text, name of the context. One of the following:
– NOSUSP indicating that the hook gets called in a context where interrupts
are disabled
– SPRVSR indicating that the called hook may disable interrupts
– USER indicating the called hook cannot disable interrupts
• _className Token, literal text, name of the class of macros. Predefined classes
for an AUTOSAR OS are:
– AR_CP_OS_APPLICATION starts and stops the application
– AR_CP_OS_TASK schedules Tasks
– AR_CP_OS_CAT2ISR dispatches Category 2 interrupts
– AR_CP_OS_SERVICECALLS calls service routines
– AR_CP_OS_SPINLOCK calls spinlocks
– AR_CP_OS_PROTECTIONHOOK calls ProtectionHook
• _instanceName Short name of the OS instance as defined in the ARXML.
• instanceParameter Index [uint32] 0..4294967295 of the CPU core as seen by the
OS (<Core Index>). Should always start with 0 and count up consecutively. This
might be equal to the index of the physical core, but doesn’t have to be.
• _eventName Token, literal text, name of the event as defined for a particular class.
• eventParameter A [uint32] 0..4294967295 value as an argument to an event.
Therefore all ARTI macros for an AUTOSAR OS do compile the following template:
1 ARTI_TRACE(_contextName, <AR OS Class Name>, <OS Short Name>, <Core
Index>, <Event Name>, <Event Parameter>)
ARTI OS
Initial -
Accessible APPLICATION_ACCESSIBLE
Restarting APPLICATION_RESTARTING
Terminated APPLICATION_TERMINATED
c(RS_ARTIFO_00015)
The <Core ID> for any event shall represent the core id where the corresponding ap-
plication is running on.
The <Event Name> should follow the transition table above.
The <Application ID> shall be a numeric identifier of the OS Application.
ARTI needs to trace all Task states and all state transitions within the OS. For some
timing parameters (e.g. the "runtime" of a Task, which goes from started to termi-
nated), the simple "ready" state of the OS is not enough. Tools evaluating the timings
need to reconstruct a more complex state diagram by calculating the transitions from
history. To be compatible to the pure OS state diagram, AR_CP_OS_TASK refers to
this state model, knowing that tools need to postprocess the event flow to get all rele-
vant information. However, if an OS implementation can provide a more detailed state
diagram, ARTI allows to define more events that won’t need postprocessing and allow
earlier synchronization of the trace if it is truncated (limited trace buffers). This state di-
agram is then handled with the class "AR_CP_OSARTI_TASK". If possible, the second
state machine is to be preferred.
AR_CP_OS_TASK
[SWS_Os_00840] dThe OS shall create events of class AR_CP_OS_TASK to allow
tracing of Tasks.c(RS_ARTIFO_00030)
The following state diagram shows the states and transitions as defined by the OS:
AR_CP_OSARTI_TASK
The class AR_CP_OSARTI_TASK contains events allowing the tracing of OS Tasks
with an enhanced state model.
The following states diagram shows the state machine as used by ARTI:
4
Name Transition Event Name
Release Waiting -> Released OsTask_Release
Continue Released -> Running OsTask_Continue
Terminate Running -> Suspended OsTask_Terminate
c(RS_ARTIFO_00015)
The <Core ID> for any event shall represent the core id where the corresponding Task
is scheduled on.
The <Event Name> should follow the transition table above.
The <Task ID> shall be a numeric identifier of the OS Task.
[SWS_Os_00849] dThe OS shall create events to trace all states of Cat2Isrs and all
state transitions within the OS ("Cat2Isr" refers to a category 2 interrupt service rou-
tine).c(RS_ARTIFO_00031)
For some timing parameters (e.g. the interrupt pending time), the simple Category
2 interrupt start/stop of the OS is not enough. Tools evaluating the timings need to
reconstruct a more complex state diagram by calculating the transitions from history.
To be compatible to the OS, AR_CP_OS_CAT2ISR refers to this state model, knowing
that tools need to postprocess the event flow to get all relevant information. However,
if an OS implementation can provide a more detailed state diagram, ARTI allows to
define more events that won’t need postprocessing and allow earlier synchronization
of the trace if it is truncated (limited trace buffers). This state diagram is then handled
with the class "AR_CP_OSARTI_CAT2ISR". If possible, the second state machine is
to be preferred.
AR_CP_OS_CAT2ISR
The class AR_CP_OS_CAT2ISR contains events allowing the tracing of Category 2
interrupts as defined for the AUTOSAR Classic Platform.
The following state diagram shows the states and transitions as defined by the OS:
AR_CP_OSARTI_CAT2ISR
The class AR_CP_OSARTI_CAT2ISR contains events allowing the tracing of Category
2 interrupts with an enhanced state model.
The following state diagram shows the state machine as used by ARTI:
ARTI OS
Inactive Inactive
Activated Inactive
Running Running
Preempted Running
c(RS_ARTIFO_00015)
The <Core Index> for any event shall represent the core index where the corresponding
Category 2 interrupt is scheduled on.
The <Event Name> should follow the transition table above.
The <Cat2Isr Index> shall be a numeric identifier of the Category 2 interrupt.
c(RS_ARTIFO_00015)
The <Core Index> for any event in the following table shall represent the core id where
the corresponding service call is called.
The <eventName> is a string literal composed of a prefix "OsServiceCall", the ser-
vice call name and "_Start" or "_Return" for the entry or exit of the service call. E.g.
when ActivateTask is called, the event names on entry and exit are OsServiceCall_
ActivateTask_Start rsp. OsServiceCall_ActivateTask_Return.
The <eventParamter> is an uint32 representation of either one of the function param-
eters or the return value. It depends on the service call and is listed in the following
table:
OS Service Call From eventParameter on Start on Return
ActivateTask OSEK TaskID (StatusType) returnValue
TerminateTask OSEK TaskID (StatusType) returnValue
ChainTask OSEK TaskID (StatusType) returnValue
Schedule OSEK 0 (StatusType) returnValue
GetTaskID OSEK 0 (TaskType) *TaskID
GetTaskState OSEK TaskID (TaskStateType) *State
EnableAllInterrupts OSEK 0 0
DisableAllInterrupts OSEK 0 0
ResumeAllInterrupts OSEK 0 0
SuspendAllInterrupts OSEK 0 0
ResumeOSInterrupts OSEK 0 0
SuspendOSInterrupts OSEK 0 0
GetResource OSEK ResID (StatusType) returnValue
ReleaseResource OSEK ResID (StatusType) returnValue
SetEvent OSEK TaskID (StatusType) returnValue
ClearEvent OSEK Mask (StatusType) returnValue
GetEvent OSEK TaskID (EventMaskType) * Event
WaitEvent OSEK Mask (StatusType) returnValue
GetAlarmBase OSEK AlarmID (AlarmBaseRefType) Info
GetAlarm OSEK AlarmID (TickType) *Tick
SetRelAlarm OSEK AlarmID (StatusType) returnValue
SetAbsAlarm OSEK AlarmID (StatusType) returnValue
CancelAlarm OSEK AlarmID (StatusType) returnValue
GetActiveApplication- OSEK 0 (AppModeType) returnValue
Mode
StartOS OSEK Mode not applicable
ShutdownOS OSEK Error not applicable
GetApplicationID AUTOSAR 0 (ApplicationType) return
Value
GetCurrentApplica- AUTOSAR 0 (ApplicationType) return
tionID Value
GetISRID AUTOSAR 0 (ISRType) returnValue
CallTrustedFunction AUTOSAR FunctionIndex (StatusType) returnValue
CheckISRMemoryAccess AUTOSAR ISRID (AccessType) returnValue
5
4
OS Service Call From eventParameter on Start on Return
CheckTaskMemoryAccess AUTOSAR TaskID (AccessType) returnValue
CheckObjectAccess AUTOSAR ApplID (ObjectAccessType) return
Value
CheckObjectOwnership AUTOSAR ObjectTypeType (ApplicationType) return
Value
StartScheduleTableRel AUTOSAR ScheduleTableID (StatusType) returnValue
StartScheduleTableAbs AUTOSAR ScheduleTableID (StatusType) returnValue
StopScheduleTable AUTOSAR ScheduleTableID (StatusType) returnValue
NextScheduleTable AUTOSAR ScheduleTableID_To (StatusType) returnValue
StartScheduleTa- AUTOSAR ScheduleTableID (StatusType) returnValue
bleSynchron
SyncScheduleTable AUTOSAR ScheduleTableID (StatusType) returnValue
SetScheduleTableAsync AUTOSAR ScheduleTableID (StatusType) returnValue
GetScheduleTableSta- AUTOSAR ScheduleTableID (ScheduleTableSta-
tus tusType) *Schedule
Status
IncrementCounter AUTOSAR CounterID (StatusType) returnValue
GetCounterValue AUTOSAR CounterID (TickType) *Value
GetElapsedValue AUTOSAR CounterID (TickType) *ElapsedValue
TerminateApplication AUTOSAR Application (StatusType) returnValue
AllowAccess AUTOSAR 0 (StatusType) returnValue
GetApplicationState AUTOSAR Application (
ApplicationStateType)
*Value
GetNumberOfActivated- AUTOSAR 0 (uint32) returnValue
Cores
GetCoreID AUTOSAR 0 (CoreIdType) returnValue
StartCore AUTOSAR CoreID (StatusType) *Status
StartNonAutosarCore AUTOSAR CoreID (StatusType) *Status
GetSpinlock AUTOSAR SpinlockId (StatusType) returnValue
ReleaseSpinlock AUTOSAR SpinlockId (StatusType) returnValue
TryToGetSpinlock AUTOSAR SpinlockId (
TryToGetSpinlockType)
*Success
ShutdownAllCores AUTOSAR Error 0
ControlIdle AUTOSAR IdleMode (StatusType) returnValue
ReadPeripheral8 AUTOSAR Address (uint8) *ReadValue
ReadPeripheral16 AUTOSAR Address (uint16) *ReadValue
ReadPeripheral32 AUTOSAR Address (uint32) *ReadValue
WritePeripheral8 AUTOSAR Address (StatusType) returnValue
WritePeripheral16 AUTOSAR Address (StatusType) returnValue
WritePeripheral32 AUTOSAR Address (StatusType) returnValue
ModifyPeripheral8 AUTOSAR Address (StatusType) returnValue
ModifyPeripheral16 AUTOSAR Address (StatusType) returnValue
ModifyPeripheral32 AUTOSAR Address (StatusType) returnValue
EnableInterruptSource AUTOSAR ISRID (StatusType) returnValue
DisableInterrupt- AUTOSAR ISRID (StatusType) returnValue
Source
ClearPendingInterrupt AUTOSAR ISRID (StatusType) returnValue
5
4
OS Service Call From eventParameter on Start on Return
ActivateTaskAsyn AUTOSAR id 0
SetEventAsyn AUTOSAR id 0
If the eventParameter of a returning service call is not of type StatusType, and if the
service call does not return E_OK, the hook shall be called with a non-valid value as
eventParameter, to give the hook consuming tool the possibility to detect the failure of
the call.
c(RS_ARTIFO_00015)
The <Core Index> for any event in the following table shall represent the core id where
the corresponding service call is called.
The following events are part of the class AR_CP_OS_SPINLOCK:
c(RS_Arti_00034, RS_ARTIFO_00015)
The <Core Index> for any event in the following table shall represent the core id on
which the corresponding hook function is executed.
The <eventName> is a string literal composed of the prefix OsHook, the hook
function name and _Start or _Return for the entry or exit of the hook function.
E.g. when the ErrorHook is called, the event names on entry and exit are Os-
Hook_ErrorHook_Start respectively OsHook_ErrorHook_Return.
The <eventParamter> is an uint32 representation of either the function parameter
or the return value. It depends on the hook function and is listed in the following table:
The ARTI hook which indicates the exit of the ProtectionHook (e.g. eventName
is OsHook_ProtectionHook_Return) shall be invoked after the OS has checked
the ReturnValue of the ProtectionHook (based on the requirements described in
chapter 7.8.2., for example [SWS_Os_00506] or [SWS_Os_00475]). The eventPa-
rameter of this ARTI hook shall reflect the action which is taken by the OS as a result
of the return value of the ProtectionHook.
8 API specification
This chapter contains the APIs offered by the operating system. Note that not all
services are available in all scalability classes, and that the behavior of some ser-
vices is extended for specific scalability classes. For example, API to relatively start a
ScheduleTable has an additional check if the ScheduleTable allows implicit syn-
chronization. This check is only performed in SC2 and SC4 where synchronization of
ScheduleTables is supported.
8.1 Constants
c()
[SWS_Os_91002] d
Name TotalNumberOfCores
Kind Type
Derived from scalar
Range 1..65535 – –
Description The total number of cores
Available via Os.h
c()
Additional constants are in section 7.15 and [2].
8.2 Macros
OSMEMORY_IS_READABLE(<AccessType>)
OSMEMORY_IS_WRITEABLE(<AccessType>)
OSMEMORY_IS_EXECUTABLE(<AccessType>)
OSMEMORY_IS_STACKSPACE(<AccessType>)
These macros return a value not equal to zero if the memory is readable / writable
/ executable or stack space. The argument of the macros must be of type Ac-
cessType. Typically the return value of the service CheckTaskMemoryAccess (or
CheckISRMemoryAccess) is used as argument for these macros.
[SWS_Os_00772] d
Name ApplicationType
Kind Type
Derived from uint32
Range INVALID_OSAPPLICATION – –
Description This data type identifies the OS-Application.
Available via Os.h
c()
[SWS_Os_00826] dThe range of valid OS-Applications described by Application-
Type shall be zero-based and consecutive. The Value of INVALID_OSAPPLICATION
shall lie outside the range of valid OS-Application IDs.c(SRS_Os_80005)
Note: The OS may use other representations internally for a performance optimal im-
plementation.
8.3.2 ApplicationStateType
[SWS_Os_00773] d
Name ApplicationStateType
Kind Type
Derived from scalar
Range APPLICATION_ACCESSIBLE – –
APPLICATION_RESTARTING – –
APPLICATION_TERMINATED – –
Description This data type identifies the state of an OS-Application.
Available via Os.h
c()
8.3.3 ApplicationStateRefType
[SWS_Os_00774] d
Name ApplicationStateRefType
Kind Type
Derived from pointer
Description This data type points to location where a ApplicationStateType can be stored.
Available via Os.h
c()
8.3.4 TrustedFunctionIndexType
[SWS_Os_00775] d
Name TrustedFunctionIndexType
Kind Type
Derived from scalar
Description This data type identifies a trusted function.
Available via Os.h
c()
8.3.5 TrustedFunctionParameterRefType
[SWS_Os_00776] d
Name TrustedFunctionParameterRefType
Kind Type
Derived from pointer
Description This data type points to a structure which holds the arguments for a call to a trusted function.
Available via Os.h
c()
8.3.6 AccessType
[SWS_Os_00777] d
Name AccessType
Kind Type
Derived from integral
Description This type holds information how a specific memory region can be accessed.
Available via Os.h
c()
8.3.7 ObjectAccessType
[SWS_Os_00778] d
Name ObjectAccessType
Kind Type
Derived from implementation_specific
Range ACCESS – –
NO_ACCESS – –
Description This data type identifies if an OS-Application has access to an object.
Available via Os.h
c()
8.3.8 ObjectTypeType
[SWS_Os_00779] d
Name ObjectTypeType
Kind Type
Derived from implementation_specific
Range OBJECT_TASK – –
OBJECT_ISR – –
OBJECT_ALARM – –
OBJECT_RESOURCE – –
OBJECT_COUNTER – –
OBJECT_SCHEDULETABLE – –
Description This data type identifies an object.
Available via Os.h
c()
8.3.9 MemoryStartAddressType
[SWS_Os_00780] d
Name MemoryStartAddressType
Kind Pointer
Type void*
Description This data type is a pointer which is able to point to any location in the MCU address space.
Available via Os.h
c()
8.3.10 MemorySizeType
[SWS_Os_00781] d
Name MemorySizeType
Kind Type
Derived from implementation_specific
Description This data type holds the size (in bytes) of a memory region.
Available via Os.h
c()
8.3.11 ISRType
[SWS_Os_00782] d
Name ISRType
Kind Type
Derived from implementation_specific
Range INVALID_ISR – –
Description This data type identifies an interrupt service routine (ISR).
Available via Os.h
c()
8.3.12 ScheduleTableType
[SWS_Os_00783] d
Name ScheduleTableType
Kind Type
Derived from implementation_specific
Description This data type identifies a schedule table.
Available via Os.h
c()
8.3.13 ScheduleTableStatusType
[SWS_Os_00784] d
Name ScheduleTableStatusType
Kind Type
Derived from implementation_specific
Range SCHEDULETABLE_STOPPED – –
SCHEDULETABLE_NEXT – –
SCHEDULETABLE_WAITING – –
SCHEDULETABLE_RUNNING – –
SCHEDULETABLE_RUNNING_ – –
AND_SYNCHRONOUS
Description This type describes the status of a schedule. The status can be one of the following: o The
schedule table is not started (SCHEDULETABLE_STOPPED) o The schedule table will be started
after the end of currently running schedule table (schedule table was used in NextScheduleTable()
service) (SCHEDULETABLE_NEXT) o The schedule table uses explicit synchronization, has been
started and is waiting for the global time. (SCHEDULETABLE_WAITING) o The schedule table is
running, but is currently not synchronous to a global time source (SCHEDULETABLE_RUNNING)
o The schedule table is running and is synchronous to a global time source (SCHEDULETABLE_
RUNNING_AND_SYNCHRONOUS)
Available via Os.h
c()
8.3.14 ScheduleTableStatusRefType
[SWS_Os_00785] d
Name ScheduleTableStatusRefType
Kind Pointer
Type ScheduleTableStatusType*
Description This data type points to a variable of the data type ScheduleTableStatusType.
Available via Os.h
c()
8.3.15 ProtectionReturnType
[SWS_Os_00787] d
Name ProtectionReturnType
Kind Type
Derived from implementation_specific
Range PRO_IGNORE – –
PRO_TERMINATETASKISR – –
PRO_TERMINATEAPPL – –
PRO_TERMINATEAPPL_ – –
RESTART
PRO_SHUTDOWN – –
Description This data type identifies a value which controls further actions of the OS on return from the
protection hook.
Available via Os.h
c()
8.3.16 RestartType
[SWS_Os_00788] d
Name RestartType
Kind Type
Derived from implementation_specific
Range RESTART – –
NO_RESTART – –
Description This data type defines the use of a Restart Task after terminating an OS-Application.
Available via Os.h
c()
8.3.17 PhysicalTimeType
[SWS_Os_00789] d
Name PhysicalTimeType
Kind Type
Derived from implementation_specific
Description This data type is used for values returned by the conversion macro (see SWS_Os_00393) OS_
TICKS2<Unit>_<Counter>().
Available via Os.h
c()
8.3.18 CoreIdType
[SWS_Os_00790] d
Name CoreIdType
Kind Type
Derived from scalar
Range OS_CORE_ID_MASTER – refers to the master core, may be
an alias for OS_CORE_ID_<x>
OS_CORE_ID_0..OS_CORE_ – refers to logical core 0, core 1 etc.
ID_65533
Description CoreIdType is a scalar that allows identifying a single core. The CoreIdType shall represent the
logical CoreID
Available via Os.h
c()
[SWS_Os_00825] dThe range of valid Core-IDs described by CoreIdType shall be
zero-based and consecutive.c(SRS_Os_80011)
8.3.19 SpinlockIdType
[SWS_Os_00791] d
Name SpinlockIdType
Kind Type
Derived from scalar
Range 1..65535 – 0x01, 0x02, ...: identifies a
spinlock instance
INVALID_SPINLOCK 0 represents an invalid spinlock
instance
Description SpinlockIdType identifies a spinlock instance and is used by the API functions: GetSpinlock,
ReleaseSpinlock and TryToGetSpinlock.
Available via Os.h
c()
8.3.20 TryToGetSpinlockType
[SWS_Os_00792] d
Name TryToGetSpinlockType
Kind Enumeration
Range TRYTOGETSPINLOCK_ – Spinlock successfully occupied
SUCCESS
5
4
TRYTOGETSPINLOCK_ – Unable to occupy the spinlock
NOSUCCESS
Description The TryToGetSpinlockType indicates if the spinlock has been occupied or not.
Available via Os.h
c(SRS_Os_80021)
8.3.21 IdleModeType
[SWS_Os_00793] d
Name IdleModeType
Kind Type
Derived from scalar
Range IDLE_NO_HALT – the core does not perform any
specific actions during idle time
Description This data type identifies the idle mode behavior.
Available via Os.h
c()
8.3.22 AreaIdType
[SWS_Os_91000] d
Name AreaIdType
Kind Type
Derived from scalar
Range 0..65534 – identifies a peripheral area
Description AreaIdType identifies a peripheral area and is used by the API functions: ReadPeripheralX, Write
PeripheralX and ModifyPeripheralX
Available via Os.h
c()
8.4.1 GetApplicationID
[SWS_Os_00016] d
Service Name GetApplicationID
Syntax ApplicationType GetApplicationID (
void
)
c()
[SWS_Os_00261] dGetApplicationID shall return the application identifier to
which the executing Task/ISR/hook was configured.c()
[SWS_Os_00262] dIf no OS-Application is running, GetApplicationID shall return
INVALID_OSAPPLICATION.c()
[SWS_Os_00514] dAvailability of GetApplicationID: Available in Scalability
Classes 3 and 4 and in multi-core systems.c()
8.4.2 GetCurrentApplicationID
[SWS_Os_00797] d
Service Name GetCurrentApplicationID
Syntax ApplicationType GetCurrentApplicationID (
void
)
4
Description This service determines the OS-Application where the caller of the service is currently
executing. Note that if the caller is not within a CallTrustedFunction() call the value is equal to
the result of GetApplicationID().
Available via Os.h
c()
[SWS_Os_00798] dGetCurrentApplicationID shall return the application identi-
fier in which the current Task/ISR/hook is executed.c()
[SWS_Os_00799] dIf no OS-Application is running, GetCurrentApplicationID
shall return INVALID_OSAPPLICATION.c()
[SWS_Os_00800] dAvailability of GetCurrentApplicationID: Available in Scala-
bility Classes 3 and 4.c()
8.4.3 GetISRID
[SWS_Os_00511] d
Service Name GetISRID
Syntax ISRType GetISRID (
void
)
c()
[SWS_Os_00263] dIf called from category 2 ISR (or Hook routines called inside a
category 2 ISR), GetISRID shall return the identifier of the currently executing ISR.c
()
[SWS_Os_00264] dIf its caller is not a category 2 ISR (or Hook routines called inside
a category 2 ISR), GetISRID shall return INVALID_ISR.c()
[SWS_Os_00515] dAvailability of GetISRID: Available in all Scalability Classes.c()
8.4.4 CallTrustedFunction
[SWS_Os_00097] d
Service Name CallTrustedFunction
Syntax StatusType CallTrustedFunction (
TrustedFunctionIndexType FunctionIndex,
TrustedFunctionParameterRefType FunctionParams
)
c()
[SWS_Os_00265] dIf <FunctionIndex> is a defined function index, CallTrusted-
Function shall call the function <FunctionIndex> out of a list of implementation spe-
cific trusted functions with the protection settings of the OS-Application which provides
the trusted function AND shall return E_OK after completion.c()
[SWS_Os_00312] dCaveats of CallTrustedFunction:
• The called trusted function must conform to the following C prototype: void
TRUSTED_<name_of_the_trusted_service>( TrustedFunctionIndex
Type,TrustedFunctionParameterRefType); (The arguments are the
same as the arguments of CallTrustedFunction).
• Normally, a user will not directly call this service, but it will be part of some stan-
dard interface, e.g. a standard I/O interface.
• It is the duty of the called trusted function to check rights of passed parameters,
especially if parameters are interpreted as out parameters.
• It should be noted that the CallTrustedFunction does not disable timing pro-
tection for the Task which called the service. This may lead to timing faults (calls
of the ProtectionHook) even inside of a trusted OS-Application. It is therefore
recommended to use CallTrustedFunction only for stateless functions (e.g.
functions which do not write or do not have internal states)
c()
8.4.5 CheckISRMemoryAccess
[SWS_Os_00512] d
Service Name CheckISRMemoryAccess
Syntax AccessType CheckISRMemoryAccess (
ISRType ISRID,
MemoryStartAddressType Address,
MemorySizeType Size
)
c()
[SWS_Os_00267] dIf the ISR reference <ISRID> in a call of CheckISRMemoryAc-
cess is valid, CheckISRMemoryAccess shall return the access rights of the ISR on
the specified memory area.c()
[SWS_Os_00313] dIf an access right (e.g. "read") is not valid for the whole memory
area specified in a call of CheckISRMemoryAccess, CheckISRMemoryAccess shall
yield no access regarding this right.c()
[SWS_Os_00268] dIf the ISR reference <ISRID> is not valid, CheckISRMemoryAc-
cess shall yield no access rights.c()
[SWS_Os_00517] dAvailability of CheckISRMemoryAccess: Available in Scalability
Classes 3 and 4.c()
8.4.6 CheckTaskMemoryAccess
[SWS_Os_00513] d
Service Name CheckTaskMemoryAccess
5
4
Syntax AccessType CheckTaskMemoryAccess (
TaskType TaskID,
MemoryStartAddressType Address,
MemorySizeType Size
)
c()
[SWS_Os_00269] dIf the Task reference <TaskID> in a call of CheckTaskMemo-
ryAccess is valid, CheckTaskMemoryAccess shall return the access rights of the
Task on the specified memory area.c()
[SWS_Os_00314] dIf an access right (e.g. "read") is not valid for the whole memory
area specified in a call of CheckTaskMemoryAccess, CheckTaskMemoryAccess
shall yield no access regarding this right.c()
[SWS_Os_00270] dIf the Task reference <TaskID> in a call of CheckTaskMemory-
Access is not valid, CheckTaskMemoryAccess shall yield no access rights.c()
[SWS_Os_00518] dAvailability of CheckTaskMemoryAccess: Available in Scalability
Classes 3 and 4c()
8.4.7 CheckObjectAccess
[SWS_Os_00256] d
Service Name CheckObjectAccess
Syntax ObjectAccessType CheckObjectAccess (
ApplicationType ApplID,
ObjectTypeType ObjectType,
void ...
)
4
Reentrancy Reentrant
Parameters (in) ApplID OS-Application identifier
ObjectType Type of the following parameter
... The object to be examined
Parameters (inout) None
Parameters (out) None
Return value ObjectAccessType ACCESS if the ApplID has access to the object
NO_ACCESS otherwise
Description This service determines if the OS-Applications, given by ApplID, is allowed to use the IDs of a
Task, Resource, Counter, Alarm or Schedule Table in API calls.
Available via Os.h
c()
[SWS_Os_00271] dIf the OS-Application <ApplID> in a call of CheckObjectAccess
has access to the queried object, CheckObjectAccess shall return ACCESS.c()
[SWS_Os_00272] dIf the OS-Application <ApplID> in a call of CheckObjectAccess
has no access to the queried object, CheckObjectAccess shall return NO_ACCESS.c
()
[SWS_Os_00423] dIf in a call of CheckObjectAccess the object to be examined is
not a valid object OR <ApplID> is invalid OR <ObjectType> is invalid THEN CheckOb-
jectAccess shall return NO_ACCESS.c()
[SWS_Os_00519] dAvailability of CheckObjectAccess: Available in Scalability
Classes 3 and 4.c()
8.4.8 CheckObjectOwnership
[SWS_Os_00017] d
Service Name CheckObjectOwnership
Syntax ApplicationType CheckObjectOwnership (
ObjectTypeType ObjectType,
void ...
)
4
Return value ApplicationType <OS-Application>: the OS-Application to which the object Object
Type belongs or
INVALID_OSAPPLICATION if the object does not exists
Description This service determines to which OS-Application a given Task, ISR, Counter, Alarm or
Schedule Table belongs
Available via Os.h
c()
[SWS_Os_00273] dIf the object <ObjectType> specified in a call of CheckObjec-
tOwnership exists, CheckObjectOwnership shall return the identifier of the OS-
Application to which the object belongs.c()
[SWS_Os_00274] dIf in a call of CheckObjectOwnership the specified object <Ob-
jectType> is invalid OR the argument of the type (the ". . . ") is invalid OR the object does
not belong to any OS-Application, CheckObjectOwnership shall return INVALID_
OSAPPLICATION.c()
[SWS_Os_00520] dAvailability of CheckObjectOwnership: Available in Scalability
Classes 3 and 4 and in multi-core systems.c()
8.4.9 StartScheduleTableRel
[SWS_Os_00347] d
Service Name StartScheduleTableRel
Syntax StatusType StartScheduleTableRel (
ScheduleTableType ScheduleTableID,
TickType Offset
)
c()
8.4.10 StartScheduleTableAbs
[SWS_Os_00358] d
Service Name StartScheduleTableAbs
Syntax StatusType StartScheduleTableAbs (
ScheduleTableType ScheduleTableID,
TickType Start
)
4
Return value StatusType E_OK: No Error
E_OS_ID (only in EXTENDED status): ScheduleTableID not valid
E_OS_VALUE (only in EXTENDED status): "Start" is greater
than OsCounterMaxAllowedValue
E_OS_STATE: Schedule table was already started
Description This service starts the processing of a schedule table at an absolute value "Start" on the
underlying counter.
Available via Os.h
c()
[SWS_Os_00348] dIf the ScheduleTable <ScheduleTableID> in a call of
StartScheduleTableAbs is not valid, StartScheduleTableAbs shall return
E_OS_ID.c()
[SWS_Os_00349] dIf the <Start> in a call of StartScheduleTableAbs is greater
than the OsCounterMaxAllowedValue of the underlying Counter, StartSched-
uleTableAbs shall return E_OS_VALUE.c()
[SWS_Os_00350] dIf the ScheduleTable <ScheduleTableID> in a call of
StartScheduleTableAbs is not in the state SCHEDULETABLE_STOPPED,
StartScheduleTableAbs shall return E_OS_STATE.c()
[SWS_Os_00351] dIf the input parameters of StartScheduleTableAbs are valid
and <ScheduleTableID> is in the state SCHEDULETABLE_STOPPED, StartSched-
uleTableAbs shall start the processing of ScheduleTable <ScheduleTableID>
when the underlying Counter next equals <Start> and shall set the state of <Schedule
TableID> to
- SCHEDULETABLE_RUNNING (for a non-synchronized / Explicitly synchronized
ScheduleTable) OR
- SCHEDULETABLE_RUNNING_AND_SYNCHRONOUS (for implicitly synchronized
ScheduleTable)
before returning to the user. (The Initial Expiry Point will be processed when the un-
derlying Counter next equals <Start>+Initial Offset).c()
[SWS_Os_00522] dAvailability of StartScheduleTableAbs: Available in all Scala-
bility Classes.c()
8.4.11 StopScheduleTable
[SWS_Os_00006] d
Service Name StopScheduleTable
5
4
Syntax StatusType StopScheduleTable (
ScheduleTableType ScheduleTableID
)
c()
[SWS_Os_00279] dIf the ScheduleTable identifier <ScheduleTableID> in a call of
StopScheduleTable is not valid, StopScheduleTable shall return E_OS_ID.c()
[SWS_Os_00280] dIf the ScheduleTable with identifier <ScheduleTableID> is in
state SCHEDULETABLE_STOPPED when calling StopScheduleTable, StopSched-
uleTable shall return E_OS_NOFUNC.c()
[SWS_Os_00281] dIf the input parameters of StopScheduleTable are valid,
StopScheduleTableshall set the state of <ScheduleTableID> to SCHED-
ULETABLE_STOPPED and (stop the ScheduleTable <ScheduleTableID> from pro-
cessing any further expiry points and) shall return E_OK.c()
[SWS_Os_00523] dAvailability of StopScheduleTable: Available in all Scalability
Classes.c()
8.4.12 NextScheduleTable
[SWS_Os_00191] d
Service Name NextScheduleTable
Syntax StatusType NextScheduleTable (
ScheduleTableType ScheduleTableID_From,
ScheduleTableType ScheduleTableID_To
)
4
Parameters (in) ScheduleTableID_From Currently processed schedule table
ScheduleTableID_To Schedule table that provides its series of expiry points
Parameters (inout) None
Parameters (out) None
Return value StatusType E_OK: No error
E_OS_ID (only in EXTENDED status): ScheduleTableID_From or
ScheduleTableID_To
not valid
E_OS_NOFUNC: ScheduleTableID_From not started
E_OS_STATE: ScheduleTableID_To is started or next
Description This service switches the processing from one schedule table to another schedule table.
Available via Os.h
c(SRS_Os_00099)
[SWS_Os_00282] dIf the input parameter <ScheduleTableID_From> or <ScheduleTa-
bleID_To> in a call of NextScheduleTable is not valid, NextScheduleTable shall
return E_OS_ID.c()
[SWS_Os_00330] dIf in a call of NextScheduleTable ScheduleTable <Schedule
TableID_To> is driven by different Counter than ScheduleTable <ScheduleTable
ID_From> then NextScheduleTable shall return an error E_OS_ID.c()
[SWS_Os_00283] dIf the ScheduleTable <ScheduleTableID_From> in a call of
NextScheduleTable is in state SCHEDULETABLE_STOPPED OR in state SCHED-
ULETABLE_NEXT, NextScheduleTable shall leave the state of <ScheduleTable_
From> and <ScheduleTable_To> unchanged and return E_OS_NOFUNC.c()
[SWS_Os_00309] dIf the ScheduleTable <ScheduleTableID_To> in a call of
NextScheduleTable is not in state SCHEDULETABLE_STOPPED, NextSched-
uleTable shall leave the state of <ScheduleTable_From> and <ScheduleTable_To>
unchanged and return E_OS_STATE.c()
[SWS_Os_00484] dIf OsScheduleTblSyncStrategy of <ScheduleTableID_To> in
a call of NextScheduleTable is not equal to the OsScheduleTblSyncStrategy
of <ScheduleTableID_From> then NextScheduleTable shall return E_OS_ID.c()
[SWS_Os_00284] dIf the input parameters of NextScheduleTable are valid then
NextScheduleTable shall start the processing of ScheduleTable <ScheduleTa-
bleID_To> <ScheduleTableID_From>.FinalDelay ticks after the Final Expiry Point on
<ScheduleTableID_From> is processed and shall return E_OK. NextScheduleTable
shall process the Initial Expiry Point on <ScheduleTableID_To> at <ScheduleTableID_
From>.Final Delay + <ScheduleTable_To>.Initial Offset ticks after the Final Expiry Point
on <ScheduleTableID_From> is processed .c()
[SWS_Os_00324] dIf the input parameters of NextScheduleTable are valid AND the
<ScheduleTableID_From> already has a "next" ScheduleTable then NextSched-
uleTableshall replace the previous "next" ScheduleTable with <ScheduleTa-
bleID_To> and shall change the old "next" ScheduleTable state to SCHED-
ULETABLE_STOPPED.c()
8.4.13 StartScheduleTableSynchron
[SWS_Os_00201] d
Service Name StartScheduleTableSynchron
Syntax StatusType StartScheduleTableSynchron (
ScheduleTableType ScheduleTableID
)
c(SRS_Os_11002)
[SWS_Os_00387] dIf in a call of StartScheduleTableSynchron the Sched-
uleTable <ScheduleTableID> is not valid OR the ScheduleTable <ScheduleTable
ID> is not explicitly synchronized (OsScheduleTblSyncStrategy != EXPLICIT)
StartScheduleTableSynchron shall return E_OS_ID.c()
[SWS_Os_00388] dIf the ScheduleTable <ScheduleTableID> in a call of
StartScheduleTableSynchron is not in the state SCHEDULETABLE_STOPPED,
StartScheduleTableSynchron shall return E_OS_STATE.c()
[SWS_Os_00389] dIf <ScheduleTableID> in a call of StartScheduleTableSyn-
chron is valid, StartScheduleTableSynchron shall set the state of <Schedule
TableID> to SCHEDULETABLE_WAITING and start the processing of ScheduleTable
<ScheduleTableID> after the synchronization count of the ScheduleTable is set via
8.4.14 SyncScheduleTable
[SWS_Os_00199] d
Service Name SyncScheduleTable
Syntax StatusType SyncScheduleTable (
ScheduleTableType ScheduleTableID,
TickType Value
)
c(SRS_Os_11002)
[SWS_Os_00454] dIf the <ScheduleTableID> in a call of SyncScheduleTable is
not valid OR ScheduleTable can not be explicitely synchronized (OsScheduleT-
blSyncStrategy is not equal to EXPLICIT) SyncScheduleTable shall return
E_OS_ID.c()
8.4.15 SetScheduleTableAsync
[SWS_Os_00422] d
Service Name SetScheduleTableAsync
Syntax StatusType SetScheduleTableAsync (
ScheduleTableType ScheduleTableID
)
c()
[SWS_Os_00362] dIf SetScheduleTableAsync is called for a running Sched-
uleTable, the Operating System module shall stop further synchronization until a
SyncScheduleTable call is made.c()
[SWS_Os_00323] dIf SetScheduleTableAsync is called for a running Sched-
uleTable the Operating System module shall continue to process expiry points on
the ScheduleTable.c()
[SWS_Os_00458] dIf OsScheduleTblSyncStrategy of <ScheduleTableID> in a
call of SetScheduleTableAsync is not equal to EXPLICIT OR if <ScheduleTable
ID> is invalid then SetScheduleTableAsync shall return E_OS_ID.c()
8.4.16 GetScheduleTableStatus
[SWS_Os_00227] d
Service Name GetScheduleTableStatus
Syntax StatusType GetScheduleTableStatus (
ScheduleTableType ScheduleTableID,
ScheduleTableStatusRefType ScheduleStatus
)
c(SRS_Os_11002)
[SWS_Os_00289] dIf the ScheduleTable <ScheduleTableID> in a call of
GetScheduleTableStatus is NOT started, GetScheduleTableStatus shall
pass back SCHEDULETABLE_STOPPED via the reference parameter <ScheduleStatus>
AND shall return E_OK.c()
[SWS_Os_00353] dIf the ScheduleTable <ScheduleTableID> in a call of
GetScheduleTableStatus was used in a NextScheduleTable call AND waits
for the end of the current ScheduleTable, GetScheduleTableStatus shall return
SCHEDULETABLE_NEXT via the reference parameter <ScheduleStatus> AND shall re-
turn E_OK.c()
8.4.17 IncrementCounter
[SWS_Os_00399] d
Service Name IncrementCounter
Syntax StatusType IncrementCounter (
CounterType CounterID
)
c()
8.4.18 GetCounterValue
[SWS_Os_00383] d
Service Name GetCounterValue
Syntax StatusType GetCounterValue (
CounterType CounterID,
TickRefType Value
)
c(SRS_Frt_00025)
[SWS_Os_00376] dIf the input parameter <CounterID> in a call of GetCounter-
Value is not valid, GetCounterValue shall return E_OS_ID.c()
[SWS_Os_00377] dIf the input parameter <CounterID> in a call of GetCounter-
Value is valid, GetCounterValue shall return the current tick value of the Counter
via <Value> and return E_OK.c(SRS_Frt_00033)
8.4.19 GetElapsedValue
[SWS_Os_00392] d
Service Name GetElapsedValue
Syntax StatusType GetElapsedValue (
CounterType CounterID,
TickRefType Value,
TickRefType ElapsedValue
)
c(SRS_Frt_00025)
[SWS_Os_00381] dIf the input parameter <CounterID> in a call of GetElapsed-
Value is not valid GetElapsedValue shall return E_OS_ID.c()
[SWS_Os_00391] dIf the <Value> in a call of GetElapsedValue is larger than
the max allowed value of the <CounterID>, GetElapsedValue shall return
E_OS_VALUE.c()
[SWS_Os_00382] dIf the input parameters in a call of GetElapsedValue are valid,
GetElapsedValue shall return the number of elapsed ticks since the given <Value>
value via <ElapsedValue> and shall return E_OK.c(SRS_Frt_00034)
[SWS_Os_00460] dGetElapsedValue shall return the current tick value of the
Counter in the <Value> parameter.c()
8.4.20 TerminateApplication
[SWS_Os_00258] d
Service Name TerminateApplication
Syntax StatusType TerminateApplication (
ApplicationType Application,
RestartType RestartOption
)
c()
[SWS_Os_00493] dIf the input parameter <Application> in a call of TerminateAp-
plication is not valid TerminateApplication shall return E_OS_ID.c()
[SWS_Os_00459] dIf the <RestartOption> in a call of TerminateApplication is
invalid, TerminateApplication shall return E_OS_VALUE.c()
[SWS_Os_00494] dIf the input parameter <Application> in a call of TerminateAp-
plication is valid AND the caller belongs to a non-trusted OS-Application AND
the caller does not belong to <Application> TerminateApplication shall return
E_OS_ACCESS.c()
8.4.21 AllowAccess
[SWS_Os_00501] d
c()
[SWS_Os_00497] dIf the state of the OS-Application of the caller of AllowAccess is
not APPLICATION_RESTARTING AllowAccess shall return E_OS_STATE.c()
[SWS_Os_00498] dIf the state of the OS-Application of the caller of AllowAc-
cess is APPLICATION_RESTARTING, AllowAccess shall set the state to APPLICA-
TION_ACCESSIBLE and allow other OS-Applications to access the configured objects
of the callers OS-Application.c()
[SWS_Os_00547] dAvailability of AllowAccess: Available in Scalability Classes 3
and 4.c()
8.4.22 GetApplicationState
[SWS_Os_00499] d
Service Name GetApplicationState
Syntax StatusType GetApplicationState (
ApplicationType Application,
ApplicationStateRefType Value
)
4
Description This service returns the current state of an OS-Application.
Available via Os.h
c()
[SWS_Os_00495] dIf the <Application> in a call of GetApplicationState is not
valid GetApplicationState shall return E_OS_ID.c()
[SWS_Os_00496] dIf the parameters in a call of GetApplicationState are valid,
GetApplicationState shall return the state of OS-Application <Application> in
<Value>.c()
[SWS_Os_00537] dAvailability of GetApplicationState: Available in Scalability
Classes 3 and 4.c()
8.4.23 GetNumberOfActivatedCores
[SWS_Os_00672] d
Service Name GetNumberOfActivatedCores
Syntax uint32 GetNumberOfActivatedCores (
void
)
8.4.24 GetCoreID
[SWS_Os_00674] d
c(SRS_Os_80001)
[SWS_Os_00675] dThe function GetCoreID shall return the unique logical CoreID of
the core on which the function is called. The mapping of physical cores to logical Core
IDs is implementation specific.c(SRS_Os_80001)
8.4.25 StartCore
[SWS_Os_00676] d
Service Name StartCore
Syntax void StartCore (
CoreIdType CoreID,
StatusType* Status
)
[SWS_Os_00677] dThe function StartCore shall start one core that shall run under
the control of the AUTOSAR OS.c(SRS_Os_80006, SRS_Os_80026, SRS_Os_80027)
[SWS_Os_00678] dCalls to the StartCore function after StartOS shall return with
E_OS_ACCESS and the core shall not be started.c(SRS_Os_80006, SRS_Os_80026,
SRS_Os_80027)
[SWS_Os_00679] dIf the parameter CoreIDs refers to a core that was already started
by the function StartCore the related core is ignored and E_OS_STATE shall be
returned.c(SRS_Os_80006, SRS_Os_80026, SRS_Os_80027)
[SWS_Os_00680] dIf the parameter CoreID refers to a core that was already started
by the function StartNonAutosarCore the related core is ignored and E_OS_STATE
shall be returned.c(SRS_Os_80006, SRS_Os_80026, SRS_Os_80027)
[SWS_Os_00681] dThere is no call to the ErrorHook if an error occurs during
StartCore.c(SRS_Os_80006, SRS_Os_80026, SRS_Os_80027)
8.4.26 StartNonAutosarCore
[SWS_Os_00682] d
Service Name StartNonAutosarCore
Syntax void StartNonAutosarCore (
CoreIdType CoreID,
StatusType* Status
)
[SWS_Os_00684] dIf the parameter CoreID refers to a core that was already
started by the function StartNonAutosarCore has no effect and sets "Status" to
E_OS_STATE.c(SRS_Os_80006, SRS_Os_80026, SRS_Os_80027)
[SWS_Os_00685] dIf the parameter CoreID refers to an unknown core the function
StartNonAutosarCore has no effect and sets "Status" to E_OS_ID.c(SRS_Os_-
80006, SRS_Os_80026, SRS_Os_80027)
8.4.27 GetSpinlock
[SWS_Os_00686] d
Service Name GetSpinlock
Syntax StatusType GetSpinlock (
SpinlockIdType SpinlockId
)
c(SRS_Os_80021)
[SWS_Os_00687] dThe function GetSpinlock shall occupy a spinlock. If the spinlock
is already occupied the function shall busy wait until the spinlock becomes available.c
(SRS_Os_80021)
[SWS_Os_00688] dThe function GetSpinlock shall return E_OK if no error was de-
tected. The spinlock is now occupied by the calling Task/Category 2 ISR on the calling
core.c(SRS_Os_80021)
[SWS_Os_00689] dThe function GetSpinlock shall return E_OS_ID if the parameter
SpinlockID refers to a spinlock that does not exist.c(SRS_Os_80021)
8.4.28 ReleaseSpinlock
[SWS_Os_00695] d
Service Name ReleaseSpinlock
Syntax StatusType ReleaseSpinlock (
SpinlockIdType SpinlockId
)
c(SRS_Os_80021)
[SWS_Os_00696] dThe function ReleaseSpinlock shall release a spinlock that has
been occupied by the same (calling) Task. If the related GetSpinlock call used
configured locks (OsSpinlockLockMethod) the function shall also perform the undo
of the used lock.c(SRS_Os_80021)
[SWS_Os_00697] dThe function ReleaseSpinlock shall return E_OK if no error was
detected. The spinlock is now free and can be occupied by the same or other Tasks.c
(SRS_Os_80021)
[SWS_Os_00698] dThe function ReleaseSpinlock shall return E_OS_ID if the pa-
rameter SpinlockID refers to a spinlock that does not exist.c(SRS_Os_80021)
[SWS_Os_00699] dThe function ReleaseSpinlock shall return E_OS_STATE if the
parameter SpinlockID refers to a spinlock that is not occupied by the calling Task.c
(SRS_Os_80021)
[SWS_Os_00700] dThe function ReleaseSpinlock shall return E_OS_ACCESS if the
Task has no access to the spinlock referred by the parameter SpinlockIDc(SRS_Os_-
80021)
[SWS_Os_00701] dThe function ReleaseSpinlock shall return E_OS_NOFUNC if the
Task tries to release a spinlock while another spinlock (or Resource) has to be re-
leased before. No functionality shall be performed.c(SRS_Os_80021)
8.4.29 TryToGetSpinlock
[SWS_Os_00703] d
Service Name TryToGetSpinlock
Syntax StatusType TryToGetSpinlock (
SpinlockIdType SpinlockId,
TryToGetSpinlockType* Success
)
4
Available via Os.h
c(SRS_Os_80021)
[SWS_Os_00704] dThe function TryToGetSpinlock shall atomically test the avail-
ability of the spinlock and if available occupy it. The result of success is returned.c
(SRS_Os_80021)
[SWS_Os_00705] dThe function TryToGetSpinlock shall set the OUT parameter
"Success" to TRYTOGETSPINLOCK_SUCCESS if the spinlock was successfully occu-
pied, and TRYTOGETSPINLOCK_NOSUCCESS if not. In both cases E_OK shall be re-
turned.c(SRS_Os_80021)
[SWS_Os_00706] dIf the function TryToGetSpinlock does not return E_OK, the
OUT parameter "Success" shall be undefined.c(SRS_Os_80021)
[SWS_Os_00707] dThe function TryToGetSpinlock shall return E_OS_ID if the pa-
rameter SpinlockID refers to a spinlock that does not exist.c(SRS_Os_80021)
[SWS_Os_00708] dThe function TryToGetSpinlock shall return
E_OS_INTERFERENCE_DEADLOCK if the spinlock referred by the parameter Spinlock
ID is already occupied by a Task on the same core.c(SRS_Os_80021)
[SWS_Os_00709] dThe function TryToGetSpinlock shall return
E_OS_NESTING_DEADLOCK if a Task tries to occupy a spinlock while holding a
different spinlock in a way that may cause a deadlock.c(SRS_Os_80021)
[SWS_Os_00710] dThe function TryToGetSpinlock shall return E_OS_ACCESS if
the Task has no access to the spinlock referred by the parameter SpinlockIDc(SRS_-
Os_80021)
[SWS_Os_00711] dIt shall be allowed to call the function TryToGetSpinlock while
interrupts are disabled.c(SRS_Os_80021)
[SWS_Os_00712] dIt shall be allowed to call the function TryToGetSpinlock while
a Resource is occupied.c(SRS_Os_80021)
8.4.30 ShutdownAllCores
[SWS_Os_00713] d
Service Name ShutdownAllCores
Syntax void ShutdownAllCores (
StatusType Error
)
4
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) Error <Error> needs to be a valid error code supported by the
AUTOSAR OS.
Parameters (inout) None
Parameters (out) None
Return value None
Description After this service the OS on all AUTOSAR cores is shut down. Allowed at TASK level and ISR
level and also internally by the OS. The function will never return. The function will force other
cores into a shutdown.
Available via Os.h
c(SRS_Os_80007)
[SWS_Os_00714] dA synchronized shutdown shall be triggered by the API function
ShutdownAllCores.c(SRS_Os_80007)
[SWS_Os_00715] dShutdownAllCores shall not return.c(SRS_Os_80007)
[SWS_Os_00716] dIf ShutdownAllCores is called from non trusted code the call
shall be ignored.c(SRS_Os_80007)
8.4.31 ControlIdle
[SWS_Os_00769] d
Service Name ControlIdle
Syntax StatusType ControlIdle (
CoreIdType CoreID,
IdleModeType IdleMode
)
c()
[SWS_Os_00770] dThe function ControlIdle shall return E_OK if no error was de-
tected and the parameters are validc(SRS_Os_80023)
[SWS_Os_00771] dThe function ControlIdle shall return E_OS_ID if the parameter
CoreID or IdleMode is invalid (e.g. refered core does not exist; idle mode is not known).
In single core systems the check of CoreID shall be omitted.c(SRS_Os_80023)
[SWS_Os_00802] dIf the core (given by CoreID) is already in another idle mode (dif-
ferent to the given IdleMode) the new IdleMode shall become effective the next time
that core enters the idle mode.c(SRS_Os_80023)
[SWS_Os_91013] d
Service Name ReadPeripheral8
Syntax StatusType ReadPeripheral8 (
AreaIdType Area,
const uint8* Address,
uint8* ReadValue
)
c(SRS_Os_11005)
[SWS_Os_91015] d
Service Name ReadPeripheral16
Syntax StatusType ReadPeripheral16 (
AreaIdType Area,
const uint16* Address,
uint16* ReadValue
)
5
4
Service ID [hex] 0x29
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) Area hardware peripheral area reference
Address memory address
Parameters (inout) None
Parameters (out) ReadValue content of the given memory location (<Address>)
Return value StatusType E_OK No error
E_OS_ID Area id is out of range (EXTENDED status)
E_OS_VALUE Address does not belong to given Area
(EXTENDED status)
E_OS_CALLEVEL Wrong call context of the API function
(EXTENDED status)
E_OS_ACCESS The calling task or ISR is not allowed to access
the given
Description This service returns the content of a given memory location (<Address>).
Available via Os.h
c(SRS_Os_11005)
[SWS_Os_91014] d
Service Name ReadPeripheral32
Syntax StatusType ReadPeripheral32 (
AreaIdType Area,
const uint32* Address,
uint32* ReadValue
)
c(SRS_Os_11005)
[SWS_Os_91010] d
Service Name WritePeripheral8
Syntax StatusType WritePeripheral8 (
AreaIdType Area,
uint8* Address,
uint8 WriteValue
)
c(SRS_Os_11005)
[SWS_Os_91012] d
Service Name WritePeripheral16
Syntax StatusType WritePeripheral16 (
AreaIdType Area,
uint16* Address,
uint16 WriteValue
)
4
Return value StatusType E_OK No error
E_OS_ID Area id is out of range (EXTENDED status)
E_OS_VALUE Address does not belong to given Area
(EXTENDED status)
E_OS_CALLEVEL Wrong call context of the API function
(EXTENDED status)
E_OS_ACCESS The calling task or ISR is not allowed to access
the given
Description This service writes the <value> to a given memory location (<memory address>).
Available via Os.h
c(SRS_Os_11005)
[SWS_Os_91011] d
Service Name WritePeripheral32
Syntax StatusType WritePeripheral32 (
AreaIdType Area,
uint32* Address,
uint32 WriteValue
)
c(SRS_Os_11005)
[SWS_Os_91016] d
Service Name ModifyPeripheral8
5
4
Syntax StatusType ModifyPeripheral8 (
AreaIdType Area,
uint8* Address,
uint8 Clearmask,
uint8 Setmask
)
c(SRS_Os_11005)
[SWS_Os_91018] d
Service Name ModifyPeripheral16
Syntax StatusType ModifyPeripheral16 (
AreaIdType Area,
uint16* Address,
uint16 Clearmask,
uint16 Setmask
)
4
Return value StatusType E_OK No error
E_OS_ID Area id is out of range (EXTENDED status)
E_OS_VALUE Address does not belong to given Area
(EXTENDED status)
E_OS_CALLEVEL Wrong call context of the API function
(EXTENDED status)
E_OS_ACCESS The calling task or ISR is not allowed to access
the given
Description This service modifies a given memory location (<memory address>) with the formula:
*<Address> = ((*<Address> & <clearmask>) | <setmask>)
Available via Os.h
c(SRS_Os_11005)
[SWS_Os_91017] d
Service Name ModifyPeripheral32
Syntax StatusType ModifyPeripheral32 (
AreaIdType Area,
uint32* Address,
uint32 Clearmask,
uint32 Setmask
)
c(SRS_Os_11005)
8.4.35 EnableInterruptSource
[SWS_Os_91020] d
c(SRS_Os_11011)
8.4.36 DisableInterruptSource
[SWS_Os_91019] d
Service Name DisableInterruptSource
Syntax StatusType DisableInterruptSource (
ISRType ISRID
)
4
Available via Os.h
c(SRS_Os_11011)
8.4.37 ClearPendingInterrupt
[SWS_Os_91021] d
Service Name ClearPendingInterrupt
Syntax StatusType ClearPendingInterrupt (
ISRType ISRID
)
c(SRS_Os_11011)
8.4.38 ActivateTaskAsyn
[SWS_Os_91022] d
Service Name ActivateTaskAsyn
Syntax void ActivateTaskAsyn (
TaskType id
)
4
Parameters (out) None
Return value None
Description Asynchronous version of the ActivateTask() function. Intended to be used for cross core task
activation. Possible errors are not returned to the caller, but may be reported via error hooks.
Available via Os.h
c(SRS_Os_80015)
[SWS_Os_00818] dAvailability of ActivateTaskAsyn: Available in systems which
support OS-Applications.c(SRS_Os_80015)
Note: If during the Task activation an error occurs, and the caller is already gone (e.g.
callers OS-Application is already terminated, OR callers core is shutting down OR ...)
calls to error hooks are dropped and no reporting is done.
8.4.39 SetEventAsyn
[SWS_Os_91023] d
Service Name SetEventAsyn
Syntax void SetEventAsyn (
TaskType id,
EventMaskType m
)
c(SRS_Os_80015)
[SWS_Os_00819] dAvailability of SetEventAsyn: Available in systems which support
OS-Applications.c(SRS_Os_80015)
Note: If during the event setting an error occurs and the caller is already gone (e.g.
callers OS-Application is already terminated, OR callers core is shutting down OR ...)
calls to error hooks are dropped and no reporting is done.
8.5 IOC
In this chapter all types included from the following modules are listed:
[SWS_Os_91029] d
Module Header File Imported Type
Std Std_Types.h Std_ReturnType
c()
[SWS_Os_00827] dIf an ImplementationDataType is defined with the typeEmitter
empty or set to RTE and is used for IOC communication, the IOC shall include Rte_
Type.hc(SRS_Os_80020)
[SWS_Os_00828] dIf an ImplementationDataType is defined with the typeEmitter
!= RTE and does end with ".h" and is used for IOC communication, the IOC shall
include specified header file.c(SRS_Os_80020)
None
8.5.3 Constants
4
IOC_E_LOST_DATA Queued Std_ReturnType Overlayed Error In case of "event"
(queued) semantic,
RCV RTE_E_LOST_DATA /
this Overlayed Error
64
indicates that the IOC
service refuses an
IocSend request due
to internal buffer
overflow.
IOC_E_NO_DATA Queued Std_ReturnType RTE_E_NO_DATA / In case of "event"
131 (queued) semantic,
RCV
no data is available
for reception.
[SWS_Os_00805] : dThe optional length parameter of the API shall be generated if the
VariableDataPrototype is of type dynamic and no size indicator is used in the according
ApplicationArrayDataType.c(SRS_Os_80020)
[SWS_Os_91026]{DRAFT} d
Service Name IocInit (draft)
Syntax void IocInit (
void
)
c()
8.5.4.2 IocSend/IocWrite
The IocWrite API call is generated for "data" (unqueued) semantics and the Ioc-
Send API call is generated for "event" (queued) semantics.
[SWS_Os_00718] d
c(SRS_Os_80020)
[SWS_Os_91003] d
Service Name IocWrite_<IocId>[_<SenderId>]
Syntax Std_ReturnType IocWrite_<IocId>[_<SenderId>] (
<Data> IN,
[uint16 numberOfBytesIN]
)
4
Parameters (in) IN Data value to be sent over a communication identified by the <Ioc
Id>. The parameter will be passed by value for primitive data
elements and by reference for all other types.
Example: Std_ReturnType IocWrite_RTE_25 (const uint32 UI_
Value); Std_ReturnType IocWrite_RTE_42 (const TASKParams3
*pStr_Value);
numberOfBytesIN (optional) number of bytes to be send
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType IOC_E_OK: The data has been passed successfully to the
communication service.
IOC_E_LENGTH: The <numberOfBytesIN> exceeds either the
internal buffer or is equal zero, so no data is send.
Description Performs an "explicit" sender-receiver transmission of data elements with "data" semantic for a
unidirectional 1:1 or N:1 communication between OS-Applications located on the same or on
different cores.
<IocId> is a unique identifier that references a unidirectional 1:1 or N:1 communication.
<SenderId> is used only in N:1 communication. Together with <IocId>, it uniquely identifies the
sender. It is separated from <IocId> with an underscore. In case of 1:1 communication, it shall
be omitted.
<numberOfBytesIN> specifies the size of the data to be transmitted (in bytes).
Available via Ioc.h
c()
General:
[SWS_Os_00719] dIocSend/IocWrite is asynchronous in that way it shall not have
to wait for the reception of the data on the receiving side to return from execution.c
(SRS_Os_80020)
[SWS_Os_00720] dThe IocSend/IocWrite function shall not return until the data
given in parameter have been completely physically sent over the communication
medium.
For example in case of communication over shared RAM, an IocSend/IocWrite shall
return when all data have been copied in the target shared RAM.c(SRS_Os_80020)
[SWS_Os_00721] dIn case of "event" (queued) semantic, the IocSend function shall
guarantee the order of delivery. In case of senders from different cores, the order in
which messages are received will be determined by the implementation.c(SRS_Os_-
80020)
[SWS_Os_00722] dThe IocSend/IocWrite function shall support mechanism to
guarantee data-Integrity during transmission.
The IocSend/IocWrite function shall solve the crossing of the protection boundaries
of OS-Applications. It has to be generated in case of intra-core and inter-core commu-
nication.c(SRS_Os_80020)
[SWS_Os_00820] dThe IocSend/IocWrite function shall be wrapped with the mem-
ory allocation keywords mechanism
1 #define OS_<IE>_START_SEC_CODE
2 #include "Os_MemMap.h"
3
4 <IocSend, IocWrite>
5
6 #define OS_<IE>_STOP_SEC_CODE
7 #include "Os_MemMap.h"
8.5.4.3 IocSendGroup/IocWriteGroup
The IocWriteGroup API call is generated for "data" (unqueued) semantics and the
IocSendGroup API call is generated for "event" (queued) semantics.
[SWS_Os_00728] d
Parameters (in) IN1 List of parameters with data values to be sent over a
communication identified by the <IocId>. The parameters will be
passed by value for simple data elements and by reference for all
other types.
Example:
Std_ReturnType IocSendGroup_RTE_G1 (const uint32 UI_
Value1, const uint16 Value2, const uint8 Value3, const uint16
Value4);
numberOfBytesIN1 (optional) number of bytes for parameter IN1 to be send.
IN2 –
numberOfBytesIN2 –
–
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType IOC_E_OK: The data has been passed successfully to the
communication service.
IOC_E_LIMIT: IOC internal communication buffer is full (Case:
Receiver is slower than sender). This error produces an IOC_E_
LOST_DATA Overlayed Error on the receiver side at the next data
reception.
IOC_E_LENGTH: Al least one of the <numberOfBytesIN<x>>
exceeds either the internal buffer or is equal zero, so no data is
send.
Description Performs an "explicit" sender-receiver transmission of data elements with "event" semantic for a
unidirectional 1:1 communication between OS-Applications located on the same or on different
cores.
This API involves a group of data elements which values are specified in parameter.
<IocId> is a unique identifier that references a unidirectional 1:1 communication involving many
data elements.
The optional parameter <numberOfBytesIN<x>> specifies the size of the data to be transmitted
(in bytes) for parameter <IN<x>>.
Available via Ioc.h
c(SRS_Os_80020)
[SWS_Os_91004] d
Service Name IocWriteGroup_<IocId>
5
4
Syntax Std_ReturnType IocWriteGroup_<IocId> (
<Data1> IN1,
[uint16 numberOfBytesIN1],
<Data2> IN2,
[uint16 numberOfBytesIN2],
...
)
Parameters (in) IN1 List of parameters with data values to be sent over a
communication identified by the <IocId>. The parameters will be
passed by value for simple data elements and by reference for all
other types.
Example:
Std_ReturnType IocWriteGroup_RTE_G1 (const uint32 UI_
Value1, const uint16 Value2, const uint8 Value3, const uint16
Value4);
numberOfBytesIN1 (optional) number of bytes for parameter IN1 to be send.
IN2 –
numberOfBytesIN2 –
–
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType IOC_E_OK: The data has been passed successfully to the
communication service.
IOC_E_LENGTH: Al least one of the <numberOfBytesIN<x>>
exceeds either the internal buffer or is equal zero, so no data is
send.
Description Performs an "explicit" sender-receiver transmission of data elements with "data" semantic for a
unidirectional 1:1 communication between OS-Applications located on the same or on different
cores.
This API involves a group of data elements which values are specified in parameter.
<IocId> is a unique identifier that references a unidirectional 1:1 communication involving many
data elements.
The optional parameter <numberOfBytesIN<x>> specifies the size of the data to be transmitted
(in bytes) for parameter <IN<x>>.
Available via Ioc.h
c()
General:
[SWS_Os_00729] dIocSendGroup/IocWriteGroup is asynchronous in that way it
shall not have to wait for the reception of the data on the receiving side to return from
execution.c(SRS_Os_80020)
[SWS_Os_00730] dThe IocSendGroup/IocWriteGroup function shall not return
until the data given in parameter have been completely physically sent over the com-
munication medium. For example in case of communication over shared RAM, an
IocSendGroup/IocWriteGroup shall return when all data have been copied in the
target shared RAM.c(SRS_Os_80020)
[SWS_Os_00731] dIn case of "event" semantic, the IocSendGroup function shall
guarantee the order of delivery.c(SRS_Os_80020)
[SWS_Os_00732] dThe IocSendGroup/IocWriteGroup function shall support
mechanisms to guarantee data-Integrity during transmission.
The IocSendGroup/IocWriteGroup function shall solve the crossing of the protec-
tion boundaries of OS-Applications. It has to be generated in case of intra-core and
inter-core communication.c(SRS_Os_80020)
[SWS_Os_00821] dThe IocSendGroup/IocWriteGroup function shall be wrapped
with the memory allocation keywords mechanism
1 #define OS_<IE>_START_SEC_CODE
2 #include "Os_MemMap.h"
3
4 <IocSendGroup, IocWriteGroup>
5
6 #define OS_<IE>_STOP_SEC_CODE
7 #include "Os_MemMap.h"
[SWS_Os_00737] dIn case of "event" semantic the IOC shall configure its internal
transmission buffer size with the value of the attribute OsIocBufferLength.c(SRS_-
Os_80020)
8.5.4.4 IocReceive/IocRead
The IocRead API call is generated for "data" and the IocReceive API call is gener-
ated for "events".
[SWS_Os_00738] d
Service Name IocReceive_<IocId>
Syntax Std_ReturnType IocReceive_<IocId> (
<Data> OUT,
[uint16* numberOfBytesOUT]
)
c(SRS_Os_80020)
[SWS_Os_91005] d
Service Name IocRead_<IocId>[_<ReceiverId>]
Syntax Std_ReturnType IocRead_<IocId>[_<ReceiverId>] (
<Data> OUT,
[uint16* numberOfBytesOUT]
)
4
Sync/Async Synchronous
Reentrancy Non Reentrant This function is generated individually for each receiver. The individual function
is not reentrant (if called from different runnable entities that belong to the same receiver), but
different functions can be called in parallel.
Parameters (in) None
Parameters (inout) None
Parameters (out) OUT Data reference to be filled with the received data element.
numberOfBytesOUT (optional) data reference to be filled with the length of the
received data element in bytes.
Return value Std_ReturnType IOC_E_OK: Data was received successfully
Description Performs an "explicit" sender-receiver reception of data elements with "data" semantic for a
unidirectional communication between OS-Applications located on the same or on different
cores.
<IocId> is a unique identifier that references a unidirectional 1:1 or N:1 communication.
<ReceiverId> is used only in N:M communication. Together with <IocId>, it uniquely identifies
the receiver. It is separated from <IocId> with an underscore. If communication is different from
N:M it shall be omitted.
Available via Ioc.h
c()
General:
[SWS_Os_00739] dA successful call to the IocReceive/IocRead function indicates
that data has been received successfully in the OUT <Data> given in parameter.
The IocReceive/IocRead function has to be generated in case of intra-core and
inter-core communication.c(SRS_Os_80020)
[SWS_Os_00822] dThe IocReceive/IocRead function shall be wrapped with the
memory allocation keywords mechanism
1 #define OS_<IE>_START_SEC_CODE
2 #include "Os_MemMap.h"
3
4 <IocReceive, IocRead>
5
6 #define OS_<IE>_STOP_SEC_CODE
7 #include "Os_MemMap.h"
8.5.4.5 IocReceiveGroup/IocReadGroup
The IocReadGroup API call is generated for "data" and the IocReceiveGroup API
call is generated for "events".
[SWS_Os_00746] d
Service Name IocReceiveGroup_<IocId>
Syntax Std_ReturnType IocReceiveGroup_<IocId> (
<Data1> OUT1,
[uint16* numberOfBytesOUT1],
<Data2> OUT2,
[uint16* numberOfBytesOUT2],
...
)
4
–
Return value Std_ReturnType IOC_E_OK: Data was received successfully
IOC_E_NO_DATA: No data is available for reception.
IOC_E_LOST_DATA: This Overlayed Error indicates that the IOC
communication service refused an IOCSend request from sender
due to an internal buffer overflow. There is no error in the data
returned in parameter.
Description Performs an "explicit" sender-receiver transmission of data elements with "event" semantic for a
unidirectional 1:1 communication between OS-Applications located on the same or on different
cores.
This API involves a group of data elements which values are specified in parameter.
<IocId> is a unique identifier that references a unidirectional 1:1 communication involving many
data elements.
Available via Ioc.h
c(SRS_Os_80020)
[SWS_Os_91006] d
Service Name IocReadGroup_<IocId>
Syntax Std_ReturnType IocReadGroup_<IocId> (
<Data1> OUT1,
[uint16* numberOfBytesOUT1],
<Data2> OUT2,
[uint16* numberOfBytesOUT2],
...
)
Parameters (out) OUT1 List of data references to be filled with the received data
elements. The specified order of the parameter shall match to the
specified order in the corresponding send function.
numberOfBytesOUT1 (optional) data reference to be filled with the length of the
received data element (OUT1) in bytes.
OUT2 –
numberOfBytesOUT2 –
–
Return value Std_ReturnType IOC_E_OK: Data was received successfully
Description Performs an "explicit" sender-receiver transmission of data elements with a "data" semantic for
a unidirectional 1:1 communication between OS-Applications located on the same or on
different cores.
This API involves a group of data elements which values are specified in parameter.
<IocId> is a unique identifier that references a unidirectional 1:1 communication involving many
data elements.
Available via Ioc.h
c()
General:
[SWS_Os_00747] dA successful call to the IocReceiveGroup/IocReadGroup func-
tion indicates that data has been received successfully in the given parameters.
The IocReceiveGroup/IocReadGroup function has to be generated in case of intra-
core and inter-core communication.c(SRS_Os_80020)
[SWS_Os_00823] dThe IocReceiveGroup/IocReadGroup function shall be
wrapped with the memory allocation keywords mechanism
1 #define OS_<IE>_START_SEC_CODE
2 #include "Os_MemMap.h"
3
4 <IocReceiveGroup, IocReadGroup>
5
6 #define OS_<IE>_STOP_SEC_CODE
7 #include "Os_MemMap.h"
8.5.4.6 IocEmptyQueue
[SWS_Os_00754] d
Service Name IocEmptyQueue_<IocId>
Syntax Std_ReturnType IocEmptyQueue_<IocId> (
void
)
c(SRS_Os_80020)
General:
[SWS_Os_00755] dThe function IocEmptyQueue_<IocId> shall be present for all IOC
elements with queued semantics.c(SRS_Os_80020)
[SWS_Os_00756] dThe function IocEmptyQueue_<IocId> shall delete all contents
from the associated data queue.
The IocEmptyQueue should be generated in a more efficient way than an iterative
call to an IocReceive function.c(SRS_Os_80020)
8.6.2.1 ReceiverPullCB
[SWS_Os_00757] d
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) None
Return value None
Description This callback function can be configured for the receiver of a communication. If configured, IOC
calls this callback on the receiving core for each data reception. <ReceiverPullCB> is the
callback function name configured by the receiver in the OsIocReceiverPullCB attribute to be
called on data reception."
Available via Os.h
c(SRS_Os_80020)
[SWS_Os_00758] dThe <ReceiverPullCB> function name shall be defined within a
configuration file for each IOC communication in the OsIocReceiverPullCB at-
tribute.c(SRS_Os_80020)
[SWS_Os_00759] dThe name of the callback shall be unique over the micro controller.
For this purpose the following example can be considered as orientation for the IOC
user:
Example: Rte_IocReceiveCB_<IocId>c(SRS_Os_80020)
[SWS_Os_00760] dThe <ReceiverPullCB> function on the receiver side is using the
access rights of the receiving OsApplication.c(SRS_Os_80020)
Note: This means that such a callback cannot be reused by another OsApplication.
[SWS_Os_00761] dThis notification mechanism shall be supported for both queued
and unqueued communication semantic.c(SRS_Os_80020)
The owner of the <ReceiverPullCB> function shall pay attention that the execution time
of the function shall not last too long. It shall be possible to call this function from an
IOC-ISR.
8.7.1 ProtectionHook
[SWS_Os_00538] d
Service Name ProtectionHook
Syntax ProtectionReturnType ProtectionHook (
StatusType Fatalerror
)
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) Fatalerror The error which caused the call to the protection hook
Parameters (inout) None
Parameters (out) None
Return value ProtectionReturnType PRO_IGNORE
PRO_TERMINATETASKISR
PRO_TERMINATEAPPL
PRO_TERMINATEAPPL_RESTART
PRO_SHUTDOWN
The return value defines the action the OS shall take after the
protection hook.
Description The protection hook is always called if a serious error occurs. E.g. exceeding the worst case
execution time or violating against the memory protection.
Available via Os_Externals.h
c()
Depending on the return value the Operating System module will either:
• forcibly terminate the Task/Category 2 ISR which causes the problem OR
• forcibly terminate the OS-Application the Task/Category 2 ISR belong (optional
with restart) OR
• shutdown the system OR
• do nothing
(see 7.8.2)
[SWS_Os_00308] dIf ProtectionHook returns an invalid value, the Operating Sys-
tem module shall take the same action as if no protection hook is configured.c()
[SWS_Os_00542] dAvailability of ProtectionHook: Available in Scalability Classes
2, 3 and 4.c()
[SWS_Os_00539] d
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) None
Return value None
Description The application specific startup hook is called during the start of the OS (after the user has
started the OS via StartOS()).
Available via Os_Externals.h
c()
The application specific StartupHook is always called after the standard Star-
tupHook (see [SWS_Os_00236]). If more than one OS-Application is configured
which use startup hooks, the order of calls to the startup hooks of the different OS-
Applications is not defined.
[SWS_Os_00543] dAvailability of StartupHook_<App>: Available in Scalability
Classes 3 and 4.c()
[SWS_Os_00540] d
Service Name ErrorHook_<App>
Syntax void ErrorHook_<App> (
StatusType Error
)
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) Error The error which caused the call to the error hook
Parameters (inout) None
Parameters (out) None
Return value None
Description The application specific error hook is called whenever a Task or Category 2 ISR which belongs
to the OS-Application causes an error.
Available via Os_Externals.h
c()
If the general ErrorHook is configured, the general ErrorHook is called before the
application specific error hook is called (see [SWS_Os_00246]).
[SWS_Os_00541] d
Service Name ShutdownHook_<App>
Syntax void ShutdownHook_<App> (
StatusType Fatalerror
)
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) Fatalerror The error which caused the action to shut down the operating
system.
Parameters (inout) None
Parameters (out) None
Return value None
Description The application specific shutdown hook is called whenever the system starts the shut down of
itself.
Available via Os_Externals.h
c()
If the general ShutdownHook is configured, the general ShutdownHook is called after
all application specific shutdown hook(s) are called (see [SWS_Os_00237]). If more
OS-Applications with an application specific shutdown hook exist the order of calls to
these application specific shutdown hooks is not defined.
[SWS_Os_00545] dAvailability of ShutdownHook_<App>: Available in Scalability
Classes 3 and 4.c()
[SWS_Os_91027] d
Name OsService
Kind ProvidedPort Interface OsService_{Counter}
Description –
Port Defined Type CounterType
Argument Value(s)
Value {ecuc(Os/OsCounter)}
Variation –
c()
8.8.2 Client-Server-Interfaces
8.8.2.1 Os_Service
[SWS_Os_00560] d
Name OsService_{Counter}
Comment –
IsService true
Variation ({ecuc(Os/OsCounter/OsSecondsPerTick)} != NULL)
Counter = {ecuc(Os/OsCounter.SHORT-NAME)}
Operation GetCounterValue
Comment This service reads the current count value of a counter (returning either the hardware timer
ticks if counter is driven by hardware or the software ticks when user drives counter).
Variation –
Parameters Value
Type TimeInMicrosecondsType
Direction OUT
Comment Contains the current tick value of the counter
Variation –
Possible Errors E_OK
E_OS_ID
Operation GetElapsedValue
Comment This service gets the number of ticks between the current tick value and a previously read tick
value.
Variation –
Value
Parameters
Type TimeInMicrosecondsType
Direction INOUT
Comment in: the previously read tick value of the counter
out: the current tick value of the counter
Variation –
ElapsedValue
Type TimeInMicrosecondsType
Direction OUT
Comment The difference to the previous read value
Variation –
Possible Errors E_OK
E_OS_ID
E_OS_VALUE
c()
[SWS_Os_00794] d
Name TimeInMicrosecondsType
Kind Type
Derived from uint64
Description –
Variation –
Available via Rte_Os_Type.h
c()
[SWS_Os_00786] d
Name CounterType
Kind Type
Derived from uint32
Description This data type identifies a counter.
Variation –
Available via Rte_Os_Type.h
c()
9 Sequence diagrams
The above sequence chart shows the sequence of error hook calls in case a service
does not return with E_OK. Note that in this case the general error hook and the OS-
Application specific error hook are called.
The sequence shows the flow of control if a protection error occurs. Depending on the
return values of the ProtectionHook, either the faulty Task/ISR is forcibly terminated
or the OS-Application is forcibly terminated or the system is shut down. If the action is
to terminate the faulty OS-Application an option is to start afterwards the restart Task,
which can do a cleanup, etc.
The above sequence shows the flow of control during the startup of the OS. Like in
OSEK OS the user calls the StartOS service to start the OS. During the startup the
startup hooks are called in the above order. The rest of the startup sequence is identi-
cal to the defined behaviour of OSEK OS.
The 9.6 shows a sequence of successful and failure cases in the interaction between
the IOC and the RTE in case of last-is-best communication ("data" semantic).
The figure 9.7 shows the interaction between IOC and RTE with a focus on the con-
gestion control for a queued communication.
The defined communication has no callback functionality for data reception, has an
internal buffer size of 2 data elements, no waitpoints are defined and the implicated
OS-Applications are located on different cores.
The figure 9.8 shows the interaction between IOC and RTE in case of a queued com-
munication with an activated callback functionality. The RTE might handle notification
internally and might therefore not provide any callback functions, but a similar scenario
will occur in case of communication between CDDs on different cores. The receiving
CDD will provide the callback function in this case.
The defined communication has no waitpoints and describes a communication impli-
cating two OS-Applications located on different cores.
10 Configuration specification
In general, this chapter defines configuration parameters and their clustering into con-
tainers. In order to support the specification Chapter 10.1 describes fundamentals.
It also specifies a template (table) you shall use for the parameter specification. We
intend to leave Chapter 10.1 in the specification to guarantee comprehension.
Chapter 10.2 specifies the structure (containers) and the parameters of the module Os.
Chapter 10.3 specifies the structure (containers) and the parameters of the Ioc.
Chapter 10.4 specifies the structure (containers) and the ARTI parameters for the Os
and Ioc.
Chapter 10.5 specifies published information of the module Os.
Some configuration parameters are configured as floating point values and sometimes
these values must be rounded in order to be used. The following rules define the
rounding of specific parameters:
• Execution times (for the timing protection) are "round down"
• Timeframes are "round down"
10.2.1 Os
upperMultiplicity = *
OsTask: lowerMultiplicity = 0
+container EcucParamConfContainerDef
upperMultiplicity = *
lowerMultiplicity = 0
OsIsr:
+container EcucParamConfContainerDef
upperMultiplicity = *
OsScheduleTable: lowerMultiplicity = 0
+container EcucParamConfContainerDef
upperMultiplicity = *
lowerMultiplicity = 0
OsResource:
+container EcucParamConfContainerDef
upperMultiplicity = *
OsAlarm: lowerMultiplicity = 0
+container EcucParamConfContainerDef
upperMultiplicity = *
lowerMultiplicity = 0
OsCounter:
+container
EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = *
OsEvent: OsEventMask:
+container EcucParamConfContainerDef +parameter EcucIntegerParamDef
upperMultiplicity = * upperMultiplicity = 1
lowerMultiplicity = 0 lowerMultiplicity = 0
min = 0
OsAppMode:
+container EcucParamConfContainerDef
upperMultiplicity = *
lowerMultiplicity = 1
OsIoc:
+container EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
OsSpinlock:
+container EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = *
OsPeripheralAreaId:
OsPeripheralArea: +parameter
EcucIntegerParamDef
EcucParamConfContainerDef
symbolicNameValue = true
upperMultiplicity = 65534
lowerMultiplicity = 0
+parameter OsPeripheralAreaStartAddress:
EcucIntegerParamDef
min = 0
+container
+parameter OsPeripheralAreaEndAddress:
EcucIntegerParamDef
min = 0
OsPeripheralAreaAccessingApplication:
+reference EcucReferenceDef
upperMultiplicity = *
lowerMultiplicity = 0
10.2.2 OsAlarmSetEvent
No Included Containers
10.2.3 OsAlarm
Included Containers
Container Name Multiplicity Scope / Dependency
OsAlarmAction 1 This container defines which type of notification is used
when the alarm expires.
OsAlarmAutostart 0..1 If present this container defines if an alarm is started
automatically at system start-up depending on the
application mode.
OsAlarmAlarmTime:
OsAlarmAutostart: +parameter
OsAlarm: EcucIntegerParamDef
EcucParamConfContainerDef
EcucParamConfContainerDef
min = 0
upperMultiplicity = 1
upperMultiplicity = *
lowerMultiplicity = 0
lowerMultiplicity = 0 OsAlarmAppModeRef: OsAppMode:
+reference +destination EcucParamConfContainerDef
EcucReferenceDef
upperMultiplicity = * upperMultiplicity = *
lowerMultiplicity = 1 lowerMultiplicity = 1
min = 0
+literal RELATIVE:
EcucEnumerationLiteralDef
upperMultiplicity = 1
lowerMultiplicity = 0
+reference OsAlarmCounterRef: +destination
EcucReferenceDef
OsAlarmAccessingApplication: OsApplication:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
upperMultiplicity = * upperMultiplicity = *
lowerMultiplicity = 0 lowerMultiplicity = 0
10.2.4 OsAlarmAction
Container Choices
Container Name Multiplicity Scope / Dependency
OsAlarmActivateTask 0..1 This container specifies the parameters to activate a
task.
OsAlarmCallback 0..1 This container specifies the parameters to call a callback
OS alarm action.
OsAlarmIncrement 0..1 This container specifies the parameters to increment a
Counter counter.
OsAlarmSetEvent 0..1 This container specifies the parameters to set an event
10.2.5 OsAlarmActivateTask
No Included Containers
10.2.6 OsAlarmAutostart
No Included Containers
10.2.7 OsAlarmCallback
No Included Containers
10.2.8 OsAlarmIncrementCounter
No Included Containers
10.2.9 OsApplication
Included Containers
Container Name Multiplicity Scope / Dependency
OsApplicationHooks 1 Container to structure the OS-Application-specific hooks
OsApplicationTrusted 0..* Container to structure the configuration parameters of
Function trusted functions
OsRestartTask: EcucReferenceDef
+reference
upperMultiplicity = 1
lowerMultiplicity = 0 +destination
OsTask:
EcucParamConfContainerDef
OsAppCounterRef: OsCounter:
+reference EcucReferenceDef EcucParamConfContainerDef
+destination
upperMultiplicity = * lowerMultiplicity = 0
lowerMultiplicity = 0 upperMultiplicity = *
OsAppAlarmRef:
+reference EcucReferenceDef
+destination OsAlarm:
upperMultiplicity = * EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = *
lowerMultiplicity = 0
OsAppEcucPartitionRef:
+reference EcucReferenceDef EcucPartition:
+destination
EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1 lowerMultiplicity = 0
upperMultiplicity = *
OsTrusted: EcucBooleanParamDef
+parameter
defaultValue = false
OsApplicationTrustedFunction:
+subContainer EcucParamConfContainerDef
upperMultiplicity = *
+parameter OsTrustedApplicationDelayTimingViolationCall: lowerMultiplicity = 0
EcucBooleanParamDef
defaultValue = true
OsTrustedApplicationWithProtection:
+parameter EcucBooleanParamDef
defaultValue = false
OsApplicationCoreRef: EcucCoreDefinition:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
OsApplicationHooks:
+subContainer EcucParamConfContainerDef
+reference
+reference
OsMemoryMappingCodeLocationRef:
+reference EcucForeignReferenceDef
destinationType = SW-ADDR-METHOD
lowerMultiplicity = 0 +reference
upperMultiplicity = 1
10.2.10 OsApplicationHooks
No Included Containers
upperMultiplicity = *
lowerMultiplicity = 0
+parameter OsAppShutdownHook:
EcucBooleanParamDef
+parameter OsAppErrorHook:
EcucBooleanParamDef
OsMemoryMappingCodeLocationRef:
+reference EcucForeignReferenceDef
destinationType = SW-ADDR-METHOD
lowerMultiplicity = 0
+reference
upperMultiplicity = 1
ARElement
AtpBlueprint
AtpBlueprintable
SwAddrMethod
10.2.11 OsApplicationTrustedFunction
No Included Containers
OsApplicationTrustedFunction: OsTrustedFunctionName:
EcucParamConfContainerDef EcucFunctionNameDef
+parameter
upperMultiplicity = *
lowerMultiplicity = 0
+reference ARElement
AtpBlueprint
OsMemoryMappingCodeLocationRef: AtpBlueprintable
EcucForeignReferenceDef SwAddrMethod
10.2.12 OsAppMode
No Included Containers
10.2.13 OsCounter
Included Containers
Container Name Multiplicity Scope / Dependency
OsDriver 0..1 This Container contains the information who will drive
the counter. This configuration is only valid if the counter
has OsCounterType set to HARDWARE.
OsCounterMinCycle:
+parameter EcucIntegerParamDef
OsCounter:
EcucParamConfContainerDef min = 1
lowerMultiplicity = 0
upperMultiplicity = * +parameter OsCounterMaxAllowedValue:
EcucIntegerParamDef
min = 1
OsCounterTicksPerBase:
+parameter
EcucIntegerParamDef
min = 1
max = 4294967295
+literal SOFTWARE:
EcucEnumerationLiteralDef
OsDriver:
EcucParamConfContainerDef
OsGptChannelRef: EcucReferenceDef GptChannelConfiguration:
+subContainer lowerMultiplicity = 0 +reference +destination
EcucParamConfContainerDef
upperMultiplicity = 1 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true lowerMultiplicity = 1
OsCounterAccessingApplication: OsApplication:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
upperMultiplicity = * upperMultiplicity = *
lowerMultiplicity = 0 lowerMultiplicity = 0
10.2.14 OsEvent
Default Value
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X All Variants
Configuration Class
Link time –
Post-build time –
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: local
No Included Containers
10.2.15 OsDriver
If the container exists the OS can use the GPT interface to manage the
timer. The user have to supply the GPT channel.
If the counter is driven by some other (external to the OS) source (like
a TPU for example) this must be described as a vendor specific
extension.
Configuration Parameters
No Included Containers
10.2.16 OsHooks
No Included Containers
OsHooks: +parameter
OsOS: OsStartupHook:
EcucParamConfContainerDef
EcucParamConfContainerDef EcucBooleanParamDef
+parameter OsShutdownHook:
EcucBooleanParamDef
+parameter OsPreTaskHook:
EcucBooleanParamDef
+subContainer
+parameter OsPostTaskHook:
EcucBooleanParamDef
OsProtectionHook:
+parameter
EcucBooleanParamDef
upperMultiplicity = 1
lowerMultiplicity = 0
+parameter OsErrorHook:
EcucBooleanParamDef
OsMemoryMappingCodeLocationRef:
+reference EcucForeignReferenceDef
destinationType = SW-ADDR-METHOD
lowerMultiplicity = 0
upperMultiplicity = 1
ARElement
AtpBlueprint
AtpBlueprintable
SwAddrMethod
10.2.17 OsIsr
This value is information, e.g. for time base calculations in the RTE in
case TimingEvents are mapped onto this OsIsr. Be aware, that this
parameter is not supposed to be relevant for the OS! It’s the
responsibility of the integrator to ensure the activation of the ISR
according the configured period. This information is given as part of
the OS configuration to support configuration work flows using a fixed
set of OsIsrs.
Multiplicity 0..1
Type EcucFloatParamDef
Range [-INF .. INF]
Default Value
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X All Variants
Configuration Class
Link time –
Post-build time –
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: ECU
Included Containers
Container Name Multiplicity Scope / Dependency
OsIsrTimingProtection 0..1 This container contains all parameters which are related
to timing protection
+literal
OsIsrCategory: CATEGORY_1:
OsIsr: EcucEnumerationLiteralDef
+parameter EcucEnumerationParamDef
EcucParamConfContainerDef
+literal
CATEGORY_2:
upperMultiplicity = * EcucEnumerationLiteralDef
lowerMultiplicity = 0
OsResource:
OsIsrResourceRef: +destination EcucParamConfContainerDef
+reference EcucReferenceDef
upperMultiplicity = *
upperMultiplicity = * lowerMultiplicity = 0
lowerMultiplicity = 0
+destination
OsIsrTimingProtection:
EcucParamConfContainerDef OsIsrResourceLock: +reference OsIsrResourceLockResourceRef:
EcucParamConfContainerDef EcucReferenceDef
lowerMultiplicity = 0 +subContainer
upperMultiplicity = 1
lowerMultiplicity = 0
upperMultiplicity = * +parameter OsIsrResourceLockBudget:
EcucFloatParamDef
min = 0
max = INF
+subContainer
OsIsrTimeFrame:
EcucFloatParamDef
+parameter
upperMultiplicity = 1
lowerMultiplicity = 0
min = 0
max = INF
OsIsrExecutionBudget:
EcucFloatParamDef
+parameter
upperMultiplicity = 1
lowerMultiplicity = 0
min = 0 OsIsrOsInterruptLockBudget:
max = INF +parameter EcucFloatParamDef
upperMultiplicity = 1
OsIsrAllInterruptLockBudget: lowerMultiplicity = 0
EcucFloatParamDef min = 0
+parameter
max = INF
upperMultiplicity = 1
lowerMultiplicity = 0
min = 0
max = INF
OsMemoryMappingCodeLocationRef:
+reference EcucForeignReferenceDef
destinationType = SW-ADDR-METHOD
lowerMultiplicity = 0
upperMultiplicity = 1
ARElement
AtpBlueprint
AtpBlueprintable
SwAddrMethod
10.2.18 OsIsrResourceLock
Configuration Parameters
No Included Containers
10.2.19 OsIsrTimingProtection
If the container exists, the timing protection is used for this interrupt. If
the container does not exist, the interrupt is not supervised regarding
timing violations.
Configuration Parameters
Included Containers
Container Name Multiplicity Scope / Dependency
OsIsrResourceLock 0..* This container contains a list of times the interrupt uses
resources.
10.2.20 OsOS
Included Containers
Container Name Multiplicity Scope / Dependency
OsHooks 1 Container to structure all hooks belonging to the OS
Os: EcucModuleDef
upperMultiplicity = 1
lowerMultiplicity = 0
+container
+literal EXTENDED:
EcucEnumerationLiteralDef
lowerMultiplicity = 0
+literal SC2:
EcucEnumerationLiteralDef
+parameter
+literal SC3:
EcucEnumerationLiteralDef
+literal SC4:
EcucEnumerationLiteralDef
+parameter OsUseGetServiceId:
EcucBooleanParamDef
+parameter
OsUseParameterAccess:
EcucBooleanParamDef
+parameter OsStackMonitoring:
EcucBooleanParamDef
+parameter OsUseResScheduler:
EcucBooleanParamDef
defaultValue = true
+subContainer OsHooks:
EcucParamConfContainerDef
+parameter OsUseArti:
EcucBooleanParamDef
OsNumberOfCores:
+parameter EcucIntegerParamDef
min = 1
max = 65535
lowerMultiplicity = 0
upperMultiplicity = 1
10.2.21 OsPeripheralArea
No Included Containers
10.2.22 OsResource
No Included Containers
OsResource: +destination
EcucParamConfContainerDef OsResourceLinkedResourceRef:
upperMultiplicity = * EcucReferenceDef
lowerMultiplicity = 0 +reference upperMultiplicity = 1
lowerMultiplicity = 0
+literal STANDARD:
EcucEnumerationLiteralDef
upperMultiplicity = * upperMultiplicity = *
lowerMultiplicity = 0 lowerMultiplicity = 0
10.2.23 OsScheduleTable
false: the schedule table processing stops when the final expiry point is
processed.
Multiplicity 1
Type EcucBooleanParamDef
Default Value
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: ECU
Included Containers
Container Name Multiplicity Scope / Dependency
OsScheduleTable 0..1 This container specifies if and how the schedule table is
Autostart started on startup of the Operating System. The options
to start a schedule table correspond to the API calls to
start schedule tables during runtime.
OsScheduleTableExpiry 1..* The point on a Schedule Table at which the OS activates
Point tasks and/or sets events
OsScheduleTableSync 0..1 This container specifies the synchronization parameters
of the schedule table.
OsScheduleTableSe
+reference
OsScheduleTableExpiryPoint: OsScheduleTableEventSetting: EcucReferenc
EcucParamConfContainerDef +subContainer EcucParamConfContainerDef
upperMultiplicity = * upperMultiplicity = *
lowerMultiplicity = 1 lowerMultiplicity = 0
OsScheduleTableMaxSh
+parameter EcucIntegerParamD
OsScheduleTblAdjustableExpPoint:
+subContainer EcucParamConfContainerDef min = 0
lowerMultiplicity = 0 +parameter
upperMultiplicity = 1 OsScheduleTableMaxLe
+subContainer EcucIntegerParam
min = 0
OsScheduleTblExpPointOffset:
+parameter EcucIntegerParamDef
min = 0
+referenc
OsScheduleTableTaskActivation:
EcucParamConfContainerDef
+subContainer
upperMultiplicity = *
lowerMultiplicity = 0
+parameter OsScheduleTableDuration:
EcucIntegerParamDef
OsScheduleTableAutosta
EcucEnumerationPara
OsScheduleTableAutostart: +parameter
EcucParamConfContainerDef
upperMultiplicity = 1
lowerMultiplicity = 0
OsScheduleTableStartValue:
+parameter EcucIntegerParamDef
+subContainer
lowerMultiplicity = 0
upperMultiplicity = 1
OsAppMo
+reference OsScheduleTableAppModeRef: +destination EcucParamConfC
EcucReferenceDef
upperMultipli
upperMultiplicity = * lowerMultipli
lowerMultiplicity = 1
OsScheduleTblSyncStrategy:
EcucEnumerationParamDef +literal NONE:
OsScheduleTableSync: +parameter
EcucEnumerationL
EcucParamConfContainerDef defaultValue = NONE
upperMultiplicity = 1
lowerMultiplicity = 0
+literal IMPLICIT:
EcucEnumerationL
+subContainer
+literal
EXPLICIT:
EcucEnumerationL
OsScheduleTblExplicitPrecision:
+parameter EcucIntegerParamDef
upperMultiplicity = 1
lowerMultiplicity = 0
min = 0
10.2.24 OsScheduleTableAutostart
Relative offset in ticks when the schedule table starts. Only used if the
OsScheduleTableAutostartType is RELATIVE.
Multiplicity 0..1
Type EcucIntegerParamDef
Range 0 ..
18446744073709551615
Default Value
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
No Included Containers
10.2.25 OsScheduleTableEventSetting
No Included Containers
10.2.26 OsScheduleTableExpiryPoint
Included Containers
Container Name Multiplicity Scope / Dependency
OsScheduleTableEvent 0..* Event that is triggered by that schedule table.
Setting
OsScheduleTableTask 0..* Task that is triggered by that schedule table.
Activation
OsScheduleTbl 0..1 Adjustable expiry point
AdjustableExpPoint
10.2.27 OsScheduleTableTaskActivation
No Included Containers
10.2.28 OsScheduleTblAdjustableExpPoint
No Included Containers
10.2.29 OsScheduleTableSync
No Included Containers
10.2.30 OsSpinlock
No Included Containers
OsApplication:
OsSpinlock: OsSpinlockAccessingApplication:
+reference +destination EcucParamConfContainerDef
EcucParamConfContainerDef EcucReferenceDef
upperMultiplicity = *
lowerMultiplicity = 0 lowerMultiplicity = 1 lowerMultiplicity = 0
upperMultiplicity = * upperMultiplicity = *
+reference
OsSpinlockSuccessor:
EcucReferenceDef
+destination
lowerMultiplicity = 0
upperMultiplicity = 1
defaultValue = LOCK_NOTHING
+literal LOCK_CAT2_INTERRUPTS:
EcucEnumerationLiteralDef
+parameter
+literal LOCK_WITH_RES_SCHEDULER:
EcucEnumerationLiteralDef
+literal LOCK_NOTHING:
EcucEnumerationLiteralDef
10.2.31 OsTask
This value is information, e.g. for time base calculations in the RTE in
case TimingEvents are mapped onto this OsTask.Be aware, that this
parameter is not supposed to be relevant for the OS! This information
is given as part of the OS configuration to support configuration work
flows using a fixed set of OsTasks.
Multiplicity 0..1
Type EcucFloatParamDef
Range [-INF .. INF]
Default Value
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X All Variants
Configuration Class
Link time –
Post-build time –
ISO 17356-3 defines the lowest priority as zero (0); larger values
correspond to higher priorities.
Multiplicity 1
Type EcucIntegerParamDef
Range 0 .. 4294967295
Default Value
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: local
Included Containers
Container Name Multiplicity Scope / Dependency
OsTaskAutostart 0..1 This container determines whether the task is activated
during the system start-up procedure or not for some
specific application modes.
+literal
NON:
OsTask: OsTaskSchedule:
+parameter EcucEnumerationLiteralDef
EcucParamConfContainerDef EcucEnumerationParamDef
+literal
upperMultiplicity = *
FULL: EcucEnumerationLiteralDef
lowerMultiplicity = 0
OsTaskPriority: SwAddrM
+parameter
EcucIntegerParamDef
+ memoryAllocationKeywordPolicy: Mem
OsTaskActivation: min = 0 + option: Identifier [0..*]
+parameter max = 4294967295 + sectionInitializationPolicy: SectionInit
EcucIntegerParamDef
+ sectionType: MemorySectionType [0..
min = 1
max = 4294967295
OsEvent:
+reference OsTaskEventRef: OsMemoryMappingC
+destination EcucParamConfContainerDef
EcucReferenceDef EcucForeignR
upperMultiplicity = *
upperMultiplicity = * destinationType = SW-AD
lowerMultiplicity = 0
lowerMultiplicity = 0 lowerMultiplicity = 0
+reference
upperMultiplicity = 1
+ref
OsTaskAutostart: OsAppMode:
OsTaskAppModeRef:
+reference +destination EcucParamConfContainerDef
+subContainer EcucParamConfContainerDef EcucReferenceDef
upperMultiplicity = 1 upperMultiplicity = *
upperMultiplicity = *
lowerMultiplicity = 0 lowerMultiplicity = 1
lowerMultiplicity = 1
OsTaskResourceRef: OsResource:
+reference EcucReferenceDef +destination
EcucParamConfContainerDef
+destination
upperMultiplicity = * upperMultiplicity = *
lowerMultiplicity = 0 lowerMultiplicity = 0
OsTaskTimingProtection: OsTaskResourceLock:
EcucParamConfContainerDef EcucParamConfContainerDef +reference OsTaskResourceLockResourceRef:
+subContainer EcucReferenceDef
upperMultiplicity = 1 lowerMultiplicity = 0
lowerMultiplicity = 0 upperMultiplicity = *
+parameter OsTaskResourceLockBudget:
EcucFloatParamDef
min = 0
OsTaskExecutionBudget: max = INF
upperMultiplicity = 1 OsTaskAllInterruptLockBudget:
lowerMultiplicity = 0 EcucFloatParamDef
min = 0
upperMultiplicity = 1
max = INF
+parameter lowerMultiplicity = 0
min = 0
max = INF
+parameter OsTaskTimeFrame:
EcucFloatParamDef
+parameter OsTaskOsInterruptLockBudget: upperMultiplicity = 1
EcucFloatParamDef lowerMultiplicity = 0
min = 0
upperMultiplicity = 1
max = INF
lowerMultiplicity = 0
min = 0
max = INF
OsTaskAccessingApplication: OsApplication:
+reference EcucReferenceDef +destination
EcucParamConfContainerDef
upperMultiplicity = * upperMultiplicity = *
lowerMultiplicity = 0 lowerMultiplicity = 0
OsTaskPeriod:
+parameter EcucFloatParamDef
lowerMultiplicity = 0
upperMultiplicity = 1
10.2.32 OsTaskAutostart
Description This container determines whether the task is activated during the
system start-up procedure or not for some specific application modes.
If the task shall be activated during the system start-up, this container
is present and holds the references to the application modes in which
the task is auto-started.
Configuration Parameters
No Included Containers
10.2.33 OsTaskResourceLock
No Included Containers
10.2.34 OsTaskTimingProtection
Included Containers
Container Name Multiplicity Scope / Dependency
OsTaskResourceLock 0..* This container contains the worst case time between
getting and releasing a given resource (in seconds).
10.2.35 OsTimeConstant
Description Allows the user to define constants which can be e.g. used to compare
time values with timer tick values.
A time value will be converted to a timer tick value during
generation and can later on accessed via the OsConstName. The
conversation is done by rounding time values to the nearest
fitting tick value.
Configuration Parameters
No Included Containers
Os: EcucModuleDef
upperMultiplicity = 1 OsIocSenderId:
lowerMultiplicity = 0 EcucIntegerParamDef
min = 0
OsIocSenderProperties: +parameter
max = 255
EcucParamConfContainerDef
OsIocCommunication: lowerMultiplicity = 0
EcucParamConfContainerDef lowerMultiplicity = 1 upperMultiplicity = 1
+subContainer upperMultiplicity = *
lowerMultiplicity = 0
upperMultiplicity = * +reference OsIocSendingOsApplicationRef:
EcucReferenceDef
+container
lowerMultiplicity = 1
OsIoc: upperMultiplicity = 1
EcucParamConfContainerDef +parameter
lowerMultiplicity = 0
upperMultiplicity = 1 +literal
defaultValue = DO_NOT_CARE EcucE
+literal
FUNCTION:
EcucEnumerationLiteralDef
+parameter
OsIocReceiverProperties: OsIocReceivingOsApplicationRef:
EcucParamConfContainerDef EcucReferenceDef
+reference
lowerMultiplicity = 1 lowerMultiplicity = 1
upperMultiplicity = * upperMultiplicity = 1
+subContainer
+parameter OsI
+subContainer Ecu
+parameter OsIocReceiverId: lo
EcucIntegerParamDef u
min = 0
max = 255
lowerMultiplicity = 0
OsIocBufferLength: upperMultiplicity = 1
+parameter EcucIntegerParamDef
max = 4294967295
upperMultiplicity = 1
lowerMultiplicity = 0
OsIocInitValue:
+parameter EcucStringParamDef
lowerMultiplicity = 0
upperMultiplicity = 1
+subContainer
OsIocDataPropertyIndex:
EcucIntegerParamDef
+parameter
max = 255
upperMultiplicity = 1
lowerMultiplicity = 0
OsMemoryMappingCodeLocatio
+reference EcucForeignReferenceDe
destinationType = SW-ADDR-METHO
lowerMultiplicity = 0
upperMultiplicity = 1
10.3.1 OsIoc
Included Containers
Container Name Multiplicity Scope / Dependency
OsIocCommunication 0..* Representation of a 1:1 or N:1 or N:M (unqueued only)
communication between software parts located in
different OS-Applications that are bound to the same or
to different cores. The name shall begin with the name
of the sending software service and be followed by a
unique identifier delivered by the sending software
service. In the case of RTE as user attention shall be
paid on the fact that uniqueness for identifier names has
to be reached over ports, data elements, object
instances and maybe additional identification properties
(E.g. Case 1:N mapping to 1:1). Example:
• <NameSpace>_UniqueID
10.3.2 OsIocCommunication
Configuration Parameters
Included Containers
Container Name Multiplicity Scope / Dependency
OsIocDataProperties 1..* Data properties of the data to be transferred on the IOC
communication channel.
OsIocReceiverProperties 1..* Representation of receiver properties for one
communication. For each OsIocCommunication one
(1:1) or many receivers (N:M) have to be defined. This
container should be instantiated within an
OsIocCommunication.
OsIocSenderProperties 1..* Representation of sender properties for one
communication. For each OsIocCommunication one
(1:1) or many senders (N:1 or N:M) have to be defined.
Multiplicity > 1 (N:1 or N:M communication) is only
allowed for Multiplicity of OsIocDataTypeRef = 1.
10.3.3 OsIocSenderProperties
Multiplicity 1
Type Reference to OsApplication
false
Post-Build Variant
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: local
No Included Containers
10.3.4 OsIocReceiverProperties
Multiplicity 1
Type Reference to OsApplication
false
Post-Build Variant
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: local
No Included Containers
10.3.5 OsIocDataProperties
No Included Containers
10.4.1 ArtiHardware
Included Containers
Container Name Multiplicity Scope / Dependency
ArtiHardwareCoreClass 0..1 Contains the layout of an ARTI "Core" object, extending
the EcucCoreDefinition.
ArtiHardwareCore 0..* Description: Represents an instance of an ARTI "Core"
Instance object, extending the EcucCoreDefinition. When using
ARTI for debugging or hardware based tracing, this is
mandatory (i.e. multiplicity 1..*), else optional.
<ECUC-MODULE-CONFIGURATION-VALUES>
<SHORT-NAME>Vendor1ArtiHardware</SHORT-NAME>
<DEFINITION-REF DEST="ECUC-MODULE-DEF">
/AUTOSAR/Arti/ArtiHardware</DEFINITION-REF>
<CONTAINERS>
<ECUC-CONTAINER-VALUE>
<SHORT-NAME>ArtiCoreClass</SHORT-NAME>
<DEFINITION-REF DEST="ECUC-PARAM-CONF-CONTAINER-DEF">
/AUTOSAR/Arti/ArtiHardware/ArtiHardwareCoreClass</DEFINITION-REF>
<...>
</ECUC-CONTAINER-VALUE>
<ECUC-CONTAINER-VALUE>
<SHORT-NAME>ArtiCore0</SHORT-NAME>
<DEFINITION-REF DEST="ECUC-PARAM-CONF-CONTAINER-DEF">
/AUTOSAR/Arti/ArtiHardware/ArtiHardwareCoreInstance</DEFINITION-REF>
<...>
</ECUC-CONTAINER-VALUE>
<ECUC-CONTAINER-VALUE>
<SHORT-NAME>ArtiCore1</SHORT-NAME>
<DEFINITION-REF DEST="ECUC-PARAM-CONF-CONTAINER-DEF">
/AUTOSAR/Arti/ArtiHardware/ArtiHardwareCoreInstance</DEFINITION-REF>
<...>
</ECUC-CONTAINER-VALUE>
</CONTAINERS>
</ECUC-MODULE-CONFIGURATION-VALUES>
10.4.2 ArtiHardwareCoreClass
No Included Containers
<ECUC-CONTAINER-VALUE>
<SHORT-NAME>ArtiCoreClass</SHORT-NAME>
<DEFINITION-REF DEST="ECUC-PARAM-CONF-CONTAINER-DEF">/AUTOSAR/Arti/
ArtiHardware/ArtiHardwareCoreClass</DEFINITION-REF>
<REFERENCE-VALUES>
<ECUC-REFERENCE-VALUE>
<DEFINITION-REF DEST="ECUC-REFERENCE-DEF">/AUTOSAR/Arti/
ArtiHardware/ArtiHardwareCoreClass/
ArtiHardwareCoreClassCurrentApplicationRef</DEFINITION-REF>
<VALUE-REF DEST="ECUC-CONTAINER-VALUE">/Vendor1/Vendor1Arti/
ArtiObjectClassParameter_ArtiHwCore_CurrentApplication
</VALUE-REF>
</ECUC-REFERENCE-VALUE>
<ECUC-REFERENCE-VALUE>
<DEFINITION-REF DEST="ECUC-REFERENCE-DEF">/AUTOSAR/Arti/
ArtiHardware/ArtiHardwareCoreClass/
ArtiHardwareCoreClassCurrentTaskRef</DEFINITION-REF>
<VALUE-REF DEST="ECUC-CONTAINER-VALUE">/Vendor1/Vendor1Arti/
ArtiObjectClassParameter_ArtiHwCore_CurrentTask</VALUE-REF>
</ECUC-REFERENCE-VALUE>
</REFERENCE-VALUES>
</ECUC-CONTAINER-VALUE>
10.4.3 ArtiHardwareCoreInstance
No Included Containers
<ECUC-CONTAINER-VALUE>
<SHORT-NAME>ArtiCore0</SHORT-NAME>
<DEFINITION-REF DEST="ECUC-PARAM-CONF-CONTAINER-DEF">/AUTOSAR/Arti/
ArtiHardware/ArtiHardwareCoreInstance</DEFINITION-REF>
<REFERENCE-VALUES>
<ECUC-REFERENCE-VALUE>
<DEFINITION-REF DEST="ECUC-REFERENCE-DEF">/AUTOSAR/Arti/
ArtiHardware/ArtiHardwareCoreInstance/
ArtiHardwareCoreInstanceCurrentApplicationRef</DEFINITION-REF>
<VALUE-REF DEST="ECUC-CONTAINER-VALUE">/Vendor1/Vendor1Arti/
ArtiObjectInstanceParameter_CurrentApplicationOnCore0
</VALUE-REF>
</ECUC-REFERENCE-VALUE>
<ECUC-REFERENCE-VALUE>
<DEFINITION-REF DEST="ECUC-REFERENCE-DEF">/AUTOSAR/Arti/
ArtiHardware/ArtiHardwareCoreInstance/
ArtiHardwareInstanceCurrentTaskRef</DEFINITION-REF>
<VALUE-REF DEST="ECUC-CONTAINER-VALUE">/Vendor1/Vendor1Arti/
ArtiObjectInstanceParameter_CurrentTaskOnCore0</VALUE-REF>
</ECUC-REFERENCE-VALUE>
<ECUC-REFERENCE-VALUE>
<DEFINITION-REF DEST="ECUC-REFERENCE-DEF">/AUTOSAR/Arti/
ArtiHardware/ArtiHardwareCoreInstance/
ArtiHardwareCoreInstanceEcucCoreRef</DEFINITION-REF>
<VALUE-REF DEST="ECUC-CONTAINER-VALUE">
/Vendor1/Vendor1EcucEcuC/Hardware/Core0</VALUE-REF>
</ECUC-REFERENCE-VALUE>
</REFERENCE-VALUES>
</ECUC-CONTAINER-VALUE>
10.4.4 ArtiOs
Configuration Parameters
Included Containers
Container Name Multiplicity Scope / Dependency
ArtiOsAlarmClass 0..1 Contains the layout of an ArtiOsAlarm object.
ArtiOsAlarmInstance 0..* Represents an instance of an ArtiOsAlarm object,
extending the EcuC OsTaskAlarm.
ArtiOsClass 0..1 Contains the layout of an ARTI "Os" object, extending
the EcuC OsOS.
ArtiOsContextClass 0..1 Contains the layout of an ARTI "OsContext" object.
ArtiOsContextInstance 0..* Represents an instance of an "ArtiContext" object.
ArtiOsInstance 0..1 Represents an instance of an ARTI "Os" object,
extending the EcuC OsOS.
ArtiOsIsrClass 0..1 Contains the layout of an ARTI "OsIsr" object, extending
the EcuC OsIsr.
ArtiOsIsrInstance 0..* Represents an instance of an ARTI "OsIsr" object,
extending the EcuC OsIsr.
ArtiOsMessageContainer 0..1 Contains the layout of an ARTI "OsMessageContainer"
Class object. The "OsMessageContainer" object represents
an existing combination of OSEK messages.
ArtiOsMessageContainer 0..* Represents an instance of an "ArtiMessageContainer"
Instance object.
ArtiOsResourceClass 0..1 Contains the layout of an ArtiOsResource object. The
ArtiOsResource object represents an OSEK resource.
ArtiOsResourceInstance 0..* Represents an instance of an ArtiOsResource object.
ArtiOsStackClass 0..1 Contains the layout of an ArtiOsStack object. The
ArtiOsStack object defines the memory area of any
stack in the system.
ArtiOsStackInstance 0..* Represents an instance of an ArtiOsStack object.
ArtiOsTaskClass 0..1 Contains the layout of an ARTI "OsTask" object,
extending the EcuC OsTask.
<ECUC-MODULE-CONFIGURATION-VALUES>
<SHORT-NAME>Vendor1ArtiOs</SHORT-NAME>
<DEFINITION-REF DEST="ECUC-MODULE-DEF">
/AUTOSAR/Arti/ArtiOs</DEFINITION-REF>
<CONTAINERS>
<ECUC-CONTAINER-VALUE>
<SHORT-NAME>ArtiOsClass_Conf</SHORT-NAME>
<DEFINITION-REF DEST="ECUC-PARAM-CONF-CONTAINER-DEF">
/AUTOSAR/Arti/ArtiOs/ArtiOsClass</DEFINITION-REF>
<...>
</ECUC-CONTAINER-VALUE>
<ECUC-CONTAINER-VALUE>
<SHORT-NAME>ArtiOsInstance_Conf</SHORT-NAME>
<DEFINITION-REF DEST="ECUC-PARAM-CONF-CONTAINER-DEF">
/AUTOSAR/Arti/ArtiOs/ArtiOsInstance</DEFINITION-REF>
<...>
</ECUC-CONTAINER-VALUE>
<ECUC-CONTAINER-VALUE>
<SHORT-NAME>ArtiOsTaskClass_Conf</SHORT-NAME>
<DEFINITION-REF DEST="ECUC-PARAM-CONF-CONTAINER-DEF">
/AUTOSAR/Arti/ArtiOs/ArtiOsTaskClass</DEFINITION-REF>
</ECUC-CONTAINER-VALUE>
<ECUC-CONTAINER-VALUE>
<SHORT-NAME>ArtiOsTaskInstance_TaskHighPriority</SHORT-NAME>
<DEFINITION-REF DEST="ECUC-PARAM-CONF-CONTAINER-DEF">
/AUTOSAR/Arti/ArtiOs/ArtiOsTaskInstance</DEFINITION-REF>
<...>
</ECUC-CONTAINER-VALUE>
<ECUC-CONTAINER-VALUE>
<SHORT-NAME>ArtiOsTaskInstance_TaskLowPriority</SHORT-NAME>
<DEFINITION-REF DEST="ECUC-PARAM-CONF-CONTAINER-DEF">
/AUTOSAR/Arti/ArtiOs/ArtiOsTaskInstance</DEFINITION-REF>
<...>
</ECUC-CONTAINER-VALUE>
</CONTAINERS>
</ECUC-MODULE-CONFIGURATION-VALUES>
10.4.5 ArtiOsAlarmClass
No Included Containers
10.4.6 ArtiOsAlarmInstance
Name ArtiOsAlarmInstanceGenericComponentInstanceRef
[ECUC_Arti_00116]
Parent Container ArtiOsAlarmInstance
Description Refers to an ArtiGenericComponentInstance that extends the
ArtiOsAlarmInstance.
Multiplicity 0..1
Type Reference to ArtiGenericComponentInstance
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time –
Scope / Dependency scope: ECU
No Included Containers
10.4.7 ArtiOsClass
No Included Containers
<ECUC-CONTAINER-VALUE>
<SHORT-NAME>ArtiOsClass_Conf</SHORT-NAME>
<DEFINITION-REF DEST="ECUC-PARAM-CONF-CONTAINER-DEF">/AUTOSAR/Arti/
ArtiOs/ArtiOsClass</DEFINITION-REF>
<REFERENCE-VALUES>
<ECUC-REFERENCE-VALUE>
<DEFINITION-REF DEST="ECUC-REFERENCE-DEF">/AUTOSAR/Arti/
ArtiOs/ArtiOsClass/ArtiOsClassAppModeRef</DEFINITION-REF>
<VALUE-REF DEST="ECUC-CONTAINER-VALUE">/Vendor1/Vendor1Arti/
ArtiObjectClassParameter_ArtiOs_OsAppMode</VALUE-REF>
</ECUC-REFERENCE-VALUE>
</REFERENCE-VALUES>
</ECUC-CONTAINER-VALUE>
10.4.8 ArtiOsContextClass
Configuration Parameters
No Included Containers
10.4.9 ArtiOsContextInstance
Name ArtiOsContextInstanceGenericComponentInstanceRef
[ECUC_Arti_00123]
Parent Container ArtiOsContextInstance
Description Refers to an ArtiGenericComponentInstance that extends the
ArtiOsContext.
Multiplicity 0..1
Type Reference to ArtiGenericComponentInstance
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time –
Scope / Dependency scope: ECU
No Included Containers
10.4.10 ArtiOsInstance
No Included Containers
<ECUC-CONTAINER-VALUE>
<SHORT-NAME>ArtiOsInstance_Conf</SHORT-NAME>
<DEFINITION-REF DEST="ECUC-PARAM-CONF-CONTAINER-DEF">/AUTOSAR/Arti/
ArtiOs/ArtiOsInstance</DEFINITION-REF>
<REFERENCE-VALUES>
<ECUC-REFERENCE-VALUE>
<DEFINITION-REF DEST="ECUC-REFERENCE-DEF">/AUTOSAR/Arti/
ArtiOs/ArtiOsInstance/ArtiOsInstanceAppModeRef</DEFINITION-REF>
<VALUE-REF DEST="ECUC-CONTAINER-VALUE">/Vendor1/Vendor1Arti/
ArtiObjectInstanceParameter_OsAppMode</VALUE-REF>
</ECUC-REFERENCE-VALUE>
<ECUC-REFERENCE-VALUE>
<DEFINITION-REF DEST="ECUC-REFERENCE-DEF">/AUTOSAR/Arti/
ArtiOs/ArtiOsInstance/ArtiOsInstanceEcucRef</DEFINITION-REF>
<VALUE-REF DEST="ECUC-CONTAINER-VALUE">/Vendor1/Vendor1EcucOs/
Vendor1Os</VALUE-REF>
</ECUC-REFERENCE-VALUE>
<ECUC-REFERENCE-VALUE>
<DEFINITION-REF DEST="ECUC-REFERENCE-DEF">/AUTOSAR/Arti/
ArtiOs/ArtiOsInstance/ArtiOsInstanceHookRef</DEFINITION-REF>
<VALUE-REF DEST="ECUC-CONTAINER-VALUE">/Vendor1/Vendor1Arti/
ArtiHook_ArtiOs_TaskStart</VALUE-REF>
</ECUC-REFERENCE-VALUE>
<ECUC-REFERENCE-VALUE>
<DEFINITION-REF DEST="ECUC-REFERENCE-DEF">/AUTOSAR/Arti/
ArtiOs/ArtiOsInstance/ArtiOsInstanceHookRef</DEFINITION-REF>
<VALUE-REF DEST="ECUC-CONTAINER-VALUE">/Vendor1/Vendor1Arti/
ArtiHook_ArtiOs_TaskStop</VALUE-REF>
</ECUC-REFERENCE-VALUE>
</REFERENCE-VALUES>
</ECUC-CONTAINER-VALUE>
10.4.11 ArtiOsIsrClass
Description Contains the layout of an ARTI "OsIsr" object, extending the EcuC
OsIsr.
Post-Build Variant false
Multiplicity
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time –
Configuration Parameters
No Included Containers
10.4.12 ArtiOsIsrInstance
No Included Containers
10.4.13 ArtiOsMessageContainerClass
Name ArtiOsMessageContainerClassGenericComponentClassRef
[ECUC_Arti_00128]
Parent Container ArtiOsMessageContainerClass
Description Refers to an ArtiGenericComponentClass that extends the
ArtiOsMessageContainerClass.
Multiplicity 0..1
Type Reference to ArtiGenericComponentClass
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time –
Scope / Dependency scope: ECU
No Included Containers
10.4.14 ArtiOsMessageContainerInstance
Name ArtiOsMessageContainerInstanceGenericComponentInstanceRef
[ECUC_Arti_00132]
Parent Container ArtiOsMessageContainerInstance
Description Refers to an ArtiGenericComponentInstance that extends the
ArtiOsMessageContainerInstance.
Multiplicity 0..1
Type Reference to ArtiGenericComponentInstance
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time –
Scope / Dependency scope: ECU
No Included Containers
10.4.15 ArtiOsResourceClass
Name ArtiOsResourceClassGenericComponentClassRef
[ECUC_Arti_00138]
Parent Container ArtiOsResourceClass
Description Refers to an ArtiGenericComponentClass that extends the
ArtiOsResourceClass.
Multiplicity 0..1
Type Reference to ArtiGenericComponentClass
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time –
Scope / Dependency scope: ECU
No Included Containers
10.4.16 ArtiOsResourceInstance
Name ArtiOsResourceInstanceGenericComponentInstanceRef
[ECUC_Arti_00143]
Parent Container ArtiOsResourceInstance
Description Refers to an ArtiGenericComponentInstance that extends the
ArtiOsResourceInstance.
Multiplicity 0..1
Type Reference to ArtiGenericComponentInstance
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time –
Scope / Dependency scope: ECU
No Included Containers
10.4.17 ArtiOsStackClass
No Included Containers
10.4.18 ArtiOsStackInstance
Name ArtiOsStackInstanceGenericComponentInstanceRef
[ECUC_Arti_00153]
Parent Container ArtiOsStackInstance
Description Refers to an ArtiGenericComponentInstance that extends the
ArtiOsStackInstance.
Multiplicity 0..1
Type Reference to ArtiGenericComponentInstance
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time –
Scope / Dependency scope: ECU
No Included Containers
10.4.19 ArtiOsTaskClass
No Included Containers
<ECUC-CONTAINER-VALUE>
<SHORT-NAME>ArtiOsTaskClass_Conf</SHORT-NAME>
<DEFINITION-REF DEST="ECUC-PARAM-CONF-CONTAINER-DEF">/AUTOSAR/Arti/
ArtiOs/ArtiOsTaskClass</DEFINITION-REF>
<REFERENCE-VALUES>
<ECUC-REFERENCE-VALUE>
<DEFINITION-REF DEST="ECUC-REFERENCE-DEF">/AUTOSAR/Arti/
ArtiOs/ArtiOsTaskClass/
ArtiOsTaskClassGenericComponentRef</DEFINITION-REF>
<VALUE-REF DEST="ECUC-CONTAINER-VALUE">/Vendor1/Vendor1ArtiGeneric/
ArtiGenericComponentClass_Vendor1Task</VALUE-REF>
</ECUC-REFERENCE-VALUE>
</REFERENCE-VALUES>
</ECUC-CONTAINER-VALUE>
10.4.20 ArtiOsTaskInstance
Configuration Parameters
No Included Containers
<ECUC-CONTAINER-VALUE>
<SHORT-NAME>ArtiOsTaskInstance_TaskHighPriority</SHORT-NAME>
<DEFINITION-REF DEST="ECUC-PARAM-CONF-CONTAINER-DEF">/AUTOSAR/Arti/
ArtiOs/ArtiOsTaskInstance</DEFINITION-REF>
<REFERENCE-VALUES>
<ECUC-REFERENCE-VALUE>
<DEFINITION-REF DEST="ECUC-REFERENCE-DEF">/AUTOSAR/Arti/
ArtiOs/ArtiOsTaskInstance/
ArtiOsTaskInstanceGenericComponentRef</DEFINITION-REF>
<VALUE-REF DEST="ECUC-CONTAINER-VALUE">/Vendor1/Vendor1ArtiGeneric/
ArtiGenericComponentInstance_TaskHighPriority</VALUE-REF>
</ECUC-REFERENCE-VALUE>
<ECUC-REFERENCE-VALUE>
<DEFINITION-REF DEST="ECUC-REFERENCE-DEF">/AUTOSAR/Arti/
ArtiOs/ArtiOsTaskInstance/
ArtiOsTaskInstanceEcucRef</DEFINITION-REF>
<VALUE-REF DEST="ECUC-CONTAINER-VALUE">/Vendor1/Vendor1EcucOs/
TaskHighPriority</VALUE-REF>
</ECUC-REFERENCE-VALUE>
</REFERENCE-VALUES>
</ECUC-CONTAINER-VALUE>
11 Generation of the OS
12 Application Notes
12.1 Hooks
In OSEK OS, PreTask & PostTask Hooks run at the level of the OS with unrestricted
access rights and therefore must be trusted. It is strongly recommended that these
hook routines are only used during debugging and are not used in a final product.
When an OS-Application is killed the shutdown and startup hooks of the OS-Application
are not called. Cleanup of OS-Application specific data can be done in the restart
Task.
All application-specific hook functions (startup, shutdown and error) must return (block-
ing or endless loops are not acceptable).
42 type2 parameter2;
43 if (GetTaskID(&task) != E_OK)
44 task = INVALID_TASK;
45 /* get parameters out of the structure (parameter1 and
46 * parameter2) */
47 parameter1 = local_struct.name1;
48 parameter2 = local_struct.name2;
49 /* check the parameters if necessary */
50 /* example is for parameter1 being an address and parameter2
51 * being a size */
52 /* example only for system_service called from tasks */
53 if(GetISRID()!=INVALID_ISR)
54 {
55 /* error: not callable from ISR */
56 local_struct.return_value = E_OS_ACCESS;
57 }
58 else if(OSMEMORY_IS_WRITEABLE(CheckTaskMemoryAccess(task,parameter1
,parameter2)))
59 {
60 /* system_service_part3() is now the function as it
61 * would be if directly called in a non-protected
62 * environment */
63 local_struct.return_value = system_service_part3(parameter1,
parameter2);
64 }
65 else
66 {
67 /* error handling */
68 local_struct.return_value = E_OS_ACCESS;
69 }
70 }
Telling the ScheduleTable that GlobalTime can be done when the application detects
that the FlexRay controller has lost synchronization with the network (by polling the
controller sync status). The following code indicates how this can be used to force an
associated ScheduleTable into the SCHEDULETABLE_RUNNING state from the SCHED-
ULETABLE_RUNNING_AND_SYNCHRONOUS state.
1 Fr_SyncStateType CurrentSyncStatus;
2
3 if (FrIf_GetSyncState(Controller, &CurrentSyncStatus) == E_OK) {
4
5 if (CurrentSyncStatus == FR_ASYNC ) {
6 SetScheduleTableAsync(Table);
7 }
8
9 }
Of course, other actions are possible here, like stopping the ScheduleTable, as best
fits user requirements.
Since OIL and XML are both ASCII formats a tool vendor may offer a possibility to
import (old) OIL files and to store them as (AUTOSAR OS) XML files. Currently all
known vendors support at least the import of existing OIL configurations.
Note that for showing conformance to the OSEK OS specification, each OSEK OS ven-
dor must support OIL. This means that practically each AUTOSAR OS vendor will offer
some sort of import of OIL configurations - at least to show the OSEK OS conformance.
Integration code shall stop all signals and signalgroups during its OsApplication
restart. This ensures that no late asynchronous notification will occur after the OsAp-
plication restart. These signals and signalgroups can be then safely restarted if
needed.
A SW-C shall cancel jobs on all its memory blocks with a call to NvM_CancelJobs
during the restart of its OsApplication. As the job might have already been started,
the call to NvM_CancelJobs can return an error; in that case, the OsApplication
shall wait until end of the job to continue. After all jobs are ensured to be cancelled, then
all memory blocks shall be reset to their initial value, in order to avoid inconsistency of
data which might have been written before the cancellation.
Any SW-C having responsible for requesting mode or state to BSW mode managers
shall always request a default mode upon a restart of its OsApplication. Thus the
BSW mode manager would not be stuck into a mode previously requested by the
OsApplication before its termination. To support this task, note that RTE offers
mechanisms to handle partition stop and restart wrt. mode machines. For mode man-
agers an "error mode" to be set by RTE can be identified. For mode user partition
the behaviour can also be selected. Furthermore an interaction to BswM to trigger an
action list in case of partition restart can be initiated. Refer to RTE specification for
details.
As a global hint, in any non-trusted OsApplication, which could be terminated, there
shall always be a restart Task which does the following actions:
• Cancel all jobs which can result in an asynchronous notification or shared mem-
ory, I/O access.
• Reset all shared memory with a default value.
• Reset any mode or state residing in another OsApplication and controlled by
this given OsApplication to a default value.
Please note that some of these actions need to be performed even if an OS-Application
is merely terminated and not restarted. For example, it may still be necessary to stop
all signals and signal groups used by the OsApplication. Otherwise, it may happen
that a bus never goes to sleep.
Consequently, in such a case it is necessary to activate the restart Task to perform
the necessary cleanup even if the OS-Application is only terminated and not restarted.
Calling TerminateApplication(<ownappid>,NO_RESTART) in the restart Task will
finally set the OS-Application to APPLICATION_TERMINATED.
13.1.1 Package
13.2 Overview
The AUTOSAR Operating System is normally not used directly by SWCs. Even the
other BSW modules which are below the RTE are using the BSW Scheduler to have
access to OS services. The BSW Scheduler of course uses the OS to implement its
features, e.g. critical sections.
Nevertheless there is one case where it makes sense to allow SWCs access to ser-
vices of the OS:
• Timer services
Since the number of timers in an ECU is limited it make sense to share these units
across several SWCs. The functionality of the timer services of the OS which are
offered to the SWCs are:
• A service to get the current value of a - hardware or software - Counter
• A service which calculates the time difference between the current timer value
and a given (previouls read) timer value
• Both services will return real time values instead of ticks. This limits the access
to the services to those counters which are counting time. Other counters e.g.
counting errors or angles are not accessible.
The notation of possible error codes resulting from server calls follows the approach in
the meta-model. It is a matter of the RTE specification [10], how those error codes will
be passed via the actual API.