@@ -16,7 +16,7 @@ limitations under the License.
1616use std:: fmt:: Debug ;
1717use std:: mem:: { offset_of, size_of} ;
1818
19- use hyperlight_common:: mem:: { GuestStackData , HyperlightPEB , PAGE_SIZE_USIZE } ;
19+ use hyperlight_common:: mem:: { GuestStack , HyperlightPEB , PAGE_SIZE_USIZE } ;
2020use rand:: { rng, RngCore } ;
2121use tracing:: { instrument, Span } ;
2222
@@ -225,17 +225,17 @@ impl SandboxMemoryLayout {
225225 peb_offset + offset_of ! ( HyperlightPEB , security_cookie_seed) ;
226226 let peb_guest_dispatch_function_ptr_offset =
227227 peb_offset + offset_of ! ( HyperlightPEB , guest_function_dispatch_ptr) ;
228- let peb_code_pointer_offset = peb_offset + offset_of ! ( HyperlightPEB , pCode ) ;
229- let peb_input_data_offset = peb_offset + offset_of ! ( HyperlightPEB , inputdata ) ;
230- let peb_output_data_offset = peb_offset + offset_of ! ( HyperlightPEB , outputdata ) ;
231- let peb_heap_data_offset = peb_offset + offset_of ! ( HyperlightPEB , guestheapData ) ;
232- let peb_guest_stack_data_offset = peb_offset + offset_of ! ( HyperlightPEB , gueststackData ) ;
228+ let peb_code_pointer_offset = peb_offset + offset_of ! ( HyperlightPEB , code_ptr ) ;
229+ let peb_input_data_offset = peb_offset + offset_of ! ( HyperlightPEB , input_stack ) ;
230+ let peb_output_data_offset = peb_offset + offset_of ! ( HyperlightPEB , output_stack ) ;
231+ let peb_heap_data_offset = peb_offset + offset_of ! ( HyperlightPEB , guest_heap ) ;
232+ let peb_guest_stack_data_offset = peb_offset + offset_of ! ( HyperlightPEB , guest_stack ) ;
233233
234234 // The following offsets are the actual values that relate to memory layout,
235235 // which are written to PEB struct
236236 let peb_address = Self :: BASE_ADDRESS + peb_offset;
237237 let input_data_buffer_offset = round_up_to (
238- peb_guest_stack_data_offset + size_of :: < GuestStackData > ( ) ,
238+ peb_guest_stack_data_offset + size_of :: < GuestStack > ( ) ,
239239 PAGE_SIZE_USIZE ,
240240 ) ;
241241 let output_data_buffer_offset = round_up_to (
@@ -332,15 +332,15 @@ impl SandboxMemoryLayout {
332332 /// Get the offset in guest memory to the input data size.
333333 #[ instrument( skip_all, parent = Span :: current( ) , level= "Trace" ) ]
334334 pub ( super ) fn get_input_data_size_offset ( & self ) -> usize {
335- // The input data size is the first field in the `InputData ` struct
335+ // The input data size is the first field in the input stack's `GuestMemoryRegion ` struct
336336 self . peb_input_data_offset
337337 }
338338
339339 /// Get the offset in guest memory to the input data pointer.
340340 #[ instrument( skip_all, parent = Span :: current( ) , level= "Trace" ) ]
341341 fn get_input_data_pointer_offset ( & self ) -> usize {
342342 // The input data pointer is immediately after the input
343- // data size field in the `InputData ` struct which is a `u64`.
343+ // data size field in the input data `GuestMemoryRegion ` struct which is a `u64`.
344344 self . get_input_data_size_offset ( ) + size_of :: < u64 > ( )
345345 }
346346
@@ -375,7 +375,7 @@ impl SandboxMemoryLayout {
375375 #[ instrument( skip_all, parent = Span :: current( ) , level= "Trace" ) ]
376376 fn get_heap_pointer_offset ( & self ) -> usize {
377377 // The heap pointer is immediately after the
378- // heap size field in the `GuestHeap ` struct which is a `u64`.
378+ // heap size field in the guest heap's `GuestMemoryRegion ` struct which is a `u64`.
379379 self . get_heap_size_offset ( ) + size_of :: < u64 > ( )
380380 }
381381
0 commit comments