kern: fix some lingering non-m_ member variables

This commit is contained in:
Michael Scire 2021-10-09 15:46:04 -07:00
parent 67a45c97ef
commit 179d91a563
3 changed files with 28 additions and 28 deletions

View file

@ -54,63 +54,63 @@ namespace ams::kern::init::Elf::Elf64 {
class Dyn { class Dyn {
private: private:
SXword tag; SXword m_tag;
union { union {
Xword value; Xword m_value;
Addr ptr; Addr m_ptr;
}; };
public: public:
constexpr ALWAYS_INLINE SXword GetTag() const { constexpr ALWAYS_INLINE SXword GetTag() const {
return this->tag; return m_tag;
} }
constexpr ALWAYS_INLINE Xword GetValue() const { constexpr ALWAYS_INLINE Xword GetValue() const {
return this->value; return m_value;
} }
constexpr ALWAYS_INLINE Addr GetPtr() const { constexpr ALWAYS_INLINE Addr GetPtr() const {
return this->ptr; return m_ptr;
} }
}; };
class Rel { class Rel {
private: private:
Addr offset; Addr m_offset;
Xword info; Xword m_info;
public: public:
constexpr ALWAYS_INLINE Addr GetOffset() const { constexpr ALWAYS_INLINE Addr GetOffset() const {
return this->offset; return m_offset;
} }
constexpr ALWAYS_INLINE Xword GetSym() const { constexpr ALWAYS_INLINE Xword GetSym() const {
return this->info >> 32; return m_info >> 32;
} }
constexpr ALWAYS_INLINE Xword GetType() const { constexpr ALWAYS_INLINE Xword GetType() const {
return this->info & 0xFFFFFFFF; return m_info & 0xFFFFFFFF;
} }
}; };
class Rela { class Rela {
private: private:
Addr offset; Addr m_offset;
Xword info; Xword m_info;
SXword addend; SXword m_addend;
public: public:
constexpr ALWAYS_INLINE Addr GetOffset() const { constexpr ALWAYS_INLINE Addr GetOffset() const {
return this->offset; return m_offset;
} }
constexpr ALWAYS_INLINE Xword GetSym() const { constexpr ALWAYS_INLINE Xword GetSym() const {
return this->info >> 32; return m_info >> 32;
} }
constexpr ALWAYS_INLINE Xword GetType() const { constexpr ALWAYS_INLINE Xword GetType() const {
return this->info & 0xFFFFFFFF; return m_info & 0xFFFFFFFF;
} }
constexpr ALWAYS_INLINE SXword GetAddend() const { constexpr ALWAYS_INLINE SXword GetAddend() const {
return this->addend; return m_addend;
} }
}; };

View file

@ -140,21 +140,21 @@ namespace ams::kern::svc {
using CT = const char; using CT = const char;
using T = char; using T = char;
private: private:
const char *ptr; const char *m_ptr;
protected: protected:
ALWAYS_INLINE Result CopyStringTo(char *dst, size_t size) const { ALWAYS_INLINE Result CopyStringTo(char *dst, size_t size) const {
static_assert(sizeof(char) == 1); static_assert(sizeof(char) == 1);
R_UNLESS(UserspaceAccess::CopyStringFromUser(dst, this->ptr, size) > 0, svc::ResultInvalidPointer()); R_UNLESS(UserspaceAccess::CopyStringFromUser(dst, m_ptr, size) > 0, svc::ResultInvalidPointer());
return ResultSuccess(); return ResultSuccess();
} }
ALWAYS_INLINE Result CopyArrayElementTo(char *dst, size_t index) const { ALWAYS_INLINE Result CopyArrayElementTo(char *dst, size_t index) const {
return Traits::CopyFromUserspace(dst, this->ptr + index, sizeof(*dst)); return Traits::CopyFromUserspace(dst, m_ptr + index, sizeof(*dst));
} }
constexpr ALWAYS_INLINE bool IsNull() const { return this->ptr == nullptr; } constexpr ALWAYS_INLINE bool IsNull() const { return m_ptr == nullptr; }
constexpr ALWAYS_INLINE const char *GetUnsafePointer() const { return this->ptr; } constexpr ALWAYS_INLINE const char *GetUnsafePointer() const { return m_ptr; }
}; };
} }

View file

@ -25,18 +25,18 @@ namespace ams::kern {
public: public:
static constexpr size_t MaxMemoryRegions = 200; static constexpr size_t MaxMemoryRegions = 200;
private: private:
KMemoryRegion region_heap[MaxMemoryRegions]; KMemoryRegion m_region_heap[MaxMemoryRegions];
size_t num_regions; size_t m_num_regions;
public: public:
constexpr ALWAYS_INLINE KMemoryRegionAllocator() : region_heap(), num_regions() { /* ... */ } constexpr ALWAYS_INLINE KMemoryRegionAllocator() : m_region_heap(), m_num_regions() { /* ... */ }
public: public:
template<typename... Args> template<typename... Args>
ALWAYS_INLINE KMemoryRegion *Allocate(Args&&... args) { ALWAYS_INLINE KMemoryRegion *Allocate(Args&&... args) {
/* Ensure we stay within the bounds of our heap. */ /* Ensure we stay within the bounds of our heap. */
MESOSPHERE_INIT_ABORT_UNLESS(this->num_regions < MaxMemoryRegions); MESOSPHERE_INIT_ABORT_UNLESS(m_num_regions < MaxMemoryRegions);
/* Create the new region. */ /* Create the new region. */
KMemoryRegion *region = std::addressof(this->region_heap[this->num_regions++]); KMemoryRegion *region = std::addressof(m_region_heap[m_num_regions++]);
std::construct_at(region, std::forward<Args>(args)...); std::construct_at(region, std::forward<Args>(args)...);
return region; return region;