Motr  M0
processor.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2012-2020 Seagate Technology LLC and/or its Affiliates
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * For any questions about this software or licensing,
18  * please email opensource@seagate.com or cortx-questions@seagate.com.
19  *
20  */
21 
22 
23 #pragma once
24 
25 #ifndef __MOTR_LIB_PROCESSOR_H__
26 #define __MOTR_LIB_PROCESSOR_H__
27 
28 #include "lib/bitmap.h"
29 #include "lib/types.h"
30 
59 #define M0_PROCESSORS_INVALID_ID ((uint32_t)-1)
60 
62 typedef uint32_t m0_processor_nr_t;
63 
84 M0_INTERNAL int m0_processors_init(void);
85 
92 M0_INTERNAL void m0_processors_fini(void);
93 
97 M0_INTERNAL m0_processor_nr_t m0_processor_nr_max(void);
98 
107 M0_INTERNAL void m0_processors_possible(struct m0_bitmap *map);
108 
117 M0_INTERNAL void m0_processors_available(struct m0_bitmap *map);
118 
127 M0_INTERNAL void m0_processors_online(struct m0_bitmap *map);
128 
137 M0_INTERNAL m0_processor_nr_t m0_processor_id_get(void);
138 
173  uint32_t pd_numa_node;
176  uint32_t pd_l1;
179  uint32_t pd_l2;
181  size_t pd_l1_sz;
183  size_t pd_l2_sz;
186  uint32_t pd_pipeline;
187 };
188 
208 M0_INTERNAL int m0_processor_describe(m0_processor_nr_t id,
209  struct m0_processor_descr *pd);
210 
218 M0_INTERNAL bool m0_processor_is_vm(void);
219 
222 /* __MOTR_LIB_PROCESSOR_H__ */
223 #endif
224 
225 /*
226  * Local variables:
227  * c-indentation-style: "K&R"
228  * c-basic-offset: 8
229  * tab-width: 8
230  * fill-column: 80
231  * scroll-step: 1
232  * End:
233  */
map
Definition: processor.c:112
M0_INTERNAL void m0_processors_possible(struct m0_bitmap *map)
Definition: processor.c:1099
M0_INTERNAL m0_processor_nr_t m0_processor_nr_max(void)
Definition: processor.c:1093
M0_INTERNAL void m0_processors_fini(void)
Definition: processor.c:1084
uint32_t pd_pipeline
Definition: processor.h:186
M0_INTERNAL m0_processor_nr_t m0_processor_id_get(void)
Definition: processor.c:1139
uint32_t pd_numa_node
Definition: processor.h:173
uint32_t m0_processor_nr_t
Definition: processor.h:62
m0_processor_nr_t pd_id
Definition: processor.h:171
M0_INTERNAL int m0_processors_init(void)
Definition: processor.c:1062
M0_INTERNAL void m0_processors_online(struct m0_bitmap *map)
Definition: processor.c:1113
M0_INTERNAL int m0_processor_describe(m0_processor_nr_t id, struct m0_processor_descr *pd)
Definition: processor.c:1120
M0_INTERNAL bool m0_processor_is_vm(void)
Definition: processor.c:1171
M0_INTERNAL void m0_processors_available(struct m0_bitmap *map)
Definition: processor.c:1106