/
tpl_os_event_kernel.h
111 lines (97 loc) · 3.1 KB
/
tpl_os_event_kernel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/*
* @file tpl_os_event_kernel.h
*
* @section desc File description
*
* Trampoline Event Management header file
*
* @section copyright Copyright
*
* Trampoline RTOS
*
* Trampoline is copyright (c) CNRS, University of Nantes, Ecole Centrale de Nantes
* Trampoline is protected by the French intellectual property law.
*
* This software is distributed under the GNU Public Licence V2.
* Check the LICENSE file in the root directory of Trampoline
*
* @section infos File informations
*
* $Date$
* $Rev$
* $Author$
* $URL$
*/
#ifndef TPL_OS_EVENT_KERNEL_H
#define TPL_OS_EVENT_KERNEL_H
#include "tpl_os_types.h"
#include "tpl_os_task_kernel.h"
#define OS_START_SEC_CODE
#include "tpl_memmap.h"
/**
* @internal
*
* Set events of a task
*
* @param task_id identifier of the task for which events will be set
* @param event event mask for selected event bits
*
* @retval E_OK no error
* @retval E_OS_ID (extended error only) task_id is invalid
* @retval E_OS_ACCESS (extended error only) referenced task is not extended task
* @retval E_OS_STATE (extended error only) referenced task is suspended
*
* see paragraph 13.5.3.1 page 60 of OSEK/VDX 2.2.2 spec
*/
FUNC(tpl_status, OS_CODE) tpl_set_event_service(
CONST(tpl_task_id, AUTOMATIC) task_id,
CONST(tpl_event_mask, AUTOMATIC) event);
/**
* Clear event of current task
*
* @param event event mask for selected event bits
*
* @retval E_OK no error
* @retval E_OS_ACCESS (extended error only) caller is not an extended task
* @retval E_OS_CALLEVEL (extended error only) call at interrupt level
*
* see paragraph 13.5.3.2 page 61 of OSEK/VDX 2.2.2 spec
*/
FUNC(tpl_status, OS_CODE) tpl_clear_event_service(
CONST(tpl_event_mask, AUTOMATIC) event);
/**
* Get the state of an event
*
* @param task_id identifier of the task
* @param event #tpl_event_mask variable where the event value will
* be stored
*
* @retval E_OK no error
* @retval E_OS_ACCESS (extended error only) referenced task is not extended
* @retval E_OS_STATE (extended error only) referenced task is suspended
*
* see paragraph 13.5.3.3 page 61 of OSEK/VDX 2.2.2 spec
*/
FUNC(tpl_status, OS_CODE) tpl_get_event_service(
CONST(tpl_task_id, AUTOMATIC) task_id,
CONSTP2VAR(tpl_event_mask, AUTOMATIC, OS_APPL_DATA) event);
/**
* Waits for some bits in the event
*
* @param event event mask for selected event bits
*
* @retval E_OK no error
* @retval E_OS_ACCESS (extended error only) calling task is not an
* extended task
* @retval E_OS_RESOURCE (extended error only) calling task occupies
* resources
* @retval E_OS_CALLEVEL (extended error only) call at interrupt level
*
* see paragraph 13.5.3.4 page 61 of OSEK/VDX 2.2.2 spec
*/
FUNC(tpl_status, OS_CODE) tpl_wait_event_service(
CONST(tpl_event_mask, AUTOMATIC) event);
#define OS_STOP_SEC_CODE
#include "tpl_memmap.h"
#endif /* TPL_OS_EVENT_KERNEL_H */
/* End of file tpl_os_event_kernel.h */