rusEFI
The most advanced open source ECU
controllers
engine_controller_misc.cpp
Go to the documentation of this file.
1
/*
2
* @file engine_controller_misc.cpp
3
*
4
* @date Mar 22, 2020
5
* @author Andrey Belomutskiy, (c) 2012-2020
6
*/
7
8
#include "
pch.h
"
9
10
static
uint8_t
nextThreadId
= 0;
11
void
threadInitHook
(
void
* vtp) {
12
// No lock required, this is already under lock
13
auto
tp =
reinterpret_cast<
thread_t*
>
(vtp);
14
tp->threadId = ++
nextThreadId
;
15
}
16
17
#if ENABLE_PERF_TRACE
18
void
irqEnterHook
() {
19
perfEventBegin
(
PE::ISR
);
20
}
21
22
void
irqExitHook
() {
23
perfEventEnd
(
PE::ISR
);
24
}
25
26
void
contextSwitchHook
() {
27
perfEventInstantGlobal
(
PE::ContextSwitch
);
28
}
29
30
#else
31
void
irqEnterHook
() {}
32
void
irqExitHook
() {}
33
void
contextSwitchHook
() {}
34
#endif
/* ENABLE_PERF_TRACE */
irqExitHook
void irqExitHook()
Definition:
engine_controller_misc.cpp:22
nextThreadId
static uint8_t nextThreadId
Definition:
engine_controller_misc.cpp:10
irqEnterHook
void irqEnterHook()
Definition:
engine_controller_misc.cpp:18
contextSwitchHook
void contextSwitchHook()
Definition:
engine_controller_misc.cpp:26
threadInitHook
void threadInitHook(void *vtp)
Definition:
engine_controller_misc.cpp:11
pch.h
perfEventInstantGlobal
void perfEventInstantGlobal(PE event)
Definition:
perf_trace.cpp:115
perfEventBegin
void perfEventBegin(PE event)
Definition:
perf_trace.cpp:107
perfEventEnd
void perfEventEnd(PE event)
Definition:
perf_trace.cpp:111
PE::ContextSwitch
@ ContextSwitch
PE::ISR
@ ISR
Generated on Wed Apr 24 2024 00:06:06 for rusEFI by
1.9.1