Damjan Marion | 3b64d63 | 2017-09-08 12:26:12 +0200 | [diff] [blame] | 1 | /* |
| 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 Marion | 01914ce | 2017-09-14 19:04:50 +0200 | [diff] [blame] | 19 | #include <vppinfra/error.h> |
Damjan Marion | 3b64d63 | 2017-09-08 12:26:12 +0200 | [diff] [blame] | 20 | |
Damjan Marion | 01914ce | 2017-09-14 19:04:50 +0200 | [diff] [blame] | 21 | clib_error_t *clib_sysfs_write (char *file_name, char *fmt, ...); |
Damjan Marion | 3b64d63 | 2017-09-08 12:26:12 +0200 | [diff] [blame] | 22 | |
Damjan Marion | 01914ce | 2017-09-14 19:04:50 +0200 | [diff] [blame] | 23 | clib_error_t *clib_sysfs_read (char *file_name, char *fmt, ...); |
Damjan Marion | 3b64d63 | 2017-09-08 12:26:12 +0200 | [diff] [blame] | 24 | |
Damjan Marion | 01914ce | 2017-09-14 19:04:50 +0200 | [diff] [blame] | 25 | u8 *clib_sysfs_link_to_name (char *link); |
| 26 | |
| 27 | clib_error_t *clib_sysfs_set_nr_hugepages (int numa_node, |
Damjan Marion | 6f3f1cb | 2018-10-22 13:01:46 +0200 | [diff] [blame] | 28 | int log2_page_size, int nr); |
Damjan Marion | 01914ce | 2017-09-14 19:04:50 +0200 | [diff] [blame] | 29 | clib_error_t *clib_sysfs_get_nr_hugepages (int numa_node, |
Damjan Marion | 6f3f1cb | 2018-10-22 13:01:46 +0200 | [diff] [blame] | 30 | int log2_page_size, int *v); |
Damjan Marion | 01914ce | 2017-09-14 19:04:50 +0200 | [diff] [blame] | 31 | clib_error_t *clib_sysfs_get_free_hugepages (int numa_node, |
Damjan Marion | 6f3f1cb | 2018-10-22 13:01:46 +0200 | [diff] [blame] | 32 | int log2_page_size, int *v); |
Damjan Marion | 01914ce | 2017-09-14 19:04:50 +0200 | [diff] [blame] | 33 | clib_error_t *clib_sysfs_get_surplus_hugepages (int numa_node, |
Damjan Marion | 6f3f1cb | 2018-10-22 13:01:46 +0200 | [diff] [blame] | 34 | int log2_page_size, int *v); |
Damjan Marion | 01914ce | 2017-09-14 19:04:50 +0200 | [diff] [blame] | 35 | clib_error_t *clib_sysfs_prealloc_hugepages (int numa_node, |
Damjan Marion | 6f3f1cb | 2018-10-22 13:01:46 +0200 | [diff] [blame] | 36 | int log2_page_size, int nr); |
Damjan Marion | 3b64d63 | 2017-09-08 12:26:12 +0200 | [diff] [blame] | 37 | |
Damjan Marion | 6db633b | 2021-04-19 21:44:21 +0200 | [diff] [blame] | 38 | uword *clib_sysfs_list_to_bitmap (char *filename); |
| 39 | |
Damjan Marion | 3b64d63 | 2017-09-08 12:26:12 +0200 | [diff] [blame] | 40 | #endif /* included_linux_sysfs_h */ |
| 41 | |
| 42 | /* |
| 43 | * fd.io coding-style-patch-verification: ON |
| 44 | * |
| 45 | * Local Variables: |
| 46 | * eval: (c-set-style "gnu") |
| 47 | * End: |
| 48 | */ |