• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  * Copyright (C) 2018 The Android Open Source Project
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at:
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *****************************************************************************
18  * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
19 */
20 
21 /*****************************************************************************/
22 /*                                                                           */
23 /*  File Name         : osal_defaults.h                                      */
24 /*                                                                           */
25 /*  Description       : This file contains default values to initialize the  */
26 /*                      attributes required components created through OSAL  */
27 /*                                                                           */
28 /*  List of Functions : None                                                 */
29 /*  Issues / Problems : None                                                 */
30 /*                                                                           */
31 /*  Revision History  :                                                      */
32 /*                                                                           */
33 /*         DD MM YYYY   Author(s)       Changes (Describe the changes made)  */
34 /*         14 07 2007   Ittiam          Draft                                */
35 /*                                                                           */
36 /*****************************************************************************/
37 
38 #ifndef OSAL_DEFAULTS_H
39 #define OSAL_DEFAULTS_H
40 
41 /*****************************************************************************/
42 /* Constants                                                                 */
43 /*****************************************************************************/
44 
45 /* Default attributes for a mailbox */
46 #define OSAL_DEFAULT_MBOX_ATTR                                                                     \
47     {                                                                                              \
48         0, /* Thread handle */                                                                     \
49             0, /* Mbox name     */                                                                 \
50             0, /* Mbox length   */                                                                 \
51             0 /* Msg size      */                                                                  \
52     }
53 
54 /* Default attributes for a semaphore */
55 #define OSAL_DEFAULT_SEM_ATTR                                                                      \
56     {                                                                                              \
57         0 /* Initial value */                                                                      \
58     }
59 
60 /* Default attributes for a thread */
61 #define OSAL_DEFAULT_THREAD_ATTR                                                                   \
62     {                                                                                              \
63         0, /* Thread function     */                                                               \
64             0, /* Thread parameters   */                                                           \
65             0, /* Stack size          */                                                           \
66             0, /* Stack start address */                                                           \
67             0, /* Thread name         */                                                           \
68             1, /* Use OSAL priorities */                                                           \
69             OSAL_PRIORITY_DEFAULT, /* Thread priority     */                                       \
70             0, /* Exit code           */                                                           \
71             OSAL_SCHED_OTHER, /* Scheduling policy   */                                            \
72             0, /* Core affinity mask  */                                                           \
73             0 /* group num           */                                                            \
74     }
75 
76 /* Default attributes for a socket */
77 #define OSAL_DEFAULT_SOCKET_ATTR                                                                   \
78     {                                                                                              \
79         OSAL_UDP /* Protocol */                                                                    \
80     }
81 
82 /* Default attributes for a socket address entry */
83 #define OSAL_DEFAULT_SOCKADDR                                                                      \
84     {                                                                                              \
85         0                                                                                          \
86     } /* Initialize IP and port to 0 */
87 
88 /* Default attributes for the select engine */
89 #define OSAL_DEFAULT_SELECT_ENGINE_ATTR                                                            \
90     {                                                                                              \
91         1, /* Use OSAL priorities */                                                               \
92             OSAL_PRIORITY_DEFAULT, /* Thread priority     */                                       \
93             0, /* Thread name         */                                                           \
94             5000, /* Timeout for select call*/                                                     \
95             10000 /* Poll interavel      */                                                        \
96     }
97 
98 /* Default attributes for an entry in the select engine */
99 #define OSAL_DEFAULT_SELECT_ENTRY                                                                  \
100     {                                                                                              \
101         0, /* Socket Handle                   */                                                   \
102             OSAL_READ_FD, /* Socket type                     */                                    \
103             0, /* Init callback                   */                                               \
104             0, /* Init callback parameters        */                                               \
105             0, /* Socket activity callback        */                                               \
106             0, /* Socket activity callback params */                                               \
107             0, /* Terminate-time callback         */                                               \
108             0, /* Terminate-time callback params  */                                               \
109             0, /* Succesful Exit code             */                                               \
110             0 /* ID                              */                                                \
111     }
112 
113 /* Default attributes for FD set */
114 #define OSAL_DEFAULT_FD_SET                                                                        \
115     {                                                                                              \
116         0 /* Initializes count to 0 */                                                             \
117     }
118 
119 /* Default attributes for time value structure */
120 #define OSAL_DEFAULT_TIMEVAL                                                                       \
121     {                                                                                              \
122         0, /* Seconds      */                                                                      \
123             0 /* Microseconds */                                                                   \
124     }
125 
126 /* Default attributes for LINGER socket option structure */
127 #define OSAL_DEFAULT_SOCKOPT_LINGER                                                                \
128     {                                                                                              \
129         0, /* On/Off */                                                                            \
130             0 /* Linger */                                                                         \
131     }
132 
133 /* Default attributes for Multicast interface IP */
134 #define OSAL_DEFAULT_IP_MREQ                                                                       \
135     {                                                                                              \
136         0                                                                                          \
137     } /* Initialize all IPs to 0 */
138 
139 #endif /* OSAL_DEFAULTS_H */
140