2017-07-07 07:09:03 +00:00
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include <fnd/types.h>
|
|
|
|
#include <nx/KernelCapability.h>
|
|
|
|
|
|
|
|
namespace nx
|
|
|
|
{
|
|
|
|
class MiscParamsEntry
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MiscParamsEntry();
|
|
|
|
MiscParamsEntry(const KernelCapability& kernel_cap);
|
2018-03-22 05:26:22 +00:00
|
|
|
MiscParamsEntry(byte_t program_type);
|
2017-07-07 07:09:03 +00:00
|
|
|
|
2018-06-24 15:01:16 +00:00
|
|
|
void operator=(const MiscParamsEntry& other);
|
|
|
|
bool operator==(const MiscParamsEntry& other) const;
|
|
|
|
bool operator!=(const MiscParamsEntry& other) const;
|
|
|
|
|
2017-07-07 07:09:03 +00:00
|
|
|
// kernel capability
|
|
|
|
const KernelCapability& getKernelCapability() const;
|
|
|
|
void setKernelCapability(const KernelCapability& kernel_cap);
|
|
|
|
|
|
|
|
// variables
|
2018-03-22 05:26:22 +00:00
|
|
|
byte_t getProgramType() const;
|
|
|
|
void setProgramType(byte_t type);
|
2017-07-07 07:09:03 +00:00
|
|
|
private:
|
|
|
|
const std::string kModuleName = "MISC_PARAMS_ENTRY";
|
|
|
|
static const KernelCapability::KernelCapId kCapId = KernelCapability::KC_MISC_PARAMS;
|
2018-03-22 05:26:22 +00:00
|
|
|
static const byte_t kValBits = 3;
|
|
|
|
static const byte_t kMaxProgramType = BIT(kValBits)-1;
|
2017-07-07 07:09:03 +00:00
|
|
|
|
|
|
|
KernelCapability mCap;
|
2018-03-22 05:26:22 +00:00
|
|
|
byte_t mProgramType;
|
2017-07-07 07:09:03 +00:00
|
|
|
|
|
|
|
inline void updateCapField()
|
|
|
|
{
|
2018-03-22 05:26:22 +00:00
|
|
|
uint32_t field = mProgramType & kMaxProgramType;
|
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
|
|
|
mProgramType = field & kMaxProgramType;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|