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
|
/*
* igatempsupport.h
*
* Interface implemented by all multiprocessor gates.
*
* Copyright (C) 2008-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 _IGATEMPSUPPORT_H_
#define _IGATEMPSUPPORT_H_
/* Invalid Igate */
#define IGATEMPSUPPORT_NULL (void *)0xFFFFFFFF
/* Gates with this "quality" may cause the calling thread to block;
* i.e., suspend execution until another thread leaves the gate. */
#define IGATEMPSUPPORT_Q_BLOCKING 1
/* Gates with this "quality" allow other threads to preempt the thread
* that has already entered the gate. */
#define IGATEMPSUPPORT_Q_PREEMPTING 2
/* Object embedded in other Gate modules. (Inheritance) */
#define IGATEMPSUPPORT_SUPERPARAMS \
u32 resource_id; \
bool open_flag; \
u16 region_id; \
void *shared_addr
/* All other GateMP modules inherit this. */
#define IGATEMPSUPPORT_INHERIT(X) \
enum X##_local_protect { \
X##_LOCALPROTECT_NONE = 0, \
X##_LOCALPROTECT_INTERRUPT = 1, \
X##_LOCALPROTECT_TASKLET = 2, \
X##_LOCALPROTECT_THREAD = 3, \
X##_LOCALPROTECT_PROCESS = 4 \
};
/* Paramter initializer. */
#define IGATEMPSUPPORT_PARAMSINTIALIZER(x) \
do { \
(x)->resource_id = 0; \
(x)->open_flag = true; \
(x)->region_id = 0; \
(x)->shared_addr = NULL; \
} while (0)
enum igatempsupport_local_protect {
IGATEMPSUPPORT_LOCALPROTECT_NONE = 0,
IGATEMPSUPPORT_LOCALPROTECT_INTERRUPT = 1,
IGATEMPSUPPORT_LOCALPROTECT_TASKLET = 2,
IGATEMPSUPPORT_LOCALPROTECT_THREAD = 3,
IGATEMPSUPPORT_LOCALPROTECT_PROCESS = 4
};
struct igatempsupport_params {
u32 resource_id;
bool open_flag;
u16 region_id;
void *shared_addr;
};
#endif /* ifndef __IGATEMPSUPPORT_H__ */
|