ClawSeven commented on code in PR #436:
URL: 
https://github.com/apache/incubator-teaclave-sgx-sdk/pull/436#discussion_r1410379548


##########
sgx_trts/src/emm/ema.rs:
##########
@@ -0,0 +1,719 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License..
+
+use crate::arch::{SE_PAGE_SHIFT, SE_PAGE_SIZE};
+use crate::emm::{PageInfo, PageRange, PageType, ProtFlags};
+use crate::enclave::is_within_enclave;
+use alloc::boxed::Box;
+use intrusive_collections::{intrusive_adapter, LinkedListLink, UnsafeRef};
+use sgx_tlibc_sys::{c_void, EACCES, EFAULT, EINVAL};
+use sgx_types::error::OsResult;
+
+use super::alloc::AllocType;
+use super::alloc::{RsrvAlloc, StaticAlloc};
+use super::bitmap::BitArray;
+use super::ocall;
+use super::page::AllocFlags;
+use super::pfhandler::PfHandler;
+
+/// Enclave Management Area
+///
+/// Question: should we replace BitArray with pointer
+/// to split struct into two pieces of 80 bytes and 32 bytes or an entity of 
104 bytes?
+#[repr(C)]

Review Comment:
   Done



##########
sgx_trts/src/emm/bitmap.rs:
##########
@@ -0,0 +1,182 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License..
+
+use alloc::boxed::Box;
+use alloc::vec;
+use core::alloc::Allocator;
+use core::alloc::Layout;
+use core::ptr::NonNull;
+use sgx_tlibc_sys::EACCES;
+use sgx_types::error::OsResult;
+
+use super::alloc::AllocType;
+
+const BYTE_SIZE: usize = 8;
+macro_rules! bytes_num {
+    ($num:expr) => {
+        ($num + BYTE_SIZE - 1) / BYTE_SIZE
+    };
+}
+
+#[repr(C)]

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@teaclave.apache.org
For additional commands, e-mail: notifications-h...@teaclave.apache.org

Reply via email to