#include <linux/acpi.h>
#include <linux/miscdevice.h>
#include <linux/mman.h>
#include <linux/security.h>
#include <linux/suspend.h>
#include <asm/traps.h>
#include "driver.h"
#include "encl.h"
u64 sgx_attributes_reserved_mask;
u64 sgx_xfrm_reserved_mask = …;
u32 sgx_misc_reserved_mask;
static int sgx_open(struct inode *inode, struct file *file)
{ … }
static int sgx_release(struct inode *inode, struct file *file)
{ … }
static int sgx_mmap(struct file *file, struct vm_area_struct *vma)
{ … }
static unsigned long sgx_get_unmapped_area(struct file *file,
unsigned long addr,
unsigned long len,
unsigned long pgoff,
unsigned long flags)
{ … }
#ifdef CONFIG_COMPAT
static long sgx_compat_ioctl(struct file *filep, unsigned int cmd,
unsigned long arg)
{ … }
#endif
static const struct file_operations sgx_encl_fops = …;
static struct miscdevice sgx_dev_enclave = …;
int __init sgx_drv_init(void)
{ … }