blob: 19fab220b2c4f8c9e0bfa4d04f6354a902bd4d44 (
plain)
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
/*
* sysmgr.h
*
* Defines for System manager.
*
* Copyright (C) 2009 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE.
*/
#ifndef _SYSMGR_H_
#define _SYSMGR_H_
/* Module headers */
#include <multiproc.h>
#include <gatepeterson.h>
#include <sharedregion.h>
#include <listmp.h>
#include <listmp_sharedmemory.h>
#include <messageq.h>
#include <messageq_transportshm.h>
#include <notify.h>
#include <notify_ducatidriver.h>
#include <nameserver.h>
#include <nameserver_remote.h>
#include <nameserver_remotenotify.h>
#include <procmgr.h>
#include <heap.h>
#include <heapbuf.h>
#include <sysmemmgr.h>
/*!
* @def SYSMGR_MODULEID
* @brief Unique module ID.
*/
#define SYSMGR_MODULEID (0xF086)
/* =============================================================================
* Module Success and Failure codes
* =============================================================================
*/
/*!
* @def SYSMGR_STATUSCODEBASE
* @brief Error code base for System manager.
*/
#define SYSMGR_STATUSCODEBASE (SYSMGR_MODULEID << 12u)
/*!
* @def SYSMGR_MAKE_FAILURE
* @brief Macro to make error code.
*/
#define SYSMGR_MAKE_FAILURE(x) ((s32)(0x80000000 + \
(SYSMGR_STATUSCODEBASE + \
(x))))
/*!
* @def SYSMGR_MAKE_SUCCESS
* @brief Macro to make success code.
*/
#define SYSMGR_MAKE_SUCCESS(x) (SYSMGR_STATUSCODEBASE + (x))
/*!
* @def SYSMGR_E_INVALIDARG
* @brief Argument passed to a function is invalid.
*/
#define SYSMGR_E_INVALIDARG SYSMGR_MAKE_FAILURE(1)
/*!
* @def SYSMGR_E_MEMORY
* @brief Memory allocation failed.
*/
#define SYSMGR_E_MEMORY SYSMGR_MAKE_FAILURE(2)
/*!
* @def SYSMGR_E_FAIL
* @brief General failure.
*/
#define SYSMGR_E_FAIL SYSMGR_MAKE_FAILURE(3)
/*!
* @def SYSMGR_E_INVALIDSTATE
* @brief Module is in invalid state.
*/
#define SYSMGR_E_INVALIDSTATE SYSMGR_MAKE_FAILURE(4)
/*!
* @def SYSMGR_E_OSFAILURE
* @brief Failure in OS call.
*/
#define SYSMGR_E_OSFAILURE SYSMGR_MAKE_FAILURE(5)
/*!
* @def SYSMGR_S_ALREADYSETUP
* @brief Module is already initialized.
*/
#define SYSMGR_S_ALREADYSETUP SYSMGR_MAKE_SUCCESS(1)
/*!
* @def SYSMGR_CMD_SCALABILITY
* @brief Command ID for scalability info.
*/
#define SYSMGR_CMD_SCALABILITY (0x00000000)
/*!
* @def SYSMGR_CMD_SHAREDREGION_ENTRY_BASE
* @brief Base of command IDs for entries used by Shared region.
*/
#define SYSMGR_CMD_SHAREDREGION_ENTRY_START (0x00000001)
#define SYSMGR_CMD_SHAREDREGION_ENTRY_END (0x00001000)
/* =============================================================================
* Structures & Enums
* =============================================================================
*/
/*!
* @brief Structure defining config parameters for overall System.
*/
struct sysmgr_config {
struct sysmemmgr_config sysmemmgr_cfg;
/*!< System memory manager config parameter */
struct multiproc_config multiproc_cfg;
/*!< Multiproc config parameter */
struct gatepeterson_config gatepeterson_cfg;
/*!< Gatepeterson config parameter */
struct sharedregion_config sharedregion_cfg;
/*!< SharedRegion config parameter */
struct messageq_config messageq_cfg;
/*!< MessageQ config parameter */
struct notify_config notify_cfg;
/*!< Notify config parameter */
struct proc_mgr_config proc_mgr_cfg;
/*!< Processor manager config parameter */
struct heapbuf_config heapbuf_cfg;
/*!< Heap Buf config parameter */
struct listmp_config listmp_sharedmemory_cfg;
/*!< ListMPSharedMemory config parameter */
struct messageq_transportshm_config messageq_transportshm_cfg;
/*!< MessageQTransportShm config parameter */
struct notify_ducatidrv_config notify_ducatidrv_cfg;
/*!< NotifyDriverShm config parameter */
struct nameserver_remotenotify_config nameserver_remotenotify_cfg;
/*!< NameServerRemoteNotify config parameter */
};
/* =============================================================================
* APIs
* =============================================================================
*/
/* Function to initialize the parameter structure */
void sysmgr_get_config(struct sysmgr_config *config);
/* Function to initialize sysmgr module */
s32 sysmgr_setup(const struct sysmgr_config *config);
/* Function to Finalize sysmgr module */
s32 sysmgr_destroy(void);
#endif /* ifndef SYSMGR_H_0xF086 */
|