diff options
Diffstat (limited to 'patches')
-rw-r--r-- | patches/rules.mk.diff | 16 | ||||
-rw-r--r-- | patches/trusty.patch | 6 |
2 files changed, 18 insertions, 4 deletions
diff --git a/patches/rules.mk.diff b/patches/rules.mk.diff index d44c11fe..e9ebe30d 100644 --- a/patches/rules.mk.diff +++ b/patches/rules.mk.diff @@ -1,8 +1,8 @@ diff --git a/rules.mk b/rules.mk -index 92f34db68..08cf2d6c3 100644 +index b2ae04d7..0cd09394 100644 --- a/rules.mk +++ b/rules.mk -@@ -24,5 +24,12 @@ +@@ -24,5 +24,21 @@ MODULE_RUSTFLAGS += \ --cfg 'libc_ptr_addr_of' \ --cfg 'libc_underscore_const_names' \ --cfg 'libc_union' \ @@ -11,6 +11,16 @@ index 92f34db68..08cf2d6c3 100644 +MODULE_LIBRARY_DEPS := \ + trusty/user/base/lib/libcompiler_builtins-rust \ + trusty/user/base/lib/libcore-rust \ ++ ++ifeq ($(call TOBOOL,$(TRUSTY_USERSPACE)),true) ++ ++MODULE_RUSTFLAGS += \ ++ --cfg 'feature="trusty_sys"' \ ++ ++MODULE_LIBRARY_DEPS += \ + trusty/user/base/lib/libc-trusty \ + trusty/user/base/lib/trusty-sys \ - ++ ++endif + + include make/library.mk diff --git a/patches/trusty.patch b/patches/trusty.patch index 77de58ca..1599f06e 100644 --- a/patches/trusty.patch +++ b/patches/trusty.patch @@ -20,12 +20,16 @@ new file mode 100644 index 000000000..140fa6dfe --- /dev/null +++ a/src/trusty.rs -@@ -0,0 +1,85 @@ +@@ -0,0 +1,89 @@ ++#[cfg(feature = "trusty_sys")] +extern crate trusty_sys; + +pub use core::ffi::c_void; + ++#[cfg(feature = "trusty_sys")] +pub const PROT_READ: i32 = self::trusty_sys::MMAP_FLAG_PROT_READ as i32; ++ ++#[cfg(feature = "trusty_sys")] +pub const PROT_WRITE: i32 = self::trusty_sys::MMAP_FLAG_PROT_WRITE as i32; + +pub type size_t = usize; |