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

Update RWLOCK_INIT with new parking_lot based value #6

Merged
merged 2 commits into from
Apr 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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