File: cap.h

package info (click to toggle)
intel-cmt-cat 25.04-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,724 kB
  • sloc: ansic: 52,004; python: 11,324; makefile: 2,197; perl: 1,165; javascript: 37; sh: 23
file content (184 lines) | stat: -rw-r--r-- 5,766 bytes parent folder | download | duplicates (2)
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
183
184
/*
 * BSD LICENSE
 *
 * Copyright(c) 2014-2023 Intel Corporation. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *   * Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *   * Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in
 *     the documentation and/or other materials provided with the
 *     distribution.
 *   * Neither the name of Intel Corporation nor the names of its
 *     contributors may be used to endorse or promote products derived
 *     from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/**
 * @brief Internal header file to share PQoS API lock mechanism
 * and library initialization status.
 */

#ifndef __PQOS_HOSTCAP_H__
#define __PQOS_HOSTCAP_H__

#ifdef __cplusplus
extern "C" {
#endif

#include "pqos.h"
#include "types.h"

/**
 * @brief Modifies L3 CAT capability structure upon CDP config change
 *
 * Limited error checks done in this function and no errors reported.
 * It is up to caller to check for L3 CAT & CDP support.
 *
 * @param [in] cdp L3 cdp configuration
 */
PQOS_LOCAL void _pqos_cap_l3cdp_change(const enum pqos_cdp_config cdp);

/**
 * @brief Modifies L3 I/O RDT capability structure upon I/O RDT config change
 *
 * Limited error checks done in this function and no errors reported.
 * It is up to caller to check for L3 CAT & I/O RDT support.
 *
 * @param [in] iordt L3 I/O RDT configuration
 */
void _pqos_cap_l3iordt_change(const enum pqos_iordt_config iordt);

/**
 * @brief Modifies L2 CAT capability structure upon CDP config change
 *
 * Limited error checks done in this function and no errors reported.
 * It is up to caller to check for L2 CAT & CDP support.
 *
 * @param [in] cdp L2 cdp configuration
 */
PQOS_LOCAL void _pqos_cap_l2cdp_change(const enum pqos_cdp_config cdp);

/**
 * @brief Modifies SMBA capability structure upon MBA CTRL config change
 *
 * Limited error checks done in this function and no errors reported.
 * It is up to caller to check for SMBA & CTRL support.
 *
 * @param [in] cfg SMBA CTRL configuration
 */
PQOS_LOCAL void _pqos_cap_smba_change(const enum pqos_mba_config cfg);

/**
 * @brief Modifies MBA capability structure upon MBA CTRL config change
 *
 * Limited error checks done in this function and no errors reported.
 * It is up to caller to check for MBA & CTRL support.
 *
 * @param [in] cfg MBA CTRL configuration
 */
PQOS_LOCAL void _pqos_cap_mba_change(const enum pqos_mba_config cfg);

/**
 * @brief Modifies Mon I/O RDT capability structure upon I/O RDT config change
 *
 * Limited error checks done in this function and no errors reported.
 * It is up to caller to check for MON & I/O RDT support.
 *
 * @param [in] iordt L3 I/O RDT configuration
 */
void _pqos_cap_mon_iordt_change(const enum pqos_iordt_config iordt);

/**
 * @brief Modifies Mon SNC capability structure upon SNC config change
 *
 * Limited error checks done in this function and no errors reported.
 * It is up to caller to check for MON & SNC support.
 *
 * @param [in] snc SNC configuration
 */
PQOS_LOCAL void _pqos_cap_mon_snc_change(const enum pqos_snc_config cfg);

/**
 * @brief Checks library initialization state
 *
 * @param expect expected stated of library initialization state
 *
 * @return Check status
 * @retval PQOS_RETVAL_OK state as expected
 * @retval PQOS_RETVA_ERROR state different than expected
 */
PQOS_LOCAL int _pqos_check_init(const int expect);

/**
 * @brief Internal API to retrieve PQoS interface
 *
 * @return PQoS interface
 */
PQOS_LOCAL enum pqos_interface _pqos_get_inter(void);

/**
 * @brief Internal API to retrieve PQoS system configuration
 *
 * @return PQoS system configuration
 */
PQOS_LOCAL const struct pqos_sysconfig *_pqos_get_sysconfig(void);

/**
 * @brief Internal API to retrieve PQoS capabilities data
 *
 * @return PQoS capabilities data
 */
PQOS_LOCAL const struct pqos_cap *_pqos_get_cap(void);

/**
 * @brief Internal API to retrieve CPU information
 *
 * @return CPU information
 */
PQOS_LOCAL const struct pqos_cpuinfo *_pqos_get_cpu(void);

/**
 * @brief Internal API to retrieve Device information
 *
 * @return Device information
 */
PQOS_LOCAL const struct pqos_devinfo *_pqos_get_dev(void);

/**
 * @brief Returns value of L3 Non-Contiguous CBM(Cache Bit Mask) support
 *
 * @return Operation status
 * @retval struct pqos_cap_l3ca member non_contiguous_cbm on success
 */
PQOS_LOCAL int cap_get_l3ca_non_contignous(void);

/**
 * @brief Returns value of L2 Non-Contiguous CBM(Cache Bit Mask) support
 *
 * @return Operation status
 * @retval struct pqos_cap_l2ca member non_contiguous_cbm on success
 */
PQOS_LOCAL int cap_get_l2ca_non_contignous(void);

#ifdef __cplusplus
}
#endif

#endif /* __PQOS_HOSTCAP_H__ */