diff options
author | Orlando Arbildo <oarbildo@google.com> | 2023-11-16 22:13:56 +0000 |
---|---|---|
committer | Orlando Arbildo <oarbildo@google.com> | 2023-11-30 21:57:25 +0000 |
commit | dab474b279d38c95d64c85d25b768ae209d8e803 (patch) | |
tree | 4d7b3fdc283fe585beccad4b1f238d8747d1e05d | |
parent | 331cb5cb594d11526aca8e812df1364691afdd85 (diff) | |
download | libc-dab474b279d38c95d64c85d25b768ae209d8e803.tar.gz |
Add PROT_READ and PROT_WRITE constants to trustytrusty-main
Adding PROT_READ and PROT_WRITE libc constants to
trusty.
Bug: 284156656
Test: build.py
Change-Id: I80c7d411520a429d6ec35685ff80f1862ccde814
-rw-r--r-- | patches/rules.mk.diff | 3 | ||||
-rw-r--r-- | patches/trusty-004.patch | 32 | ||||
-rw-r--r-- | rules.mk | 1 | ||||
-rw-r--r-- | src/trusty.rs | 5 |
4 files changed, 40 insertions, 1 deletions
diff --git a/patches/rules.mk.diff b/patches/rules.mk.diff index 75e796b1..860909c8 100644 --- a/patches/rules.mk.diff +++ b/patches/rules.mk.diff @@ -2,7 +2,7 @@ diff --git a/rules.mk b/rules.mk index 92f34db68..08cf2d6c3 100644 --- a/rules.mk +++ b/rules.mk -@@ -27,8 +27,11 @@ +@@ -27,8 +27,12 @@ --cfg 'libc_ptr_addr_of' \ --cfg 'libc_underscore_const_names' \ --cfg 'libc_union' \ @@ -13,4 +13,5 @@ index 92f34db68..08cf2d6c3 100644 + trusty/user/base/lib/libcompiler_builtins-rust \ + trusty/user/base/lib/libcore-rust \ + trusty/user/base/lib/libc-trusty \ ++ trusty/user/base/lib/trusty-sys \ diff --git a/patches/trusty-004.patch b/patches/trusty-004.patch new file mode 100644 index 00000000..33951e26 --- /dev/null +++ b/patches/trusty-004.patch @@ -0,0 +1,32 @@ +From ec3dab63a07ca05b93ecb68686bf1f0699d172eb Mon Sep 17 00:00:00 2001 +From: Orlando Arbildo <oarbildo@google.com> +Date: Thu, 30 Nov 2023 19:19:19 +0000 +Subject: [PATCH] Add PROT_READ and PROT_WRITE constants to trusty + +Adding PROT_READ and PROT_WRITE libc constants to +trusty. + +Bug: 284156656 +Change-Id: I62797b2eb26775fd4ef161c9f59641aab8a066aa +--- + src/trusty.rs | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/trusty.rs b/src/trusty.rs +index 140fa6df..eca27bf7 100644 +--- a/src/trusty.rs ++++ b/src/trusty.rs +@@ -1,5 +1,10 @@ ++extern crate trusty_sys; ++ + pub use core::ffi::c_void; + ++pub const PROT_READ: i32 = self::trusty_sys::MMAP_FLAG_PROT_READ as i32; ++pub const PROT_WRITE: i32 = self::trusty_sys::MMAP_FLAG_PROT_WRITE as i32; ++ + pub type size_t = usize; + pub type ssize_t = isize; + +-- +2.43.0.rc2.451.g8631bc7472-goog + @@ -33,5 +33,6 @@ MODULE_LIBRARY_DEPS := \ trusty/user/base/lib/libcompiler_builtins-rust \ trusty/user/base/lib/libcore-rust \ trusty/user/base/lib/libc-trusty \ + trusty/user/base/lib/trusty-sys \ include make/library.mk diff --git a/src/trusty.rs b/src/trusty.rs index 140fa6df..eca27bf7 100644 --- a/src/trusty.rs +++ b/src/trusty.rs @@ -1,5 +1,10 @@ +extern crate trusty_sys; + pub use core::ffi::c_void; +pub const PROT_READ: i32 = self::trusty_sys::MMAP_FLAG_PROT_READ as i32; +pub const PROT_WRITE: i32 = self::trusty_sys::MMAP_FLAG_PROT_WRITE as i32; + pub type size_t = usize; pub type ssize_t = isize; |