|
21 | 21 | #include <stdint.h>
|
22 | 22 |
|
23 | 23 | // We have to use RWLock from rust repo, it is defined in:
|
24 |
| -// src/libstd/sys/sgx/rwlock.rs. |
25 |
| -// rwlock.rs has compile time check to ensure sizeof(RWLock) = 128. |
| 24 | +// src/libstd/sys/sgx/unwind.rs. |
| 25 | +// unwind.rs has compile time check to ensure sizeof(RWLock) = 16. |
26 | 26 | typedef struct {
|
27 |
| - unsigned char opaque[128]; |
28 |
| -} RWLock; |
| 27 | + unsigned char opaque[16]; |
| 28 | +} __attribute__ ((aligned (8))) RWLock; |
29 | 29 |
|
30 | 30 | // The below is obtained by printing initialized bytes
|
31 |
| -// for RWLock in rust repo: src/libstd/sys/sgx/rwlock.rs. |
| 31 | +// for RWLock in rust repo: src/libstd/sys/sgx/unwind.rs. |
32 | 32 | #define RWLOCK_INIT { \
|
33 |
| - 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ |
34 |
| - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ |
35 |
| - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ |
36 |
| - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ |
37 |
| - 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ |
38 |
| - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ |
39 |
| - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ |
40 |
| - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ |
41 |
| - 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ |
42 |
| - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ |
43 |
| - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ |
44 |
| - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ |
45 |
| - 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ |
46 |
| - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ |
47 | 33 | 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
|
48 | 34 | 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
|
49 | 35 | }
|
|
0 commit comments