Compare commits

...

441 Commits

Author SHA1 Message Date
lsp199308
d8a37b4b71
loader: add usb 3.0 enable patches for 20.1.0 (#2556)
* loader: add usb 3.0 enable patches for 20.1.0
2025-06-03 01:04:52 -07:00
Michael Scire
b11850b3a3 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "0f72b2ceb"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "0f72b2ceb"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2025-05-28 19:34:34 -07:00
Michael Scire
77603bf7e5 docs: add basic changelog for 1.9.1 2025-05-28 19:33:49 -07:00
Marcus Carter
6b01ebca9e Clarify that code type 0xC4 uses a 64-bit value in cheats.md by formatting the key values as such
Changes the formatting of the key values at `Code Type 0xC4: Begin Extended Keypress Conditional Block` in cheats.md so that it is perfectly clear that those values are 64-bit values rather than 32-bit or 28-bit like `Code Type 0x8: Begin Keypress Conditional Block`, and also for the fact that the formatting matches the rest of the document and is thus cleaner.
2025-05-28 14:47:45 -07:00
Michael Scire
17be65b4b9 git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "a8e5f1a18"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "a8e5f1a18"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2025-05-28 12:29:54 -07:00
Michael Scire
409c3cf9e1 emummc: note 20.1.0 support in README 2025-05-28 12:29:17 -07:00
Michael Scire
f4e1d0bf9f kern: move spendsgir static assert 2025-05-28 12:18:51 -07:00
Michael Scire
ae65b5df0c fusee/emummc: add support for FS 20.1.0 2025-05-28 12:02:56 -07:00
Michael Scire
0a299a3d40 erpt: update IDs for 20.1.0 2025-05-28 11:48:04 -07:00
Michael Scire
801438953d kern: save/restore spendsgir in KInterruptController::Save/RestoreCoreLocal 2025-05-28 10:54:52 -07:00
Michael Scire
3fbc59cce1 kern: wait 100us after synchronizing cores before saving interrupt state on sleep 2025-05-28 10:48:42 -07:00
Michael Scire
f646d9c8f9 kern: use KLightLock for KCoreBarrierInterruptHandler 2025-05-28 10:44:31 -07:00
Michael Scire
69cc653e7f Add version enums for 20.1.0 2025-05-28 10:32:26 -07:00
Michael Scire
6da88f8f3e docs: add banner to readme 2025-05-27 22:24:41 -07:00
Michael Scire
1d3f3c6e56 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "9e8cbe3fa"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "9e8cbe3fa"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2025-05-09 12:11:13 -07:00
Michael Scire
4d4f0ba968 svc: bump supported kernel version 2025-05-09 12:05:01 -07:00
Michael Scire
cc4531e3bf git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "7522f1f60"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "7522f1f60"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2025-05-09 12:02:17 -07:00
Michael Scire
0e2ef545f9 fusee: commit mtc table combined bins, to remove need for running py script outside of makefile 2025-05-09 12:00:44 -07:00
Michael Scire
f1ca7db562 boot: use --embed-dir for fusee embed 2025-05-09 11:58:56 -07:00
Michael Scire
d5567b5363 pm: update for fsp-pr RegisterProgram api change 2025-05-09 11:55:21 -07:00
Michael Scire
f9165c472e docs: add gcc15 to changelog 2025-05-09 11:55:21 -07:00
Michael Scire
b2dd3b7dce boot: use #embed for fusee 2025-05-09 11:55:21 -07:00
Michael Scire
66acab02db exo: use #embed for loader stub 2025-05-09 11:55:21 -07:00
Michael Scire
2c50ef717a fusee: use embed in mtc/sdram param scripts 2025-05-09 11:55:21 -07:00
Michael Scire
d305d48a7e ams: basic support for compiling with gcc 15 2025-05-09 11:55:21 -07:00
Michael Scire
cb032006d5 fusee: fix off-by-one in nogc patches for exFAT firm 2025-05-09 11:55:21 -07:00
Michael Scire
8da6bc59a7 docs: add provisional changelog for ams 1.9.0 2025-05-09 11:55:21 -07:00
Michael Scire
b7ec64ea16 fs.mitm: add and use memlet module to temporarily steal applet memory while building romfs images.
Starting in 20.0.0, the browser needs more applet memory to function, so we can't steal as much any more.
Thus, we now steal 14 MB on 20.0.0+ instead of 40MB.

However, since this reduces memory available for custom system modules, we are adjusting to compensate.
ams.mitm's heap size has been reduced from 32MB to 12MB (recovering 20MB).
In addition, fs.mitm now uses a new mechanism for stealing memory from the applet pool while romfs is being built.

On net, we are compromising:
    * Custom sysmodules lose memory available to them.
        On 19.0.0/AMS 1.8.0, there was 30 MB available for custom sysmodules.
        Stealing 14 MB instead of 40 MB, we lose 26 MB of that. Reducing ams.mitm's usage will gain us back 20.
        Nintendo also appears to...use 4 extra MB, in 20.0.0, from my test homebrew.
        So on 20.0.0/AMS 1.9.0, there should be 20 MB available for custom sysmodules.
        On the bright side, on <20.0.0/AMS 1.9.0, I guess there will be 50 MB available for custom sysmodules now?
    * totk mods will lose the ability to...put every file in the romfs on sd card. There will be some unknown maximum filecount for totk mods.
        On the bright side, implementing the transient memory stealing should improve compatibility for some mods which strictly add files?
2025-05-09 11:55:21 -07:00
Michael Scire
bc44ffe70d emummc: fix offsets for 20.0.0-exfat 2025-05-09 11:55:21 -07:00
Michael Scire
a6847ca70e ams: add enum support for 20.0.1/18.0.1 2025-05-09 11:55:21 -07:00
Michael Scire
3af8757c3b erpt: initial support (incomplete) for 20.0.0 2025-05-09 11:55:21 -07:00
Michael Scire
f55cf42433 ldr/pm: update for 20.0.0 abi changes 2025-05-09 11:55:21 -07:00
Michael Scire
07df13e2a0 strat: update for fsp-ldr 20.0.0 changes 2025-05-09 11:55:21 -07:00
Michael Scire
791edf87a0 ncm: update to implement new ContentMetaDatabase function for 20.0.0 2025-05-09 11:55:21 -07:00
Michael Scire
b1ca5b4049 kern: plutoo is an intellectual, I am a fool, fix chicanery 2025-05-09 11:55:21 -07:00
Michael Scire
4580a352c0 kern: use callback to note pte updates in KPageTableImpl 2025-05-09 11:55:21 -07:00
Michael Scire
28296e2aac kern: refactor FindFreeArea region search logic per 20.0.0 changes 2025-05-09 11:55:21 -07:00
Michael Scire
b80f0944ab kern: update instruction cache invalidation logic in KPageTableBase to reflect 20.0.0 changes 2025-05-09 11:55:21 -07:00
Michael Scire
96d4546498 kern: reorder resource manager implementation 2025-05-09 11:55:21 -07:00
Michael Scire
86e4bed056 kern: support null resource limit in KSecureSystemResource 2025-05-09 11:55:21 -07:00
Michael Scire
2e204ccbaf kern: update synchronous exception handlers to assume FAR validity on TLB conflict 2025-05-09 11:55:21 -07:00
Michael Scire
b27999a116 kern: adjust system registers during exception handling on MTE-violation or kernel address fault 2025-05-09 11:55:21 -07:00
Michael Scire
98e5bd4411 kern: update UserspaceAccess functions for 20.0.0 changes 2025-05-09 11:55:21 -07:00
Michael Scire
4c5c5c85e3 kern: update crt0 to reflect 20.0.0 changes 2025-05-09 11:55:21 -07:00
Michael Scire
3e19e4d004 kern: update KAddressSpaceInfo to reflect 20.0.0 changes 2025-05-09 11:55:21 -07:00
Michael Scire
66fcf33a2c kern: invert meaning of KTargetSystem/KSystemControl bools 2025-05-09 11:55:21 -07:00
Michael Scire
d147f6f93b erpt: update ids for 20.0.0 2025-05-09 11:55:21 -07:00
Michael Scire
3dd5c98f52 readme: sept has not been in the project for many years 2025-05-09 11:55:21 -07:00
Michael Scire
b9b01bbbd1 loader: add usb 3.0 enable patches for 20.0.0 2025-05-09 11:55:21 -07:00
Michael Scire
6352397203 emummc: add offsets for 20.0.0 (untested) 2025-05-09 11:55:21 -07:00
Michael Scire
ef5334c3ca fusee/exo/ams: update with new keydata/version enums 2025-05-09 11:55:21 -07:00
Michael Scire
6125f40bdb ams: various fixes to support booting debug configuration 2025-04-08 13:43:29 -07:00
Michael Scire
85fd13f724 kern: update KernelLdr for 19.0.0 (new checks, dummy function call).
Also, fix a few very embarassing mistakes in kernel ldr:
* We have been mapping the page table region RWX for a few years now, accidentally.
* My attempt at making initial page tables not use bit 58 was broken in multiple ways.
2025-04-07 16:49:10 -07:00
tomvita
4e99a5e08d
Add extensions to dmnt cheat virtual machine (#2479)
* dmnt_extension

* update type 8 extension

* clearify that bit 27 does not correspond to a button

* update cheat.md with new code type 0xC4

* implement code type 0xC4

* Add type 1 extension

* remove C0Tcr6Ma aaaaaaaa VVVVVVVV (VVVVVVVV)

* Type 9 extension for floating point math

* updated according to review
2025-01-09 19:38:59 -07:00
Michael Scire
9f8d17b9e6 crypto: implement CmacGenerator 2024-10-30 18:08:29 -07:00
Michael Scire
3a5f70dceb fs: fix uninit warnings on windows localfilesystem 2024-10-29 20:00:08 -07:00
Michael Scire
e51e11a71c libstrat: re-nolto files when compiling for windows-audit 2024-10-29 19:30:30 -07:00
Michael Scire
57e15f3622 strat: ldr::PlatformId -> ncm::ContentMetaPlatform 2024-10-29 19:24:52 -07:00
Michael Scire
c6014b533f docs: add changelog for 1.8.0 2024-10-15 21:55:50 -07:00
Michael Scire
0c3608d1f4 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "989fb7be0"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "989fb7be0"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2024-10-15 21:52:50 -07:00
Michael Scire
be19749841 svc: bump supported kernel version 2024-10-15 21:51:17 -07:00
Michael Scire
7c31b21d4b git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "d248ea6f7"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "d248ea6f7"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2024-10-15 21:50:20 -07:00
Michael Scire
9112461620 loader: add usb 3.0 enable patches for 19.0.0 2024-10-15 21:48:59 -07:00
Michael Scire
3522ac18c1 kern: support reboot to fatal error on mariko 2024-10-15 21:48:59 -07:00
Michael Scire
e63cae5c77 kern: Perform page table validity pass during KPageTableImpl::InitializeForKernel 2024-10-15 21:48:59 -07:00
Michael Scire
c911420d6a kern: fix more page table refactor bugs 2024-10-15 21:48:59 -07:00
Michael Scire
570989384b kern: first round of page table refactor bug fixes 2024-10-15 21:48:59 -07:00
Michael Scire
4c81432e94 kern: update KPageTable::Map for new refactor 2024-10-15 21:48:59 -07:00
Michael Scire
e1e84d4450 kern: update ChangePermissions to use new iteration logic 2024-10-15 21:48:59 -07:00
Michael Scire
d2656e3948 kern: update KPageTable::Finalize for the refactor 2024-10-15 21:48:59 -07:00
Michael Scire
62abb31122 kern: use new merge pages api 2024-10-15 21:48:59 -07:00
Michael Scire
cb970049db kern: implement KPageTableImpl merge 2024-10-15 21:48:59 -07:00
Michael Scire
9610f42dc0 kern: continue page table refactor, implement separate/unmap 2024-10-15 21:48:59 -07:00
Michael Scire
02e837d82e kern: start KPageTable(Impl) refactor, use array-with-levels for KPageTableImpl 2024-10-15 21:48:59 -07:00
Michael Scire
7aa0bed869 ldr: ProgramInfo is 0x410 now, and fix debug flags for hbl 2024-10-15 21:48:59 -07:00
Michael Scire
a80d5b5c86 pm: add new 19.0.0 commands
This is functionally correct, but I have no idea what these are meant to represent.
These functions are completely unused on NX.
2024-10-15 21:48:59 -07:00
Michael Scire
77d239265d ns_mitm: update to support new 19.0.0 command 2024-10-15 21:48:59 -07:00
Michael Scire
624f8d0d8d ro: support NROs with read-only first page 2024-10-15 21:48:59 -07:00
Michael Scire
9cfd535568 kern: invoke supervisor mode thread functions from C++ context with valid stack frame 2024-10-15 21:48:59 -07:00
Michael Scire
23ba31da1f kern: add note that N ifdef'd out calling HandleException() for EL1 faults 2024-10-15 21:48:59 -07:00
Michael Scire
3b03b9603c kern: specify allowable ipc client memory attr via inverted-whitelist, not blacklist 2024-10-15 21:48:59 -07:00
Michael Scire
912b84c4e3 kern: add minimum alignment support to KMemoryManager 2024-10-15 21:48:59 -07:00
Michael Scire
ff38a32a9b kern/ldr: add support for --x executables 2024-10-15 21:48:59 -07:00
Michael Scire
2855b8ee35 kern/strat: update for new DebugFlags capability semantics 2024-10-15 21:48:59 -07:00
Michael Scire
00716576cd kern: simplify KProcess max memory calculation 2024-10-15 21:48:59 -07:00
Michael Scire
743634c3fd kern: move KTargetSystem into .rodata, split init/verify 2024-10-15 21:48:59 -07:00
Michael Scire
3394a88a1a kern: fix debug build 2024-10-15 21:48:59 -07:00
Michael Scire
a72e39d657 kern: allocate all TTBR0 pages during init, use procidx as asid 2024-10-15 21:48:59 -07:00
Michael Scire
c3fa42d958 kern: clear gicd/gicc pointers in KInterruptController::Finalize 2024-10-15 21:48:59 -07:00
Michael Scire
126cb8bbdf kern: fix KMemoryBlock ctor reorder warn 2024-10-15 21:48:59 -07:00
Michael Scire
753cf74bf2 kern: eliminate use of KMemoryInfo, shuffle KMemoryBlock fields 2024-10-15 21:48:59 -07:00
Michael Scire
70bf833070 kern: KAddressSpaceInfo now takes CreateProcessFlags in getters 2024-10-15 21:48:59 -07:00
Michael Scire
a0ad3ef949 kern/svc: update WaitForAddress to support 64-bit WaitIfEqual 2024-10-15 21:48:59 -07:00
Michael Scire
5de551db29 kern: add InfoType_TransferMemoryHint 2024-10-15 21:48:59 -07:00
Michael Scire
77d17dc4ff emummc: update for 19.0.0 2024-10-15 21:48:59 -07:00
Michael Scire
4acfac539c erpt: add new IDs/categories 2024-10-15 21:48:59 -07:00
Michael Scire
c4a5d4db09 fusee/exo/ams: update with new keydata/version enums 2024-10-15 21:48:59 -07:00
Michael Scire
10c7a39528 kern/creport: use mod0 to locate symbol table for all modules 2024-09-24 13:15:21 -07:00
Michael Scire
009f581721 creport: optimize ScopedFile performance 2024-09-23 02:41:57 -07:00
Michael Scire
027e209073 kern/ldr: enable the use of relr for relocations 2024-09-01 22:27:48 -07:00
Michael Scire
423a05a1e9 meso: fix sign-comparison warn on svc/interrupt flag compare 2024-09-01 16:27:01 -07:00
hexkyz
4617fec672 fusee: add missing mtc tables 2024-07-10 21:36:22 +01:00
Michael Scire
e85bc4db0b fusee: add nogc case for 18.1 2024-06-11 10:29:02 -07:00
Michael Scire
39c201e37f git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "bb7678691"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "bb7678691"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2024-06-10 22:19:29 -07:00
Michael Scire
ab5cc75684 git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "f23f943d4"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "f23f943d4"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2024-06-10 22:18:44 -07:00
Michael Scire
1e3349e99a emummc: update readme 2024-06-10 22:18:04 -07:00
Michael Scire
76628e273a ams: bump to 1.7.1 (support for 18.1.0) 2024-06-10 22:17:23 -07:00
Michael Scire
257ac2bd33 emummc: update to support 18.1.0 2024-06-10 22:16:24 -07:00
Michael Scire
9eb92f37db git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "d58ff30a1"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "d58ff30a1"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2024-06-05 11:29:13 -07:00
Michael Scire
5b135d12ca libstrat: fix more gnu++23 errors 2024-06-05 11:28:29 -07:00
Michael Scire
c41a6b80d7 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "087f68257"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "087f68257"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2024-06-05 09:22:53 -07:00
Michael Scire
05fde7b764 ams: may as well test removal of CRTP from Result 2024-06-01 22:36:37 -07:00
Michael Scire
1609f804f2 ams: build with -std=gnu++23 2024-06-01 22:36:37 -07:00
Michael Scire
f35c94810c ams: fix compilation with gcc 14 (closes #2330) 2024-06-01 22:36:37 -07:00
Michael Scire
548b48b2a6 loader: update to reflect latest 18.0.0 changes
well, this sure is late, whoops
2024-05-27 15:43:58 -07:00
Michael Scire
35d93a7c41 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "fadec2981"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "fadec2981"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2024-03-29 03:20:12 -07:00
Michael Scire
410f23035e docs: update changelog for 1.7.0 2024-03-29 03:19:17 -07:00
Michael Scire
29cc13543a kern: fix using memory config for half-of-true-size 2024-03-29 03:18:20 -07:00
Michael Scire
31ad4eec1d git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "832b24426"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "832b24426"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2024-03-29 02:57:53 -07:00
Michael Scire
3ccb0ae02b git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "8b85add71"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "8b85add71"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2024-03-29 02:56:10 -07:00
Michael Scire
4f7db6e60e docs: add changelog for 1.7.0 2024-03-29 02:54:40 -07:00
Michael Scire
a325e18cb5 loader: add usb3 patches for 18.0.0 2024-03-29 02:41:14 -07:00
Michael Scire
af41272591 spl: add support for new spl:es command 33 2024-03-29 02:41:14 -07:00
Michael Scire
551821e7e2 erpt: actually support non-sequential ids, nintendo why 2024-03-29 02:41:14 -07:00
Michael Scire
b081762657 emummc: update for 18.0.0 2024-03-29 02:41:14 -07:00
Michael Scire
d2c2a94c5e erpt: add new IDs/categories 2024-03-29 02:41:14 -07:00
Michael Scire
4ff9278d11 jpegdec: stop bundling (TODO post-prerelease) 2024-03-29 02:41:14 -07:00
Michael Scire
21c85c6a4f exo/fusee: apparently 18.0.0 did not burn a fuse 2024-03-29 02:41:14 -07:00
Michael Scire
05090005b7 svc: advertise support for 18.3.0.0 2024-03-29 02:41:14 -07:00
Michael Scire
c0487ad384 kern: fix whoops in new page table logic 2024-03-29 02:41:14 -07:00
Michael Scire
ecbe5cd406 kern: refactor smc helpers to share more common logic 2024-03-29 02:41:14 -07:00
Michael Scire
4fe139ea52 kern: return ExceptionType_UnalignedData on data abort caused by alignment fault 2024-03-29 02:41:14 -07:00
Michael Scire
6922eae3e7 kern: add KPageGroup::CopyRangeTo 2024-03-29 02:41:14 -07:00
Michael Scire
952188fc73 kern: implement new attr tracking for memory range/traversal context 2024-03-29 02:41:14 -07:00
Michael Scire
c0a4fc30a8 kern: simplify size calculations in KPageTableBase::Read/WriteDebugIoMemory 2024-03-29 02:41:14 -07:00
Michael Scire
0b04c89a84 kern: pass properties directly to KPageTableBase::AllocateAndMapPagesImpl 2024-03-29 02:41:14 -07:00
Michael Scire
217dd1260a kern: take alignment argument in KMemoryManager::AllocateAndOpen 2024-03-29 02:41:14 -07:00
Michael Scire
8aa62a54d8 kern/os: support CreateProcessFlag_EnableAliasRegionExtraSize 2024-03-29 02:41:14 -07:00
Michael Scire
25bae14064 kern: revise KPageTableBase region layout logic to match 18.0.0 changes 2024-03-29 02:41:14 -07:00
Michael Scire
900913fe3b kern: fix longstanding bug in ConvertToKMemoryPermission 2024-03-29 02:41:14 -07:00
Michael Scire
7562f807fd kern: pass kernel base from KernelLdr to Kernel 2024-03-29 02:41:14 -07:00
Michael Scire
cf5895e04f kern: use userspace access instructions to read from tlr 2024-03-29 02:41:14 -07:00
Michael Scire
1f37fbed1d fusee/exo/ams: update with new keydata/version enums 2024-03-29 02:41:14 -07:00
JerryWn
9701d5b2ab readme: fix broken discord icon 2024-03-20 03:04:29 -07:00
Michael Scire
c8c76bf8f8 readme: I suppose we're living in 2024, then 2024-03-04 14:51:44 -07:00
Michael Scire
0220f67085 fssrv: fix dumb assert error 2024-02-23 13:55:51 -07:00
german77
615f8a3ef3 dmnt: Fix debug log for cheats 2024-02-14 10:28:16 -07:00
Liam
000e382c42 dmnt.gen2: avoid data abort when too many breakpoints are created 2024-02-14 10:27:45 -07:00
Liam
3627356d4b dmnt.gen2: enable gdbserver QStartNoAckMode 2024-02-14 10:27:36 -07:00
Michael Scire
72b0fe6c1c strat: fix nx_debug build target 2024-01-20 13:31:12 -07:00
Michael Scire
e919b80fa2 pm: improve resource limit management accuracy
This change was made for #2255, but the issue creator never confirmed if it resolved the issue.

This *does* better reflect what Nintendo's pm does, though, so I'm going to commit it regardless.
2024-01-20 13:09:04 -07:00
Michael Scire
fc16f28d0c settings: support PortugueseBr (closes #2264) 2024-01-08 12:20:53 -07:00
Michael Scire
e09ba765a1 kern: fix various comment/style hygiene issues (thanks @liamwhite) 2023-12-27 23:24:35 -07:00
Michael Scire
3217df147e kern: allow ktrace map capability when ktrace is disabled 2023-12-27 23:17:52 -07:00
Michael Scire
1fa41c3e2a loader/ro: abort if patching would go out of bounds 2023-12-27 23:05:10 -07:00
Michael Scire
db3dc4ebd2 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "bfc558348"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "bfc558348"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-11-28 13:02:32 -07:00
Michael Scire
742fd16080 sf: fix ipc serialization bug (out object id offsets) 2023-11-28 12:54:00 -07:00
Michael Scire
812b2aeb4c git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "d7a02b6ca"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "d7a02b6ca"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-11-16 16:25:52 -07:00
Michael Scire
46a4357882 fusee: remove ips patch parsing from sd filesystem
Parsing the SD fs is very slow. In addition, the only KIPs are either a) atmosphere modules, or b) FS.

The IPS subsystem was originally designed to make nogc/etc patches work for FS,
but these are now internal, and it appears that the literal only kip patches
that exist are for piracy.

It just doesn't make sense to slow down boot for every normal user for a feature
that has no actual usecase, and especially when fusee is already so minimal.
2023-11-13 12:45:00 -07:00
Michael Scire
872c18c501 kern: fix some comment typos 2023-11-01 10:25:31 -07:00
Michael Scire
afc0e14556 kern/svc: fix query/insecure names 2023-11-01 10:24:13 -07:00
Michael Scire
f7bf379cfe git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "80bf6aeee"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "80bf6aeee"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-10-27 16:22:45 -07:00
Michael Scire
9f26419b1a ams: bump version to 1.6.2, add changelog 2023-10-27 16:21:57 -07:00
Michael Scire
1b057d48c6 sm: fix compat with new service macros 2023-10-26 14:44:45 -07:00
Michael Scire
0c3afff4d3 pm: update to reflect 17.0.0 internal design changes 2023-10-26 14:44:32 -07:00
Michael Scire
274f6b63f2 erpt: add remaining SubmitFsInfo helpers 2023-10-25 16:08:12 -07:00
Michael Scire
2ed8450446 erpt: SubmitFileSystemProxyErrorInfo 2023-10-25 14:21:27 -07:00
Michael Scire
60974a5f4e erpt: GetMmcErrorInfo, GetSdCard*Info 2023-10-25 12:41:18 -07:00
Michael Scire
fa384fd920 erpt: begin SubmitFsinfo (SubmitMmcDetailInfo) 2023-10-25 04:45:41 -07:00
Michael Scire
3f19db0d96 jpegdec: fix abort check on output width 2023-10-18 02:33:59 -07:00
Michael Scire
a84f725e21 jpegdec: update to reflect 17.0.0 changes 2023-10-18 02:31:26 -07:00
Michael Scire
7f61dfdb8d pm: since 15.0.0, WaitApplicationMemoryAvailable is more lenient 2023-10-17 11:25:35 -07:00
Michael Scire
c44da84869 pm: adjust resource limit function names 2023-10-17 11:10:09 -07:00
Liam
7f4450f930 haze: pretend to be able to write MTP server code 2023-10-16 17:31:09 -04:00
Michael Scire
edb4e2ea56 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "965e05b3c"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "965e05b3c"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-10-16 12:31:15 -07:00
Michael Scire
183f3e0d7e ams: bump version to 1.6.1 2023-10-16 12:30:35 -07:00
Michael Scire
7650c5eb96 docs: add changelog for 1.6.1 2023-10-16 12:30:18 -07:00
Liam
0ff197b300 haze: fix bMaxPacketSize0 2023-10-16 08:36:33 -07:00
Liam
d9fff85bc4 haze: use gpu console for rendering 2023-10-16 08:36:10 -07:00
Liam
c866c15856 haze: implement GetObjectPropList 2023-10-16 08:36:10 -07:00
Michael Scire
e8ac23e2ee ncm: fix two comments 2023-10-16 08:24:07 -07:00
Michael Scire
3a8cffef57 ncm: better detect + fix 17 brick after-the-fact
This adds detection for missing-save or empty-save, and rebuilds in either case.
2023-10-16 02:38:30 -07:00
Liam
13411902c9 fs: add missing stub for GetProgramId 2023-10-14 07:52:47 -07:00
Michael Scire
693fb423cb kern: fix minor sin 2023-10-12 14:25:17 -07:00
Michael Scire
8a9eb85e05 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "132558c33"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "132558c33"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-10-12 09:23:31 -07:00
Michael Scire
d389ef639e docs: add changelog for 1.6.0 2023-10-12 09:19:26 -07:00
Michael Scire
719858ad18 git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "9513a5412"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "9513a5412"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-10-12 09:02:30 -07:00
Michael Scire
e4d08ae0c5 erpt: amend min-version for latest CreateReportWithAttachments 2023-10-12 08:55:58 -07:00
Michael Scire
0c063db926 loader: add usb3 patches for 17.0.0 2023-10-12 08:55:58 -07:00
Michael Scire
02e987819b ncm: work around change in Nintendo save handling behavior
Static save files do not require an entry in the save data indexer to mount.
Prior to 17.0.0, save data files were considered static if userid was 0.
In 17.0.0+, only 8000000000000000 is static.

However, some users using cfw do not have an entry for 8000000000000120 in the indexer,
for various reasons (but mostly manual nand-restore, I think). Thus, on boot of 17.0.0+,
FS will say 8000000000000120 is not present (not in indexer), and NCM will create it anew.

The 8000000000000120 save will then be empty, and then the firmware can't boot.

To workaround this, logic has been re-enabled on 17.0.0+ for building the content meta database.
Thus, if the user encounters this error, the 8000000000000120 save will be emptied, but then
it will be automatically reconstructed, fixing the problem.
2023-10-12 08:55:58 -07:00
Michael Scire
2ec3e141c7 bpc.mitm/exo: support pmic reboot/shutdown on mariko (thanks @CTCaer) 2023-10-12 08:55:58 -07:00
Michael Scire
71d0274884 erpt: remove deprecated fields, they didn't actually change IDs, just the mapping between id and name table index 2023-10-12 08:55:58 -07:00
Michael Scire
05259b7519 emummc: fix offsets for 17.0.0 2023-10-12 08:55:58 -07:00
Michael Scire
59a24fa646 fusee: support parsing 17.0.0+ INI 2023-10-12 08:55:58 -07:00
Michael Scire
f5b2eab4a8 exo: fix up new titlekey option extents 2023-10-12 08:55:58 -07:00
Michael Scire
e96e1063e2 jpegdec: stop bundling (TODO post-prerelease) 2023-10-12 08:55:58 -07:00
Michael Scire
aa170a72a9 erpt: Add basic (TODO-impl post-prerelease) support for 17.0.0 changes 2023-10-12 08:55:58 -07:00
Michael Scire
9d4cb685a7 fs: update OpenCodeFileSystem abi for 17.0.0 2023-10-12 08:55:58 -07:00
Michael Scire
c95741142e ncm: update for new 17.0.0 apis 2023-10-12 08:55:58 -07:00
Michael Scire
ef9b111bbf emummc: update for 17.0.0 2023-10-12 08:55:58 -07:00
Michael Scire
114b82284d exo/spl: Add new EsCommonKeyType 2023-10-12 08:55:58 -07:00
Michael Scire
c5d7ca5159 fusee/exo: implement the usual changes for new firmware support 2023-10-12 08:55:58 -07:00
Michael Scire
6d0bf70783 kern: fix assert usage in process load 2023-10-12 08:55:58 -07:00
Michael Scire
aba6ca7329 kern: bump supported version to 17.x 2023-10-12 08:55:58 -07:00
Michael Scire
06a840e550 kern: fix operation type enum-value whoops 2023-10-12 08:55:58 -07:00
Michael Scire
11c02e22e0 kern: implement support for applying relr relocations 2023-10-12 08:55:58 -07:00
Michael Scire
f93aea4c06 kern: split Process/Thread exit to separate WorkerTaskManagers 2023-10-12 08:55:58 -07:00
Michael Scire
4ddfb6183c kern: split out GetInstructionDataUserMode in exception handler 2023-10-12 08:55:58 -07:00
Michael Scire
3737151a2f kern: Add special-case for InvalidateProcessDataCache on current process 2023-10-12 08:55:58 -07:00
Michael Scire
2a4d68f916 kern: KPageTable: remove MapFirst operation, replace with MapFirstGroup 2023-10-12 08:55:58 -07:00
Michael Scire
7b523cfc8d kern: note OnFinalize calls in KPageTable::Finalize 2023-10-12 08:55:58 -07:00
Michael Scire
39a95d4023 kern: implement new default application system resource field in KProcess 2023-10-12 08:55:58 -07:00
Michael Scire
2c5002ce50 kern: update KMemoryRegionType values for new ids + SecureUnknown region 2023-10-12 08:55:58 -07:00
Michael Scire
b7384a8667 kern: KSupervisorPageTable now checks wxn instead of setting it 2023-10-12 08:55:58 -07:00
Michael Scire
85b5f20395 kern: KPageTable::Initialize no longer takes unused process id 2023-10-12 08:55:58 -07:00
Michael Scire
ad5bd81d3f kern: implement PermissionLock, update KPageTableBase attribute/alignment checks 2023-10-12 08:55:58 -07:00
Michael Scire
777b6d285c kern: KPageTableBase::CheckMemoryState now invokes a helper 2023-10-12 08:55:58 -07:00
Michael Scire
ae2c25e9c8 kern: update KMemoryState, remove bijection (separate IoRegister/IoMemory) 2023-10-12 08:55:58 -07:00
Michael Scire
3b8f65d502 kern: update initial process load logic to do per-segment mapping/decompression 2023-10-12 08:55:58 -07:00
Michael Scire
cfd2d5b012 kern: clear new pages in init page allocator, not init page table 2023-10-12 08:55:58 -07:00
Michael Scire
c72ba35684 kern: add speculation barriers after eret 2023-10-12 08:55:58 -07:00
Michael Scire
ec96203cb7 kern: remove unnecessary fields from InitArgs (0x80 -> 0x40) 2023-10-12 08:55:58 -07:00
Michael Scire
1491a7b159 kern: on second thought, move vectors back to end of text 2023-10-12 08:55:58 -07:00
Michael Scire
0daef4a6e8 kern/ldr: move crt0 into .rodata 2023-10-12 08:55:58 -07:00
Michael Scire
4ca3c44e5f kern: pass ini1 size from loader to kernel, remove slab memset from init0 2023-10-12 08:55:58 -07:00
Michael Scire
add4b3fdc3 utils: update erpt script 2023-10-12 08:55:58 -07:00
Liam
159f8d384b dmnt.gen2: enable attach to arbitrary program id 2023-10-11 19:50:09 -07:00
Liam
92a8c8eb88 haze: implement android operations 2023-10-11 18:57:49 -07:00
Liam
9e0daff46e haze: split operations by type 2023-10-11 18:57:49 -07:00
Liam
6b72dbd22d haze: refactor constant use for cleaner separation 2023-10-11 18:57:49 -07:00
Michael Scire
ba91f070e8 mesosphere: remove nostartfiles from specs files (should only be passed to linker wrapper) 2023-09-17 09:33:56 -07:00
Michael Scire
4fe9a89ab8 docs: commit saddest changelog of all time, this is your brain on going to vacation 2023-08-21 17:30:06 -07:00
Michael Scire
de73f6c5bb git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "c3dc418a2"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "c3dc418a2"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-08-21 17:27:16 -07:00
Michael Scire
e488b6ee47 ams: add enum recognition for 16.1.0 2023-08-21 17:26:27 -07:00
Michael Scire
99810dc091 fssystem: fix typo error in BucketTree::Visitor::MoveNext 2023-08-15 14:47:09 -07:00
Liam
e54957285f libstrat: comment fixes for fssystem 2023-08-12 11:33:29 -07:00
Michael Scire
fca213460b libstrat: fix more minor style issues pointed out by Pharynx 2023-08-10 11:48:28 -07:00
Michael Scire
4e6bd19fcd fssystem: fix stupid issue in NodeBuffer move-ctor
Code compiles with this constructor deleted, so it wasn't used, but even so...
2023-08-03 16:58:55 -07:00
Michael Scire
8b88351cb4 mitm: fix errant include on non-hos 2023-06-06 19:32:06 -07:00
Michael Scire
63ea152349 fatal: take good idea from shrek 2023-05-19 11:47:38 -07:00
Michael Scire
3cb54e2b4b git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "f4a966eb4"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "f4a966eb4"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-05-14 03:17:20 -07:00
Michael Scire
e9de11a746 ams: bump version to 1.5.4 2023-05-14 03:16:27 -07:00
Michael Scire
b979b5aa36 docs: 1.5.4 changelog, zelda why the fuck 2023-05-14 03:16:15 -07:00
SciresM
f2ee44da74
romfs/ams.mitm/pm: refactor to dynamically steal heap for certain games. (#2122)
* fs.mitm: skeleton the use of special allocation in romfs build

* pm: add api for ams.mitm to steal application memory

* pm/mitm: okay, that api won't work, try a different one

* romfs: revert memory usage increases; we'll handle torture games case-by-case.

* pm/romfs: first (broken?) pass at dynamic heap.

I cannot wait to figure out all the ways this is wrong.

* Release the dynamic heap a little more eagerly

* romfs: animal crossing is also not a nice game

* romfs: fix issues in close-during-build

* romfs: zelda is a blight upon this earth
2023-05-14 03:06:52 -07:00
Michael Scire
85c23b5781 fusee: actually identify new FS 2023-05-08 18:38:13 -07:00
Michael Scire
8e042f2262 git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "30205111e"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "30205111e"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-05-08 18:25:25 -07:00
Michael Scire
81e9154a52 emummc: add enums for 16.0.3 2023-05-08 18:24:49 -07:00
Michael Scire
e9b9dbc2aa docs: add changelog for 1.5.3 2023-05-08 18:19:31 -07:00
Michael Scire
7e6c849ca4 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "cd0fc2c1d"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "cd0fc2c1d"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-05-08 18:06:50 -07:00
Michael Scire
8ec7c096d0 git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "d2fcc73eb"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "d2fcc73eb"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-05-08 18:05:36 -07:00
Michael Scire
6e5b901a9b emummc: support 16.0.3 2023-05-08 18:03:35 -07:00
Michael Scire
b800953d66 ams: recognize 16.0.3('s FS) 2023-05-08 17:51:13 -07:00
Michael Scire
f0240db75a fs.mitm: mitm glue for font replacement, before I forget 2023-05-08 17:40:10 -07:00
Michael Scire
1f5ec68a5c ams: fix compilation with gcc 13 2023-05-07 03:36:46 -07:00
Michael Scire
ed9e60acb9 kern: track heap in KPageTableBase::MemoryRange 2023-04-30 16:50:53 -07:00
Liam
a7300b0fa4 haze: fix file size transmission issue 2023-04-18 22:15:48 -07:00
Liam
8e2eca2004 haze: abstract firmware version and serial number fetch 2023-04-18 22:15:48 -07:00
Michael Scire
9f83b3c838 ams: I really need to automate keeping this in sync 2023-04-17 20:57:57 -07:00
Michael Scire
434c8cefc4 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "ecc8b1811"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "ecc8b1811"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-04-17 20:40:41 -07:00
Michael Scire
d8aed7de6d ams: add 16.0.2 enum 2023-04-17 20:40:02 -07:00
Liam
a346014dc7 haze: get serial number and firmware version from set:sys 2023-04-17 22:22:28 -04:00
Michael Scire
4b3c801e9f dist: add haze to output zip 2023-04-17 14:35:25 -07:00
Michael Scire
90db1223f6 docs: avoid unintended insinuations 2023-04-17 14:24:27 -07:00
Michael Scire
fa64a6ff4d docs: pretend to be literate 2023-04-17 14:20:16 -07:00
Michael Scire
0c6a06a0cf git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "7340e2eab"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "7340e2eab"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-04-17 14:19:59 -07:00
Michael Scire
5efb4a2a98 docs: bump version, 16.0.1 exists too 2023-04-17 14:19:18 -07:00
liamwhite
3b662122f9
troposphere: add haze MTP server (#2095)
* troposphere: add haze MTP server

* haze: adjust banner, new lines between class sections, single-statement if

* haze: remove additional newlines between sections

* haze: avoid use of reference out parameter

* haze: console_main_loop: style

* haze: event_reactor, file_system_proxy, ptp: style

* haze: ptp_data_builder, ptp_object_database, ptp_object_heap, results, usb_session: style

* haze: event_reactor, ptp_data_parser, async_usb_server, ptp_object_database, ptp_object_heap: style

* haze: ptp_responder: style

* haze: usb_session: style

* haze: use svc defs from vapours

* haze: misc comments

* haze: fix pointer overflow check

* haze: fix copy paste error

* haze: use alignment, invalidate cached use values in console

* haze: fix stray hex constant

* haze: misc style

* haze: fixes for windows

* haze: add GetObjectPropsSupported, GetObjectPropDesc, GetObjectPropValue

* haze: add SetObjectPropValue

* haze: improve object database API

* haze: improve WriteVariableLengthData readability

* haze: fix directory renames on windows

* haze: ptp_object_database: fix collation

* haze: event_reactor: fix size validation

* haze: ptp_responder: improve documentation

* haze: ptp_responder: avoid unnecessary fs interaction in GetObjectPropValue

* haze: ptp_responder: fix object deletion on windows

* haze: tear down sessions on suspension

* haze: prefer more specific data types

* haze: misc

* haze: fix usb 3.0 support

* haze: improve host-to-device file transfer performance

* haze: report device serial

* haze: move static_assert to requires, fix alignment
2023-04-17 14:08:05 -07:00
Michael Scire
e9b28ab4b1 kern: adjust wording to be more technically correct 2023-03-27 10:54:58 -07:00
Michael Scire
1afb184c14 docs: pretend I know how to type common words 2023-03-14 01:52:06 -07:00
Michael Scire
5e070600a9 docs: add faq.md
"Alexa, what does June 15th mean?"
2023-03-14 01:48:19 -07:00
Michael Scire
8274081e39 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "b1607dc8a"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "b1607dc8a"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-03-13 17:17:50 -07:00
Michael Scire
f1ad26ce84 ams: bump version 2023-03-13 17:16:51 -07:00
Michael Scire
e4c314146e docs: update changelog 2023-03-13 17:16:33 -07:00
Michael Scire
52f00731d9 settings: add os guard 2023-03-12 22:34:23 -07:00
Michael Scire
476d658a79 ams: allow convertible-to-result in abort print macros 2023-03-11 15:14:33 -07:00
Michael Scire
7263022bac docs: mention bluetooth db feature 2023-03-10 10:24:19 -07:00
Michael Scire
e0e7aa1e2f set.mitm: misc style fixes for bluetooth db 2023-03-10 10:19:58 -07:00
ndeadly
bd9d8fff46
Add system setting to mirror bluetooth pairing database to sd card (#1787)
* ams_mitm: add ability to mirror bluetooth device pairing database to sd card via a system setting

* ams_mitm: address requested stylistic changes

* ams_mitm: make use of R_SUCCEED macro

* ams_mitm: use settings::BluetoothDevicesSettings instead of libnx type

* ams_mitm: fix logic error when truncating pairing database on read

* Update .ini comment

* ams_mitm: missing R_TRY around call to fs::FlushFile

* stratosphere: remove union from BluetoothDevicesSettings type

---------

Co-authored-by: ndeadly <24677491+ndeadly@users.noreply.github.com>
2023-03-10 10:06:38 -07:00
Michael Scire
61e3f0b391 windows: disable -fdata-sections
This causes all data to be emitted as .data$*. This breaks fzero-initialized-in-bss,
because linker puts stuff in .data even when it's all-zero and should end up in .bss.
2023-03-09 23:46:54 -07:00
Michael Scire
cd9b173318 windows: re-enable lto for os/fs libraries 2023-03-09 23:46:31 -07:00
Michael Scire
a8df400825 kern: fix stray addressof operator 2023-03-08 09:46:38 -07:00
Michael Scire
68040e2922 windows: add brave new mingw compat hook for gcc 12.2.0+ 2023-03-07 22:07:03 -07:00
Michael Scire
8da4d14e15 kern: minor cleanup (thanks @liamwhite) 2023-03-06 21:18:00 -07:00
Michael Scire
e2ebf9c0ff fatal: correct comment about pools 2023-03-01 03:21:51 -07:00
Michael Scire
5fb6f52b9e fatal: dynamically allocate memory as required (preferring system > nonsecure > unsafe) 2023-03-01 03:20:49 -07:00
Michael Scire
982389dceb os: add UnsafeMemory apis 2023-03-01 03:20:49 -07:00
Adubbz
f636596ee2 daybreak: scale title font size
(cherry picked from commit 035b37c615183bd387210a54d269346e3a9b379a)
2023-02-25 10:53:16 +11:00
Michael Scire
0a2440522f fatal: use a hack to be kinder wrt pl:u session limit 2023-02-23 22:06:49 -07:00
Michael Scire
3292ea5970 kern: fix stray comment copy/paste error 2023-02-23 22:00:00 -07:00
Michael Scire
33d42f4831 erpt: update server code for 16.0.0 logic changes 2023-02-23 21:51:51 -07:00
Michael Scire
46094cfb3e kern: increase non-dynamic heap sizes to 8 GB to match 2023-02-23 19:05:52 -07:00
Michael Scire
618691a500 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "af0d00890"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "af0d00890"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-02-23 09:01:41 -07:00
Michael Scire
356d89244f docs: add 1.5.0 pre-release changelog 2023-02-22 18:36:01 -07:00
Michael Scire
1ce3611695 git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "bba1f1fb6"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "bba1f1fb6"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-02-22 18:26:15 -07:00
Michael Scire
1ab8b23444 emummc: try fixing commit id 2023-02-22 18:25:41 -07:00
Michael Scire
06b4738d54 emummc: re-update for 16.0.0 2023-02-22 18:24:51 -07:00
Michael Scire
b92c614347 git subrepo clone --force --branch=develop https://github.com/m4xw/emummc
subrepo:
  subdir:   "emummc"
  merged:   "4714b2df9"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "4714b2df9"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-02-22 18:23:27 -07:00
Michael Scire
99175c1149 loader: update usb3 patches for 16.0.0 2023-02-22 17:19:51 -08:00
Michael Scire
8876eedfb0 ncm: alignment was changed for PlaceHolderId/ContentId in 16.0.0 2023-02-22 17:19:51 -08:00
Michael Scire
bbcee8c77c ncm: fix inversion in activation skipping 2023-02-22 17:19:51 -08:00
Michael Scire
f7915c2c05 ncm: Add IntegratedContent*Impl 2023-02-22 17:19:51 -08:00
Michael Scire
668cabd4a2 ncm: first pass at ContentManagerImpl refactor (missing the IntegratedImpls, won't link) 2023-02-22 17:19:51 -08:00
Michael Scire
d64ab354ad kern: 16.x web applet crashes on exit with 48 MB stolen (rip) 2023-02-22 17:19:51 -08:00
Michael Scire
59b518783d ncm: fix copy/paste error in switch case 2023-02-22 17:19:51 -08:00
Michael Scire
6462101b6f strat: fix sysmodule building, bump version so I don't forget later 2023-02-22 17:19:51 -08:00
Michael Scire
0ea5dbcfbb libstrat: make build with new ncm/fs api changes (sysmodules probably fail to build) 2023-02-22 17:19:51 -08:00
Michael Scire
bb6446aada erpt: update for new ids 2023-02-22 17:19:51 -08:00
Michael Scire
e46e7e0eb1 boot2: update for 16.0.0 2023-02-22 17:19:51 -08:00
Michael Scire
cb89c66bd8 emummc: update for 16.0.0 2023-02-22 17:19:51 -08:00
Michael Scire
e85a512cf4 fusee/exo: implement the usual changes for new firmware support 2023-02-22 17:19:51 -08:00
Michael Scire
7d9fea01c3 kern: bump supported version to 16.x 2023-02-22 17:19:51 -08:00
Michael Scire
406320f6ec kern: better divide non-secure size, don't waste fatal memory unless necessary 2023-02-22 17:19:51 -08:00
Michael Scire
aad2be0a01 kern: delete creation time field from KProcess 2023-02-22 17:19:51 -08:00
Michael Scire
25383db524 kern: add InfoType_IoRegionHint 2023-02-22 17:19:51 -08:00
Michael Scire
48f4c526f3 kern: refactor priority inheritance to represent locks as C++ objects 2023-02-22 17:19:51 -08:00
Michael Scire
1279d236f3 kern: remove unnecessary interrupt disables from arbiter/condvar 2023-02-22 17:19:51 -08:00
Michael Scire
008eb974d4 kern: KConditionVariable::SignalToAddress now emits dmb before userspace write 2023-02-22 17:19:51 -08:00
Michael Scire
035cebef9d kern: refactor init (kill identity map, merge cpu on logic) 2023-02-22 17:19:51 -08:00
Michael Scire
8db22967bf kern: use variable-count parameter arrays for DebugEvents 2023-02-22 17:19:51 -08:00
Michael Scire
db510f96c3 kern: update KSystemControl::InitializePhase1, dynamically scale 39-bit address space regions 2023-02-22 17:19:51 -08:00
Michael Scire
6e2dd791b2 kern: update for new ChangePermissions page table operation 2023-02-22 17:19:51 -08:00
Michael Scire
bff61c68ab kern: adjust pool allocations 2023-02-22 17:19:51 -08:00
Michael Scire
ca7734ffaf kern: simplify KSchedulerLock::Lock 2023-02-22 17:19:51 -08:00
Michael Scire
ed22f802ee kern: allow QueryIoMapping to find Static mappings 2023-02-22 17:19:51 -08:00
Michael Scire
8ffc177b44 kern: update UnmapIoRegion for new Mapping_Memory handling 2023-02-22 17:19:51 -08:00
Michael Scire
c058376b3b kern: use tree for IoPool regions instead of list 2023-02-22 17:19:51 -08:00
Michael Scire
d5ebf13094 kern: optimize userspace access asm to use cheaper instruction in io memory loops 2023-02-22 17:19:51 -08:00
Michael Scire
695c125721 kern: use different psr masks for 64 and 32-bit El0 threads 2023-02-22 17:19:51 -08:00
Michael Scire
e7e3e7b374 kern: increase stack parameter size by 0x10 2023-02-22 17:19:51 -08:00
Michael Scire
3a5f406c5f kern: update scheduler for new switch count tracking logic 2023-02-21 03:12:17 -07:00
Michael Scire
8176f085f1 gpio: really not sure how this works before, lol 2023-01-30 23:13:45 -07:00
Michael Scire
7a69f2f062 kern/pm: only steal 8 MB from applet.
WebApplet crashes on exit with 16 more MB stolen, apparently.
2023-01-24 19:54:28 -07:00
Michael Scire
32b590e7ab git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "b7711b8fb"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "b7711b8fb"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-01-24 14:39:54 -07:00
Michael Scire
590f22933d docs/ams: bump version to 1.4.1 2023-01-24 14:39:06 -07:00
Michael Scire
0dd071b279 romfs: thank you fire emblem, very cool (closes #2021) 2023-01-24 14:07:50 -07:00
Michael Scire
f1132fbf5a romfs: push clobber fix missed by git add 2023-01-24 14:03:54 -07:00
Michael Scire
9cd57b6c61 romfs: reduce peak allocation sizes by enabling intermediate context frees 2023-01-24 14:02:05 -07:00
0x8ff
bf66e40a7b Update ReSwitched Team URL
reswitched.team is a dead domain no longer owned by the ReSwitched Team
2023-01-20 19:01:33 -08:00
Michael Scire
77cc53227a sdmmc: fix wrong mode select for GcAsic(Fpga)Speed 2023-01-19 21:47:19 -07:00
Michael Scire
59a295db79 sdmmc: fix missing call to GetSdStatus at non-uhsi mode 2023-01-19 21:44:44 -07:00
Michael Scire
e4b9930bf3 kern: fix unnecessarily strong load in aligned spinlock
Copy-paste error I didn't notice for two years, whoops
2022-12-25 01:56:31 -07:00
Michael Scire
04c9004e05 erpt: fix multiple issues with automatic report cleanup (thanks @yellows8)
* Setting retrieval was performed before the call that used the setting.
* Call to detect number of files passed incomplete path and was guaranteed to fail.
* Call to delete reports passed incomplete path and was guaranteed to do nothing.
2022-12-13 01:08:13 -07:00
Michael Scire
1f8798ace7 kern: fix GetProcessId wrong result on invalid parameter 2022-12-04 13:40:44 -07:00
Michael Scire
ff7a80e592 dmnt: allow string termination to end a toggle (closes #1980) 2022-10-28 14:14:38 -07:00
Michael Scire
e3ace4be15 exo: fix MemoryArrange enum typo 2022-10-19 15:18:08 -07:00
Michael Scire
36a33617a4 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "b2232894f"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "b2232894f"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-10-18 11:11:09 -07:00
Michael Scire
8ce4f19615 ncm: update enums, refactor comparison operators 2022-10-18 11:10:17 -07:00
Michael Scire
05fee5d53c fusee: fix 15.x exFAT nogc patch 2022-10-16 15:45:47 -07:00
Michael Scire
f88606fbc1 gdbstub: fix reading module name for homebrew 2022-10-15 15:13:05 -07:00
Michael Scire
e580c3970c git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "363fba0cf"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "363fba0cf"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-10-12 09:16:51 -07:00
Michael Scire
2603136e8b ams: add changelog for 1.4.0 2022-10-12 09:15:16 -07:00
Michael Scire
3d3f8629af loader: update usb3 enable patches for 15.0.0 2022-10-12 09:15:16 -07:00
Michael Scire
d178ea368a lr: new AOC commands use MapAlias for paths... 2022-10-12 09:15:16 -07:00
Michael Scire
b444385762 git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "4714b2df9"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "4714b2df9"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-10-12 09:15:16 -07:00
Michael Scire
0c3f1bed33 emummc: update for 15.0.0 2022-10-12 09:15:16 -07:00
Michael Scire
bf4fdf6188 kern: update for new exception flag semantics 2022-10-12 09:15:16 -07:00
Michael Scire
13238fc4fd kern: use slab allocated KSessionRequest dynamic mappings 2022-10-12 09:15:16 -07:00
Michael Scire
e7a1e0fee2 kern: implement Svc(Un)MapInsecureMemory 2022-10-12 09:15:16 -07:00
Michael Scire
5a918f3bc9 kern: move SecureAppletMemory/KPageBuffer heap into the ResourceRegion 2022-10-12 09:15:16 -07:00
Michael Scire
ea82889e6c kern: increase stack region size when thread resource limit is increased 2022-10-12 09:15:16 -07:00
Michael Scire
7f2cbba543 kern: Implement new PageTable operations/PhysicalMemory reference semantics 2022-10-12 09:15:16 -07:00
Michael Scire
5ee7d8a5ed kern: update for new device map semantics 2022-10-12 09:15:16 -07:00
Michael Scire
947fdcf6f6 kern: merge/simplify KInterruptEventTask into KInterruptEvent 2022-10-12 09:15:16 -07:00
Michael Scire
2e73f33eb0 kern: implement K(Secure)SystemResource 2022-10-12 09:15:16 -07:00
Michael Scire
752704a798 kern: update handle table init 2022-10-12 09:15:16 -07:00
Michael Scire
d00406e089 os: update os namespace for 15.0.0, loader/ro: update to use csrng, spl: bump max sessions 2022-10-12 09:15:16 -07:00
Michael Scire
dddb5bfdea boot2: launch new eth sysmodule after bsdsockets 2022-10-12 09:15:16 -07:00
Michael Scire
ed0572bd53 erpt: update IDs for 15.0.0 2022-10-12 09:15:16 -07:00
Michael Scire
b3bbc99cfb ams.mitm: fix up ContentInfo construction 2022-10-12 09:15:16 -07:00
Michael Scire
0ebbbc839f fusee/exo: fix up dram id names/mappings 2022-10-12 09:15:16 -07:00
hexkyz
275c0234cb exo: add new dram ids 2022-10-12 09:15:16 -07:00
Michael Scire
427130a122 ncm: update for new add on content/attr changes 2022-10-12 09:15:16 -07:00
hexkyz
ef07964ea0 fusee: update sdram handling for 15.0.0 2022-10-12 09:15:16 -07:00
Michael Scire
e1aff401ba lr: add support for location resolver disable commands 2022-10-12 09:15:16 -07:00
Michael Scire
05de5538d6 ncm: GetContentAccessibilities, GetContentInfo* 2022-10-12 09:15:16 -07:00
Michael Scire
9929517a83 fusee/exo: enum support for 15.0.0 2022-10-12 09:15:16 -07:00
Michael Scire
545765d167 ams/fuse: update version numbers, update DramId read logic 2022-10-12 09:15:16 -07:00
Michael Scire
8d9e3f2a31 boot: fix ChargerDriver inititalization correctness (thanks @CTCaer) 2022-09-16 15:34:38 -07:00
Michael Scire
28f0940c58 diag: fix process name cache 2022-08-11 14:19:26 -07:00
Michael Scire
d954e85826 fs/emummc: fix DirectoryRedirectionFileSystem not stripping prefix 2022-08-06 08:48:51 -07:00
Michael Scire
7e6b369605 ns.mitm/fs.mitm: allow program specific web override for non-hbl, if present 2022-07-25 16:24:57 -07:00
Liam
e702eab21c KScheduler: fix documentation mistakes 2022-06-29 17:28:26 -07:00
Liam
592b9c66d1 gdbstub: report architecture tag for ARM targets 2022-06-29 17:28:03 -07:00
Michael Scire
8e17feff94 os: pthread_yield is deprecated, don't use it on linux 2022-06-27 15:36:04 -07:00
Michael Scire
6514e365ad gdbstub: fix threads with invalid characters for packets (closes #1904) 2022-06-16 00:11:44 -07:00
Michael Scire
efa4a346af os: silence warning building with gcc 12 on windows 2022-06-12 01:38:04 -07:00
Michael Scire
d75f9bbedf fs: add extension GetEntryList to AesCtrCounterExtendedStorage 2022-06-11 16:54:02 -07:00
Michael Scire
ea7f51a279 os: fix whoops in SetMemoryPermission on windows 2022-06-11 00:58:14 -07:00
Michael Scire
a65b6df8d2 os: implement MemoryHeapManager, SetMemoryAttribute 2022-06-10 22:36:03 -07:00
Michael Scire
4e112de223 dmnt.gen2: fix gt, optimize 2022-06-08 00:49:47 -07:00
Michael Scire
20d200471d kern: optimize postfix-compare to prefix-compare, result logic is identical but breaks earlier in some paths 2022-06-07 23:49:31 -07:00
Michael Scire
5f2d713fe4 kern: mea culpa (some time since 7.x) 2022-06-07 23:40:32 -07:00
Michael Scire
114d2598da dmnt.gen2: sanitize brackets in thread names to be valid xml 2022-06-07 22:03:37 -07:00
Michael Scire
36bdb83cfc util: prevent optimizer from removing endian-swapped writes 2022-06-05 22:57:18 -07:00
Michael Scire
a975689c59 ams: address some warnings when building with gcc-12 2022-06-05 22:57:08 -07:00
Michael Scire
a809e23320 lr: update capacity constants to reflect 12.0.0 changes 2022-05-26 18:44:12 -07:00
Michael Scire
4db485083b strat: update for code changes found in boot (closes #1797) 2022-05-05 17:45:55 -07:00
Michael Scire
e96972c939 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "b91294d3b"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "b91294d3b"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-04-29 16:15:06 -07:00
Michael Scire
3545c0aac2 ams: fs accuracy fixes, bump to 1.3.2 2022-04-29 16:14:01 -07:00
Michael Scire
d85875b910 os: fix various regressions since 1.3.1 2022-04-29 15:46:55 -07:00
Michael Scire
b1367942a2 os: fix minor bug (and simplify) MapProcessCodeMemory 2022-04-18 01:43:49 -07:00
Michael Scire
c2c0a2e169 ro/os: use os primitives for MapProcessCodeMemory 2022-04-18 01:39:22 -07:00
Michael Scire
f5052b4bca loader: update for changes in 14.0.0 2022-04-17 20:11:05 -07:00
Michael Scire
70d67bb115 loader: use os apis for interacting with process memory 2022-04-17 18:51:36 -07:00
Michael Scire
9056e0b05f strat: fix linux clang build 2022-04-17 14:01:03 -07:00
Michael Scire
895b6d0470 optional: add c++23 monadic interface 2022-04-17 12:17:25 -07:00
Michael Scire
dfba595cdc fs: fix null check in AesXtsStorageExternal 2022-04-16 12:28:40 -07:00
Michael Scire
175a34da43 os: silence a maybe-uninit warning 2022-04-16 12:28:21 -07:00
Michael Scire
02b126c2be os: refactor multi wait apis to better match Nintendo's latest implementation 2022-04-12 16:47:36 -07:00
Michael Scire
b45671fd35 fs: QueryEntry uses NonSecure buffers 2022-04-08 11:23:39 -07:00
Michael Scire
106599895d fs: fix memory leak when path is reallocated (closes #1842) 2022-04-08 11:02:17 -07:00
Michael Scire
80154b0a54 os: broadcast, not signal, on release more than 1 sema 2022-04-07 12:17:13 -07:00
Michael Scire
62eb4d6989 docs: add changelog for 1.3.1 2022-04-04 17:48:18 -07:00
Michael Scire
b52e44e798 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "590cdaf02"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "590cdaf02"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-04-04 17:47:56 -07:00
Michael Scire
72baa4ff18 ams: add enum recognition for 14.1.0 2022-04-04 17:44:56 -07:00
Michael Scire
442656899f util: update some bit utility logic 2022-04-03 10:51:46 -07:00
Michael Scire
d7f89a0c31 fs: update signature for VerifySign1 2022-04-01 21:06:26 -07:00
Michael Scire
2e6223d9d0 fssystem: add unique lock apis 2022-03-28 14:29:22 -07:00
Michael Scire
28f11a86fd fs: update romfs types 2022-03-28 13:57:06 -07:00
Michael Scire
a8b52dc123 fs: remove dead code 2022-03-28 08:37:08 -07:00
Michael Scire
9b47ddf01f fs: update LocalFileSystem 2022-03-28 01:33:40 -07:00
Michael Scire
0fbf007bcf fs: fixup all OperateRange implementations 2022-03-28 00:54:10 -07:00
Michael Scire
4ad8dad416 os: add DetachIoRegionHandle 2022-03-28 00:00:36 -07:00
Michael Scire
8e258bde9d util: LockFreeAtomicType (for time) 2022-03-27 20:15:10 -07:00
Michael Scire
c0d5140ef0 strat: add windows socket api, linux/macos TODO 2022-03-27 14:36:31 -07:00
Michael Scire
1bef1b58d4 fs: also update comment, for locking 2022-03-26 15:29:38 -07:00
Michael Scire
07cd682460 fs: fix inverted optional-lock condition 2022-03-26 15:28:40 -07:00
Michael Scire
e5c3d264ec fs: implement new 14.0.0 spl-ctr dispatch semantics 2022-03-26 15:21:12 -07:00
Michael Scire
bbf22b4c60 ams: globally prefer R_RETURN to return for ams::Result 2022-03-26 14:48:33 -07:00
Michael Scire
dd78ede99f ams: use R_SUCCEED, R_THROW globally 2022-03-26 00:14:36 -07:00
Michael Scire
e5b1739f65 fatal: yield our lbl session unless needed 2022-03-25 23:47:20 -07:00
Michael Scire
a4a2cc2218 fs: update IStorage::Check functions for 14.0.0 2022-03-25 23:29:36 -07:00
Michael Scire
5ffbed1bee fs: update a few loose missed results 2022-03-25 10:02:55 -07:00
Michael Scire
ec44eaa263 fs: update nca drivers (and dependents/callees) for 14.0.0 changes 2022-03-25 09:48:24 -07:00
Michael Scire
20e53fcd82 fs: update HashGeneratorFactorySelector to reflect 14.0.0 2022-03-24 21:57:37 -07:00
SciresM
64c6ef2de7
fs: reduce path size 0x28 -> 0x18
This implements two optimizations on fs::Path, which N added in 12.0.0.

The current structure looks like: 

```cpp
struct Path {
    const char *m_str; // Points to the read-only path string
    char *m_write_buffer_buffer; // Part of std::unique_ptr<char[], ams::fs::impl::Deleter>
    ams::fs::impl::Deleter m_write_buffer_deleter; // Parse of std::unique_ptr<char[], ams::fs::impl::Deleter>, stores the size of the buffer.
    size_t m_write_buffer_length; // Copy of the write buffer's size accessible to the Path() structure.
    bool m_is_normalized; // Whether the path buffer is normalized
};
```

This is pretty wasteful. The write buffer size is stored twice, wasting 8 bytes, because one copy of the size isn't accessible to the path.

In addition, due to alignment, the bool wastes 7 padding bytes.

This commit:

* Encodes normalized in the low bit of the write buffer length, saving 8 bytes.
* Use a custom WriteBuffer class rather than generic unique_ptr, to avoid needing to store the WriteBuffer twice.


These each save 8 bytes, for a final size of 0x18 rather than 0x28.
2022-03-24 20:22:47 -07:00
Michael Scire
817ad8f98d util: pointer traits only if <memory>/stratosphere 2022-03-24 18:24:19 -07:00
Michael Scire
dfa475a769 util: add pointer utils, use to constrain fs pointers 2022-03-24 16:21:03 -07:00
Michael Scire
141ae5c7ab fs: fix removed include 2022-03-24 13:31:49 -07:00
Michael Scire
4646581e93 fs: for my sanity, begin tracking version where code was last checked for accuracy 2022-03-24 08:43:40 -07:00
Michael Scire
b69fa13576 fatal: fix usage of removed bpc api in 14.0.0 2022-03-23 19:11:37 -07:00
1332 changed files with 35747 additions and 19327 deletions

View File

@ -3,7 +3,8 @@
===== =====
![License](https://img.shields.io/badge/License-GPLv2-blue.svg) ![License](https://img.shields.io/badge/License-GPLv2-blue.svg)
[![Chat on Discord](https://camo.githubusercontent.com/b4175720ede4f2621aa066ffbabb70ae30044679/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636861742d446973636f72642d627269676874677265656e2e737667)](https://discordapp.com/invite/ZdqEhed) [![Chat on Discord](https://img.shields.io/badge/Discord-5865f2?logo=discord&logoColor=white)](https://discordapp.com/invite/ZdqEhed)
![Made with Notepad++](img/np++.png?raw=true)
Atmosphère is a work-in-progress customized firmware for the Nintendo Switch. Atmosphère is a work-in-progress customized firmware for the Nintendo Switch.
@ -13,7 +14,6 @@ Components
Atmosphère consists of multiple components, each of which replaces/modifies a different component of the system: Atmosphère consists of multiple components, each of which replaces/modifies a different component of the system:
* Fusée: First-stage Loader, responsible for loading and validating stage 2 (custom TrustZone) plus package2 (Kernel/FIRM sysmodules), and patching them as needed. This replaces all functionality normally in Package1loader/NX Bootloader. * Fusée: First-stage Loader, responsible for loading and validating stage 2 (custom TrustZone) plus package2 (Kernel/FIRM sysmodules), and patching them as needed. This replaces all functionality normally in Package1loader/NX Bootloader.
* Sept: Payload used to enable support for runtime key derivation on 7.0.0.
* Exosphère: Customized TrustZone, to run a customized Secure Monitor * Exosphère: Customized TrustZone, to run a customized Secure Monitor
* Thermosphère: EL2 EmuNAND support, i.e. backing up and using virtualized/redirected NAND images * Thermosphère: EL2 EmuNAND support, i.e. backing up and using virtualized/redirected NAND images
* Stratosphère: Custom Sysmodule(s), both Rosalina style to extend the kernel/provide new features, and of the loader reimplementation style to hook important system actions * Stratosphère: Custom Sysmodule(s), both Rosalina style to extend the kernel/provide new features, and of the loader reimplementation style to hook important system actions
@ -27,7 +27,6 @@ This software is licensed under the terms of the GPLv2, with exemptions for spec
You can find a copy of the license in the [LICENSE file](LICENSE). You can find a copy of the license in the [LICENSE file](LICENSE).
Exemptions: Exemptions:
* The [yuzu Nintendo Switch emulator](https://github.com/yuzu-emu/yuzu) and the [Ryujinx Team and Contributors](https://github.com/orgs/Ryujinx) are exempt from GPLv2 licensing. They are permitted, each at their individual discretion, to instead license any source code authored for the Atmosphère project as either GPLv2 or later or the [MIT license](https://github.com/Atmosphere-NX/Atmosphere/blob/master/docs/licensing_exemptions/MIT_LICENSE). In doing so, they may alter, supplement, or entirely remove the copyright notice for each file they choose to relicense. Neither the Atmosphère project nor its individual contributors shall assert their moral rights against any of the aforementioned projects.
* [Nintendo](https://github.com/Nintendo) is exempt from GPLv2 licensing and may (at its option) instead license any source code authored for the Atmosphère project under the Zero-Clause BSD license. * [Nintendo](https://github.com/Nintendo) is exempt from GPLv2 licensing and may (at its option) instead license any source code authored for the Atmosphère project under the Zero-Clause BSD license.
Credits Credits
@ -38,7 +37,7 @@ In no particular order, we credit the following for their invaluable contributio
* __switchbrew__ for the [libnx](https://github.com/switchbrew/libnx) project and the extensive [documentation, research and tool development](http://switchbrew.org) pertaining to the Nintendo Switch. * __switchbrew__ for the [libnx](https://github.com/switchbrew/libnx) project and the extensive [documentation, research and tool development](http://switchbrew.org) pertaining to the Nintendo Switch.
* __devkitPro__ for the [devkitA64](https://devkitpro.org/) toolchain and libnx support. * __devkitPro__ for the [devkitA64](https://devkitpro.org/) toolchain and libnx support.
* __ReSwitched Team__ for additional [documentation, research and tool development](https://reswitched.team/) pertaining to the Nintendo Switch. * __ReSwitched Team__ for additional [documentation, research and tool development](https://reswitched.github.io/) pertaining to the Nintendo Switch.
* __ChaN__ for the [FatFs](http://elm-chan.org/fsw/ff/00index_e.html) module. * __ChaN__ for the [FatFs](http://elm-chan.org/fsw/ff/00index_e.html) module.
* __Marcus Geelnard__ for the [bcl-1.2.0](https://sourceforge.net/projects/bcl/files/bcl/bcl-1.2.0) library. * __Marcus Geelnard__ for the [bcl-1.2.0](https://sourceforge.net/projects/bcl/files/bcl/bcl-1.2.0) library.
* __naehrwert__ and __st4rk__ for the original [hekate](https://github.com/nwert/hekate) project and its hwinit code base. * __naehrwert__ and __st4rk__ for the original [hekate](https://github.com/nwert/hekate) project and its hwinit code base.

View File

@ -50,7 +50,10 @@ dist: dist-no-debug
cp $(CURRENT_DIRECTORY)/stratosphere/sm/$(ATMOSPHERE_OUT_DIR)/sm.elf $(DIST_DIR)/sm.elf cp $(CURRENT_DIRECTORY)/stratosphere/sm/$(ATMOSPHERE_OUT_DIR)/sm.elf $(DIST_DIR)/sm.elf
cp $(CURRENT_DIRECTORY)/stratosphere/spl/$(ATMOSPHERE_OUT_DIR)/spl.elf $(DIST_DIR)/spl.elf cp $(CURRENT_DIRECTORY)/stratosphere/spl/$(ATMOSPHERE_OUT_DIR)/spl.elf $(DIST_DIR)/spl.elf
cp $(CURRENT_DIRECTORY)/stratosphere/TioServer/$(ATMOSPHERE_OUT_DIR)/TioServer.elf $(DIST_DIR)/TioServer.elf cp $(CURRENT_DIRECTORY)/stratosphere/TioServer/$(ATMOSPHERE_OUT_DIR)/TioServer.elf $(DIST_DIR)/TioServer.elf
cp $(CURRENT_DIRECTORY)/stratosphere/memlet/$(ATMOSPHERE_OUT_DIR)/memlet.elf $(DIST_DIR)/memlet.elf
cp $(CURRENT_DIRECTORY)/troposphere/daybreak/daybreak.elf $(DIST_DIR)/daybreak.elf cp $(CURRENT_DIRECTORY)/troposphere/daybreak/daybreak.elf $(DIST_DIR)/daybreak.elf
cp $(CURRENT_DIRECTORY)/troposphere/haze/haze.elf $(DIST_DIR)/haze.elf
cp $(CURRENT_DIRECTORY)/troposphere/reboot_to_payload/reboot_to_payload.elf $(DIST_DIR)/reboot_to_payload.elf
cd $(DIST_DIR); zip -r ../atmosphere-$(ATMOSPHERE_VERSION)-debug.zip ./*; cd ../; cd $(DIST_DIR); zip -r ../atmosphere-$(ATMOSPHERE_VERSION)-debug.zip ./*; cd ../;
rm -rf $(DIST_DIR) rm -rf $(DIST_DIR)
@ -82,9 +85,10 @@ dist-no-debug: package3 $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000034 mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000034
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000036 mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000036
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000037 mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000037
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000003c #mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000003c
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000042 mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000042
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000420 mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000420
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000421
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000b240 mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000b240
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000d609 mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000d609
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000d623 mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000d623
@ -96,16 +100,18 @@ dist-no-debug: package3 $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
cp stratosphere/fatal/$(ATMOSPHERE_OUT_DIR)/fatal.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000034/exefs.nsp cp stratosphere/fatal/$(ATMOSPHERE_OUT_DIR)/fatal.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000034/exefs.nsp
cp stratosphere/creport/$(ATMOSPHERE_OUT_DIR)/creport.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000036/exefs.nsp cp stratosphere/creport/$(ATMOSPHERE_OUT_DIR)/creport.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000036/exefs.nsp
cp stratosphere/ro/$(ATMOSPHERE_OUT_DIR)/ro.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000037/exefs.nsp cp stratosphere/ro/$(ATMOSPHERE_OUT_DIR)/ro.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000037/exefs.nsp
cp stratosphere/jpegdec/$(ATMOSPHERE_OUT_DIR)/jpegdec.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000003c/exefs.nsp #cp stratosphere/jpegdec/$(ATMOSPHERE_OUT_DIR)/jpegdec.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000003c/exefs.nsp
cp stratosphere/pgl/$(ATMOSPHERE_OUT_DIR)/pgl.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000042/exefs.nsp cp stratosphere/pgl/$(ATMOSPHERE_OUT_DIR)/pgl.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000042/exefs.nsp
cp stratosphere/LogManager/$(ATMOSPHERE_OUT_DIR)/LogManager.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000420/exefs.nsp cp stratosphere/LogManager/$(ATMOSPHERE_OUT_DIR)/LogManager.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000420/exefs.nsp
cp stratosphere/htc/$(ATMOSPHERE_OUT_DIR)/htc.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000b240/exefs.nsp cp stratosphere/htc/$(ATMOSPHERE_OUT_DIR)/htc.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000b240/exefs.nsp
cp stratosphere/dmnt.gen2/$(ATMOSPHERE_OUT_DIR)/dmnt.gen2.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000d609/exefs.nsp cp stratosphere/dmnt.gen2/$(ATMOSPHERE_OUT_DIR)/dmnt.gen2.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000d609/exefs.nsp
cp stratosphere/TioServer/$(ATMOSPHERE_OUT_DIR)/TioServer.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000d623/exefs.nsp cp stratosphere/TioServer/$(ATMOSPHERE_OUT_DIR)/TioServer.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000d623/exefs.nsp
cp stratosphere/memlet/$(ATMOSPHERE_OUT_DIR)/memlet.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000421/exefs.nsp
@build_romfs $(DIST_DIR)/stratosphere_romfs $(DIST_DIR)/atmosphere/stratosphere.romfs @build_romfs $(DIST_DIR)/stratosphere_romfs $(DIST_DIR)/atmosphere/stratosphere.romfs
rm -r $(DIST_DIR)/stratosphere_romfs rm -r $(DIST_DIR)/stratosphere_romfs
cp troposphere/reboot_to_payload/reboot_to_payload.nro $(DIST_DIR)/switch/reboot_to_payload.nro cp troposphere/reboot_to_payload/reboot_to_payload.nro $(DIST_DIR)/switch/reboot_to_payload.nro
cp troposphere/daybreak/daybreak.nro $(DIST_DIR)/switch/daybreak.nro cp troposphere/daybreak/daybreak.nro $(DIST_DIR)/switch/daybreak.nro
cp troposphere/haze/haze.nro $(DIST_DIR)/switch/haze.nro
cd $(DIST_DIR); zip -r ../atmosphere-$(ATMOSPHERE_VERSION).zip ./*; cd ../; cd $(DIST_DIR); zip -r ../atmosphere-$(ATMOSPHERE_VERSION).zip ./*; cd ../;
rm -rf $(DIST_DIR) rm -rf $(DIST_DIR)
cp fusee/$(ATMOSPHERE_BOOT_OUT_DIR)/fusee.bin $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)/fusee.bin cp fusee/$(ATMOSPHERE_BOOT_OUT_DIR)/fusee.bin $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)/fusee.bin

View File

@ -1,6 +1,6 @@
# Key: debugmode, default: 1. # Key: debugmode, default: 1.
# Desc: Controls whether kernel is debug mode. # Desc: Controls whether kernel is debug mode.
# Disabling this may break Atmosphere's debugger in a future release. # Disabling this will break Atmosphere.
# Key: debugmode_user, default: 0. # Key: debugmode_user, default: 0.
# Desc: Controls whether userland is debug mode. # Desc: Controls whether userland is debug mode.

View File

@ -67,6 +67,10 @@
; Note that this setting is ignored (and treated as 1) when htc is enabled. ; Note that this setting is ignored (and treated as 1) when htc is enabled.
; 0 = Disabled, 1 = Enabled ; 0 = Disabled, 1 = Enabled
; enable_log_manager = u8!0x0 ; enable_log_manager = u8!0x0
; Controls whether the bluetooth pairing database is redirected to the SD card (shared across sysmmc/all emummcs)
; NOTE: On <13.0.0, the database size was 10 instead of 20; booting pre-13.0.0 will truncate the database.
; 0 = Disabled, 1 = Enabled
; enable_external_bluetooth_db = u8!0x0
[hbloader] [hbloader]
; Controls the size of the homebrew heap when running as applet. ; Controls the size of the homebrew heap when running as applet.
; If set to zero, all available applet memory is used as heap. ; If set to zero, all available applet memory is used as heap.

View File

@ -1,4 +1,203 @@
# Changelog # Changelog
## 1.9.1
+ Basic support was added for 20.1.0.
+ General system stability improvements to enhance the user's experience.
## 1.9.0
+ Basic support was added for 20.0.0.
+ The console should boot and atmosphère should be fully functional. However, not all modules have been fully updated to reflect the latest changes.
+ There shouldn't be anything user visible resulting from this, but it will be addressed in a future atmosphère update.
+ The same action item from 18.0.0 remains, and I believe in my heart of hearts that it will be addressed eventually. Someone has told me they're working on it.
+ There aren't (to my knowledge) outstanding 19.0.0 items any more.
+ **Please note**: As a result of changes made to nintendo's software in 20.0.0, there is roughly 10MB less memory available for custom system modules.
+ We can only steal a maximum of 14MB from the applet pool, down from 40MB.
+ To compensate for this, `ams.mitm`'s heap usage has been reduced by 20MB.
+ To facilitate this, a new helper module (`memlet`) was added, so that memory may be temporarily stolen during the romfs building process.
+ Hopefully, this results in relatively little breakage, however it is possible that user mods which replace extremely large numbers of files in The Legend of Zelda: Tears of the Kingdom may no longer function.
+ If you are affected by this, you will see "Data abort (0x101)" when trying to launch the game with mods.
+ Please reach out to `sciresm` on discord if this occurs to share your error report binary. However, some issues may be impossible to fix.
+ I apologize sincerely if the issue is impossible to resolve, but I have been forced unavoidably to make compromises here, and I think this is the best balance to be struck.
+ `exosphère` was updated to reflect the latest official secure monitor behavior.
+ `mesosphère` was updated to reflect the latest official kernel behavior.
+ `loader` was updated to reflect the latest official behavior.
+ `pm` was updated to reflect the latest official behavior.
+ `ncm` was partially updated to reflect the latest official behavior.
+ `erpt` was updated to reflect the latest official behavior.
+ Atmosphère was updated to use GCC 15/newlib (latest devkitA64/devkitARM releases).
+ A number of improvements were made to the dmnt cheat engine.
+ New instructions were added, and instructions were updated for improved/new functionality.
+ Please see the documents for details -- thanks @tomvita!
+ General system stability improvements to enhance the user's experience.
## 1.8.0
+ Basic support was added for 19.0.0.
+ The console should boot and atmosphère should be fully functional. However, not all modules have been fully updated to reflect the latest changes.
+ There shouldn't be anything user visible resulting from this, but it will be addressed in a future atmosphère update. There is still one action item from 18.0.0 to be addressed, as well.
+ `exosphère` was updated to reflect the latest official secure monitor behavior.
+ `mesosphère` was updated to reflect the latest official kernel behavior.
+ `loader` was updated to reflect the latest official behavior.
+ `pm` was updated to reflect the latest official behavior.
+ `ro` was updated to reflect the latest official behavior.
+ `creport`'s file acces patterns were optimized, greatly improving performance when generating a crash report.
+ Atmosphère now uses `relr` relocations where possible.
+ This reduces the filesize of a number of atmosphère's modules.
+ A number of minor issues were fixed and improvements were made, including:
+ Support was fixed for running Atmosphère on newer units with specific Hynix/Micron DRAM chips.
+ General system stability improvements to enhance the user's experience.
## 1.7.1
+ Support was added for 18.1.0.
+ Atmosphère was updated to use GCC 14/newlib (latest devkitA64/devkitARM releases).
+ Further changes were for 18.0.0:
+ `loader` was updated to reflect the latest official behavior.
+ General system stability improvements to enhance the user's experience.
## 1.7.0
+ Basic support was added for 18.0.0.
+ The console should boot and atmosphère should be fully functional. However, not all modules have been fully updated to reflect the latest changes.
+ There shouldn't be anything user visible resulting from this, but it will be addressed in a future atmosphère update, once I am not traveling so much.
+ `exosphère` was updated to reflect the latest official secure monitor behavior.
+ `mesosphère` was updated to reflect the latest official kernel behavior.
+ `spl` was updated to reflect the latest official behavior.
+ `fusee`'s no longer supports applying IPS patches to KIPs.
+ The only KIPs that are ever present are a) atmosphère modules, b) custom system modules, or c) FS.
+ The IPS subsystem was originally designed to make nogc patches work for FS, but these are now internal, and it appears the literal only kip patches that exist are for piracy.
+ I could not find any kip patches posted anywhere made for any other purpose.
+ It fundamentally does not make sense to slow down boot for every normal user for a feature that has no actual use-case, especially when `fusee` seeks to be a minimal bootloader.
+ Minor improvements were made to atmosphere's gdbstub, including:
+ Support was added for QStartNoAckMode.
+ An issue was fixed that could cause a fatal error when creating too many breakpoints.
+ A number of minor issues were fixed and improvements were made, including:
+ `pt-BR` (`PortugueseBr`) is now accepted as a valid language when overriding game locales.
+ A bug was fixed that could cause atmosphere to incorrectly serialize output object IDs over IPC when using domain objects.
+ A bug was fixed in `pm`'s resource limit boost logic that could potentially cause legitimate boosts to fail in certain circumstances.
+ `loader`/`ro` will now throw a fatal error when using invalid IPS patches that go out of bounds, instead of corrupting memory.
+ Support was fixed for booting using a memory configuration of half of the true available memory (e.g. forcing a 4GB configuration on an 8GB board).
+ General system stability improvements to enhance the user's experience.
## 1.6.2
+ Support was finished for 17.0.0.
+ `erpt` was updated to support the latest official behavior.
+ `jpegdec` was updated to support the latest official behavior.
+ `pm` was updated to support the latest official behavior.
+ General system stability improvements to enhance the user's experience.
## 1.6.1
+ An improved solution to [the problem that would cause consoles which had previously re-built their SYSTEM partition to brick on update-to-17.0.0](https://gist.github.com/SciresM/2ddb708c812ed585c4d99f54e25205ff) was added.
+ In particular, booting atmosphère will now automatically detect the problem and unbrick any consoles which have fallen into this state.
+ Some improvements were made to `haze`, including:
+ Performance was greatly improved:
+ Support was added for GetObjectPropList, which decreases the amount of requests made by ~8x.
+ Haze now performs rendering on the GPU, freeing up the CPU to respond to requests in a more timely manner.
+ An issue was fixed with how `haze` configures `bMaxPacketSize0` which improves support for USB3.
+ General system stability improvements to enhance the user's experience.
## 1.6.0
+ Basic support was added for 17.0.0.
+ The console should boot and atmosphère should be fully functional. However, not all modules have been fully updated to reflect the latest changes.
+ There shouldn't be anything user visible resulting from this, but it will be addressed in a soon-to-come atmosphère update.
+ `exosphère` was updated to reflect the latest official secure monitor behavior.
+ `mesosphère` was updated to reflect the latest official kernel behavior.
+ `ncm` was updated to reflect the latest official behavior.
+ `erpt` was partially updated to support the latest official behavior.
+ Atmosphere's gdbstub now supports waiting to attach to a specific program id on launch (as opposed to any application).
+ The monitor command for this is `monitor wait <hex program id>`, where program id can optionally have an `0x` prefix.
+ Support was added to `haze` for editing files in-place and performing 64-bit transfers (files larger than 4 GB).
+ `bpc.mitm` was enabled on Mariko units, and now triggers pmic-based shutdowns/reboots (thanks @CTCaer).
+ This should cause the console to no longer wake ~15 seconds after shutdown on Mariko.
+ A number of minor issues were fixed and improvements were made, including:
+ A workaround was added for a change in 17.0.0 that would cause consoles which had previously re-built their SYSTEM partition to brick on update-to-17.0.0.
+ General system stability improvements to enhance the user's experience.
## 1.5.5
+ Support was added for 16.1.0.
+ General system stability improvements to enhance the user's experience.
## 1.5.4
+ Experimental new functionality was implemented to prevent crashing when building romfs for certain games with obscene file counts.
+ This includes both Fire Emblem: Engage (~190000 files), and The Legend of Zelda: Tears of the Kingdom (~300000) files.
+ The solution involved adding functionality to ams.mitm/pm to dynamically steal memory from the application (and system) pool as needed when the games have romfs mods.
+ No memory is taken, and there is no cost to this functionality when playing without mods (or with overrides disabled).
+ The Legend of Zelda: Tears of the Kingdom is currently the absolute worst case game, requiring ~48 MB of memory to build a romfs image to play with mods.
+ Right now, the memory is sourced as follows: 32 MB (base ams.mitm heap), 10 MB (stolen from application pool), 8 MB (dynamically stolen from system pool).
+ This is 50 MB, which allows a little overhead in the worst case (prevents crashing due to exhausting the heap for other allocations in ams.mitm).
+ Zelda is remarkably sensitive to memory being stolen from the application pool, tolerating no more than 16 MB on 1.0.0 and 12 MB on 1.1.0. I have chosen to steal 10 MB, to be safe, for now.
+ This may break on a future game update, but I will fix it if and when that happens. There is no perfect solution; the game simply requires too much memory to support mods flawlessly, and I am forced to compromise.
+ As usual, if you encounter a game that exhausts ams.mitm's memory (crashing it) when loading layeredfs mods, please contact `SciresM#0524`.
"I am jinxing myself by saying this, but it's really hard to imagine any game being worse than The Legend of Zelda: Tears of the Kingdom, but if it happens again I will drop everything to fix it as usual".
+ General system stability improvements to enhance the user's experience.
## 1.5.3
+ Support was added for 16.0.3.
+ Atmosphère was updated to use GCC 13/newlib (latest devkitA64/devkitARM releases).
+ **Please note**: This introduces a known issue, which is currently being worked on.
+ As you may recall from the 1.4.1 changelog, Fire Emblem: Engage requires enormous amounts of memory to support using layeredfs mods with the game.
+ Latest GCC/newlib slightly increases malloc overhead size, which makes the previous memory increase insufficient.
+ A general-case solution to this is in the works, which should hopefully fix the problem in a way that doesn't jinx me for the future.
+ A number of minor issues were fixed and improvements were made, including:
+ An issue was fixed that caused system font replacement to not work on 16.0.0+.
+ An minor accuracy issue was addressed in mesosphere's management of certain memory ranges; this issue would have had zero visible impact to the end-user.
+ General system stability improvements to enhance the user's experience.
## 1.5.2
+ A homebrew application (`haze`) was added for performing USB file transfer (with thanks to @liamwhite for both design and implementation).
+ `haze` is included with atmosphère, and provides access to the SD card via the PTP/MTP protocol.
+ **Please note**: haze will show inside the homebrew menu under the name "USB File Transfer".
+ **Please note**: Atmosphère cannot be updated at runtime, and trying to install an atmosphère update via haze will fail as usual.
+ General system stability improvements to enhance the user's experience.
## 1.5.1
+ `fatal` was updated to reduce memory footprint.
+ Starting in 16.0.0, official `fatal` has no framebuffer or rendering logic, and instead calls other system service commands to draw the screen.
+ However, these commands aren't usable by atmosphère (too small rendering window, bad color support).
+ To reduce the relative memory footprint differential between atmosphère and official code, the framebuffer (2 MB) is now dynamically allocated when needed.
+ This will try to allocate from multiple pools (preferring System > System_NonSecure > Application).
+ This technically requires that 2 MB be available in at least one of these pools for the fatal screen to render (otherwise, a reboot-to-black-and-white-fatal will occur), but this should be a non-issue in almost all cases.
+ A feature was added to optionally mirror the bluetooth pairing database to the SD card (thanks @ndeadly).
+ This allows device pairings to be automatically kept in-sync across sysmmc/all emummcs.
+ This is opt-in, and can be controlled by setting `atmosphere!enable_external_bluetooth_db = u8!0x1`.
+ When enabled, the pairing database will be synchronized to `/atmosphere/bluetooth_devices.db`.
+ General system stability improvements to enhance the user's experience.
## 1.5.0
+ Support was added for 16.0.0
+ `mesosphère` was updated to reflect the latest official kernel behavior.
+ `ncm` was updated to reflect the latest official behavior.
+ Many FS apis were updated under the hood to reflect the latest official behavior.
+ **Please Note**: 16.0.0 made breaking changes to a number of system APIs, including in FS/NCM/Shared Font commands that some homebrew programs may use.
+ These programs may encounter strange errors, and may need to be recompiled with a libnx updated to support 16.0.0's changes to function properly.
+ A number of minor issues were fixed and improvements were made, including:
+ An issue was fixed that could cause GPIO outputs to be misconfigured under certain circumstances.
+ General system stability improvements to enhance the user's experience.
## 1.4.1
+ A number of minor issues were fixed and improvements were made, including:
+ `dmnt` cheat toggle files are no longer ignored when they are missing a trailing newline.
+ The mechanism for automatically cleaning up `erpt_reports` added in 1.3.0 was fixed.
+ This was actually just very fundamentally broken and has never worked, but it is verified working now.
+ Minor fixes were made in `mesosphère` to match official kernel behavior (spin lock assembly was corrected, wrong result on failure in in GetProcessId was corrected).
+ A missing call to GetSdStatus when initializing SD cards at non uhs-i mode was added in the sdmmc driver.
+ `ams.mitm`'s memory usage was increased by 16 MB, to prevent crashing when building romfs for games with obscene file counts.
+ To quote the changelog for 1.2.3: "Animal Crossing's 2.0.0 update contains >99000 files [...] It's really hard to imagine any game being worse than Animal Crossing".
+ As it turns out, Fire Emblem: Engage has ~186000 files, and is approximately twice as bad as animal crossing.
+ The additional memory here is taken from the applet pool; no issues are expected to arise from this, but please report anything you may run into.
+ As usual, if you encounter a game that exhausts ams.mitm's memory (crashing it) when loading layeredfs mods, please contact `SciresM#0524`.
+ I am jinxing myself by saying this, but it's really hard to imagine any game being worse than Fire Emblem: Engage, but if it happens again I will drop everything to fix it as usual.
+ General system stability improvements to enhance the user's experience.
## 1.4.0
+ Support was added for 15.0.0.
+ `mesosphère` was updated to reflect the latest official kernel behavior.
+ `ncm` was updated to reflect the latest official behavior.
+ A number of minor issues were fixed and improvements were made, including:
+ The capacity limit on registered add-on contents was fixed in NCM to reflect the increase that occurred in 12.0.0.
+ An off-by-one was fixed in mesosphere when computing the new value for an address arbiter signaled with ModifyByWaitingCountIfEqual.
+ dmnt.gen2's gdbstub now sanitizes thread names to prevent invalid characters from breaking gdb.
+ dmnt.gen2's gdbstub now reports the architecture tag correctly when attached to 32-bit processes.
+ Support for program-specific html manual content overrides was added for non-hbl takeover context.
+ A bug was fixed in how emummc constructed the alternate Nintendo directory path.
+ Previously, this was using `/*/Nintendo/Nintendo` instead of `/*/Nintendo`.
+ Code was added to automatically move the old folders to the new ones when booting into emummc.
+ A bug was fixed in boot that caused an incorrectly low input voltage limit to be set.
+ General system stability improvements to enhance the user's experience.
## 1.3.2
+ Support was improved for 14.0.0+.
+ `loader` was updated to reflect the latest official behaviors.
+ `ro` was updated to reflect the latest official behaviors.
+ A number of minor issues were fixed and improvements were made, including:
+ A memory leak was fixed in filesystem path management; this could cause a crash when launching games ~100 times, or when deleting/re-downloading games.
+ A bug was fixed that could cause threads to not see a newly signaled semaphore.
+ A number of minor inaccuracies were fixed in the updated FileSystem APIs.
+ General system stability improvements to enhance the user's experience.
## 1.3.1
+ Support was added for 14.1.0.
+ A number of minor under the hood improvements to accuracy were made to better reflect latest official system module behavior, particularly around FS apis.
+ General system stability improvements to enhance the user's experience.
## 1.3.0 ## 1.3.0
+ Support was added for 14.0.0. + Support was added for 14.0.0.
+ `mesosphère` was updated to reflect the latest official kernel behavior. + `mesosphère` was updated to reflect the latest official kernel behavior.

18
docs/faq.md Normal file
View File

@ -0,0 +1,18 @@
# Frequently Asked Questions
This document serves as a place to store answers for common questions received about Atmosphère.
## What does "June 15th" mean?
When Atmosphère began development in February 2018, "June 15" was given as the estimate/target date for a first release, to coincide with the planned disclosure of a vulnerability.
This deadline was missed, hard.
People made rather a lot of fun of me (SciresM) for this.
Several months later, when the first Atmosphère release occurred, I captioned it "Happy June 15th!" and pretended like I hadn't missed the first deadline.
This amused me a lot, and so the practice has been kept up for every single release since.
Depending on who you ask, you may be told that this is a dumb joke and it is not funny.
This is incorrect. It is definitely a dumb joke, but it is also hilarious.

View File

@ -49,7 +49,7 @@ Code type 0x0 allows writing a static value to a memory address.
`0TMR00AA AAAAAAAA VVVVVVVV (VVVVVVVV)` `0TMR00AA AAAAAAAA VVVVVVVV (VVVVVVVV)`
+ T: Width of memory write (1, 2, 4, or 8 bytes). + T: Width of memory write (1, 2, 4, or 8 bytes).
+ M: Memory region to write to (0 = Main NSO, 1 = Heap, 2 = Alias, 3 = Aslr). + M: Memory region to write to (0 = Main NSO, 1 = Heap, 2 = Alias, 3 = Aslr, 4 = non-relative).
+ R: Register to use as an offset from memory region base. + R: Register to use as an offset from memory region base.
+ A: Immediate offset to use from memory region base. + A: Immediate offset to use from memory region base.
+ V: Value to write. + V: Value to write.
@ -62,11 +62,13 @@ Code type 0x1 performs a comparison of the contents of memory to a static value.
If the condition is not met, all instructions until the appropriate End or Else conditional block terminator are skipped. If the condition is not met, all instructions until the appropriate End or Else conditional block terminator are skipped.
#### Encoding #### Encoding
`1TMC00AA AAAAAAAA VVVVVVVV (VVVVVVVV)` `1TMCXrAA AAAAAAAA VVVVVVVV (VVVVVVVV)`
+ T: Width of memory write (1, 2, 4, or 8 bytes). + T: Width of memory read (1, 2, 4, or 8 bytes).
+ M: Memory region to write to (0 = Main NSO, 1 = Heap, 2 = Alias, 3 = Aslr). + M: Memory region to read from (0 = Main NSO, 1 = Heap, 2 = Alias, 3 = Aslr, 4 = non-relative).
+ C: Condition to use, see below. + C: Condition to use, see below.
+ X: Operand Type, see below.
+ r: Offset Register (operand types 1).
+ A: Immediate offset to use from memory region base. + A: Immediate offset to use from memory region base.
+ V: Value to compare to. + V: Value to compare to.
@ -78,6 +80,9 @@ If the condition is not met, all instructions until the appropriate End or Else
+ 5: == + 5: ==
+ 6: != + 6: !=
#### Operand Type
+ 0: Memory Base + Relative Offset
+ 1: Memory Base + Offset Register + Relative Offset
--- ---
### Code Type 0x2: End Conditional Block ### Code Type 0x2: End Conditional Block
@ -126,7 +131,7 @@ Code type 0x5 allows loading a value from memory into a register, either using a
`5TMR00AA AAAAAAAA` `5TMR00AA AAAAAAAA`
+ T: Width of memory read (1, 2, 4, or 8 bytes). + T: Width of memory read (1, 2, 4, or 8 bytes).
+ M: Memory region to write to (0 = Main NSO, 1 = Heap, 2 = Alias, 3 = Aslr). + M: Memory region to write to (0 = Main NSO, 1 = Heap, 2 = Alias, 3 = Aslr, 4 = non-relative).
+ R: Register to load value into. + R: Register to load value into.
+ A: Immediate offset to use from memory region base. + A: Immediate offset to use from memory region base.
@ -137,6 +142,22 @@ Code type 0x5 allows loading a value from memory into a register, either using a
+ R: Register to load value into. (This register is also used as the base memory address). + R: Register to load value into. (This register is also used as the base memory address).
+ A: Immediate offset to use from register R. + A: Immediate offset to use from register R.
#### Load from Register Address Encoding
`5T0R2SAA AAAAAAAA`
+ T: Width of memory read (1, 2, 4, or 8 bytes).
+ R: Register to load value into.
+ S: Register to use as the base memory address.
+ A: Immediate offset to use from register R.
#### Load From Fixed Address Encoding with offset register
`5TMR3SAA AAAAAAAA`
+ T: Width of memory read (1, 2, 4, or 8 bytes).
+ M: Memory region to write to (0 = Main NSO, 1 = Heap, 2 = Alias, 3 = Aslr, 4 = non-relative).
+ R: Register to load value into.
+ S: Register to use as offset register.
+ A: Immediate offset to use from memory region base.
--- ---
### Code Type 0x6: Store Static Value to Register Memory Address ### Code Type 0x6: Store Static Value to Register Memory Address
@ -250,7 +271,10 @@ Code type 0x9 allows performing arithmetic on registers.
+ 7: Logical Not (discards right-hand operand) + 7: Logical Not (discards right-hand operand)
+ 8: Logical Xor + 8: Logical Xor
+ 9: None/Move (discards right-hand operand) + 9: None/Move (discards right-hand operand)
+ 10: Float Addition, T==4 single T==8 double
+ 11: Float Subtraction, T==4 single T==8 double
+ 12: Float Multiplication, T==4 single T==8 double
+ 13: Float Division, T==4 single T==8 double
--- ---
### Code Type 0xA: Store Register to Memory Address ### Code Type 0xA: Store Register to Memory Address
@ -380,6 +404,61 @@ Code type 0xC3 reads or writes a static register with a given register.
--- ---
### Code Type 0xC4: Begin Extended Keypress Conditional Block
Code type 0xC4 enters or skips a conditional block based on whether a key combination is pressed.
#### Encoding
`C4r00000 kkkkkkkk kkkkkkkk`
+ r: Auto-repeat, see below.
+ kkkkkkkkkk: Keypad mask to check against output of `hidKeysDown()`.
Note that for multiple button combinations, the bitmasks should be OR'd together.
#### Auto-repeat
+ 0: The conditional block executes only once when the keypad mask matches. The mask must stop matching to reset for the next trigger.
+ 1: The conditional block executes as long as the keypad mask matches.
#### Keypad Values
Note: This is the direct output of `hidKeysDown()`.
+ 00000000 00000001: A
+ 00000000 00000002: B
+ 00000000 00000004: X
+ 00000000 00000008: Y
+ 00000000 00000010: Left Stick Pressed
+ 00000000 00000020: Right Stick Pressed
+ 00000000 00000040: L
+ 00000000 00000080: R
+ 00000000 00000100: ZL
+ 00000000 00000200: ZR
+ 00000000 00000400: Plus
+ 00000000 00000800: Minus
+ 00000000 00001000: Left
+ 00000000 00002000: Up
+ 00000000 00004000: Right
+ 00000000 00008000: Down
+ 00000000 00010000: Left Stick Left
+ 00000000 00020000: Left Stick Up
+ 00000000 00040000: Left Stick Right
+ 00000000 00080000: Left Stick Down
+ 00000000 00100000: Right Stick Left
+ 00000000 00200000: Right Stick Up
+ 00000000 00400000: Right Stick Right
+ 00000000 00800000: Right Stick Down
+ 00000000 01000000: SL Left Joy-Con
+ 00000000 02000000: SR Left Joy-Con
+ 00000000 04000000: SL Right Joy-Con
+ 00000000 08000000: SR Right Joy-Con
+ 00000000 10000000: Top button on Poké Ball Plus (Palma) controller
+ 00000000 20000000: Verification
+ 00000000 40000000: B button on Left NES/HVC controller in Handheld mode
+ 00000000 80000000: Left C button in N64 controller
+ 00000001 00000000: Up C button in N64 controller
+ 00000002 00000000: Right C button in N64 controller
+ 00000004 00000000: Down C button in N64 controller
### Code Type 0xF0: Double Extended-Width Instruction ### Code Type 0xF0: Double Extended-Width Instruction
Code Type 0xF0 signals to the VM to treat the upper three nybbles of the first dword as instruction type, instead of just the upper nybble. Code Type 0xF0 signals to the VM to treat the upper three nybbles of the first dword as instruction type, instead of just the upper nybble.

View File

@ -27,3 +27,6 @@ A list of planned features for Atmosphère can be found [here](roadmap.md).
## Release History ## Release History
A changelog of previous versions of Atmosphère can be found [here](changelog.md). A changelog of previous versions of Atmosphère can be found [here](changelog.md).
## Frequently Asked Questions
Answers to one or more frequently asked questions may be found [here](faq.md).

4
emummc/.gitrepo vendored
View File

@ -6,7 +6,7 @@
[subrepo] [subrepo]
remote = https://github.com/m4xw/emummc remote = https://github.com/m4xw/emummc
branch = develop branch = develop
commit = 56a2e8a2078944d9bf8daead237036254bb6e36d commit = a8e5f1a184aeb8ba884166a1e4f386088d4a6cf1
parent = 4f763b2aa401ac3e3d699ec8c866ae9b3c8fb28d parent = 409c3cf9e190dbb65fe76570954939cbe8a5eca0
method = merge method = merge
cmdver = 0.4.1 cmdver = 0.4.1

2
emummc/README.md vendored
View File

@ -2,7 +2,7 @@
*A SDMMC driver replacement for Nintendo's Filesystem Services, by **m4xw*** *A SDMMC driver replacement for Nintendo's Filesystem Services, by **m4xw***
### Supported Horizon Versions ### Supported Horizon Versions
**1.0.0 - 13.1.0** **1.0.0 - 20.1.0**
## Features ## Features
* Arbitrary SDMMC backend selection * Arbitrary SDMMC backend selection

View File

@ -61,6 +61,24 @@
#include "offsets/1310_exfat.h" #include "offsets/1310_exfat.h"
#include "offsets/1400.h" #include "offsets/1400.h"
#include "offsets/1400_exfat.h" #include "offsets/1400_exfat.h"
#include "offsets/1500.h"
#include "offsets/1500_exfat.h"
#include "offsets/1600.h"
#include "offsets/1600_exfat.h"
#include "offsets/1603.h"
#include "offsets/1603_exfat.h"
#include "offsets/1700.h"
#include "offsets/1700_exfat.h"
#include "offsets/1800.h"
#include "offsets/1800_exfat.h"
#include "offsets/1810.h"
#include "offsets/1810_exfat.h"
#include "offsets/1900.h"
#include "offsets/1900_exfat.h"
#include "offsets/2000.h"
#include "offsets/2000_exfat.h"
#include "offsets/2010.h"
#include "offsets/2010_exfat.h"
#include "../utils/fatal.h" #include "../utils/fatal.h"
#define GET_OFFSET_STRUCT_NAME(vers) g_offsets##vers #define GET_OFFSET_STRUCT_NAME(vers) g_offsets##vers
@ -133,6 +151,24 @@ DEFINE_OFFSET_STRUCT(_1310);
DEFINE_OFFSET_STRUCT(_1310_EXFAT); DEFINE_OFFSET_STRUCT(_1310_EXFAT);
DEFINE_OFFSET_STRUCT(_1400); DEFINE_OFFSET_STRUCT(_1400);
DEFINE_OFFSET_STRUCT(_1400_EXFAT); DEFINE_OFFSET_STRUCT(_1400_EXFAT);
DEFINE_OFFSET_STRUCT(_1500);
DEFINE_OFFSET_STRUCT(_1500_EXFAT);
DEFINE_OFFSET_STRUCT(_1600);
DEFINE_OFFSET_STRUCT(_1600_EXFAT);
DEFINE_OFFSET_STRUCT(_1603);
DEFINE_OFFSET_STRUCT(_1603_EXFAT);
DEFINE_OFFSET_STRUCT(_1700);
DEFINE_OFFSET_STRUCT(_1700_EXFAT);
DEFINE_OFFSET_STRUCT(_1800);
DEFINE_OFFSET_STRUCT(_1800_EXFAT);
DEFINE_OFFSET_STRUCT(_1810);
DEFINE_OFFSET_STRUCT(_1810_EXFAT);
DEFINE_OFFSET_STRUCT(_1900);
DEFINE_OFFSET_STRUCT(_1900_EXFAT);
DEFINE_OFFSET_STRUCT(_2000);
DEFINE_OFFSET_STRUCT(_2000_EXFAT);
DEFINE_OFFSET_STRUCT(_2010);
DEFINE_OFFSET_STRUCT(_2010_EXFAT);
const fs_offsets_t *get_fs_offsets(enum FS_VER version) { const fs_offsets_t *get_fs_offsets(enum FS_VER version) {
switch (version) { switch (version) {
@ -226,6 +262,42 @@ const fs_offsets_t *get_fs_offsets(enum FS_VER version) {
return &(GET_OFFSET_STRUCT_NAME(_1400)); return &(GET_OFFSET_STRUCT_NAME(_1400));
case FS_VER_14_0_0_EXFAT: case FS_VER_14_0_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1400_EXFAT)); return &(GET_OFFSET_STRUCT_NAME(_1400_EXFAT));
case FS_VER_15_0_0:
return &(GET_OFFSET_STRUCT_NAME(_1500));
case FS_VER_15_0_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1500_EXFAT));
case FS_VER_16_0_0:
return &(GET_OFFSET_STRUCT_NAME(_1600));
case FS_VER_16_0_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1600_EXFAT));
case FS_VER_16_0_3:
return &(GET_OFFSET_STRUCT_NAME(_1603));
case FS_VER_16_0_3_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1603_EXFAT));
case FS_VER_17_0_0:
return &(GET_OFFSET_STRUCT_NAME(_1700));
case FS_VER_17_0_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1700_EXFAT));
case FS_VER_18_0_0:
return &(GET_OFFSET_STRUCT_NAME(_1800));
case FS_VER_18_0_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1800_EXFAT));
case FS_VER_18_1_0:
return &(GET_OFFSET_STRUCT_NAME(_1810));
case FS_VER_18_1_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1810_EXFAT));
case FS_VER_19_0_0:
return &(GET_OFFSET_STRUCT_NAME(_1900));
case FS_VER_19_0_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1900_EXFAT));
case FS_VER_20_0_0:
return &(GET_OFFSET_STRUCT_NAME(_2000));
case FS_VER_20_0_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_2000_EXFAT));
case FS_VER_20_1_0:
return &(GET_OFFSET_STRUCT_NAME(_2010));
case FS_VER_20_1_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_2010_EXFAT));
default: default:
fatal_abort(Fatal_UnknownVersion); fatal_abort(Fatal_UnknownVersion);
} }

View File

@ -89,6 +89,33 @@ enum FS_VER
FS_VER_14_0_0, FS_VER_14_0_0,
FS_VER_14_0_0_EXFAT, FS_VER_14_0_0_EXFAT,
FS_VER_15_0_0,
FS_VER_15_0_0_EXFAT,
FS_VER_16_0_0,
FS_VER_16_0_0_EXFAT,
FS_VER_16_0_3,
FS_VER_16_0_3_EXFAT,
FS_VER_17_0_0,
FS_VER_17_0_0_EXFAT,
FS_VER_18_0_0,
FS_VER_18_0_0_EXFAT,
FS_VER_18_1_0,
FS_VER_18_1_0_EXFAT,
FS_VER_19_0_0,
FS_VER_19_0_0_EXFAT,
FS_VER_20_0_0,
FS_VER_20_0_0_EXFAT,
FS_VER_20_1_0,
FS_VER_20_1_0_EXFAT,
FS_VER_MAX, FS_VER_MAX,
}; };

59
emummc/source/FS/offsets/1500.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1500_H__
#define __FS_1500_H__
// Accessor vtable getters
#define FS_OFFSET_1500_SDMMC_ACCESSOR_GC 0x183E20
#define FS_OFFSET_1500_SDMMC_ACCESSOR_SD 0x185AA0
#define FS_OFFSET_1500_SDMMC_ACCESSOR_NAND 0x1842E0
// Hooks
#define FS_OFFSET_1500_SDMMC_WRAPPER_READ 0x17FCF0
#define FS_OFFSET_1500_SDMMC_WRAPPER_WRITE 0x17FD50
#define FS_OFFSET_1500_RTLD 0x26518
#define FS_OFFSET_1500_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1500_CLKRST_SET_MIN_V_CLK_RATE 0x1A0870
// Misc funcs
#define FS_OFFSET_1500_LOCK_MUTEX 0x1791A0
#define FS_OFFSET_1500_UNLOCK_MUTEX 0x1791F0
#define FS_OFFSET_1500_SDMMC_WRAPPER_CONTROLLER_OPEN 0x17FCB0
#define FS_OFFSET_1500_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x17FCD0
// Misc Data
#define FS_OFFSET_1500_SD_MUTEX 0xFF33F0
#define FS_OFFSET_1500_NAND_MUTEX 0xFEE2E8
#define FS_OFFSET_1500_ACTIVE_PARTITION 0xFEE328
#define FS_OFFSET_1500_SDMMC_DAS_HANDLE 0xFD38D8
// NOPs
#define FS_OFFSET_1500_SD_DAS_INIT 0x25454
// Nintendo Paths
#define FS_OFFSET_1500_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00063050, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0006FDE8, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x000768D4, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00089364, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1500_H__

59
emummc/source/FS/offsets/1500_exfat.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1500_EXFAT_H__
#define __FS_1500_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_1500_EXFAT_SDMMC_ACCESSOR_GC 0x18EDB0
#define FS_OFFSET_1500_EXFAT_SDMMC_ACCESSOR_SD 0x190A30
#define FS_OFFSET_1500_EXFAT_SDMMC_ACCESSOR_NAND 0x18F270
// Hooks
#define FS_OFFSET_1500_EXFAT_SDMMC_WRAPPER_READ 0x18AC80
#define FS_OFFSET_1500_EXFAT_SDMMC_WRAPPER_WRITE 0x18ACE0
#define FS_OFFSET_1500_EXFAT_RTLD 0x26518
#define FS_OFFSET_1500_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1500_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1AB800
// Misc funcs
#define FS_OFFSET_1500_EXFAT_LOCK_MUTEX 0x184130
#define FS_OFFSET_1500_EXFAT_UNLOCK_MUTEX 0x184180
#define FS_OFFSET_1500_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x18AC40
#define FS_OFFSET_1500_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x18AC60
// Misc Data
#define FS_OFFSET_1500_EXFAT_SD_MUTEX 0x10053F0
#define FS_OFFSET_1500_EXFAT_NAND_MUTEX 0x10002E8
#define FS_OFFSET_1500_EXFAT_ACTIVE_PARTITION 0x1000328
#define FS_OFFSET_1500_EXFAT_SDMMC_DAS_HANDLE 0xFE08D8
// NOPs
#define FS_OFFSET_1500_EXFAT_SD_DAS_INIT 0x25454
// Nintendo Paths
#define FS_OFFSET_1500_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00063050, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0006FDE8, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x000768D4, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00089364, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1500_EXFAT_H__

59
emummc/source/FS/offsets/1600.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1600_H__
#define __FS_1600_H__
// Accessor vtable getters
#define FS_OFFSET_1600_SDMMC_ACCESSOR_GC 0x1862A0
#define FS_OFFSET_1600_SDMMC_ACCESSOR_SD 0x187F20
#define FS_OFFSET_1600_SDMMC_ACCESSOR_NAND 0x186760
// Hooks
#define FS_OFFSET_1600_SDMMC_WRAPPER_READ 0x1821F0
#define FS_OFFSET_1600_SDMMC_WRAPPER_WRITE 0x182250
#define FS_OFFSET_1600_RTLD 0x269B0
#define FS_OFFSET_1600_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1600_CLKRST_SET_MIN_V_CLK_RATE 0x1A2D30
// Misc funcs
#define FS_OFFSET_1600_LOCK_MUTEX 0x17B730
#define FS_OFFSET_1600_UNLOCK_MUTEX 0x17B780
#define FS_OFFSET_1600_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1821B0
#define FS_OFFSET_1600_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1821D0
// Misc Data
#define FS_OFFSET_1600_SD_MUTEX 0xFFB3F0
#define FS_OFFSET_1600_NAND_MUTEX 0xFF6B58
#define FS_OFFSET_1600_ACTIVE_PARTITION 0xFF6B98
#define FS_OFFSET_1600_SDMMC_DAS_HANDLE 0xFDC8B0
// NOPs
#define FS_OFFSET_1600_SD_DAS_INIT 0x258D4
// Nintendo Paths
#define FS_OFFSET_1600_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00063B48, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x00070D6C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007790C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0008A754, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1600_H__

59
emummc/source/FS/offsets/1600_exfat.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1600_EXFAT_H__
#define __FS_1600_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_1600_EXFAT_SDMMC_ACCESSOR_GC 0x190F80
#define FS_OFFSET_1600_EXFAT_SDMMC_ACCESSOR_SD 0x192C00
#define FS_OFFSET_1600_EXFAT_SDMMC_ACCESSOR_NAND 0x191440
// Hooks
#define FS_OFFSET_1600_EXFAT_SDMMC_WRAPPER_READ 0x18CED0
#define FS_OFFSET_1600_EXFAT_SDMMC_WRAPPER_WRITE 0x18CF30
#define FS_OFFSET_1600_EXFAT_RTLD 0x269B0
#define FS_OFFSET_1600_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1600_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1ADA10
// Misc funcs
#define FS_OFFSET_1600_EXFAT_LOCK_MUTEX 0x186410
#define FS_OFFSET_1600_EXFAT_UNLOCK_MUTEX 0x186460
#define FS_OFFSET_1600_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x18CE90
#define FS_OFFSET_1600_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x18CEB0
// Misc Data
#define FS_OFFSET_1600_EXFAT_SD_MUTEX 0x100D3F0
#define FS_OFFSET_1600_EXFAT_NAND_MUTEX 0x1008B58
#define FS_OFFSET_1600_EXFAT_ACTIVE_PARTITION 0x1008B98
#define FS_OFFSET_1600_EXFAT_SDMMC_DAS_HANDLE 0xFE98B0
// NOPs
#define FS_OFFSET_1600_EXFAT_SD_DAS_INIT 0x258D4
// Nintendo Paths
#define FS_OFFSET_1600_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00063B48, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x00070D6C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007790C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0008A754, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1600_EXFAT_H__

59
emummc/source/FS/offsets/1603.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1603_H__
#define __FS_1603_H__
// Accessor vtable getters
#define FS_OFFSET_1603_SDMMC_ACCESSOR_GC 0x1862F0
#define FS_OFFSET_1603_SDMMC_ACCESSOR_SD 0x187F70
#define FS_OFFSET_1603_SDMMC_ACCESSOR_NAND 0x1867B0
// Hooks
#define FS_OFFSET_1603_SDMMC_WRAPPER_READ 0x182240
#define FS_OFFSET_1603_SDMMC_WRAPPER_WRITE 0x1822A0
#define FS_OFFSET_1603_RTLD 0x269B0
#define FS_OFFSET_1603_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1603_CLKRST_SET_MIN_V_CLK_RATE 0x1A2D80
// Misc funcs
#define FS_OFFSET_1603_LOCK_MUTEX 0x17B780
#define FS_OFFSET_1603_UNLOCK_MUTEX 0x17B7D0
#define FS_OFFSET_1603_SDMMC_WRAPPER_CONTROLLER_OPEN 0x182200
#define FS_OFFSET_1603_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x182220
// Misc Data
#define FS_OFFSET_1603_SD_MUTEX 0xFFB3F0
#define FS_OFFSET_1603_NAND_MUTEX 0xFF6B58
#define FS_OFFSET_1603_ACTIVE_PARTITION 0xFF6B98
#define FS_OFFSET_1603_SDMMC_DAS_HANDLE 0xFDC8B0
// NOPs
#define FS_OFFSET_1603_SD_DAS_INIT 0x258D4
// Nintendo Paths
#define FS_OFFSET_1603_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00063B98, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x00070DBC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007795C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0008A7A4, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1603_H__

59
emummc/source/FS/offsets/1603_exfat.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1603_EXFAT_H__
#define __FS_1603_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_1603_EXFAT_SDMMC_ACCESSOR_GC 0x190FD0
#define FS_OFFSET_1603_EXFAT_SDMMC_ACCESSOR_SD 0x192C50
#define FS_OFFSET_1603_EXFAT_SDMMC_ACCESSOR_NAND 0x191490
// Hooks
#define FS_OFFSET_1603_EXFAT_SDMMC_WRAPPER_READ 0x18CF20
#define FS_OFFSET_1603_EXFAT_SDMMC_WRAPPER_WRITE 0x18CF80
#define FS_OFFSET_1603_EXFAT_RTLD 0x269B0
#define FS_OFFSET_1603_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1603_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1ADA60
// Misc funcs
#define FS_OFFSET_1603_EXFAT_LOCK_MUTEX 0x186460
#define FS_OFFSET_1603_EXFAT_UNLOCK_MUTEX 0x1864B0
#define FS_OFFSET_1603_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x18CEE0
#define FS_OFFSET_1603_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x18CF00
// Misc Data
#define FS_OFFSET_1603_EXFAT_SD_MUTEX 0x100D3F0
#define FS_OFFSET_1603_EXFAT_NAND_MUTEX 0x1008B58
#define FS_OFFSET_1603_EXFAT_ACTIVE_PARTITION 0x1008B98
#define FS_OFFSET_1603_EXFAT_SDMMC_DAS_HANDLE 0xFE98B0
// NOPs
#define FS_OFFSET_1603_EXFAT_SD_DAS_INIT 0x258D4
// Nintendo Paths
#define FS_OFFSET_1603_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00063B98, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x00070DBC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007795C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0008A7A4, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1603_EXFAT_H__

59
emummc/source/FS/offsets/1700.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1700_H__
#define __FS_1700_H__
// Accessor vtable getters
#define FS_OFFSET_1700_SDMMC_ACCESSOR_GC 0x18AD00
#define FS_OFFSET_1700_SDMMC_ACCESSOR_SD 0x18C9D0
#define FS_OFFSET_1700_SDMMC_ACCESSOR_NAND 0x18B1D0
// Hooks
#define FS_OFFSET_1700_SDMMC_WRAPPER_READ 0x186BC0
#define FS_OFFSET_1700_SDMMC_WRAPPER_WRITE 0x186C20
#define FS_OFFSET_1700_RTLD 0x29D10
#define FS_OFFSET_1700_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1700_CLKRST_SET_MIN_V_CLK_RATE 0x1A7B60
// Misc funcs
#define FS_OFFSET_1700_LOCK_MUTEX 0x17FEA0
#define FS_OFFSET_1700_UNLOCK_MUTEX 0x17FEF0
#define FS_OFFSET_1700_SDMMC_WRAPPER_CONTROLLER_OPEN 0x186B80
#define FS_OFFSET_1700_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x186BA0
// Misc Data
#define FS_OFFSET_1700_SD_MUTEX 0xFCE3F0
#define FS_OFFSET_1700_NAND_MUTEX 0xFC9B78
#define FS_OFFSET_1700_ACTIVE_PARTITION 0xFC9BB8
#define FS_OFFSET_1700_SDMMC_DAS_HANDLE 0xFAF840
// NOPs
#define FS_OFFSET_1700_SD_DAS_INIT 0x28C64
// Nintendo Paths
#define FS_OFFSET_1700_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00068068, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007510C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007BEAC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0008F674, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1700_H__

59
emummc/source/FS/offsets/1700_exfat.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1700_EXFAT_H__
#define __FS_1700_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_1700_EXFAT_SDMMC_ACCESSOR_GC 0x195B60
#define FS_OFFSET_1700_EXFAT_SDMMC_ACCESSOR_SD 0x197830
#define FS_OFFSET_1700_EXFAT_SDMMC_ACCESSOR_NAND 0x196030
// Hooks
#define FS_OFFSET_1700_EXFAT_SDMMC_WRAPPER_READ 0x191A20
#define FS_OFFSET_1700_EXFAT_SDMMC_WRAPPER_WRITE 0x191A80
#define FS_OFFSET_1700_EXFAT_RTLD 0x29D10
#define FS_OFFSET_1700_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1700_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1B29C0
// Misc funcs
#define FS_OFFSET_1700_EXFAT_LOCK_MUTEX 0x18AD00
#define FS_OFFSET_1700_EXFAT_UNLOCK_MUTEX 0x18AD50
#define FS_OFFSET_1700_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1919E0
#define FS_OFFSET_1700_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x191A00
// Misc Data
#define FS_OFFSET_1700_EXFAT_SD_MUTEX 0xFE03F0
#define FS_OFFSET_1700_EXFAT_NAND_MUTEX 0xFDBB78
#define FS_OFFSET_1700_EXFAT_ACTIVE_PARTITION 0xFDBBB8
#define FS_OFFSET_1700_EXFAT_SDMMC_DAS_HANDLE 0xFBC840
// NOPs
#define FS_OFFSET_1700_EXFAT_SD_DAS_INIT 0x28C64
// Nintendo Paths
#define FS_OFFSET_1700_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00068068, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007510C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007BEAC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0008F674, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1700_EXFAT_H__

59
emummc/source/FS/offsets/1800.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1800_H__
#define __FS_1800_H__
// Accessor vtable getters
#define FS_OFFSET_1800_SDMMC_ACCESSOR_GC 0x18AB00
#define FS_OFFSET_1800_SDMMC_ACCESSOR_SD 0x18C800
#define FS_OFFSET_1800_SDMMC_ACCESSOR_NAND 0x18AFE0
// Hooks
#define FS_OFFSET_1800_SDMMC_WRAPPER_READ 0x186A50
#define FS_OFFSET_1800_SDMMC_WRAPPER_WRITE 0x186AB0
#define FS_OFFSET_1800_RTLD 0x2A3A4
#define FS_OFFSET_1800_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x44)))
#define FS_OFFSET_1800_CLKRST_SET_MIN_V_CLK_RATE 0x1A77D0
// Misc funcs
#define FS_OFFSET_1800_LOCK_MUTEX 0x17FCC0
#define FS_OFFSET_1800_UNLOCK_MUTEX 0x17FD10
#define FS_OFFSET_1800_SDMMC_WRAPPER_CONTROLLER_OPEN 0x186A10
#define FS_OFFSET_1800_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x186A30
// Misc Data
#define FS_OFFSET_1800_SD_MUTEX 0xFD13F0
#define FS_OFFSET_1800_NAND_MUTEX 0xFCCB28
#define FS_OFFSET_1800_ACTIVE_PARTITION 0xFCCB68
#define FS_OFFSET_1800_SDMMC_DAS_HANDLE 0xFB1950
// NOPs
#define FS_OFFSET_1800_SD_DAS_INIT 0x28F24
// Nintendo Paths
#define FS_OFFSET_1800_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00068B08, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x000758DC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007C77C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x000905C4, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1800_H__

59
emummc/source/FS/offsets/1800_exfat.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1800_EXFAT_H__
#define __FS_1800_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_1800_EXFAT_SDMMC_ACCESSOR_GC 0x195B90
#define FS_OFFSET_1800_EXFAT_SDMMC_ACCESSOR_SD 0x197890
#define FS_OFFSET_1800_EXFAT_SDMMC_ACCESSOR_NAND 0x196070
// Hooks
#define FS_OFFSET_1800_EXFAT_SDMMC_WRAPPER_READ 0x191AE0
#define FS_OFFSET_1800_EXFAT_SDMMC_WRAPPER_WRITE 0x191B40
#define FS_OFFSET_1800_EXFAT_RTLD 0x2A3A4
#define FS_OFFSET_1800_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x44)))
#define FS_OFFSET_1800_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1B2860
// Misc funcs
#define FS_OFFSET_1800_EXFAT_LOCK_MUTEX 0x18AD50
#define FS_OFFSET_1800_EXFAT_UNLOCK_MUTEX 0x18ADA0
#define FS_OFFSET_1800_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x191AA0
#define FS_OFFSET_1800_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x191AC0
// Misc Data
#define FS_OFFSET_1800_EXFAT_SD_MUTEX 0xFE33F0
#define FS_OFFSET_1800_EXFAT_NAND_MUTEX 0xFDEB28
#define FS_OFFSET_1800_EXFAT_ACTIVE_PARTITION 0xFDEB68
#define FS_OFFSET_1800_EXFAT_SDMMC_DAS_HANDLE 0xFBE950
// NOPs
#define FS_OFFSET_1800_EXFAT_SD_DAS_INIT 0x28F24
// Nintendo Paths
#define FS_OFFSET_1800_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00068B08, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x000758DC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007C77C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x000905C4, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1800_EXFAT_H__

59
emummc/source/FS/offsets/1810.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1810_H__
#define __FS_1810_H__
// Accessor vtable getters
#define FS_OFFSET_1810_SDMMC_ACCESSOR_GC 0x18AB00
#define FS_OFFSET_1810_SDMMC_ACCESSOR_SD 0x18C800
#define FS_OFFSET_1810_SDMMC_ACCESSOR_NAND 0x18AFE0
// Hooks
#define FS_OFFSET_1810_SDMMC_WRAPPER_READ 0x186A50
#define FS_OFFSET_1810_SDMMC_WRAPPER_WRITE 0x186AB0
#define FS_OFFSET_1810_RTLD 0x2A3A4
#define FS_OFFSET_1810_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x44)))
#define FS_OFFSET_1810_CLKRST_SET_MIN_V_CLK_RATE 0x1A77D0
// Misc funcs
#define FS_OFFSET_1810_LOCK_MUTEX 0x17FCC0
#define FS_OFFSET_1810_UNLOCK_MUTEX 0x17FD10
#define FS_OFFSET_1810_SDMMC_WRAPPER_CONTROLLER_OPEN 0x186A10
#define FS_OFFSET_1810_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x186A30
// Misc Data
#define FS_OFFSET_1810_SD_MUTEX 0xFD13F0
#define FS_OFFSET_1810_NAND_MUTEX 0xFCCB28
#define FS_OFFSET_1810_ACTIVE_PARTITION 0xFCCB68
#define FS_OFFSET_1810_SDMMC_DAS_HANDLE 0xFB1950
// NOPs
#define FS_OFFSET_1810_SD_DAS_INIT 0x28F24
// Nintendo Paths
#define FS_OFFSET_1810_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00068B08, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x000758DC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007C77C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x000905C4, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1810_H__

59
emummc/source/FS/offsets/1810_exfat.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1810_EXFAT_H__
#define __FS_1810_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_1810_EXFAT_SDMMC_ACCESSOR_GC 0x195B90
#define FS_OFFSET_1810_EXFAT_SDMMC_ACCESSOR_SD 0x197890
#define FS_OFFSET_1810_EXFAT_SDMMC_ACCESSOR_NAND 0x196070
// Hooks
#define FS_OFFSET_1810_EXFAT_SDMMC_WRAPPER_READ 0x191AE0
#define FS_OFFSET_1810_EXFAT_SDMMC_WRAPPER_WRITE 0x191B40
#define FS_OFFSET_1810_EXFAT_RTLD 0x2A3A4
#define FS_OFFSET_1810_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x44)))
#define FS_OFFSET_1810_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1B2860
// Misc funcs
#define FS_OFFSET_1810_EXFAT_LOCK_MUTEX 0x18AD50
#define FS_OFFSET_1810_EXFAT_UNLOCK_MUTEX 0x18ADA0
#define FS_OFFSET_1810_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x191AA0
#define FS_OFFSET_1810_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x191AC0
// Misc Data
#define FS_OFFSET_1810_EXFAT_SD_MUTEX 0xFE33F0
#define FS_OFFSET_1810_EXFAT_NAND_MUTEX 0xFDEB28
#define FS_OFFSET_1810_EXFAT_ACTIVE_PARTITION 0xFDEB68
#define FS_OFFSET_1810_EXFAT_SDMMC_DAS_HANDLE 0xFBE950
// NOPs
#define FS_OFFSET_1810_EXFAT_SD_DAS_INIT 0x28F24
// Nintendo Paths
#define FS_OFFSET_1810_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00068B08, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x000758DC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007C77C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x000905C4, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1810_EXFAT_H__

59
emummc/source/FS/offsets/1900.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1900_H__
#define __FS_1900_H__
// Accessor vtable getters
#define FS_OFFSET_1900_SDMMC_ACCESSOR_GC 0x195C00
#define FS_OFFSET_1900_SDMMC_ACCESSOR_SD 0x197F80
#define FS_OFFSET_1900_SDMMC_ACCESSOR_NAND 0x1963B0
// Hooks
#define FS_OFFSET_1900_SDMMC_WRAPPER_READ 0x191A70
#define FS_OFFSET_1900_SDMMC_WRAPPER_WRITE 0x191AD0
#define FS_OFFSET_1900_RTLD 0x275F0
#define FS_OFFSET_1900_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x50)))
#define FS_OFFSET_1900_CLKRST_SET_MIN_V_CLK_RATE 0x1B3880
// Misc funcs
#define FS_OFFSET_1900_LOCK_MUTEX 0x18AC20
#define FS_OFFSET_1900_UNLOCK_MUTEX 0x18AC70
#define FS_OFFSET_1900_SDMMC_WRAPPER_CONTROLLER_OPEN 0x191A30
#define FS_OFFSET_1900_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x191A50
// Misc Data
#define FS_OFFSET_1900_SD_MUTEX 0xFE1408
#define FS_OFFSET_1900_NAND_MUTEX 0xFDCB60
#define FS_OFFSET_1900_ACTIVE_PARTITION 0xFDCBA0
#define FS_OFFSET_1900_SDMMC_DAS_HANDLE 0xFC1908
// NOPs
#define FS_OFFSET_1900_SD_DAS_INIT 0x260C4
// Nintendo Paths
#define FS_OFFSET_1900_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00067FC8, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x00075D6C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007D1E8, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00092818, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1900_H__

59
emummc/source/FS/offsets/1900_exfat.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1900_EXFAT_H__
#define __FS_1900_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_1900_EXFAT_SDMMC_ACCESSOR_GC 0x1A1430
#define FS_OFFSET_1900_EXFAT_SDMMC_ACCESSOR_SD 0x1A37B0
#define FS_OFFSET_1900_EXFAT_SDMMC_ACCESSOR_NAND 0x1A1BE0
// Hooks
#define FS_OFFSET_1900_EXFAT_SDMMC_WRAPPER_READ 0x19D2A0
#define FS_OFFSET_1900_EXFAT_SDMMC_WRAPPER_WRITE 0x19D300
#define FS_OFFSET_1900_EXFAT_RTLD 0x275F0
#define FS_OFFSET_1900_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x50)))
#define FS_OFFSET_1900_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1BF0B0
// Misc funcs
#define FS_OFFSET_1900_EXFAT_LOCK_MUTEX 0x196450
#define FS_OFFSET_1900_EXFAT_UNLOCK_MUTEX 0x1964A0
#define FS_OFFSET_1900_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x19D260
#define FS_OFFSET_1900_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x19D280
// Misc Data
#define FS_OFFSET_1900_EXFAT_SD_MUTEX 0xFF4408
#define FS_OFFSET_1900_EXFAT_NAND_MUTEX 0xFEFB60
#define FS_OFFSET_1900_EXFAT_ACTIVE_PARTITION 0xFEFBA0
#define FS_OFFSET_1900_EXFAT_SDMMC_DAS_HANDLE 0xFCF908
// NOPs
#define FS_OFFSET_1900_EXFAT_SD_DAS_INIT 0x260C4
// Nintendo Paths
#define FS_OFFSET_1900_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00067FC8, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x00075D6C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007D1E8, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00092818, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1900_EXFAT_H__

59
emummc/source/FS/offsets/2000.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_2000_H__
#define __FS_2000_H__
// Accessor vtable getters
#define FS_OFFSET_2000_SDMMC_ACCESSOR_GC 0x1A7DB0
#define FS_OFFSET_2000_SDMMC_ACCESSOR_SD 0x1AA130
#define FS_OFFSET_2000_SDMMC_ACCESSOR_NAND 0x1A8560
// Hooks
#define FS_OFFSET_2000_SDMMC_WRAPPER_READ 0x1A3C20
#define FS_OFFSET_2000_SDMMC_WRAPPER_WRITE 0x1A3C80
#define FS_OFFSET_2000_RTLD 0x2B594
#define FS_OFFSET_2000_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
#define FS_OFFSET_2000_CLKRST_SET_MIN_V_CLK_RATE 0x1C6150
// Misc funcs
#define FS_OFFSET_2000_LOCK_MUTEX 0x19CD80
#define FS_OFFSET_2000_UNLOCK_MUTEX 0x19CDD0
#define FS_OFFSET_2000_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1A3BE0
#define FS_OFFSET_2000_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1A3C00
// Misc Data
#define FS_OFFSET_2000_SD_MUTEX 0xFF5408
#define FS_OFFSET_2000_NAND_MUTEX 0xFF0CF0
#define FS_OFFSET_2000_ACTIVE_PARTITION 0xFF0D30
#define FS_OFFSET_2000_SDMMC_DAS_HANDLE 0xFD2B08
// NOPs
#define FS_OFFSET_2000_SD_DAS_INIT 0x289F4
// Nintendo Paths
#define FS_OFFSET_2000_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x0006DB14, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007CE1C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00084A08, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0009AE48, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_2000_H__

59
emummc/source/FS/offsets/2000_exfat.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_2000_EXFAT_H__
#define __FS_2000_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_2000_EXFAT_SDMMC_ACCESSOR_GC 0x1B36D0
#define FS_OFFSET_2000_EXFAT_SDMMC_ACCESSOR_SD 0x1B5A50
#define FS_OFFSET_2000_EXFAT_SDMMC_ACCESSOR_NAND 0x1B3E80
// Hooks
#define FS_OFFSET_2000_EXFAT_SDMMC_WRAPPER_READ 0x1AF540
#define FS_OFFSET_2000_EXFAT_SDMMC_WRAPPER_WRITE 0x1AF5A0
#define FS_OFFSET_2000_EXFAT_RTLD 0x2B594
#define FS_OFFSET_2000_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
#define FS_OFFSET_2000_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1D1A70
// Misc funcs
#define FS_OFFSET_2000_EXFAT_LOCK_MUTEX 0x1A86A0
#define FS_OFFSET_2000_EXFAT_UNLOCK_MUTEX 0x1A86F0
#define FS_OFFSET_2000_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1AF500
#define FS_OFFSET_2000_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1AF520
// Misc Data
#define FS_OFFSET_2000_EXFAT_SD_MUTEX 0x1006408
#define FS_OFFSET_2000_EXFAT_NAND_MUTEX 0x1001CF0
#define FS_OFFSET_2000_EXFAT_ACTIVE_PARTITION 0x1001D30
#define FS_OFFSET_2000_EXFAT_SDMMC_DAS_HANDLE 0xFDFB08
// NOPs
#define FS_OFFSET_2000_EXFAT_SD_DAS_INIT 0x289F4
// Nintendo Paths
#define FS_OFFSET_2000_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x0006DB14, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007CE1C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00084A08, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0009AE48, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_2000_EXFAT_H__

59
emummc/source/FS/offsets/2010.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_2010_H__
#define __FS_2010_H__
// Accessor vtable getters
#define FS_OFFSET_2010_SDMMC_ACCESSOR_GC 0x1A7DB0
#define FS_OFFSET_2010_SDMMC_ACCESSOR_SD 0x1AA130
#define FS_OFFSET_2010_SDMMC_ACCESSOR_NAND 0x1A8560
// Hooks
#define FS_OFFSET_2010_SDMMC_WRAPPER_READ 0x1A3C20
#define FS_OFFSET_2010_SDMMC_WRAPPER_WRITE 0x1A3C80
#define FS_OFFSET_2010_RTLD 0x2B594
#define FS_OFFSET_2010_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
#define FS_OFFSET_2010_CLKRST_SET_MIN_V_CLK_RATE 0x1C6150
// Misc funcs
#define FS_OFFSET_2010_LOCK_MUTEX 0x19CD80
#define FS_OFFSET_2010_UNLOCK_MUTEX 0x19CDD0
#define FS_OFFSET_2010_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1A3BE0
#define FS_OFFSET_2010_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1A3C00
// Misc Data
#define FS_OFFSET_2010_SD_MUTEX 0xFF5408
#define FS_OFFSET_2010_NAND_MUTEX 0xFF0CF0
#define FS_OFFSET_2010_ACTIVE_PARTITION 0xFF0D30
#define FS_OFFSET_2010_SDMMC_DAS_HANDLE 0xFD2B08
// NOPs
#define FS_OFFSET_2010_SD_DAS_INIT 0x289F4
// Nintendo Paths
#define FS_OFFSET_2010_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x0006DB14, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007CE1C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00084A08, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0009AE48, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_2010_H__

59
emummc/source/FS/offsets/2010_exfat.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_2010_EXFAT_H__
#define __FS_2010_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_2010_EXFAT_SDMMC_ACCESSOR_GC 0x1B36D0
#define FS_OFFSET_2010_EXFAT_SDMMC_ACCESSOR_SD 0x1B5A50
#define FS_OFFSET_2010_EXFAT_SDMMC_ACCESSOR_NAND 0x1B3E80
// Hooks
#define FS_OFFSET_2010_EXFAT_SDMMC_WRAPPER_READ 0x1AF540
#define FS_OFFSET_2010_EXFAT_SDMMC_WRAPPER_WRITE 0x1AF5A0
#define FS_OFFSET_2010_EXFAT_RTLD 0x2B594
#define FS_OFFSET_2010_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
#define FS_OFFSET_2010_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1D1A70
// Misc funcs
#define FS_OFFSET_2010_EXFAT_LOCK_MUTEX 0x1A86A0
#define FS_OFFSET_2010_EXFAT_UNLOCK_MUTEX 0x1A86F0
#define FS_OFFSET_2010_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1AF500
#define FS_OFFSET_2010_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1AF520
// Misc Data
#define FS_OFFSET_2010_EXFAT_SD_MUTEX 0x1006408
#define FS_OFFSET_2010_EXFAT_NAND_MUTEX 0x1001CF0
#define FS_OFFSET_2010_EXFAT_ACTIVE_PARTITION 0x1001D30
#define FS_OFFSET_2010_EXFAT_SDMMC_DAS_HANDLE 0xFDFB08
// NOPs
#define FS_OFFSET_2010_EXFAT_SD_DAS_INIT 0x289F4
// Nintendo Paths
#define FS_OFFSET_2010_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x0006DB14, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007CE1C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00084A08, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0009AE48, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_2010_EXFAT_H__

View File

@ -18,6 +18,7 @@
#define _TYPES_H_ #define _TYPES_H_
#include <stdint.h> #include <stdint.h>
#include <stdbool.h>
#define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1)) #define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1))
#define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MAX(a, b) ((a) > (b) ? (a) : (b))
@ -58,12 +59,6 @@ typedef u32 Result; ///< Function error code result type.
#define INVALID_HANDLE ((Handle) 0) #define INVALID_HANDLE ((Handle) 0)
#define CUR_PROCESS_HANDLE ((Handle) 0xFFFF8001) #define CUR_PROCESS_HANDLE ((Handle) 0xFFFF8001)
#ifndef __cplusplus
typedef int bool;
#define true 1
#define false 0
#endif /* __cplusplus */
#define BOOT_CFG_AUTOBOOT_EN (1 << 0) #define BOOT_CFG_AUTOBOOT_EN (1 << 0)
#define BOOT_CFG_FROM_LAUNCH (1 << 1) #define BOOT_CFG_FROM_LAUNCH (1 << 1)
#define BOOT_CFG_SEPT_RUN (1 << 7) #define BOOT_CFG_SEPT_RUN (1 << 7)

View File

@ -15,13 +15,12 @@ ifneq ($(__RECURSIVE__),1)
export ATMOSPHERE_TOPDIR := $(CURRENT_DIRECTORY) export ATMOSPHERE_TOPDIR := $(CURRENT_DIRECTORY)
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) $(CURDIR)/include \ export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) $(CURDIR)/include \
$(foreach dir,$(DATA),$(CURDIR)/$(dir)) \ $(foreach dir,$(DATA),$(CURDIR)/$(dir))
$(CURRENT_DIRECTORY)/../program/$(ATMOSPHERE_OUT_DIR)
CFILES := $(call FIND_SOURCE_FILES,$(SOURCES),c) CFILES := $(call FIND_SOURCE_FILES,$(SOURCES),c)
CPPFILES := $(call FIND_SOURCE_FILES,$(SOURCES),cpp) CPPFILES := $(call FIND_SOURCE_FILES,$(SOURCES),cpp)
SFILES := $(call FIND_SOURCE_FILES,$(SOURCES),s) SFILES := $(call FIND_SOURCE_FILES,$(SOURCES),s)
BINFILES := program.lz4 boot_code.lz4 BINFILES :=
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C # use CXX for linking C++ projects, CC for standard C
@ -102,13 +101,7 @@ $(OUTPUT).elf : $(OFILES)
$(OFILES) : $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/$(ATMOSPHERE_LIBRARY_DIR)/libexosphere.a $(OFILES) : $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/$(ATMOSPHERE_LIBRARY_DIR)/libexosphere.a
program.lz4.o: program.lz4 secmon_loader_main.o: CXXFLAGS += --embed-dir="$(CURRENT_DIRECTORY)/../program/$(ATMOSPHERE_OUT_DIR)/"
@echo $(notdir $<)
@$(bin2o)
boot_code.lz4.o: boot_code.lz4
@echo $(notdir $<)
@$(bin2o)
%.elf: %.elf:
@echo linking $(notdir $@) @echo linking $(notdir $@)
@ -117,14 +110,6 @@ boot_code.lz4.o: boot_code.lz4
$(OFILES_SRC) : $(OFILES_BIN) $(OFILES_SRC) : $(OFILES_BIN)
#---------------------------------------------------------------------------------
# you need a rule like this for each extension you use as binary data
#---------------------------------------------------------------------------------
%.bin.o %_bin.h: %.bin
#---------------------------------------------------------------------------------
@echo $(notdir $<)
@$(bin2o)
-include $(DEPENDS) -include $(DEPENDS)
#--------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------

View File

@ -15,21 +15,31 @@
*/ */
#include <exosphere.hpp> #include <exosphere.hpp>
#include "secmon_loader_uncompress.hpp" #include "secmon_loader_uncompress.hpp"
#include "program_lz4.h"
#include "boot_code_lz4.h"
namespace ams::secmon::loader { namespace ams::secmon::loader {
NORETURN void UncompressAndExecute(const void *program, const void *boot_code) { namespace {
constexpr const u8 SecmonProgramLz4[] = {
#embed <program.lz4>
};
constexpr const u8 SecmonBootCodeLz4[] = {
#embed <boot_code.lz4>
};
}
NORETURN void UncompressAndExecute() {
/* Uncompress the program image. */ /* Uncompress the program image. */
Uncompress(secmon::MemoryRegionPhysicalTzramFullProgramImage.GetPointer(), secmon::MemoryRegionPhysicalTzramFullProgramImage.GetSize(), program, program_lz4_size); Uncompress(secmon::MemoryRegionPhysicalTzramFullProgramImage.GetPointer(), secmon::MemoryRegionPhysicalTzramFullProgramImage.GetSize(), SecmonProgramLz4, sizeof(SecmonProgramLz4));
/* Copy the boot image to the end of IRAM */ /* Copy the boot image to the end of IRAM */
u8 *relocated_boot_code = secmon::MemoryRegionPhysicalIramBootCodeImage.GetEndPointer<u8>() - boot_code_lz4_size; u8 *relocated_boot_code = secmon::MemoryRegionPhysicalIramBootCodeImage.GetEndPointer<u8>() - sizeof(SecmonBootCodeLz4);
std::memcpy(relocated_boot_code, boot_code, boot_code_lz4_size); std::memcpy(relocated_boot_code, SecmonBootCodeLz4, sizeof(SecmonBootCodeLz4));
/* Uncompress the boot image. */ /* Uncompress the boot image. */
Uncompress(secmon::MemoryRegionPhysicalIramBootCodeImage.GetPointer(), secmon::MemoryRegionPhysicalIramBootCodeImage.GetSize(), relocated_boot_code, boot_code_lz4_size); Uncompress(secmon::MemoryRegionPhysicalIramBootCodeImage.GetPointer(), secmon::MemoryRegionPhysicalIramBootCodeImage.GetSize(), relocated_boot_code, sizeof(SecmonBootCodeLz4));
/* Jump to the boot image. */ /* Jump to the boot image. */
reinterpret_cast<void (*)()>(secmon::MemoryRegionPhysicalIramBootCodeImage.GetAddress())(); reinterpret_cast<void (*)()>(secmon::MemoryRegionPhysicalIramBootCodeImage.GetAddress())();

View File

@ -98,8 +98,5 @@ _start:
ldr x20, =0x7C020000 ldr x20, =0x7C020000
mov sp, x20 mov sp, x20
adr x0, program_lz4
adr x1, boot_code_lz4
/* Uncompress the program and iram boot code images. */ /* Uncompress the program and iram boot code images. */
b _ZN3ams6secmon6loader20UncompressAndExecuteEPKvS3_ b _ZN3ams6secmon6loader20UncompressAndExecuteEv

View File

@ -62,7 +62,7 @@ namespace ams::secmon::fatal {
/* Write the context to the file. */ /* Write the context to the file. */
R_TRY(fs::WriteFile(file, 0, ctx, sizeof(*ctx), fs::WriteOption::Flush)); R_TRY(fs::WriteFile(file, 0, ctx, sizeof(*ctx), fs::WriteOption::Flush));
return ResultSuccess(); R_SUCCEED();
} }
} }

View File

@ -48,11 +48,11 @@ namespace ams::secmon::fatal {
//sdmmc::Deactivate(Port); //sdmmc::Deactivate(Port);
R_TRY(sdmmc::Activate(Port)); R_TRY(sdmmc::Activate(Port));
return ResultSuccess(); R_SUCCEED();
} }
Result CheckSdCardConnection(sdmmc::SpeedMode *out_sm, sdmmc::BusWidth *out_bw) { Result CheckSdCardConnection(sdmmc::SpeedMode *out_sm, sdmmc::BusWidth *out_bw) {
return sdmmc::CheckSdCardConnection(out_sm, out_bw, Port); R_RETURN(sdmmc::CheckSdCardConnection(out_sm, out_bw, Port));
} }
Result ReadSdCard(void *dst, size_t size, size_t sector_index, size_t sector_count) { Result ReadSdCard(void *dst, size_t size, size_t sector_index, size_t sector_count) {
@ -78,7 +78,7 @@ namespace ams::secmon::fatal {
sector_count -= cur_sectors; sector_count -= cur_sectors;
} }
return ResultSuccess(); R_SUCCEED();
} }
Result WriteSdCard(size_t sector_index, size_t sector_count, const void *src, size_t size) { Result WriteSdCard(size_t sector_index, size_t sector_count, const void *src, size_t size) {
@ -104,7 +104,7 @@ namespace ams::secmon::fatal {
sector_count -= cur_sectors; sector_count -= cur_sectors;
} }
return ResultSuccess(); R_SUCCEED();
} }
} }

View File

@ -34,45 +34,45 @@ namespace ams::fs {
Result TranslateFatFsError(FRESULT res) { Result TranslateFatFsError(FRESULT res) {
switch (res) { switch (res) {
case FR_OK: case FR_OK:
return ResultSuccess(); R_SUCCEED();
case FR_DISK_ERR: case FR_DISK_ERR:
return fs::ResultMmcAccessFailed(); R_THROW(fs::ResultMmcAccessFailed());
case FR_INT_ERR: case FR_INT_ERR:
return fs::ResultPreconditionViolation(); R_THROW(fs::ResultPreconditionViolation());
case FR_NOT_READY: case FR_NOT_READY:
return fs::ResultMmcAccessFailed(); R_THROW(fs::ResultMmcAccessFailed());
case FR_NO_FILE: case FR_NO_FILE:
return fs::ResultPathNotFound(); R_THROW(fs::ResultPathNotFound());
case FR_NO_PATH: case FR_NO_PATH:
return fs::ResultPathNotFound(); R_THROW(fs::ResultPathNotFound());
case FR_INVALID_NAME: case FR_INVALID_NAME:
return fs::ResultInvalidPath(); R_THROW(fs::ResultInvalidPath());
case FR_DENIED: case FR_DENIED:
return fs::ResultPermissionDenied(); R_THROW(fs::ResultPermissionDenied());
case FR_EXIST: case FR_EXIST:
return fs::ResultPathAlreadyExists(); R_THROW(fs::ResultPathAlreadyExists());
case FR_INVALID_OBJECT: case FR_INVALID_OBJECT:
return fs::ResultInvalidArgument(); R_THROW(fs::ResultInvalidArgument());
case FR_WRITE_PROTECTED: case FR_WRITE_PROTECTED:
return fs::ResultWriteNotPermitted(); R_THROW(fs::ResultWriteNotPermitted());
case FR_INVALID_DRIVE: case FR_INVALID_DRIVE:
return fs::ResultInvalidMountName(); R_THROW(fs::ResultInvalidMountName());
case FR_NOT_ENABLED: case FR_NOT_ENABLED:
return fs::ResultInvalidMountName(); /* BAD/TODO */ R_THROW(fs::ResultInvalidMountName()); /* BAD/TODO */
case FR_NO_FILESYSTEM: case FR_NO_FILESYSTEM:
return fs::ResultInvalidMountName(); /* BAD/TODO */ R_THROW(fs::ResultInvalidMountName()); /* BAD/TODO */
case FR_TIMEOUT: case FR_TIMEOUT:
return fs::ResultTargetLocked(); /* BAD/TODO */ R_THROW(fs::ResultTargetLocked()); /* BAD/TODO */
case FR_LOCKED: case FR_LOCKED:
return fs::ResultTargetLocked(); R_THROW(fs::ResultTargetLocked());
case FR_NOT_ENOUGH_CORE: case FR_NOT_ENOUGH_CORE:
return fs::ResultPreconditionViolation(); /* BAD/TODO */ R_THROW(fs::ResultPreconditionViolation()); /* BAD/TODO */
case FR_TOO_MANY_OPEN_FILES: case FR_TOO_MANY_OPEN_FILES:
return fs::ResultPreconditionViolation(); /* BAD/TODO */ R_THROW(fs::ResultPreconditionViolation()); /* BAD/TODO */
case FR_INVALID_PARAMETER: case FR_INVALID_PARAMETER:
return fs::ResultInvalidArgument(); R_THROW(fs::ResultInvalidArgument());
default: default:
return fs::ResultInternal(); R_THROW(fs::ResultInternal());
} }
} }
@ -125,11 +125,11 @@ namespace ams::fs {
/* Expand the file. */ /* Expand the file. */
R_TRY(TranslateFatFsError(f_expand(std::addressof(fp), size, 1))); R_TRY(TranslateFatFsError(f_expand(std::addressof(fp), size, 1)));
return ResultSuccess(); R_SUCCEED();
} }
Result CreateDirectory(const char *path) { Result CreateDirectory(const char *path) {
return TranslateFatFsError(f_mkdir(path)); R_RETURN(TranslateFatFsError(f_mkdir(path)));
} }
Result OpenFile(FileHandle *out_file, const char *path, int mode) { Result OpenFile(FileHandle *out_file, const char *path, int mode) {
@ -144,10 +144,10 @@ namespace ams::fs {
out_file->_handle = fp; out_file->_handle = fp;
g_files_opened[i] = true; g_files_opened[i] = true;
g_open_modes[i] = mode; g_open_modes[i] = mode;
return ResultSuccess(); R_SUCCEED();
} }
} }
return fs::ResultOpenCountLimit(); R_THROW(fs::ResultOpenCountLimit());
} }
Result ReadFile(FileHandle handle, s64 offset, void *buffer, size_t size, const fs::ReadOption &option) { Result ReadFile(FileHandle handle, s64 offset, void *buffer, size_t size, const fs::ReadOption &option) {
@ -164,11 +164,11 @@ namespace ams::fs {
/* Check that we read the correct amount. */ /* Check that we read the correct amount. */
R_UNLESS(br == size, fs::ResultOutOfRange()); R_UNLESS(br == size, fs::ResultOutOfRange());
return ResultSuccess(); R_SUCCEED();
} }
Result ReadFile(FileHandle handle, s64 offset, void *buffer, size_t size) { Result ReadFile(FileHandle handle, s64 offset, void *buffer, size_t size) {
return ReadFile(handle, offset, buffer, size, fs::ReadOption::None); R_RETURN(ReadFile(handle, offset, buffer, size, fs::ReadOption::None));
} }
Result ReadFile(size_t *out, FileHandle handle, s64 offset, void *buffer, size_t size, const fs::ReadOption &option) { Result ReadFile(size_t *out, FileHandle handle, s64 offset, void *buffer, size_t size, const fs::ReadOption &option) {
@ -185,21 +185,21 @@ namespace ams::fs {
/* Set the output size. */ /* Set the output size. */
*out = br; *out = br;
return ResultSuccess(); R_SUCCEED();
} }
Result ReadFile(size_t *out, FileHandle handle, s64 offset, void *buffer, size_t size) { Result ReadFile(size_t *out, FileHandle handle, s64 offset, void *buffer, size_t size) {
return ReadFile(out, handle, offset, buffer, size, fs::ReadOption::None); R_RETURN(ReadFile(out, handle, offset, buffer, size, fs::ReadOption::None));
} }
Result GetFileSize(s64 *out, FileHandle handle) { Result GetFileSize(s64 *out, FileHandle handle) {
FIL *fp = GetInternalFile(handle); FIL *fp = GetInternalFile(handle);
*out = f_size(fp); *out = f_size(fp);
return ResultSuccess(); R_SUCCEED();
} }
Result FlushFile(FileHandle handle) { Result FlushFile(FileHandle handle) {
return TranslateFatFsError(f_sync(GetInternalFile(handle))); R_RETURN(TranslateFatFsError(f_sync(GetInternalFile(handle))));
} }
Result WriteFile(FileHandle handle, s64 offset, const void *buffer, size_t size, const fs::WriteOption &option) { Result WriteFile(FileHandle handle, s64 offset, const void *buffer, size_t size, const fs::WriteOption &option) {
@ -218,7 +218,7 @@ namespace ams::fs {
R_TRY(FlushFile(handle)); R_TRY(FlushFile(handle));
} }
return ResultSuccess(); R_SUCCEED();
} }
Result SetFileSize(FileHandle handle, s64 size) { Result SetFileSize(FileHandle handle, s64 size) {
@ -242,7 +242,7 @@ namespace ams::fs {
/* Check that our expansion succeeded. */ /* Check that our expansion succeeded. */
AMS_ASSERT(f_size(fp) == static_cast<FSIZE_t>(size)); AMS_ASSERT(f_size(fp) == static_cast<FSIZE_t>(size));
return ResultSuccess(); R_SUCCEED();
} }
int GetFileOpenMode(FileHandle handle) { int GetFileOpenMode(FileHandle handle) {

View File

@ -106,6 +106,7 @@ SECTIONS
.debug_code : { .debug_code : {
KEEP (*(.text._ZN3ams3log6PrintfEPKcz .text._ZN3ams3log7VPrintfEPKcSt9__va_list .text._ZN3ams3log4DumpEPKvm)) KEEP (*(.text._ZN3ams3log6PrintfEPKcz .text._ZN3ams3log7VPrintfEPKcSt9__va_list .text._ZN3ams3log4DumpEPKvm))
KEEP (*(.text._ZN3ams4util10TVSNPrintfEPcmPKcSt9__va_list .text._ZN3ams4util12_GLOBAL__N_114TVSNPrintfImplEPcmPKcSt9__va_list .text._ZZN3ams4util12_GLOBAL__N_114TVSNPrintfImplEPcmPKcSt9__va_listENKUlbmE3_clEbm)) KEEP (*(.text._ZN3ams4util10TVSNPrintfEPcmPKcSt9__va_list .text._ZN3ams4util12_GLOBAL__N_114TVSNPrintfImplEPcmPKcSt9__va_list .text._ZZN3ams4util12_GLOBAL__N_114TVSNPrintfImplEPcmPKcSt9__va_listENKUlbmE3_clEbm))
KEEP (*(.text._ZN3ams4util12_GLOBAL__N_1L14TVSNPrintfImplEPcmPKcSt9__va_list .text._ZZN3ams4util12_GLOBAL__N_1L14TVSNPrintfImplEPcmPKcSt9__va_listENKUlbmE_clEbm))
KEEP(secmon_exception_handler.o(.text*)) KEEP(secmon_exception_handler.o(.text*))
secmon_exception_handler.o(.rodata*) secmon_exception_handler.o(.rodata*)
secmon_exception_handler.o(.data*) secmon_exception_handler.o(.data*)

View File

@ -85,10 +85,10 @@ _ZN3ams6secmon4boot15VolatileKeyDataE:
/* We can get away with only including latest because exosphere supports newer-than-expected master key in engine. */ /* We can get away with only including latest because exosphere supports newer-than-expected master key in engine. */
/* TODO: Update on next change of keys. */ /* TODO: Update on next change of keys. */
/* Mariko Development Master Kek Source. */ /* Mariko Development Master Kek Source. */
.byte 0xEC, 0x5E, 0xB5, 0x11, 0xD5, 0x43, 0x1E, 0x6A, 0x4E, 0x54, 0x6F, 0xD4, 0xD3, 0x22, 0xCE, 0x87 .byte 0x8C, 0x2E, 0xC1, 0x1C, 0xA0, 0x28, 0x35, 0xFC, 0x9A, 0x9F, 0x1D, 0x9B, 0x4E, 0xDF, 0x1E, 0x03
/* Mariko Production Master Kek Source. */ /* Mariko Production Master Kek Source. */
.byte 0xD2, 0x68, 0xC6, 0x53, 0x9D, 0x94, 0xF9, 0xA8, 0xA5, 0xA8, 0xA7, 0xC8, 0x8F, 0x53, 0x4B, 0x7A .byte 0x1A, 0x31, 0x62, 0x87, 0xA8, 0x09, 0xCA, 0xF8, 0x69, 0x15, 0x45, 0xC2, 0x6B, 0xAA, 0x5A, 0x8A
/* Development Master Key Vectors. */ /* Development Master Key Vectors. */
.byte 0x46, 0x22, 0xB4, 0x51, 0x9A, 0x7E, 0xA7, 0x7F, 0x62, 0xA1, 0x1F, 0x8F, 0xC5, 0x3A, 0xDB, 0xFE /* Zeroes encrypted with Master Key 00. */ .byte 0x46, 0x22, 0xB4, 0x51, 0x9A, 0x7E, 0xA7, 0x7F, 0x62, 0xA1, 0x1F, 0x8F, 0xC5, 0x3A, 0xDB, 0xFE /* Zeroes encrypted with Master Key 00. */
@ -105,6 +105,12 @@ _ZN3ams6secmon4boot15VolatileKeyDataE:
.byte 0x21, 0x88, 0x6B, 0x10, 0x9E, 0x83, 0xD6, 0x52, 0xAB, 0x08, 0xDB, 0x6D, 0x39, 0xFF, 0x1C, 0x9C /* Master key 0A encrypted with Master key 0B. */ .byte 0x21, 0x88, 0x6B, 0x10, 0x9E, 0x83, 0xD6, 0x52, 0xAB, 0x08, 0xDB, 0x6D, 0x39, 0xFF, 0x1C, 0x9C /* Master key 0A encrypted with Master key 0B. */
.byte 0x8A, 0xCE, 0xC4, 0x7F, 0xBE, 0x08, 0x61, 0x88, 0xD3, 0x73, 0x64, 0x51, 0xE2, 0xB6, 0x53, 0x15 /* Master key 0B encrypted with Master key 0C. */ .byte 0x8A, 0xCE, 0xC4, 0x7F, 0xBE, 0x08, 0x61, 0x88, 0xD3, 0x73, 0x64, 0x51, 0xE2, 0xB6, 0x53, 0x15 /* Master key 0B encrypted with Master key 0C. */
.byte 0x08, 0xE0, 0xF4, 0xBE, 0xAA, 0x6E, 0x5A, 0xC3, 0xA6, 0xBC, 0xFE, 0xB9, 0xE2, 0xA3, 0x24, 0x12 /* Master key 0C encrypted with Master key 0D. */ .byte 0x08, 0xE0, 0xF4, 0xBE, 0xAA, 0x6E, 0x5A, 0xC3, 0xA6, 0xBC, 0xFE, 0xB9, 0xE2, 0xA3, 0x24, 0x12 /* Master key 0C encrypted with Master key 0D. */
.byte 0xD6, 0x80, 0x98, 0xC0, 0xFA, 0xC7, 0x13, 0xCB, 0x93, 0xD2, 0x0B, 0x82, 0x4C, 0xA1, 0x7B, 0x8D /* Master key 0D encrypted with Master key 0E. */
.byte 0x78, 0x66, 0x19, 0xBD, 0x86, 0xE7, 0xC1, 0x09, 0x9B, 0x6F, 0x92, 0xB2, 0x58, 0x7D, 0xCF, 0x26 /* Master key 0E encrypted with Master key 0F. */
.byte 0x39, 0x1E, 0x7E, 0xF8, 0x7E, 0x73, 0xEA, 0x6F, 0xAF, 0x00, 0x3A, 0xB4, 0xAA, 0xB8, 0xB7, 0x59 /* Master key 0F encrypted with Master key 10. */
.byte 0x0C, 0x75, 0x39, 0x15, 0x53, 0xEA, 0x81, 0x11, 0xA3, 0xE0, 0xDC, 0x3D, 0x0E, 0x76, 0xC6, 0xB8 /* Master key 10 encrypted with Master key 11. */
.byte 0x90, 0x64, 0xF9, 0x08, 0x29, 0x88, 0xD4, 0xDC, 0x73, 0xA4, 0xA1, 0x13, 0x9E, 0x59, 0x85, 0xA0 /* Master key 11 encrypted with Master key 12. */
.byte 0x94, 0x46, 0x3B, 0xFA, 0x7D, 0xB9, 0xE2, 0x94, 0xC2, 0x9D, 0xB9, 0xA4, 0xB2, 0x56, 0xCA, 0xFE /* Master key 12 encrypted with Master key 13. */
/* Production Master Key Vectors. */ /* Production Master Key Vectors. */
.byte 0x0C, 0xF0, 0x59, 0xAC, 0x85, 0xF6, 0x26, 0x65, 0xE1, 0xE9, 0x19, 0x55, 0xE6, 0xF2, 0x67, 0x3D /* Zeroes encrypted with Master Key 00. */ .byte 0x0C, 0xF0, 0x59, 0xAC, 0x85, 0xF6, 0x26, 0x65, 0xE1, 0xE9, 0x19, 0x55, 0xE6, 0xF2, 0x67, 0x3D /* Zeroes encrypted with Master Key 00. */
@ -121,6 +127,12 @@ _ZN3ams6secmon4boot15VolatileKeyDataE:
.byte 0xC1, 0x8D, 0x16, 0xBB, 0x2A, 0xE4, 0x1D, 0xD4, 0xC2, 0xC1, 0xB6, 0x40, 0x94, 0x35, 0x63, 0x98 /* Master key 0A encrypted with Master key 0B. */ .byte 0xC1, 0x8D, 0x16, 0xBB, 0x2A, 0xE4, 0x1D, 0xD4, 0xC2, 0xC1, 0xB6, 0x40, 0x94, 0x35, 0x63, 0x98 /* Master key 0A encrypted with Master key 0B. */
.byte 0xA3, 0x24, 0x65, 0x75, 0xEA, 0xCC, 0x6E, 0x8D, 0xFB, 0x5A, 0x16, 0x50, 0x74, 0xD2, 0x15, 0x06 /* Master key 0B encrypted with Master key 0C. */ .byte 0xA3, 0x24, 0x65, 0x75, 0xEA, 0xCC, 0x6E, 0x8D, 0xFB, 0x5A, 0x16, 0x50, 0x74, 0xD2, 0x15, 0x06 /* Master key 0B encrypted with Master key 0C. */
.byte 0x83, 0x67, 0xAF, 0x01, 0xCF, 0x93, 0xA1, 0xAB, 0x80, 0x45, 0xF7, 0x3F, 0x72, 0xFD, 0x3B, 0x38 /* Master key 0C encrypted with Master key 0D. */ .byte 0x83, 0x67, 0xAF, 0x01, 0xCF, 0x93, 0xA1, 0xAB, 0x80, 0x45, 0xF7, 0x3F, 0x72, 0xFD, 0x3B, 0x38 /* Master key 0C encrypted with Master key 0D. */
.byte 0xB1, 0x81, 0xA6, 0x0D, 0x72, 0xC7, 0xEE, 0x15, 0x21, 0xF3, 0xC0, 0xB5, 0x6B, 0x61, 0x6D, 0xE7 /* Master key 0D encrypted with Master key 0E. */
.byte 0xAF, 0x11, 0x4C, 0x67, 0x17, 0x7A, 0x52, 0x43, 0xF7, 0x70, 0x2F, 0xC7, 0xEF, 0x81, 0x72, 0x16 /* Master key 0E encrypted with Master key 0F. */
.byte 0x25, 0x12, 0x8B, 0xCB, 0xB5, 0x46, 0xA1, 0xF8, 0xE0, 0x52, 0x15, 0xB7, 0x0B, 0x57, 0x00, 0xBD /* Master key 0F encrypted with Master key 10. */
.byte 0x58, 0x15, 0xD2, 0xF6, 0x8A, 0xE8, 0x19, 0xAB, 0xFB, 0x2D, 0x52, 0x9D, 0xE7, 0x55, 0xF3, 0x93 /* Master key 10 encrypted with Master key 11. */
.byte 0x4A, 0x01, 0x3B, 0xC7, 0x44, 0x6E, 0x45, 0xBD, 0xE6, 0x5E, 0x2B, 0xEC, 0x07, 0x37, 0x52, 0x86 /* Master key 11 encrypted with Master key 12. */
.byte 0x97, 0xE4, 0x11, 0xAB, 0x22, 0x72, 0x1A, 0x1F, 0x70, 0x5C, 0x00, 0xB3, 0x96, 0x30, 0x05, 0x28 /* Master key 12 encrypted with Master key 13. */
/* Device Master Key Source Sources. */ /* Device Master Key Source Sources. */
.byte 0x8B, 0x4E, 0x1C, 0x22, 0x42, 0x07, 0xC8, 0x73, 0x56, 0x94, 0x08, 0x8B, 0xCC, 0x47, 0x0F, 0x5D /* 4.0.0 Device Master Key Source Source. */ .byte 0x8B, 0x4E, 0x1C, 0x22, 0x42, 0x07, 0xC8, 0x73, 0x56, 0x94, 0x08, 0x8B, 0xCC, 0x47, 0x0F, 0x5D /* 4.0.0 Device Master Key Source Source. */
@ -134,6 +146,12 @@ _ZN3ams6secmon4boot15VolatileKeyDataE:
.byte 0xAA, 0xFD, 0xBC, 0xBB, 0x25, 0xC3, 0xA4, 0xEF, 0xE3, 0xEE, 0x58, 0x53, 0xB7, 0xF8, 0xDD, 0xD6 /* 12.1.0 Device Master Key Source Source. */ .byte 0xAA, 0xFD, 0xBC, 0xBB, 0x25, 0xC3, 0xA4, 0xEF, 0xE3, 0xEE, 0x58, 0x53, 0xB7, 0xF8, 0xDD, 0xD6 /* 12.1.0 Device Master Key Source Source. */
.byte 0xE4, 0xF3, 0x45, 0x6F, 0x18, 0xA1, 0x89, 0xF8, 0xDA, 0x4C, 0x64, 0x75, 0x68, 0xE6, 0xBD, 0x4F /* 13.0.0 Device Master Key Source Source. */ .byte 0xE4, 0xF3, 0x45, 0x6F, 0x18, 0xA1, 0x89, 0xF8, 0xDA, 0x4C, 0x64, 0x75, 0x68, 0xE6, 0xBD, 0x4F /* 13.0.0 Device Master Key Source Source. */
.byte 0x5B, 0x94, 0x63, 0xF7, 0xAD, 0x96, 0x1B, 0xA6, 0x23, 0x30, 0x06, 0x4D, 0x01, 0xE4, 0xCE, 0x1D /* 14.0.0 Device Master Key Source Source. */ .byte 0x5B, 0x94, 0x63, 0xF7, 0xAD, 0x96, 0x1B, 0xA6, 0x23, 0x30, 0x06, 0x4D, 0x01, 0xE4, 0xCE, 0x1D /* 14.0.0 Device Master Key Source Source. */
.byte 0x5E, 0xC9, 0xC5, 0x0A, 0xD0, 0x5F, 0x8B, 0x7B, 0xA7, 0x39, 0xEA, 0xBC, 0x60, 0x0F, 0x74, 0xE6 /* 15.0.0 Device Master Key Source Source. */
.byte 0xEA, 0x90, 0x6E, 0xA8, 0xAE, 0x92, 0x99, 0x64, 0x36, 0xC1, 0xF3, 0x1C, 0xC6, 0x32, 0x83, 0x8C /* 16.0.0 Device Master Key Source Source. */
.byte 0xDA, 0xB9, 0xD6, 0x77, 0x52, 0x2D, 0x1F, 0x78, 0x73, 0xC9, 0x98, 0x5B, 0x06, 0xFE, 0xA0, 0x52 /* 17.0.0 Device Master Key Source Source. */
.byte 0x14, 0xF5, 0xA5, 0xD0, 0x73, 0x6D, 0x44, 0x80, 0x5F, 0x31, 0x5A, 0x8F, 0x1E, 0xD4, 0x0D, 0x63 /* 18.0.0 Device Master Key Source Source. */
.byte 0x07, 0x38, 0x9A, 0xEC, 0x9C, 0xBD, 0x50, 0x4A, 0x4C, 0x1F, 0x04, 0xDA, 0x40, 0x68, 0x29, 0xE3 /* 19.0.0 Device Master Key Source Source. */
.byte 0xA3, 0x6B, 0x0A, 0xB5, 0x6F, 0x57, 0x4C, 0x5E, 0x00, 0xFD, 0x56, 0x21, 0xF5, 0x06, 0x6B, 0xD1 /* 20.0.0 Device Master Key Source Source. */
/* Development Device Master Kek Sources. */ /* Development Device Master Kek Sources. */
.byte 0xD6, 0xBD, 0x9F, 0xC6, 0x18, 0x09, 0xE1, 0x96, 0x20, 0x39, 0x60, 0xD2, 0x89, 0x83, 0x31, 0x34 /* 4.0.0 Device Master Kek Source. */ .byte 0xD6, 0xBD, 0x9F, 0xC6, 0x18, 0x09, 0xE1, 0x96, 0x20, 0x39, 0x60, 0xD2, 0x89, 0x83, 0x31, 0x34 /* 4.0.0 Device Master Kek Source. */
@ -147,6 +165,12 @@ _ZN3ams6secmon4boot15VolatileKeyDataE:
.byte 0xC4, 0xBB, 0xF3, 0x9F, 0xA3, 0xAA, 0x00, 0x99, 0x7C, 0x97, 0xAD, 0x91, 0x8F, 0xE8, 0x45, 0xCB /* 12.1.0 Device Master Kek Source. */ .byte 0xC4, 0xBB, 0xF3, 0x9F, 0xA3, 0xAA, 0x00, 0x99, 0x7C, 0x97, 0xAD, 0x91, 0x8F, 0xE8, 0x45, 0xCB /* 12.1.0 Device Master Kek Source. */
.byte 0x20, 0x20, 0xAA, 0xFB, 0x89, 0xC2, 0xF0, 0x70, 0xB5, 0xE0, 0xA3, 0x11, 0x8A, 0x29, 0x8D, 0x0F /* 13.0.0 Device Master Kek Source. */ .byte 0x20, 0x20, 0xAA, 0xFB, 0x89, 0xC2, 0xF0, 0x70, 0xB5, 0xE0, 0xA3, 0x11, 0x8A, 0x29, 0x8D, 0x0F /* 13.0.0 Device Master Kek Source. */
.byte 0xCE, 0x14, 0x74, 0x66, 0x98, 0xA8, 0x6D, 0x7D, 0xBD, 0x54, 0x91, 0x68, 0x5F, 0x1D, 0x0E, 0xEA /* 14.0.0 Device Master Kek Source. */ .byte 0xCE, 0x14, 0x74, 0x66, 0x98, 0xA8, 0x6D, 0x7D, 0xBD, 0x54, 0x91, 0x68, 0x5F, 0x1D, 0x0E, 0xEA /* 14.0.0 Device Master Kek Source. */
.byte 0xAE, 0x05, 0x48, 0x65, 0xAB, 0x17, 0x9D, 0x3D, 0x51, 0xB7, 0x56, 0xBD, 0x9B, 0x0B, 0x5B, 0x6E /* 15.0.0 Device Master Kek Source. */
.byte 0xFF, 0xF6, 0x4B, 0x0F, 0xFF, 0x0D, 0xC0, 0x4F, 0x56, 0x8A, 0x40, 0x74, 0x67, 0xC5, 0xFE, 0x9F /* 16.0.0 Device Master Kek Source. */
.byte 0x4E, 0xCE, 0x7B, 0x2A, 0xEA, 0x2E, 0x3D, 0x16, 0xD5, 0x2A, 0xDE, 0xF6, 0xF8, 0x6A, 0x7D, 0x43 /* 17.0.0 Device Master Kek Source. */
.byte 0x3B, 0x00, 0x89, 0xD7, 0xA9, 0x9E, 0xB7, 0x70, 0x86, 0x00, 0xC3, 0x49, 0x52, 0x8C, 0xA4, 0xAF /* 18.0.0 Device Master Kek Source. */
.byte 0xAE, 0x78, 0x36, 0xB6, 0x91, 0xEB, 0xAF, 0x9C, 0x18, 0xF1, 0xC0, 0xD5, 0x8A, 0x0C, 0x7C, 0xA1 /* 19.0.0 Device Master Kek Source. */
.byte 0x09, 0x12, 0x4F, 0x26, 0x90, 0xB9, 0xA6, 0xF5, 0xA5, 0x18, 0x74, 0xB6, 0x8D, 0x80, 0x59, 0x3D /* 20.0.0 Device Master Kek Source. */
/* Production Device Master Kek Sources. */ /* Production Device Master Kek Sources. */
.byte 0x88, 0x62, 0x34, 0x6E, 0xFA, 0xF7, 0xD8, 0x3F, 0xE1, 0x30, 0x39, 0x50, 0xF0, 0xB7, 0x5D, 0x5D /* 4.0.0 Device Master Kek Source. */ .byte 0x88, 0x62, 0x34, 0x6E, 0xFA, 0xF7, 0xD8, 0x3F, 0xE1, 0x30, 0x39, 0x50, 0xF0, 0xB7, 0x5D, 0x5D /* 4.0.0 Device Master Kek Source. */
@ -160,3 +184,9 @@ _ZN3ams6secmon4boot15VolatileKeyDataE:
.byte 0xC2, 0x65, 0x34, 0x6E, 0xC7, 0xC6, 0x5D, 0x97, 0x3E, 0x34, 0x5C, 0x6B, 0xB3, 0x7E, 0xC6, 0xE3 /* 12.1.0 Device Master Kek Source. */ .byte 0xC2, 0x65, 0x34, 0x6E, 0xC7, 0xC6, 0x5D, 0x97, 0x3E, 0x34, 0x5C, 0x6B, 0xB3, 0x7E, 0xC6, 0xE3 /* 12.1.0 Device Master Kek Source. */
.byte 0x77, 0x52, 0x92, 0xF0, 0xAA, 0xE3, 0xFB, 0xE0, 0x60, 0x16, 0xB3, 0x78, 0x68, 0x53, 0xF7, 0xA8 /* 13.0.0 Device Master Kek Source. */ .byte 0x77, 0x52, 0x92, 0xF0, 0xAA, 0xE3, 0xFB, 0xE0, 0x60, 0x16, 0xB3, 0x78, 0x68, 0x53, 0xF7, 0xA8 /* 13.0.0 Device Master Kek Source. */
.byte 0x67, 0xD5, 0xD6, 0x0C, 0x08, 0xF5, 0xA3, 0x11, 0xBD, 0x6D, 0x5A, 0xEB, 0x96, 0x24, 0xB0, 0xD2 /* 14.0.0 Device Master Kek Source. */ .byte 0x67, 0xD5, 0xD6, 0x0C, 0x08, 0xF5, 0xA3, 0x11, 0xBD, 0x6D, 0x5A, 0xEB, 0x96, 0x24, 0xB0, 0xD2 /* 14.0.0 Device Master Kek Source. */
.byte 0x7C, 0x30, 0xED, 0x8B, 0x39, 0x25, 0x2C, 0x08, 0x8F, 0x48, 0xDC, 0x28, 0xE6, 0x1A, 0x6B, 0x49 /* 15.0.0 Device Master Kek Source. */
.byte 0xF0, 0xF3, 0xFF, 0x52, 0x75, 0x2F, 0xBA, 0x4D, 0x09, 0x72, 0x30, 0x89, 0xA9, 0xDF, 0xFE, 0x1F /* 16.0.0 Device Master Kek Source. */
.byte 0x21, 0xD6, 0x35, 0xF1, 0x0F, 0x7A, 0xF0, 0x5D, 0xDF, 0x79, 0x1C, 0x7A, 0xE4, 0x32, 0x82, 0x9E /* 17.0.0 Device Master Kek Source. */
.byte 0xE7, 0x85, 0x8C, 0xA2, 0xF4, 0x49, 0xCB, 0x07, 0xD1, 0x8E, 0x48, 0x1B, 0xE8, 0x1E, 0x28, 0x3B /* 18.0.0 Device Master Kek Source. */
.byte 0x9B, 0xA5, 0xFD, 0x74, 0x7F, 0xCD, 0x23, 0xD1, 0xD9, 0xBD, 0x6C, 0x51, 0x72, 0x5F, 0x3D, 0x1F /* 19.0.0 Device Master Kek Source. */
.byte 0xDA, 0xFB, 0x61, 0x39, 0x48, 0x2D, 0xC2, 0x7E, 0x0D, 0x8E, 0x8F, 0x98, 0x57, 0x20, 0xB8, 0x15 /* 20.0.0 Device Master Kek Source. */

View File

@ -94,7 +94,7 @@ namespace ams::secmon::boot {
} }
/* Check that the key generation is one that we can use. */ /* Check that the key generation is one that we can use. */
static_assert(pkg1::KeyGeneration_Count == 14); static_assert(pkg1::KeyGeneration_Count == 20);
if (key_generation >= pkg1::KeyGeneration_Count) { if (key_generation >= pkg1::KeyGeneration_Count) {
return false; return false;
} }

View File

@ -70,6 +70,15 @@ namespace ams::secmon {
} }
void PerformUserRebootByPmic() {
/* Ensure that i2c-5 is usable for communicating with the pmic. */
clkrst::EnableI2c5Clock();
i2c::Initialize(i2c::Port_5);
/* Reboot. */
pmic::ShutdownSystem(true);
}
void PerformUserRebootToRcm() { void PerformUserRebootToRcm() {
/* Configure the bootrom to boot to rcm. */ /* Configure the bootrom to boot to rcm. */
reg::Write(PMC + APBDEV_PMC_SCRATCH0, 0x2); reg::Write(PMC + APBDEV_PMC_SCRATCH0, 0x2);
@ -100,11 +109,20 @@ namespace ams::secmon {
} }
void PerformUserShutDown() { void PerformUserShutDown() {
if (fuse::GetSocType() == fuse::SocType_Mariko) {
/* Ensure that i2c-5 is usable for communicating with the pmic. */
clkrst::EnableI2c5Clock();
i2c::Initialize(i2c::Port_5);
/* On Mariko shutdown via pmic. */
pmic::ShutdownSystem(false);
} else /* if (fuse::GetSocType() == fuse::SocType_Erista) */ {
/* Load our reboot stub to iram. */ /* Load our reboot stub to iram. */
LoadRebootStub(RebootStubAction_ShutDown); LoadRebootStub(RebootStubAction_ShutDown);
/* Reboot. */ /* Reboot. */
PerformPmcReboot(); PerformPmcReboot();
} }
}
} }

View File

@ -23,11 +23,13 @@ namespace ams::secmon {
UserRebootType_ToRcm = 1, UserRebootType_ToRcm = 1,
UserRebootType_ToPayload = 2, UserRebootType_ToPayload = 2,
UserRebootType_ToFatalError = 3, UserRebootType_ToFatalError = 3,
UserRebootType_ByPmic = 4,
}; };
void PerformUserRebootToRcm(); void PerformUserRebootToRcm();
void PerformUserRebootToPayload(); void PerformUserRebootToPayload();
void PerformUserRebootToFatalError(); void PerformUserRebootToFatalError();
void PerformUserRebootByPmic();
void PerformUserShutDown(); void PerformUserShutDown();
} }

View File

@ -161,6 +161,7 @@ namespace ams::secmon::smc {
constexpr const u8 EsCommonKeySources[EsCommonKeyType_Count][AesKeySize] = { constexpr const u8 EsCommonKeySources[EsCommonKeyType_Count][AesKeySize] = {
[EsCommonKeyType_TitleKey] = { 0x1E, 0xDC, 0x7B, 0x3B, 0x60, 0xE6, 0xB4, 0xD8, 0x78, 0xB8, 0x17, 0x15, 0x98, 0x5E, 0x62, 0x9B }, [EsCommonKeyType_TitleKey] = { 0x1E, 0xDC, 0x7B, 0x3B, 0x60, 0xE6, 0xB4, 0xD8, 0x78, 0xB8, 0x17, 0x15, 0x98, 0x5E, 0x62, 0x9B },
[EsCommonKeyType_ArchiveKey] = { 0x3B, 0x78, 0xF2, 0x61, 0x0F, 0x9D, 0x5A, 0xE2, 0x7B, 0x4E, 0x45, 0xAF, 0xCB, 0x0B, 0x67, 0x4D }, [EsCommonKeyType_ArchiveKey] = { 0x3B, 0x78, 0xF2, 0x61, 0x0F, 0x9D, 0x5A, 0xE2, 0x7B, 0x4E, 0x45, 0xAF, 0xCB, 0x0B, 0x67, 0x4D },
[EsCommonKeyType_Unknown2] = { 0x42, 0x64, 0x0B, 0xE3, 0x5F, 0xC6, 0xBE, 0x47, 0xC7, 0xB4, 0x84, 0xC5, 0xEB, 0x63, 0xAA, 0x02 },
}; };
constexpr const u8 EsSealKeySource[AesKeySize] = { constexpr const u8 EsSealKeySource[AesKeySize] = {

View File

@ -22,6 +22,7 @@ namespace ams::secmon::smc {
enum EsCommonKeyType { enum EsCommonKeyType {
EsCommonKeyType_TitleKey = 0, EsCommonKeyType_TitleKey = 0,
EsCommonKeyType_ArchiveKey = 1, EsCommonKeyType_ArchiveKey = 1,
EsCommonKeyType_Unknown2 = 2,
EsCommonKeyType_Count, EsCommonKeyType_Count,
}; };

View File

@ -52,7 +52,7 @@ namespace ams::secmon::smc {
[fuse::DramId_IcosaSamsung6GB] = pkg1::MemorySize_6GB, [fuse::DramId_IcosaSamsung6GB] = pkg1::MemorySize_6GB,
[fuse::DramId_HoagHynix1y4GB] = pkg1::MemorySize_4GB, [fuse::DramId_HoagHynix1y4GB] = pkg1::MemorySize_4GB,
[fuse::DramId_AulaHynix1y4GB] = pkg1::MemorySize_4GB, [fuse::DramId_AulaHynix1y4GB] = pkg1::MemorySize_4GB,
[fuse::DramId_IowaX1X2Samsung4GB] = pkg1::MemorySize_4GB, [fuse::DramId_Deprecated7] = pkg1::MemorySize_4GB,
[fuse::DramId_IowaSansung4GB] = pkg1::MemorySize_4GB, [fuse::DramId_IowaSansung4GB] = pkg1::MemorySize_4GB,
[fuse::DramId_IowaSamsung8GB] = pkg1::MemorySize_8GB, [fuse::DramId_IowaSamsung8GB] = pkg1::MemorySize_8GB,
[fuse::DramId_IowaHynix4GB] = pkg1::MemorySize_4GB, [fuse::DramId_IowaHynix4GB] = pkg1::MemorySize_4GB,
@ -61,7 +61,7 @@ namespace ams::secmon::smc {
[fuse::DramId_HoagSamsung8GB] = pkg1::MemorySize_8GB, [fuse::DramId_HoagSamsung8GB] = pkg1::MemorySize_8GB,
[fuse::DramId_HoagHynix4GB] = pkg1::MemorySize_4GB, [fuse::DramId_HoagHynix4GB] = pkg1::MemorySize_4GB,
[fuse::DramId_HoagMicron4GB] = pkg1::MemorySize_4GB, [fuse::DramId_HoagMicron4GB] = pkg1::MemorySize_4GB,
[fuse::DramId_IowaSamsung4GBY] = pkg1::MemorySize_4GB, [fuse::DramId_Deprecated16] = pkg1::MemorySize_4GB,
[fuse::DramId_IowaSamsung1y4GBX] = pkg1::MemorySize_4GB, [fuse::DramId_IowaSamsung1y4GBX] = pkg1::MemorySize_4GB,
[fuse::DramId_IowaSamsung1y8GBX] = pkg1::MemorySize_8GB, [fuse::DramId_IowaSamsung1y8GBX] = pkg1::MemorySize_8GB,
[fuse::DramId_HoagSamsung1y4GBX] = pkg1::MemorySize_4GB, [fuse::DramId_HoagSamsung1y4GBX] = pkg1::MemorySize_4GB,
@ -74,6 +74,12 @@ namespace ams::secmon::smc {
[fuse::DramId_HoagMicron1y4GB] = pkg1::MemorySize_4GB, [fuse::DramId_HoagMicron1y4GB] = pkg1::MemorySize_4GB,
[fuse::DramId_AulaMicron1y4GB] = pkg1::MemorySize_4GB, [fuse::DramId_AulaMicron1y4GB] = pkg1::MemorySize_4GB,
[fuse::DramId_AulaSamsung1y8GBX] = pkg1::MemorySize_8GB, [fuse::DramId_AulaSamsung1y8GBX] = pkg1::MemorySize_8GB,
[fuse::DramId_IowaX1X2Samsung4GB] = pkg1::MemorySize_4GB,
[fuse::DramId_HoagX1X2Samsung4GB] = pkg1::MemorySize_4GB,
[fuse::DramId_AulaX1X2Samsung4GB] = pkg1::MemorySize_4GB,
[fuse::DramId_IowaSamsung4GBY] = pkg1::MemorySize_4GB,
[fuse::DramId_HoagSamsung4GBY] = pkg1::MemorySize_4GB,
[fuse::DramId_AulaSamsung4GBY] = pkg1::MemorySize_4GB,
}; };
constexpr const pkg1::MemoryMode MemoryModes[] = { constexpr const pkg1::MemoryMode MemoryModes[] = {
@ -351,6 +357,9 @@ namespace ams::secmon::smc {
case UserRebootType_ToFatalError: case UserRebootType_ToFatalError:
PerformUserRebootToFatalError(); PerformUserRebootToFatalError();
break; break;
case UserRebootType_ByPmic:
PerformUserRebootByPmic();
break;
default: default:
return SmcResult::InvalidArgument; return SmcResult::InvalidArgument;
} }
@ -359,19 +368,18 @@ namespace ams::secmon::smc {
case UserRebootType_ToFatalError: case UserRebootType_ToFatalError:
PerformUserRebootToFatalError(); PerformUserRebootToFatalError();
break; break;
case UserRebootType_ByPmic:
PerformUserRebootByPmic();
break;
default: default:
return SmcResult::InvalidArgument; return SmcResult::InvalidArgument;
} }
} }
break; break;
case ConfigItem::ExosphereNeedsShutdown: case ConfigItem::ExosphereNeedsShutdown:
if (soc_type == fuse::SocType_Erista) {
if (args.r[3] != 0) { if (args.r[3] != 0) {
PerformUserShutDown(); PerformUserShutDown();
} }
} else /* if (soc_type == fuse::SocType_Mariko) */ {
return SmcResult::NotSupported;
}
break; break;
case ConfigItem::ExospherePayloadAddress: case ConfigItem::ExospherePayloadAddress:
if (g_payload_address == 0) { if (g_payload_address == 0) {

View File

@ -32,8 +32,8 @@ namespace ams::secmon::smc {
struct PrepareEsDeviceUniqueKeyOption { struct PrepareEsDeviceUniqueKeyOption {
using KeyGeneration = util::BitPack32::Field<0, 6, int>; using KeyGeneration = util::BitPack32::Field<0, 6, int>;
using Type = util::BitPack32::Field<6, 1, EsCommonKeyType>; using Type = util::BitPack32::Field<6, 2, EsCommonKeyType>;
using Reserved = util::BitPack32::Field<7, 25, u32>; using Reserved = util::BitPack32::Field<8, 24, u32>;
}; };
constexpr const u8 ModularExponentiateByStorageKeyTable[] = { constexpr const u8 ModularExponentiateByStorageKeyTable[] = {

View File

@ -96,7 +96,7 @@ namespace ams::nxboot::loader {
} }
void Uncompress(void *dst, size_t dst_size, const void *src, size_t src_size) { void Uncompress(void *dst, size_t dst_size, const void *src, size_t src_size) {
/* Create an execute a decompressor. */ /* Create and execute a decompressor. */
Lz4Uncompressor(dst, dst_size, src, src_size).Uncompress(); Lz4Uncompressor(dst, dst_size, src, src_size).Uncompress();
} }

Some files were not shown because too many files have changed in this diff Show More