diff options
Diffstat (limited to 'include/ctrl/ctrlboardobj.h')
-rw-r--r-- | include/ctrl/ctrlboardobj.h | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/include/ctrl/ctrlboardobj.h b/include/ctrl/ctrlboardobj.h new file mode 100644 index 0000000..8f57e88 --- /dev/null +++ b/include/ctrl/ctrlboardobj.h | |||
@@ -0,0 +1,89 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | * copy of this software and associated documentation files (the "Software"), | ||
6 | * to deal in the Software without restriction, including without limitation | ||
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
9 | * Software is furnished to do so, subject to the following conditions: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
20 | * DEALINGS IN THE SOFTWARE. | ||
21 | */ | ||
22 | |||
23 | #ifndef NVGPU_CTRLBOARDOBJ_H | ||
24 | #define NVGPU_CTRLBOARDOBJ_H | ||
25 | |||
26 | struct ctrl_boardobj { | ||
27 | u8 type; | ||
28 | }; | ||
29 | |||
30 | #define CTRL_BOARDOBJGRP_TYPE_INVALID 0x00U | ||
31 | #define CTRL_BOARDOBJGRP_TYPE_E32 0x01U | ||
32 | #define CTRL_BOARDOBJGRP_TYPE_E255 0x02U | ||
33 | |||
34 | #define CTRL_BOARDOBJGRP_E32_MAX_OBJECTS 32U | ||
35 | |||
36 | #define CTRL_BOARDOBJGRP_E255_MAX_OBJECTS 255U | ||
37 | |||
38 | #define CTRL_BOARDOBJ_MAX_BOARD_OBJECTS \ | ||
39 | CTRL_BOARDOBJGRP_E32_MAX_OBJECTS | ||
40 | |||
41 | #define CTRL_BOARDOBJ_IDX_INVALID 255U | ||
42 | |||
43 | #define CTRL_BOARDOBJGRP_MASK_MASK_ELEMENT_BIT_SIZE 32U | ||
44 | |||
45 | #define CTRL_BOARDOBJGRP_MASK_MASK_ELEMENT_INDEX(_bit) \ | ||
46 | ((_bit) / CTRL_BOARDOBJGRP_MASK_MASK_ELEMENT_BIT_SIZE) | ||
47 | |||
48 | #define CTRL_BOARDOBJGRP_MASK_MASK_ELEMENT_OFFSET(_bit) \ | ||
49 | ((_bit) % CTRL_BOARDOBJGRP_MASK_MASK_ELEMENT_BIT_SIZE) | ||
50 | |||
51 | #define CTRL_BOARDOBJGRP_MASK_DATA_SIZE(_bits) \ | ||
52 | (CTRL_BOARDOBJGRP_MASK_MASK_ELEMENT_INDEX((_bits) - 1U) + 1U) | ||
53 | |||
54 | |||
55 | #define CTRL_BOARDOBJGRP_MASK_ARRAY_START_SIZE 1U | ||
56 | #define CTRL_BOARDOBJGRP_MASK_ARRAY_EXTENSION_SIZE(_bits) \ | ||
57 | (CTRL_BOARDOBJGRP_MASK_DATA_SIZE(_bits) - \ | ||
58 | CTRL_BOARDOBJGRP_MASK_ARRAY_START_SIZE) | ||
59 | |||
60 | struct ctrl_boardobjgrp_mask { | ||
61 | u32 data[1]; | ||
62 | }; | ||
63 | |||
64 | struct ctrl_boardobjgrp_mask_e32 { | ||
65 | struct ctrl_boardobjgrp_mask super; | ||
66 | }; | ||
67 | |||
68 | struct ctrl_boardobjgrp_mask_e255 { | ||
69 | struct ctrl_boardobjgrp_mask super; | ||
70 | u32 data_e255[7]; | ||
71 | }; | ||
72 | |||
73 | struct ctrl_boardobjgrp_super { | ||
74 | struct ctrl_boardobjgrp_mask obj_mask; | ||
75 | }; | ||
76 | |||
77 | struct ctrl_boardobjgrp_e32 { | ||
78 | struct ctrl_boardobjgrp_mask_e32 obj_mask; | ||
79 | }; | ||
80 | |||
81 | struct CTRL_boardobjgrp_e255 { | ||
82 | struct ctrl_boardobjgrp_mask_e255 obj_mask; | ||
83 | }; | ||
84 | |||
85 | struct ctrl_boardobjgrp { | ||
86 | u32 obj_mask; | ||
87 | }; | ||
88 | |||
89 | #endif /* NVGPU_CTRLBOARDOBJ_H */ | ||