Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
[Pal/Linux-SGX] Remove #undef __USE_POSIX199309 from linux_types.h
Browse files Browse the repository at this point in the history
And the rest cascaded.

Signed-off-by: Wojtek Porczyk <[email protected]>
  • Loading branch information
woju committed Aug 23, 2021
1 parent e0c2577 commit 807a4f1
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 13 deletions.
4 changes: 1 addition & 3 deletions Pal/src/host/Linux-SGX/generated-offsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 3,14 @@

#include "ecall_types.h"
#include "generated-offsets-build.h"
#include "gsgx.h"
#include "ocall_types.h"
#include "pal.h"
#include "pal_linux.h"
#include "pal_linux_defs.h"
#include "pal_security.h"
#include "sgx_arch.h"
#include "sgx_tls.h"

#include "gsgx.h"

__attribute__((__used__)) static void dummy(void) {
/* defines in sgx_arch.h */
DEFINE(SGX_FLAGS_DEBUG, SGX_FLAGS_DEBUG);
Expand Down
8 changes: 3 additions & 5 deletions Pal/src/host/Linux-SGX/linux_types.h
Original file line number Diff line number Diff line change
@@ -1,22 1,20 @@
#ifndef LINUX_TYPES_H
#define LINUX_TYPES_H

#include <linux/posix_types.h> /* needed for __kernel_off_t */
#include <linux/socket.h>
#include <linux/time.h>
#define __timespec_defined
#undef __USE_POSIX199309
#include <asm/fcntl.h>
#include <asm/posix_types.h>
#include <asm/stat.h>
#include <linux/poll.h>
#include <linux/sched.h>
#include <linux/socket.h>
#include <linux/time.h>
#include <linux/uio.h>
#include <stdint.h>

#include "sigset.h"

typedef __kernel_off_t off_t;
typedef __kernel_pid_t pid_t;

#ifndef size_t
typedef __kernel_size_t size_t;
Expand Down
11 changes: 9 additions & 2 deletions Pal/src/host/Linux-SGX/pal_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 9,16 @@

#include "api.h"
#include "assert.h"

/*
* XXX this ifdef is because there is no mbedtls linked in untrusted PAL; this should be fixed by
* cleaning up this header which has become a rubbish bin for everything that didn't have a better
* place
*/
#ifdef IN_ENCLAVE
#include "crypto.h"
#endif /* IN_ENCLAVE */

#include "enclave_ocalls.h"
#include "linux_types.h"
#include "log.h"
Expand Down Expand Up @@ -37,8 46,6 @@ extern struct pal_linux_state {
const char* runtime_dir;
} g_linux_state;

#define DEFAULT_BACKLOG 2048

#define ACCESS_R 4
#define ACCESS_W 2
#define ACCESS_X 1
Expand Down
3 changes: 3 additions & 0 deletions Pal/src/host/Linux-SGX/sgx_enclave.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 7,7 @@
#include <asm/ioctls.h>
#include <asm/mman.h>
#include <asm/socket.h>
#include <limits.h>
#include <linux/fs.h>
#include <linux/futex.h>
#include <linux/in.h>
Expand All @@ -29,6 30,8 @@
#include "sgx_tls.h"
#include "sigset.h"

#define DEFAULT_BACKLOG 2048

#define ODEBUG(code, ms) \
do { \
} while (0)
Expand Down
3 changes: 1 addition & 2 deletions Pal/src/host/Linux-SGX/sgx_enclave.h
Original file line number Diff line number Diff line change
@@ -1,5 1,4 @@
#include "pal_linux.h"
#include "pal_security.h"
#include <stddef.h>

int ecall_enclave_start(char* libpal_uri, char* args, size_t args_size, char* env, size_t env_size);

Expand Down
2 changes: 1 addition & 1 deletion Pal/src/host/Linux-SGX/sgx_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 12,7 @@
* errors.
*/
#include "pal_internal-arch.h"
#include "pal_linux.h"
#include "pal_linux_defs.h"
#include "pal_linux_error.h"
#include "pal_rtld.h"
#include "hex.h"
Expand Down
1 change: 1 addition & 0 deletions Pal/src/host/Linux-SGX/sgx_perf_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 31,7 @@
#include <asm/perf_regs.h>
#include <assert.h>
#include <linux/perf_event.h>
#include <linux/fs.h>

#include "perm.h"
#include "sgx_internal.h"
Expand Down
1 change: 1 addition & 0 deletions Pal/src/host/Linux-SGX/sgx_profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 14,7 @@

#include <assert.h>
#include <errno.h>
#include <linux/fs.h>
#include <linux/limits.h>
#include <stddef.h>

Expand Down

0 comments on commit 807a4f1

Please sign in to comment.