2017-07-07 07:09:03 +00:00
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include <fnd/types.h>
|
2018-06-29 04:24:39 +00:00
|
|
|
#include <nx/KernelCapabilityEntry.h>
|
2017-07-07 07:09:03 +00:00
|
|
|
|
|
|
|
namespace nx
|
|
|
|
{
|
|
|
|
class MiscFlagsEntry
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MiscFlagsEntry();
|
2018-06-29 04:24:39 +00:00
|
|
|
MiscFlagsEntry(const KernelCapabilityEntry& kernel_cap);
|
2018-03-22 05:26:22 +00:00
|
|
|
MiscFlagsEntry(uint32_t flags);
|
2017-07-07 07:09:03 +00:00
|
|
|
|
2018-06-24 15:01:16 +00:00
|
|
|
void operator=(const MiscFlagsEntry& other);
|
|
|
|
bool operator==(const MiscFlagsEntry& other) const;
|
|
|
|
bool operator!=(const MiscFlagsEntry& other) const;
|
|
|
|
|
2017-07-07 07:09:03 +00:00
|
|
|
// kernel capability
|
2018-06-29 04:24:39 +00:00
|
|
|
const KernelCapabilityEntry& getKernelCapability() const;
|
|
|
|
void setKernelCapability(const KernelCapabilityEntry& kernel_cap);
|
2017-07-07 07:09:03 +00:00
|
|
|
|
|
|
|
// variables
|
2018-03-22 05:26:22 +00:00
|
|
|
uint32_t getFlags() const;
|
|
|
|
void setFlags(uint32_t flags);
|
2017-07-07 07:09:03 +00:00
|
|
|
private:
|
|
|
|
const std::string kModuleName = "MISC_FLAG_ENTRY";
|
2018-06-29 04:24:39 +00:00
|
|
|
static const kc::KernelCapId kCapId = kc::KC_MISC_FLAGS;
|
2018-03-22 05:26:22 +00:00
|
|
|
static const uint32_t kValueBits = 15;
|
|
|
|
static const uint32_t kMaxVal = BIT(kValueBits)-1;
|
2017-07-07 07:09:03 +00:00
|
|
|
|
2018-06-29 04:24:39 +00:00
|
|
|
KernelCapabilityEntry mCap;
|
2018-03-22 05:26:22 +00:00
|
|
|
uint32_t mFlags;
|
2017-07-07 07:09:03 +00:00
|
|
|
|
|
|
|
inline void updateCapField()
|
|
|
|
{
|
2018-03-22 05:26:22 +00:00
|
|
|
uint32_t field = mFlags & kMaxVal;
|
2017-07-07 07:09:03 +00:00
|
|
|
mCap.setField(field);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void processCapField()
|
|
|
|
{
|
2018-03-22 05:26:22 +00:00
|
|
|
uint32_t field = mCap.getField();
|
2017-07-07 07:09:03 +00:00
|
|
|
mFlags = field & kMaxVal;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|