exo/vapours: refactor member variables to m_ over this->

This commit is contained in:
Michael Scire 2021-10-09 15:40:06 -07:00
parent 5a38311ebf
commit 67a45c97ef
55 changed files with 846 additions and 847 deletions

View file

@ -23,16 +23,16 @@ namespace ams::secmon {
void *PageMapperImpl::GetPointerTo(uintptr_t phys, size_t size) const {
/* Ensure we stay within the page. */
if (util::AlignDown(phys, 4_KB) != this->physical_address) {
if (util::AlignDown(phys, 4_KB) != m_physical_address) {
return nullptr;
}
if (size != 0) {
if (util::AlignDown(phys + size - 1, 4_KB) != this->physical_address) {
if (util::AlignDown(phys + size - 1, 4_KB) != m_physical_address) {
return nullptr;
}
}
return reinterpret_cast<void *>(phys + (this->virtual_address - this->physical_address));
return reinterpret_cast<void *>(phys + (m_virtual_address - m_physical_address));
}
bool PageMapperImpl::CopyToMapping(uintptr_t dst_phys, const void *src, size_t size) const {

View file

@ -22,10 +22,10 @@ namespace ams::secmon {
class PageMapperImpl {
private:
uintptr_t physical_address;
uintptr_t virtual_address;
uintptr_t m_physical_address;
uintptr_t m_virtual_address;
public:
constexpr PageMapperImpl(uintptr_t phys) : physical_address(util::AlignDown(phys, 4_KB)), virtual_address() { /* ... */ }
constexpr PageMapperImpl(uintptr_t phys) : m_physical_address(util::AlignDown(phys, 4_KB)), m_virtual_address() { /* ... */ }
void *GetPointerTo(uintptr_t phys, size_t size) const;
@ -37,14 +37,14 @@ namespace ams::secmon {
template<auto F>
bool MapImpl() {
this->virtual_address = F(this->physical_address);
return this->virtual_address != 0;
m_virtual_address = F(m_physical_address);
return m_virtual_address != 0;
}
template<auto F>
void UnmapImpl() {
F();
this->virtual_address = 0;
m_virtual_address = 0;
}
};

View file

@ -55,31 +55,31 @@ namespace ams::secmon::smc {
class PrepareEsDeviceUniqueKeyAsyncArguments {
private:
int generation;
EsCommonKeyType type;
u8 label_digest[crypto::Sha256Generator::HashSize];
int m_generation;
EsCommonKeyType m_type;
u8 m_label_digest[crypto::Sha256Generator::HashSize];
public:
void Set(int gen, EsCommonKeyType t, const u8 ld[crypto::Sha256Generator::HashSize]) {
this->generation = gen;
this->type = t;
std::memcpy(this->label_digest, ld, sizeof(this->label_digest));
m_generation = gen;
m_type = t;
std::memcpy(m_label_digest, ld, sizeof(m_label_digest));
}
int GetKeyGeneration() const { return this->generation; }
EsCommonKeyType GetCommonKeyType() const { return this->type; }
void GetLabelDigest(u8 dst[crypto::Sha256Generator::HashSize]) const { std::memcpy(dst, this->label_digest, sizeof(this->label_digest)); }
int GetKeyGeneration() const { return m_generation; }
EsCommonKeyType GetCommonKeyType() const { return m_type; }
void GetLabelDigest(u8 dst[crypto::Sha256Generator::HashSize]) const { std::memcpy(dst, m_label_digest, sizeof(m_label_digest)); }
};
class ModularExponentiateByStorageKeyAsyncArguments {
private:
u8 msg[se::RsaSize];
u8 m_msg[se::RsaSize];
public:
void Set(const void *m, size_t m_size) {
AMS_UNUSED(m_size);
std::memcpy(this->msg, m, sizeof(this->msg));
std::memcpy(m_msg, m, sizeof(m_msg));
}
const u8 *GetMessage() const { return this->msg; }
const u8 *GetMessage() const { return m_msg; }
};
constinit SmcResult g_exp_mod_result = SmcResult::Success;