AutosarOS
OCB.c File Reference

Implementation of Operating System Control Block. More...

#include "OCB.h"
#include "OS.h"
#include "context.h"
#include "assert.h"
#include <avr/interrupt.h>
#include "AppCfg.h"
Include dependency graph for OCB.c:

Go to the source code of this file.

Macros

#define OS_CONFIG_GEN_DATA_STRUCT
 
#define OS_CONFIG_GEN_TCB
 
#define OS_CONFIG_GEN_FUNC
 

Variables

volatile bool isISR = false
 Is currently ISR context? More...
 
volatile uint8_t isCat2ISR
 Priority of current Cat 2 ISR (zero if not in Cat 2 ISR) More...
 
volatile TaskType currentTask = INVALID_TASK
 Task currently being executed. More...
 
volatile uint32_t sysTick
 Current system tick. More...
 
volatile uint8_t needScheduling
 Scheduling needed during timer interrupt. More...
 
volatile uint8_t blockScheduling
 Block scheduling. More...
 
bool forceScheduling
 Force the next rescheduling. More...
 
volatile uint8_t needSysTickEval
 SysTick must be evaluated during timer interrupt. More...
 
struct resource_s *volatile isrResourceQueue = NULL
 Resource queue for resources taken by Cat2 ISRs. More...
 

Detailed Description

Implementation of Operating System Control Block.

Date
2019-09-02
Author
Pascal Romahn

Definition in file OCB.c.

Macro Definition Documentation

◆ OS_CONFIG_GEN_DATA_STRUCT

#define OS_CONFIG_GEN_DATA_STRUCT

Definition at line 42 of file OCB.c.

◆ OS_CONFIG_GEN_FUNC

#define OS_CONFIG_GEN_FUNC

Definition at line 50 of file OCB.c.

◆ OS_CONFIG_GEN_TCB

#define OS_CONFIG_GEN_TCB

Definition at line 46 of file OCB.c.

Variable Documentation

◆ blockScheduling

volatile uint8_t blockScheduling

Block scheduling.

While set to a value different from zero all scheduling will be blocked.

Definition at line 27 of file OCB.c.

◆ currentTask

volatile TaskType currentTask = INVALID_TASK

Task currently being executed.

Definition at line 23 of file OCB.c.

◆ forceScheduling

bool forceScheduling

Force the next rescheduling.

If set to true the next call of OS_Schedule() will perform a rescheduling even if current task is marked as non-preemptive.

This should only be set immediately before OS_Schedule() is called.

Definition at line 28 of file OCB.c.

◆ isCat2ISR

volatile uint8_t isCat2ISR

Priority of current Cat 2 ISR (zero if not in Cat 2 ISR)

Definition at line 21 of file OCB.c.

◆ isISR

volatile bool isISR = false

Is currently ISR context?

Definition at line 20 of file OCB.c.

◆ isrResourceQueue

struct resource_s* volatile isrResourceQueue = NULL

Resource queue for resources taken by Cat2 ISRs.

Definition at line 32 of file OCB.c.

◆ needScheduling

volatile uint8_t needScheduling

Scheduling needed during timer interrupt.

If set to 0 the system timer will not trigger rescheduling.

Definition at line 26 of file OCB.c.

◆ needSysTickEval

volatile uint8_t needSysTickEval

SysTick must be evaluated during timer interrupt.

This indicates whether or not the change in SysTick value must be evaluated during the timer ISR. The value should be zero if no subsystem (like alarms) require evaluation of the sysTick counter.

Definition at line 30 of file OCB.c.

◆ sysTick

volatile uint32_t sysTick

Current system tick.

Definition at line 25 of file OCB.c.