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

Commit

Permalink
Merge pull request #6 from fortanix/update-rwlock-init
Browse files Browse the repository at this point in the history
Update RWLOCK_INIT with new parking_lot based value
  • Loading branch information
jethrogb authored Apr 4, 2019
2 parents 53b5863 + 6e0a83a commit a50a70f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
24 changes: 5 additions & 19 deletions libunwind/src/UnwindRustSgx.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,15 @@
#include <stdint.h>

// We have to use RWLock from rust repo, it is defined in:
// src/libstd/sys/sgx/rwlock.rs.
// rwlock.rs has compile time check to ensure sizeof(RWLock) = 128.
// src/libstd/sys/sgx/unwind.rs.
// unwind.rs has compile time check to ensure sizeof(RWLock) = 16.
typedef struct {
unsigned char opaque[128];
} RWLock;
unsigned char opaque[16];
} __attribute__ ((aligned (8))) RWLock;

// The below is obtained by printing initialized bytes
// for RWLock in rust repo: src/libstd/sys/sgx/rwlock.rs.
// for RWLock in rust repo: src/libstd/sys/sgx/unwind.rs.
#define RWLOCK_INIT { \
0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
}
Expand Down
2 changes: 2 additions & 0 deletions libunwind/src/UnwindRustSgxSnprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#pragma GCC diagnostic ignored "-Wfloat-conversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wstrict-overflow"
#if __GNUC__ >= 7
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
#endif

/**************************************************************
* Original:
Expand Down

0 comments on commit a50a70f

Please sign in to comment.