forked from chipsec/chipsec
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Nathaniel Mitchell <[email protected]>
- Loading branch information
Showing
10 changed files
with
964 additions
and
627 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
# [email protected] | ||
|
||
import copy | ||
from chipsec.library.registertype.pci_register import PciRegister | ||
from chipsec.parsers import BaseConfigParser | ||
from chipsec.parsers import Stage | ||
from chipsec.parsers import info_data | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,6 @@ | |
# [email protected] | ||
# | ||
|
||
|
||
from chipsec.library.register import RegisterType | ||
from chipsec.logger import logger | ||
from typing import List, Optional, Tuple, Union | ||
from chipsec.exceptions import CSFirstNotFoundError, CSBusNotFoundError, DeviceNotFoundError | ||
|
@@ -30,17 +28,20 @@ | |
# | ||
################################################################################## | ||
|
||
|
||
class Device: | ||
def __init__(self, cs) -> None: | ||
self.cs = cs | ||
|
||
def get_first_bus(self, device:dict) -> int: | ||
@staticmethod | ||
def get_first_bus(device: dict) -> int: | ||
'''Retrieves first value in bus list for PCI device''' | ||
if 'bus' in device: | ||
return self.get_first(device['bus']) | ||
return Device.get_first(device['bus']) | ||
raise CSBusNotFoundError() | ||
|
||
def get_first(self, a_list:Union[list, int]) -> int: | ||
@staticmethod | ||
def get_first(a_list: Union[list, int]) -> int: | ||
'''Returns received integer or first item from recieved list''' | ||
if type(a_list) is int: | ||
return a_list | ||
|
Oops, something went wrong.