Compare commits
39 Commits
1.1.1
...
1300_suppo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86ee40dbc3 | ||
|
|
bde480b5ca | ||
|
|
4c5debdf88 | ||
|
|
df4ebae93a | ||
|
|
29940e1a82 | ||
|
|
30514c0e2c | ||
|
|
a33576e674 | ||
|
|
1cf3b24c2d | ||
|
|
f8fd072349 | ||
|
|
dfd57b09a3 | ||
|
|
ecd2392ff4 | ||
|
|
62fe20693e | ||
|
|
d2664c60a3 | ||
|
|
0230609cca | ||
|
|
e105b39ae7 | ||
|
|
05e9084e93 | ||
|
|
a85a87a907 | ||
|
|
e10a7e7d65 | ||
|
|
fe03791d11 | ||
|
|
53aa04303a | ||
|
|
a5aed96b80 | ||
|
|
4a1ca5f39b | ||
|
|
71e87ef8d0 | ||
|
|
71eaeb78d2 | ||
|
|
575f62a41b | ||
|
|
91c3ed9704 | ||
|
|
2554e0c9f1 | ||
|
|
f1e2f001cb | ||
|
|
8859aefdd7 | ||
|
|
45e5e8eb8e | ||
|
|
f7d5d96e1c | ||
|
|
0f62d77197 | ||
|
|
39688c7d47 | ||
|
|
5c89aaf31a | ||
|
|
76bbc3022e | ||
|
|
2cf53dd75f | ||
|
|
0587509a3e | ||
|
|
c5b3f4e2ec | ||
|
|
00a0a4f44b |
@@ -1,7 +1,4 @@
|
||||
# Changelog
|
||||
## 1.1.1
|
||||
+ A bug was fixed which caused some memory to leak when launching a game with mods enabled, eventually causing a crash after enough game launches without rebooting.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 1.1.0
|
||||
+ Support was implemented for 13.0.0.
|
||||
+ `mesosphère` was updated to reflect the latest official kernel behavior.
|
||||
|
||||
@@ -15,12 +15,12 @@ def read_file(fn):
|
||||
|
||||
def pad(data, size):
|
||||
assert len(data) <= size
|
||||
return (data + b'\x00' * size)[:size]
|
||||
return (data + '\x00' * size)[:size]
|
||||
|
||||
def get_overlay(program, i):
|
||||
return program[0x2B000 + 0x14000 * i:0x2B000 + 0x14000 * (i+1)]
|
||||
|
||||
KIP_NAMES = [b'Loader', b'NCM', b'ProcessManager', b'sm', b'boot', b'spl', b'ams_mitm']
|
||||
KIP_NAMES = ['Loader', 'NCM', 'ProcessManager', 'sm', 'boot', 'spl', 'ams_mitm']
|
||||
|
||||
def get_kips(ams_dir):
|
||||
emummc = read_file(os.path.join(ams_dir, 'emummc/emummc_unpacked.kip'))
|
||||
@@ -32,13 +32,13 @@ def get_kips(ams_dir):
|
||||
spl = read_file(os.path.join(ams_dir, 'stratosphere/spl/spl.kip'))
|
||||
ams_mitm = read_file(os.path.join(ams_dir, 'stratosphere/ams_mitm/ams_mitm.kip'))
|
||||
return (emummc, {
|
||||
b'Loader' : loader,
|
||||
b'NCM' : ncm,
|
||||
b'ProcessManager' : pm,
|
||||
b'sm' : sm,
|
||||
b'boot' : boot,
|
||||
b'spl' : spl,
|
||||
b'ams_mitm' : ams_mitm,
|
||||
'Loader' : loader,
|
||||
'NCM' : ncm,
|
||||
'ProcessManager' : pm,
|
||||
'sm' : sm,
|
||||
'boot' : boot,
|
||||
'spl' : spl,
|
||||
'ams_mitm' : ams_mitm,
|
||||
})
|
||||
|
||||
def write_kip_meta(f, kip, ofs):
|
||||
@@ -81,14 +81,14 @@ def write_header(f, all_kips, wb_size, tk_size, xf_size, ex_size, ms_size, fs_si
|
||||
# Write git_revision;
|
||||
f.write(pk('<I', git_revision))
|
||||
# Write content metas
|
||||
f.write(pk('<IIBBBBI16s', 0x000800, wb_size, 2, 0, 0, 0, 0xCCCCCCCC, b'warmboot'))
|
||||
f.write(pk('<IIBBBBI16s', 0x002000, tk_size, 12, 0, 0, 0, 0xCCCCCCCC, b'tsec_keygen'))
|
||||
f.write(pk('<IIBBBBI16s', 0x004000, xf_size, 11, 0, 0, 0, 0xCCCCCCCC, b'exosphere_fatal'))
|
||||
f.write(pk('<IIBBBBI16s', 0x048000, ex_size, 1, 0, 0, 0, 0xCCCCCCCC, b'exosphere'))
|
||||
f.write(pk('<IIBBBBI16s', 0x056000, ms_size, 10, 0, 0, 0, 0xCCCCCCCC, b'mesosphere'))
|
||||
f.write(pk('<IIBBBBI16s', 0x7C0000, fs_size, 0, 0, 0, 0, 0xCCCCCCCC, b'fusee'))
|
||||
f.write(pk('<IIBBBBI16s', 0x7E0000, rb_size, 3, 0, 0, 0, 0xCCCCCCCC, b'rebootstub'))
|
||||
f.write(pk('<IIBBBBI16s', 0x100000, len(emummc), 8, 0, 0, 0, 0xCCCCCCCC, b'emummc'))
|
||||
f.write(pk('<IIBBBBI16s', 0x000800, wb_size, 2, 0, 0, 0, 0xCCCCCCCC, 'warmboot'))
|
||||
f.write(pk('<IIBBBBI16s', 0x002000, tk_size, 12, 0, 0, 0, 0xCCCCCCCC, 'tsec_keygen'))
|
||||
f.write(pk('<IIBBBBI16s', 0x004000, xf_size, 11, 0, 0, 0, 0xCCCCCCCC, 'exosphere_fatal'))
|
||||
f.write(pk('<IIBBBBI16s', 0x048000, ex_size, 1, 0, 0, 0, 0xCCCCCCCC, 'exosphere'))
|
||||
f.write(pk('<IIBBBBI16s', 0x056000, ms_size, 10, 0, 0, 0, 0xCCCCCCCC, 'mesosphere'))
|
||||
f.write(pk('<IIBBBBI16s', 0x7C0000, fs_size, 0, 0, 0, 0, 0xCCCCCCCC, 'fusee'))
|
||||
f.write(pk('<IIBBBBI16s', 0x7E0000, rb_size, 3, 0, 0, 0, 0xCCCCCCCC, 'rebootstub'))
|
||||
f.write(pk('<IIBBBBI16s', 0x100000, len(emummc), 8, 0, 0, 0, 0xCCCCCCCC, 'emummc'))
|
||||
ofs = (0x100000 + len(emummc) + 0xF) & ~0xF
|
||||
for kip_name in KIP_NAMES:
|
||||
kip_data = kips[kip_name]
|
||||
@@ -119,7 +119,7 @@ def write_kips(f, all_kips):
|
||||
# Write kips
|
||||
tot = len(emummc)
|
||||
if (tot & 0xF):
|
||||
f.write(b'\xCC' * (0x10 - (tot & 0xF)))
|
||||
f.write('\xCC' * (0x10 - (tot & 0xF)))
|
||||
tot += 0xF
|
||||
tot &= ~0xF
|
||||
for kip_name in KIP_NAMES:
|
||||
@@ -127,7 +127,7 @@ def write_kips(f, all_kips):
|
||||
f.write(kip_data)
|
||||
tot += len(kip_data)
|
||||
if (tot & 0xF):
|
||||
f.write(b'\xCC' * (0x10 - (tot & 0xF)))
|
||||
f.write('\xCC' * (0x10 - (tot & 0xF)))
|
||||
tot += 0xF
|
||||
tot &= ~0xF
|
||||
# Pad to 3 MB
|
||||
@@ -140,7 +140,7 @@ def main(argc, argv):
|
||||
# Parse arguments
|
||||
ams_dir = argv[1]
|
||||
target = '' if argv[2] == 'release' else ('_%s' % argv[2])
|
||||
revision = int(argv[3][:8], 16)
|
||||
revision = int(argv[3], 16)
|
||||
major = int(argv[4])
|
||||
minor = int(argv[5])
|
||||
micro = int(argv[6])
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
[subrepo]
|
||||
remote = https://github.com/Atmosphere-NX/Atmosphere-libs
|
||||
branch = master
|
||||
commit = e05183a6f4849d2a55e5d75f03e8af51010648b7
|
||||
parent = a3d9efb18cfcbdce7b286d1ead67313e0cb6af1f
|
||||
commit = 0c0bb8153ab5d56b2a428ba662dd1bff620b7404
|
||||
parent = a1af1af74d465440b01744ccb054edaaaca0c192
|
||||
method = merge
|
||||
cmdver = 0.4.1
|
||||
|
||||
@@ -22,11 +22,9 @@
|
||||
|
||||
namespace ams::kern::arch::arm64 {
|
||||
|
||||
class KPageTable final : public KPageTableBase {
|
||||
class KPageTable : public KPageTableBase {
|
||||
NON_COPYABLE(KPageTable);
|
||||
NON_MOVEABLE(KPageTable);
|
||||
private:
|
||||
friend class KPageTableBase;
|
||||
public:
|
||||
using TraversalEntry = KPageTableImpl::TraversalEntry;
|
||||
using TraversalContext = KPageTableImpl::TraversalContext;
|
||||
@@ -98,9 +96,9 @@ namespace ams::kern::arch::arm64 {
|
||||
u64 m_ttbr;
|
||||
u8 m_asid;
|
||||
protected:
|
||||
Result OperateImpl(PageLinkedList *page_list, KProcessAddress virt_addr, size_t num_pages, KPhysicalAddress phys_addr, bool is_pa_valid, const KPageProperties properties, OperationType operation, bool reuse_ll);
|
||||
Result OperateImpl(PageLinkedList *page_list, KProcessAddress virt_addr, size_t num_pages, const KPageGroup &page_group, const KPageProperties properties, OperationType operation, bool reuse_ll);
|
||||
void FinalizeUpdateImpl(PageLinkedList *page_list);
|
||||
virtual Result Operate(PageLinkedList *page_list, KProcessAddress virt_addr, size_t num_pages, KPhysicalAddress phys_addr, bool is_pa_valid, const KPageProperties properties, OperationType operation, bool reuse_ll) override;
|
||||
virtual Result Operate(PageLinkedList *page_list, KProcessAddress virt_addr, size_t num_pages, const KPageGroup &page_group, const KPageProperties properties, OperationType operation, bool reuse_ll) override;
|
||||
virtual void FinalizeUpdate(PageLinkedList *page_list) override;
|
||||
|
||||
KPageTableManager &GetPageTableManager() const { return *m_manager; }
|
||||
private:
|
||||
|
||||
@@ -217,13 +217,9 @@ namespace ams::kern {
|
||||
size_t GetRegionSize(KMemoryState state) const;
|
||||
bool CanContain(KProcessAddress addr, size_t size, KMemoryState state) const;
|
||||
protected:
|
||||
/* NOTE: These three functions (Operate, Operate, FinalizeUpdate) are virtual functions */
|
||||
/* in Nintendo's kernel. We devirtualize them, since KPageTable is the only derived */
|
||||
/* class, and this avoids unnecessary virtual function calls. See "kern_select_page_table.hpp" */
|
||||
/* for definition of these functions. */
|
||||
Result Operate(PageLinkedList *page_list, KProcessAddress virt_addr, size_t num_pages, KPhysicalAddress phys_addr, bool is_pa_valid, const KPageProperties properties, OperationType operation, bool reuse_ll);
|
||||
Result Operate(PageLinkedList *page_list, KProcessAddress virt_addr, size_t num_pages, const KPageGroup &page_group, const KPageProperties properties, OperationType operation, bool reuse_ll);
|
||||
void FinalizeUpdate(PageLinkedList *page_list);
|
||||
virtual Result Operate(PageLinkedList *page_list, KProcessAddress virt_addr, size_t num_pages, KPhysicalAddress phys_addr, bool is_pa_valid, const KPageProperties properties, OperationType operation, bool reuse_ll) = 0;
|
||||
virtual Result Operate(PageLinkedList *page_list, KProcessAddress virt_addr, size_t num_pages, const KPageGroup &page_group, const KPageProperties properties, OperationType operation, bool reuse_ll) = 0;
|
||||
virtual void FinalizeUpdate(PageLinkedList *page_list) = 0;
|
||||
|
||||
ALWAYS_INLINE KPageTableImpl &GetImpl() { return m_impl; }
|
||||
ALWAYS_INLINE const KPageTableImpl &GetImpl() const { return m_impl; }
|
||||
|
||||
@@ -32,24 +32,3 @@
|
||||
#error "Unknown architecture for KPageTable"
|
||||
|
||||
#endif
|
||||
|
||||
namespace ams::kern {
|
||||
|
||||
/* NOTE: These three functions (Operate, Operate, FinalizeUpdate) are virtual functions */
|
||||
/* in Nintendo's kernel. We devirtualize them, since KPageTable is the only derived */
|
||||
/* class, and this avoids unnecessary virtual function calls. */
|
||||
static_assert(std::derived_from<KPageTable, KPageTableBase>);
|
||||
|
||||
ALWAYS_INLINE Result KPageTableBase::Operate(PageLinkedList *page_list, KProcessAddress virt_addr, size_t num_pages, KPhysicalAddress phys_addr, bool is_pa_valid, const KPageProperties properties, OperationType operation, bool reuse_ll) {
|
||||
return static_cast<KPageTable *>(this)->OperateImpl(page_list, virt_addr, num_pages, phys_addr, is_pa_valid, properties, operation, reuse_ll);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result KPageTableBase::Operate(PageLinkedList *page_list, KProcessAddress virt_addr, size_t num_pages, const KPageGroup &page_group, const KPageProperties properties, OperationType operation, bool reuse_ll) {
|
||||
return static_cast<KPageTable *>(this)->OperateImpl(page_list, virt_addr, num_pages, page_group, properties, operation, reuse_ll);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void KPageTableBase::FinalizeUpdate(PageLinkedList *page_list) {
|
||||
return static_cast<KPageTable *>(this)->FinalizeUpdateImpl(page_list);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -319,7 +319,7 @@ namespace ams::kern::arch::arm64 {
|
||||
return ResultSuccess();
|
||||
}
|
||||
|
||||
Result KPageTable::OperateImpl(PageLinkedList *page_list, KProcessAddress virt_addr, size_t num_pages, KPhysicalAddress phys_addr, bool is_pa_valid, const KPageProperties properties, OperationType operation, bool reuse_ll) {
|
||||
Result KPageTable::Operate(PageLinkedList *page_list, KProcessAddress virt_addr, size_t num_pages, KPhysicalAddress phys_addr, bool is_pa_valid, const KPageProperties properties, OperationType operation, bool reuse_ll) {
|
||||
/* Check validity of parameters. */
|
||||
MESOSPHERE_ASSERT(this->IsLockedByCurrentThread());
|
||||
MESOSPHERE_ASSERT(num_pages > 0);
|
||||
@@ -350,7 +350,7 @@ namespace ams::kern::arch::arm64 {
|
||||
}
|
||||
}
|
||||
|
||||
Result KPageTable::OperateImpl(PageLinkedList *page_list, KProcessAddress virt_addr, size_t num_pages, const KPageGroup &page_group, const KPageProperties properties, OperationType operation, bool reuse_ll) {
|
||||
Result KPageTable::Operate(PageLinkedList *page_list, KProcessAddress virt_addr, size_t num_pages, const KPageGroup &page_group, const KPageProperties properties, OperationType operation, bool reuse_ll) {
|
||||
/* Check validity of parameters. */
|
||||
MESOSPHERE_ASSERT(this->IsLockedByCurrentThread());
|
||||
MESOSPHERE_ASSERT(util::IsAligned(GetInteger(virt_addr), PageSize));
|
||||
@@ -1429,7 +1429,7 @@ namespace ams::kern::arch::arm64 {
|
||||
return ResultSuccess();
|
||||
}
|
||||
|
||||
void KPageTable::FinalizeUpdateImpl(PageLinkedList *page_list) {
|
||||
void KPageTable::FinalizeUpdate(PageLinkedList *page_list) {
|
||||
while (page_list->Peek()) {
|
||||
KVirtualAddress page = KVirtualAddress(page_list->Pop());
|
||||
MESOSPHERE_ASSERT(this->GetPageTableManager().IsInPageTableHeap(page));
|
||||
|
||||
@@ -40,6 +40,7 @@ namespace ams::ncm {
|
||||
}
|
||||
public:
|
||||
HostContentStorageImpl(RegisteredHostContent *registered_content) : registered_content(registered_content), disabled(false) { /* ... */ }
|
||||
~HostContentStorageImpl();
|
||||
public:
|
||||
/* Actual commands. */
|
||||
virtual Result GeneratePlaceHolderId(sf::Out<PlaceHolderId> out);
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
namespace ams::ncm {
|
||||
|
||||
|
||||
class RegisteredHostContent::RegisteredPath : public util::IntrusiveListBaseNode<RegisteredPath> {
|
||||
NON_COPYABLE(RegisteredPath);
|
||||
NON_MOVEABLE(RegisteredPath);
|
||||
@@ -24,8 +24,8 @@ namespace ams::ncm {
|
||||
ContentId content_id;
|
||||
Path path;
|
||||
public:
|
||||
RegisteredPath(const ncm::ContentId &content_id, const Path &p) : content_id(content_id), path(p) {
|
||||
/* ... */
|
||||
RegisteredPath(const ncm::ContentId &content_id, const Path &p) : content_id(content_id), path(p) {
|
||||
/* ... */
|
||||
}
|
||||
|
||||
ncm::ContentId GetContentId() const {
|
||||
@@ -41,10 +41,6 @@ namespace ams::ncm {
|
||||
}
|
||||
};
|
||||
|
||||
RegisteredHostContent::~RegisteredHostContent() {
|
||||
/* ... */
|
||||
}
|
||||
|
||||
Result RegisteredHostContent::RegisterPath(const ncm::ContentId &content_id, const ncm::Path &path) {
|
||||
std::scoped_lock lk(this->mutex);
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#define ATMOSPHERE_RELEASE_VERSION_MAJOR 1
|
||||
#define ATMOSPHERE_RELEASE_VERSION_MINOR 1
|
||||
#define ATMOSPHERE_RELEASE_VERSION_MICRO 1
|
||||
#define ATMOSPHERE_RELEASE_VERSION_MICRO 0
|
||||
|
||||
#define ATMOSPHERE_RELEASE_VERSION ATMOSPHERE_RELEASE_VERSION_MAJOR, ATMOSPHERE_RELEASE_VERSION_MINOR, ATMOSPHERE_RELEASE_VERSION_MICRO
|
||||
|
||||
|
||||
@@ -197,7 +197,6 @@ namespace ams::mitm::fs {
|
||||
|
||||
~TableWriter() {
|
||||
this->Flush();
|
||||
std::free(this->cache);
|
||||
}
|
||||
|
||||
Entry *GetEntry(u32 entry_offset, u32 name_len) {
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace ams::ldr {
|
||||
lr::Path path;
|
||||
|
||||
/* Check that path registration is allowable. */
|
||||
if (static_cast<ncm::StorageId>(loc.storage_id) == ncm::StorageId::Host) {
|
||||
if (loc.storage_id == ncm::StorageId::Host) {
|
||||
AMS_ABORT_UNLESS(spl::IsDevelopment());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user