NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
gki_target.h
1
/******************************************************************************
2
*
3
* NOTICE OF CHANGES
4
* 2024/03/25:
5
* - Add #defines for RVL target
6
*
7
* Compile with REVOLUTION defined to include these changes.
8
*
9
******************************************************************************/
10
11
12
13
/******************************************************************************
14
*
15
* Copyright (C) 1999-2012 Broadcom Corporation
16
*
17
* Licensed under the Apache License, Version 2.0 (the "License");
18
* you may not use this file except in compliance with the License.
19
* You may obtain a copy of the License at:
20
*
21
* http://www.apache.org/licenses/LICENSE-2.0
22
*
23
* Unless required by applicable law or agreed to in writing, software
24
* distributed under the License is distributed on an "AS IS" BASIS,
25
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26
* See the License for the specific language governing permissions and
27
* limitations under the License.
28
*
29
******************************************************************************/
30
#ifndef GKI_TARGET_H
31
#define GKI_TARGET_H
32
33
/**
34
* Modifications for decomp
35
*/
36
#ifdef REVOLUTION
37
38
#define GKI_MAX_TASKS 8
39
#define GKI_NUM_TIMERS 2
40
#define GKI_DELAY_STOP_SYS_TICK 0
41
#define GKI_BUF1_SIZE 128
42
#define GKI_BUF3_SIZE 1800
43
#define GKI_BUF3_MAX 30
44
#define GKI_BUF4_SIZE 8192
45
#define GKI_BUF4_MAX 9
46
#define GKI_NUM_FIXED_BUF_POOLS 5
47
#define GKI_DEF_BUFPOOL_PERM_MASK 0xfff0
48
#define GKI_NUM_TOTAL_BUF_POOLS 9
49
50
// RVL version didn't have A2DP?
51
#define GKI_PPC_TASK 2
52
53
#endif
54
55
56
/* Operating System Selection */
57
#ifndef BTE_SIM_APP
58
#define _GKI_ARM
59
#define _GKI_STANDALONE
60
#else
61
#define _BT_WIN32
62
#endif
63
64
/* define prefix for exporting APIs from libraries */
65
#define EXPORT_API
66
67
#ifndef BTE_BSE_WRAPPER
68
#ifdef BTE_SIM_APP
69
#undef EXPORT_API
70
#define EXPORT_API __declspec(dllexport)
71
#endif
72
#endif
73
74
#define GKI_API EXPORT_API
75
#define UDRV_API EXPORT_API
76
77
#ifndef GKI_DEBUG
78
#define GKI_DEBUG FALSE
79
#endif
80
81
82
#if defined (GKI_DEBUG) && (GKI_DEBUG == TRUE)
83
#define GKI_TRACE(fmt, ...) ALOGI ("%s: " fmt, __FUNCTION__, ## __VA_ARGS__)
84
#else
85
#define GKI_TRACE(fmt, ...)
86
#endif
87
88
/******************************************************************************
89
**
90
** Task configuration
91
**
92
******************************************************************************/
93
94
/* Definitions of task IDs for inter-task messaging */
95
#ifndef BTU_TASK
96
#define BTU_TASK 0
97
#endif
98
99
#ifndef BTIF_TASK
100
#define BTIF_TASK 1
101
#endif
102
103
#ifndef A2DP_MEDIA_TASK
104
#define A2DP_MEDIA_TASK 2
105
#endif
106
107
/* The number of GKI tasks in the software system. */
108
#ifndef GKI_MAX_TASKS
109
#define GKI_MAX_TASKS 3
110
#endif
111
112
/******************************************************************************
113
**
114
** Timer configuration
115
**
116
******************************************************************************/
117
118
/* The number of GKI timers in the software system. */
119
#ifndef GKI_NUM_TIMERS
120
#define GKI_NUM_TIMERS 3
121
#endif
122
123
/* A conversion value for translating ticks to calculate GKI timer. */
124
#ifndef TICKS_PER_SEC
125
#define TICKS_PER_SEC 100
126
#endif
127
128
/************************************************************************
129
** Utility macros converting ticks to time with user define OS ticks per sec
130
**/
131
#ifndef GKI_MS_TO_TICKS
132
#define GKI_MS_TO_TICKS(x) ((x) / (1000 / TICKS_PER_SEC))
133
#endif
134
135
#ifndef GKI_SECS_TO_TICKS
136
#define GKI_SECS_TO_TICKS(x) ((x) * (TICKS_PER_SEC))
137
#endif
138
139
#ifndef GKI_TICKS_TO_MS
140
#define GKI_TICKS_TO_MS(x) ((x) * 1000 / TICKS_PER_SEC)
141
#endif
142
143
#ifndef GKI_TICKS_TO_SECS
144
#define GKI_TICKS_TO_SECS(x) ((x) / TICKS_PER_SEC)
145
#endif
146
147
148
149
/* TICK per second from OS (OS dependent change this macro accordingly to various OS) */
150
#ifndef OS_TICKS_PER_SEC
151
#define OS_TICKS_PER_SEC 1000
152
#endif
153
154
/************************************************************************
155
** Utility macros converting ticks to time with user define OS ticks per sec
156
**/
157
158
#ifndef GKI_OS_TICKS_TO_MS
159
#define GKI_OS_TICKS_TO_MS(x) ((x) * 1000 / OS_TICKS_PER_SEC)
160
#endif
161
162
163
#ifndef GKI_OS_TICKS_TO_SECS
164
#define GKI_OS_TICKS_TO_SECS(x) ((x) / OS_TICKS_PER_SEC))
165
#endif
166
167
168
/* delay in ticks before stopping system tick. */
169
#ifndef GKI_DELAY_STOP_SYS_TICK
170
#define GKI_DELAY_STOP_SYS_TICK 10
171
#endif
172
173
/* Option to guarantee no preemption during timer expiration (most system don't need this) */
174
#ifndef GKI_TIMER_LIST_NOPREEMPT
175
#define GKI_TIMER_LIST_NOPREEMPT FALSE
176
#endif
177
178
/******************************************************************************
179
**
180
** Buffer configuration
181
**
182
******************************************************************************/
183
184
/* TRUE if GKI uses dynamic buffers. */
185
#ifndef GKI_USE_DYNAMIC_BUFFERS
186
#define GKI_USE_DYNAMIC_BUFFERS FALSE
187
#endif
188
189
/* The size of the buffers in pool 0. */
190
#ifndef GKI_BUF0_SIZE
191
#define GKI_BUF0_SIZE 64
192
#endif
193
194
/* The number of buffers in buffer pool 0. */
195
#ifndef GKI_BUF0_MAX
196
#define GKI_BUF0_MAX 48
197
#endif
198
199
/* The ID of buffer pool 0. */
200
#ifndef GKI_POOL_ID_0
201
#define GKI_POOL_ID_0 0
202
#endif
203
204
/* The size of the buffers in pool 1. */
205
#ifndef GKI_BUF1_SIZE
206
#define GKI_BUF1_SIZE 288
207
#endif
208
209
/* The number of buffers in buffer pool 1. */
210
#ifndef GKI_BUF1_MAX
211
#define GKI_BUF1_MAX 26
212
#endif
213
214
/* The ID of buffer pool 1. */
215
#ifndef GKI_POOL_ID_1
216
#define GKI_POOL_ID_1 1
217
#endif
218
219
/* The size of the buffers in pool 2. */
220
#ifndef GKI_BUF2_SIZE
221
#define GKI_BUF2_SIZE 660
222
#endif
223
224
/* The number of buffers in buffer pool 2. */
225
#ifndef GKI_BUF2_MAX
226
#define GKI_BUF2_MAX 45
227
#endif
228
229
/* The ID of buffer pool 2. */
230
#ifndef GKI_POOL_ID_2
231
#define GKI_POOL_ID_2 2
232
#endif
233
234
/* The size of the buffers in pool 3. */
235
#ifndef GKI_BUF3_SIZE
236
#define GKI_BUF3_SIZE (4096+16)
237
#endif
238
239
/* The number of buffers in buffer pool 3. */
240
#ifndef GKI_BUF3_MAX
241
#define GKI_BUF3_MAX 200
242
#endif
243
244
/* The ID of buffer pool 3. */
245
#ifndef GKI_POOL_ID_3
246
#define GKI_POOL_ID_3 3
247
#endif
248
249
/* The size of the largest PUBLIC fixed buffer in system. */
250
#ifndef GKI_MAX_BUF_SIZE
251
#define GKI_MAX_BUF_SIZE GKI_BUF3_SIZE
252
#endif
253
254
/* The pool ID of the largest PUBLIC fixed buffer in system. */
255
#ifndef GKI_MAX_BUF_SIZE_POOL_ID
256
#define GKI_MAX_BUF_SIZE_POOL_ID GKI_POOL_ID_3
257
#endif
258
259
/* RESERVED buffer pool for OBX */
260
/* Ideally there should be 1 buffer for each instance for RX data, and some number
261
of TX buffers based on active instances. OBX will only use these if packet size
262
requires it. In most cases the large packets are used in only one direction so
263
the other direction will use smaller buffers.
264
Devices with small amount of RAM should limit the number of active obex objects.
265
*/
266
/* The size of the buffers in pool 4. */
267
#ifndef GKI_BUF4_SIZE
268
#define GKI_BUF4_SIZE (8080+26)
269
#endif
270
271
/* The number of buffers in buffer pool 4. */
272
#ifndef GKI_BUF4_MAX
273
#define GKI_BUF4_MAX (OBX_NUM_SERVERS + OBX_NUM_CLIENTS)
274
#endif
275
276
/* The ID of buffer pool 4. */
277
#ifndef GKI_POOL_ID_4
278
#define GKI_POOL_ID_4 4
279
#endif
280
281
/* The number of fixed GKI buffer pools.
282
eL2CAP requires Pool ID 5
283
If BTM_SCO_HCI_INCLUDED is FALSE, Pool ID 6 is unnecessary, otherwise set to 7
284
If BTA_HL_INCLUDED is FALSE then Pool ID 7 is uncessary and set the following to 7, otherwise set to 8
285
If BLE_INCLUDED is FALSE then Pool ID 8 is uncessary and set the following to 8, otherwise set to 9
286
POOL_ID 9 is a public pool meant for large buffer needs such as SDP_DB
287
*/
288
// btla-specific ++
289
#ifndef GKI_NUM_FIXED_BUF_POOLS
290
#define GKI_NUM_FIXED_BUF_POOLS 10
291
#endif
292
293
/* The buffer pool usage mask. */
294
#ifndef GKI_DEF_BUFPOOL_PERM_MASK
295
/* Setting POOL_ID 9 as a public pool meant for large buffers such as SDP_DB */
296
#define GKI_DEF_BUFPOOL_PERM_MASK 0xfdf0
297
#endif
298
// btla-specific --
299
300
/* The number of fixed and dynamic buffer pools */
301
#ifndef GKI_NUM_TOTAL_BUF_POOLS
302
#define GKI_NUM_TOTAL_BUF_POOLS 10
303
#endif
304
305
/* The following is intended to be a reserved pool for L2CAP
306
Flow control and retransmissions and intentionally kept out
307
of order */
308
309
/* The number of buffers in buffer pool 5. */
310
#ifndef GKI_BUF5_MAX
311
#define GKI_BUF5_MAX 64
312
#endif
313
314
/* The ID of buffer pool 5. */
315
#ifndef GKI_POOL_ID_5
316
#define GKI_POOL_ID_5 5
317
#endif
318
319
/* The size of the buffers in pool 5
320
** Special pool used by l2cap retransmissions only. This size based on segment
321
** that will fit into both DH5 and 2-DH3 packet types after accounting for GKI
322
** header. 13 bytes of max headers allows us a 339 payload max. (in btui_app.txt)
323
** Note: 748 used for insight scriptwrapper with CAT-2 scripts.
324
*/
325
#ifndef GKI_BUF5_SIZE
326
#define GKI_BUF5_SIZE 748
327
#endif
328
329
/* The buffer corruption check flag. */
330
#ifndef GKI_ENABLE_BUF_CORRUPTION_CHECK
331
#define GKI_ENABLE_BUF_CORRUPTION_CHECK TRUE
332
#endif
333
334
/* The GKI severe error macro. */
335
#ifndef GKI_SEVERE
336
#define GKI_SEVERE(code)
337
#endif
338
339
/* TRUE if GKI includes debug functionality. */
340
#ifndef GKI_DEBUG
341
#define GKI_DEBUG FALSE
342
#endif
343
344
/* Maximum number of exceptions logged. */
345
#ifndef GKI_MAX_EXCEPTION
346
#define GKI_MAX_EXCEPTION 8
347
#endif
348
349
/* Maximum number of chars stored for each exception message. */
350
#ifndef GKI_MAX_EXCEPTION_MSGLEN
351
#define GKI_MAX_EXCEPTION_MSGLEN 64
352
#endif
353
354
#ifndef GKI_SEND_MSG_FROM_ISR
355
#define GKI_SEND_MSG_FROM_ISR FALSE
356
#endif
357
358
359
/* The following is intended to be a reserved pool for SCO
360
over HCI data and intentionally kept out of order */
361
362
/* The ID of buffer pool 6. */
363
#ifndef GKI_POOL_ID_6
364
#define GKI_POOL_ID_6 6
365
#endif
366
367
/* The size of the buffers in pool 6,
368
BUF_SIZE = max SCO data 255 + sizeof(BT_HDR) = 8 + SCO packet header 3 + padding 2 = 268 */
369
#ifndef GKI_BUF6_SIZE
370
#define GKI_BUF6_SIZE 268
371
#endif
372
373
/* The number of buffers in buffer pool 6. */
374
#ifndef GKI_BUF6_MAX
375
#define GKI_BUF6_MAX 60
376
#endif
377
378
379
/* The following pool is a dedicated pool for HDP
380
If a shared pool is more desirable then
381
1. set BTA_HL_LRG_DATA_POOL_ID to the desired Gki Pool ID
382
2. make sure that the shared pool size is larger than 9472
383
3. adjust GKI_NUM_FIXED_BUF_POOLS accordingly since
384
POOL ID 7 is not needed
385
*/
386
387
/* The ID of buffer pool 7. */
388
#ifndef GKI_POOL_ID_7
389
#define GKI_POOL_ID_7 7
390
#endif
391
392
/* The size of the buffers in pool 7 */
393
#ifndef GKI_BUF7_SIZE
394
#define GKI_BUF7_SIZE 9472
395
#endif
396
397
/* The number of buffers in buffer pool 7. */
398
#ifndef GKI_BUF7_MAX
399
#define GKI_BUF7_MAX 2
400
#endif
401
402
/* The following pool is a dedicated pool for GATT
403
If a shared pool is more desirable then
404
1. set GATT_DB_POOL_ID to the desired Gki Pool ID
405
2. make sure that the shared pool size fit a common GATT database needs
406
3. adjust GKI_NUM_FIXED_BUF_POOLS accordingly since
407
POOL ID 8 is not needed
408
*/
409
410
/* The ID of buffer pool 8. */
411
#ifndef GKI_POOL_ID_8
412
#define GKI_POOL_ID_8 8
413
#endif
414
415
/* The size of the buffers in pool 8 */
416
#ifndef GKI_BUF8_SIZE
417
#define GKI_BUF8_SIZE 128
418
#endif
419
420
/* The number of buffers in buffer pool 8. */
421
#ifndef GKI_BUF8_MAX
422
#define GKI_BUF8_MAX 30
423
#endif
424
425
// btla-specific ++
426
/* The following pool is meant for large allocations such as SDP_DB */
427
#ifndef GKI_POOL_ID_9
428
#define GKI_POOL_ID_9 9
429
#endif
430
431
#ifndef GKI_BUF9_SIZE
432
#define GKI_BUF9_SIZE 8192
433
#endif
434
435
#ifndef GKI_BUF9_MAX
436
#define GKI_BUF9_MAX 5
437
#endif
438
// btla-specific --
439
440
/* GKI Trace Macros */
441
#define GKI_TRACE_0(m) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_GKI | TRACE_ORG_GKI | TRACE_TYPE_GENERIC,m)
442
#define GKI_TRACE_1(m,p1) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_GKI | TRACE_ORG_GKI | TRACE_TYPE_GENERIC,m,p1)
443
#define GKI_TRACE_2(m,p1,p2) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_GKI | TRACE_ORG_GKI | TRACE_TYPE_GENERIC,m,p1,p2)
444
#define GKI_TRACE_3(m,p1,p2,p3) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_GKI | TRACE_ORG_GKI | TRACE_TYPE_GENERIC,m,p1,p2,p3)
445
#define GKI_TRACE_4(m,p1,p2,p3,p4) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_GKI | TRACE_ORG_GKI | TRACE_TYPE_GENERIC,m,p1,p2,p3,p4)
446
#define GKI_TRACE_5(m,p1,p2,p3,p4,p5) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_GKI | TRACE_ORG_GKI | TRACE_TYPE_GENERIC,m,p1,p2,p3,p4,p5)
447
#define GKI_TRACE_6(m,p1,p2,p3,p4,p5,p6) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_GKI | TRACE_ORG_GKI | TRACE_TYPE_GENERIC,m,p1,p2,p3,p4,p5,p6)
448
449
#define GKI_TRACE_ERROR_0(m) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_GKI | TRACE_ORG_GKI | TRACE_TYPE_ERROR,m)
450
#define GKI_TRACE_ERROR_1(m,p1) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_GKI | TRACE_ORG_GKI | TRACE_TYPE_ERROR,m,p1)
451
#define GKI_TRACE_ERROR_2(m,p1,p2) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_GKI | TRACE_ORG_GKI | TRACE_TYPE_ERROR,m,p1,p2)
452
#define GKI_TRACE_ERROR_3(m,p1,p2,p3) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_GKI | TRACE_ORG_GKI | TRACE_TYPE_ERROR,m,p1,p2,p3)
453
#define GKI_TRACE_ERROR_4(m,p1,p2,p3,p4) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_GKI | TRACE_ORG_GKI | TRACE_TYPE_ERROR,m,p1,p2,p3,p4)
454
#define GKI_TRACE_ERROR_5(m,p1,p2,p3,p4,p5) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_GKI | TRACE_ORG_GKI | TRACE_TYPE_ERROR,m,p1,p2,p3,p4,p5)
455
#define GKI_TRACE_ERROR_6(m,p1,p2,p3,p4,p5,p6) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_GKI | TRACE_ORG_GKI | TRACE_TYPE_ERROR,m,p1,p2,p3,p4,p5,p6)
456
457
#ifdef __cplusplus
458
extern
"C"
459
{
460
#endif
461
462
EXPORT_API
extern
void
LogMsg (UINT32 trace_set_mask,
const
char
*fmt_str, ...);
463
464
#ifdef __cplusplus
465
}
466
#endif
467
468
#endif
/* GKI_TARGET_H */
include
lib
revolution
BTE
include
gki_target.h
Made with ❤️ by
CLF78
and
RootCubed
. Logos by
Chasical
and
B1
. Website generated by
Doxygen
1.13.2