2 * Copyright (c) 2017 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #ifndef included_linux_sysfs_h
17 #define included_linux_sysfs_h
19 #include <vppinfra/error.h>
20 #include <vppinfra/bitmap.h>
22 clib_error_t *clib_sysfs_write (char *file_name, char *fmt, ...);
24 clib_error_t *clib_sysfs_read (char *file_name, char *fmt, ...);
26 clib_error_t *clib_sysfs_set_nr_hugepages (int numa_node,
27 int log2_page_size, int nr);
28 clib_error_t *clib_sysfs_get_nr_hugepages (int numa_node,
29 int log2_page_size, int *v);
30 clib_error_t *clib_sysfs_get_free_hugepages (int numa_node,
31 int log2_page_size, int *v);
32 clib_error_t *clib_sysfs_get_surplus_hugepages (int numa_node,
33 int log2_page_size, int *v);
34 clib_error_t *clib_sysfs_prealloc_hugepages (int numa_node,
35 int log2_page_size, int nr);
37 uword *clib_sysfs_read_bitmap (char *fmt, ...);
39 #endif /* included_linux_sysfs_h */
42 * fd.io coding-style-patch-verification: ON
45 * eval: (c-set-style "gnu")