]> rtime.felk.cvut.cz Git - arc.git/blob - system/kernel/include/application.h
Again, loads of refactoring and removing and adding files.
[arc.git] / system / kernel / include / application.h
1 \r
2 #ifndef APPLICATION_H_\r
3 #define APPLICATION_H_\r
4 \r
5 #if ( OS_SC3 == STD_ON) || ( OS_SC4 == STD_ON )\r
6 \r
7 /* STD container : OsApplicationHooks\r
8  * class: 3,4\r
9  * OsAppErrorHook:                              1    Bool\r
10  * OsAppShutdownHook:                   1    Bool\r
11  * OsAppStartupHook:                    1    Bool\r
12  */\r
13 \r
14 typedef struct OsAppHooks {\r
15         void (*startup)( void );\r
16         void (*shutdown)( Std_ReturnType Error );\r
17         void (*error)( Std_ReturnType Error );\r
18 } OsAppHooksType;\r
19 \r
20 \r
21 /* STD container : OsApplication\r
22  * OsTrusted:                                   1    Bool\r
23  * OsAppAlarmRef:                               0..*\r
24  * OsAppCounterRef:                             0..*\r
25  * OsAppIsrRef:                                 0..*\r
26  * OsAppResourceRef:                    0..*\r
27  * OsAppScheduleTableRef:               0..*\r
28  * OsAppTaskRef:                                0..*\r
29  * OsRestartTask:                               0..1 Ref to system restart task\r
30  * OsApplicatinHooks[C]                 1\r
31  * OsApplictionTrustedFunction[C]:      0..*\r
32  *\r
33  * Note! referenced objects also can be accessed by multiple applications.\r
34  * Note! speed is needed when looking up the accessing application, not vice versa.\r
35  * Note! The application knowledge about what objects belong to it is just a memory\r
36  *       management issue, not an access issue.\r
37  * */\r
38 \r
39 typedef struct OsApplication {\r
40         /* 0 - Non-trusted application\r
41          * 1 - Trusted application */\r
42         _Bool trusted;\r
43 \r
44         /* NOTE! Refs here is memory management issue */\r
45 \r
46         /* The application hooks */\r
47         OsAppHooksType hooks;\r
48 \r
49         /* Trusted functions */\r
50         /* .... */\r
51 } OsApplicationType;\r
52 \r
53 \r
54 /* NON standard type.\r
55  * Used for ROM based parameters.... TODO
56  */\r
57 typedef struct OsRomApplication {\r
58         uint32  application_id;\r
59         char    name[16];\r
60         uint8   trusted;\r
61 \r
62         /* hooks */\r
63         void (*StartupHook)( void );\r
64         void (*ShutdownHook)( Std_ReturnType Error );\r
65         void (*ErrorHook)( Std_ReturnType Error );\r
66 \r
67         uint32 isr_mask;\r
68         uint32 scheduletable_mask;\r
69         uint32 alarm_mask;\r
70         uint32 counter_mask;\r
71         uint32 resource_mask;\r
72         uint32 message_mask;\r
73 \r
74 } OsRomApplicationType;\r
75 \r
76 #endif /*  ( OS_SC1 == STD_ON ) || ( OS_SC4 == STD_ON ) */\r
77 \r
78 \r
79 #endif /* APPLICATION_H_ */\r