Compare commits
4 Commits
master
...
gcc15_supp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4859bcc0fe | ||
|
|
0ecd822c26 | ||
|
|
b1e0dad506 | ||
|
|
c55606cfdb |
80
Dockerfile
80
Dockerfile
@@ -1,80 +0,0 @@
|
|||||||
FROM devkitpro/devkita64:20260219
|
|
||||||
|
|
||||||
ARG PYTHON_VERSION=2.7.18
|
|
||||||
ARG PYTHON_SHA256=da3080e3b488f648a3d7a4560ddee895284c3380b11d6de75edb986526b9a814
|
|
||||||
ARG PYTHON_LZ4_VERSION=2.2.1
|
|
||||||
ARG PYTHON_LZ4_SHA256=9f529a443f9eb1b49d040f0791bb3934c64b9a927609a30319c3b82f93d9525a
|
|
||||||
|
|
||||||
RUN apt update && \
|
|
||||||
apt install automake build-essential ca-certificates wget libbz2-dev libffi-dev libgdbm-dev liblz4-dev libncurses5-dev libreadline-dev libsqlite3-dev libssl-dev liblzma-dev sudo tk-dev uuid-dev zlib1g-dev python3-lz4 python3-pip -y && \
|
|
||||||
cd /tmp && \
|
|
||||||
wget -q https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \
|
|
||||||
echo "${PYTHON_SHA256} Python-${PYTHON_VERSION}.tgz" | sha256sum --check && \
|
|
||||||
tar -xzf Python-${PYTHON_VERSION}.tgz && \
|
|
||||||
cd /tmp/Python-${PYTHON_VERSION} && \
|
|
||||||
./configure --prefix=/usr/local --with-ensurepip=install && \
|
|
||||||
make -j"$(nproc)" altinstall && \
|
|
||||||
cd /tmp && \
|
|
||||||
wget -q https://files.pythonhosted.org/packages/86/4f/028a9ff9cfc73f317c22dc3b8f29a7c5c94098d4da590405e6b78af00e57/lz4-${PYTHON_LZ4_VERSION}-cp27-cp27m-manylinux1_x86_64.whl && \
|
|
||||||
echo "${PYTHON_LZ4_SHA256} lz4-${PYTHON_LZ4_VERSION}-cp27-cp27m-manylinux1_x86_64.whl" | sha256sum --check && \
|
|
||||||
/usr/local/bin/python2.7 -m pip install --no-deps --no-index lz4-${PYTHON_LZ4_VERSION}-cp27-cp27m-manylinux1_x86_64.whl && \
|
|
||||||
ln -fs /usr/local/bin/python2.7 /usr/local/bin/python2 && \
|
|
||||||
ln -fs /usr/local/bin/python2.7 /usr/local/bin/python && \
|
|
||||||
rm -rf /tmp/Python-${PYTHON_VERSION} /tmp/Python-${PYTHON_VERSION}.tgz /tmp/lz4-${PYTHON_LZ4_VERSION}-cp27-cp27m-manylinux1_x86_64.whl && \
|
|
||||||
rm -rf /var/lib/apt/lists/* /var/cache/apt/* /usr/share/doc /usr/share/man
|
|
||||||
|
|
||||||
# Install latest hactool & switch-tools from dkp pacman & update everything
|
|
||||||
RUN dkp-pacman -S switch-tools hactool --noconfirm && dkp-pacman -Syu --noconfirm
|
|
||||||
|
|
||||||
# # Install hactool from Git (optional)
|
|
||||||
# ENV HACTOOL_REV=1d64a83450e025622f3468c28fc4164dad2c5ef6
|
|
||||||
# RUN cd /tmp && \
|
|
||||||
# mkdir -p /tmp/hactool && \
|
|
||||||
# cd /tmp/hactool && \
|
|
||||||
# git init && \
|
|
||||||
# git remote add origin https://github.com/SciresM/hactool.git && \
|
|
||||||
# git fetch --depth 1 origin $HACTOOL_REV && \
|
|
||||||
# git reset --hard FETCH_HEAD && \
|
|
||||||
# cp config.mk.template config.mk && \
|
|
||||||
# make -j$(nproc) && \
|
|
||||||
# cp hactool /opt/devkitpro/tools/bin/hactool && \
|
|
||||||
# cd /tmp && \
|
|
||||||
# rm -rf /tmp/hactool
|
|
||||||
|
|
||||||
# # Install switch-tools from Git (optional)
|
|
||||||
# ENV SWITCH_TOOLS_REV=22756068dd0ed6ff9734c59cb4f99ebd3f62555b
|
|
||||||
# RUN cd /tmp && \
|
|
||||||
# mkdir -p /tmp/switch-tools && \
|
|
||||||
# cd /tmp/switch-tools && \
|
|
||||||
# git init && \
|
|
||||||
# git remote add origin https://github.com/switchbrew/switch-tools.git && \
|
|
||||||
# git fetch --depth 1 origin $SWITCH_TOOLS_REV && \
|
|
||||||
# git reset --hard FETCH_HEAD && \
|
|
||||||
# ./autogen.sh && ./configure && make -j$(nproc) && \
|
|
||||||
# make install prefix=/opt/devkitpro/tools && \
|
|
||||||
# cd /tmp && \
|
|
||||||
# rm -rf /tmp/switch-tools
|
|
||||||
|
|
||||||
# Install libnx from Git (optional)
|
|
||||||
# ENV LIBNX_REV=146c3d1446d35546943c7b6cfcd479bc1f5e9b67
|
|
||||||
# RUN cd /tmp && \
|
|
||||||
# mkdir -p /tmp/libnx && \
|
|
||||||
# cd /tmp/libnx && \
|
|
||||||
# git init && \
|
|
||||||
# git remote add origin https://github.com/switchbrew/libnx.git && \
|
|
||||||
# git fetch --depth 1 origin $LIBNX_REV && \
|
|
||||||
# git reset --hard FETCH_HEAD && \
|
|
||||||
# make -j$(nproc) && \
|
|
||||||
# cd nx && \
|
|
||||||
# make install && \
|
|
||||||
# cd /tmp && \
|
|
||||||
# rm -rf /tmp/libnx
|
|
||||||
|
|
||||||
RUN useradd -m atmosphere && \
|
|
||||||
echo "atmosphere ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/atmosphere && \
|
|
||||||
chmod 0440 /etc/sudoers.d/atmosphere && \
|
|
||||||
echo "atmosphere:atmosphere" | chpasswd && \
|
|
||||||
usermod -aG sudo atmosphere
|
|
||||||
|
|
||||||
USER atmosphere
|
|
||||||
CMD ["/bin/bash"]
|
|
||||||
4
Makefile
4
Makefile
@@ -13,10 +13,6 @@ $(strip $1):
|
|||||||
@echo "Building $(strip $1)"
|
@echo "Building $(strip $1)"
|
||||||
@$$(MAKE) -f $(CURRENT_DIRECTORY)/atmosphere.mk ATMOSPHERE_MAKEFILE_TARGET="$(strip $1)" ATMOSPHERE_BUILD_NAME="$(strip $2)" ATMOSPHERE_BOARD="$(strip $3)" ATMOSPHERE_CPU="$(strip $4)" $(strip $5)
|
@$$(MAKE) -f $(CURRENT_DIRECTORY)/atmosphere.mk ATMOSPHERE_MAKEFILE_TARGET="$(strip $1)" ATMOSPHERE_BUILD_NAME="$(strip $2)" ATMOSPHERE_BOARD="$(strip $3)" ATMOSPHERE_CPU="$(strip $4)" $(strip $5)
|
||||||
|
|
||||||
dist-no-debug-$(strip $1):
|
|
||||||
@echo "Building $(strip $1)"
|
|
||||||
@$$(MAKE) -f $(CURRENT_DIRECTORY)/atmosphere.mk dist-no-debug ATMOSPHERE_MAKEFILE_TARGET="$(strip $1)" ATMOSPHERE_BUILD_NAME="$(strip $2)" ATMOSPHERE_BOARD="$(strip $3)" ATMOSPHERE_CPU="$(strip $4)" $(strip $5)
|
|
||||||
|
|
||||||
clean-$(strip $1):
|
clean-$(strip $1):
|
||||||
@echo "Cleaning $(strip $1)"
|
@echo "Cleaning $(strip $1)"
|
||||||
@$$(MAKE) -f $(CURRENT_DIRECTORY)/atmosphere.mk clean ATMOSPHERE_MAKEFILE_TARGET="$(strip $1)" ATMOSPHERE_BUILD_NAME="$(strip $2)" ATMOSPHERE_BOARD="$(strip $3)" ATMOSPHERE_CPU="$(strip $4)" $(strip $5)
|
@$$(MAKE) -f $(CURRENT_DIRECTORY)/atmosphere.mk clean ATMOSPHERE_MAKEFILE_TARGET="$(strip $1)" ATMOSPHERE_BUILD_NAME="$(strip $2)" ATMOSPHERE_BOARD="$(strip $3)" ATMOSPHERE_CPU="$(strip $4)" $(strip $5)
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||

|

|
||||||
[](https://discordapp.com/invite/ZdqEhed)
|
[](https://discordapp.com/invite/ZdqEhed)
|
||||||

|
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
@@ -14,6 +13,7 @@ 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
|
||||||
|
|||||||
@@ -50,11 +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/haze/haze.elf $(DIST_DIR)/haze.elf
|
||||||
cp $(CURRENT_DIRECTORY)/troposphere/reboot_to_payload/reboot_to_payload.elf $(DIST_DIR)/reboot_to_payload.elf
|
cp $(CURRENT_DIRECTORY)/troposphere/reboot_to_payload/reboot_to_payload.elf $(DIST_DIR)/reboot_to_payload.elf
|
||||||
cd $(DIST_DIR); zip -1 -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)
|
||||||
|
|
||||||
dist-no-debug: package3 $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
|
dist-no-debug: package3 $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
|
||||||
@@ -88,7 +87,6 @@ dist-no-debug: package3 $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
|
|||||||
#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
|
||||||
@@ -106,8 +104,7 @@ dist-no-debug: package3 $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
|
|||||||
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
|
||||||
@PATH="$(DEVKITPRO)/tools/bin:$$PATH" 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
|
||||||
@@ -117,7 +114,7 @@ dist-no-debug: package3 $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_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
|
||||||
|
|
||||||
package3: emummc fusee stratosphere mesosphere exosphere troposphere
|
package3: emummc fusee stratosphere mesosphere exosphere troposphere
|
||||||
$(SILENTCMD)$(PYTHON) fusee/build_package3.py $(CURRENT_DIRECTORY) $(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BOOT_OUT_DIR) $(ATMOSPHERE_GIT_HASH) $(ATMOSPHERE_MAJOR_VERSION) $(ATMOSPHERE_MINOR_VERSION) $(ATMOSPHERE_MICRO_VERSION) 0 $(ATMOSPHERE_SUPPORTED_HOS_MAJOR_VERSION) $(ATMOSPHERE_SUPPORTED_HOS_MINOR_VERSION) $(ATMOSPHERE_SUPPORTED_HOS_MICRO_VERSION) 0
|
@python fusee/build_package3.py $(CURRENT_DIRECTORY) $(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BOOT_OUT_DIR) $(ATMOSPHERE_GIT_HASH) $(ATMOSPHERE_MAJOR_VERSION) $(ATMOSPHERE_MINOR_VERSION) $(ATMOSPHERE_MICRO_VERSION) 0 $(ATMOSPHERE_SUPPORTED_HOS_MAJOR_VERSION) $(ATMOSPHERE_SUPPORTED_HOS_MINOR_VERSION) $(ATMOSPHERE_SUPPORTED_HOS_MICRO_VERSION) 0
|
||||||
@echo "Built package3!"
|
@echo "Built package3!"
|
||||||
|
|
||||||
emummc:
|
emummc:
|
||||||
|
|||||||
@@ -15,13 +15,6 @@
|
|||||||
# Desc: Controls whether userland has access to the PMU registers.
|
# Desc: Controls whether userland has access to the PMU registers.
|
||||||
# NOTE: It is unknown what effects this has on official code.
|
# NOTE: It is unknown what effects this has on official code.
|
||||||
|
|
||||||
# Key: enable_mem_mode, default: 0.
|
|
||||||
# Desc: Controls whether boot config memory mode is taken into account
|
|
||||||
# for retail units. This does not affect development units.
|
|
||||||
# NOTE: On retail units max ram size is capped to 4GB.
|
|
||||||
# Enabling this will use the boot config memory mode parameter,
|
|
||||||
# which by default is auto and size gets set based on physical size.
|
|
||||||
|
|
||||||
# Key: blank_prodinfo_sysmmc, default: 0.
|
# Key: blank_prodinfo_sysmmc, default: 0.
|
||||||
# Desc: Controls whether PRODINFO should be blanked in sysmmc.
|
# Desc: Controls whether PRODINFO should be blanked in sysmmc.
|
||||||
# This will cause the system to see dummied out keys and
|
# This will cause the system to see dummied out keys and
|
||||||
@@ -58,7 +51,6 @@ debugmode=1
|
|||||||
debugmode_user=0
|
debugmode_user=0
|
||||||
disable_user_exception_handlers=0
|
disable_user_exception_handlers=0
|
||||||
enable_user_pmu_access=0
|
enable_user_pmu_access=0
|
||||||
enable_mem_mode=0
|
|
||||||
blank_prodinfo_sysmmc=0
|
blank_prodinfo_sysmmc=0
|
||||||
blank_prodinfo_emummc=0
|
blank_prodinfo_emummc=0
|
||||||
allow_writing_to_cal_sysmmc=0
|
allow_writing_to_cal_sysmmc=0
|
||||||
|
|||||||
@@ -1,138 +1,4 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
## 1.12.0
|
|
||||||
+ Support was added for 23.0.0.
|
|
||||||
+ Special thanks to @alula for handling the implementation of several kernel changes.
|
|
||||||
+ The console should boot and atmosphère should be fully functional.
|
|
||||||
+ **Please note**: As a result of changes made to nintendo's software in 23.0.0, there is even less memory available for custom system modules.
|
|
||||||
+ The amount of memory we can steal from the applet pool has been reduced beyond 7MB and we can no longer launch browser applets (e.g.: eshop) without crashing.
|
|
||||||
+ To compensate for this, a set of patches for the browser applets has been introduced.
|
|
||||||
+ Thanks to the redesign of the browser applets in 22.0.0 there are only 3 applets we need to worry about: systemWeb, openWeb and LibAppletOff.
|
|
||||||
+ With the added burden of maintaining patches for these applets, we can reclaim around 9MB of reserved memory by patching out their allocations.
|
|
||||||
+ This memory is provably unused and stealing it should not affect the browser applets in any way as the applets themselves tag it as reserved and never access it.
|
|
||||||
+ As a result, the memory available for custom system modules has been experimentally increased to 16MB.
|
|
||||||
+ Preliminary testing has seemingly shown no downsides to the overall functioning of the OS and the browser applets in particular.
|
|
||||||
+ Nonetheless, please report any issues you may face to ensure no edge cases have been missed and to determine if the memory amount needs to be adjusted.
|
|
||||||
+ These patches may be deprecated at any point in the future if a better solution is devised.
|
|
||||||
+ `exosphère` was updated to reflect the latest official secure monitor behavior.
|
|
||||||
+ A new ConfigItem was added to the secure monitor for the first time since firmware 5.0.0.
|
|
||||||
+ `mesosphère` was updated to reflect the latest official kernel behavior.
|
|
||||||
+ The kernel now supports a 42bit wide address space.
|
|
||||||
+ A new memory region dubbed ShadowStack has been introduced.
|
|
||||||
+ Kernel RNG was changed to CTR-DRBG.
|
|
||||||
+ `boot` was updated to reflect the latest official behavior and to implement a previously missing change.
|
|
||||||
+ The way battery i2c shutdown was being enabled changed in firmware 18.0.0 and we missed it.
|
|
||||||
+ It is possible this might have been related to a known battery draining issue reported to have started around firmware 18.0.0. Further testing will be needed to confirm.
|
|
||||||
+ `loader` was updated to reflect the latest official behavior.
|
|
||||||
+ `erpt` was updated to reflect the latest official behavior.
|
|
||||||
+ `pgl` was updated to reflect the latest official behavior.
|
|
||||||
+ `ro` was updated to reflect the latest official behavior.
|
|
||||||
+ NROs can now be lz4 frame compressed.
|
|
||||||
+ ZBIC compresison/decompression has been properly implemented. Applications using it should now launch and work properly.
|
|
||||||
+ A dockerfile has been added to atmosphère (thanks @alula).
|
|
||||||
+ R_DISCARD macro has been adopted across the entire codebase where applicable. This finishes the work started in version 1.10.0 and eliminates the nodiscard warnings during compilation.
|
|
||||||
+ General system stability improvements to enhance the user's experience.
|
|
||||||
## 1.11.2
|
|
||||||
+ Basic support was added for 22.5.0.
|
|
||||||
+ Atmosphère was updated to use GCC 16/newlib (latest devkitA64/devkitARM releases).
|
|
||||||
+ General system stability improvements to enhance the user's experience.
|
|
||||||
## 1.11.1
|
|
||||||
+ Basic support was added for 22.1.0.
|
|
||||||
+ General system stability improvements to enhance the user's experience.
|
|
||||||
## 1.11.0
|
|
||||||
+ Support was added for 22.0.0.
|
|
||||||
+ Special thanks to @alula for handling a large chunk of the necessary kernel, loader and erpt changes.
|
|
||||||
+ The console should boot and atmosphère should be fully functional.
|
|
||||||
+ **Please note**: A change in how applications/applets' lifespan is managed broke the homebrew ecosystem.
|
|
||||||
+ All applications and applets are expected to perform a clean exit by calling the relevant IPC commands.
|
|
||||||
+ Homebrew compiled with libnx and hbmenu itself explicitly avoid exiting so it can keep using the same process.
|
|
||||||
+ Properly fixing this would require a re-design of how homebrew is launched and terminated.
|
|
||||||
+ As a temporary solution, patches to the `am` sysmodule are now included which allow restoring the previous behavior and regain homebrew compatibility without any further changes.
|
|
||||||
+ Nonetheless, please report any issues you may face when testing homebrew to ensure no edge cases have been missed.
|
|
||||||
+ `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.
|
|
||||||
+ `erpt` was updated to reflect the latest official behavior.
|
|
||||||
+ `pgl` was updated to fix a few issues.
|
|
||||||
+ Support was added for memory modes above 4GB (thanks @CTCaer).
|
|
||||||
+ A build time option to configure Joy-Con rails as UART for debugging was added (thanks @alula).
|
|
||||||
+ General system stability improvements to enhance the user's experience.
|
|
||||||
## 1.10.2
|
|
||||||
+ Basic support was added for 21.2.0.
|
|
||||||
+ General system stability improvements to enhance the user's experience.
|
|
||||||
## 1.10.1
|
|
||||||
+ Basic support was added for 21.1.0.
|
|
||||||
+ A bug was fixed that caused some games (e.g. Tomb Raider definitive edition) to fail to launch.
|
|
||||||
+ General system stability improvements to enhance the user's experience.
|
|
||||||
## 1.10.0
|
|
||||||
+ Basic support was added for 21.0.0.
|
|
||||||
+ The console should boot and atmosphère should be fully functional.
|
|
||||||
+ **Please note**: All homebrew software may need to be re-compiled with the latest libnx (>= 4.10.0), or else it may crash/experience memory corruption.
|
|
||||||
+ Nintendo broke the userland<->kernel TLS ABI in 21.0.0, by writing to previously reserved space.
|
|
||||||
+ Homebrew used this reserved space for its TLS slots, which means any homebrew software using TLS slots will experience memory corruption when running under Atmosphere 1.10.0.
|
|
||||||
+ This doesn't appear to impact everything, but a large portion of tested homebrew crashes (often on exit), and so will need re-compile for the new ABI.
|
|
||||||
+ For those technically inclined, while TLS slots are rarely used by developers, they're used to implement features like e.g. C++ exceptions under the hood, and so anything using those crashes, etc.
|
|
||||||
+ To help make this transition easier, hbmenu now shows a warning when selecting homebrew compiled with an older, incompatible ABI version.
|
|
||||||
+ I apologize for the hassle in general.
|
|
||||||
+ libnx has been updated so that its reserved space matches Nintendo's now -- this particular issue can never occur again, even if Nintendo touches more reserved space.
|
|
||||||
+ `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.
|
|
||||||
+ `erpt` was updated to reflect the latest official behavior.
|
|
||||||
+ `pgl` was updated to reflect the latest official behavior.
|
|
||||||
+ `fatal` was updated to reflect the latest official behavior.
|
|
||||||
+ Support was added for launching another game-which-has-too-many-files with romfs mods.
|
|
||||||
+ I rely on user reports for adding support/fixing these, and some of these games can be pretty obscure!
|
|
||||||
+ 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.
|
|
||||||
+ Although some games may be impossible to fix, I believe I can get almost everything working, so please let me try to help you (and improve atmosphère's support!) if you run into this!
|
|
||||||
+ General system stability improvements to enhance the user's experience.
|
|
||||||
## 1.9.5
|
|
||||||
+ Basic support was added for 20.5.0.
|
|
||||||
+ General system stability improvements to enhance the user's experience.
|
|
||||||
## 1.9.4
|
|
||||||
+ Basic support was added for 20.4.0.
|
|
||||||
+ An issue was fixed in `exosphère`'s register accessilibity tables (thanks @CTCaer).
|
|
||||||
+ I believe this had no impact on official code, though it would have prevented some homebrew from interacting correctly with the MC0/MC1 registers.
|
|
||||||
+ An issue was fixed that could cause a deadlock when building multiple romfs images simultaneously (thanks @Ereza).
|
|
||||||
+ This fixes support for certain mods, e.g. system language translations overriding content for both overlayDisp and qlaunch.
|
|
||||||
+ General system stability improvements to enhance the user's experience.
|
|
||||||
## 1.9.3
|
|
||||||
+ Basic support was added for 20.3.0.
|
|
||||||
+ Compatibility was fixed for loading mods with KOTOR 2 (star wars).
|
|
||||||
+ General system stability improvements to enhance the user's experience.
|
|
||||||
## 1.9.2
|
|
||||||
+ Basic support was added for 20.2.0.
|
|
||||||
+ USB 3.0 support force-enable was fixed for 20.1.0+.
|
|
||||||
+ General system stability improvements to enhance the user's experience.
|
|
||||||
## 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
|
## 1.8.0
|
||||||
+ Basic support was added for 19.0.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.
|
+ The console should boot and atmosphère should be fully functional. However, not all modules have been fully updated to reflect the latest changes.
|
||||||
|
|||||||
@@ -423,41 +423,41 @@ Note that for multiple button combinations, the bitmasks should be OR'd together
|
|||||||
#### Keypad Values
|
#### Keypad Values
|
||||||
Note: This is the direct output of `hidKeysDown()`.
|
Note: This is the direct output of `hidKeysDown()`.
|
||||||
|
|
||||||
+ 00000000 00000001: A
|
+ 000000001: A
|
||||||
+ 00000000 00000002: B
|
+ 000000002: B
|
||||||
+ 00000000 00000004: X
|
+ 000000004: X
|
||||||
+ 00000000 00000008: Y
|
+ 000000008: Y
|
||||||
+ 00000000 00000010: Left Stick Pressed
|
+ 000000010: Left Stick Pressed
|
||||||
+ 00000000 00000020: Right Stick Pressed
|
+ 000000020: Right Stick Pressed
|
||||||
+ 00000000 00000040: L
|
+ 000000040: L
|
||||||
+ 00000000 00000080: R
|
+ 000000080: R
|
||||||
+ 00000000 00000100: ZL
|
+ 000000100: ZL
|
||||||
+ 00000000 00000200: ZR
|
+ 000000200: ZR
|
||||||
+ 00000000 00000400: Plus
|
+ 000000400: Plus
|
||||||
+ 00000000 00000800: Minus
|
+ 000000800: Minus
|
||||||
+ 00000000 00001000: Left
|
+ 000001000: Left
|
||||||
+ 00000000 00002000: Up
|
+ 000002000: Up
|
||||||
+ 00000000 00004000: Right
|
+ 000004000: Right
|
||||||
+ 00000000 00008000: Down
|
+ 000008000: Down
|
||||||
+ 00000000 00010000: Left Stick Left
|
+ 000010000: Left Stick Left
|
||||||
+ 00000000 00020000: Left Stick Up
|
+ 000020000: Left Stick Up
|
||||||
+ 00000000 00040000: Left Stick Right
|
+ 000040000: Left Stick Right
|
||||||
+ 00000000 00080000: Left Stick Down
|
+ 000080000: Left Stick Down
|
||||||
+ 00000000 00100000: Right Stick Left
|
+ 000100000: Right Stick Left
|
||||||
+ 00000000 00200000: Right Stick Up
|
+ 000200000: Right Stick Up
|
||||||
+ 00000000 00400000: Right Stick Right
|
+ 000400000: Right Stick Right
|
||||||
+ 00000000 00800000: Right Stick Down
|
+ 000800000: Right Stick Down
|
||||||
+ 00000000 01000000: SL Left Joy-Con
|
+ 001000000: SL Left Joy-Con
|
||||||
+ 00000000 02000000: SR Left Joy-Con
|
+ 002000000: SR Left Joy-Con
|
||||||
+ 00000000 04000000: SL Right Joy-Con
|
+ 004000000: SL Right Joy-Con
|
||||||
+ 00000000 08000000: SR Right Joy-Con
|
+ 008000000: SR Right Joy-Con
|
||||||
+ 00000000 10000000: Top button on Poké Ball Plus (Palma) controller
|
+ 010000000: Top button on Poké Ball Plus (Palma) controller
|
||||||
+ 00000000 20000000: Verification
|
+ 020000000: Verification
|
||||||
+ 00000000 40000000: B button on Left NES/HVC controller in Handheld mode
|
+ 040000000: B button on Left NES/HVC controller in Handheld mode
|
||||||
+ 00000000 80000000: Left C button in N64 controller
|
+ 080000000: Left C button in N64 controller
|
||||||
+ 00000001 00000000: Up C button in N64 controller
|
+ 100000000: Up C button in N64 controller
|
||||||
+ 00000002 00000000: Right C button in N64 controller
|
+ 200000000: Right C button in N64 controller
|
||||||
+ 00000004 00000000: Down C button in N64 controller
|
+ 400000000: 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.
|
||||||
|
|||||||
6
emummc/.gitrepo
vendored
6
emummc/.gitrepo
vendored
@@ -6,7 +6,7 @@
|
|||||||
[subrepo]
|
[subrepo]
|
||||||
remote = https://github.com/m4xw/emummc
|
remote = https://github.com/m4xw/emummc
|
||||||
branch = develop
|
branch = develop
|
||||||
commit = 5b966b6f3f83349ec65066a1877f7f948b48d08c
|
commit = d248ea6f700c3e6987549e30a1e2eeb609ce9f8c
|
||||||
parent = 7442487ace6b79ddddf2cd0007b8dade8150bf5c
|
parent = 9112461620330ba73a74926edd4c08b3cc0310f0
|
||||||
method = merge
|
method = merge
|
||||||
cmdver = 0.4.9
|
cmdver = 0.4.1
|
||||||
|
|||||||
2
emummc/README.md
vendored
2
emummc/README.md
vendored
@@ -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 - 23.0.0**
|
**1.0.0 - 19.0.0**
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
* Arbitrary SDMMC backend selection
|
* Arbitrary SDMMC backend selection
|
||||||
|
|||||||
56
emummc/source/FS/FS_offsets.c
vendored
56
emummc/source/FS/FS_offsets.c
vendored
@@ -75,20 +75,6 @@
|
|||||||
#include "offsets/1810_exfat.h"
|
#include "offsets/1810_exfat.h"
|
||||||
#include "offsets/1900.h"
|
#include "offsets/1900.h"
|
||||||
#include "offsets/1900_exfat.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 "offsets/2100.h"
|
|
||||||
#include "offsets/2100_exfat.h"
|
|
||||||
#include "offsets/2120.h"
|
|
||||||
#include "offsets/2120_exfat.h"
|
|
||||||
#include "offsets/2200.h"
|
|
||||||
#include "offsets/2200_exfat.h"
|
|
||||||
#include "offsets/2250.h"
|
|
||||||
#include "offsets/2250_exfat.h"
|
|
||||||
#include "offsets/2300.h"
|
|
||||||
#include "offsets/2300_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
|
||||||
@@ -175,20 +161,6 @@ DEFINE_OFFSET_STRUCT(_1810);
|
|||||||
DEFINE_OFFSET_STRUCT(_1810_EXFAT);
|
DEFINE_OFFSET_STRUCT(_1810_EXFAT);
|
||||||
DEFINE_OFFSET_STRUCT(_1900);
|
DEFINE_OFFSET_STRUCT(_1900);
|
||||||
DEFINE_OFFSET_STRUCT(_1900_EXFAT);
|
DEFINE_OFFSET_STRUCT(_1900_EXFAT);
|
||||||
DEFINE_OFFSET_STRUCT(_2000);
|
|
||||||
DEFINE_OFFSET_STRUCT(_2000_EXFAT);
|
|
||||||
DEFINE_OFFSET_STRUCT(_2010);
|
|
||||||
DEFINE_OFFSET_STRUCT(_2010_EXFAT);
|
|
||||||
DEFINE_OFFSET_STRUCT(_2100);
|
|
||||||
DEFINE_OFFSET_STRUCT(_2100_EXFAT);
|
|
||||||
DEFINE_OFFSET_STRUCT(_2120);
|
|
||||||
DEFINE_OFFSET_STRUCT(_2120_EXFAT);
|
|
||||||
DEFINE_OFFSET_STRUCT(_2200);
|
|
||||||
DEFINE_OFFSET_STRUCT(_2200_EXFAT);
|
|
||||||
DEFINE_OFFSET_STRUCT(_2250);
|
|
||||||
DEFINE_OFFSET_STRUCT(_2250_EXFAT);
|
|
||||||
DEFINE_OFFSET_STRUCT(_2300);
|
|
||||||
DEFINE_OFFSET_STRUCT(_2300_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) {
|
||||||
@@ -310,34 +282,6 @@ const fs_offsets_t *get_fs_offsets(enum FS_VER version) {
|
|||||||
return &(GET_OFFSET_STRUCT_NAME(_1900));
|
return &(GET_OFFSET_STRUCT_NAME(_1900));
|
||||||
case FS_VER_19_0_0_EXFAT:
|
case FS_VER_19_0_0_EXFAT:
|
||||||
return &(GET_OFFSET_STRUCT_NAME(_1900_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));
|
|
||||||
case FS_VER_21_0_0:
|
|
||||||
return &(GET_OFFSET_STRUCT_NAME(_2100));
|
|
||||||
case FS_VER_21_0_0_EXFAT:
|
|
||||||
return &(GET_OFFSET_STRUCT_NAME(_2100_EXFAT));
|
|
||||||
case FS_VER_21_2_0:
|
|
||||||
return &(GET_OFFSET_STRUCT_NAME(_2120));
|
|
||||||
case FS_VER_21_2_0_EXFAT:
|
|
||||||
return &(GET_OFFSET_STRUCT_NAME(_2120_EXFAT));
|
|
||||||
case FS_VER_22_0_0:
|
|
||||||
return &(GET_OFFSET_STRUCT_NAME(_2200));
|
|
||||||
case FS_VER_22_0_0_EXFAT:
|
|
||||||
return &(GET_OFFSET_STRUCT_NAME(_2200_EXFAT));
|
|
||||||
case FS_VER_22_5_0:
|
|
||||||
return &(GET_OFFSET_STRUCT_NAME(_2250));
|
|
||||||
case FS_VER_22_5_0_EXFAT:
|
|
||||||
return &(GET_OFFSET_STRUCT_NAME(_2250_EXFAT));
|
|
||||||
case FS_VER_23_0_0:
|
|
||||||
return &(GET_OFFSET_STRUCT_NAME(_2300));
|
|
||||||
case FS_VER_23_0_0_EXFAT:
|
|
||||||
return &(GET_OFFSET_STRUCT_NAME(_2300_EXFAT));
|
|
||||||
default:
|
default:
|
||||||
fatal_abort(Fatal_UnknownVersion);
|
fatal_abort(Fatal_UnknownVersion);
|
||||||
}
|
}
|
||||||
|
|||||||
21
emummc/source/FS/FS_versions.h
vendored
21
emummc/source/FS/FS_versions.h
vendored
@@ -110,27 +110,6 @@ enum FS_VER
|
|||||||
FS_VER_19_0_0,
|
FS_VER_19_0_0,
|
||||||
FS_VER_19_0_0_EXFAT,
|
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_21_0_0,
|
|
||||||
FS_VER_21_0_0_EXFAT,
|
|
||||||
|
|
||||||
FS_VER_21_2_0,
|
|
||||||
FS_VER_21_2_0_EXFAT,
|
|
||||||
|
|
||||||
FS_VER_22_0_0,
|
|
||||||
FS_VER_22_0_0_EXFAT,
|
|
||||||
|
|
||||||
FS_VER_22_5_0,
|
|
||||||
FS_VER_22_5_0_EXFAT,
|
|
||||||
|
|
||||||
FS_VER_23_0_0,
|
|
||||||
FS_VER_23_0_0_EXFAT,
|
|
||||||
|
|
||||||
FS_VER_MAX,
|
FS_VER_MAX,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
59
emummc/source/FS/offsets/2000.h
vendored
59
emummc/source/FS/offsets/2000.h
vendored
@@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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
59
emummc/source/FS/offsets/2000_exfat.h
vendored
@@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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
59
emummc/source/FS/offsets/2010.h
vendored
@@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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
59
emummc/source/FS/offsets/2010_exfat.h
vendored
@@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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__
|
|
||||||
59
emummc/source/FS/offsets/2100.h
vendored
59
emummc/source/FS/offsets/2100.h
vendored
@@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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_2100_H__
|
|
||||||
#define __FS_2100_H__
|
|
||||||
|
|
||||||
// Accessor vtable getters
|
|
||||||
#define FS_OFFSET_2100_SDMMC_ACCESSOR_GC 0x1AC970
|
|
||||||
#define FS_OFFSET_2100_SDMMC_ACCESSOR_SD 0x1AE980
|
|
||||||
#define FS_OFFSET_2100_SDMMC_ACCESSOR_NAND 0x1ACFA0
|
|
||||||
|
|
||||||
// Hooks
|
|
||||||
#define FS_OFFSET_2100_SDMMC_WRAPPER_READ 0x1A8850
|
|
||||||
#define FS_OFFSET_2100_SDMMC_WRAPPER_WRITE 0x1A88B0
|
|
||||||
#define FS_OFFSET_2100_RTLD 0x2E1C0
|
|
||||||
#define FS_OFFSET_2100_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
|
|
||||||
|
|
||||||
#define FS_OFFSET_2100_CLKRST_SET_MIN_V_CLK_RATE 0x1CB9B0
|
|
||||||
|
|
||||||
// Misc funcs
|
|
||||||
#define FS_OFFSET_2100_LOCK_MUTEX 0x1A17D0
|
|
||||||
#define FS_OFFSET_2100_UNLOCK_MUTEX 0x1A1830
|
|
||||||
|
|
||||||
#define FS_OFFSET_2100_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1A8810
|
|
||||||
#define FS_OFFSET_2100_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1A8830
|
|
||||||
|
|
||||||
// Misc Data
|
|
||||||
#define FS_OFFSET_2100_SD_MUTEX 0xFEE408
|
|
||||||
#define FS_OFFSET_2100_NAND_MUTEX 0xFE9CF0
|
|
||||||
#define FS_OFFSET_2100_ACTIVE_PARTITION 0xFE9D30
|
|
||||||
#define FS_OFFSET_2100_SDMMC_DAS_HANDLE 0xFCBB18
|
|
||||||
|
|
||||||
// NOPs
|
|
||||||
#define FS_OFFSET_2100_SD_DAS_INIT 0x2B5C8
|
|
||||||
|
|
||||||
// Nintendo Paths
|
|
||||||
#define FS_OFFSET_2100_NINTENDO_PATHS \
|
|
||||||
{ \
|
|
||||||
{.opcode_reg = 3, .adrp_offset = 0x000718CC, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 3, .adrp_offset = 0x000824F4, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 4, .adrp_offset = 0x0008AF18, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 4, .adrp_offset = 0x000A0B8C, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __FS_2100_H__
|
|
||||||
59
emummc/source/FS/offsets/2100_exfat.h
vendored
59
emummc/source/FS/offsets/2100_exfat.h
vendored
@@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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_2100_EXFAT_EXFAT_H__
|
|
||||||
#define __FS_2100_EXFAT_EXFAT_H__
|
|
||||||
|
|
||||||
// Accessor vtable getters
|
|
||||||
#define FS_OFFSET_2100_EXFAT_SDMMC_ACCESSOR_GC 0x1B7AD0
|
|
||||||
#define FS_OFFSET_2100_EXFAT_SDMMC_ACCESSOR_SD 0x1B9AE0
|
|
||||||
#define FS_OFFSET_2100_EXFAT_SDMMC_ACCESSOR_NAND 0x1B8100
|
|
||||||
|
|
||||||
// Hooks
|
|
||||||
#define FS_OFFSET_2100_EXFAT_SDMMC_WRAPPER_READ 0x1B39B0
|
|
||||||
#define FS_OFFSET_2100_EXFAT_SDMMC_WRAPPER_WRITE 0x1B3A10
|
|
||||||
#define FS_OFFSET_2100_EXFAT_RTLD 0x2E1C0
|
|
||||||
#define FS_OFFSET_2100_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
|
|
||||||
|
|
||||||
#define FS_OFFSET_2100_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1D6B10
|
|
||||||
|
|
||||||
// Misc funcs
|
|
||||||
#define FS_OFFSET_2100_EXFAT_LOCK_MUTEX 0x1AC930
|
|
||||||
#define FS_OFFSET_2100_EXFAT_UNLOCK_MUTEX 0x1AC990
|
|
||||||
|
|
||||||
#define FS_OFFSET_2100_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1B3970
|
|
||||||
#define FS_OFFSET_2100_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1B3990
|
|
||||||
|
|
||||||
// Misc Data
|
|
||||||
#define FS_OFFSET_2100_EXFAT_SD_MUTEX 0xFFF408
|
|
||||||
#define FS_OFFSET_2100_EXFAT_NAND_MUTEX 0xFFACF0
|
|
||||||
#define FS_OFFSET_2100_EXFAT_ACTIVE_PARTITION 0xFFAD30
|
|
||||||
#define FS_OFFSET_2100_EXFAT_SDMMC_DAS_HANDLE 0xFD8B18
|
|
||||||
|
|
||||||
// NOPs
|
|
||||||
#define FS_OFFSET_2100_EXFAT_SD_DAS_INIT 0x2B5C8
|
|
||||||
|
|
||||||
// Nintendo Paths
|
|
||||||
#define FS_OFFSET_2100_EXFAT_NINTENDO_PATHS \
|
|
||||||
{ \
|
|
||||||
{.opcode_reg = 3, .adrp_offset = 0x000718CC, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 3, .adrp_offset = 0x000824F4, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 4, .adrp_offset = 0x0008AF18, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 4, .adrp_offset = 0x000A0B8C, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __FS_2100_EXFAT_EXFAT_H__
|
|
||||||
59
emummc/source/FS/offsets/2120.h
vendored
59
emummc/source/FS/offsets/2120.h
vendored
@@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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_2120_H__
|
|
||||||
#define __FS_2120_H__
|
|
||||||
|
|
||||||
// Accessor vtable getters
|
|
||||||
#define FS_OFFSET_2120_SDMMC_ACCESSOR_GC 0x1AC970
|
|
||||||
#define FS_OFFSET_2120_SDMMC_ACCESSOR_SD 0x1AE980
|
|
||||||
#define FS_OFFSET_2120_SDMMC_ACCESSOR_NAND 0x1ACFA0
|
|
||||||
|
|
||||||
// Hooks
|
|
||||||
#define FS_OFFSET_2120_SDMMC_WRAPPER_READ 0x1A8850
|
|
||||||
#define FS_OFFSET_2120_SDMMC_WRAPPER_WRITE 0x1A88B0
|
|
||||||
#define FS_OFFSET_2120_RTLD 0x2E1C0
|
|
||||||
#define FS_OFFSET_2120_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
|
|
||||||
|
|
||||||
#define FS_OFFSET_2120_CLKRST_SET_MIN_V_CLK_RATE 0x1CB9B0
|
|
||||||
|
|
||||||
// Misc funcs
|
|
||||||
#define FS_OFFSET_2120_LOCK_MUTEX 0x1A17D0
|
|
||||||
#define FS_OFFSET_2120_UNLOCK_MUTEX 0x1A1830
|
|
||||||
|
|
||||||
#define FS_OFFSET_2120_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1A8810
|
|
||||||
#define FS_OFFSET_2120_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1A8830
|
|
||||||
|
|
||||||
// Misc Data
|
|
||||||
#define FS_OFFSET_2120_SD_MUTEX 0xFEE408
|
|
||||||
#define FS_OFFSET_2120_NAND_MUTEX 0xFE9CF0
|
|
||||||
#define FS_OFFSET_2120_ACTIVE_PARTITION 0xFE9D30
|
|
||||||
#define FS_OFFSET_2120_SDMMC_DAS_HANDLE 0xFCBB18
|
|
||||||
|
|
||||||
// NOPs
|
|
||||||
#define FS_OFFSET_2120_SD_DAS_INIT 0x2B5C8
|
|
||||||
|
|
||||||
// Nintendo Paths
|
|
||||||
#define FS_OFFSET_2120_NINTENDO_PATHS \
|
|
||||||
{ \
|
|
||||||
{.opcode_reg = 3, .adrp_offset = 0x000718CC, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 3, .adrp_offset = 0x000824F4, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 4, .adrp_offset = 0x0008AF18, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 4, .adrp_offset = 0x000A0B8C, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __FS_2120_H__
|
|
||||||
59
emummc/source/FS/offsets/2120_exfat.h
vendored
59
emummc/source/FS/offsets/2120_exfat.h
vendored
@@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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_2120_EXFAT_EXFAT_H__
|
|
||||||
#define __FS_2120_EXFAT_EXFAT_H__
|
|
||||||
|
|
||||||
// Accessor vtable getters
|
|
||||||
#define FS_OFFSET_2120_EXFAT_SDMMC_ACCESSOR_GC 0x1B7AD0
|
|
||||||
#define FS_OFFSET_2120_EXFAT_SDMMC_ACCESSOR_SD 0x1B9AE0
|
|
||||||
#define FS_OFFSET_2120_EXFAT_SDMMC_ACCESSOR_NAND 0x1B8100
|
|
||||||
|
|
||||||
// Hooks
|
|
||||||
#define FS_OFFSET_2120_EXFAT_SDMMC_WRAPPER_READ 0x1B39B0
|
|
||||||
#define FS_OFFSET_2120_EXFAT_SDMMC_WRAPPER_WRITE 0x1B3A10
|
|
||||||
#define FS_OFFSET_2120_EXFAT_RTLD 0x2E1C0
|
|
||||||
#define FS_OFFSET_2120_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
|
|
||||||
|
|
||||||
#define FS_OFFSET_2120_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1D6B10
|
|
||||||
|
|
||||||
// Misc funcs
|
|
||||||
#define FS_OFFSET_2120_EXFAT_LOCK_MUTEX 0x1AC930
|
|
||||||
#define FS_OFFSET_2120_EXFAT_UNLOCK_MUTEX 0x1AC990
|
|
||||||
|
|
||||||
#define FS_OFFSET_2120_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1B3970
|
|
||||||
#define FS_OFFSET_2120_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1B3990
|
|
||||||
|
|
||||||
// Misc Data
|
|
||||||
#define FS_OFFSET_2120_EXFAT_SD_MUTEX 0xFFF408
|
|
||||||
#define FS_OFFSET_2120_EXFAT_NAND_MUTEX 0xFFACF0
|
|
||||||
#define FS_OFFSET_2120_EXFAT_ACTIVE_PARTITION 0xFFAD30
|
|
||||||
#define FS_OFFSET_2120_EXFAT_SDMMC_DAS_HANDLE 0xFD8B18
|
|
||||||
|
|
||||||
// NOPs
|
|
||||||
#define FS_OFFSET_2120_EXFAT_SD_DAS_INIT 0x2B5C8
|
|
||||||
|
|
||||||
// Nintendo Paths
|
|
||||||
#define FS_OFFSET_2120_EXFAT_NINTENDO_PATHS \
|
|
||||||
{ \
|
|
||||||
{.opcode_reg = 3, .adrp_offset = 0x000718CC, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 3, .adrp_offset = 0x000824F4, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 4, .adrp_offset = 0x0008AF18, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 4, .adrp_offset = 0x000A0B8C, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __FS_2120_EXFAT_EXFAT_H__
|
|
||||||
59
emummc/source/FS/offsets/2200.h
vendored
59
emummc/source/FS/offsets/2200.h
vendored
@@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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_2200_H__
|
|
||||||
#define __FS_2200_H__
|
|
||||||
|
|
||||||
// Accessor vtable getters
|
|
||||||
#define FS_OFFSET_2200_SDMMC_ACCESSOR_GC 0x1B01C0
|
|
||||||
#define FS_OFFSET_2200_SDMMC_ACCESSOR_SD 0x1B21C0
|
|
||||||
#define FS_OFFSET_2200_SDMMC_ACCESSOR_NAND 0x1B07F0
|
|
||||||
|
|
||||||
// Hooks
|
|
||||||
#define FS_OFFSET_2200_SDMMC_WRAPPER_READ 0x1AC0F0
|
|
||||||
#define FS_OFFSET_2200_SDMMC_WRAPPER_WRITE 0x1AC150
|
|
||||||
#define FS_OFFSET_2200_RTLD 0x2DED0
|
|
||||||
#define FS_OFFSET_2200_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
|
|
||||||
|
|
||||||
#define FS_OFFSET_2200_CLKRST_SET_MIN_V_CLK_RATE 0x1CF260
|
|
||||||
|
|
||||||
// Misc funcs
|
|
||||||
#define FS_OFFSET_2200_LOCK_MUTEX 0x1A4EF0
|
|
||||||
#define FS_OFFSET_2200_UNLOCK_MUTEX 0x1A4F40
|
|
||||||
|
|
||||||
#define FS_OFFSET_2200_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1AC0B0
|
|
||||||
#define FS_OFFSET_2200_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1AC0D0
|
|
||||||
|
|
||||||
// Misc Data
|
|
||||||
#define FS_OFFSET_2200_SD_MUTEX 0xFF1408
|
|
||||||
#define FS_OFFSET_2200_NAND_MUTEX 0xFECD00
|
|
||||||
#define FS_OFFSET_2200_ACTIVE_PARTITION 0xFECD40
|
|
||||||
#define FS_OFFSET_2200_SDMMC_DAS_HANDLE 0xFCEB98
|
|
||||||
|
|
||||||
// NOPs
|
|
||||||
#define FS_OFFSET_2200_SD_DAS_INIT 0x2B438
|
|
||||||
|
|
||||||
// Nintendo Paths
|
|
||||||
#define FS_OFFSET_2200_NINTENDO_PATHS \
|
|
||||||
{ \
|
|
||||||
{.opcode_reg = 3, .adrp_offset = 0x000715EC, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 3, .adrp_offset = 0x00082E64, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 4, .adrp_offset = 0x0008B888, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 4, .adrp_offset = 0x000A1B1C, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __FS_2200_H__
|
|
||||||
59
emummc/source/FS/offsets/2200_exfat.h
vendored
59
emummc/source/FS/offsets/2200_exfat.h
vendored
@@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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_2200_EXFAT_H__
|
|
||||||
#define __FS_2200_EXFAT_H__
|
|
||||||
|
|
||||||
// Accessor vtable getters
|
|
||||||
#define FS_OFFSET_2200_EXFAT_SDMMC_ACCESSOR_GC 0x1BB3B0
|
|
||||||
#define FS_OFFSET_2200_EXFAT_SDMMC_ACCESSOR_SD 0x1BD3B0
|
|
||||||
#define FS_OFFSET_2200_EXFAT_SDMMC_ACCESSOR_NAND 0x1BB9E0
|
|
||||||
|
|
||||||
// Hooks
|
|
||||||
#define FS_OFFSET_2200_EXFAT_SDMMC_WRAPPER_READ 0x1B72E0
|
|
||||||
#define FS_OFFSET_2200_EXFAT_SDMMC_WRAPPER_WRITE 0x1B7340
|
|
||||||
#define FS_OFFSET_2200_EXFAT_RTLD 0x2DED0
|
|
||||||
#define FS_OFFSET_2200_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
|
|
||||||
|
|
||||||
#define FS_OFFSET_2200_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1DA450
|
|
||||||
|
|
||||||
// Misc funcs
|
|
||||||
#define FS_OFFSET_2200_EXFAT_LOCK_MUTEX 0x1B00E0
|
|
||||||
#define FS_OFFSET_2200_EXFAT_UNLOCK_MUTEX 0x1B0130
|
|
||||||
|
|
||||||
#define FS_OFFSET_2200_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1B72A0
|
|
||||||
#define FS_OFFSET_2200_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1B72C0
|
|
||||||
|
|
||||||
// Misc Data
|
|
||||||
#define FS_OFFSET_2200_EXFAT_SD_MUTEX 0x1002408
|
|
||||||
#define FS_OFFSET_2200_EXFAT_NAND_MUTEX 0xFFDD00
|
|
||||||
#define FS_OFFSET_2200_EXFAT_ACTIVE_PARTITION 0xFFDD40
|
|
||||||
#define FS_OFFSET_2200_EXFAT_SDMMC_DAS_HANDLE 0xFDBB98
|
|
||||||
|
|
||||||
// NOPs
|
|
||||||
#define FS_OFFSET_2200_EXFAT_SD_DAS_INIT 0x2B438
|
|
||||||
|
|
||||||
// Nintendo Paths
|
|
||||||
#define FS_OFFSET_2200_EXFAT_NINTENDO_PATHS \
|
|
||||||
{ \
|
|
||||||
{.opcode_reg = 3, .adrp_offset = 0x000715EC, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 3, .adrp_offset = 0x00082E64, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 4, .adrp_offset = 0x0008B888, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 4, .adrp_offset = 0x000A1B1C, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __FS_2200_EXFAT_H__
|
|
||||||
59
emummc/source/FS/offsets/2250.h
vendored
59
emummc/source/FS/offsets/2250.h
vendored
@@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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_2250_H__
|
|
||||||
#define __FS_2250_H__
|
|
||||||
|
|
||||||
// Accessor vtable getters
|
|
||||||
#define FS_OFFSET_2250_SDMMC_ACCESSOR_GC 0x1B01C0
|
|
||||||
#define FS_OFFSET_2250_SDMMC_ACCESSOR_SD 0x1B21C0
|
|
||||||
#define FS_OFFSET_2250_SDMMC_ACCESSOR_NAND 0x1B07F0
|
|
||||||
|
|
||||||
// Hooks
|
|
||||||
#define FS_OFFSET_2250_SDMMC_WRAPPER_READ 0x1AC0F0
|
|
||||||
#define FS_OFFSET_2250_SDMMC_WRAPPER_WRITE 0x1AC150
|
|
||||||
#define FS_OFFSET_2250_RTLD 0x2DED0
|
|
||||||
#define FS_OFFSET_2250_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
|
|
||||||
|
|
||||||
#define FS_OFFSET_2250_CLKRST_SET_MIN_V_CLK_RATE 0x1CF260
|
|
||||||
|
|
||||||
// Misc funcs
|
|
||||||
#define FS_OFFSET_2250_LOCK_MUTEX 0x1A4EF0
|
|
||||||
#define FS_OFFSET_2250_UNLOCK_MUTEX 0x1A4F40
|
|
||||||
|
|
||||||
#define FS_OFFSET_2250_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1AC0B0
|
|
||||||
#define FS_OFFSET_2250_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1AC0D0
|
|
||||||
|
|
||||||
// Misc Data
|
|
||||||
#define FS_OFFSET_2250_SD_MUTEX 0xFF1408
|
|
||||||
#define FS_OFFSET_2250_NAND_MUTEX 0xFECD00
|
|
||||||
#define FS_OFFSET_2250_ACTIVE_PARTITION 0xFECD40
|
|
||||||
#define FS_OFFSET_2250_SDMMC_DAS_HANDLE 0xFCEB98
|
|
||||||
|
|
||||||
// NOPs
|
|
||||||
#define FS_OFFSET_2250_SD_DAS_INIT 0x2B438
|
|
||||||
|
|
||||||
// Nintendo Paths
|
|
||||||
#define FS_OFFSET_2250_NINTENDO_PATHS \
|
|
||||||
{ \
|
|
||||||
{.opcode_reg = 3, .adrp_offset = 0x000715EC, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 3, .adrp_offset = 0x00082E64, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 4, .adrp_offset = 0x0008B888, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 4, .adrp_offset = 0x000A1B1C, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __FS_2250_H__
|
|
||||||
59
emummc/source/FS/offsets/2250_exfat.h
vendored
59
emummc/source/FS/offsets/2250_exfat.h
vendored
@@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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_2250_EXFAT_H__
|
|
||||||
#define __FS_2250_EXFAT_H__
|
|
||||||
|
|
||||||
// Accessor vtable getters
|
|
||||||
#define FS_OFFSET_2250_EXFAT_SDMMC_ACCESSOR_GC 0x1BB3B0
|
|
||||||
#define FS_OFFSET_2250_EXFAT_SDMMC_ACCESSOR_SD 0x1BD3B0
|
|
||||||
#define FS_OFFSET_2250_EXFAT_SDMMC_ACCESSOR_NAND 0x1BB9E0
|
|
||||||
|
|
||||||
// Hooks
|
|
||||||
#define FS_OFFSET_2250_EXFAT_SDMMC_WRAPPER_READ 0x1B72E0
|
|
||||||
#define FS_OFFSET_2250_EXFAT_SDMMC_WRAPPER_WRITE 0x1B7340
|
|
||||||
#define FS_OFFSET_2250_EXFAT_RTLD 0x2DED0
|
|
||||||
#define FS_OFFSET_2250_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
|
|
||||||
|
|
||||||
#define FS_OFFSET_2250_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1DA450
|
|
||||||
|
|
||||||
// Misc funcs
|
|
||||||
#define FS_OFFSET_2250_EXFAT_LOCK_MUTEX 0x1B00E0
|
|
||||||
#define FS_OFFSET_2250_EXFAT_UNLOCK_MUTEX 0x1B0130
|
|
||||||
|
|
||||||
#define FS_OFFSET_2250_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1B72A0
|
|
||||||
#define FS_OFFSET_2250_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1B72C0
|
|
||||||
|
|
||||||
// Misc Data
|
|
||||||
#define FS_OFFSET_2250_EXFAT_SD_MUTEX 0x1002408
|
|
||||||
#define FS_OFFSET_2250_EXFAT_NAND_MUTEX 0xFFDD00
|
|
||||||
#define FS_OFFSET_2250_EXFAT_ACTIVE_PARTITION 0xFFDD40
|
|
||||||
#define FS_OFFSET_2250_EXFAT_SDMMC_DAS_HANDLE 0xFDBB98
|
|
||||||
|
|
||||||
// NOPs
|
|
||||||
#define FS_OFFSET_2250_EXFAT_SD_DAS_INIT 0x2B438
|
|
||||||
|
|
||||||
// Nintendo Paths
|
|
||||||
#define FS_OFFSET_2250_EXFAT_NINTENDO_PATHS \
|
|
||||||
{ \
|
|
||||||
{.opcode_reg = 3, .adrp_offset = 0x000715EC, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 3, .adrp_offset = 0x00082E64, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 4, .adrp_offset = 0x0008B888, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 4, .adrp_offset = 0x000A1B1C, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __FS_2250_EXFAT_H__
|
|
||||||
59
emummc/source/FS/offsets/2300.h
vendored
59
emummc/source/FS/offsets/2300.h
vendored
@@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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_2300_H__
|
|
||||||
#define __FS_2300_H__
|
|
||||||
|
|
||||||
// Accessor vtable getters
|
|
||||||
#define FS_OFFSET_2300_SDMMC_ACCESSOR_GC 0x1B3640
|
|
||||||
#define FS_OFFSET_2300_SDMMC_ACCESSOR_SD 0x1B5640
|
|
||||||
#define FS_OFFSET_2300_SDMMC_ACCESSOR_NAND 0x1B3C70
|
|
||||||
|
|
||||||
// Hooks
|
|
||||||
#define FS_OFFSET_2300_SDMMC_WRAPPER_READ 0x1AF570
|
|
||||||
#define FS_OFFSET_2300_SDMMC_WRAPPER_WRITE 0x1AF5D0
|
|
||||||
#define FS_OFFSET_2300_RTLD 0x2F520
|
|
||||||
#define FS_OFFSET_2300_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
|
|
||||||
|
|
||||||
#define FS_OFFSET_2300_CLKRST_SET_MIN_V_CLK_RATE 0x1D27E0
|
|
||||||
|
|
||||||
// Misc funcs
|
|
||||||
#define FS_OFFSET_2300_LOCK_MUTEX 0x1A8090
|
|
||||||
#define FS_OFFSET_2300_UNLOCK_MUTEX 0x1A80E0
|
|
||||||
|
|
||||||
#define FS_OFFSET_2300_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1AF530
|
|
||||||
#define FS_OFFSET_2300_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1AF550
|
|
||||||
|
|
||||||
// Misc Data
|
|
||||||
#define FS_OFFSET_2300_SD_MUTEX 0xFF5408
|
|
||||||
#define FS_OFFSET_2300_NAND_MUTEX 0xFF0D70
|
|
||||||
#define FS_OFFSET_2300_ACTIVE_PARTITION 0xFF0DB0
|
|
||||||
#define FS_OFFSET_2300_SDMMC_DAS_HANDLE 0xFD2BE8
|
|
||||||
|
|
||||||
// NOPs
|
|
||||||
#define FS_OFFSET_2300_SD_DAS_INIT 0x2CA98
|
|
||||||
|
|
||||||
// Nintendo Paths
|
|
||||||
#define FS_OFFSET_2300_NINTENDO_PATHS \
|
|
||||||
{ \
|
|
||||||
{.opcode_reg = 3, .adrp_offset = 0x00072D7C, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 3, .adrp_offset = 0x00081BA4, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 4, .adrp_offset = 0x0008A668, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 4, .adrp_offset = 0x0009F97C, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __FS_2300_H__
|
|
||||||
59
emummc/source/FS/offsets/2300_exfat.h
vendored
59
emummc/source/FS/offsets/2300_exfat.h
vendored
@@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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_2300_EXFAT_H__
|
|
||||||
#define __FS_2300_EXFAT_H__
|
|
||||||
|
|
||||||
// Accessor vtable getters
|
|
||||||
#define FS_OFFSET_2300_EXFAT_SDMMC_ACCESSOR_GC 0x1BE840
|
|
||||||
#define FS_OFFSET_2300_EXFAT_SDMMC_ACCESSOR_SD 0x1C0840
|
|
||||||
#define FS_OFFSET_2300_EXFAT_SDMMC_ACCESSOR_NAND 0x1BEE70
|
|
||||||
|
|
||||||
// Hooks
|
|
||||||
#define FS_OFFSET_2300_EXFAT_SDMMC_WRAPPER_READ 0x1BA770
|
|
||||||
#define FS_OFFSET_2300_EXFAT_SDMMC_WRAPPER_WRITE 0x1BA7D0
|
|
||||||
#define FS_OFFSET_2300_EXFAT_RTLD 0x2F530
|
|
||||||
#define FS_OFFSET_2300_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
|
|
||||||
|
|
||||||
#define FS_OFFSET_2300_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1DD9E0
|
|
||||||
|
|
||||||
// Misc funcs
|
|
||||||
#define FS_OFFSET_2300_EXFAT_LOCK_MUTEX 0x1B3290
|
|
||||||
#define FS_OFFSET_2300_EXFAT_UNLOCK_MUTEX 0x1B32E0
|
|
||||||
|
|
||||||
#define FS_OFFSET_2300_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1BA730
|
|
||||||
#define FS_OFFSET_2300_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1BA750
|
|
||||||
|
|
||||||
// Misc Data
|
|
||||||
#define FS_OFFSET_2300_EXFAT_SD_MUTEX 0x1006408
|
|
||||||
#define FS_OFFSET_2300_EXFAT_NAND_MUTEX 0x1001D70
|
|
||||||
#define FS_OFFSET_2300_EXFAT_ACTIVE_PARTITION 0x1001DB0
|
|
||||||
#define FS_OFFSET_2300_EXFAT_SDMMC_DAS_HANDLE 0xFDFBE8
|
|
||||||
|
|
||||||
// NOPs
|
|
||||||
#define FS_OFFSET_2300_EXFAT_SD_DAS_INIT 0x2CAA8
|
|
||||||
|
|
||||||
// Nintendo Paths
|
|
||||||
#define FS_OFFSET_2300_EXFAT_NINTENDO_PATHS \
|
|
||||||
{ \
|
|
||||||
{.opcode_reg = 3, .adrp_offset = 0x00072D8C, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 3, .adrp_offset = 0x00081BB4, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 4, .adrp_offset = 0x0008A678, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 4, .adrp_offset = 0x0009F98C, .add_rel_offset = 0x00000004}, \
|
|
||||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __FS_2300_EXFAT_H__
|
|
||||||
@@ -70,6 +70,6 @@ clean:
|
|||||||
@$(MAKE) --no-print-directory -C $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere -f $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/libexosphere.mk clean
|
@$(MAKE) --no-print-directory -C $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere -f $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/libexosphere.mk clean
|
||||||
@$(MAKE) --no-print-directory -C $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere -f $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/libexosphere.mk clean ATMOSPHERE_CPU="$(strip $(ATMOSPHERE_BOOT_CPU))"
|
@$(MAKE) --no-print-directory -C $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere -f $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/libexosphere.mk clean ATMOSPHERE_CPU="$(strip $(ATMOSPHERE_BOOT_CPU))"
|
||||||
@rm -fr $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
|
@rm -fr $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
|
||||||
@for i in $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR); do [ -d $$i ] && rmdir $$i 2>/dev/null || true; done
|
@for i in $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR); do [ -d $$i ] && rmdir --ignore-fail-on-non-empty $$i || true; done
|
||||||
|
|
||||||
.PHONY: all clean check_lib check_boot_lib check_loader_stub check_program check_mariko_fatal check_warmboot
|
.PHONY: all clean check_lib check_boot_lib check_loader_stub check_program check_mariko_fatal check_warmboot
|
||||||
@@ -119,7 +119,7 @@ DEPENDS := $(OFILES:.o=.d)
|
|||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
|
|
||||||
$(OUTPUT).lz4 : $(OUTPUT).bin
|
$(OUTPUT).lz4 : $(OUTPUT).bin
|
||||||
$(SILENTCMD)$(PYTHON) $(CURRENT_DIRECTORY)/split_program.py $(OUTPUT).bin $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
|
@python $(CURRENT_DIRECTORY)/split_program.py $(OUTPUT).bin $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
|
||||||
@echo built ... $(notdir $@)
|
@echo built ... $(notdir $@)
|
||||||
|
|
||||||
$(OUTPUT).bin : $(OUTPUT).elf
|
$(OUTPUT).bin : $(OUTPUT).elf
|
||||||
|
|||||||
@@ -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 0x2B, 0xCD, 0xE7, 0xA4, 0x93, 0x12, 0x0A, 0x72, 0x64, 0x2B, 0x9E, 0xA4, 0xC2, 0x9F, 0xED, 0x13
|
.byte 0x65, 0x7B, 0x11, 0x46, 0x0E, 0xC2, 0x22, 0x5D, 0xB9, 0xF1, 0xF5, 0x00, 0xF9, 0x3E, 0x1F, 0x70
|
||||||
|
|
||||||
/* Mariko Production Master Kek Source. */
|
/* Mariko Production Master Kek Source. */
|
||||||
.byte 0x08, 0x11, 0xF7, 0xE8, 0x76, 0x9E, 0xA3, 0xD5, 0x3A, 0x3D, 0x7A, 0x68, 0x1A, 0x24, 0x2A, 0x99
|
.byte 0x31, 0xBE, 0x25, 0xFB, 0xDB, 0xB4, 0xEE, 0x49, 0x5C, 0x77, 0x05, 0xC2, 0x36, 0x9F, 0x34, 0x80
|
||||||
|
|
||||||
/* 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. */
|
||||||
@@ -110,10 +110,6 @@ _ZN3ams6secmon4boot15VolatileKeyDataE:
|
|||||||
.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 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 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 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. */
|
|
||||||
.byte 0x74, 0xB2, 0x5F, 0xA0, 0x4B, 0x74, 0x6D, 0x47, 0x5B, 0xA9, 0xF5, 0x26, 0x46, 0xD7, 0x4B, 0x6E /* Master key 13 encrypted with Master key 14. */
|
|
||||||
.byte 0x97, 0xB3, 0x61, 0x88, 0x5C, 0x0D, 0xA1, 0x38, 0x73, 0xA4, 0x2F, 0x1A, 0x46, 0xA1, 0x09, 0xBF /* Master key 14 encrypted with Master key 15. */
|
|
||||||
.byte 0xA6, 0x25, 0x12, 0x6D, 0xA1, 0x12, 0x1F, 0x15, 0x08, 0x2F, 0x30, 0x5F, 0xCB, 0x7D, 0x32, 0x82 /* Master key 15 encrypted with Master key 16. */
|
|
||||||
|
|
||||||
/* 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. */
|
||||||
@@ -135,10 +131,6 @@ _ZN3ams6secmon4boot15VolatileKeyDataE:
|
|||||||
.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 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 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 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. */
|
|
||||||
.byte 0xF7, 0x92, 0xC0, 0xEC, 0xF3, 0xA4, 0x8C, 0xB7, 0x0D, 0xB3, 0xF3, 0xAB, 0x10, 0x9B, 0x18, 0xBA /* Master key 13 encrypted with Master key 14. */
|
|
||||||
.byte 0x14, 0xCB, 0x60, 0x29, 0x3D, 0xE0, 0xFB, 0xF2, 0x5B, 0x60, 0xB6, 0xC5, 0x2E, 0x77, 0x8F, 0x98 /* Master key 14 encrypted with Master key 15. */
|
|
||||||
.byte 0x26, 0x87, 0xDF, 0x21, 0x44, 0xD4, 0x5F, 0x4E, 0x61, 0x03, 0x9E, 0xF3, 0x40, 0x04, 0xC3, 0x87 /* Master Key 15 encrypted with Master Key 16. */
|
|
||||||
|
|
||||||
/* 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. */
|
||||||
@@ -157,10 +149,6 @@ _ZN3ams6secmon4boot15VolatileKeyDataE:
|
|||||||
.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 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 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 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. */
|
|
||||||
.byte 0xF9, 0x62, 0x05, 0x99, 0xE0, 0xB9, 0xA6, 0x9B, 0x9D, 0xAA, 0xB4, 0x12, 0x0B, 0x0F, 0xF5, 0x8F /* 21.0.0 Device Master Key Source Source. */
|
|
||||||
.byte 0xF8, 0xF4, 0x22, 0xA4, 0x34, 0xAE, 0x0E, 0x0C, 0x4D, 0x5C, 0x5B, 0xA1, 0x1B, 0x46, 0x1C, 0x78 /* 22.0.0 Device Master Key Source Source. */
|
|
||||||
.byte 0x95, 0xC1, 0xAC, 0xB7, 0xB2, 0xCA, 0x9B, 0x8C, 0xD5, 0xEA, 0x40, 0xD9, 0x9C, 0xD2, 0x7C, 0x47 /* 23.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. */
|
||||||
@@ -179,10 +167,6 @@ _ZN3ams6secmon4boot15VolatileKeyDataE:
|
|||||||
.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 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 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 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. */
|
|
||||||
.byte 0x7A, 0x4C, 0x38, 0xB7, 0x03, 0x6B, 0x1E, 0x81, 0x20, 0x53, 0x14, 0x99, 0xA4, 0x21, 0x92, 0x9F /* 21.0.0 Device Master Kek Source. */
|
|
||||||
.byte 0xF3, 0xBC, 0xB5, 0xB5, 0x5F, 0x01, 0x50, 0x2B, 0x69, 0x69, 0x3A, 0x6B, 0xF9, 0x2C, 0x11, 0x9F /* 22.0.0 Device Master Kek Source. */
|
|
||||||
.byte 0x54, 0xAD, 0x79, 0x15, 0x11, 0x7C, 0x1E, 0x52, 0xBF, 0x2E, 0x40, 0xBB, 0x8B, 0x11, 0x54, 0x38 /* 23.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. */
|
||||||
@@ -201,7 +185,3 @@ _ZN3ams6secmon4boot15VolatileKeyDataE:
|
|||||||
.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 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 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 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. */
|
|
||||||
.byte 0x92, 0xBF, 0x37, 0x80, 0x0E, 0x79, 0x56, 0x8C, 0x57, 0x75, 0x72, 0x0A, 0x48, 0xD8, 0x15, 0x39 /* 21.0.0 Device Master Kek Source. */
|
|
||||||
.byte 0xC4, 0x6F, 0x0E, 0x72, 0x43, 0xCE, 0x87, 0xFC, 0x38, 0x95, 0x9B, 0xC9, 0x31, 0x44, 0x97, 0x63 /* 22.0.0 Device Master Kek Source. */
|
|
||||||
.byte 0xA0, 0xC8, 0x44, 0x39, 0x8A, 0x1F, 0xD8, 0x6A, 0x3D, 0x0A, 0x23, 0xFF, 0x43, 0xA6, 0x95, 0x80 /* 23.0.0 Device Master Kek Source. */
|
|
||||||
@@ -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 == 23);
|
static_assert(pkg1::KeyGeneration_Count == 19);
|
||||||
if (key_generation >= pkg1::KeyGeneration_Count) {
|
if (key_generation >= pkg1::KeyGeneration_Count) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,13 +132,10 @@ namespace ams::secmon::smc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
u32 GetMemoryMode() {
|
u32 GetMemoryMode() {
|
||||||
/* Unless development function or forced boot config memory size is enabled, we're 4 GB. */
|
/* Unless development function is enabled, we're 4 GB. */
|
||||||
u32 memory_mode = pkg1::MemoryMode_4GB;
|
u32 memory_mode = pkg1::MemoryMode_4GB;
|
||||||
|
|
||||||
const auto &bcd = GetBootConfig().data;
|
if (const auto &bcd = GetBootConfig().data; bcd.IsDevelopmentFunctionEnabled()) {
|
||||||
const auto &sc = GetSecmonConfiguration(); /* Exosphere extensions */
|
|
||||||
|
|
||||||
if (bcd.IsDevelopmentFunctionEnabled() || sc.IsBootConfigMemoryModeEnabled()) {
|
|
||||||
memory_mode = GetMemoryMode(bcd.GetMemoryMode());
|
memory_mode = GetMemoryMode(bcd.GetMemoryMode());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,20 +146,18 @@ namespace ams::secmon::smc {
|
|||||||
pkg1::MemorySize memory_size = pkg1::MemorySize_4GB;
|
pkg1::MemorySize memory_size = pkg1::MemorySize_4GB;
|
||||||
util::BitPack32 value = {};
|
util::BitPack32 value = {};
|
||||||
|
|
||||||
const auto &bcd = GetBootConfig().data;
|
if (const auto &bcd = GetBootConfig().data; bcd.IsDevelopmentFunctionEnabled()) {
|
||||||
const auto &sc = GetSecmonConfiguration(); /* Exosphere extensions */
|
memory_size = GetMemorySize(GetMemoryMode(bcd.GetMemoryMode()));
|
||||||
|
|
||||||
if (bcd.IsDevelopmentFunctionEnabled()) {
|
|
||||||
value.Set<KernelConfiguration::Flags1>(bcd.GetKernelFlags1());
|
value.Set<KernelConfiguration::Flags1>(bcd.GetKernelFlags1());
|
||||||
value.Set<KernelConfiguration::Flags0>(bcd.GetKernelFlags0());
|
value.Set<KernelConfiguration::Flags0>(bcd.GetKernelFlags0());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bcd.IsDevelopmentFunctionEnabled() || sc.IsBootConfigMemoryModeEnabled()) {
|
|
||||||
memory_size = GetMemorySize(GetMemoryMode(bcd.GetMemoryMode()));
|
|
||||||
}
|
|
||||||
|
|
||||||
value.Set<KernelConfiguration::PhysicalMemorySize>(memory_size);
|
value.Set<KernelConfiguration::PhysicalMemorySize>(memory_size);
|
||||||
|
|
||||||
|
/* Exosphere extensions. */
|
||||||
|
const auto &sc = GetSecmonConfiguration();
|
||||||
|
|
||||||
if (!sc.DisableUserModeExceptionHandlers()) {
|
if (!sc.DisableUserModeExceptionHandlers()) {
|
||||||
value.Set<KernelConfiguration::EnableUserExceptionHandlers>(true);
|
value.Set<KernelConfiguration::EnableUserExceptionHandlers>(true);
|
||||||
}
|
}
|
||||||
@@ -174,27 +169,6 @@ namespace ams::secmon::smc {
|
|||||||
return value.value;
|
return value.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
fuse::DramId GetDramIdAdjusted() {
|
|
||||||
const auto dram_id = fuse::GetDramId();
|
|
||||||
AMS_ABORT_UNLESS(dram_id < fuse::DramId_Count);
|
|
||||||
|
|
||||||
const auto fuse_mem_size = DramIdToMemorySize[dram_id];
|
|
||||||
const auto phys_mem_size = GetPhysicalMemorySize();
|
|
||||||
|
|
||||||
AMS_ABORT_UNLESS(fuse_mem_size <= phys_mem_size);
|
|
||||||
|
|
||||||
if (fuse_mem_size == phys_mem_size) {
|
|
||||||
return dram_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Adjust Dram ID to match density/ranks. */
|
|
||||||
if (GetSocType() == fuse::SocType_Erista) {
|
|
||||||
return fuse::DramId_IcosaSamsung6GB;
|
|
||||||
} else { /* fuse::SocType_Mariko */
|
|
||||||
return fuse::DramId_IowaSamsung1y8GBX;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
constinit u64 g_payload_address = 0;
|
constinit u64 g_payload_address = 0;
|
||||||
constinit bool g_set_true_target_firmware = false;
|
constinit bool g_set_true_target_firmware = false;
|
||||||
|
|
||||||
@@ -204,7 +178,7 @@ namespace ams::secmon::smc {
|
|||||||
args.r[1] = GetBootConfig().signed_data.IsProgramVerificationDisabled();
|
args.r[1] = GetBootConfig().signed_data.IsProgramVerificationDisabled();
|
||||||
break;
|
break;
|
||||||
case ConfigItem::DramId:
|
case ConfigItem::DramId:
|
||||||
args.r[1] = GetDramIdAdjusted(); /* Nintendo: fuse::GetDramId() */
|
args.r[1] = fuse::GetDramId();
|
||||||
break;
|
break;
|
||||||
case ConfigItem::SecurityEngineInterruptNumber:
|
case ConfigItem::SecurityEngineInterruptNumber:
|
||||||
args.r[1] = SecurityEngineUserInterruptId;
|
args.r[1] = SecurityEngineUserInterruptId;
|
||||||
@@ -271,9 +245,6 @@ namespace ams::secmon::smc {
|
|||||||
std::memcpy(std::addressof(args.r[1]), std::addressof(tmp_hash), sizeof(tmp_hash));
|
std::memcpy(std::addressof(args.r[1]), std::addressof(tmp_hash), sizeof(tmp_hash));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ConfigItem::Unknown18:
|
|
||||||
args.r[1] = GetBootConfig().data.GetUnknown70();
|
|
||||||
break;
|
|
||||||
case ConfigItem::ExosphereApiVersion:
|
case ConfigItem::ExosphereApiVersion:
|
||||||
/* Get information about the current exosphere version. */
|
/* Get information about the current exosphere version. */
|
||||||
if (kern || g_set_true_target_firmware) {
|
if (kern || g_set_true_target_firmware) {
|
||||||
@@ -500,18 +471,9 @@ namespace ams::secmon::smc {
|
|||||||
|
|
||||||
/* For exosphere's usage. */
|
/* For exosphere's usage. */
|
||||||
pkg1::MemorySize GetPhysicalMemorySize() {
|
pkg1::MemorySize GetPhysicalMemorySize() {
|
||||||
const uintptr_t MC = secmon::MemoryRegionVirtualDeviceMemoryController.GetAddress();
|
const auto dram_id = fuse::GetDramId();
|
||||||
const u32 mem_size = reg::Read(MC + MC_EMEM_CFG) & 0x3FFF;
|
AMS_ABORT_UNLESS(dram_id < fuse::DramId_Count);
|
||||||
|
return DramIdToMemorySize[dram_id];
|
||||||
switch (mem_size >> 10) {
|
|
||||||
case 4:
|
|
||||||
default:
|
|
||||||
return pkg1::MemorySize_4GB;
|
|
||||||
case 6:
|
|
||||||
return pkg1::MemorySize_6GB;
|
|
||||||
case 8:
|
|
||||||
return pkg1::MemorySize_8GB;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ namespace ams::secmon::smc {
|
|||||||
RegulatorType = 15,
|
RegulatorType = 15,
|
||||||
DeviceUniqueKeyGeneration = 16,
|
DeviceUniqueKeyGeneration = 16,
|
||||||
Package2Hash = 17,
|
Package2Hash = 17,
|
||||||
Unknown18 = 18,
|
|
||||||
|
|
||||||
/* Extension config items for exosphere. */
|
/* Extension config items for exosphere. */
|
||||||
ExosphereApiVersion = 65000,
|
ExosphereApiVersion = 65000,
|
||||||
|
|||||||
@@ -101,10 +101,10 @@ namespace ams::secmon::smc {
|
|||||||
#include "secmon_define_mc01_access_table.inc"
|
#include "secmon_define_mc01_access_table.inc"
|
||||||
|
|
||||||
constexpr const AccessTableEntry AccessTables[] = {
|
constexpr const AccessTableEntry AccessTables[] = {
|
||||||
{ PmcAccessTable::ReducedAccessTable.data(), MemoryRegionVirtualDevicePmc.GetAddress(), PmcAccessTable::Address, PmcAccessTable::Size, },
|
{ PmcAccessTable::ReducedAccessTable.data(), MemoryRegionVirtualDevicePmc.GetAddress(), PmcAccessTable::Address, PmcAccessTable::Size, },
|
||||||
{ McAccessTable::ReducedAccessTable.data(), MemoryRegionVirtualDeviceMemoryController.GetAddress(), McAccessTable::Address, McAccessTable::Size, },
|
{ McAccessTable::ReducedAccessTable.data(), MemoryRegionVirtualDeviceMemoryController.GetAddress(), McAccessTable::Address, McAccessTable::Size, },
|
||||||
{ Mc01AccessTable::ReducedAccessTable.data(), Mc01AccessTable::Address + MemoryRegionVirtualDeviceMemoryController0.GetAddress(), Mc01AccessTable::Address + MemoryRegionPhysicalDeviceMemoryController0.GetAddress(), Mc01AccessTable::Size, },
|
{ Mc01AccessTable::ReducedAccessTable.data(), MemoryRegionVirtualDeviceMemoryController0.GetAddress(), Mc01AccessTable::Address + MemoryRegionPhysicalDeviceMemoryController0.GetAddress(), Mc01AccessTable::Size, },
|
||||||
{ Mc01AccessTable::ReducedAccessTable.data(), Mc01AccessTable::Address + MemoryRegionVirtualDeviceMemoryController1.GetAddress(), Mc01AccessTable::Address + MemoryRegionPhysicalDeviceMemoryController1.GetAddress(), Mc01AccessTable::Size, },
|
{ Mc01AccessTable::ReducedAccessTable.data(), MemoryRegionVirtualDeviceMemoryController1.GetAddress(), Mc01AccessTable::Address + MemoryRegionPhysicalDeviceMemoryController1.GetAddress(), Mc01AccessTable::Size, },
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr bool IsAccessAllowed(const AccessTableEntry &entry, uintptr_t address) {
|
constexpr bool IsAccessAllowed(const AccessTableEntry &entry, uintptr_t address) {
|
||||||
|
|||||||
@@ -43,6 +43,6 @@ clean:
|
|||||||
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/loader_stub -f $(CURRENT_DIRECTORY)/loader_stub/loader_stub.mk clean
|
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/loader_stub -f $(CURRENT_DIRECTORY)/loader_stub/loader_stub.mk clean
|
||||||
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/program -f $(CURRENT_DIRECTORY)/program/program.mk clean
|
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/program -f $(CURRENT_DIRECTORY)/program/program.mk clean
|
||||||
@rm -fr $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
|
@rm -fr $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
|
||||||
@for i in $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR); do [ -d $$i ] && rmdir $$i 2>/dev/null || true; done
|
@for i in $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR); do [ -d $$i ] && rmdir --ignore-fail-on-non-empty $$i || true; done
|
||||||
|
|
||||||
.PHONY: all clean check_lib check_loader_stub check_program
|
.PHONY: all clean check_lib check_loader_stub check_program
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -84,7 +84,7 @@ DEPENDS := $(OFILES:.o=.d)
|
|||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
|
|
||||||
$(OUTPUT).lz4 : $(OUTPUT).bin
|
$(OUTPUT).lz4 : $(OUTPUT).bin
|
||||||
$(SILENTCMD)$(PYTHON) $(CURRENT_DIRECTORY)/lz4_compress.py $(OUTPUT).bin $(OUTPUT).lz4
|
@python $(CURRENT_DIRECTORY)/lz4_compress.py $(OUTPUT).bin $(OUTPUT).lz4
|
||||||
@echo built ... $(notdir $@)
|
@echo built ... $(notdir $@)
|
||||||
|
|
||||||
$(OUTPUT).bin : $(OUTPUT).elf
|
$(OUTPUT).bin : $(OUTPUT).elf
|
||||||
|
|||||||
@@ -602,7 +602,7 @@ namespace ams::nxboot {
|
|||||||
Print("\n");
|
Print("\n");
|
||||||
|
|
||||||
if (R_SUCCEEDED(save_result)) {
|
if (R_SUCCEEDED(save_result)) {
|
||||||
Print("Report saved to /atmosphere/fatal_errors/report_%016" PRIx64 ".bin\n", f_ctx->report_identifier);
|
Print("Report saved to /atmosphere/fatal_errors/report_%016" PRIx64 ".bin", f_ctx->report_identifier);
|
||||||
} else {
|
} else {
|
||||||
Print("Failed to save report to the SD card! (%08" PRIx32 ")\n", save_result.GetValue());
|
Print("Failed to save report to the SD card! (%08" PRIx32 ")\n", save_result.GetValue());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,17 +23,17 @@ namespace ams::nxboot {
|
|||||||
|
|
||||||
alignas(se::AesBlockSize) constexpr inline const u8 MarikoMasterKekSource[se::AesBlockSize] = {
|
alignas(se::AesBlockSize) constexpr inline const u8 MarikoMasterKekSource[se::AesBlockSize] = {
|
||||||
/* TODO: Update on next change of keys. */
|
/* TODO: Update on next change of keys. */
|
||||||
0x08, 0x11, 0xF7, 0xE8, 0x76, 0x9E, 0xA3, 0xD5, 0x3A, 0x3D, 0x7A, 0x68, 0x1A, 0x24, 0x2A, 0x99
|
0x31, 0xBE, 0x25, 0xFB, 0xDB, 0xB4, 0xEE, 0x49, 0x5C, 0x77, 0x05, 0xC2, 0x36, 0x9F, 0x34, 0x80
|
||||||
};
|
};
|
||||||
|
|
||||||
alignas(se::AesBlockSize) constexpr inline const u8 MarikoMasterKekSourceDev[se::AesBlockSize] = {
|
alignas(se::AesBlockSize) constexpr inline const u8 MarikoMasterKekSourceDev[se::AesBlockSize] = {
|
||||||
/* TODO: Update on next change of keys. */
|
/* TODO: Update on next change of keys. */
|
||||||
0x2B, 0xCD, 0xE7, 0xA4, 0x93, 0x12, 0x0A, 0x72, 0x64, 0x2B, 0x9E, 0xA4, 0xC2, 0x9F, 0xED, 0x13
|
0x65, 0x7B, 0x11, 0x46, 0x0E, 0xC2, 0x22, 0x5D, 0xB9, 0xF1, 0xF5, 0x00, 0xF9, 0x3E, 0x1F, 0x70
|
||||||
};
|
};
|
||||||
|
|
||||||
alignas(se::AesBlockSize) constexpr inline const u8 EristaMasterKekSource[se::AesBlockSize] = {
|
alignas(se::AesBlockSize) constexpr inline const u8 EristaMasterKekSource[se::AesBlockSize] = {
|
||||||
/* TODO: Update on next change of keys. */
|
/* TODO: Update on next change of keys. */
|
||||||
0x92, 0xC8, 0x9C, 0x8A, 0x58, 0xE6, 0xE7, 0xB6, 0xE4, 0x27, 0xE2, 0x31, 0xEF, 0x4B, 0xD8, 0x82
|
0xD7, 0x63, 0x74, 0x46, 0x4E, 0xBA, 0x78, 0x0A, 0x7C, 0x9D, 0xB3, 0xE8, 0x7A, 0x3D, 0x71, 0xE3
|
||||||
};
|
};
|
||||||
|
|
||||||
alignas(se::AesBlockSize) constexpr inline const u8 KeyblobKeySource[se::AesBlockSize] = {
|
alignas(se::AesBlockSize) constexpr inline const u8 KeyblobKeySource[se::AesBlockSize] = {
|
||||||
@@ -73,10 +73,6 @@ namespace ams::nxboot {
|
|||||||
{ 0xDA, 0xB9, 0xD6, 0x77, 0x52, 0x2D, 0x1F, 0x78, 0x73, 0xC9, 0x98, 0x5B, 0x06, 0xFE, 0xA0, 0x52 }, /* 17.0.0 Device Master Key Source Source. */
|
{ 0xDA, 0xB9, 0xD6, 0x77, 0x52, 0x2D, 0x1F, 0x78, 0x73, 0xC9, 0x98, 0x5B, 0x06, 0xFE, 0xA0, 0x52 }, /* 17.0.0 Device Master Key Source Source. */
|
||||||
{ 0x14, 0xF5, 0xA5, 0xD0, 0x73, 0x6D, 0x44, 0x80, 0x5F, 0x31, 0x5A, 0x8F, 0x1E, 0xD4, 0x0D, 0x63 }, /* 18.0.0 Device Master Key Source Source. */
|
{ 0x14, 0xF5, 0xA5, 0xD0, 0x73, 0x6D, 0x44, 0x80, 0x5F, 0x31, 0x5A, 0x8F, 0x1E, 0xD4, 0x0D, 0x63 }, /* 18.0.0 Device Master Key Source Source. */
|
||||||
{ 0x07, 0x38, 0x9A, 0xEC, 0x9C, 0xBD, 0x50, 0x4A, 0x4C, 0x1F, 0x04, 0xDA, 0x40, 0x68, 0x29, 0xE3 }, /* 19.0.0 Device Master Key Source Source. */
|
{ 0x07, 0x38, 0x9A, 0xEC, 0x9C, 0xBD, 0x50, 0x4A, 0x4C, 0x1F, 0x04, 0xDA, 0x40, 0x68, 0x29, 0xE3 }, /* 19.0.0 Device Master Key Source Source. */
|
||||||
{ 0xA3, 0x6B, 0x0A, 0xB5, 0x6F, 0x57, 0x4C, 0x5E, 0x00, 0xFD, 0x56, 0x21, 0xF5, 0x06, 0x6B, 0xD1 }, /* 20.0.0 Device Master Key Source Source. */
|
|
||||||
{ 0xF9, 0x62, 0x05, 0x99, 0xE0, 0xB9, 0xA6, 0x9B, 0x9D, 0xAA, 0xB4, 0x12, 0x0B, 0x0F, 0xF5, 0x8F }, /* 21.0.0 Device Master Key Source Source. */
|
|
||||||
{ 0xF8, 0xF4, 0x22, 0xA4, 0x34, 0xAE, 0x0E, 0x0C, 0x4D, 0x5C, 0x5B, 0xA1, 0x1B, 0x46, 0x1C, 0x78 }, /* 22.0.0 Device Master Key Source Source. */
|
|
||||||
{ 0x95, 0xC1, 0xAC, 0xB7, 0xB2, 0xCA, 0x9B, 0x8C, 0xD5, 0xEA, 0x40, 0xD9, 0x9C, 0xD2, 0x7C, 0x47 }, /* 23.0.0 Device Master Key Source Source. */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
alignas(se::AesBlockSize) constexpr inline const u8 DeviceMasterKekSources[pkg1::OldDeviceMasterKeyCount][se::AesBlockSize] = {
|
alignas(se::AesBlockSize) constexpr inline const u8 DeviceMasterKekSources[pkg1::OldDeviceMasterKeyCount][se::AesBlockSize] = {
|
||||||
@@ -96,10 +92,6 @@ namespace ams::nxboot {
|
|||||||
{ 0x21, 0xD6, 0x35, 0xF1, 0x0F, 0x7A, 0xF0, 0x5D, 0xDF, 0x79, 0x1C, 0x7A, 0xE4, 0x32, 0x82, 0x9E }, /* 17.0.0 Device Master Kek Source. */
|
{ 0x21, 0xD6, 0x35, 0xF1, 0x0F, 0x7A, 0xF0, 0x5D, 0xDF, 0x79, 0x1C, 0x7A, 0xE4, 0x32, 0x82, 0x9E }, /* 17.0.0 Device Master Kek Source. */
|
||||||
{ 0xE7, 0x85, 0x8C, 0xA2, 0xF4, 0x49, 0xCB, 0x07, 0xD1, 0x8E, 0x48, 0x1B, 0xE8, 0x1E, 0x28, 0x3B }, /* 18.0.0 Device Master Kek Source. */
|
{ 0xE7, 0x85, 0x8C, 0xA2, 0xF4, 0x49, 0xCB, 0x07, 0xD1, 0x8E, 0x48, 0x1B, 0xE8, 0x1E, 0x28, 0x3B }, /* 18.0.0 Device Master Kek Source. */
|
||||||
{ 0x9B, 0xA5, 0xFD, 0x74, 0x7F, 0xCD, 0x23, 0xD1, 0xD9, 0xBD, 0x6C, 0x51, 0x72, 0x5F, 0x3D, 0x1F }, /* 19.0.0 Device Master Kek Source. */
|
{ 0x9B, 0xA5, 0xFD, 0x74, 0x7F, 0xCD, 0x23, 0xD1, 0xD9, 0xBD, 0x6C, 0x51, 0x72, 0x5F, 0x3D, 0x1F }, /* 19.0.0 Device Master Kek Source. */
|
||||||
{ 0xDA, 0xFB, 0x61, 0x39, 0x48, 0x2D, 0xC2, 0x7E, 0x0D, 0x8E, 0x8F, 0x98, 0x57, 0x20, 0xB8, 0x15 }, /* 20.0.0 Device Master Kek Source. */
|
|
||||||
{ 0x92, 0xBF, 0x37, 0x80, 0x0E, 0x79, 0x56, 0x8C, 0x57, 0x75, 0x72, 0x0A, 0x48, 0xD8, 0x15, 0x39 }, /* 21.0.0 Device Master Kek Source. */
|
|
||||||
{ 0xC4, 0x6F, 0x0E, 0x72, 0x43, 0xCE, 0x87, 0xFC, 0x38, 0x95, 0x9B, 0xC9, 0x31, 0x44, 0x97, 0x63 }, /* 22.0.0 Device Master Kek Source. */
|
|
||||||
{ 0xA0, 0xC8, 0x44, 0x39, 0x8A, 0x1F, 0xD8, 0x6A, 0x3D, 0x0A, 0x23, 0xFF, 0x43, 0xA6, 0x95, 0x80 }, /* 23.0.0 Device Master Kek Source. */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
alignas(se::AesBlockSize) constexpr inline const u8 DeviceMasterKekSourcesDev[pkg1::OldDeviceMasterKeyCount][se::AesBlockSize] = {
|
alignas(se::AesBlockSize) constexpr inline const u8 DeviceMasterKekSourcesDev[pkg1::OldDeviceMasterKeyCount][se::AesBlockSize] = {
|
||||||
@@ -119,10 +111,6 @@ namespace ams::nxboot {
|
|||||||
{ 0x4E, 0xCE, 0x7B, 0x2A, 0xEA, 0x2E, 0x3D, 0x16, 0xD5, 0x2A, 0xDE, 0xF6, 0xF8, 0x6A, 0x7D, 0x43 }, /* 17.0.0 Device Master Kek Source. */
|
{ 0x4E, 0xCE, 0x7B, 0x2A, 0xEA, 0x2E, 0x3D, 0x16, 0xD5, 0x2A, 0xDE, 0xF6, 0xF8, 0x6A, 0x7D, 0x43 }, /* 17.0.0 Device Master Kek Source. */
|
||||||
{ 0x3B, 0x00, 0x89, 0xD7, 0xA9, 0x9E, 0xB7, 0x70, 0x86, 0x00, 0xC3, 0x49, 0x52, 0x8C, 0xA4, 0xAF }, /* 18.0.0 Device Master Kek Source. */
|
{ 0x3B, 0x00, 0x89, 0xD7, 0xA9, 0x9E, 0xB7, 0x70, 0x86, 0x00, 0xC3, 0x49, 0x52, 0x8C, 0xA4, 0xAF }, /* 18.0.0 Device Master Kek Source. */
|
||||||
{ 0xAE, 0x78, 0x36, 0xB6, 0x91, 0xEB, 0xAF, 0x9C, 0x18, 0xF1, 0xC0, 0xD5, 0x8A, 0x0C, 0x7C, 0xA1 }, /* 19.0.0 Device Master Kek Source. */
|
{ 0xAE, 0x78, 0x36, 0xB6, 0x91, 0xEB, 0xAF, 0x9C, 0x18, 0xF1, 0xC0, 0xD5, 0x8A, 0x0C, 0x7C, 0xA1 }, /* 19.0.0 Device Master Kek Source. */
|
||||||
{ 0x09, 0x12, 0x4F, 0x26, 0x90, 0xB9, 0xA6, 0xF5, 0xA5, 0x18, 0x74, 0xB6, 0x8D, 0x80, 0x59, 0x3D }, /* 20.0.0 Device Master Kek Source. */
|
|
||||||
{ 0x7A, 0x4C, 0x38, 0xB7, 0x03, 0x6B, 0x1E, 0x81, 0x20, 0x53, 0x14, 0x99, 0xA4, 0x21, 0x92, 0x9F }, /* 21.0.0 Device Master Kek Source. */
|
|
||||||
{ 0xF3, 0xBC, 0xB5, 0xB5, 0x5F, 0x01, 0x50, 0x2B, 0x69, 0x69, 0x3A, 0x6B, 0xF9, 0x2C, 0x11, 0x9F }, /* 22.0.0 Device Master Kek Source. */
|
|
||||||
{ 0x54, 0xAD, 0x79, 0x15, 0x11, 0x7C, 0x1E, 0x52, 0xBF, 0x2E, 0x40, 0xBB, 0x8B, 0x11, 0x54, 0x38 }, /* 23.0.0 Device Master Kek Source. */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
alignas(se::AesBlockSize) constexpr inline const u8 MasterKeySources[pkg1::KeyGeneration_Count][se::AesBlockSize] = {
|
alignas(se::AesBlockSize) constexpr inline const u8 MasterKeySources[pkg1::KeyGeneration_Count][se::AesBlockSize] = {
|
||||||
@@ -145,10 +133,6 @@ namespace ams::nxboot {
|
|||||||
{ 0x25, 0x12, 0x8B, 0xCB, 0xB5, 0x46, 0xA1, 0xF8, 0xE0, 0x52, 0x15, 0xB7, 0x0B, 0x57, 0x00, 0xBD }, /* Master key 0F encrypted with Master key 10. */
|
{ 0x25, 0x12, 0x8B, 0xCB, 0xB5, 0x46, 0xA1, 0xF8, 0xE0, 0x52, 0x15, 0xB7, 0x0B, 0x57, 0x00, 0xBD }, /* Master key 0F encrypted with Master key 10. */
|
||||||
{ 0x58, 0x15, 0xD2, 0xF6, 0x8A, 0xE8, 0x19, 0xAB, 0xFB, 0x2D, 0x52, 0x9D, 0xE7, 0x55, 0xF3, 0x93 }, /* Master key 10 encrypted with Master key 11. */
|
{ 0x58, 0x15, 0xD2, 0xF6, 0x8A, 0xE8, 0x19, 0xAB, 0xFB, 0x2D, 0x52, 0x9D, 0xE7, 0x55, 0xF3, 0x93 }, /* Master key 10 encrypted with Master key 11. */
|
||||||
{ 0x4A, 0x01, 0x3B, 0xC7, 0x44, 0x6E, 0x45, 0xBD, 0xE6, 0x5E, 0x2B, 0xEC, 0x07, 0x37, 0x52, 0x86 }, /* Master key 11 encrypted with Master key 12. */
|
{ 0x4A, 0x01, 0x3B, 0xC7, 0x44, 0x6E, 0x45, 0xBD, 0xE6, 0x5E, 0x2B, 0xEC, 0x07, 0x37, 0x52, 0x86 }, /* Master key 11 encrypted with Master key 12. */
|
||||||
{ 0x97, 0xE4, 0x11, 0xAB, 0x22, 0x72, 0x1A, 0x1F, 0x70, 0x5C, 0x00, 0xB3, 0x96, 0x30, 0x05, 0x28 }, /* Master key 12 encrypted with Master key 13. */
|
|
||||||
{ 0xF7, 0x92, 0xC0, 0xEC, 0xF3, 0xA4, 0x8C, 0xB7, 0x0D, 0xB3, 0xF3, 0xAB, 0x10, 0x9B, 0x18, 0xBA }, /* Master key 13 encrypted with Master key 14. */
|
|
||||||
{ 0x14, 0xCB, 0x60, 0x29, 0x3D, 0xE0, 0xFB, 0xF2, 0x5B, 0x60, 0xB6, 0xC5, 0x2E, 0x77, 0x8F, 0x98 }, /* Master key 14 encrypted with Master key 15. */
|
|
||||||
{ 0x26, 0x87, 0xDF, 0x21, 0x44, 0xD4, 0x5F, 0x4E, 0x61, 0x03, 0x9E, 0xF3, 0x40, 0x04, 0xC3, 0x87 }, /* Master key 15 encrypted with Master key 16. */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
alignas(se::AesBlockSize) constexpr inline const u8 MasterKeySourcesDev[pkg1::KeyGeneration_Count][se::AesBlockSize] = {
|
alignas(se::AesBlockSize) constexpr inline const u8 MasterKeySourcesDev[pkg1::KeyGeneration_Count][se::AesBlockSize] = {
|
||||||
@@ -171,10 +155,6 @@ namespace ams::nxboot {
|
|||||||
{ 0x39, 0x1E, 0x7E, 0xF8, 0x7E, 0x73, 0xEA, 0x6F, 0xAF, 0x00, 0x3A, 0xB4, 0xAA, 0xB8, 0xB7, 0x59 }, /* Master key 0F encrypted with Master key 10. */
|
{ 0x39, 0x1E, 0x7E, 0xF8, 0x7E, 0x73, 0xEA, 0x6F, 0xAF, 0x00, 0x3A, 0xB4, 0xAA, 0xB8, 0xB7, 0x59 }, /* Master key 0F encrypted with Master key 10. */
|
||||||
{ 0x0C, 0x75, 0x39, 0x15, 0x53, 0xEA, 0x81, 0x11, 0xA3, 0xE0, 0xDC, 0x3D, 0x0E, 0x76, 0xC6, 0xB8 }, /* Master key 10 encrypted with Master key 11. */
|
{ 0x0C, 0x75, 0x39, 0x15, 0x53, 0xEA, 0x81, 0x11, 0xA3, 0xE0, 0xDC, 0x3D, 0x0E, 0x76, 0xC6, 0xB8 }, /* Master key 10 encrypted with Master key 11. */
|
||||||
{ 0x90, 0x64, 0xF9, 0x08, 0x29, 0x88, 0xD4, 0xDC, 0x73, 0xA4, 0xA1, 0x13, 0x9E, 0x59, 0x85, 0xA0 }, /* Master key 11 encrypted with Master key 12. */
|
{ 0x90, 0x64, 0xF9, 0x08, 0x29, 0x88, 0xD4, 0xDC, 0x73, 0xA4, 0xA1, 0x13, 0x9E, 0x59, 0x85, 0xA0 }, /* Master key 11 encrypted with Master key 12. */
|
||||||
{ 0x94, 0x46, 0x3B, 0xFA, 0x7D, 0xB9, 0xE2, 0x94, 0xC2, 0x9D, 0xB9, 0xA4, 0xB2, 0x56, 0xCA, 0xFE }, /* Master key 12 encrypted with Master key 13. */
|
|
||||||
{ 0x74, 0xB2, 0x5F, 0xA0, 0x4B, 0x74, 0x6D, 0x47, 0x5B, 0xA9, 0xF5, 0x26, 0x46, 0xD7, 0x4B, 0x6E }, /* Master key 13 encrypted with Master key 14. */
|
|
||||||
{ 0x97, 0xB3, 0x61, 0x88, 0x5C, 0x0D, 0xA1, 0x38, 0x73, 0xA4, 0x2F, 0x1A, 0x46, 0xA1, 0x09, 0xBF }, /* Master key 14 encrypted with Master key 15. */
|
|
||||||
{ 0xA6, 0x25, 0x12, 0x6D, 0xA1, 0x12, 0x1F, 0x15, 0x08, 0x2F, 0x30, 0x5F, 0xCB, 0x7D, 0x32, 0x82 }, /* Master key 15 encrypted with Master key 16. */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
alignas(se::AesBlockSize) constinit u8 MasterKeys[pkg1::OldMasterKeyCount][se::AesBlockSize] = {};
|
alignas(se::AesBlockSize) constinit u8 MasterKeys[pkg1::OldMasterKeyCount][se::AesBlockSize] = {};
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ namespace ams::nxboot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 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 == 23);
|
static_assert(pkg1::KeyGeneration_Count == 19);
|
||||||
if (key_generation >= pkg1::KeyGeneration_Count) {
|
if (key_generation >= pkg1::KeyGeneration_Count) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -263,14 +263,6 @@ namespace ams::nxboot {
|
|||||||
return ams::TargetFirmware_18_0_0;
|
return ams::TargetFirmware_18_0_0;
|
||||||
} else if (std::memcmp(package1 + 0x10, "20240808", 8) == 0) {
|
} else if (std::memcmp(package1 + 0x10, "20240808", 8) == 0) {
|
||||||
return ams::TargetFirmware_19_0_0;
|
return ams::TargetFirmware_19_0_0;
|
||||||
} else if (std::memcmp(package1 + 0x10, "20250206", 8) == 0) {
|
|
||||||
return ams::TargetFirmware_20_0_0;
|
|
||||||
} else if (std::memcmp(package1 + 0x10, "20251009", 8) == 0) {
|
|
||||||
return ams::TargetFirmware_21_0_0;
|
|
||||||
} else if (std::memcmp(package1 + 0x10, "20260123", 8) == 0) {
|
|
||||||
return ams::TargetFirmware_22_0_0;
|
|
||||||
} else if (std::memcmp(package1 + 0x10, "20260730", 8) == 0) {
|
|
||||||
return ams::TargetFirmware_23_0_0;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -415,9 +407,8 @@ namespace ams::nxboot {
|
|||||||
/* If we should, save the current warmboot firmware. */
|
/* If we should, save the current warmboot firmware. */
|
||||||
UpdateWarmbootPath(expected_fuses);
|
UpdateWarmbootPath(expected_fuses);
|
||||||
if (!IsFileExist(warmboot_path)) {
|
if (!IsFileExist(warmboot_path)) {
|
||||||
/* Try to create the directory/file, allowing them to fail (if already exist). */
|
fs::CreateDirectory("sdmc:/warmboot_mariko");
|
||||||
static_cast<void>(fs::CreateDirectory("sdmc:/warmboot_mariko"));
|
fs::CreateFile(warmboot_path, warmboot_src_size);
|
||||||
static_cast<void>(fs::CreateFile(warmboot_path, warmboot_src_size));
|
|
||||||
|
|
||||||
Result result;
|
Result result;
|
||||||
fs::FileHandle file;
|
fs::FileHandle file;
|
||||||
@@ -547,12 +538,6 @@ namespace ams::nxboot {
|
|||||||
} else {
|
} else {
|
||||||
storage_ctx.flags[0] &= ~secmon::SecureMonitorConfigurationFlag_EnableUserModePerformanceCounterAccess;
|
storage_ctx.flags[0] &= ~secmon::SecureMonitorConfigurationFlag_EnableUserModePerformanceCounterAccess;
|
||||||
}
|
}
|
||||||
} else if (std::strcmp(entry.key, "enable_mem_mode") == 0) {
|
|
||||||
if (entry.value[0] == '1') {
|
|
||||||
storage_ctx.flags[0] |= secmon::SecureMonitorConfigurationFlag_BootConfigMemoryModeEnabled;
|
|
||||||
} else {
|
|
||||||
storage_ctx.flags[0] &= ~secmon::SecureMonitorConfigurationFlag_BootConfigMemoryModeEnabled;
|
|
||||||
}
|
|
||||||
} else if (std::strcmp(entry.key, "blank_prodinfo_sysmmc") == 0) {
|
} else if (std::strcmp(entry.key, "blank_prodinfo_sysmmc") == 0) {
|
||||||
if (!emummc_enabled) {
|
if (!emummc_enabled) {
|
||||||
if (entry.value[0] == '1') {
|
if (entry.value[0] == '1') {
|
||||||
|
|||||||
@@ -180,27 +180,6 @@ namespace ams::nxboot {
|
|||||||
FsVersion_19_0_0,
|
FsVersion_19_0_0,
|
||||||
FsVersion_19_0_0_Exfat,
|
FsVersion_19_0_0_Exfat,
|
||||||
|
|
||||||
FsVersion_20_0_0,
|
|
||||||
FsVersion_20_0_0_Exfat,
|
|
||||||
|
|
||||||
FsVersion_20_1_0,
|
|
||||||
FsVersion_20_1_0_Exfat,
|
|
||||||
|
|
||||||
FsVersion_21_0_0,
|
|
||||||
FsVersion_21_0_0_Exfat,
|
|
||||||
|
|
||||||
FsVersion_21_2_0,
|
|
||||||
FsVersion_21_2_0_Exfat,
|
|
||||||
|
|
||||||
FsVersion_22_0_0,
|
|
||||||
FsVersion_22_0_0_Exfat,
|
|
||||||
|
|
||||||
FsVersion_22_5_0,
|
|
||||||
FsVersion_22_5_0_Exfat,
|
|
||||||
|
|
||||||
FsVersion_23_0_0,
|
|
||||||
FsVersion_23_0_0_Exfat,
|
|
||||||
|
|
||||||
FsVersion_Count,
|
FsVersion_Count,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -293,27 +272,6 @@ namespace ams::nxboot {
|
|||||||
|
|
||||||
{ 0xD9, 0x4C, 0x68, 0x15, 0xF8, 0xF5, 0x0A, 0x20 }, /* FsVersion_19_0_0 */
|
{ 0xD9, 0x4C, 0x68, 0x15, 0xF8, 0xF5, 0x0A, 0x20 }, /* FsVersion_19_0_0 */
|
||||||
{ 0xED, 0xA8, 0x78, 0x68, 0xA4, 0x49, 0x07, 0x50 }, /* FsVersion_19_0_0_Exfat */
|
{ 0xED, 0xA8, 0x78, 0x68, 0xA4, 0x49, 0x07, 0x50 }, /* FsVersion_19_0_0_Exfat */
|
||||||
|
|
||||||
{ 0x63, 0x54, 0x96, 0x9E, 0x60, 0xA7, 0x97, 0x7B }, /* FsVersion_20_0_0 */
|
|
||||||
{ 0x47, 0x41, 0x07, 0x10, 0x65, 0x4F, 0xA4, 0x3F }, /* FsVersion_20_0_0_Exfat */
|
|
||||||
|
|
||||||
{ 0xED, 0x34, 0xB4, 0x50, 0x58, 0x4A, 0x5B, 0x43 }, /* FsVersion_20_1_0 */
|
|
||||||
{ 0xA5, 0x1A, 0xA4, 0x92, 0x6C, 0x41, 0x87, 0x59 }, /* FsVersion_20_1_0_Exfat */
|
|
||||||
|
|
||||||
{ 0xEE, 0x4B, 0x30, 0x12, 0xA6, 0x84, 0x02, 0x25 }, /* FsVersion_21_0_0 */
|
|
||||||
{ 0x6E, 0x2B, 0xD9, 0xBA, 0xA3, 0xB9, 0x10, 0xF1 }, /* FsVersion_21_0_0_Exfat */
|
|
||||||
|
|
||||||
{ 0xAF, 0x1D, 0xBD, 0xC7, 0x82, 0x98, 0x3C, 0xBD }, /* FsVersion_21_2_0 */
|
|
||||||
{ 0x56, 0x25, 0x17, 0xA1, 0x92, 0xC3, 0xC8, 0xF0 }, /* FsVersion_21_2_0_Exfat */
|
|
||||||
|
|
||||||
{ 0xB7, 0xA2, 0x97, 0x39, 0xB7, 0xED, 0xDE, 0xFC }, /* FsVersion_22_0_0 */
|
|
||||||
{ 0xFB, 0x0B, 0x68, 0xDB, 0x24, 0x03, 0xD1, 0x19 }, /* FsVersion_22_0_0_Exfat */
|
|
||||||
|
|
||||||
{ 0x53, 0x6D, 0x93, 0x84, 0x69, 0xFE, 0x73, 0xBE }, /* FsVersion_22_5_0 */
|
|
||||||
{ 0xD4, 0x45, 0x28, 0x29, 0x5B, 0x41, 0x92, 0xBA }, /* FsVersion_22_5_0_Exfat */
|
|
||||||
|
|
||||||
{ 0x34, 0x38, 0x3E, 0xE7, 0x99, 0x92, 0x63, 0x40 }, /* FsVersion_23_0_0 */
|
|
||||||
{ 0xFD, 0xAF, 0x16, 0x32, 0x88, 0xE1, 0x08, 0x05 }, /* FsVersion_23_0_0_Exfat */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const InitialProcessBinaryHeader *FindInitialProcessBinary(const pkg2::Package2Header *header, const u8 *data, ams::TargetFirmware target_firmware) {
|
const InitialProcessBinaryHeader *FindInitialProcessBinary(const pkg2::Package2Header *header, const u8 *data, ams::TargetFirmware target_firmware) {
|
||||||
@@ -703,52 +661,6 @@ namespace ams::nxboot {
|
|||||||
AddPatch(fs_meta, 0x1A16A5, NogcPatch0, sizeof(NogcPatch0));
|
AddPatch(fs_meta, 0x1A16A5, NogcPatch0, sizeof(NogcPatch0));
|
||||||
AddPatch(fs_meta, 0x17A9A0, NogcPatch1, sizeof(NogcPatch1));
|
AddPatch(fs_meta, 0x17A9A0, NogcPatch1, sizeof(NogcPatch1));
|
||||||
break;
|
break;
|
||||||
case FsVersion_20_0_0:
|
|
||||||
case FsVersion_20_1_0:
|
|
||||||
AddPatch(fs_meta, 0x1A7E25, NogcPatch0, sizeof(NogcPatch0));
|
|
||||||
AddPatch(fs_meta, 0x1A8025, NogcPatch0, sizeof(NogcPatch0));
|
|
||||||
AddPatch(fs_meta, 0x17C250, NogcPatch1, sizeof(NogcPatch1));
|
|
||||||
break;
|
|
||||||
case FsVersion_20_0_0_Exfat:
|
|
||||||
case FsVersion_20_1_0_Exfat:
|
|
||||||
AddPatch(fs_meta, 0x1B3745, NogcPatch0, sizeof(NogcPatch0));
|
|
||||||
AddPatch(fs_meta, 0x1B3945, NogcPatch0, sizeof(NogcPatch0));
|
|
||||||
AddPatch(fs_meta, 0x187B70, NogcPatch1, sizeof(NogcPatch1));
|
|
||||||
break;
|
|
||||||
case FsVersion_21_0_0:
|
|
||||||
case FsVersion_21_2_0:
|
|
||||||
AddPatch(fs_meta, 0x1AC9ED, NogcPatch0, sizeof(NogcPatch0));
|
|
||||||
AddPatch(fs_meta, 0x1ACA05, NogcPatch0, sizeof(NogcPatch0));
|
|
||||||
AddPatch(fs_meta, 0x17FBE0, NogcPatch1, sizeof(NogcPatch1));
|
|
||||||
break;
|
|
||||||
case FsVersion_21_0_0_Exfat:
|
|
||||||
case FsVersion_21_2_0_Exfat:
|
|
||||||
AddPatch(fs_meta, 0x1B7B4D, NogcPatch0, sizeof(NogcPatch0));
|
|
||||||
AddPatch(fs_meta, 0x1B7B65, NogcPatch0, sizeof(NogcPatch0));
|
|
||||||
AddPatch(fs_meta, 0x18AD40, NogcPatch1, sizeof(NogcPatch1));
|
|
||||||
break;
|
|
||||||
case FsVersion_22_0_0:
|
|
||||||
case FsVersion_22_5_0:
|
|
||||||
AddPatch(fs_meta, 0x1B023D, NogcPatch0, sizeof(NogcPatch0));
|
|
||||||
AddPatch(fs_meta, 0x1B0255, NogcPatch0, sizeof(NogcPatch0));
|
|
||||||
AddPatch(fs_meta, 0x183060, NogcPatch1, sizeof(NogcPatch1));
|
|
||||||
break;
|
|
||||||
case FsVersion_22_0_0_Exfat:
|
|
||||||
case FsVersion_22_5_0_Exfat:
|
|
||||||
AddPatch(fs_meta, 0x1BB42D, NogcPatch0, sizeof(NogcPatch0));
|
|
||||||
AddPatch(fs_meta, 0x1BB445, NogcPatch0, sizeof(NogcPatch0));
|
|
||||||
AddPatch(fs_meta, 0x18E250, NogcPatch1, sizeof(NogcPatch1));
|
|
||||||
break;
|
|
||||||
case FsVersion_23_0_0:
|
|
||||||
AddPatch(fs_meta, 0x1B36BD, NogcPatch0, sizeof(NogcPatch0));
|
|
||||||
AddPatch(fs_meta, 0x1B36D5, NogcPatch0, sizeof(NogcPatch0));
|
|
||||||
AddPatch(fs_meta, 0x186340, NogcPatch1, sizeof(NogcPatch1));
|
|
||||||
break;
|
|
||||||
case FsVersion_23_0_0_Exfat:
|
|
||||||
AddPatch(fs_meta, 0x1BE8BD, NogcPatch0, sizeof(NogcPatch0));
|
|
||||||
AddPatch(fs_meta, 0x1BE8D5, NogcPatch0, sizeof(NogcPatch0));
|
|
||||||
AddPatch(fs_meta, 0x191540, NogcPatch1, sizeof(NogcPatch1));
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1356,9 +1356,6 @@ namespace ams::nxboot {
|
|||||||
emc_zcal_wait_cnt_old &= ~0x7ff;
|
emc_zcal_wait_cnt_old &= ~0x7ff;
|
||||||
emc_zcal_wait_cnt_new &= ~0x7ff;
|
emc_zcal_wait_cnt_new &= ~0x7ff;
|
||||||
|
|
||||||
/* TODO: Unused variable. */
|
|
||||||
AMS_UNUSED(emc_zcal_wait_cnt_old);
|
|
||||||
|
|
||||||
if (dram_type == DRAM_TYPE_LPDDR4) {
|
if (dram_type == DRAM_TYPE_LPDDR4) {
|
||||||
zq_wait_long = std::max<u32>(1, util::DivideUp(1000000, destination_clock_period));
|
zq_wait_long = std::max<u32>(1, util::DivideUp(1000000, destination_clock_period));
|
||||||
} else if (dram_type == DRAM_TYPE_LPDDR2 || is_lpddr3) {
|
} else if (dram_type == DRAM_TYPE_LPDDR2 || is_lpddr3) {
|
||||||
|
|||||||
BIN
img/np++.png
BIN
img/np++.png
Binary file not shown.
|
Before Width: | Height: | Size: 2.2 KiB |
@@ -6,7 +6,7 @@
|
|||||||
[subrepo]
|
[subrepo]
|
||||||
remote = https://github.com/Atmosphere-NX/Atmosphere-libs
|
remote = https://github.com/Atmosphere-NX/Atmosphere-libs
|
||||||
branch = master
|
branch = master
|
||||||
commit = aae2da0155a490abd3bfd17a70ccd16bb73c916a
|
commit = 989fb7be0c68bf229fe6789428b6c448b6de142a
|
||||||
parent = c68e08a101353a89777eb118d6bd21d1dba98ce5
|
parent = be19749841e581de4cc5d38f39f4de5fa4046c52
|
||||||
method = merge
|
method = merge
|
||||||
cmdver = 0.4.9
|
cmdver = 0.4.1
|
||||||
|
|||||||
@@ -297,23 +297,6 @@ FIND_SOURCE_FILES=$(foreach dir,$1,$(filter-out $(notdir $(wildcard $(dir)/*.arc
|
|||||||
|
|
||||||
ATMOSPHERE_GCH_IDENTIFIER := $(ATMOSPHERE_FULL_NAME)
|
ATMOSPHERE_GCH_IDENTIFIER := $(ATMOSPHERE_FULL_NAME)
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# Python. The scripts should work with Python 2 or 3, but 2 is preferred.
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
PYTHON = $(shell command -v python >/dev/null && echo python || echo python3)
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# Export MAKE:
|
|
||||||
# GCC's LTO driver invokes Make internally. This invocation respects both $(MAKE)
|
|
||||||
# and $(MAKEFLAGS), but only if they're in the environment. By default, MAKEFLAGS
|
|
||||||
# is in the environment while MAKE isn't, so GCC will always use the default
|
|
||||||
# `make` command, yet it inherits MAKEFLAGS from the copy of Make the user
|
|
||||||
# invoked, which might have incompatible flags. In practice this is an issue on
|
|
||||||
# macOS when running e.g. `gmake -j32 -Otarget`. This behavior is arguably a bug
|
|
||||||
# in GCC and/or Make, but we can work around it by exporting MAKE.
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
export MAKE
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# Rules for compiling pre-compiled headers
|
# Rules for compiling pre-compiled headers
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ ATMOSPHERE_OPTIMIZATION_FLAG := -O2
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
export DEFINES = $(ATMOSPHERE_DEFINES) -DATMOSPHERE_IS_STRATOSPHERE -D_GNU_SOURCE
|
export DEFINES = $(ATMOSPHERE_DEFINES) -DATMOSPHERE_IS_STRATOSPHERE -D_GNU_SOURCE
|
||||||
export SETTINGS = $(ATMOSPHERE_SETTINGS) $(ATMOSPHERE_OPTIMIZATION_FLAG) -Wextra -Werror -Wno-missing-field-initializers -Wno-error=unused-result
|
export SETTINGS = $(ATMOSPHERE_SETTINGS) $(ATMOSPHERE_OPTIMIZATION_FLAG) -Wextra -Werror -Wno-missing-field-initializers
|
||||||
export CFLAGS = $(ATMOSPHERE_CFLAGS) $(SETTINGS) $(DEFINES) $(INCLUDE)
|
export CFLAGS = $(ATMOSPHERE_CFLAGS) $(SETTINGS) $(DEFINES) $(INCLUDE)
|
||||||
export CXXFLAGS = $(CFLAGS) $(ATMOSPHERE_CXXFLAGS)
|
export CXXFLAGS = $(CFLAGS) $(ATMOSPHERE_CXXFLAGS)
|
||||||
export ASFLAGS = $(ATMOSPHERE_ASFLAGS) $(SETTINGS) $(DEFINES)
|
export ASFLAGS = $(ATMOSPHERE_ASFLAGS) $(SETTINGS) $(DEFINES)
|
||||||
|
|||||||
@@ -61,15 +61,14 @@ namespace ams::pkg1 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct BootConfigData {
|
struct BootConfigData {
|
||||||
u64 version;
|
u32 version;
|
||||||
|
u32 reserved_04;
|
||||||
u32 reserved_08;
|
u32 reserved_08;
|
||||||
u32 reserved_0C;
|
u32 reserved_0C;
|
||||||
u8 flags1[0x10];
|
u8 flags1[0x10];
|
||||||
u8 flags0[0x10];
|
u8 flags0[0x10];
|
||||||
u64 initial_tsc_value;
|
u64 initial_tsc_value;
|
||||||
u8 padding_38[0x38];
|
u8 padding_38[0x200 - 0x38];
|
||||||
u64 unknown_70;
|
|
||||||
u8 padding_78[0x200 - 0x78];
|
|
||||||
|
|
||||||
constexpr bool IsDevelopmentFunctionEnabled() const {
|
constexpr bool IsDevelopmentFunctionEnabled() const {
|
||||||
return (this->flags1[0] & (1 << 1)) != 0;
|
return (this->flags1[0] & (1 << 1)) != 0;
|
||||||
@@ -98,16 +97,13 @@ namespace ams::pkg1 {
|
|||||||
constexpr u64 GetInitialTscValue() const {
|
constexpr u64 GetInitialTscValue() const {
|
||||||
return this->IsInitialTscValueValid() ? this->initial_tsc_value : 0;
|
return this->IsInitialTscValueValid() ? this->initial_tsc_value : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr u64 GetUnknown70() const {
|
|
||||||
return this->unknown_70;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
static_assert(util::is_pod<BootConfigData>::value);
|
static_assert(util::is_pod<BootConfigData>::value);
|
||||||
static_assert(sizeof(BootConfigData) == 0x200);
|
static_assert(sizeof(BootConfigData) == 0x200);
|
||||||
|
|
||||||
struct BootConfigSignedData {
|
struct BootConfigSignedData {
|
||||||
u64 version;
|
u32 version;
|
||||||
|
u32 reserved_04;
|
||||||
u8 flags;
|
u8 flags;
|
||||||
u8 reserved_09[0x10 - 9];
|
u8 reserved_09[0x10 - 9];
|
||||||
u8 ecid[0x10];
|
u8 ecid[0x10];
|
||||||
|
|||||||
@@ -39,10 +39,6 @@ namespace ams::pkg1 {
|
|||||||
KeyGeneration_17_0_0 = 0x10,
|
KeyGeneration_17_0_0 = 0x10,
|
||||||
KeyGeneration_18_0_0 = 0x11,
|
KeyGeneration_18_0_0 = 0x11,
|
||||||
KeyGeneration_19_0_0 = 0x12,
|
KeyGeneration_19_0_0 = 0x12,
|
||||||
KeyGeneration_20_0_0 = 0x13,
|
|
||||||
KeyGeneration_21_0_0 = 0x14,
|
|
||||||
KeyGeneration_22_0_0 = 0x15,
|
|
||||||
KeyGeneration_23_0_0 = 0x16,
|
|
||||||
|
|
||||||
KeyGeneration_Count,
|
KeyGeneration_Count,
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace ams::pkg2 {
|
|||||||
constexpr inline int PayloadCount = 3;
|
constexpr inline int PayloadCount = 3;
|
||||||
|
|
||||||
constexpr inline int MinimumValidDataVersion = 0; /* We allow older package2 to load; this value is currently 0x18 in Nintendo's code. */
|
constexpr inline int MinimumValidDataVersion = 0; /* We allow older package2 to load; this value is currently 0x18 in Nintendo's code. */
|
||||||
constexpr inline int CurrentBootloaderVersion = 0x18;
|
constexpr inline int CurrentBootloaderVersion = 0x16;
|
||||||
|
|
||||||
struct Package2Meta {
|
struct Package2Meta {
|
||||||
using Magic = util::FourCC<'P','K','2','1'>;
|
using Magic = util::FourCC<'P','K','2','1'>;
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ namespace ams::secmon {
|
|||||||
SecureMonitorConfigurationFlag_ShouldUseBlankCalibrationBinary = (1u << 5),
|
SecureMonitorConfigurationFlag_ShouldUseBlankCalibrationBinary = (1u << 5),
|
||||||
SecureMonitorConfigurationFlag_AllowWritingToCalibrationBinarySysmmc = (1u << 6),
|
SecureMonitorConfigurationFlag_AllowWritingToCalibrationBinarySysmmc = (1u << 6),
|
||||||
SecureMonitorConfigurationFlag_ForceEnableUsb30 = (1u << 7),
|
SecureMonitorConfigurationFlag_ForceEnableUsb30 = (1u << 7),
|
||||||
SecureMonitorConfigurationFlag_BootConfigMemoryModeEnabled = (1u << 8),
|
|
||||||
|
|
||||||
SecureMonitorConfigurationFlag_Default = SecureMonitorConfigurationFlag_IsDevelopmentFunctionEnabledForKernel,
|
SecureMonitorConfigurationFlag_Default = SecureMonitorConfigurationFlag_IsDevelopmentFunctionEnabledForKernel,
|
||||||
};
|
};
|
||||||
@@ -104,7 +103,6 @@ namespace ams::secmon {
|
|||||||
constexpr bool ShouldUseBlankCalibrationBinary() const { return (this->flags[0] & SecureMonitorConfigurationFlag_ShouldUseBlankCalibrationBinary) != 0; }
|
constexpr bool ShouldUseBlankCalibrationBinary() const { return (this->flags[0] & SecureMonitorConfigurationFlag_ShouldUseBlankCalibrationBinary) != 0; }
|
||||||
constexpr bool AllowWritingToCalibrationBinarySysmmc() const { return (this->flags[0] & SecureMonitorConfigurationFlag_AllowWritingToCalibrationBinarySysmmc) != 0; }
|
constexpr bool AllowWritingToCalibrationBinarySysmmc() const { return (this->flags[0] & SecureMonitorConfigurationFlag_AllowWritingToCalibrationBinarySysmmc) != 0; }
|
||||||
constexpr bool IsUsb30ForceEnabled() const { return (this->flags[0] & SecureMonitorConfigurationFlag_ForceEnableUsb30) != 0; }
|
constexpr bool IsUsb30ForceEnabled() const { return (this->flags[0] & SecureMonitorConfigurationFlag_ForceEnableUsb30) != 0; }
|
||||||
constexpr bool IsBootConfigMemoryModeEnabled() const { return (this->flags[0] & SecureMonitorConfigurationFlag_BootConfigMemoryModeEnabled) != 0; }
|
|
||||||
|
|
||||||
constexpr bool IsDevelopmentFunctionEnabled(bool for_kern) const { return for_kern ? this->IsDevelopmentFunctionEnabledForKernel() : this->IsDevelopmentFunctionEnabledForUser(); }
|
constexpr bool IsDevelopmentFunctionEnabled(bool for_kern) const { return for_kern ? this->IsDevelopmentFunctionEnabledForKernel() : this->IsDevelopmentFunctionEnabledForUser(); }
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ clean:
|
|||||||
@echo clean $(ATMOSPHERE_BUILD_NAME) ...
|
@echo clean $(ATMOSPHERE_BUILD_NAME) ...
|
||||||
@rm -fr $(ATMOSPHERE_BUILD_DIR) $(ATMOSPHERE_OUT_DIR)
|
@rm -fr $(ATMOSPHERE_BUILD_DIR) $(ATMOSPHERE_OUT_DIR)
|
||||||
@rm -fr $(foreach hdr,$(GCH_DIRS),$(hdr)/$(ATMOSPHERE_GCH_IDENTIFIER))
|
@rm -fr $(foreach hdr,$(GCH_DIRS),$(hdr)/$(ATMOSPHERE_GCH_IDENTIFIER))
|
||||||
@for i in $(GCH_DIRS); do [ -d $$i ] && rmdir $$i 2>/dev/null || true; done
|
@for i in $(GCH_DIRS); do [ -d $$i ] && rmdir --ignore-fail-on-non-empty $$i || true; done
|
||||||
|
|
||||||
$(ATMOSPHERE_LIBRARY_DIR) $(ATMOSPHERE_BUILD_DIR) $(GCH_DIRS):
|
$(ATMOSPHERE_LIBRARY_DIR) $(ATMOSPHERE_BUILD_DIR) $(GCH_DIRS):
|
||||||
@[ -d $@ ] || mkdir -p $@
|
@[ -d $@ ] || mkdir -p $@
|
||||||
|
|||||||
@@ -177,10 +177,6 @@ namespace ams::fuse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
constexpr const TargetFirmware FuseVersionIncrementFirmwares[] = {
|
constexpr const TargetFirmware FuseVersionIncrementFirmwares[] = {
|
||||||
TargetFirmware_23_0_0,
|
|
||||||
TargetFirmware_22_0_0,
|
|
||||||
TargetFirmware_21_0_0,
|
|
||||||
TargetFirmware_20_0_0,
|
|
||||||
TargetFirmware_19_0_0,
|
TargetFirmware_19_0_0,
|
||||||
TargetFirmware_17_0_0,
|
TargetFirmware_17_0_0,
|
||||||
TargetFirmware_16_0_0,
|
TargetFirmware_16_0_0,
|
||||||
|
|||||||
@@ -105,9 +105,6 @@ namespace ams::se {
|
|||||||
value |= ((flags & KeySlotLockFlags_KeyRead) == 0) ? (1u << 1) : 0;
|
value |= ((flags & KeySlotLockFlags_KeyRead) == 0) ? (1u << 1) : 0;
|
||||||
value |= ((flags & KeySlotLockFlags_KeyRead) == 0) ? (1u << 2) : 0;
|
value |= ((flags & KeySlotLockFlags_KeyRead) == 0) ? (1u << 2) : 0;
|
||||||
|
|
||||||
/* TODO: Unused variable. */
|
|
||||||
AMS_UNUSED(value);
|
|
||||||
|
|
||||||
reg::Write(SE->SE_RSA_KEYTABLE_ACCESS[slot], SE_REG_BITS_ENUM_SEL(RSA_KEYTABLE_ACCESS_KEYREAD, (flags & KeySlotLockFlags_KeyRead) != 0, DISABLE, ENABLE),
|
reg::Write(SE->SE_RSA_KEYTABLE_ACCESS[slot], SE_REG_BITS_ENUM_SEL(RSA_KEYTABLE_ACCESS_KEYREAD, (flags & KeySlotLockFlags_KeyRead) != 0, DISABLE, ENABLE),
|
||||||
SE_REG_BITS_ENUM_SEL(RSA_KEYTABLE_ACCESS_KEYUPDATE, (flags & KeySlotLockFlags_KeyWrite) != 0, DISABLE, ENABLE),
|
SE_REG_BITS_ENUM_SEL(RSA_KEYTABLE_ACCESS_KEYUPDATE, (flags & KeySlotLockFlags_KeyWrite) != 0, DISABLE, ENABLE),
|
||||||
SE_REG_BITS_ENUM_SEL(RSA_KEYTABLE_ACCESS_KEYUSE, (flags & KeySlotLockFlags_KeyUse) != 0, DISABLE, ENABLE));
|
SE_REG_BITS_ENUM_SEL(RSA_KEYTABLE_ACCESS_KEYUSE, (flags & KeySlotLockFlags_KeyUse) != 0, DISABLE, ENABLE));
|
||||||
|
|||||||
@@ -116,9 +116,7 @@ namespace ams::kern::arch::arm {
|
|||||||
u32 ipriorityr[NumLocalInterrupts / 4];
|
u32 ipriorityr[NumLocalInterrupts / 4];
|
||||||
u32 itargetsr[NumLocalInterrupts / 4];
|
u32 itargetsr[NumLocalInterrupts / 4];
|
||||||
u32 icfgr[NumLocalInterrupts / 16];
|
u32 icfgr[NumLocalInterrupts / 16];
|
||||||
u32 spendsgir[4];
|
|
||||||
};
|
};
|
||||||
static_assert(sizeof(LocalState{}.spendsgir) == sizeof(GicDistributor{}.spendsgir));
|
|
||||||
|
|
||||||
struct GlobalState {
|
struct GlobalState {
|
||||||
u32 isenabler[NumGlobalInterrupts / 32];
|
u32 isenabler[NumGlobalInterrupts / 32];
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ namespace ams::kern::arch::arm64::cpu {
|
|||||||
MESOSPHERE_CPU_DEFINE_SYSREG_ACCESSORS(SpEl0, sp_el0)
|
MESOSPHERE_CPU_DEFINE_SYSREG_ACCESSORS(SpEl0, sp_el0)
|
||||||
|
|
||||||
MESOSPHERE_CPU_DEFINE_SYSREG_ACCESSORS(IdAa64Dfr0El1, id_aa64dfr0_el1)
|
MESOSPHERE_CPU_DEFINE_SYSREG_ACCESSORS(IdAa64Dfr0El1, id_aa64dfr0_el1)
|
||||||
MESOSPHERE_CPU_DEFINE_SYSREG_ACCESSORS(IdAa64Mmfr0El1, id_aa64mmfr0_el1)
|
|
||||||
|
|
||||||
MESOSPHERE_CPU_DEFINE_SYSREG_ACCESSORS(PmcrEl0, pmcr_el0)
|
MESOSPHERE_CPU_DEFINE_SYSREG_ACCESSORS(PmcrEl0, pmcr_el0)
|
||||||
MESOSPHERE_CPU_DEFINE_SYSREG_ACCESSORS(PmUserEnrEl0, pmuserenr_el0)
|
MESOSPHERE_CPU_DEFINE_SYSREG_ACCESSORS(PmUserEnrEl0, pmuserenr_el0)
|
||||||
|
|||||||
@@ -83,9 +83,9 @@ namespace ams::kern::arch::arm64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
NOINLINE Result BindHandler(KInterruptHandler *handler, s32 irq, s32 core_id, s32 priority, bool manual_clear, bool level);
|
NOINLINE Result BindHandler(KInterruptHandler *handler, s32 irq, s32 core_id, s32 priority, bool manual_clear, bool level);
|
||||||
NOINLINE void UnbindHandler(s32 irq, s32 core);
|
NOINLINE Result UnbindHandler(s32 irq, s32 core);
|
||||||
|
|
||||||
NOINLINE void ClearInterrupt(s32 irq, s32 core_id);
|
NOINLINE Result ClearInterrupt(s32 irq, s32 core_id);
|
||||||
|
|
||||||
ALWAYS_INLINE void SendInterProcessorInterrupt(s32 irq, u64 core_mask) {
|
ALWAYS_INLINE void SendInterProcessorInterrupt(s32 irq, u64 core_mask) {
|
||||||
m_interrupt_controller.SendInterProcessorInterrupt(irq, core_mask);
|
m_interrupt_controller.SendInterProcessorInterrupt(irq, core_mask);
|
||||||
@@ -99,10 +99,10 @@ namespace ams::kern::arch::arm64 {
|
|||||||
private:
|
private:
|
||||||
Result BindGlobal(KInterruptHandler *handler, s32 irq, s32 core_id, s32 priority, bool manual_clear, bool level);
|
Result BindGlobal(KInterruptHandler *handler, s32 irq, s32 core_id, s32 priority, bool manual_clear, bool level);
|
||||||
Result BindLocal(KInterruptHandler *handler, s32 irq, s32 priority, bool manual_clear);
|
Result BindLocal(KInterruptHandler *handler, s32 irq, s32 priority, bool manual_clear);
|
||||||
void UnbindGlobal(s32 irq);
|
Result UnbindGlobal(s32 irq);
|
||||||
void UnbindLocal(s32 irq);
|
Result UnbindLocal(s32 irq);
|
||||||
void ClearGlobal(s32 irq);
|
Result ClearGlobal(s32 irq);
|
||||||
void ClearLocal(s32 irq);
|
Result ClearLocal(s32 irq);
|
||||||
private:
|
private:
|
||||||
[[nodiscard]] static ALWAYS_INLINE u32 GetInterruptsEnabledState() {
|
[[nodiscard]] static ALWAYS_INLINE u32 GetInterruptsEnabledState() {
|
||||||
u64 intr_state;
|
u64 intr_state;
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
#include <mesosphere/kern_k_page_table_base.hpp>
|
#include <mesosphere/kern_k_page_table_base.hpp>
|
||||||
#include <mesosphere/kern_k_page_group.hpp>
|
#include <mesosphere/kern_k_page_group.hpp>
|
||||||
#include <mesosphere/kern_k_page_table_manager.hpp>
|
#include <mesosphere/kern_k_page_table_manager.hpp>
|
||||||
#include <mesosphere/init/kern_init_slab_setup.hpp>
|
|
||||||
|
|
||||||
namespace ams::kern::arch::arm64 {
|
namespace ams::kern::arch::arm64 {
|
||||||
|
|
||||||
@@ -95,10 +94,10 @@ namespace ams::kern::arch::arm64 {
|
|||||||
return KPageTable::GetBlockSize(static_cast<KPageTable::BlockType>(KPageTable::GetBlockType(alignment) + 1));
|
return KPageTable::GetBlockSize(static_cast<KPageTable::BlockType>(KPageTable::GetBlockType(alignment) + 1));
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
static constexpr size_t NumPTEntries = ::ams::kern::init::SlabCountKProcess + 1; /* +1 for kernel. */
|
/* TODO: How should this size be determined. Does the KProcess slab count need to go in a header as a define? */
|
||||||
|
static constexpr size_t NumTtbr0Entries = 81;
|
||||||
private:
|
private:
|
||||||
static constinit inline const volatile u64 s_ttbr0_entries[NumPTEntries] = {};
|
static constinit inline const volatile u64 s_ttbr0_entries[NumTtbr0Entries] = {};
|
||||||
static constinit inline const volatile u64 s_tcr_el1_entries[NumPTEntries] = {};
|
|
||||||
private:
|
private:
|
||||||
KPageTableManager *m_manager;
|
KPageTableManager *m_manager;
|
||||||
u8 m_asid;
|
u8 m_asid;
|
||||||
@@ -189,12 +188,6 @@ namespace ams::kern::arch::arm64 {
|
|||||||
return s_ttbr0_entries[0];
|
return s_ttbr0_entries[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
static const volatile u64 &GetTcrEL1Entry(size_t index) { return s_tcr_el1_entries[index]; }
|
|
||||||
|
|
||||||
static ALWAYS_INLINE u64 GetKernelTcrEL1() {
|
|
||||||
return s_tcr_el1_entries[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
static ALWAYS_INLINE void ActivateKernel() {
|
static ALWAYS_INLINE void ActivateKernel() {
|
||||||
/* Activate, using asid 0 and process id = 0xFFFFFFFF */
|
/* Activate, using asid 0 and process id = 0xFFFFFFFF */
|
||||||
cpu::SwitchProcess(GetKernelTtbr0(), 0xFFFFFFFF);
|
cpu::SwitchProcess(GetKernelTtbr0(), 0xFFFFFFFF);
|
||||||
@@ -204,14 +197,9 @@ namespace ams::kern::arch::arm64 {
|
|||||||
cpu::SwitchProcess(s_ttbr0_entries[proc_idx + 1], proc_id);
|
cpu::SwitchProcess(s_ttbr0_entries[proc_idx + 1], proc_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
NOINLINE void InitializeForKernel(void *table, KVirtualAddress start, KVirtualAddress end);
|
NOINLINE Result InitializeForKernel(void *table, KVirtualAddress start, KVirtualAddress end);
|
||||||
NOINLINE Result InitializeForProcess(ams::svc::CreateProcessParameterFlag flags, bool from_back, KMemoryManager::Pool pool, KProcessAddress code_address, size_t code_size, KSystemResource *system_resource, KResourceLimit *resource_limit, size_t process_index);
|
NOINLINE Result InitializeForProcess(ams::svc::CreateProcessFlag flags, bool from_back, KMemoryManager::Pool pool, KProcessAddress code_address, size_t code_size, KSystemResource *system_resource, KResourceLimit *resource_limit, size_t process_index);
|
||||||
void Finalize();
|
Result Finalize();
|
||||||
|
|
||||||
static void NoteUpdatedCallback(const void *pt) {
|
|
||||||
/* Note the update. */
|
|
||||||
static_cast<const KPageTable *>(pt)->NoteUpdated();
|
|
||||||
}
|
|
||||||
private:
|
private:
|
||||||
Result Unmap(KProcessAddress virt_addr, size_t num_pages, PageLinkedList *page_list, bool force, bool reuse_ll);
|
Result Unmap(KProcessAddress virt_addr, size_t num_pages, PageLinkedList *page_list, bool force, bool reuse_ll);
|
||||||
|
|
||||||
|
|||||||
@@ -49,8 +49,6 @@ namespace ams::kern::arch::arm64 {
|
|||||||
EntryLevel level;
|
EntryLevel level;
|
||||||
bool is_contiguous;
|
bool is_contiguous;
|
||||||
};
|
};
|
||||||
|
|
||||||
using EntryUpdatedCallback = void (*)(const void *);
|
|
||||||
private:
|
private:
|
||||||
static constexpr size_t PageBits = util::CountTrailingZeros(PageSize);
|
static constexpr size_t PageBits = util::CountTrailingZeros(PageSize);
|
||||||
static constexpr size_t NumLevels = 3;
|
static constexpr size_t NumLevels = 3;
|
||||||
@@ -146,8 +144,8 @@ namespace ams::kern::arch::arm64 {
|
|||||||
|
|
||||||
bool GetPhysicalAddress(KPhysicalAddress *out, KProcessAddress virt_addr) const;
|
bool GetPhysicalAddress(KPhysicalAddress *out, KProcessAddress virt_addr) const;
|
||||||
|
|
||||||
static bool MergePages(KVirtualAddress *out, TraversalContext *context, EntryUpdatedCallback on_entry_updated, const void *pt);
|
static bool MergePages(KVirtualAddress *out, TraversalContext *context);
|
||||||
void SeparatePages(TraversalEntry *entry, TraversalContext *context, KProcessAddress address, PageTableEntry *pte, EntryUpdatedCallback on_entry_updated, const void *pt) const;
|
void SeparatePages(TraversalEntry *entry, TraversalContext *context, KProcessAddress address, PageTableEntry *pte) const;
|
||||||
|
|
||||||
KProcessAddress GetAddressForContext(const TraversalContext *context) const {
|
KProcessAddress GetAddressForContext(const TraversalContext *context) const {
|
||||||
KProcessAddress addr = m_is_kernel ? static_cast<uintptr_t>(-GetBlockSize(EntryLevel_L1)) * m_num_entries : 0;
|
KProcessAddress addr = m_is_kernel ? static_cast<uintptr_t>(-GetBlockSize(EntryLevel_L1)) * m_num_entries : 0;
|
||||||
|
|||||||
@@ -28,15 +28,10 @@ namespace ams::kern::arch::arm64 {
|
|||||||
m_page_table.ActivateProcess(process_index, id);
|
m_page_table.ActivateProcess(process_index, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result Initialize(ams::svc::CreateProcessParameterFlag flags, bool from_back, KMemoryManager::Pool pool, KProcessAddress code_address, size_t code_size, KSystemResource *system_resource, KResourceLimit *resource_limit, size_t process_index) {
|
Result Initialize(ams::svc::CreateProcessFlag flags, bool from_back, KMemoryManager::Pool pool, KProcessAddress code_address, size_t code_size, KSystemResource *system_resource, KResourceLimit *resource_limit, size_t process_index) {
|
||||||
R_RETURN(m_page_table.InitializeForProcess(flags, from_back, pool, code_address, code_size, system_resource, resource_limit, process_index));
|
R_RETURN(m_page_table.InitializeForProcess(flags, from_back, pool, code_address, code_size, system_resource, resource_limit, process_index));
|
||||||
}
|
}
|
||||||
|
|
||||||
static ALWAYS_INLINE u64 GetProcessTcrEl1(size_t process_index) {
|
|
||||||
/* The kernel's root table is entry zero; processes are indexed from one. */
|
|
||||||
return KPageTable::GetTcrEL1Entry(process_index + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Finalize() { m_page_table.Finalize(); }
|
void Finalize() { m_page_table.Finalize(); }
|
||||||
|
|
||||||
ALWAYS_INLINE KScopedLightLock AcquireDeviceMapLock() {
|
ALWAYS_INLINE KScopedLightLock AcquireDeviceMapLock() {
|
||||||
@@ -307,25 +302,19 @@ namespace ams::kern::arch::arm64 {
|
|||||||
bool CanContain(KProcessAddress addr, size_t size, KMemoryState state) const { return m_page_table.CanContain(addr, size, state); }
|
bool CanContain(KProcessAddress addr, size_t size, KMemoryState state) const { return m_page_table.CanContain(addr, size, state); }
|
||||||
bool CanContain(KProcessAddress addr, size_t size, ams::svc::MemoryState state) const { return m_page_table.CanContain(addr, size, state); }
|
bool CanContain(KProcessAddress addr, size_t size, ams::svc::MemoryState state) const { return m_page_table.CanContain(addr, size, state); }
|
||||||
|
|
||||||
bool IsInShadowStackRegion(KProcessAddress addr, size_t size) const { return m_page_table.IsInShadowStackRegion(addr, size); }
|
KProcessAddress GetAddressSpaceStart() const { return m_page_table.GetAddressSpaceStart(); }
|
||||||
bool IsInShadowStackRegion(KProcessAddress addr) const { return m_page_table.IsInShadowStackRegion(addr); }
|
KProcessAddress GetHeapRegionStart() const { return m_page_table.GetHeapRegionStart(); }
|
||||||
bool IsSafeUserPointer(KProcessAddress addr, size_t size) const { return m_page_table.IsSafeUserPointer(addr, size); }
|
KProcessAddress GetAliasRegionStart() const { return m_page_table.GetAliasRegionStart(); }
|
||||||
|
KProcessAddress GetStackRegionStart() const { return m_page_table.GetStackRegionStart(); }
|
||||||
|
KProcessAddress GetKernelMapRegionStart() const { return m_page_table.GetKernelMapRegionStart(); }
|
||||||
|
KProcessAddress GetAliasCodeRegionStart() const { return m_page_table.GetAliasCodeRegionStart(); }
|
||||||
|
|
||||||
KProcessAddress GetAddressSpaceStart() const { return m_page_table.GetAddressSpaceStart(); }
|
size_t GetAddressSpaceSize() const { return m_page_table.GetAddressSpaceSize(); }
|
||||||
KProcessAddress GetShadowStackRegionStart() const { return m_page_table.GetShadowStackRegionStart(); }
|
size_t GetHeapRegionSize() const { return m_page_table.GetHeapRegionSize(); }
|
||||||
KProcessAddress GetHeapRegionStart() const { return m_page_table.GetHeapRegionStart(); }
|
size_t GetAliasRegionSize() const { return m_page_table.GetAliasRegionSize(); }
|
||||||
KProcessAddress GetAliasRegionStart() const { return m_page_table.GetAliasRegionStart(); }
|
size_t GetStackRegionSize() const { return m_page_table.GetStackRegionSize(); }
|
||||||
KProcessAddress GetStackRegionStart() const { return m_page_table.GetStackRegionStart(); }
|
size_t GetKernelMapRegionSize() const { return m_page_table.GetKernelMapRegionSize(); }
|
||||||
KProcessAddress GetKernelMapRegionStart() const { return m_page_table.GetKernelMapRegionStart(); }
|
size_t GetAliasCodeRegionSize() const { return m_page_table.GetAliasCodeRegionSize(); }
|
||||||
KProcessAddress GetAliasCodeRegionStart() const { return m_page_table.GetAliasCodeRegionStart(); }
|
|
||||||
|
|
||||||
size_t GetAddressSpaceSize() const { return m_page_table.GetAddressSpaceSize(); }
|
|
||||||
size_t GetShadowStackRegionSize() const { return m_page_table.GetShadowStackRegionSize(); }
|
|
||||||
size_t GetHeapRegionSize() const { return m_page_table.GetHeapRegionSize(); }
|
|
||||||
size_t GetAliasRegionSize() const { return m_page_table.GetAliasRegionSize(); }
|
|
||||||
size_t GetStackRegionSize() const { return m_page_table.GetStackRegionSize(); }
|
|
||||||
size_t GetKernelMapRegionSize() const { return m_page_table.GetKernelMapRegionSize(); }
|
|
||||||
size_t GetAliasCodeRegionSize() const { return m_page_table.GetAliasCodeRegionSize(); }
|
|
||||||
|
|
||||||
size_t GetAliasRegionExtraSize() const { return m_page_table.GetAliasRegionExtraSize(); }
|
size_t GetAliasRegionExtraSize() const { return m_page_table.GetAliasRegionExtraSize(); }
|
||||||
|
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ namespace ams::kern::arch::arm64 {
|
|||||||
constexpr explicit KThreadContext(util::ConstantInitializeTag) : m_callee_saved(), m_lr(), m_sp(), m_fpcr(), m_fpsr(), m_callee_saved_fpu(), m_locked() { /* ... */ }
|
constexpr explicit KThreadContext(util::ConstantInitializeTag) : m_callee_saved(), m_lr(), m_sp(), m_fpcr(), m_fpsr(), m_callee_saved_fpu(), m_locked() { /* ... */ }
|
||||||
explicit KThreadContext() { /* ... */ }
|
explicit KThreadContext() { /* ... */ }
|
||||||
|
|
||||||
void Initialize(KVirtualAddress u_pc, KVirtualAddress k_sp, KVirtualAddress u_sp, uintptr_t arg, bool is_user, bool is_64_bit, bool is_main);
|
Result Initialize(KVirtualAddress u_pc, KVirtualAddress k_sp, KVirtualAddress u_sp, uintptr_t arg, bool is_user, bool is_64_bit, bool is_main);
|
||||||
|
|
||||||
void SetArguments(uintptr_t arg0, uintptr_t arg1);
|
void SetArguments(uintptr_t arg0, uintptr_t arg1);
|
||||||
|
|
||||||
|
|||||||
@@ -22,139 +22,49 @@ namespace ams::kern::arch::arm64 {
|
|||||||
|
|
||||||
class UserspaceAccess {
|
class UserspaceAccess {
|
||||||
private:
|
private:
|
||||||
class Impl {
|
static bool CopyMemoryFromUserSize32BitWithSupervisorAccessImpl(void *dst, const void *src);
|
||||||
public:
|
|
||||||
static bool CopyMemoryFromUser(void *dst, const void *src, size_t size);
|
|
||||||
static bool CopyMemoryFromUserAligned32Bit(void *dst, const void *src, size_t size);
|
|
||||||
static bool CopyMemoryFromUserAligned64Bit(void *dst, const void *src, size_t size);
|
|
||||||
static bool CopyMemoryFromUserSize64Bit(void *dst, const void *src);
|
|
||||||
static bool CopyMemoryFromUserSize32Bit(void *dst, const void *src);
|
|
||||||
static bool CopyMemoryFromUserSize32BitWithSupervisorAccess(void *dst, const void *src);
|
|
||||||
static s32 CopyStringFromUser(void *dst, const void *src, size_t size);
|
|
||||||
|
|
||||||
static bool CopyMemoryToUser(void *dst, const void *src, size_t size);
|
|
||||||
static bool CopyMemoryToUserAligned32Bit(void *dst, const void *src, size_t size);
|
|
||||||
static bool CopyMemoryToUserAligned64Bit(void *dst, const void *src, size_t size);
|
|
||||||
static bool CopyMemoryToUserSize32Bit(void *dst, u32 value);
|
|
||||||
static s32 CopyStringToUser(void *dst, const void *src, size_t size);
|
|
||||||
|
|
||||||
static bool UpdateLockAtomic(u32 *out, u32 *address, u32 if_zero, u32 new_orr_mask);
|
|
||||||
static bool UpdateIfEqualAtomic(s32 *out, s32 *address, s32 compare_value, s32 new_value);
|
|
||||||
static bool DecrementIfLessThanAtomic(s32 *out, s32 *address, s32 compare);
|
|
||||||
|
|
||||||
static bool StoreDataCache(uintptr_t start, uintptr_t end);
|
|
||||||
static bool FlushDataCache(uintptr_t start, uintptr_t end);
|
|
||||||
static bool InvalidateDataCache(uintptr_t start, uintptr_t end);
|
|
||||||
|
|
||||||
static bool ReadIoMemory32Bit(void *dst, const void *src, size_t size);
|
|
||||||
static bool ReadIoMemory16Bit(void *dst, const void *src, size_t size);
|
|
||||||
static bool ReadIoMemory8Bit(void *dst, const void *src, size_t size);
|
|
||||||
static bool WriteIoMemory32Bit(void *dst, const void *src, size_t size);
|
|
||||||
static bool WriteIoMemory16Bit(void *dst, const void *src, size_t size);
|
|
||||||
static bool WriteIoMemory8Bit(void *dst, const void *src, size_t size);
|
|
||||||
};
|
|
||||||
public:
|
public:
|
||||||
static bool CopyMemoryFromUser(void *dst, const void *src, size_t size) {
|
|
||||||
return Impl::CopyMemoryFromUser(dst, src, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool CopyMemoryFromUserAligned32Bit(void *dst, const void *src, size_t size) {
|
|
||||||
return Impl::CopyMemoryFromUserAligned32Bit(dst, src, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool CopyMemoryFromUserAligned64Bit(void *dst, const void *src, size_t size) {
|
|
||||||
return Impl::CopyMemoryFromUserAligned64Bit(dst, src, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool CopyMemoryFromUserSize64Bit(void *dst, const void *src) {
|
|
||||||
return Impl::CopyMemoryFromUserSize64Bit(dst, src);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool CopyMemoryFromUserSize32Bit(void *dst, const void *src) {
|
|
||||||
return Impl::CopyMemoryFromUserSize32Bit(dst, src);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static bool CopyMemoryFromUserSize32BitWithSupervisorAccess(void *dst, const void *src) {
|
static bool CopyMemoryFromUserSize32BitWithSupervisorAccess(void *dst, const void *src) {
|
||||||
/* Check that the address is within the valid userspace range. */
|
/* Check that the address is within the valid userspace range. */
|
||||||
if (const uintptr_t src_uptr = reinterpret_cast<uintptr_t>(src); src_uptr < ams::svc::AddressNullGuard32Size || (src_uptr + sizeof(u32) - 1) >= ams::svc::AddressMemoryRegion42Size) {
|
if (const uintptr_t src_uptr = reinterpret_cast<uintptr_t>(src); src_uptr < ams::svc::AddressNullGuard32Size || (src_uptr + sizeof(u32) - 1) >= ams::svc::AddressMemoryRegion39Size) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Impl::CopyMemoryFromUserSize32BitWithSupervisorAccess(dst, src);
|
return CopyMemoryFromUserSize32BitWithSupervisorAccessImpl(dst, src);
|
||||||
}
|
}
|
||||||
|
|
||||||
static s32 CopyStringFromUser(void *dst, const void *src, size_t size) {
|
static bool CopyMemoryFromUser(void *dst, const void *src, size_t size);
|
||||||
return Impl::CopyStringFromUser(dst, src, size);
|
static bool CopyMemoryFromUserAligned32Bit(void *dst, const void *src, size_t size);
|
||||||
}
|
static bool CopyMemoryFromUserAligned64Bit(void *dst, const void *src, size_t size);
|
||||||
|
static bool CopyMemoryFromUserSize64Bit(void *dst, const void *src);
|
||||||
|
static bool CopyMemoryFromUserSize32Bit(void *dst, const void *src);
|
||||||
|
static s32 CopyStringFromUser(void *dst, const void *src, size_t size);
|
||||||
|
|
||||||
static bool CopyMemoryToUser(void *dst, const void *src, size_t size) {
|
static bool CopyMemoryToUser(void *dst, const void *src, size_t size);
|
||||||
return Impl::CopyMemoryToUser(dst, src, size);
|
static bool CopyMemoryToUserAligned32Bit(void *dst, const void *src, size_t size);
|
||||||
}
|
static bool CopyMemoryToUserAligned64Bit(void *dst, const void *src, size_t size);
|
||||||
|
static bool CopyMemoryToUserSize32Bit(void *dst, const void *src);
|
||||||
|
static s32 CopyStringToUser(void *dst, const void *src, size_t size);
|
||||||
|
|
||||||
static bool CopyMemoryToUserAligned32Bit(void *dst, const void *src, size_t size) {
|
static bool ClearMemory(void *dst, size_t size);
|
||||||
return Impl::CopyMemoryToUserAligned32Bit(dst, src, size);
|
static bool ClearMemoryAligned32Bit(void *dst, size_t size);
|
||||||
}
|
static bool ClearMemoryAligned64Bit(void *dst, size_t size);
|
||||||
|
static bool ClearMemorySize32Bit(void *dst);
|
||||||
|
|
||||||
static bool CopyMemoryToUserAligned64Bit(void *dst, const void *src, size_t size) {
|
static bool UpdateLockAtomic(u32 *out, u32 *address, u32 if_zero, u32 new_orr_mask);
|
||||||
return Impl::CopyMemoryToUserAligned64Bit(dst, src, size);
|
static bool UpdateIfEqualAtomic(s32 *out, s32 *address, s32 compare_value, s32 new_value);
|
||||||
}
|
static bool DecrementIfLessThanAtomic(s32 *out, s32 *address, s32 compare);
|
||||||
|
|
||||||
static bool CopyMemoryToUserSize32Bit(void *dst, u32 value) {
|
static bool StoreDataCache(uintptr_t start, uintptr_t end);
|
||||||
return Impl::CopyMemoryToUserSize32Bit(dst, value);
|
static bool FlushDataCache(uintptr_t start, uintptr_t end);
|
||||||
}
|
static bool InvalidateDataCache(uintptr_t start, uintptr_t end);
|
||||||
|
|
||||||
static s32 CopyStringToUser(void *dst, const void *src, size_t size) {
|
static bool ReadIoMemory32Bit(void *dst, const void *src, size_t size);
|
||||||
return Impl::CopyStringToUser(dst, src, size);
|
static bool ReadIoMemory16Bit(void *dst, const void *src, size_t size);
|
||||||
}
|
static bool ReadIoMemory8Bit(void *dst, const void *src, size_t size);
|
||||||
|
static bool WriteIoMemory32Bit(void *dst, const void *src, size_t size);
|
||||||
static bool UpdateLockAtomic(u32 *out, u32 *address, u32 if_zero, u32 new_orr_mask) {
|
static bool WriteIoMemory16Bit(void *dst, const void *src, size_t size);
|
||||||
return Impl::UpdateLockAtomic(out, address, if_zero, new_orr_mask);
|
static bool WriteIoMemory8Bit(void *dst, const void *src, size_t size);
|
||||||
}
|
|
||||||
|
|
||||||
static bool UpdateIfEqualAtomic(s32 *out, s32 *address, s32 compare_value, s32 new_value) {
|
|
||||||
return Impl::UpdateIfEqualAtomic(out, address, compare_value, new_value);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool DecrementIfLessThanAtomic(s32 *out, s32 *address, s32 compare) {
|
|
||||||
return Impl::DecrementIfLessThanAtomic(out, address, compare);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool StoreDataCache(uintptr_t start, uintptr_t end) {
|
|
||||||
return Impl::StoreDataCache(start, end);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool FlushDataCache(uintptr_t start, uintptr_t end) {
|
|
||||||
return Impl::FlushDataCache(start, end);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool InvalidateDataCache(uintptr_t start, uintptr_t end) {
|
|
||||||
return Impl::InvalidateDataCache(start, end);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool ReadIoMemory32Bit(void *dst, const void *src, size_t size) {
|
|
||||||
return Impl::ReadIoMemory32Bit(dst, src, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool ReadIoMemory16Bit(void *dst, const void *src, size_t size) {
|
|
||||||
return Impl::ReadIoMemory16Bit(dst, src, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool ReadIoMemory8Bit(void *dst, const void *src, size_t size) {
|
|
||||||
return Impl::ReadIoMemory8Bit(dst, src, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool WriteIoMemory32Bit(void *dst, const void *src, size_t size) {
|
|
||||||
return Impl::WriteIoMemory32Bit(dst, src, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool WriteIoMemory16Bit(void *dst, const void *src, size_t size) {
|
|
||||||
return Impl::WriteIoMemory16Bit(dst, src, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool WriteIoMemory8Bit(void *dst, const void *src, size_t size) {
|
|
||||||
return Impl::WriteIoMemory8Bit(dst, src, size);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,9 @@ namespace ams::kern::board::nintendo::nx {
|
|||||||
static NOINLINE u32 GetCreateProcessMemoryPool();
|
static NOINLINE u32 GetCreateProcessMemoryPool();
|
||||||
|
|
||||||
/* Randomness. */
|
/* Randomness. */
|
||||||
static void GenerateRandomBytesForUninitialized(void *dst, size_t size);
|
static void GenerateRandom(u64 *dst, size_t count);
|
||||||
|
static u64 GenerateRandomRange(u64 min, u64 max);
|
||||||
|
static u64 GenerateRandomU64();
|
||||||
|
|
||||||
/* Privileged Access. */
|
/* Privileged Access. */
|
||||||
static void ReadWriteRegisterPrivileged(u32 *out, ams::svc::PhysicalAddress address, u32 mask, u32 value);
|
static void ReadWriteRegisterPrivileged(u32 *out, ams::svc::PhysicalAddress address, u32 mask, u32 value);
|
||||||
|
|||||||
@@ -18,25 +18,6 @@
|
|||||||
#include <mesosphere/kern_k_slab_heap.hpp>
|
#include <mesosphere/kern_k_slab_heap.hpp>
|
||||||
|
|
||||||
namespace ams::kern::init {
|
namespace ams::kern::init {
|
||||||
/* Constexpr counts. */
|
|
||||||
constexpr size_t SlabCountKProcess = 80;
|
|
||||||
constexpr size_t SlabCountKThread = 800;
|
|
||||||
constexpr size_t SlabCountKEvent = 900;
|
|
||||||
constexpr size_t SlabCountKInterruptEvent = 100;
|
|
||||||
constexpr size_t SlabCountKPort = 384;
|
|
||||||
constexpr size_t SlabCountKSharedMemory = 80;
|
|
||||||
constexpr size_t SlabCountKTransferMemory = 200;
|
|
||||||
constexpr size_t SlabCountKCodeMemory = 10;
|
|
||||||
constexpr size_t SlabCountKDeviceAddressSpace = 300;
|
|
||||||
constexpr size_t SlabCountKSession = 1133;
|
|
||||||
constexpr size_t SlabCountKLightSession = 100;
|
|
||||||
constexpr size_t SlabCountKObjectName = 7;
|
|
||||||
constexpr size_t SlabCountKResourceLimit = 5;
|
|
||||||
constexpr size_t SlabCountKDebug = cpu::NumCores;
|
|
||||||
constexpr size_t SlabCountKIoPool = 1;
|
|
||||||
constexpr size_t SlabCountKIoRegion = 6;
|
|
||||||
constexpr size_t SlabcountKSessionRequestMappings = 40;
|
|
||||||
|
|
||||||
|
|
||||||
struct KSlabResourceCounts {
|
struct KSlabResourceCounts {
|
||||||
size_t num_KProcess;
|
size_t num_KProcess;
|
||||||
|
|||||||
@@ -47,6 +47,13 @@
|
|||||||
/* re-enabled by toggling this define. */
|
/* re-enabled by toggling this define. */
|
||||||
//#define MESOSPHERE_ENABLE_PROCESS_CREATION_TIME
|
//#define MESOSPHERE_ENABLE_PROCESS_CREATION_TIME
|
||||||
|
|
||||||
|
/* NOTE: This enables fast class token storage using a class member. */
|
||||||
|
/* This saves a virtual call when doing KAutoObject->DynCast<>(), */
|
||||||
|
/* at the cost of storing class tokens inside the class object. */
|
||||||
|
/* However, as of (10/16/2021) KAutoObject has an unused class member */
|
||||||
|
/* of the right side, and so this does not actually cost any space. */
|
||||||
|
#define MESOSPHERE_ENABLE_DEVIRTUALIZED_DYNAMIC_CAST
|
||||||
|
|
||||||
/* NOTE: This enables usage of KDebug handles as parameter for svc::GetInfo */
|
/* NOTE: This enables usage of KDebug handles as parameter for svc::GetInfo */
|
||||||
/* calls which require a process parameter. This enables a debugger to obtain */
|
/* calls which require a process parameter. This enables a debugger to obtain */
|
||||||
/* address space/layout information, for example. However, it changes abi, and so */
|
/* address space/layout information, for example. However, it changes abi, and so */
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace ams::kern {
|
|||||||
enum Type {
|
enum Type {
|
||||||
Type_MapSmall = 0,
|
Type_MapSmall = 0,
|
||||||
Type_MapLarge = 1,
|
Type_MapLarge = 1,
|
||||||
Type_MapHuge = 2,
|
Type_Map39Bit = 2,
|
||||||
Type_Heap = 3,
|
Type_Heap = 3,
|
||||||
Type_Stack = 4,
|
Type_Stack = 4,
|
||||||
Type_Alias = 5,
|
Type_Alias = 5,
|
||||||
@@ -37,8 +37,8 @@ namespace ams::kern {
|
|||||||
size_t m_size;
|
size_t m_size;
|
||||||
Type m_type;
|
Type m_type;
|
||||||
public:
|
public:
|
||||||
static uintptr_t GetAddressSpaceStart(ams::svc::CreateProcessParameterFlag flags, Type type, size_t code_size);
|
static uintptr_t GetAddressSpaceStart(ams::svc::CreateProcessFlag flags, Type type);
|
||||||
static size_t GetAddressSpaceSize(ams::svc::CreateProcessParameterFlag flags, Type type);
|
static size_t GetAddressSpaceSize(ams::svc::CreateProcessFlag flags, Type type);
|
||||||
|
|
||||||
static void SetAddressSpaceSize(size_t width, Type type, size_t size);
|
static void SetAddressSpaceSize(size_t width, Type type, size_t size);
|
||||||
|
|
||||||
|
|||||||
@@ -121,9 +121,14 @@ namespace ams::kern {
|
|||||||
private:
|
private:
|
||||||
KAutoObject *m_next_closed_object;
|
KAutoObject *m_next_closed_object;
|
||||||
ReferenceCount m_ref_count;
|
ReferenceCount m_ref_count;
|
||||||
|
#if defined(MESOSPHERE_ENABLE_DEVIRTUALIZED_DYNAMIC_CAST)
|
||||||
ClassTokenType m_class_token;
|
ClassTokenType m_class_token;
|
||||||
|
#endif
|
||||||
public:
|
public:
|
||||||
constexpr ALWAYS_INLINE explicit KAutoObject(util::ConstantInitializeTag) : m_next_closed_object(nullptr), m_ref_count(0), m_class_token(0)
|
constexpr ALWAYS_INLINE explicit KAutoObject(util::ConstantInitializeTag) : m_next_closed_object(nullptr), m_ref_count(0)
|
||||||
|
#if defined(MESOSPHERE_ENABLE_DEVIRTUALIZED_DYNAMIC_CAST)
|
||||||
|
, m_class_token(0)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
MESOSPHERE_ASSERT_THIS();
|
MESOSPHERE_ASSERT_THIS();
|
||||||
}
|
}
|
||||||
@@ -146,11 +151,19 @@ namespace ams::kern {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ALWAYS_INLINE bool IsDerivedFrom(const TypeObj &rhs) const {
|
ALWAYS_INLINE bool IsDerivedFrom(const TypeObj &rhs) const {
|
||||||
return TypeObj::IsClassTokenDerivedFrom(m_class_token, rhs.GetClassToken());
|
#if defined(MESOSPHERE_ENABLE_DEVIRTUALIZED_DYNAMIC_CAST)
|
||||||
|
return TypeObj::IsClassTokenDerivedFrom(m_class_token, rhs.GetClassToken());
|
||||||
|
#else
|
||||||
|
return this->GetTypeObj().IsDerivedFrom(rhs);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
ALWAYS_INLINE bool IsDerivedFrom(const KAutoObject &rhs) const {
|
ALWAYS_INLINE bool IsDerivedFrom(const KAutoObject &rhs) const {
|
||||||
return TypeObj::IsClassTokenDerivedFrom(m_class_token, rhs.m_class_token);
|
#if defined(MESOSPHERE_ENABLE_DEVIRTUALIZED_DYNAMIC_CAST)
|
||||||
|
return TypeObj::IsClassTokenDerivedFrom(m_class_token, rhs.m_class_token);
|
||||||
|
#else
|
||||||
|
return this->IsDerivedFrom(rhs.GetTypeObj());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
@@ -205,10 +218,12 @@ namespace ams::kern {
|
|||||||
KAutoObject &auto_object = *static_cast<KAutoObject *>(obj);
|
KAutoObject &auto_object = *static_cast<KAutoObject *>(obj);
|
||||||
|
|
||||||
/* If we should, set our class token. */
|
/* If we should, set our class token. */
|
||||||
|
#if defined(MESOSPHERE_ENABLE_DEVIRTUALIZED_DYNAMIC_CAST)
|
||||||
{
|
{
|
||||||
constexpr auto Token = Derived::GetStaticTypeObj().GetClassToken();
|
constexpr auto Token = Derived::GetStaticTypeObj().GetClassToken();
|
||||||
auto_object.m_class_token = Token;
|
auto_object.m_class_token = Token;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Initialize reference count to 1. */
|
/* Initialize reference count to 1. */
|
||||||
auto_object.m_ref_count = 1;
|
auto_object.m_ref_count = 1;
|
||||||
|
|||||||
@@ -93,9 +93,9 @@ namespace ams::kern {
|
|||||||
static Result ProcessDebugEvent(ams::svc::DebugEvent event, const uintptr_t *params, size_t num_params);
|
static Result ProcessDebugEvent(ams::svc::DebugEvent event, const uintptr_t *params, size_t num_params);
|
||||||
public:
|
public:
|
||||||
static Result OnDebugEvent(ams::svc::DebugEvent event, const uintptr_t *params, size_t num_params);
|
static Result OnDebugEvent(ams::svc::DebugEvent event, const uintptr_t *params, size_t num_params);
|
||||||
static void OnExitProcess(KProcess *process);
|
static Result OnExitProcess(KProcess *process);
|
||||||
static void OnTerminateProcess(KProcess *process);
|
static Result OnTerminateProcess(KProcess *process);
|
||||||
static void OnExitThread(KThread *thread);
|
static Result OnExitThread(KThread *thread);
|
||||||
static KEventInfo *CreateDebugEvent(ams::svc::DebugEvent event, u64 thread_id, const uintptr_t *params, size_t num_params);
|
static KEventInfo *CreateDebugEvent(ams::svc::DebugEvent event, u64 thread_id, const uintptr_t *params, size_t num_params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ namespace ams::kern {
|
|||||||
|
|
||||||
KReadableEvent &GetReadableEvent() { return m_readable_event; }
|
KReadableEvent &GetReadableEvent() { return m_readable_event; }
|
||||||
|
|
||||||
void Signal();
|
Result Signal();
|
||||||
void Clear();
|
Result Clear();
|
||||||
|
|
||||||
ALWAYS_INLINE void OnReadableEventDestroyed() { m_readable_event_destroyed = true; }
|
ALWAYS_INLINE void OnReadableEventDestroyed() { m_readable_event_destroyed = true; }
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ namespace ams::kern {
|
|||||||
constexpr ALWAYS_INLINE size_t GetCount() const { return m_count; }
|
constexpr ALWAYS_INLINE size_t GetCount() const { return m_count; }
|
||||||
constexpr ALWAYS_INLINE size_t GetMaxCount() const { return m_max_count; }
|
constexpr ALWAYS_INLINE size_t GetMaxCount() const { return m_max_count; }
|
||||||
|
|
||||||
MESOSPHERE_NOINLINE_IF_DEBUG void Finalize();
|
MESOSPHERE_NOINLINE_IF_DEBUG Result Finalize();
|
||||||
MESOSPHERE_NOINLINE_IF_DEBUG bool Remove(ams::svc::Handle handle);
|
MESOSPHERE_NOINLINE_IF_DEBUG bool Remove(ams::svc::Handle handle);
|
||||||
|
|
||||||
template<typename T = KAutoObject>
|
template<typename T = KAutoObject>
|
||||||
|
|||||||
@@ -38,11 +38,13 @@ namespace ams::kern {
|
|||||||
|
|
||||||
Result Reset();
|
Result Reset();
|
||||||
|
|
||||||
void Clear() {
|
Result Clear() {
|
||||||
MESOSPHERE_ASSERT_THIS();
|
MESOSPHERE_ASSERT_THIS();
|
||||||
|
|
||||||
/* Try to perform a reset, ignoring whether it succeeds. */
|
/* Try to perform a reset, succeeding unconditionally. */
|
||||||
static_cast<void>(this->Reset());
|
this->Reset();
|
||||||
|
|
||||||
|
R_SUCCEED();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsInitialized() const { return m_is_initialized; }
|
bool IsInitialized() const { return m_is_initialized; }
|
||||||
|
|||||||
@@ -119,8 +119,6 @@ namespace ams::kern {
|
|||||||
KMemoryState_Insecure = ams::svc::MemoryState_Insecure | KMemoryState_FlagMapped | KMemoryState_FlagReferenceCounted | KMemoryState_FlagLinearMapped | KMemoryState_FlagCanChangeAttribute
|
KMemoryState_Insecure = ams::svc::MemoryState_Insecure | KMemoryState_FlagMapped | KMemoryState_FlagReferenceCounted | KMemoryState_FlagLinearMapped | KMemoryState_FlagCanChangeAttribute
|
||||||
| KMemoryState_FlagCanDeviceMap | KMemoryState_FlagCanAlignedDeviceMap | KMemoryState_FlagCanQueryPhysical
|
| KMemoryState_FlagCanDeviceMap | KMemoryState_FlagCanAlignedDeviceMap | KMemoryState_FlagCanQueryPhysical
|
||||||
| KMemoryState_FlagCanUseNonSecureIpc | KMemoryState_FlagCanUseNonDeviceIpc,
|
| KMemoryState_FlagCanUseNonSecureIpc | KMemoryState_FlagCanUseNonDeviceIpc,
|
||||||
|
|
||||||
KMemoryState_ShadowStack = ams::svc::MemoryState_ShadowStack,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
@@ -149,7 +147,6 @@ namespace ams::kern {
|
|||||||
static_assert(KMemoryState_CodeOut == 0x04402015);
|
static_assert(KMemoryState_CodeOut == 0x04402015);
|
||||||
static_assert(KMemoryState_Coverage == 0x00002016); /* TODO: Is this correct? */
|
static_assert(KMemoryState_Coverage == 0x00002016); /* TODO: Is this correct? */
|
||||||
static_assert(KMemoryState_Insecure == 0x055C3817);
|
static_assert(KMemoryState_Insecure == 0x055C3817);
|
||||||
static_assert(KMemoryState_ShadowStack == 0x0000001A);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum KMemoryPermission : u8 {
|
enum KMemoryPermission : u8 {
|
||||||
@@ -214,15 +211,15 @@ namespace ams::kern {
|
|||||||
uintptr_t m_address;
|
uintptr_t m_address;
|
||||||
size_t m_size;
|
size_t m_size;
|
||||||
KMemoryState m_state;
|
KMemoryState m_state;
|
||||||
|
u16 m_device_disable_merge_left_count;
|
||||||
|
u16 m_device_disable_merge_right_count;
|
||||||
|
u16 m_ipc_lock_count;
|
||||||
|
u16 m_device_use_count;
|
||||||
|
u16 m_ipc_disable_merge_count;
|
||||||
KMemoryPermission m_permission;
|
KMemoryPermission m_permission;
|
||||||
KMemoryAttribute m_attribute;
|
KMemoryAttribute m_attribute;
|
||||||
KMemoryPermission m_original_permission;
|
KMemoryPermission m_original_permission;
|
||||||
u16 m_ipc_lock_count;
|
|
||||||
u16 m_device_use_count;
|
|
||||||
KMemoryBlockDisableMergeAttribute m_disable_merge_attribute;
|
KMemoryBlockDisableMergeAttribute m_disable_merge_attribute;
|
||||||
u16 m_ipc_disable_merge_count;
|
|
||||||
u16 m_device_disable_merge_left_count;
|
|
||||||
u16 m_device_disable_merge_right_count;
|
|
||||||
|
|
||||||
constexpr ams::svc::MemoryInfo GetSvcMemoryInfo() const {
|
constexpr ams::svc::MemoryInfo GetSvcMemoryInfo() const {
|
||||||
return {
|
return {
|
||||||
@@ -368,15 +365,15 @@ namespace ams::kern {
|
|||||||
.m_address = GetInteger(this->GetAddress()),
|
.m_address = GetInteger(this->GetAddress()),
|
||||||
.m_size = this->GetSize(),
|
.m_size = this->GetSize(),
|
||||||
.m_state = m_memory_state,
|
.m_state = m_memory_state,
|
||||||
|
.m_device_disable_merge_left_count = m_device_disable_merge_left_count,
|
||||||
|
.m_device_disable_merge_right_count = m_device_disable_merge_right_count,
|
||||||
|
.m_ipc_lock_count = m_ipc_lock_count,
|
||||||
|
.m_device_use_count = m_device_use_count,
|
||||||
|
.m_ipc_disable_merge_count = m_ipc_disable_merge_count,
|
||||||
.m_permission = m_permission,
|
.m_permission = m_permission,
|
||||||
.m_attribute = m_attribute,
|
.m_attribute = m_attribute,
|
||||||
.m_original_permission = m_original_permission,
|
.m_original_permission = m_original_permission,
|
||||||
.m_ipc_lock_count = m_ipc_lock_count,
|
|
||||||
.m_device_use_count = m_device_use_count,
|
|
||||||
.m_disable_merge_attribute = m_disable_merge_attribute,
|
.m_disable_merge_attribute = m_disable_merge_attribute,
|
||||||
.m_ipc_disable_merge_count = m_ipc_disable_merge_count,
|
|
||||||
.m_device_disable_merge_left_count = m_device_disable_merge_left_count,
|
|
||||||
.m_device_disable_merge_right_count = m_device_disable_merge_right_count,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -99,7 +99,6 @@ namespace ams::kern {
|
|||||||
Result Initialize(KProcessAddress st, KProcessAddress nd, KMemoryBlockSlabManager *slab_manager);
|
Result Initialize(KProcessAddress st, KProcessAddress nd, KMemoryBlockSlabManager *slab_manager);
|
||||||
void Finalize(KMemoryBlockSlabManager *slab_manager);
|
void Finalize(KMemoryBlockSlabManager *slab_manager);
|
||||||
|
|
||||||
static bool GetRegionForFindFreeArea(KProcessAddress *out_start, KProcessAddress *out_end, KProcessAddress region_start, size_t region_num_pages, size_t num_pages, size_t alignment, size_t offset, size_t guard_pages);
|
|
||||||
KProcessAddress FindFreeArea(KProcessAddress region_start, size_t region_num_pages, size_t num_pages, size_t alignment, size_t offset, size_t guard_pages) const;
|
KProcessAddress FindFreeArea(KProcessAddress region_start, size_t region_num_pages, size_t num_pages, size_t alignment, size_t offset, size_t guard_pages) const;
|
||||||
|
|
||||||
void Update(KMemoryBlockManagerUpdateAllocator *allocator, KProcessAddress address, size_t num_pages, KMemoryState state, KMemoryPermission perm, KMemoryAttribute attr, KMemoryBlockDisableMergeAttribute set_disable_attr, KMemoryBlockDisableMergeAttribute clear_disable_attr);
|
void Update(KMemoryBlockManagerUpdateAllocator *allocator, KProcessAddress address, size_t num_pages, KMemoryState state, KMemoryPermission perm, KMemoryAttribute attr, KMemoryBlockDisableMergeAttribute set_disable_attr, KMemoryBlockDisableMergeAttribute clear_disable_attr);
|
||||||
|
|||||||
@@ -90,11 +90,10 @@ namespace ams::kern {
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum RegionType {
|
enum RegionType {
|
||||||
RegionType_KernelMap = 0,
|
RegionType_KernelMap = 0,
|
||||||
RegionType_Stack = 1,
|
RegionType_Stack = 1,
|
||||||
RegionType_Alias = 2,
|
RegionType_Alias = 2,
|
||||||
RegionType_Heap = 3,
|
RegionType_Heap = 3,
|
||||||
RegionType_ShadowStack = 4,
|
|
||||||
|
|
||||||
RegionType_Count,
|
RegionType_Count,
|
||||||
};
|
};
|
||||||
@@ -151,14 +150,14 @@ namespace ams::kern {
|
|||||||
|
|
||||||
static constexpr u32 DefaultMemoryIgnoreAttr = KMemoryAttribute_IpcLocked | KMemoryAttribute_DeviceShared;
|
static constexpr u32 DefaultMemoryIgnoreAttr = KMemoryAttribute_IpcLocked | KMemoryAttribute_DeviceShared;
|
||||||
|
|
||||||
static constexpr size_t GetAddressSpaceWidth(ams::svc::CreateProcessParameterFlag as_type) {
|
static constexpr size_t GetAddressSpaceWidth(ams::svc::CreateProcessFlag as_type) {
|
||||||
switch (static_cast<ams::svc::CreateProcessParameterFlag>(as_type & ams::svc::CreateProcessParameterFlag_AddressSpaceMask)) {
|
switch (static_cast<ams::svc::CreateProcessFlag>(as_type & ams::svc::CreateProcessFlag_AddressSpaceMask)) {
|
||||||
case ams::svc::CreateProcessParameterFlag_AddressSpace64Bit39:
|
case ams::svc::CreateProcessFlag_AddressSpace64Bit:
|
||||||
return 39;
|
return 39;
|
||||||
case ams::svc::CreateProcessParameterFlag_AddressSpace64Bit36:
|
case ams::svc::CreateProcessFlag_AddressSpace64BitDeprecated:
|
||||||
return 36;
|
return 36;
|
||||||
case ams::svc::CreateProcessParameterFlag_AddressSpace32Bit:
|
case ams::svc::CreateProcessFlag_AddressSpace32Bit:
|
||||||
case ams::svc::CreateProcessParameterFlag_AddressSpace32BitNoReserved:
|
case ams::svc::CreateProcessFlag_AddressSpace32BitWithoutAlias:
|
||||||
return 32;
|
return 32;
|
||||||
MESOSPHERE_UNREACHABLE_DEFAULT_CASE();
|
MESOSPHERE_UNREACHABLE_DEFAULT_CASE();
|
||||||
}
|
}
|
||||||
@@ -197,10 +196,10 @@ namespace ams::kern {
|
|||||||
KPageTableImpl m_impl;
|
KPageTableImpl m_impl;
|
||||||
KMemoryBlockManager m_memory_block_manager;
|
KMemoryBlockManager m_memory_block_manager;
|
||||||
u32 m_allocate_option;
|
u32 m_allocate_option;
|
||||||
|
u32 m_address_space_width;
|
||||||
bool m_is_kernel;
|
bool m_is_kernel;
|
||||||
bool m_enable_aslr;
|
bool m_enable_aslr;
|
||||||
bool m_enable_device_address_space_merge;
|
bool m_enable_device_address_space_merge;
|
||||||
bool m_allowed_exec_device_mapping;
|
|
||||||
KMemoryBlockSlabManager *m_memory_block_slab_manager;
|
KMemoryBlockSlabManager *m_memory_block_slab_manager;
|
||||||
KBlockInfoManager *m_block_info_manager;
|
KBlockInfoManager *m_block_info_manager;
|
||||||
KResourceLimit *m_resource_limit;
|
KResourceLimit *m_resource_limit;
|
||||||
@@ -212,24 +211,23 @@ namespace ams::kern {
|
|||||||
public:
|
public:
|
||||||
constexpr explicit KPageTableBase(util::ConstantInitializeTag)
|
constexpr explicit KPageTableBase(util::ConstantInitializeTag)
|
||||||
: m_address_space_start(Null<KProcessAddress>), m_address_space_end(Null<KProcessAddress>),
|
: m_address_space_start(Null<KProcessAddress>), m_address_space_end(Null<KProcessAddress>),
|
||||||
m_region_starts{Null<KProcessAddress>, Null<KProcessAddress>, Null<KProcessAddress>, Null<KProcessAddress>, Null<KProcessAddress>},
|
m_region_starts{Null<KProcessAddress>, Null<KProcessAddress>, Null<KProcessAddress>, Null<KProcessAddress>},
|
||||||
m_region_ends{Null<KProcessAddress>, Null<KProcessAddress>, Null<KProcessAddress>, Null<KProcessAddress>, Null<KProcessAddress>},
|
m_region_ends{Null<KProcessAddress>, Null<KProcessAddress>, Null<KProcessAddress>, Null<KProcessAddress>},
|
||||||
m_current_heap_end(Null<KProcessAddress>), m_alias_code_region_start(Null<KProcessAddress>),
|
m_current_heap_end(Null<KProcessAddress>), m_alias_code_region_start(Null<KProcessAddress>),
|
||||||
m_alias_code_region_end(Null<KProcessAddress>), m_code_region_start(Null<KProcessAddress>), m_code_region_end(Null<KProcessAddress>),
|
m_alias_code_region_end(Null<KProcessAddress>), m_code_region_start(Null<KProcessAddress>), m_code_region_end(Null<KProcessAddress>),
|
||||||
m_max_heap_size(), m_mapped_physical_memory_size(), m_mapped_unsafe_physical_memory(), m_mapped_insecure_memory(),
|
m_max_heap_size(), m_mapped_physical_memory_size(), m_mapped_unsafe_physical_memory(), m_mapped_insecure_memory(), m_mapped_ipc_server_memory(), m_alias_region_extra_size(),
|
||||||
m_mapped_ipc_server_memory(), m_alias_region_extra_size(), m_general_lock(), m_map_physical_memory_lock(),
|
m_general_lock(), m_map_physical_memory_lock(), m_device_map_lock(), m_impl(util::ConstantInitialize), m_memory_block_manager(util::ConstantInitialize),
|
||||||
m_device_map_lock(), m_impl(util::ConstantInitialize), m_memory_block_manager(util::ConstantInitialize),
|
m_allocate_option(), m_address_space_width(), m_is_kernel(), m_enable_aslr(), m_enable_device_address_space_merge(),
|
||||||
m_allocate_option(), m_is_kernel(), m_enable_aslr(), m_enable_device_address_space_merge(), m_allowed_exec_device_mapping(),
|
m_memory_block_slab_manager(), m_block_info_manager(), m_resource_limit(), m_cached_physical_linear_region(), m_cached_physical_heap_region(),
|
||||||
m_memory_block_slab_manager(), m_block_info_manager(), m_resource_limit(), m_cached_physical_linear_region(),
|
m_heap_fill_value(), m_ipc_fill_value(), m_stack_fill_value()
|
||||||
m_cached_physical_heap_region(), m_heap_fill_value(), m_ipc_fill_value(), m_stack_fill_value()
|
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
explicit KPageTableBase() { /* ... */ }
|
explicit KPageTableBase() { /* ... */ }
|
||||||
|
|
||||||
NOINLINE void InitializeForKernel(void *table, KVirtualAddress start, KVirtualAddress end);
|
NOINLINE Result InitializeForKernel(bool is_64_bit, void *table, KVirtualAddress start, KVirtualAddress end);
|
||||||
NOINLINE Result InitializeForProcess(ams::svc::CreateProcessParameterFlag flags, bool from_back, void *table, KProcessAddress start, KProcessAddress end, KMemoryManager::Pool pool, KProcessAddress code_address, size_t code_size, KSystemResource *system_resource, KResourceLimit *resource_limit);
|
NOINLINE Result InitializeForProcess(ams::svc::CreateProcessFlag flags, bool from_back, KMemoryManager::Pool pool, void *table, KProcessAddress start, KProcessAddress end, KProcessAddress code_address, size_t code_size, KSystemResource *system_resource, KResourceLimit *resource_limit);
|
||||||
|
|
||||||
void Finalize();
|
void Finalize();
|
||||||
|
|
||||||
@@ -248,22 +246,6 @@ namespace ams::kern {
|
|||||||
return this->Contains(addr, size) && m_region_starts[RegionType_Alias] <= addr && addr + size - 1 <= m_region_ends[RegionType_Alias] - 1;
|
return this->Contains(addr, size) && m_region_starts[RegionType_Alias] <= addr && addr + size - 1 <= m_region_ends[RegionType_Alias] - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr bool IsInShadowStackRegion(KProcessAddress addr, size_t size) const {
|
|
||||||
const auto start = m_region_starts[RegionType_ShadowStack];
|
|
||||||
const auto end = m_region_ends[RegionType_ShadowStack];
|
|
||||||
return start != end && addr < end && start < addr + size;
|
|
||||||
}
|
|
||||||
|
|
||||||
constexpr bool IsInShadowStackRegion(KProcessAddress addr) const {
|
|
||||||
const auto start = m_region_starts[RegionType_ShadowStack];
|
|
||||||
const auto end = m_region_ends[RegionType_ShadowStack];
|
|
||||||
return start <= addr && addr < end;
|
|
||||||
}
|
|
||||||
|
|
||||||
constexpr bool IsSafeUserPointer(KProcessAddress addr, size_t size) const {
|
|
||||||
return this->Contains(addr, size) && !this->IsInShadowStackRegion(addr, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IsInUnsafeAliasRegion(KProcessAddress addr, size_t size) const {
|
bool IsInUnsafeAliasRegion(KProcessAddress addr, size_t size) const {
|
||||||
/* Even though Unsafe physical memory is KMemoryState_Normal, it must be mapped inside the alias code region. */
|
/* Even though Unsafe physical memory is KMemoryState_Normal, it must be mapped inside the alias code region. */
|
||||||
return this->CanContain(addr, size, ams::svc::MemoryState_AliasCode);
|
return this->CanContain(addr, size, ams::svc::MemoryState_AliasCode);
|
||||||
@@ -507,21 +489,19 @@ namespace ams::kern {
|
|||||||
public:
|
public:
|
||||||
KProcessAddress GetAddressSpaceStart() const { return m_address_space_start; }
|
KProcessAddress GetAddressSpaceStart() const { return m_address_space_start; }
|
||||||
|
|
||||||
KProcessAddress GetShadowStackRegionStart() const { return m_region_starts[RegionType_ShadowStack]; }
|
KProcessAddress GetHeapRegionStart() const { return m_region_starts[RegionType_Heap]; }
|
||||||
KProcessAddress GetHeapRegionStart() const { return m_region_starts[RegionType_Heap]; }
|
KProcessAddress GetAliasRegionStart() const { return m_region_starts[RegionType_Alias]; }
|
||||||
KProcessAddress GetAliasRegionStart() const { return m_region_starts[RegionType_Alias]; }
|
KProcessAddress GetStackRegionStart() const { return m_region_starts[RegionType_Stack]; }
|
||||||
KProcessAddress GetStackRegionStart() const { return m_region_starts[RegionType_Stack]; }
|
KProcessAddress GetKernelMapRegionStart() const { return m_region_starts[RegionType_KernelMap]; }
|
||||||
KProcessAddress GetKernelMapRegionStart() const { return m_region_starts[RegionType_KernelMap]; }
|
|
||||||
|
|
||||||
KProcessAddress GetAliasCodeRegionStart() const { return m_alias_code_region_start; }
|
KProcessAddress GetAliasCodeRegionStart() const { return m_alias_code_region_start; }
|
||||||
|
|
||||||
size_t GetAddressSpaceSize() const { return m_address_space_end - m_address_space_start; }
|
size_t GetAddressSpaceSize() const { return m_address_space_end - m_address_space_start; }
|
||||||
|
|
||||||
size_t GetShadowStackRegionSize() const { return m_region_ends[RegionType_ShadowStack] - m_region_starts[RegionType_ShadowStack]; }
|
size_t GetHeapRegionSize() const { return m_region_ends[RegionType_Heap] - m_region_starts[RegionType_Heap]; }
|
||||||
size_t GetHeapRegionSize() const { return m_region_ends[RegionType_Heap] - m_region_starts[RegionType_Heap]; }
|
size_t GetAliasRegionSize() const { return m_region_ends[RegionType_Alias] - m_region_starts[RegionType_Alias]; }
|
||||||
size_t GetAliasRegionSize() const { return m_region_ends[RegionType_Alias] - m_region_starts[RegionType_Alias]; }
|
size_t GetStackRegionSize() const { return m_region_ends[RegionType_Stack] - m_region_starts[RegionType_Stack]; }
|
||||||
size_t GetStackRegionSize() const { return m_region_ends[RegionType_Stack] - m_region_starts[RegionType_Stack]; }
|
size_t GetKernelMapRegionSize() const { return m_region_ends[RegionType_KernelMap] - m_region_starts[RegionType_KernelMap]; }
|
||||||
size_t GetKernelMapRegionSize() const { return m_region_ends[RegionType_KernelMap] - m_region_starts[RegionType_KernelMap]; }
|
|
||||||
|
|
||||||
size_t GetAliasCodeRegionSize() const { return m_alias_code_region_end - m_alias_code_region_start; }
|
size_t GetAliasCodeRegionSize() const { return m_alias_code_region_end - m_alias_code_region_start; }
|
||||||
|
|
||||||
@@ -540,8 +520,6 @@ namespace ams::kern {
|
|||||||
size_t GetAliasCodeDataSize() const;
|
size_t GetAliasCodeDataSize() const;
|
||||||
|
|
||||||
u32 GetAllocateOption() const { return m_allocate_option; }
|
u32 GetAllocateOption() const { return m_allocate_option; }
|
||||||
|
|
||||||
void AllowDeviceMappingOfExecPages() { m_allowed_exec_device_mapping = true; }
|
|
||||||
public:
|
public:
|
||||||
static ALWAYS_INLINE KVirtualAddress GetLinearMappedVirtualAddress(KPhysicalAddress addr) {
|
static ALWAYS_INLINE KVirtualAddress GetLinearMappedVirtualAddress(KPhysicalAddress addr) {
|
||||||
return KMemoryLayout::GetLinearVirtualAddress(addr);
|
return KMemoryLayout::GetLinearVirtualAddress(addr);
|
||||||
|
|||||||
@@ -102,8 +102,8 @@ namespace ams::kern {
|
|||||||
IoRegionList m_io_region_list;
|
IoRegionList m_io_region_list;
|
||||||
bool m_is_suspended;
|
bool m_is_suspended;
|
||||||
bool m_is_immortal;
|
bool m_is_immortal;
|
||||||
bool m_is_handle_table_initialized;
|
|
||||||
bool m_is_jit_debug;
|
bool m_is_jit_debug;
|
||||||
|
bool m_is_handle_table_initialized;
|
||||||
ams::svc::DebugEvent m_jit_debug_event_type;
|
ams::svc::DebugEvent m_jit_debug_event_type;
|
||||||
ams::svc::DebugException m_jit_debug_exception_type;
|
ams::svc::DebugException m_jit_debug_exception_type;
|
||||||
uintptr_t m_jit_debug_params[4];
|
uintptr_t m_jit_debug_params[4];
|
||||||
@@ -113,7 +113,6 @@ namespace ams::kern {
|
|||||||
u64 m_running_thread_idle_counts[cpu::NumCores];
|
u64 m_running_thread_idle_counts[cpu::NumCores];
|
||||||
u64 m_running_thread_switch_counts[cpu::NumCores];
|
u64 m_running_thread_switch_counts[cpu::NumCores];
|
||||||
KThread *m_pinned_threads[cpu::NumCores];
|
KThread *m_pinned_threads[cpu::NumCores];
|
||||||
s64 m_exit_tag;
|
|
||||||
util::Atomic<s64> m_cpu_time;
|
util::Atomic<s64> m_cpu_time;
|
||||||
util::Atomic<s64> m_num_process_switches;
|
util::Atomic<s64> m_num_process_switches;
|
||||||
util::Atomic<s64> m_num_thread_switches;
|
util::Atomic<s64> m_num_thread_switches;
|
||||||
@@ -143,11 +142,11 @@ namespace ams::kern {
|
|||||||
m_pinned_threads[core_id] = nullptr;
|
m_pinned_threads[core_id] = nullptr;
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
explicit KProcess() : m_is_initialized(false), m_exit_tag(-1ll) { /* ... */ }
|
explicit KProcess() : m_is_initialized(false) { /* ... */ }
|
||||||
|
|
||||||
Result Initialize(const ams::svc::CreateProcessParameter ¶ms, const KPageGroup &pg, const u32 *caps, s32 num_caps, KResourceLimit *res_limit, KMemoryManager::Pool pool, bool immortal);
|
Result Initialize(const ams::svc::CreateProcessParameter ¶ms, const KPageGroup &pg, const u32 *caps, s32 num_caps, KResourceLimit *res_limit, KMemoryManager::Pool pool, bool immortal);
|
||||||
Result Initialize(const ams::svc::CreateProcessParameter ¶ms, svc::KUserPointer<const u32 *> caps, s32 num_caps, KResourceLimit *res_limit, KMemoryManager::Pool pool);
|
Result Initialize(const ams::svc::CreateProcessParameter ¶ms, svc::KUserPointer<const u32 *> caps, s32 num_caps, KResourceLimit *res_limit, KMemoryManager::Pool pool);
|
||||||
void Exit(s64 exit_tag);
|
void Exit();
|
||||||
|
|
||||||
constexpr const char *GetName() const { return m_name; }
|
constexpr const char *GetName() const { return m_name; }
|
||||||
|
|
||||||
@@ -157,21 +156,18 @@ namespace ams::kern {
|
|||||||
|
|
||||||
constexpr State GetState() const { return m_state; }
|
constexpr State GetState() const { return m_state; }
|
||||||
|
|
||||||
constexpr s64 GetExitTag() const { return m_exit_tag; }
|
|
||||||
|
|
||||||
constexpr u64 GetCoreMask() const { return m_capabilities.GetCoreMask(); }
|
constexpr u64 GetCoreMask() const { return m_capabilities.GetCoreMask(); }
|
||||||
constexpr u64 GetPhysicalCoreMask() const { return m_capabilities.GetPhysicalCoreMask(); }
|
constexpr u64 GetPhysicalCoreMask() const { return m_capabilities.GetPhysicalCoreMask(); }
|
||||||
constexpr u64 GetPriorityMask() const { return m_capabilities.GetPriorityMask(); }
|
constexpr u64 GetPriorityMask() const { return m_capabilities.GetPriorityMask(); }
|
||||||
constexpr u32 GetIntendedKernelMajorVersion() const { return m_capabilities.GetIntendedKernelMajorVersion(); }
|
|
||||||
|
|
||||||
constexpr s32 GetIdealCoreId() const { return m_ideal_core_id; }
|
constexpr s32 GetIdealCoreId() const { return m_ideal_core_id; }
|
||||||
constexpr void SetIdealCoreId(s32 core_id) { m_ideal_core_id = core_id; }
|
constexpr void SetIdealCoreId(s32 core_id) { m_ideal_core_id = core_id; }
|
||||||
|
|
||||||
constexpr bool CheckThreadPriority(s32 prio) const { return ((1ul << prio) & this->GetPriorityMask()) != 0; }
|
constexpr bool CheckThreadPriority(s32 prio) const { return ((1ul << prio) & this->GetPriorityMask()) != 0; }
|
||||||
|
|
||||||
constexpr u32 GetCreateProcessParameterFlags() const { return m_flags; }
|
constexpr u32 GetCreateProcessFlags() const { return m_flags; }
|
||||||
|
|
||||||
constexpr bool Is64Bit() const { return m_flags & ams::svc::CreateProcessParameterFlag_64Bit; }
|
constexpr bool Is64Bit() const { return m_flags & ams::svc::CreateProcessFlag_Is64Bit; }
|
||||||
|
|
||||||
constexpr KProcessAddress GetEntryPoint() const { return m_code_address; }
|
constexpr KProcessAddress GetEntryPoint() const { return m_code_address; }
|
||||||
|
|
||||||
@@ -188,7 +184,7 @@ namespace ams::kern {
|
|||||||
constexpr bool IsSuspended() const { return m_is_suspended; }
|
constexpr bool IsSuspended() const { return m_is_suspended; }
|
||||||
constexpr void SetSuspended(bool suspended) { m_is_suspended = suspended; }
|
constexpr void SetSuspended(bool suspended) { m_is_suspended = suspended; }
|
||||||
|
|
||||||
Result Terminate(s64 exit_tag);
|
Result Terminate();
|
||||||
|
|
||||||
constexpr bool IsTerminated() const {
|
constexpr bool IsTerminated() const {
|
||||||
return m_state == State_Terminated;
|
return m_state == State_Terminated;
|
||||||
@@ -219,7 +215,6 @@ namespace ams::kern {
|
|||||||
}
|
}
|
||||||
|
|
||||||
u32 GetAllocateOption() const { return m_page_table.GetAllocateOption(); }
|
u32 GetAllocateOption() const { return m_page_table.GetAllocateOption(); }
|
||||||
size_t GetAddressSpaceSize() const { return m_page_table.GetAddressSpaceSize(); }
|
|
||||||
|
|
||||||
ThreadList &GetThreadList() { return m_thread_list; }
|
ThreadList &GetThreadList() { return m_thread_list; }
|
||||||
const ThreadList &GetThreadList() const { return m_thread_list; }
|
const ThreadList &GetThreadList() const { return m_thread_list; }
|
||||||
@@ -274,7 +269,7 @@ namespace ams::kern {
|
|||||||
void RemoveIoRegion(KIoRegion *io_region);
|
void RemoveIoRegion(KIoRegion *io_region);
|
||||||
|
|
||||||
Result CreateThreadLocalRegion(KProcessAddress *out);
|
Result CreateThreadLocalRegion(KProcessAddress *out);
|
||||||
void DeleteThreadLocalRegion(KProcessAddress addr);
|
Result DeleteThreadLocalRegion(KProcessAddress addr);
|
||||||
void *GetThreadLocalRegionPointer(KProcessAddress addr);
|
void *GetThreadLocalRegionPointer(KProcessAddress addr);
|
||||||
|
|
||||||
constexpr KProcessAddress GetProcessLocalRegionAddress() const { return m_plr_address; }
|
constexpr KProcessAddress GetProcessLocalRegionAddress() const { return m_plr_address; }
|
||||||
@@ -415,10 +410,6 @@ namespace ams::kern {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetExitTag(s64 exit_tag) {
|
|
||||||
m_exit_tag = exit_tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
ALWAYS_INLINE Result InitializeHandleTable(s32 size) {
|
ALWAYS_INLINE Result InitializeHandleTable(s32 size) {
|
||||||
/* Try to initialize the handle table. */
|
/* Try to initialize the handle table. */
|
||||||
R_TRY(m_handle_table.Initialize(size));
|
R_TRY(m_handle_table.Initialize(size));
|
||||||
|
|||||||
@@ -35,14 +35,16 @@ namespace ams::kern {
|
|||||||
|
|
||||||
constexpr KEvent *GetParent() const { return m_parent; }
|
constexpr KEvent *GetParent() const { return m_parent; }
|
||||||
|
|
||||||
void Signal();
|
Result Signal();
|
||||||
Result Reset();
|
Result Reset();
|
||||||
|
|
||||||
void Clear() {
|
Result Clear() {
|
||||||
MESOSPHERE_ASSERT_THIS();
|
MESOSPHERE_ASSERT_THIS();
|
||||||
|
|
||||||
/* Try to perform a reset, ignoring whether it succeeds. */
|
/* Try to perform a reset, succeeding unconditionally. */
|
||||||
static_cast<void>(this->Reset());
|
this->Reset();
|
||||||
|
|
||||||
|
R_SUCCEED();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool IsSignaled() const override;
|
virtual bool IsSignaled() const override;
|
||||||
|
|||||||
@@ -37,12 +37,13 @@ namespace ams::kern {
|
|||||||
public:
|
public:
|
||||||
/* This can be overridden as needed. */
|
/* This can be overridden as needed. */
|
||||||
static constexpr size_t SecureAppletMemorySize = 0;
|
static constexpr size_t SecureAppletMemorySize = 0;
|
||||||
private:
|
protected:
|
||||||
/* Randomness helpers. */
|
/* Nintendo uses std::mt19937_t for randomness. */
|
||||||
static void InitializeRandomGenerator(const void *seed, size_t size);
|
/* To save space (and because mt19337_t isn't secure anyway), */
|
||||||
static void ReseedRandomGeneratorInternal();
|
/* We will use TinyMT. */
|
||||||
static u32 GenerateRandomU32();
|
static constinit inline bool s_initialized_random_generator;
|
||||||
static u64 GenerateRandomU64Internal();
|
static constinit inline util::TinyMT s_random_generator{util::ConstantInitialize};
|
||||||
|
static constinit inline KSpinLock s_random_lock;
|
||||||
public:
|
public:
|
||||||
class Init {
|
class Init {
|
||||||
private:
|
private:
|
||||||
@@ -65,7 +66,7 @@ namespace ams::kern {
|
|||||||
static u64 GenerateRandomRange(u64 min, u64 max);
|
static u64 GenerateRandomRange(u64 min, u64 max);
|
||||||
};
|
};
|
||||||
protected:
|
protected:
|
||||||
static NOINLINE void InitializePhase1Base(const void *seed, size_t size);
|
static NOINLINE void InitializePhase1Base(u64 seed);
|
||||||
public:
|
public:
|
||||||
/* Initialization. */
|
/* Initialization. */
|
||||||
static NOINLINE void ConfigureKTargetSystem();
|
static NOINLINE void ConfigureKTargetSystem();
|
||||||
@@ -77,10 +78,6 @@ namespace ams::kern {
|
|||||||
static void GenerateRandom(u64 *dst, size_t count);
|
static void GenerateRandom(u64 *dst, size_t count);
|
||||||
static u64 GenerateRandomRange(u64 min, u64 max);
|
static u64 GenerateRandomRange(u64 min, u64 max);
|
||||||
static u64 GenerateRandomU64();
|
static u64 GenerateRandomU64();
|
||||||
static void ReseedRandomGenerator();
|
|
||||||
|
|
||||||
/* Obtains random bytes while the generator is not yet initialized. Board-provided. */
|
|
||||||
static void GenerateRandomBytesForUninitialized(void *dst, size_t size);
|
|
||||||
|
|
||||||
/* Register access Access. */
|
/* Register access Access. */
|
||||||
static Result ReadWriteRegister(u32 *out, ams::svc::PhysicalAddress address, u32 mask, u32 value);
|
static Result ReadWriteRegister(u32 *out, ams::svc::PhysicalAddress address, u32 mask, u32 value);
|
||||||
|
|||||||
@@ -94,11 +94,7 @@ namespace ams::kern {
|
|||||||
static void PostDestroy(uintptr_t arg) { MESOSPHERE_UNUSED(arg); /* ... */ }
|
static void PostDestroy(uintptr_t arg) { MESOSPHERE_UNUSED(arg); /* ... */ }
|
||||||
|
|
||||||
ALWAYS_INLINE size_t CalculateRequiredSecureMemorySize() const {
|
ALWAYS_INLINE size_t CalculateRequiredSecureMemorySize() const {
|
||||||
if (m_resource_limit != nullptr) {
|
return CalculateRequiredSecureMemorySize(m_resource_size, m_resource_pool);
|
||||||
return CalculateRequiredSecureMemorySize(m_resource_size, m_resource_pool);
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ALWAYS_INLINE size_t GetSize() const { return m_resource_size; }
|
ALWAYS_INLINE size_t GetSize() const { return m_resource_size; }
|
||||||
|
|||||||
@@ -25,38 +25,35 @@ namespace ams::kern {
|
|||||||
friend class KSystemControl;
|
friend class KSystemControl;
|
||||||
private:
|
private:
|
||||||
struct KTargetSystemData {
|
struct KTargetSystemData {
|
||||||
bool is_not_debug_mode;
|
bool is_debug_mode;
|
||||||
bool is_not_debug_mode2;
|
bool enable_debug_logging;
|
||||||
bool disable_debug_logging;
|
bool enable_user_exception_handlers;
|
||||||
bool disable_user_exception_handlers;
|
bool enable_debug_memory_fill;
|
||||||
bool disable_debug_memory_fill;
|
bool enable_user_pmu_access;
|
||||||
bool disable_user_pmu_access;
|
bool enable_kernel_debugging;
|
||||||
bool disable_kernel_debugging;
|
bool enable_dynamic_resource_limits;
|
||||||
bool disable_dynamic_resource_limits;
|
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
static inline constinit bool s_is_uninitialized = true;
|
static inline constinit bool s_is_initialized = false;
|
||||||
static inline constinit const volatile KTargetSystemData s_data = {
|
static inline constinit const volatile KTargetSystemData s_data = {
|
||||||
.is_not_debug_mode = false,
|
.is_debug_mode = true,
|
||||||
.is_not_debug_mode2 = false,
|
.enable_debug_logging = true,
|
||||||
.disable_debug_logging = false,
|
.enable_user_exception_handlers = true,
|
||||||
.disable_user_exception_handlers = false,
|
.enable_debug_memory_fill = true,
|
||||||
.disable_debug_memory_fill = false,
|
.enable_user_pmu_access = true,
|
||||||
.disable_user_pmu_access = false,
|
.enable_kernel_debugging = true,
|
||||||
.disable_kernel_debugging = false,
|
.enable_dynamic_resource_limits = false,
|
||||||
.disable_dynamic_resource_limits = true,
|
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
static ALWAYS_INLINE void SetInitialized() { s_is_uninitialized = false; }
|
static ALWAYS_INLINE void SetInitialized() { s_is_initialized = true; }
|
||||||
public:
|
public:
|
||||||
static ALWAYS_INLINE bool IsDebugMode() { return !(s_is_uninitialized | s_data.is_not_debug_mode); }
|
static ALWAYS_INLINE bool IsDebugMode() { return s_is_initialized && s_data.is_debug_mode; }
|
||||||
static ALWAYS_INLINE bool IsDebugMode2() { return !(s_is_uninitialized | s_data.is_not_debug_mode2); }
|
static ALWAYS_INLINE bool IsDebugLoggingEnabled() { return s_is_initialized && s_data.enable_debug_logging; }
|
||||||
static ALWAYS_INLINE bool IsDebugLoggingEnabled() { return !(s_is_uninitialized | s_data.disable_debug_logging); }
|
static ALWAYS_INLINE bool IsUserExceptionHandlersEnabled() { return s_is_initialized && s_data.enable_user_exception_handlers; }
|
||||||
static ALWAYS_INLINE bool IsUserExceptionHandlersEnabled() { return !(s_is_uninitialized | s_data.disable_user_exception_handlers); }
|
static ALWAYS_INLINE bool IsDebugMemoryFillEnabled() { return s_is_initialized && s_data.enable_debug_memory_fill; }
|
||||||
static ALWAYS_INLINE bool IsDebugMemoryFillEnabled() { return !(s_is_uninitialized | s_data.disable_debug_memory_fill); }
|
static ALWAYS_INLINE bool IsUserPmuAccessEnabled() { return s_is_initialized && s_data.enable_user_pmu_access; }
|
||||||
static ALWAYS_INLINE bool IsUserPmuAccessEnabled() { return !(s_is_uninitialized | s_data.disable_user_pmu_access); }
|
static ALWAYS_INLINE bool IsKernelDebuggingEnabled() { return s_is_initialized && s_data.enable_kernel_debugging; }
|
||||||
static ALWAYS_INLINE bool IsKernelDebuggingEnabled() { return !(s_is_uninitialized | s_data.disable_kernel_debugging); }
|
static ALWAYS_INLINE bool IsDynamicResourceLimitsEnabled() { return s_is_initialized && s_data.enable_dynamic_resource_limits; }
|
||||||
static ALWAYS_INLINE bool IsDynamicResourceLimitsEnabled() { return !(s_is_uninitialized | s_data.disable_dynamic_resource_limits); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,6 @@ namespace ams::kern {
|
|||||||
class KProcess;
|
class KProcess;
|
||||||
class KConditionVariable;
|
class KConditionVariable;
|
||||||
class KAddressArbiter;
|
class KAddressArbiter;
|
||||||
class KPageBuffer;
|
|
||||||
|
|
||||||
using KThreadFunction = void (*)(uintptr_t);
|
using KThreadFunction = void (*)(uintptr_t);
|
||||||
|
|
||||||
@@ -106,7 +105,7 @@ namespace ams::kern {
|
|||||||
util::Atomic<u8> dpc_flags;
|
util::Atomic<u8> dpc_flags;
|
||||||
u8 current_svc_id;
|
u8 current_svc_id;
|
||||||
u8 reserved_2c;
|
u8 reserved_2c;
|
||||||
util::Atomic<u8> exception_flags;
|
u8 exception_flags;
|
||||||
bool is_pinned;
|
bool is_pinned;
|
||||||
u8 reserved_2f;
|
u8 reserved_2f;
|
||||||
u8 reserved_30[0x10];
|
u8 reserved_30[0x10];
|
||||||
@@ -306,8 +305,6 @@ namespace ams::kern {
|
|||||||
u32 *m_light_ipc_data;
|
u32 *m_light_ipc_data;
|
||||||
KProcessAddress m_tls_address;
|
KProcessAddress m_tls_address;
|
||||||
void *m_tls_heap_address;
|
void *m_tls_heap_address;
|
||||||
KProcessAddress m_shadow_stack_address;
|
|
||||||
KPageBuffer *m_shadow_stack_page;
|
|
||||||
KLightLock m_activity_pause_lock;
|
KLightLock m_activity_pause_lock;
|
||||||
SyncObjectBuffer m_sync_object_buffer;
|
SyncObjectBuffer m_sync_object_buffer;
|
||||||
s64 m_schedule_count;
|
s64 m_schedule_count;
|
||||||
@@ -344,19 +341,18 @@ namespace ams::kern {
|
|||||||
bool m_debug_attached;
|
bool m_debug_attached;
|
||||||
s8 m_priority_inheritance_count;
|
s8 m_priority_inheritance_count;
|
||||||
bool m_resource_limit_release_hint;
|
bool m_resource_limit_release_hint;
|
||||||
bool m_debug_unknown5;
|
|
||||||
public:
|
public:
|
||||||
constexpr explicit KThread(util::ConstantInitializeTag)
|
constexpr explicit KThread(util::ConstantInitializeTag)
|
||||||
: KAutoObjectWithSlabHeapAndContainer<KThread, KWorkerTask>(util::ConstantInitialize), KTimerTask(util::ConstantInitialize),
|
: KAutoObjectWithSlabHeapAndContainer<KThread, KWorkerTask>(util::ConstantInitialize), KTimerTask(util::ConstantInitialize),
|
||||||
m_process_list_node{}, m_condvar_arbiter_tree_node{util::ConstantInitialize}, m_priority{-1}, m_condvar_tree{}, m_condvar_key{},
|
m_process_list_node{}, m_condvar_arbiter_tree_node{util::ConstantInitialize}, m_priority{-1}, m_condvar_tree{}, m_condvar_key{},
|
||||||
m_caller_save_fpu_registers{}, m_virtual_affinity_mask{}, m_physical_affinity_mask{}, m_thread_id{}, m_cpu_time{0}, m_address_key{Null<KProcessAddress>}, m_parent{},
|
m_caller_save_fpu_registers{}, m_virtual_affinity_mask{}, m_physical_affinity_mask{}, m_thread_id{}, m_cpu_time{0}, m_address_key{Null<KProcessAddress>}, m_parent{},
|
||||||
m_kernel_stack_top{}, m_light_ipc_data{}, m_tls_address{Null<KProcessAddress>}, m_tls_heap_address{}, m_shadow_stack_address{Null<KProcessAddress>}, m_shadow_stack_page{}, m_activity_pause_lock{}, m_sync_object_buffer{util::ConstantInitialize},
|
m_kernel_stack_top{}, m_light_ipc_data{}, m_tls_address{Null<KProcessAddress>}, m_tls_heap_address{}, m_activity_pause_lock{}, m_sync_object_buffer{util::ConstantInitialize},
|
||||||
m_schedule_count{}, m_last_scheduled_tick{}, m_per_core_priority_queue_entry{}, m_wait_queue{}, m_held_lock_info_list{}, m_waiting_lock_info{},
|
m_schedule_count{}, m_last_scheduled_tick{}, m_per_core_priority_queue_entry{}, m_wait_queue{}, m_held_lock_info_list{}, m_waiting_lock_info{},
|
||||||
m_pinned_waiter_list{}, m_debug_params{}, m_closed_object{}, m_address_key_value{}, m_suspend_request_flags{}, m_suspend_allowed_flags{}, m_synced_index{},
|
m_pinned_waiter_list{}, m_debug_params{}, m_closed_object{}, m_address_key_value{}, m_suspend_request_flags{}, m_suspend_allowed_flags{}, m_synced_index{},
|
||||||
m_wait_result{svc::ResultNoSynchronizationObject()}, m_debug_exception_result{ResultSuccess()}, m_base_priority{}, m_base_priority_on_unpin{},
|
m_wait_result{svc::ResultNoSynchronizationObject()}, m_debug_exception_result{ResultSuccess()}, m_base_priority{}, m_base_priority_on_unpin{},
|
||||||
m_physical_ideal_core_id{}, m_virtual_ideal_core_id{}, m_num_kernel_waiters{}, m_current_core_id{}, m_core_id{}, m_original_physical_affinity_mask{},
|
m_physical_ideal_core_id{}, m_virtual_ideal_core_id{}, m_num_kernel_waiters{}, m_current_core_id{}, m_core_id{}, m_original_physical_affinity_mask{},
|
||||||
m_original_physical_ideal_core_id{}, m_num_core_migration_disables{}, m_thread_state{}, m_termination_requested{false}, m_wait_cancelled{},
|
m_original_physical_ideal_core_id{}, m_num_core_migration_disables{}, m_thread_state{}, m_termination_requested{false}, m_wait_cancelled{},
|
||||||
m_cancellable{}, m_signaled{}, m_initialized{}, m_debug_attached{}, m_priority_inheritance_count{}, m_resource_limit_release_hint{}, m_debug_unknown5{}
|
m_cancellable{}, m_signaled{}, m_initialized{}, m_debug_attached{}, m_priority_inheritance_count{}, m_resource_limit_release_hint{}
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
@@ -421,17 +417,17 @@ namespace ams::kern {
|
|||||||
private:
|
private:
|
||||||
ALWAYS_INLINE void SetExceptionFlag(ExceptionFlag flag) {
|
ALWAYS_INLINE void SetExceptionFlag(ExceptionFlag flag) {
|
||||||
MESOSPHERE_ASSERT_THIS();
|
MESOSPHERE_ASSERT_THIS();
|
||||||
this->GetStackParameters().exception_flags.FetchOr<std::memory_order_relaxed>(flag);
|
this->GetStackParameters().exception_flags |= flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
ALWAYS_INLINE void ClearExceptionFlag(ExceptionFlag flag) {
|
ALWAYS_INLINE void ClearExceptionFlag(ExceptionFlag flag) {
|
||||||
MESOSPHERE_ASSERT_THIS();
|
MESOSPHERE_ASSERT_THIS();
|
||||||
this->GetStackParameters().exception_flags.FetchAnd<std::memory_order_relaxed>(~flag);
|
this->GetStackParameters().exception_flags &= ~flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
ALWAYS_INLINE bool IsExceptionFlagSet(ExceptionFlag flag) const {
|
ALWAYS_INLINE bool IsExceptionFlagSet(ExceptionFlag flag) const {
|
||||||
MESOSPHERE_ASSERT_THIS();
|
MESOSPHERE_ASSERT_THIS();
|
||||||
return this->GetStackParameters().exception_flags.Load<std::memory_order_relaxed>() & flag;
|
return this->GetStackParameters().exception_flags & flag;
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
/* ALWAYS_INLINE void SetCallingSvc() { return this->SetExceptionFlag(ExceptionFlag_IsCallingSvc); } */
|
/* ALWAYS_INLINE void SetCallingSvc() { return this->SetExceptionFlag(ExceptionFlag_IsCallingSvc); } */
|
||||||
@@ -527,7 +523,7 @@ namespace ams::kern {
|
|||||||
Result GetCoreMask(int32_t *out_ideal_core, u64 *out_affinity_mask);
|
Result GetCoreMask(int32_t *out_ideal_core, u64 *out_affinity_mask);
|
||||||
Result SetCoreMask(int32_t ideal_core, u64 affinity_mask);
|
Result SetCoreMask(int32_t ideal_core, u64 affinity_mask);
|
||||||
|
|
||||||
void GetPhysicalCoreMask(int32_t *out_ideal_core, u64 *out_affinity_mask);
|
Result GetPhysicalCoreMask(int32_t *out_ideal_core, u64 *out_affinity_mask);
|
||||||
|
|
||||||
constexpr ThreadState GetState() const { return static_cast<ThreadState>(m_thread_state & ThreadState_Mask); }
|
constexpr ThreadState GetState() const { return static_cast<ThreadState>(m_thread_state & ThreadState_Mask); }
|
||||||
constexpr ThreadState GetRawState() const { return m_thread_state; }
|
constexpr ThreadState GetRawState() const { return m_thread_state; }
|
||||||
@@ -687,9 +683,6 @@ namespace ams::kern {
|
|||||||
constexpr void SetDebugAttached() { m_debug_attached = true; }
|
constexpr void SetDebugAttached() { m_debug_attached = true; }
|
||||||
constexpr bool IsAttachedToDebugger() const { return m_debug_attached; }
|
constexpr bool IsAttachedToDebugger() const { return m_debug_attached; }
|
||||||
|
|
||||||
constexpr void SetDebugUnknown5(bool value) { m_debug_unknown5 = value; }
|
|
||||||
constexpr bool IsDebugUnknown5() const { return m_debug_unknown5; }
|
|
||||||
|
|
||||||
void AddCpuTime(s32 core_id, s64 amount) {
|
void AddCpuTime(s32 core_id, s64 amount) {
|
||||||
m_cpu_time += amount;
|
m_cpu_time += amount;
|
||||||
/* TODO: Debug kernels track per-core tick counts. Should we? */
|
/* TODO: Debug kernels track per-core tick counts. Should we? */
|
||||||
@@ -724,7 +717,7 @@ namespace ams::kern {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SetBasePriority(s32 priority);
|
void SetBasePriority(s32 priority);
|
||||||
void SetPriorityToIdle();
|
Result SetPriorityToIdle();
|
||||||
|
|
||||||
Result Run();
|
Result Run();
|
||||||
void Exit();
|
void Exit();
|
||||||
@@ -732,7 +725,7 @@ namespace ams::kern {
|
|||||||
Result Terminate();
|
Result Terminate();
|
||||||
ThreadState RequestTerminate();
|
ThreadState RequestTerminate();
|
||||||
|
|
||||||
void Sleep(s64 timeout);
|
Result Sleep(s64 timeout);
|
||||||
|
|
||||||
ALWAYS_INLINE void *GetStackTop() const { return reinterpret_cast<StackParameters *>(m_kernel_stack_top) - 1; }
|
ALWAYS_INLINE void *GetStackTop() const { return reinterpret_cast<StackParameters *>(m_kernel_stack_top) - 1; }
|
||||||
ALWAYS_INLINE void *GetKernelStackTop() const { return m_kernel_stack_top; }
|
ALWAYS_INLINE void *GetKernelStackTop() const { return m_kernel_stack_top; }
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ namespace ams::kern {
|
|||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
Result Initialize(KProcess *process);
|
Result Initialize(KProcess *process);
|
||||||
void Finalize();
|
Result Finalize();
|
||||||
|
|
||||||
KProcessAddress Reserve();
|
KProcessAddress Reserve();
|
||||||
void Release(KProcessAddress addr);
|
void Release(KProcessAddress addr);
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ clean:
|
|||||||
@echo clean $(ATMOSPHERE_BUILD_NAME) ...
|
@echo clean $(ATMOSPHERE_BUILD_NAME) ...
|
||||||
@rm -fr $(ATMOSPHERE_BUILD_DIR) $(ATMOSPHERE_OUT_DIR)
|
@rm -fr $(ATMOSPHERE_BUILD_DIR) $(ATMOSPHERE_OUT_DIR)
|
||||||
@rm -fr $(foreach hdr,$(GCH_DIRS),$(hdr)/$(ATMOSPHERE_GCH_IDENTIFIER))
|
@rm -fr $(foreach hdr,$(GCH_DIRS),$(hdr)/$(ATMOSPHERE_GCH_IDENTIFIER))
|
||||||
@for i in $(GCH_DIRS); do [ -d $$i ] && rmdir $$i 2>/dev/null || true; done
|
@for i in $(GCH_DIRS); do [ -d $$i ] && rmdir --ignore-fail-on-non-empty $$i || true; done
|
||||||
|
|
||||||
$(ATMOSPHERE_LIBRARY_DIR) $(ATMOSPHERE_BUILD_DIR) $(GCH_DIRS):
|
$(ATMOSPHERE_LIBRARY_DIR) $(ATMOSPHERE_BUILD_DIR) $(GCH_DIRS):
|
||||||
@[ -d $@ ] || mkdir -p $@
|
@[ -d $@ ] || mkdir -p $@
|
||||||
@@ -108,8 +108,6 @@ $(OFILES_SRC) : $(HFILES_BIN)
|
|||||||
|
|
||||||
kern_libc_generic.o: CFLAGS += -fno-builtin
|
kern_libc_generic.o: CFLAGS += -fno-builtin
|
||||||
|
|
||||||
crypto_aes_impl.arch.arm64.o: CXXFLAGS := $(filter-out -mgeneral-regs-only,$(CXXFLAGS))
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
%_bin.h %.bin.o : %.bin
|
%_bin.h %.bin.o : %.bin
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -113,11 +113,6 @@ namespace ams::kern::arch::arm {
|
|||||||
constexpr size_t Offset = 0;
|
constexpr size_t Offset = 0;
|
||||||
state->icfgr[i] = m_gicd->icfgr[i + Offset];
|
state->icfgr[i] = m_gicd->icfgr[i + Offset];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Save spendsgir. */
|
|
||||||
for (size_t i = 0; i < util::size(state->spendsgir); ++i) {
|
|
||||||
state->spendsgir[i] = m_gicd->spendsgir[i];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void KInterruptController::SaveGlobal(GlobalState *state) const {
|
void KInterruptController::SaveGlobal(GlobalState *state) const {
|
||||||
@@ -173,11 +168,6 @@ namespace ams::kern::arch::arm {
|
|||||||
m_gicd->icenabler[i + Offset] = 0xFFFFFFFF;
|
m_gicd->icenabler[i + Offset] = 0xFFFFFFFF;
|
||||||
m_gicd->isenabler[i + Offset] = state->isenabler[i];
|
m_gicd->isenabler[i + Offset] = state->isenabler[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Restore spendsgir. */
|
|
||||||
for (size_t i = 0; i < util::size(state->spendsgir); ++i) {
|
|
||||||
m_gicd->spendsgir[i] = state->spendsgir[i];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void KInterruptController::RestoreGlobal(const GlobalState *state) const {
|
void KInterruptController::RestoreGlobal(const GlobalState *state) const {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user