blob: f2f822d9741f2b0a405d69b26c0c5c27f2ebb454 [file] [log] [blame]
Damjan Marion3b64d632017-09-08 12:26:12 +02001/*
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:
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
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.
14 */
15
16#ifndef included_linux_sysfs_h
17#define included_linux_sysfs_h
18
Damjan Marion01914ce2017-09-14 19:04:50 +020019#include <vppinfra/error.h>
Damjan Marion3eb6cbe2024-02-12 19:44:58 +000020#include <vppinfra/bitmap.h>
Damjan Marion3b64d632017-09-08 12:26:12 +020021
Damjan Marion01914ce2017-09-14 19:04:50 +020022clib_error_t *clib_sysfs_write (char *file_name, char *fmt, ...);
Damjan Marion3b64d632017-09-08 12:26:12 +020023
Damjan Marion01914ce2017-09-14 19:04:50 +020024clib_error_t *clib_sysfs_read (char *file_name, char *fmt, ...);
Damjan Marion3b64d632017-09-08 12:26:12 +020025
Damjan Marion01914ce2017-09-14 19:04:50 +020026clib_error_t *clib_sysfs_set_nr_hugepages (int numa_node,
Damjan Marion6f3f1cb2018-10-22 13:01:46 +020027 int log2_page_size, int nr);
Damjan Marion01914ce2017-09-14 19:04:50 +020028clib_error_t *clib_sysfs_get_nr_hugepages (int numa_node,
Damjan Marion6f3f1cb2018-10-22 13:01:46 +020029 int log2_page_size, int *v);
Damjan Marion01914ce2017-09-14 19:04:50 +020030clib_error_t *clib_sysfs_get_free_hugepages (int numa_node,
Damjan Marion6f3f1cb2018-10-22 13:01:46 +020031 int log2_page_size, int *v);
Damjan Marion01914ce2017-09-14 19:04:50 +020032clib_error_t *clib_sysfs_get_surplus_hugepages (int numa_node,
Damjan Marion6f3f1cb2018-10-22 13:01:46 +020033 int log2_page_size, int *v);
Damjan Marion01914ce2017-09-14 19:04:50 +020034clib_error_t *clib_sysfs_prealloc_hugepages (int numa_node,
Damjan Marion6f3f1cb2018-10-22 13:01:46 +020035 int log2_page_size, int nr);
Damjan Marion3b64d632017-09-08 12:26:12 +020036
Damjan Marion3eb6cbe2024-02-12 19:44:58 +000037uword *clib_sysfs_read_bitmap (char *fmt, ...);
Damjan Marion6db633b2021-04-19 21:44:21 +020038
Damjan Marion3b64d632017-09-08 12:26:12 +020039#endif /* included_linux_sysfs_h */
40
41/*
42 * fd.io coding-style-patch-verification: ON
43 *
44 * Local Variables:
45 * eval: (c-set-style "gnu")
46 * End:
47 */