diff options
author | Miriam Zimmerman <mutexlox@google.com> | 2019-03-15 16:54:25 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-03-20 08:52:41 -0700 |
commit | 63e3a83a37fe62fd0189a08ac178b7c2b74b91cb (patch) | |
tree | 0cd9703f530dd2394ca3e5c4150f37940e9554bb /x86_64 | |
parent | 7e622edd00393dbd018f6d20039f8abfa945a287 (diff) | |
download | crosvm-63e3a83a37fe62fd0189a08ac178b7c2b74b91cb.tar crosvm-63e3a83a37fe62fd0189a08ac178b7c2b74b91cb.tar.gz crosvm-63e3a83a37fe62fd0189a08ac178b7c2b74b91cb.tar.bz2 crosvm-63e3a83a37fe62fd0189a08ac178b7c2b74b91cb.tar.lz crosvm-63e3a83a37fe62fd0189a08ac178b7c2b74b91cb.tar.xz crosvm-63e3a83a37fe62fd0189a08ac178b7c2b74b91cb.tar.zst crosvm-63e3a83a37fe62fd0189a08ac178b7c2b74b91cb.zip |
Move split_irqchip_common to devices/.
Previously, code in devices/ couldn't use split_irqchip_common, since x86_64/ already has a dependency on devices/. TEST=Built. BUG=chromium:908689 Change-Id: I481514ae6bbd68e47feecc6f364ca8f4fd798e67 Reviewed-on: https://chromium-review.googlesource.com/1526762 Commit-Ready: Miriam Zimmerman <mutexlox@chromium.org> Tested-by: Miriam Zimmerman <mutexlox@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: David Tolnay <dtolnay@chromium.org>
Diffstat (limited to 'x86_64')
-rw-r--r-- | x86_64/Cargo.toml | 1 | ||||
-rw-r--r-- | x86_64/src/lib.rs | 3 | ||||
-rw-r--r-- | x86_64/src/split_irqchip_common.rs | 76 |
3 files changed, 0 insertions, 80 deletions
diff --git a/x86_64/Cargo.toml b/x86_64/Cargo.toml index 47a281c..521573b 100644 --- a/x86_64/Cargo.toml +++ b/x86_64/Cargo.toml @@ -6,7 +6,6 @@ build = "build.rs" [dependencies] arch = { path = "../arch" } -bit_field = { path = "../bit_field" } data_model = { path = "../data_model" } devices = { path = "../devices" } io_jail = { path = "../io_jail" } diff --git a/x86_64/src/lib.rs b/x86_64/src/lib.rs index 0f3c757..4ca7c2e 100644 --- a/x86_64/src/lib.rs +++ b/x86_64/src/lib.rs @@ -3,7 +3,6 @@ // found in the LICENSE file. extern crate arch; -extern crate bit_field; extern crate byteorder; extern crate data_model; extern crate devices; @@ -66,9 +65,7 @@ mod gdt; mod interrupts; mod mptable; mod regs; -mod split_irqchip_common; -pub use self::split_irqchip_common::*; use std::error::Error as StdError; use std::ffi::{CStr, CString}; use std::fmt::{self, Display}; diff --git a/x86_64/src/split_irqchip_common.rs b/x86_64/src/split_irqchip_common.rs deleted file mode 100644 index 6a722e2..0000000 --- a/x86_64/src/split_irqchip_common.rs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2019 The Chromium OS Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Common constants and types used for Split IRQ chip devices (e.g. PIC, PIT, IOAPIC). - -use bit_field::*; - -#[bitfield] -#[derive(Clone, Copy, Debug, PartialEq)] -pub enum DestinationMode { - Physical = 0, - Logical = 1, -} - -#[bitfield] -#[derive(Clone, Copy, Debug, PartialEq)] -pub enum TriggerMode { - Edge = 0, - Level = 1, -} - -#[derive(Clone, Copy, PartialEq)] -pub enum DeliveryMode { - DeliveryModeFixed = 0b000, - DeliveryModeLowest = 0b001, - DeliveryModeSMI = 0b010, // System management interrupt - DeliveryModeRemoteRead = 0b011, // This is no longer supported by intel. - DeliveryModeNMI = 0b100, // Non maskable interrupt - DeliveryModeInit = 0b101, - DeliveryModeStartup = 0b110, - DeliveryModeExternal = 0b111, -} - -#[bitfield] -#[derive(Clone, Copy, PartialEq)] -pub struct MsiAddressMessageNonRemappable { - reserved: BitField2, - #[bits = 1] - destination_mode: DestinationMode, - redirection_hint: BitField1, - reserved_2: BitField8, - destination_id: BitField8, - // According to Intel's implementation of MSI, these bits must always be 0xfee. - always_0xfee: BitField12, -} - -#[bitfield] -#[derive(Clone, Copy, PartialEq)] -pub struct MsiAddressMessageRemappable { - reserved: BitField2, - handle_hi: BitField1, // Bit 15 of handle - shv: BitField1, - interrupt_format: BitField1, - handle_low: BitField15, // Bits 0-14 of handle. - // According to Intel's implementation of MSI, these bits must always be 0xfee. - always_0xfee: BitField12, -} - -#[derive(Clone, Copy, PartialEq)] -pub enum MsiAddressMessage { - NonRemappable(MsiAddressMessageNonRemappable), - Remappable(MsiAddressMessageRemappable), -} - -#[bitfield] -#[derive(Clone, Copy, PartialEq)] -struct MsiDataMessage { - vector: BitField8, - delivery_mode: BitField3, - reserved: BitField3, - level: BitField1, - #[bits = 1] - trigger: TriggerMode, - reserved2: BitField16, -} |