Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.

Commit 69f29f5

Browse files
committed
Update x86_64 functionality for pub use
Exported module and data types as public.
1 parent 6a082af commit 69f29f5

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extern crate kvm_bindings;
1818
pub mod vcpu;
1919

2020
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
21-
mod x86_64;
21+
pub mod x86_64;
2222

2323
#[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
2424
mod arm;

src/x86_64.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ fn vcpu_test_layout_lapic_state() {
259259
pub use kvm_bindings::kvm_lapic_state as LapicState;
260260

261261
// Returns a `Vec<T>` with a size in bytes at least as large as `size_in_bytes`.
262-
fn vec_with_size_in_bytes<T: Default>(size_in_bytes: usize) -> Vec<T> {
262+
pub fn vec_with_size_in_bytes<T: Default>(size_in_bytes: usize) -> Vec<T> {
263263
let rounded_size = (size_in_bytes + size_of::<T>() - 1) / size_of::<T>();
264264
let mut v = Vec::with_capacity(rounded_size);
265265
for _ in 0..rounded_size {
@@ -283,7 +283,7 @@ fn vec_with_size_in_bytes<T: Default>(size_in_bytes: usize) -> Vec<T> {
283283
// for `Foo`, a `Vec<Foo>` is created. Only the first element of `Vec<Foo>` would actually be used
284284
// as a `Foo`. The remaining memory in the `Vec<Foo>` is for `entries`, which must be contiguous
285285
// with `Foo`. This function is used to make the `Vec<Foo>` with enough space for `count` entries.
286-
fn vec_with_array_field<T: Default, F>(count: usize) -> Vec<T> {
286+
pub fn vec_with_array_field<T: Default, F>(count: usize) -> Vec<T> {
287287
let element_space = count * size_of::<F>();
288288
let vec_size_bytes = size_of::<T>() + element_space;
289289
vec_with_size_in_bytes(vec_size_bytes)
@@ -322,7 +322,6 @@ impl Clone for CpuId {
322322
}
323323
}
324324

325-
#[cfg(test)]
326325
impl PartialEq for CpuId {
327326
fn eq(&self, other: &CpuId) -> bool {
328327
let entries: &[CpuIdEntry2] =

0 commit comments

Comments
 (0)