depthcharge.register¶
The depthcharge.register subpackage provides register access functionality.
Bear in mind that not all registers will be accessible, given that some subset will be tainted by virtue of executing code in an attempt to read them. This is intended only for retrieving special register values, such as that reserved for U-Boot’s global data structure pointer.
Base Classes¶
-
class
depthcharge.register.
RegisterReader
(ctx, **_kwargs)¶ Base class for
Operation
implementations used to read device registers.-
read
(register: str) → int¶ Read a value from the target device register, specified by name. Note that registers can be obtained using
depthcharge.Architecture
.
-
_setup
()¶ RegisterReader
subclasses shall override this method to perform any necessary setup or preparation.
-
_teardown
()¶ RegisterReader
subclasses shall override this method to perform any necessary deinitialization actions.
-
_read
(register: str, info) → int¶ Subclasses of RegisterReader are required to implement the _read() method, which performs the specific operation.
The subclass receives both the validated register name.
-
-
class
depthcharge.register.
DataAbortRegisterReader
(ctx, **kwargs)¶ This is a type of
RegisterReader
that triggers a Data Abort on ARM targets and parses the crash output to retrieve a register value.For these to work, the system must automatically reset upon crash, and allow re-entry into the console. Subclasses must set the
crash_or_reboot=True
property in their private_required
dictionary in order to exclude the operation when a user has indicated that this should not be permitted.-
_trigger_data_abort
() → str¶ Subclasses must implement this method.
It should trigger a data abort and return the crash dump text printed to the terminal. This class will take care of parsing it accordingly.
-
Implementations¶
RegisterReader
DataAbortRegisterReader
-
class
depthcharge.register.
GoRegisterReader
(ctx, **_kwargs)¶ Uses the “go” console command to execute a register read payload.
Note that some regsiters are inherently tainted using this approach; it is not neccessarily possible to read every register.
-
class
depthcharge.register.
CRC32CrashRegisterReader
(ctx, **kwargs)¶ This is a
DataAbortRegisterReader
that uses thecrc32
console command to trigger the Data Abort used to read registers.
-
class
depthcharge.register.
FDTCrashRegisterReader
(ctx, **kwargs)¶ This is a
DataAbortRegisterReader
that uses thefdt
console command to trigger the Data Abort used to read registers.
-
class
depthcharge.register.
ItestCrashRegisterReader
(ctx, **kwargs)¶ This is a
DataAbortRegisterReader
that uses theitest
console command to trigger the Data Abort used to read registers.
-
class
depthcharge.register.
MdCrashRegisterReader
(ctx, **kwargs)¶ A
DataAbortRegisterReader
that uses themd.l
console command to trigger a Data Abort.
-
class
depthcharge.register.
MmCrashRegisterReader
(ctx, **kwargs)¶ A
DataAbortRegisterReader
that uses themm.l
console command to trigger a Data Abort.
-
class
depthcharge.register.
MwCrashRegisterReader
(ctx, **kwargs)¶ A
DataAbortRegisterReader
that uses themm.l
console command to trigger a Data Abort.
-
class
depthcharge.register.
NmCrashRegisterReader
(ctx, **kwargs)¶ A
DataAbortRegisterReader
that uses thenm.l
console command to trigger a Data Abort.
-
class
depthcharge.register.
SetexprCrashRegisterReader
(ctx, **kwargs)¶ This is a
DataAbortRegisterReader
that uses thesetexpr
console command to trigger the Data Abort used to read registers.