comparison src/gpf3/inc/nuc/os_const.h @ 2:c41a534f33c6

src/gpf3: preened GPF goo from TCS3.2
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 25 Sep 2016 23:52:50 +0000
parents
children
comparison
equal deleted inserted replaced
1:864b8cc0cf63 2:c41a534f33c6
1 /*
2 +------------------------------------------------------------------------------
3 | File: os_const.h
4 +------------------------------------------------------------------------------
5 | Copyright 2002 Texas Instruments Berlin, AG
6 | All rights reserved.
7 |
8 | This file is confidential and a trade secret of Texas
9 | Instruments Berlin, AG
10 | The receipt of or possession of this file does not convey
11 | any rights to reproduce or disclose its contents or to
12 | manufacture, use, or sell anything it may describe, in
13 | whole, or in part, without the specific written consent of
14 | Texas Instruments Berlin, AG.
15 +-----------------------------------------------------------------------------
16 | Purpose : Constants for the Nucleus OS-Layer
17 +-----------------------------------------------------------------------------
18 */
19
20 #ifndef OS_CONST_H
21 #define OS_CONST_H
22
23 /*==== INCLUDES =============================================================*/
24
25
26 /*==== CONSTS ===============================================================*/
27
28 #define PTR_OVERHEAD 8
29
30 #ifdef MEMORY_SUPERVISION
31 #define PPM_CHKOVERHEAD 4
32 #define PPM_OVERHEAD (4+PPM_CHKOVERHEAD)
33 #define PPM_IDX_OFFSET 0
34 #else
35 #define PPM_CHKOVERHEAD 0
36 #define PPM_OVERHEAD 0
37 #endif
38
39 #ifdef NU_DEBUG
40 #define PT_CHKOVERHEAD 4
41 #else
42 #define PT_CHKOVERHEAD 0
43 #endif
44
45 #define PT_OVERHEAD (PTR_OVERHEAD+PPM_OVERHEAD)
46 #define POOL_OVERHEAD 0
47
48 #define PPM_OFFSET ((PPM_OVERHEAD-PPM_CHKOVERHEAD)/sizeof(ULONG))
49
50 #define SUSPEND_ONE_TICK 1
51 #define TDMA_FRAME_DURATION 4.615
52 #define WIN32_TIMER_TICK 50
53
54 #define NO_WAIT_CHECK 0
55 #define WAIT_CHECK 1
56
57 #define OS_SUSPEND 0xffffffffUL /*NU_SUSPEND*/
58 #define OS_NO_SUSPEND 0 /*NU_NO_SUSPEND*/
59
60 #define OS_FOREVER 0xffffffffUL /*NU_SUSPEND*/
61
62 #define TIME_TO_TICK_TDMA_FRAME_MULTIPLIER 14199
63 #define TICK_TO_TIME_TDMA_FRAME_MULTIPLIER 302483
64 #define TIME_TO_TICK_10MS_MULTIPLIER 6554
65 #define TICK_TO_TIME_10MS_MULTIPLIER 655319
66
67 #ifdef _TARGET_
68 #define TIME_TO_SYSTEM_TICKS(time) (((((time)&0xffff)*os_time_to_tick_multiplier+0x8000)>>16)\
69 +(((time)>>16)*os_time_to_tick_multiplier))
70 #define SYSTEM_TICKS_TO_TIME(ticks) (((((ticks)&0xfff)*os_tick_to_time_multiplier+0x8000)>>16)\
71 +((((ticks)>>12)*os_tick_to_time_multiplier)>>4))
72 #else
73 #define TIME_TO_SYSTEM_TICKS(Time) ((Time)/WIN32_TIMER_TICK)
74 #define SYSTEM_TICKS_TO_TIME(Ticks) ((Ticks)*WIN32_TIMER_TICK)
75 #endif
76
77 #define OS_QUEUE_ENTRY_SIZE(E) (((E)*(sizeof(OS_QDATA)+sizeof(void*)) + (OS_MAX_PRIORITY * (((E)+1)*sizeof(void*)))))
78
79 #define POOL_SIZE(n,s) ((n*(s+PT_CHKOVERHEAD+PT_OVERHEAD)))
80
81 /* to avoid changes in all xxxconst.h files even if they do not use events */
82 #ifndef MAX_EVENT_GROUPS
83 #define MAX_EVENT_GROUPS 1
84 #endif
85
86 /*==== TYPES =================================================================*/
87
88
89 /*==== EXPORTS ===============================================================*/
90
91
92 #endif /* OS_CONST_H */