#ifndef _X86_SGX_H
#define _X86_SGX_H
#include <linux/bitops.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/rwsem.h>
#include <linux/types.h>
#include <asm/asm.h>
#include <asm/sgx.h>
#undef pr_fmt
#define pr_fmt(fmt) …
#define EREMOVE_ERROR_MESSAGE …
#define SGX_MAX_EPC_SECTIONS …
#define SGX_EEXTEND_BLOCK_SIZE …
#define SGX_NR_TO_SCAN …
#define SGX_NR_LOW_PAGES …
#define SGX_NR_HIGH_PAGES …
#define SGX_EPC_PAGE_RECLAIMER_TRACKED …
#define SGX_EPC_PAGE_IS_FREE …
struct sgx_epc_page { … };
struct sgx_numa_node { … };
struct sgx_epc_section { … };
extern struct sgx_epc_section sgx_epc_sections[SGX_MAX_EPC_SECTIONS];
static inline unsigned long sgx_get_epc_phys_addr(struct sgx_epc_page *page)
{ … }
static inline void *sgx_get_epc_virt_addr(struct sgx_epc_page *page)
{ … }
struct sgx_epc_page *__sgx_alloc_epc_page(void);
void sgx_free_epc_page(struct sgx_epc_page *page);
void sgx_reclaim_direct(void);
void sgx_mark_page_reclaimable(struct sgx_epc_page *page);
int sgx_unmark_page_reclaimable(struct sgx_epc_page *page);
struct sgx_epc_page *sgx_alloc_epc_page(void *owner, bool reclaim);
void sgx_ipi_cb(void *info);
#ifdef CONFIG_X86_SGX_KVM
int __init sgx_vepc_init(void);
#else
static inline int __init sgx_vepc_init(void)
{
return -ENODEV;
}
#endif
void sgx_update_lepubkeyhash(u64 *lepubkeyhash);
#endif