Skip to content

Commit

Permalink
Trim oe_ecompat.h
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph M. Wintersteiger <[email protected]>
  • Loading branch information
Christoph M. Wintersteiger committed Sep 15, 2020
1 parent 4dbd395 commit 3140f65
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/include/host/env.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef _ENV_H
#define _ENV_H

#include "shared/oe_compat.h"
#include <inttypes.h>

uint64_t size_str_to_uint64(const char* str, uint64_t def, uint64_t max);

Expand Down
1 change: 0 additions & 1 deletion src/include/shared/oe_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

#include <assert.h>
#include <inttypes.h>
#include <malloc.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
Expand Down
2 changes: 0 additions & 2 deletions src/include/shared/shared_memory.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef SGXLKL_SHARED_MEMORY_H
#define SGXLKL_SHARED_MEMORY_H

#include "shared/oe_compat.h"

#include <shared/vio_event_channel.h>

typedef struct sgxlkl_shared_memory
Expand Down
10 changes: 10 additions & 0 deletions src/shared/sgxlkl_enclave_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,18 @@ const sgxlkl_enclave_config_page_t* sgxlkl_read_enclave_config(

size_t num_pages = (strlen(from) / OE_PAGE_SIZE) + 1;
sgxlkl_enclave_config_page_t* config_page =
#ifdef SGXLKL_ENCLAVE
memalign(OE_PAGE_SIZE, num_pages * OE_PAGE_SIZE);
#else
malloc(num_pages * OE_PAGE_SIZE);
#endif

#ifdef SGXLKL_ENCLAVE
oe_memset_s(config_page, OE_PAGE_SIZE, 0, OE_PAGE_SIZE);
#else
memset(config_page, 0, OE_PAGE_SIZE);
#endif

if (!config_page)
FAIL("out of memory\n");
config_page->config = sgxlkl_enclave_config_default;
Expand Down

0 comments on commit 3140f65

Please sign in to comment.