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

Commit

Permalink
Update x86_64 functionality for pub use
Browse files Browse the repository at this point in the history
Exported module and data types as public.
  • Loading branch information
jennymankin committed Apr 20, 2019
1 parent 6a082af commit 69f29f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extern crate kvm_bindings;
pub mod vcpu;

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
mod x86_64;
pub mod x86_64;

#[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
mod arm;
5 changes: 2 additions & 3 deletions src/x86_64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ fn vcpu_test_layout_lapic_state() {
pub use kvm_bindings::kvm_lapic_state as LapicState;

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

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

0 comments on commit 69f29f5

Please sign in to comment.