diff options
author | Dylan Reid <dgreid@chromium.org> | 2018-05-24 19:19:22 +0000 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-07-11 12:12:54 -0700 |
commit | 9b871c2db3feaee1c311ba0c49aaf50637994f71 (patch) | |
tree | c74ba3cafc049c649ee4c03ec109601ec9a9f7ab /devices/src/pci/mod.rs | |
parent | 228e4a6a91ea2972b2443d3959c14d862a23c358 (diff) | |
download | crosvm-9b871c2db3feaee1c311ba0c49aaf50637994f71.tar crosvm-9b871c2db3feaee1c311ba0c49aaf50637994f71.tar.gz crosvm-9b871c2db3feaee1c311ba0c49aaf50637994f71.tar.bz2 crosvm-9b871c2db3feaee1c311ba0c49aaf50637994f71.tar.lz crosvm-9b871c2db3feaee1c311ba0c49aaf50637994f71.tar.xz crosvm-9b871c2db3feaee1c311ba0c49aaf50637994f71.tar.zst crosvm-9b871c2db3feaee1c311ba0c49aaf50637994f71.zip |
devices: Add pci_types
Start PCI work by defining an enum to represent the four PCI interrupt lines. Change-Id: Ib95a4e4a03f0d6917ed2bed4b1afb97d18ff4f9e Signed-off-by: Dylan Reid <dgreid@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1072573 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Diffstat (limited to 'devices/src/pci/mod.rs')
-rw-r--r-- | devices/src/pci/mod.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/devices/src/pci/mod.rs b/devices/src/pci/mod.rs new file mode 100644 index 0000000..071930d --- /dev/null +++ b/devices/src/pci/mod.rs @@ -0,0 +1,20 @@ +// Copyright 2018 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. + +//! Implements pci devices and busses. + +/// PCI has four interrupt pins A->D. +#[derive(Copy, Clone)] +pub enum PciInterruptPin { + IntA, + IntB, + IntC, + IntD, +} + +impl PciInterruptPin { + pub fn to_mask(self) -> u32 { + self as u32 + } +} |