Skip to content

Commit e3fb902

Browse files
committed
fixup! Tsc: Decouple creation from finding host clock rate
1 parent 73b022e commit e3fb902

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

src/main/bindings/rust/wrapper.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,35 @@ extern "C" {
139139
pub type SysCallHandler = _SysCallHandler;
140140
#[repr(C)]
141141
#[derive(Debug, Copy, Clone)]
142+
pub struct _Tsc {
143+
pub cyclesPerSecond: u64,
144+
}
145+
#[test]
146+
fn bindgen_test_layout__Tsc() {
147+
assert_eq!(
148+
::std::mem::size_of::<_Tsc>(),
149+
8usize,
150+
concat!("Size of: ", stringify!(_Tsc))
151+
);
152+
assert_eq!(
153+
::std::mem::align_of::<_Tsc>(),
154+
8usize,
155+
concat!("Alignment of ", stringify!(_Tsc))
156+
);
157+
assert_eq!(
158+
unsafe { &(*(::std::ptr::null::<_Tsc>())).cyclesPerSecond as *const _ as usize },
159+
0usize,
160+
concat!(
161+
"Offset of field: ",
162+
stringify!(_Tsc),
163+
"::",
164+
stringify!(cyclesPerSecond)
165+
)
166+
);
167+
}
168+
pub type Tsc = _Tsc;
169+
#[repr(C)]
170+
#[derive(Debug, Copy, Clone)]
142171
pub struct _CPU {
143172
_unused: [u8; 0],
144173
}
@@ -1249,6 +1278,9 @@ extern "C" {
12491278
extern "C" {
12501279
pub fn host_getCPU(host: *mut Host) -> *mut CPU;
12511280
}
1281+
extern "C" {
1282+
pub fn host_getTsc(host: *mut Host) -> *mut Tsc;
1283+
}
12521284
extern "C" {
12531285
pub fn host_getName(host: *mut Host) -> *mut gchar;
12541286
}

0 commit comments

Comments
 (0)