Skip to content

Commit 0a3a6ac

Browse files
committed
[common/mem] use u64s for PEB pointers
If the guest and host are compiled for different architectures, there will be a mismatch in usage of the PEB. Using u64s, just like we do for pCode, makes our PEB portable. Signed-off-by: danbugs <[email protected]>
1 parent 63667c0 commit 0a3a6ac

File tree

1 file changed

+4
-6
lines changed
  • src/hyperlight_common/src

1 file changed

+4
-6
lines changed

src/hyperlight_common/src/mem.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,22 @@ pub const PAGE_SHIFT: u64 = 12;
2020
pub const PAGE_SIZE: u64 = 1 << 12;
2121
pub const PAGE_SIZE_USIZE: usize = 1 << 12;
2222

23-
use core::ffi::{c_char, c_void};
24-
2523
#[repr(C)]
2624
pub struct InputData {
2725
pub inputDataSize: u64,
28-
pub inputDataBuffer: *mut c_void,
26+
pub inputDataBuffer: u64,
2927
}
3028

3129
#[repr(C)]
3230
pub struct OutputData {
3331
pub outputDataSize: u64,
34-
pub outputDataBuffer: *mut c_void,
32+
pub outputDataBuffer: u64,
3533
}
3634

3735
#[repr(C)]
3836
pub struct GuestHeapData {
3937
pub guestHeapSize: u64,
40-
pub guestHeapBuffer: *mut c_void,
38+
pub guestHeapBuffer: u64,
4139
}
4240

4341
#[repr(C)]
@@ -52,7 +50,7 @@ pub struct GuestStackData {
5250
pub struct HyperlightPEB {
5351
pub security_cookie_seed: u64,
5452
pub guest_function_dispatch_ptr: u64,
55-
pub pCode: *mut c_char,
53+
pub pCode: u64,
5654
pub inputdata: InputData,
5755
pub outputdata: OutputData,
5856
pub guestheapData: GuestHeapData,

0 commit comments

Comments
 (0)