AutosarOS
|
Implementation of operating system control functions. More...
#include "OS.h"
#include "assert.h"
#include "context.h"
#include "Task.h"
#include "Resource.h"
#include "ScheduleTables.h"
#include "Alarm.h"
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/atomic.h>
Go to the source code of this file.
Functions | |
void | OS_StartOS (AppModeType mode) |
Start operating system. More... | |
void | OS_ShutdownOS (StatusType error) |
Shutdown operating system. More... | |
void | __attribute__ ((naked)) |
Task switch. More... | |
void | OS_Switch (void) |
Switch to new task. More... | |
void | OS_EnableAllInterrupts (void) |
Enable all interrupts. More... | |
void | OS_DisableAllInterrupts (void) |
Disable all interrupts. More... | |
void | OS_ResumeAllInterrupts (void) |
Resume all interrupts. More... | |
void | OS_SuspendAllInterrupts (void) |
Suspend all interrupts. More... | |
void | OS_ResumeOSInterrupts (void) |
Resume OS interrupts. More... | |
void | OS_SuspendOSInterrupts (void) |
Suspend OS interrupts. More... | |
AppModeType | OS_GetActiveApplicationMode (void) |
Get currently active application mode. More... | |
void | OS_ProtectionHookInternal (StatusType error) |
Internal function for protection hook handling. More... | |
void | OS_ShutdownOSStackOverrun (void) |
Call OS_ShutdownOS() with E_OS_STACKFAULT. More... | |
Variables | |
uint8_t *volatile * | ptrCurrentStack |
Stack-Pointer saved in current task control block. More... | |
pTaskFxn | ptrCurrentFxnAddr |
Function pointer to current task function. More... | |
Implementation of operating system control functions.
Definition in file OS.c.
void __attribute__ | ( | (naked) | ) |
Task switch.
This function performs the actual scheduling. It selects a new task to be executed and switches the current context accordingly. It should not be called directly and instead be used with OS_Schedule().
Definition at line 143 of file OS.c.
|
inline |
Disable all interrupts.
This service disables all interrupts. It is the counterpart to OS_EnableAllInterrupts().
Nesting is not supported by this call.
Definition at line 256 of file OS.c.
|
inline |
Enable all interrupts.
This service enables all interrupts. It is the counterpart to OS_DisableAllInterrupts().
Nesting is not supported by this call.
Definition at line 251 of file OS.c.
AppModeType OS_GetActiveApplicationMode | ( | void | ) |
void OS_ProtectionHookInternal | ( | StatusType | error | ) |
Internal function for protection hook handling.
This function is called when a protection error is detected. It will call the configured protection hook if available and handle its return value.
error | Type of error that triggered the protection hook |
Definition at line 310 of file OS.c.
void OS_ResumeAllInterrupts | ( | void | ) |
Resume all interrupts.
This service resumes all interrupts disabled by the previous call to OS_SuspendAllInterrupts().
Nesting is supported by this call.
void OS_ResumeOSInterrupts | ( | void | ) |
Resume OS interrupts.
This service resumes OS interrupts disabled by the privious call to OS_SuspendOSInterrupts().
Nesting is supported by this call.
void OS_ShutdownOS | ( | StatusType | error | ) |
Shutdown operating system.
This service shuts down the operating system and does not return. If a ShutdownHook is configured it will be called before the system is terminated.
error | Error occurred |
Definition at line 128 of file OS.c.
void OS_ShutdownOSStackOverrun | ( | void | ) |
Call OS_ShutdownOS() with E_OS_STACKFAULT.
This function will simply call OS_ShutdownOS() with E_OS_STACKFAULT. This is mainly used to simplify the function call from the the sysTick timer ISR.
Definition at line 391 of file OS.c.
void OS_StartOS | ( | AppModeType | mode | ) |
Start operating system.
This service starts the operating system in the specified application mode. The default application mode is OSDEFAULTAPPMODE.
mode | Application mode |
Definition at line 91 of file OS.c.
void OS_SuspendAllInterrupts | ( | void | ) |
Suspend all interrupts.
This service suspends all interrupts. It is the counterpart to OS_ResumeAllInterrupts().
Nesting is supported by this call
void OS_SuspendOSInterrupts | ( | void | ) |
Suspend OS interrupts.
This service suspends all OS interrupts. It is the counterpart to OS_ResumeOSInterrupts().
Nesting is supported by this call.
void OS_Switch | ( | void | ) |
pTaskFxn ptrCurrentFxnAddr |