2018-04-21 09:36:09 +00:00
|
|
|
#pragma once
|
|
|
|
#include <fnd/types.h>
|
2018-08-07 07:17:51 +00:00
|
|
|
#include <nn/hac/macro.h>
|
2018-04-21 09:36:09 +00:00
|
|
|
|
2018-08-07 07:17:51 +00:00
|
|
|
namespace nn
|
|
|
|
{
|
|
|
|
namespace hac
|
2018-04-21 09:36:09 +00:00
|
|
|
{
|
|
|
|
namespace npdm
|
|
|
|
{
|
2018-06-29 07:10:10 +00:00
|
|
|
static const uint32_t kNpdmStructMagic = _MAKE_STRUCT_MAGIC_U32("META");
|
2018-04-21 09:36:09 +00:00
|
|
|
static const size_t kNameMaxLen = 0x10;
|
|
|
|
static const size_t kProductCodeMaxLen = 0x10;
|
2018-06-29 06:45:36 +00:00
|
|
|
static const uint32_t kMaxPriority = BIT(6) - 1;
|
|
|
|
static const size_t kSectionAlignSize = 0x10;
|
2018-04-25 04:59:42 +00:00
|
|
|
static const uint32_t kDefaultMainThreadStackSize = 4096;
|
2018-04-21 09:36:09 +00:00
|
|
|
|
|
|
|
enum InstructionType
|
|
|
|
{
|
|
|
|
INSTR_32BIT,
|
|
|
|
INSTR_64BIT,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum ProcAddrSpaceType
|
|
|
|
{
|
|
|
|
ADDR_SPACE_64BIT = 1,
|
|
|
|
ADDR_SPACE_32BIT,
|
|
|
|
ADDR_SPACE_32BIT_NO_RESERVED,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#pragma pack(push,1)
|
|
|
|
|
|
|
|
struct sNpdmHeader
|
|
|
|
{
|
2018-06-26 04:23:40 +00:00
|
|
|
le_uint32_t st_magic;
|
2018-04-21 09:36:09 +00:00
|
|
|
byte_t reserved_0[8];
|
2018-04-25 04:59:42 +00:00
|
|
|
byte_t flags;
|
2018-04-21 09:36:09 +00:00
|
|
|
byte_t reserved_1;
|
2018-04-25 04:59:42 +00:00
|
|
|
byte_t main_thread_priority;
|
|
|
|
byte_t main_thread_cpu_id;
|
2018-04-21 09:36:09 +00:00
|
|
|
byte_t reserved_2[8];
|
2018-04-25 04:59:42 +00:00
|
|
|
le_uint32_t version;
|
|
|
|
le_uint32_t main_thread_stack_size;
|
|
|
|
char name[npdm::kNameMaxLen]; // important
|
|
|
|
char product_code[npdm::kProductCodeMaxLen]; // can be empty
|
2018-04-21 09:36:09 +00:00
|
|
|
byte_t reserved_3[48];
|
|
|
|
// Access Control Info
|
|
|
|
struct sNpdmSection
|
|
|
|
{
|
2018-04-25 04:59:42 +00:00
|
|
|
le_uint32_t offset;
|
|
|
|
le_uint32_t size;
|
|
|
|
} aci, acid;
|
2018-04-21 09:36:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#pragma pack(pop)
|
2018-08-07 07:17:51 +00:00
|
|
|
}
|
2018-04-21 09:36:09 +00:00
|
|
|
}
|