New upstream version 18.02
[deb_dpdk.git] / lib / librte_eal / common / eal_hugepages.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2014 Intel Corporation
3  */
4
5 #ifndef EAL_HUGEPAGES_H
6 #define EAL_HUGEPAGES_H
7
8 #include <stddef.h>
9 #include <stdint.h>
10 #include <limits.h>
11
12 #define MAX_HUGEPAGE_PATH PATH_MAX
13
14 /**
15  * Structure used to store informations about hugepages that we mapped
16  * through the files in hugetlbfs.
17  */
18 struct hugepage_file {
19         void *orig_va;      /**< virtual addr of first mmap() */
20         void *final_va;     /**< virtual addr of 2nd mmap() */
21         uint64_t physaddr;  /**< physical addr */
22         size_t size;        /**< the page size */
23         int socket_id;      /**< NUMA socket ID */
24         int file_id;        /**< the '%d' in HUGEFILE_FMT */
25         int memseg_id;      /**< the memory segment to which page belongs */
26         char filepath[MAX_HUGEPAGE_PATH]; /**< path to backing file on filesystem */
27 };
28
29 /**
30  * Read the information from linux on what hugepages are available
31  * for the EAL to use
32  */
33 int eal_hugepage_info_init(void);
34
35 #endif /* EAL_HUGEPAGES_H */