#include <linux/miscdevice.h>
#include <linux/mm.h>
#include <linux/mman.h>
#include <linux/sched/mm.h>
#include <linux/sched/signal.h>
#include <linux/slab.h>
#include <linux/xarray.h>
#include <asm/sgx.h>
#include <uapi/asm/sgx.h>
#include "encls.h"
#include "sgx.h"
struct sgx_vepc { … };
static struct mutex zombie_secs_pages_lock;
static struct list_head zombie_secs_pages;
static int __sgx_vepc_fault(struct sgx_vepc *vepc,
struct vm_area_struct *vma, unsigned long addr)
{ … }
static vm_fault_t sgx_vepc_fault(struct vm_fault *vmf)
{ … }
static const struct vm_operations_struct sgx_vepc_vm_ops = …;
static int sgx_vepc_mmap(struct file *file, struct vm_area_struct *vma)
{ … }
static int sgx_vepc_remove_page(struct sgx_epc_page *epc_page)
{ … }
static int sgx_vepc_free_page(struct sgx_epc_page *epc_page)
{ … }
static long sgx_vepc_remove_all(struct sgx_vepc *vepc)
{ … }
static int sgx_vepc_release(struct inode *inode, struct file *file)
{ … }
static int sgx_vepc_open(struct inode *inode, struct file *file)
{ … }
static long sgx_vepc_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{ … }
static const struct file_operations sgx_vepc_fops = …;
static struct miscdevice sgx_vepc_dev = …;
int __init sgx_vepc_init(void)
{ … }
int sgx_virt_ecreate(struct sgx_pageinfo *pageinfo, void __user *secs,
int *trapnr)
{ … }
EXPORT_SYMBOL_GPL(…);
static int __sgx_virt_einit(void __user *sigstruct, void __user *token,
void __user *secs)
{ … }
int sgx_virt_einit(void __user *sigstruct, void __user *token,
void __user *secs, u64 *lepubkeyhash, int *trapnr)
{ … }
EXPORT_SYMBOL_GPL(…);