class SysReg

Defined at line 37 of file ../../zircon/kernel/lib/arch/include/lib/arch/sysreg.h

arch::SysReg() is an object used to access system registers. It's always an

empty object, so it can be constructed afresh for each use. Other classes

can be defined for testing with the same object API.

Public Methods

template <class RegisterTag>
auto * Io ()

This returns an hwreg "IO provider" pointer that can be passed to

ReadFrom() and WriteTo() methods to access the register identified

by RegisterTag.

Defined at line 43 of file ../../zircon/kernel/lib/arch/include/lib/arch/sysreg.h

template <class RegisterTag>
auto Read ()

This is a shorthand for reading the register into an hwreg::RegisterAddr

object as returned by RegisterTag::Get().

Defined at line 50 of file ../../zircon/kernel/lib/arch/include/lib/arch/sysreg.h

template <class RegisterTag, typename T>
auto Modify (T && mutate)

This is a shorthand for doing Read(), some modifications, and then writing

back. The argument is called with a mutable reference to the object as

returned by Read

<RegisterTag

>(). That object is also returned so it can

be used for additional fluent calls.

Defined at line 59 of file ../../zircon/kernel/lib/arch/include/lib/arch/sysreg.h

template <class RegisterTag, typename T>
decltype(auto) Write (T && reg)

This is a shorthand for writing a register value from an existing

hwreg::RegisterAddr object. It returns the object (or reference) passed

after writing it back to the system register so it can be used for

additional fluent calls.

Defined at line 70 of file ../../zircon/kernel/lib/arch/include/lib/arch/sysreg.h

template <class RegisterTag>
auto Write (typename RegisterTag::ValueType value)

Write

<RegisterTag

> can also be called with a plain integer value to

clobber the register with that value like RegisterTag::Get().FromValue()

before writing it. It returns the hwreg::RegisterAddr object by value.

Defined at line 82 of file ../../zircon/kernel/lib/arch/include/lib/arch/sysreg.h

Records