Commit Graph

48 Commits (df5a44a40b9d691f1e80f369c4aaa6ed89676955)

Author SHA1 Message Date
Lioncash 2ea45fe75b kernel/thread: Include thread-related enums within the kernel namespace
Previously, these were sitting outside of the Kernel namespace, which
doesn't really make sense, given they're related to the Thread class
which is within the Kernel namespace.
7 years ago
Lioncash 4a587b81b2 core/core: Replace includes with forward declarations where applicable
The follow-up to e2457418da, which
replaces most of the includes in the core header with forward declarations.

This makes it so that if any of the headers the core header was
previously including change, then no one will need to rebuild the bulk
of the core, due to core.h being quite a prevalent inclusion.

This should make turnaround for changes much faster for developers.
7 years ago
Lioncash 0cbcd6ec9a kernel: Eliminate kernel global state
As means to pave the way for getting rid of global state within core,
This eliminates kernel global state by removing all globals. Instead
this introduces a KernelCore class which acts as a kernel instance. This
instance lives in the System class, which keeps its lifetime contained
to the lifetime of the System class.

This also forces the kernel types to actually interact with the main
kernel instance itself instead of having transient kernel state placed
all over several translation units, keeping everything together. It also
has a nice consequence of making dependencies much more explicit.

This also makes our initialization a tad bit more correct. Previously we
were creating a kernel process before the actual kernel was initialized,
which doesn't really make much sense.

The KernelCore class itself follows the PImpl idiom, which allows
keeping all the implementation details sealed away from everything else,
which forces the use of the exposed API and allows us to avoid any
unnecessary inclusions within the main kernel header.
7 years ago
Lioncash 96c0b81a51 loader: Remove address mapping remnants from citra
These mappings are leftovers from citra and don't apply to the Switch.
7 years ago
Lioncash 2beda7c2b3 kernel/process: Use accessors instead of class members for referencing segment array
Using member variables for referencing the segments array increases the
size of the class in memory for little benefit. The same behavior can be
achieved through the use of accessors that just return the relevant
segment.
7 years ago
Lioncash 364b950515 nso: Silence implicit sign conversion warnings 7 years ago
Lioncash a25c5b982a nso: Remove unused function ReadSegment() 7 years ago
bunnei dd0446ff43
Merge pull request #718 from lioncash/read
loader/nso: Check if read succeeded in IdentifyFile() before checking magic value
7 years ago
Lioncash 9b22f856c2 loader/nso: Check if read succeeded in IdentifyFile() before checking magic value
We should always assume the filesystem is volatile and check each IO
operation. While we're at it reorganize checks so that early-out errors
are near one another.
7 years ago
Lioncash 1831b5ef62
loader/nso: Remove unnecessary vector resizes
We can just initialize these vectors directly via their constructor.
7 years ago
Lioncash e3a30ccc7c
loader/nso: Resolve sign mismatch warnings 7 years ago
Zach Hilman 29aff8d5ab Virtual Filesystem 2: Electric Boogaloo (#676)
* Virtual Filesystem

* Fix delete bug and documentate

* Review fixes + other stuff

* Fix puyo regression
7 years ago
Zach Hilman 69bfe075b5 General Filesystem and Save Data Fixes (#670) 7 years ago
Hedges e066bc75b9 More improvements to GDBStub (#653)
* More improvements to GDBStub
- Debugging of threads should work correctly with source and assembly level stepping and modifying registers and memory, meaning threads and callstacks are fully clickable in VS.
- List of modules is available to the client, with assumption that .nro and .nso are backed up by an .elf with symbols, while deconstructed ROMs keep N names.
- Initial support for floating point registers.

* Tidy up as requested in PR feedback

* Tidy up as requested in PR feedback
7 years ago
bunnei 913896cbd9 Revert "Virtual Filesystem (#597)"
This reverts commit 77c684c114.
7 years ago
Zach Hilman 77c684c114 Virtual Filesystem (#597)
* Add VfsFile and VfsDirectory classes

* Finish abstract Vfs classes

* Implement RealVfsFile (computer fs backend)

* Finish RealVfsFile and RealVfsDirectory

* Finished OffsetVfsFile

* More changes

* Fix import paths

* Major refactor

* Remove double const

* Use experimental/filesystem or filesystem depending on compiler

* Port partition_filesystem

* More changes

* More Overhaul

* FSP_SRV fixes

* Fixes and testing

* Try to get filesystem to compile

* Filesystem on linux

* Remove std::filesystem and document/test

* Compile fixes

* Missing include

* Bug fixes

* Fixes

* Rename v_file and v_dir

* clang-format fix

* Rename NGLOG_* to LOG_*

* Most review changes

* Fix TODO

* Guess 'main' to be Directory by filename
7 years ago
James Rowe 638956aa81 Rename logging macro back to LOG_* 7 years ago
Zach Hilman 63f26d5c40 Add support for decrypted NCA files (#567)
* Start to add NCA support in loader

* More nca stuff

* More changes to nca.cpp

* Now identifies decrypted NCA cont.

* Game list fixes and more structs and stuff

* More updates to Nca class

* Now reads ExeFs (i think)

* ACTUALLY LOADS EXEFS!

* RomFS loads and games execute

* Cleanup and Finalize

* plumbing, cleanup and testing

* fix some things that i didnt think of before

* Preliminary Review Changes

* Review changes for bunnei and subv
7 years ago
Lioncash 7c9644646f
general: Make formatting of logged hex values more straightforward
This makes the formatting expectations more obvious (e.g. any zero padding specified
is padding that's entirely dedicated to the value being printed, not any pretty-printing
that also gets tacked on).
7 years ago
Lioncash 8475496630
general: Convert assertion macros over to be fmt-compatible 7 years ago
Lioncash cc2e14ec2a
loader: Move old logging macros over to new fmt-capable ones 7 years ago
Subv a70ed9c8ae Kernel: Use 0x2C as default main thread priority for homebrew and lone NRO/NSOs 7 years ago
bunnei b27ab46bde memory: Fix stack region. 7 years ago
bunnei 8581404482 kernel: Move stack region outside of application heap. 7 years ago
bunnei 7d6653268f core: Move process creation out of global state. 7 years ago
Subv 827f8ca3c7 Kernel: Store the program id in the Process class instead of the CodeSet class.
There may be many CodeSets per Process, so it's wasteful and overcomplicated to store the program id in each of them.
7 years ago
shinyquagsire23 487f8bc018 loader: Check error on NPDM load, use TID for CodeSet 7 years ago
Lioncash e6bf72877f
nso: Silence formatting specifier warnings 7 years ago
bunnei 386df282a3 loader: Clean up ctors and includes. 7 years ago
bunnei 023aef053c loader: Refactor to also pass filepath into IdentifyType. 7 years ago
bunnei 2dafd0d287 nso: Remove code specific to directory loading. 7 years ago
gdkchan c65ac49238 Remove relocation on NSO/NRO 7 years ago
bunnei 07b465d24e
Merge pull request #44 from Rozelette/master
nso: Modify .bss size calculation logic
7 years ago
MerryMage e35644c005 clang-format 7 years ago
Rozlette 09bcc2042c nso: Modify .bss size calculation logic 7 years ago
bunnei 6f904bb622 nso: Load subsdk4 if available. 7 years ago
bunnei 1247c53786 yuzu: Update license text to be consistent across project. 7 years ago
bunnei bc77a7580e nso: Always load the filepath specified by the user. 7 years ago
bunnei 3f0caefdf5 nso: Load more common submodules. 8 years ago
bunnei 9ceb0d9381 memory: Support 32-bit paging, move heap address space up. 8 years ago
bunnei 746c2a3ae7 core: Refactor MakeMagic usage and remove dead code. 8 years ago
bunnei 12c7469d81 nso: Add a log for loading submodules. 8 years ago
bunnei b1d5db1cf6 Merge remote-tracking branch 'upstream/master' into nx
# Conflicts:
#	src/core/CMakeLists.txt
#	src/core/arm/dynarmic/arm_dynarmic.cpp
#	src/core/arm/dyncom/arm_dyncom.cpp
#	src/core/hle/kernel/process.cpp
#	src/core/hle/kernel/thread.cpp
#	src/core/hle/kernel/thread.h
#	src/core/hle/kernel/vm_manager.cpp
#	src/core/loader/3dsx.cpp
#	src/core/loader/elf.cpp
#	src/core/loader/ncch.cpp
#	src/core/memory.cpp
#	src/core/memory.h
#	src/core/memory_setup.h
8 years ago
bunnei 23ce4f5afc loader: Various improvements for NSO/NRO loaders. 8 years ago
bunnei 33ea53094c loader: Add support for NRO, as well as various fixes and shared linker. 8 years ago
bunnei d454364bca nso: Fixes to support homebrew NSOs without a MOD header. 8 years ago
bunnei 8c92435ded nso: Refactor and allocate .bss section. 8 years ago
bunnei 6bafd3f4f7 loader: Add support for loading an NSO. 8 years ago