Compare commits
100 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9dd93687b | ||
|
|
8a9ddc30e0 | ||
|
|
4cb8034ac8 | ||
|
|
296fb31358 | ||
|
|
1dd9d46415 | ||
|
|
2b3c7fd104 | ||
|
|
6e1b0abf1d | ||
|
|
d7adef3810 | ||
|
|
1545fa9d44 | ||
|
|
71add1add8 | ||
|
|
a96786fd2c | ||
|
|
74e4e70053 | ||
|
|
26b6216fa0 | ||
|
|
fe5c850e69 | ||
|
|
2b825d56dc | ||
|
|
13b17a5848 | ||
|
|
621520c30b | ||
|
|
846cc0b47a | ||
|
|
e82ad1cdc5 | ||
|
|
b40da8f445 | ||
|
|
a9c6476416 | ||
|
|
c1d93a9495 | ||
|
|
201b17f100 | ||
|
|
c0e3cee657 | ||
|
|
26d8db74f8 | ||
|
|
ee2e9d50fd | ||
|
|
fd1a39996e | ||
|
|
8eb65ab401 | ||
|
|
bcda834980 | ||
|
|
408b81b881 | ||
|
|
d854b94382 | ||
|
|
63440cab18 | ||
|
|
4fa585a23f | ||
|
|
e521ae805d | ||
|
|
6950989552 | ||
|
|
ffbdf29c10 | ||
|
|
135d42ffee | ||
|
|
1306d03136 | ||
|
|
97aa209c43 | ||
|
|
4ce2a6deb3 | ||
|
|
e45d8cd7d8 | ||
|
|
79211e1159 | ||
|
|
ca8e8ce487 | ||
|
|
b30311be65 | ||
|
|
6694d8c2d9 | ||
|
|
658389fc60 | ||
|
|
d6477cf024 | ||
|
|
400f5142ee | ||
|
|
8bf8df43e2 | ||
|
|
a28c60970f | ||
|
|
b5f72b9f20 | ||
|
|
8d10584a51 | ||
|
|
366c265ab2 | ||
|
|
42964992d1 | ||
|
|
4a82d9bf28 | ||
|
|
4190281b2f | ||
|
|
48830d190f | ||
|
|
3389aaefc3 | ||
|
|
f8f987aa8d | ||
|
|
e87e146112 | ||
|
|
5751bcc117 | ||
|
|
eb1e979257 | ||
|
|
204539664b | ||
|
|
f5c6736431 | ||
|
|
d00ebaa28a | ||
|
|
402e4d1adb | ||
|
|
ed7c0605f9 | ||
|
|
c848a830ee | ||
|
|
dbe8add4f4 | ||
|
|
e4e278bb3d | ||
|
|
3761f80592 | ||
|
|
9878c18e47 | ||
|
|
3bb94aa146 | ||
|
|
83c04fa5d7 | ||
|
|
dc4ee1a5bc | ||
|
|
5191f0e305 | ||
|
|
170034aed3 | ||
|
|
21236020cb | ||
|
|
f06de12bea | ||
|
|
8314d015f3 | ||
|
|
49f07b065a | ||
|
|
9e104bb83f | ||
|
|
33457d61da | ||
|
|
b5816b4a91 | ||
|
|
af7233d84c | ||
|
|
8ac8abf295 | ||
|
|
b26ebc12e1 | ||
|
|
b4122da6ad | ||
|
|
6a2ee02409 | ||
|
|
094cede39e | ||
|
|
9cfd259c5c | ||
|
|
4f7f37fae6 | ||
|
|
d2f81d2ca2 | ||
|
|
b8072b1398 | ||
|
|
a6e3a93c07 | ||
|
|
1e643f7ab0 | ||
|
|
4aa18b06e8 | ||
|
|
f051f707ed | ||
|
|
1c9d6b4d90 | ||
|
|
b21f8a5043 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -95,3 +95,5 @@ sept/sept-secondary/KEYS.py
|
|||||||
**/build_nintendo_nx_arm
|
**/build_nintendo_nx_arm
|
||||||
**/build_nintendo_nx_x64
|
**/build_nintendo_nx_x64
|
||||||
**/build_nintendo_nx_x86
|
**/build_nintendo_nx_x86
|
||||||
|
|
||||||
|
stratosphere/test/
|
||||||
|
|||||||
1
Makefile
1
Makefile
@@ -135,6 +135,7 @@ dist: dist-no-debug
|
|||||||
cp exosphere/program/sc7fw/sc7fw.elf atmosphere-$(AMSVER)-debug/exosphere-sc7fw.elf
|
cp exosphere/program/sc7fw/sc7fw.elf atmosphere-$(AMSVER)-debug/exosphere-sc7fw.elf
|
||||||
cp exosphere/program/rebootstub/rebootstub.elf atmosphere-$(AMSVER)-debug/exosphere-rebootstub.elf
|
cp exosphere/program/rebootstub/rebootstub.elf atmosphere-$(AMSVER)-debug/exosphere-rebootstub.elf
|
||||||
cp mesosphere/kernel_ldr/kernel_ldr.elf atmosphere-$(AMSVER)-debug/kernel_ldr.elf
|
cp mesosphere/kernel_ldr/kernel_ldr.elf atmosphere-$(AMSVER)-debug/kernel_ldr.elf
|
||||||
|
cp mesosphere/kernel/kernel.elf atmosphere-$(AMSVER)-debug/kernel.elf
|
||||||
cp stratosphere/ams_mitm/ams_mitm.elf atmosphere-$(AMSVER)-debug/ams_mitm.elf
|
cp stratosphere/ams_mitm/ams_mitm.elf atmosphere-$(AMSVER)-debug/ams_mitm.elf
|
||||||
cp stratosphere/boot/boot.elf atmosphere-$(AMSVER)-debug/boot.elf
|
cp stratosphere/boot/boot.elf atmosphere-$(AMSVER)-debug/boot.elf
|
||||||
cp stratosphere/boot2/boot2.elf atmosphere-$(AMSVER)-debug/boot2.elf
|
cp stratosphere/boot2/boot2.elf atmosphere-$(AMSVER)-debug/boot2.elf
|
||||||
|
|||||||
@@ -42,6 +42,21 @@
|
|||||||
; enabled or disabled.
|
; enabled or disabled.
|
||||||
; 0 = Disabled (not debug mode), 1 = Enabled (debug mode)
|
; 0 = Disabled (not debug mode), 1 = Enabled (debug mode)
|
||||||
; enable_am_debug_mode = u8!0x0
|
; enable_am_debug_mode = u8!0x0
|
||||||
|
; Controls whether dns.mitm is enabled
|
||||||
|
; 0 = Disabled, 1 = Enabled
|
||||||
|
; enable_dns_mitm = u8!0x1
|
||||||
|
; Controls whether dns.mitm uses the default redirections in addition to
|
||||||
|
; whatever is specified in the user's hosts file.
|
||||||
|
; 0 = Disabled (use hosts file contents), 1 = Enabled (use defaults and hosts file contents)
|
||||||
|
; add_defaults_to_dns_hosts = u8!0x1
|
||||||
|
; Controls whether dns.mitm logs to the sd card for debugging
|
||||||
|
; 0 = Disabled, 1 = Enabled
|
||||||
|
; enable_dns_mitm_debug_log = u8!0x0
|
||||||
|
; Controls whether to enable uart mitm
|
||||||
|
; for logging bluetooth HCI to btsnoop captures.
|
||||||
|
; This is only implemented for [7.0.0+].
|
||||||
|
; 0 = Do not enable, 1 = Enable.
|
||||||
|
; enable_uart_mitm = u8!0x0
|
||||||
[hbloader]
|
[hbloader]
|
||||||
; Controls the size of the homebrew heap when running as applet.
|
; Controls the size of the homebrew heap when running as applet.
|
||||||
; If set to zero, all available applet memory is used as heap.
|
; If set to zero, all available applet memory is used as heap.
|
||||||
|
|||||||
@@ -1,4 +1,38 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
## 0.18.1
|
||||||
|
+ A number of minor issues were fixed, including:
|
||||||
|
+ The new `dns.mitm` module added in 0.18.0 no longer fatal errors when receiving port=nullptr.
|
||||||
|
+ This fixes youtube ad-blocking, and possibly other usecases.
|
||||||
|
+ A bug was fixed that caused ams.mitm to incorrectly cache data storages.
|
||||||
|
+ This potentially broke DLC when using romfs mods, and could have caused other issues (e.g. with custom themes, and maybe other cases).
|
||||||
|
+ A bug was fixed in power state control module registration.
|
||||||
|
+ This might fix a weird edge case with system module dependencies on sleep/wake, but probably nobody should notice any differences.
|
||||||
|
+ A bug was fixed where mesosphere sometimes treated virtual core IDs as though they were physical core IDs.
|
||||||
|
+ This had zero impact, because for Switch virtual core == physical core, but it could have affected future platforms if it had remained unresolved.
|
||||||
|
+ Several issues were fixed, and usability and stability were improved.
|
||||||
|
## 0.18.0
|
||||||
|
+ A new mitm module was added (`dns.mitm`).
|
||||||
|
+ This provides a highly configurable mechanism for redirecting DNS resolution requests.
|
||||||
|
+ By default atmosphère redirects resolution requests for official telemetry servers to a loopback address.
|
||||||
|
+ Documentation on how to configure `dns.mitm` to meet your more specific needs may be found [here](https://github.com/Atmosphere-NX/Atmosphere/blob/master/docs/features/dns_mitm.md).
|
||||||
|
+ The service framework API (`sf`) was refactored to be more accurate to official logic and greatly reduce memory requirements.
|
||||||
|
+ The comparison of atmosphère module memory usage versus Nintendo's found [here](https://github.com/Atmosphere-NX/Atmosphere/wiki/Memory-Comparisons) was updated to reflect this.
|
||||||
|
+ **Please Note**: If you are a developer using the libstratosphere service APIs, some updating may be required. Contact SciresM#0524 on discord for assistance if required.
|
||||||
|
+ A number of deprecations were removed, following a general codebase cleanup:
|
||||||
|
+ The `sm` extension to not unregister services on connection close was superseded by official opt-in logic in 11.0.0, and has been removed in favor of official logic.
|
||||||
|
+ This should have zero impact on users.
|
||||||
|
+ The temporary `hid-mitm` added in 0.9.0 has finally been removed, following over a year of deprecation.
|
||||||
|
+ There shouldn't be any homebrew in use still affected by this, but the situation will be monitored.
|
||||||
|
+ If this is somehow still a real issue, an unaffiliated hid mitm sysmodule providing the same functionality can be created and released, separate from atmosphère itself.
|
||||||
|
+ Several issues were fixed, and usability and stability were improved.
|
||||||
|
## 0.17.1
|
||||||
|
+ A number of atmosphère's modules were using more memory than their Nintendo equivalent's in 0.17.0; a number of code generatio tweaks have been applied to fix this across the board.
|
||||||
|
+ A detailed comparison of atmosphère module memory usage versus Nintendo's was made and can be found [here](https://github.com/Atmosphere-NX/Atmosphere/wiki/Memory-Comparisons).
|
||||||
|
+ Several minor bugs were fixed, including:
|
||||||
|
+ A bug was fixed in mesosphère that caused games which attempt to map more memory than the Switch has to fail.
|
||||||
|
+ This affected "Piczle Lines DX 500 More Puzzles!", and possibly other games.
|
||||||
|
+ Enabling configuration to "blank" PRODINFO no longer causes a hang on Mariko devices (or any devices with newer format).
|
||||||
|
+ Several issues were fixed, and usability and stability were improved.
|
||||||
## 0.17.0
|
## 0.17.0
|
||||||
+ fusee was heavily rewritten in order to add support for Mariko hardware.
|
+ fusee was heavily rewritten in order to add support for Mariko hardware.
|
||||||
+ **Please Note**: Mariko hardware currently has no (and may not ever have any) software exploits; fusee works when loaded from bootloader context with the right keys in the security engine. No means of getting the system into this state is provided.
|
+ **Please Note**: Mariko hardware currently has no (and may not ever have any) software exploits; fusee works when loaded from bootloader context with the right keys in the security engine. No means of getting the system into this state is provided.
|
||||||
|
|||||||
@@ -33,3 +33,19 @@ in settings as `#.#.#|AMS #.#.#|?` with `? = S` when running under system eMMC o
|
|||||||
### System Settings
|
### System Settings
|
||||||
set_mitm intercepts the `GetSettingsItemValueSize` and `GetSettingsItemValue` commands for all requesters.
|
set_mitm intercepts the `GetSettingsItemValueSize` and `GetSettingsItemValue` commands for all requesters.
|
||||||
It does so in order to enable user configuration of system settings, which are parsed from `/atmosphere/system_settings.ini` on boot. See [here](../../features/configurations.md) for more information on the system settings format.
|
It does so in order to enable user configuration of system settings, which are parsed from `/atmosphere/system_settings.ini` on boot. See [here](../../features/configurations.md) for more information on the system settings format.
|
||||||
|
|
||||||
|
## dns_mitm
|
||||||
|
dns_mitm enables intercepting requests to dns resolution services, to enable redirecting requests for specified hostnames.
|
||||||
|
|
||||||
|
For documentation, see [here](../../features/dns_mitm.md).
|
||||||
|
|
||||||
|
## uart_mitm
|
||||||
|
`uart_mitm` intercepts the uart service used by bluetooth, on 7.0.0+ when enabled by [system_settings.ini](../../features/configurations.md). This allows logging bluetooth traffic.
|
||||||
|
|
||||||
|
Usage of bluetooth devices will be less responsive when this is enabled.
|
||||||
|
|
||||||
|
Logs are written to directory `/atmosphere/uart_logs/{PosixTime}_{TickTimestamp}_{ProgramId}`, which then contains the following:
|
||||||
|
+ `cmd_log` Text log for uart IPortSession commands, and any warning messages.
|
||||||
|
+ `btsnoop_hci.log` Bluetooth HCI log in the btsnoop format. This file is not accessible while it's the current log being used with HOS running.
|
||||||
|
|
||||||
|
4 directories are created for each system-boot. btsnoop logging is disabled for the first 3, with only the 4th enabled (enabled when a certain HCI vendor command is detected).
|
||||||
|
|||||||
53
docs/features/dns_mitm.md
Normal file
53
docs/features/dns_mitm.md
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
# DNS.mitm
|
||||||
|
As of 0.18.0, atmosphère provides a mechanism for redirecting DNS resolution requests.
|
||||||
|
|
||||||
|
By default, atmosphère redirects resolution requests for official telemetry servers, redirecting them to a loopback address.
|
||||||
|
|
||||||
|
## Hosts files
|
||||||
|
|
||||||
|
DNS.mitm can be configured through the usage of a slightly-extended `hosts` file format, which is parsed only once on system startup.
|
||||||
|
|
||||||
|
In particular, hosts files parsed by DNS.mitm have the following extensions to the usual format:
|
||||||
|
+ `*` is treated as a wildcard character, matching any collection of 0 or more characters wherever it occurs in a hostname.
|
||||||
|
+ `%` is treated as a stand-in for the value of `nsd!environment_identifier`. This is always `lp1`, on production devices.
|
||||||
|
|
||||||
|
If multiple entries in a host file match a domain, the last-defined match is used.
|
||||||
|
|
||||||
|
Please note that homebrew may trigger a hosts file re-parse by sending the extension IPC command 65000 ("AtmosphereReloadHostsFile") to a connected `sfdnsres` session.
|
||||||
|
|
||||||
|
### Hosts file selection
|
||||||
|
|
||||||
|
Atmosphère will try to read hosts from the following file paths, in order, stopping once it successfully performs a file read:
|
||||||
|
|
||||||
|
+ (emummc only) `/atmosphere/hosts/emummc_%04lx.txt`, formatted with the emummc's id number (see `emummc.ini`).
|
||||||
|
+ (emummc only) `/atmosphere/hosts/emummc.txt`.
|
||||||
|
+ (sysmmc only) `/atmosphere/hosts/sysmmc.txt`.
|
||||||
|
+ `/atmosphere/hosts/default.txt`
|
||||||
|
|
||||||
|
If `/atmosphere/hosts/default.txt` does not exist, atmosphère will create it to contain the defaults.
|
||||||
|
|
||||||
|
### Atmosphère defaults
|
||||||
|
|
||||||
|
By default, atmosphère's default redirections are parsed **in addition to** the contents of the loaded hosts file.
|
||||||
|
|
||||||
|
This is equivalent to thinking of the loaded hosts file as having the atmosphère defaults prepended to it.
|
||||||
|
|
||||||
|
This setting is considered desirable, because it minimizes the telemetry risks if a user forgets to update a custom hosts file on a system update which changes the telemetry servers.
|
||||||
|
|
||||||
|
This behavior can be opted-out from by setting `atmosphere!add_defaults_to_dns_hosts = u8!0x0` in `system_settings.ini`.
|
||||||
|
|
||||||
|
The current default redirections are:
|
||||||
|
|
||||||
|
```
|
||||||
|
# Nintendo telemetry servers
|
||||||
|
127.0.0.1 receive-%.dg.srv.nintendo.net receive-%.er.srv.nintendo.net
|
||||||
|
```
|
||||||
|
|
||||||
|
## Debugging
|
||||||
|
|
||||||
|
On startup (or on hosts file re-parse), DNS.mitm will log both what hosts file it selected and the contents of all redirections it parses to `/atmosphere/logs/dns_mitm_startup.log`.
|
||||||
|
|
||||||
|
In addition, if the user sets `atmosphere!enable_dns_mitm_debug_log = u8!0x1` in `system_settings.ini`, DNS.mitm will log all requests to GetHostByName/GetAddrInfo to `/atmosphere/logs/dns_mitm_debug.log`. All redirections will be noted when they occur.
|
||||||
|
|
||||||
|
## Opting-out of DNS.mitm entirely
|
||||||
|
If you wish to disable DNS.mitm entirely, `system_settings.ini` can be edited to set `atmosphere!enable_dns_mitm = u8!0x0`.
|
||||||
@@ -1,42 +1,32 @@
|
|||||||
# Planned Features
|
# Planned Features
|
||||||
atmosphère has a number of features that are either works-in-progress or planned. Please note that while time-estimates are given, they are loose, and things may be completed sooner or later than advertised.
|
atmosphère has a number of features that are either works-in-progress or planned. Please note that while time-estimates are given, they are loose, and things may be completed sooner or later than advertised.
|
||||||
|
|
||||||
The following descriptions were last updated on July 7th, 2020.
|
The following descriptions were last updated on January 14th, 2021
|
||||||
|
|
||||||
## ams-on-mariko
|
|
||||||
* **Description**: Atmosphere cannot run as-is on Mariko hardware. A large number of changes are needed in many components. Although secure monitor support is complete in exosphere, additional work is needed on the bootloader and stratosphere sides as well. Mariko support will also require further design thought; atmosphere's debugging design heavily relies on reboot-to-payload and (more generally) the ability to perform warmboot bootrom hax at will. This is not possible on Mariko, and will require a new design/software support for whatever solution is chosen.
|
|
||||||
* **Development Status**: Planned.
|
|
||||||
* **Estimated Time**: Summer 2020
|
|
||||||
|
|
||||||
## settings reimplementation
|
|
||||||
* **Description**: A planned reimplementation of the settings system module, and with it a removal of the settings mitm. This will greatly simplify atmosphère's boot process, and will allow much more flexible control over the various system settings.
|
|
||||||
* **Development Status**: Undergoing research/initial development by Adubbz.
|
|
||||||
* **Estimated Time**: Mid 2020
|
|
||||||
|
|
||||||
## mesosphere
|
|
||||||
* **Description**: mesosphère is a reimplementation of the Horizon operating system's Kernel. It aims to provide an open-source reference for Nintendo's code.
|
|
||||||
* **Development Status**: Under active development by SciresM.
|
|
||||||
* **Estimated Time**: Mid-to-Late 2020
|
|
||||||
|
|
||||||
## tma reimplementation
|
## tma reimplementation
|
||||||
* **Description** tma ("target manager agent") is a system module that manages communication between the Switch and a client PC. Atmosphere's implementation will allow homebrew on the switch to communicate with a connected PC to do various operations such as exchanging data or interacting with files. It will also serve as the communicator for Atmosphère's planned debugger. This will also include PC-side software for interacting with the Switch.
|
* **Description** tma ("target manager agent") is a system module that manages communication between the Switch and a client PC. Atmosphere's implementation will allow homebrew on the switch to communicate with a connected PC to do various operations such as exchanging data or interacting with files. It will also serve as the communicator for Atmosphère's planned debugger. This will also include PC-side software for interacting with the Switch.
|
||||||
* **Development Status**: Planned. Switch-side code is fully implemented but needs heavy refactoring/rebasing, as the code was originally authored in 2018.
|
* **Development Status**: Planned. Switch-side code is fully implemented but needs heavy refactoring/rebasing, as the code was originally authored in 2018.
|
||||||
* **Estimated Time**: Late 2020-2021.
|
* **Estimated Time**: 2021-2022.
|
||||||
|
|
||||||
## dmnt.gen2 reimplementation
|
## dmnt.gen2 reimplementation
|
||||||
* **Description**: A reimplementation of the Switch's debug monitor, dmnt will provide an interface for debugging applications or system modules running on the Switch. This will include a gdbstub for debugging actively-running system components or applications.
|
* **Description**: A reimplementation of the Switch's debug monitor, dmnt will provide an interface for debugging applications or system modules running on the Switch. This will include a gdbstub for debugging actively-running system components or applications.
|
||||||
* **Development Status**: Planned
|
* **Development Status**: Planned
|
||||||
* **Estimated Time**: 2021
|
* **Estimated Time**: 2021-2022
|
||||||
|
|
||||||
## fs reimplementation
|
## fs reimplementation
|
||||||
* **Description**: Following mesosphère's completion, atmosphère will have reimplemented all components of the BootImagePackage firmware except for the filesystem services system module. Reimplementing fs will allow for fixing Nintendo bugs (such as corruption when using exFAT filesystems and encoding inconsistencies with UTF-8 and Shift-JIS).
|
* **Description**: Following mesosphère's completion, atmosphère will have reimplemented all components of the BootImagePackage firmware except for the filesystem services system module. Reimplementing fs will allow for fixing Nintendo bugs (such as corruption when using exFAT filesystems and encoding inconsistencies with UTF-8 and Shift-JIS).
|
||||||
* **Development Status**: Planned.
|
* **Development Status**: Planned.
|
||||||
* **Estimated Time**: 2021-2022.
|
* **Estimated Time**: 2021-2022.
|
||||||
|
|
||||||
|
## settings reimplementation
|
||||||
|
* **Description**: A planned reimplementation of the settings system module, and with it a removal of the settings mitm. This will greatly simplify atmosphère's boot process, and will allow much more flexible control over the various system settings.
|
||||||
|
* **Development Status**: Pending development by Adubbz.
|
||||||
|
* **Estimated Time**: Unclear, pending developer availability.
|
||||||
|
|
||||||
## thermosphère
|
## thermosphère
|
||||||
* **Description**: A general-purpose hypervisor, thermosphère will enable the virtualization of the Switch's operating system; this is planned to enable debugging of the Switch's kernel.
|
* **Description**: A general-purpose hypervisor, thermosphère will enable the virtualization of the Switch's operating system; this is planned to enable debugging of the Switch's kernel.
|
||||||
* **Development Status**: Under semi-active development by TuxSH.
|
* **Development Status**: Pending development by TuxSH.
|
||||||
* **Estimated Time**: 2020-2021.
|
* **Estimated Time**: Unclear, pending developer availability.
|
||||||
|
|
||||||
## other planned features
|
## other planned features
|
||||||
* **Description**: General system stability improvements to enhance the user's experience.
|
* **Description**: General system stability improvements to enhance the user's experience.
|
||||||
@@ -59,4 +49,12 @@ Please note that this is not an exhaustive list of features present in atmosphè
|
|||||||
|
|
||||||
## exosphere re-write
|
## exosphere re-write
|
||||||
* **Description**: exosphère, atmosphère's reimplementation of Horizon's Secure Monitor, was the first component authored for the project in early 2018. It is written in C, and in a style very different from the rest of atmosphère's code. In addition, exosphère was written to conform to constraints that no longer apply in an environment where it is not launched from the web browser, and where using a custom firmware image to orchestrate wake-from-sleep is possible. exosphère currently uses all but 1 KB of the space available to it, putting it at risk of breaking as future firmware updates are supported. A re-write will solve these issues.
|
* **Description**: exosphère, atmosphère's reimplementation of Horizon's Secure Monitor, was the first component authored for the project in early 2018. It is written in C, and in a style very different from the rest of atmosphère's code. In addition, exosphère was written to conform to constraints that no longer apply in an environment where it is not launched from the web browser, and where using a custom firmware image to orchestrate wake-from-sleep is possible. exosphère currently uses all but 1 KB of the space available to it, putting it at risk of breaking as future firmware updates are supported. A re-write will solve these issues.
|
||||||
* **Completion Time**: June 2020
|
* **Completion Time**: June 2020
|
||||||
|
|
||||||
|
## mesosphere
|
||||||
|
* **Description**: mesosphère is a reimplementation of the Horizon operating system's Kernel. It aims to provide an open-source reference for Nintendo's code.
|
||||||
|
* **Estimated Time**: September 2020
|
||||||
|
|
||||||
|
## ams-on-mariko
|
||||||
|
* **Description**: Atmosphere cannot run as-is on Mariko hardware. A large number of changes are needed in many components. Although secure monitor support is complete in exosphere, additional work is needed on the bootloader and stratosphere sides as well. Mariko support will also require further design thought; atmosphere's debugging design heavily relies on reboot-to-payload and (more generally) the ability to perform warmboot bootrom hax at will. This is not possible on Mariko, and will require a new design/software support for whatever solution is chosen.
|
||||||
|
* **Completion Time**: January 2021
|
||||||
@@ -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 = b05ba02f044beb03b3e228a660c0c28d0b1efe0d
|
commit = bc08912dd31bb172467add8e24b4f0adac431939
|
||||||
parent = f2a6a4a6e60bfe0dea11ba3a0ff56c95a5871a6c
|
parent = 71add1add8521e0c2115ec612c514400ac7ba688
|
||||||
method = merge
|
method = merge
|
||||||
cmdver = 0.4.1
|
cmdver = 0.4.1
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export CXXWRAPS := -Wl,--wrap,__cxa_pure_virtual \
|
|||||||
-Wl,--wrap,_ZSt20__throw_length_errorPKc \
|
-Wl,--wrap,_ZSt20__throw_length_errorPKc \
|
||||||
-Wl,--wrap,_ZNSt11logic_errorC2EPKc
|
-Wl,--wrap,_ZNSt11logic_errorC2EPKc
|
||||||
|
|
||||||
export LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs $(SETTINGS) $(CXXWRAPS) -Wl,-Map,$(notdir $*.map)
|
export LDFLAGS = -specs=$(ATMOSPHERE_LIBRARIES_DIR)/libstratosphere/stratosphere.specs -specs=$(DEVKITPRO)/libnx/switch.specs $(SETTINGS) $(CXXWRAPS) -Wl,-Map,$(notdir $*.map)
|
||||||
|
|
||||||
export LIBS = -lstratosphere -lnx
|
export LIBS = -lstratosphere -lnx
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ namespace ams::kern {
|
|||||||
virtual KProcess *GetOwner() const { return nullptr; }
|
virtual KProcess *GetOwner() const { return nullptr; }
|
||||||
|
|
||||||
u32 GetReferenceCount() const {
|
u32 GetReferenceCount() const {
|
||||||
return m_ref_count;
|
return m_ref_count.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
ALWAYS_INLINE bool IsDerivedFrom(const TypeObj &rhs) const {
|
ALWAYS_INLINE bool IsDerivedFrom(const TypeObj &rhs) const {
|
||||||
|
|||||||
@@ -49,9 +49,9 @@ namespace ams::kern {
|
|||||||
|
|
||||||
constexpr KVirtualAddress GetAddress() const { return m_address; }
|
constexpr KVirtualAddress GetAddress() const { return m_address; }
|
||||||
constexpr size_t GetSize() const { return m_size; }
|
constexpr size_t GetSize() const { return m_size; }
|
||||||
constexpr size_t GetUsed() const { return m_used; }
|
constexpr size_t GetUsed() const { return m_used.load(); }
|
||||||
constexpr size_t GetPeak() const { return m_peak; }
|
constexpr size_t GetPeak() const { return m_peak.load(); }
|
||||||
constexpr size_t GetCount() const { return m_count; }
|
constexpr size_t GetCount() const { return m_count.load(); }
|
||||||
|
|
||||||
constexpr bool IsInRange(KVirtualAddress addr) const {
|
constexpr bool IsInRange(KVirtualAddress addr) const {
|
||||||
return this->GetAddress() <= addr && addr <= this->GetAddress() + this->GetSize() - 1;
|
return this->GetAddress() <= addr && addr <= this->GetAddress() + this->GetSize() - 1;
|
||||||
@@ -65,7 +65,7 @@ namespace ams::kern {
|
|||||||
|
|
||||||
/* Free blocks to memory. */
|
/* Free blocks to memory. */
|
||||||
u8 *cur = GetPointer<u8>(m_address + m_size);
|
u8 *cur = GetPointer<u8>(m_address + m_size);
|
||||||
for (size_t i = 0; i < m_count; i++) {
|
for (size_t i = 0; i < sz / sizeof(T); i++) {
|
||||||
cur -= sizeof(T);
|
cur -= sizeof(T);
|
||||||
this->GetImpl()->Free(cur);
|
this->GetImpl()->Free(cur);
|
||||||
}
|
}
|
||||||
@@ -84,13 +84,13 @@ namespace ams::kern {
|
|||||||
this->Initialize(page_allocator);
|
this->Initialize(page_allocator);
|
||||||
|
|
||||||
/* Allocate until we have the correct number of objects. */
|
/* Allocate until we have the correct number of objects. */
|
||||||
while (m_count < num_objects) {
|
while (m_count.load() < num_objects) {
|
||||||
auto *allocated = reinterpret_cast<T *>(m_page_allocator->Allocate());
|
auto *allocated = reinterpret_cast<T *>(m_page_allocator->Allocate());
|
||||||
MESOSPHERE_ABORT_UNLESS(allocated != nullptr);
|
MESOSPHERE_ABORT_UNLESS(allocated != nullptr);
|
||||||
for (size_t i = 0; i < sizeof(PageBuffer) / sizeof(T); i++) {
|
for (size_t i = 0; i < sizeof(PageBuffer) / sizeof(T); i++) {
|
||||||
this->GetImpl()->Free(allocated + i);
|
this->GetImpl()->Free(allocated + i);
|
||||||
}
|
}
|
||||||
m_count += sizeof(PageBuffer) / sizeof(T);
|
m_count.fetch_add(sizeof(PageBuffer) / sizeof(T));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ namespace ams::kern {
|
|||||||
for (size_t i = 1; i < sizeof(PageBuffer) / sizeof(T); i++) {
|
for (size_t i = 1; i < sizeof(PageBuffer) / sizeof(T); i++) {
|
||||||
this->GetImpl()->Free(allocated + i);
|
this->GetImpl()->Free(allocated + i);
|
||||||
}
|
}
|
||||||
m_count += sizeof(PageBuffer) / sizeof(T);
|
m_count.fetch_add(sizeof(PageBuffer) / sizeof(T));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -116,8 +116,8 @@ namespace ams::kern {
|
|||||||
new (allocated) T();
|
new (allocated) T();
|
||||||
|
|
||||||
/* Update our tracking. */
|
/* Update our tracking. */
|
||||||
size_t used = ++m_used;
|
size_t used = m_used.fetch_add(1) + 1;
|
||||||
size_t peak = m_peak;
|
size_t peak = m_peak.load();
|
||||||
while (peak < used) {
|
while (peak < used) {
|
||||||
if (m_peak.compare_exchange_weak(peak, used, std::memory_order_relaxed)) {
|
if (m_peak.compare_exchange_weak(peak, used, std::memory_order_relaxed)) {
|
||||||
break;
|
break;
|
||||||
@@ -130,7 +130,7 @@ namespace ams::kern {
|
|||||||
|
|
||||||
void Free(T *t) {
|
void Free(T *t) {
|
||||||
this->GetImpl()->Free(t);
|
this->GetImpl()->Free(t);
|
||||||
--m_used;
|
m_used.fetch_sub(1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -303,6 +303,7 @@ namespace ams::kern {
|
|||||||
const auto linear_id = handle_pack.Get<HandleLinearId>();
|
const auto linear_id = handle_pack.Get<HandleLinearId>();
|
||||||
const auto reserved = handle_pack.Get<HandleReserved>();
|
const auto reserved = handle_pack.Get<HandleReserved>();
|
||||||
MESOSPHERE_ASSERT(reserved == 0);
|
MESOSPHERE_ASSERT(reserved == 0);
|
||||||
|
MESOSPHERE_UNUSED(reserved);
|
||||||
|
|
||||||
/* Validate our indexing information. */
|
/* Validate our indexing information. */
|
||||||
if (raw_value == 0) {
|
if (raw_value == 0) {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ namespace ams::kern {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unlock() {
|
ALWAYS_INLINE void Unlock() {
|
||||||
MESOSPHERE_ASSERT_THIS();
|
MESOSPHERE_ASSERT_THIS();
|
||||||
|
|
||||||
const uintptr_t cur_thread = reinterpret_cast<uintptr_t>(GetCurrentThreadPointer());
|
const uintptr_t cur_thread = reinterpret_cast<uintptr_t>(GetCurrentThreadPointer());
|
||||||
@@ -65,8 +65,8 @@ namespace ams::kern {
|
|||||||
void LockSlowPath(uintptr_t owner, uintptr_t cur_thread);
|
void LockSlowPath(uintptr_t owner, uintptr_t cur_thread);
|
||||||
void UnlockSlowPath(uintptr_t cur_thread);
|
void UnlockSlowPath(uintptr_t cur_thread);
|
||||||
|
|
||||||
bool IsLocked() const { return m_tag != 0; }
|
ALWAYS_INLINE bool IsLocked() const { return m_tag.load() != 0; }
|
||||||
bool IsLockedByCurrentThread() const { return (m_tag | 0x1ul) == (reinterpret_cast<uintptr_t>(GetCurrentThreadPointer()) | 0x1ul); }
|
ALWAYS_INLINE bool IsLockedByCurrentThread() const { return (m_tag.load() | 0x1ul) == (reinterpret_cast<uintptr_t>(GetCurrentThreadPointer()) | 0x1ul); }
|
||||||
};
|
};
|
||||||
|
|
||||||
using KScopedLightLock = KScopedLock<KLightLock>;
|
using KScopedLightLock = KScopedLock<KLightLock>;
|
||||||
|
|||||||
@@ -203,54 +203,54 @@ namespace ams::kern {
|
|||||||
virtual Result Operate(PageLinkedList *page_list, KProcessAddress virt_addr, size_t num_pages, const KPageGroup &page_group, const KPageProperties properties, OperationType operation, bool reuse_ll) = 0;
|
virtual Result Operate(PageLinkedList *page_list, KProcessAddress virt_addr, size_t num_pages, const KPageGroup &page_group, const KPageProperties properties, OperationType operation, bool reuse_ll) = 0;
|
||||||
virtual void FinalizeUpdate(PageLinkedList *page_list) = 0;
|
virtual void FinalizeUpdate(PageLinkedList *page_list) = 0;
|
||||||
|
|
||||||
KPageTableImpl &GetImpl() { return m_impl; }
|
ALWAYS_INLINE KPageTableImpl &GetImpl() { return m_impl; }
|
||||||
const KPageTableImpl &GetImpl() const { return m_impl; }
|
ALWAYS_INLINE const KPageTableImpl &GetImpl() const { return m_impl; }
|
||||||
|
|
||||||
bool IsLockedByCurrentThread() const { return m_general_lock.IsLockedByCurrentThread(); }
|
ALWAYS_INLINE bool IsLockedByCurrentThread() const { return m_general_lock.IsLockedByCurrentThread(); }
|
||||||
|
|
||||||
bool IsLinearMappedPhysicalAddress(KPhysicalAddress phys_addr) {
|
ALWAYS_INLINE bool IsLinearMappedPhysicalAddress(KPhysicalAddress phys_addr) {
|
||||||
MESOSPHERE_ASSERT(this->IsLockedByCurrentThread());
|
MESOSPHERE_ASSERT(this->IsLockedByCurrentThread());
|
||||||
|
|
||||||
return KMemoryLayout::IsLinearMappedPhysicalAddress(m_cached_physical_linear_region, phys_addr);
|
return KMemoryLayout::IsLinearMappedPhysicalAddress(m_cached_physical_linear_region, phys_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsLinearMappedPhysicalAddress(KPhysicalAddress phys_addr, size_t size) {
|
ALWAYS_INLINE bool IsLinearMappedPhysicalAddress(KPhysicalAddress phys_addr, size_t size) {
|
||||||
MESOSPHERE_ASSERT(this->IsLockedByCurrentThread());
|
MESOSPHERE_ASSERT(this->IsLockedByCurrentThread());
|
||||||
|
|
||||||
return KMemoryLayout::IsLinearMappedPhysicalAddress(m_cached_physical_linear_region, phys_addr, size);
|
return KMemoryLayout::IsLinearMappedPhysicalAddress(m_cached_physical_linear_region, phys_addr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsHeapPhysicalAddress(KPhysicalAddress phys_addr) {
|
ALWAYS_INLINE bool IsHeapPhysicalAddress(KPhysicalAddress phys_addr) {
|
||||||
MESOSPHERE_ASSERT(this->IsLockedByCurrentThread());
|
MESOSPHERE_ASSERT(this->IsLockedByCurrentThread());
|
||||||
|
|
||||||
return KMemoryLayout::IsHeapPhysicalAddress(m_cached_physical_heap_region, phys_addr);
|
return KMemoryLayout::IsHeapPhysicalAddress(m_cached_physical_heap_region, phys_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsHeapPhysicalAddress(KPhysicalAddress phys_addr, size_t size) {
|
ALWAYS_INLINE bool IsHeapPhysicalAddress(KPhysicalAddress phys_addr, size_t size) {
|
||||||
MESOSPHERE_ASSERT(this->IsLockedByCurrentThread());
|
MESOSPHERE_ASSERT(this->IsLockedByCurrentThread());
|
||||||
|
|
||||||
return KMemoryLayout::IsHeapPhysicalAddress(m_cached_physical_heap_region, phys_addr, size);
|
return KMemoryLayout::IsHeapPhysicalAddress(m_cached_physical_heap_region, phys_addr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsHeapPhysicalAddressForFinalize(KPhysicalAddress phys_addr) {
|
ALWAYS_INLINE bool IsHeapPhysicalAddressForFinalize(KPhysicalAddress phys_addr) {
|
||||||
MESOSPHERE_ASSERT(!this->IsLockedByCurrentThread());
|
MESOSPHERE_ASSERT(!this->IsLockedByCurrentThread());
|
||||||
|
|
||||||
return KMemoryLayout::IsHeapPhysicalAddress(m_cached_physical_heap_region, phys_addr);
|
return KMemoryLayout::IsHeapPhysicalAddress(m_cached_physical_heap_region, phys_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsHeapVirtualAddress(KVirtualAddress virt_addr) {
|
ALWAYS_INLINE bool IsHeapVirtualAddress(KVirtualAddress virt_addr) {
|
||||||
MESOSPHERE_ASSERT(this->IsLockedByCurrentThread());
|
MESOSPHERE_ASSERT(this->IsLockedByCurrentThread());
|
||||||
|
|
||||||
return KMemoryLayout::IsHeapVirtualAddress(m_cached_virtual_heap_region, virt_addr);
|
return KMemoryLayout::IsHeapVirtualAddress(m_cached_virtual_heap_region, virt_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsHeapVirtualAddress(KVirtualAddress virt_addr, size_t size) {
|
ALWAYS_INLINE bool IsHeapVirtualAddress(KVirtualAddress virt_addr, size_t size) {
|
||||||
MESOSPHERE_ASSERT(this->IsLockedByCurrentThread());
|
MESOSPHERE_ASSERT(this->IsLockedByCurrentThread());
|
||||||
|
|
||||||
return KMemoryLayout::IsHeapVirtualAddress(m_cached_virtual_heap_region, virt_addr, size);
|
return KMemoryLayout::IsHeapVirtualAddress(m_cached_virtual_heap_region, virt_addr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContainsPages(KProcessAddress addr, size_t num_pages) const {
|
ALWAYS_INLINE bool ContainsPages(KProcessAddress addr, size_t num_pages) const {
|
||||||
return (m_address_space_start <= addr) && (num_pages <= (m_address_space_end - m_address_space_start) / PageSize) && (addr + num_pages * PageSize - 1 <= m_address_space_end - 1);
|
return (m_address_space_start <= addr) && (num_pages <= (m_address_space_end - m_address_space_start) / PageSize) && (addr + num_pages * PageSize - 1 <= m_address_space_end - 1);
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ namespace ams::kern {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void UnpinThread(s32 core_id, KThread *thread) {
|
void UnpinThread(s32 core_id, KThread *thread) {
|
||||||
|
MESOSPHERE_UNUSED(thread);
|
||||||
MESOSPHERE_ASSERT(0 <= core_id && core_id < static_cast<s32>(cpu::NumCores));
|
MESOSPHERE_ASSERT(0 <= core_id && core_id < static_cast<s32>(cpu::NumCores));
|
||||||
MESOSPHERE_ASSERT(thread != nullptr);
|
MESOSPHERE_ASSERT(thread != nullptr);
|
||||||
MESOSPHERE_ASSERT(m_pinned_threads[core_id] == thread);
|
MESOSPHERE_ASSERT(m_pinned_threads[core_id] == thread);
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace ams::kern {
|
|||||||
static_assert(ams::svc::HighestThreadPriority <= HighestCoreMigrationAllowedPriority);
|
static_assert(ams::svc::HighestThreadPriority <= HighestCoreMigrationAllowedPriority);
|
||||||
|
|
||||||
struct SchedulingState {
|
struct SchedulingState {
|
||||||
std::atomic<bool> needs_scheduling;
|
std::atomic<u8> needs_scheduling;
|
||||||
bool interrupt_task_thread_runnable;
|
bool interrupt_task_thread_runnable;
|
||||||
bool should_count_idle;
|
bool should_count_idle;
|
||||||
u64 idle_count;
|
u64 idle_count;
|
||||||
@@ -181,7 +181,7 @@ namespace ams::kern {
|
|||||||
KScopedInterruptDisable intr_disable;
|
KScopedInterruptDisable intr_disable;
|
||||||
ON_SCOPE_EXIT { GetCurrentThread().EnableDispatch(); };
|
ON_SCOPE_EXIT { GetCurrentThread().EnableDispatch(); };
|
||||||
|
|
||||||
if (m_state.needs_scheduling) {
|
if (m_state.needs_scheduling.load()) {
|
||||||
Schedule();
|
Schedule();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ namespace ams::kern {
|
|||||||
|
|
||||||
void Dump();
|
void Dump();
|
||||||
private:
|
private:
|
||||||
bool IsSignaledImpl() const;
|
ALWAYS_INLINE bool IsSignaledImpl() const;
|
||||||
void CleanupRequests();
|
void CleanupRequests();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ namespace ams::kern {
|
|||||||
}
|
}
|
||||||
|
|
||||||
constexpr void Open() {
|
constexpr void Open() {
|
||||||
const size_t ref_count = ++m_reference_count;
|
++m_reference_count;
|
||||||
MESOSPHERE_ASSERT(ref_count > 0);
|
MESOSPHERE_ASSERT(m_reference_count > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr bool Close() {
|
constexpr bool Close() {
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ namespace ams::kern {
|
|||||||
s32 m_original_physical_ideal_core_id{};
|
s32 m_original_physical_ideal_core_id{};
|
||||||
s32 m_num_core_migration_disables{};
|
s32 m_num_core_migration_disables{};
|
||||||
ThreadState m_thread_state{};
|
ThreadState m_thread_state{};
|
||||||
std::atomic<bool> m_termination_requested{};
|
std::atomic<u8> m_termination_requested{};
|
||||||
bool m_wait_cancelled{};
|
bool m_wait_cancelled{};
|
||||||
bool m_cancellable{};
|
bool m_cancellable{};
|
||||||
bool m_signaled{};
|
bool m_signaled{};
|
||||||
@@ -486,7 +486,7 @@ namespace ams::kern {
|
|||||||
MESOSPHERE_UNUSED(core_id);
|
MESOSPHERE_UNUSED(core_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
s64 GetCpuTime() const { return m_cpu_time; }
|
s64 GetCpuTime() const { return m_cpu_time.load(); }
|
||||||
|
|
||||||
s64 GetCpuTime(s32 core_id) const {
|
s64 GetCpuTime(s32 core_id) const {
|
||||||
MESOSPHERE_ABORT_UNLESS(0 <= core_id && core_id < static_cast<s32>(cpu::NumCores));
|
MESOSPHERE_ABORT_UNLESS(0 <= core_id && core_id < static_cast<s32>(cpu::NumCores));
|
||||||
@@ -530,7 +530,7 @@ namespace ams::kern {
|
|||||||
ALWAYS_INLINE void *GetKernelStackTop() const { return m_kernel_stack_top; }
|
ALWAYS_INLINE void *GetKernelStackTop() const { return m_kernel_stack_top; }
|
||||||
|
|
||||||
ALWAYS_INLINE bool IsTerminationRequested() const {
|
ALWAYS_INLINE bool IsTerminationRequested() const {
|
||||||
return m_termination_requested || this->GetRawState() == ThreadState_Terminated;
|
return m_termination_requested.load() || this->GetRawState() == ThreadState_Terminated;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t GetKernelStackUsage() const;
|
size_t GetKernelStackUsage() const;
|
||||||
|
|||||||
@@ -40,8 +40,10 @@ namespace ams::kern {
|
|||||||
MESOSPHERE_PANIC(__VA_ARGS__); \
|
MESOSPHERE_PANIC(__VA_ARGS__); \
|
||||||
} \
|
} \
|
||||||
})
|
})
|
||||||
#else
|
#elif defined(MESOSPHERE_PRESERVE_ASSERTION_EXPRESSIONS)
|
||||||
#define MESOSPHERE_ASSERT_IMPL(expr, ...) do { static_cast<void>(expr); } while (0)
|
#define MESOSPHERE_ASSERT_IMPL(expr, ...) do { static_cast<void>(expr); } while (0)
|
||||||
|
#else
|
||||||
|
#define MESOSPHERE_ASSERT_IMPL(expr, ...) static_cast<void>(0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MESOSPHERE_ASSERT(expr) MESOSPHERE_ASSERT_IMPL(expr, "Assertion failed: %s\n", #expr)
|
#define MESOSPHERE_ASSERT(expr) MESOSPHERE_ASSERT_IMPL(expr, "Assertion failed: %s\n", #expr)
|
||||||
@@ -56,8 +58,10 @@ namespace ams::kern {
|
|||||||
|
|
||||||
#ifdef MESOSPHERE_BUILD_FOR_AUDITING
|
#ifdef MESOSPHERE_BUILD_FOR_AUDITING
|
||||||
#define MESOSPHERE_AUDIT(expr) MESOSPHERE_ASSERT(expr)
|
#define MESOSPHERE_AUDIT(expr) MESOSPHERE_ASSERT(expr)
|
||||||
#else
|
#elif defined(MESOSPHERE_PRESERVE_AUDIT_EXPRESSIONS)
|
||||||
#define MESOSPHERE_AUDIT(expr) do { static_cast<void>(expr); } while (0)
|
#define MESOSPHERE_AUDIT(expr) do { static_cast<void>(expr); } while (0)
|
||||||
|
#else
|
||||||
|
#define MESOSPHERE_AUDIT(expr) static_cast<void>(0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MESOSPHERE_TODO(arg) ({ constexpr const char *__mesosphere_todo = arg; static_cast<void>(__mesosphere_todo); MESOSPHERE_PANIC("TODO (%s): %s\n", __PRETTY_FUNCTION__, __mesosphere_todo); })
|
#define MESOSPHERE_TODO(arg) ({ constexpr const char *__mesosphere_todo = arg; static_cast<void>(__mesosphere_todo); MESOSPHERE_PANIC("TODO (%s): %s\n", __PRETTY_FUNCTION__, __mesosphere_todo); })
|
||||||
|
|||||||
@@ -45,7 +45,21 @@
|
|||||||
|
|
||||||
namespace ams::kern {
|
namespace ams::kern {
|
||||||
|
|
||||||
static_assert(cpu::NumCores <= static_cast<s32>(BITSIZEOF(u64)));
|
namespace cpu {
|
||||||
static_assert(util::size(cpu::VirtualToPhysicalCoreMap) == BITSIZEOF(u64));
|
|
||||||
|
static constexpr inline size_t NumVirtualCores = BITSIZEOF(u64);
|
||||||
|
|
||||||
|
static constexpr inline u64 VirtualCoreMask = [] {
|
||||||
|
u64 mask = 0;
|
||||||
|
for (size_t i = 0; i < NumVirtualCores; ++i) {
|
||||||
|
mask |= (UINT64_C(1) << i);
|
||||||
|
}
|
||||||
|
return mask;
|
||||||
|
}();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static_assert(cpu::NumCores <= cpu::NumVirtualCores);
|
||||||
|
static_assert(util::size(cpu::VirtualToPhysicalCoreMap) == cpu::NumVirtualCores);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,12 +54,12 @@ namespace ams::kern::svc {
|
|||||||
public:
|
public:
|
||||||
using T = typename std::remove_const<typename std::remove_pointer<_T>::type>::type;
|
using T = typename std::remove_const<typename std::remove_pointer<_T>::type>::type;
|
||||||
public:
|
public:
|
||||||
static Result CopyFromUserspace(void *dst, const void *src, size_t size) {
|
static ALWAYS_INLINE Result CopyFromUserspace(void *dst, const void *src, size_t size) {
|
||||||
R_UNLESS(UserspaceAccess::CopyMemoryFromUser(dst, src, size), svc::ResultInvalidPointer());
|
R_UNLESS(UserspaceAccess::CopyMemoryFromUser(dst, src, size), svc::ResultInvalidPointer());
|
||||||
return ResultSuccess();
|
return ResultSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Result CopyToUserspace(void *dst, const void *src, size_t size) {
|
static ALWAYS_INLINE Result CopyToUserspace(void *dst, const void *src, size_t size) {
|
||||||
R_UNLESS(UserspaceAccess::CopyMemoryToUser(dst, src, size), svc::ResultInvalidPointer());
|
R_UNLESS(UserspaceAccess::CopyMemoryToUser(dst, src, size), svc::ResultInvalidPointer());
|
||||||
return ResultSuccess();
|
return ResultSuccess();
|
||||||
}
|
}
|
||||||
@@ -70,12 +70,12 @@ namespace ams::kern::svc {
|
|||||||
public:
|
public:
|
||||||
using T = typename std::remove_const<typename std::remove_pointer<_T>::type>::type;
|
using T = typename std::remove_const<typename std::remove_pointer<_T>::type>::type;
|
||||||
public:
|
public:
|
||||||
static Result CopyFromUserspace(void *dst, const void *src, size_t size) {
|
static ALWAYS_INLINE Result CopyFromUserspace(void *dst, const void *src, size_t size) {
|
||||||
R_UNLESS(UserspaceAccess::CopyMemoryFromUserAligned32Bit(dst, src, size), svc::ResultInvalidPointer());
|
R_UNLESS(UserspaceAccess::CopyMemoryFromUserAligned32Bit(dst, src, size), svc::ResultInvalidPointer());
|
||||||
return ResultSuccess();
|
return ResultSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Result CopyToUserspace(void *dst, const void *src, size_t size) {
|
static ALWAYS_INLINE Result CopyToUserspace(void *dst, const void *src, size_t size) {
|
||||||
R_UNLESS(UserspaceAccess::CopyMemoryToUserAligned32Bit(dst, src, size), svc::ResultInvalidPointer());
|
R_UNLESS(UserspaceAccess::CopyMemoryToUserAligned32Bit(dst, src, size), svc::ResultInvalidPointer());
|
||||||
return ResultSuccess();
|
return ResultSuccess();
|
||||||
}
|
}
|
||||||
@@ -86,12 +86,12 @@ namespace ams::kern::svc {
|
|||||||
public:
|
public:
|
||||||
using T = typename std::remove_const<typename std::remove_pointer<_T>::type>::type;
|
using T = typename std::remove_const<typename std::remove_pointer<_T>::type>::type;
|
||||||
public:
|
public:
|
||||||
static Result CopyFromUserspace(void *dst, const void *src, size_t size) {
|
static ALWAYS_INLINE Result CopyFromUserspace(void *dst, const void *src, size_t size) {
|
||||||
R_UNLESS(UserspaceAccess::CopyMemoryFromUserAligned64Bit(dst, src, size), svc::ResultInvalidPointer());
|
R_UNLESS(UserspaceAccess::CopyMemoryFromUserAligned64Bit(dst, src, size), svc::ResultInvalidPointer());
|
||||||
return ResultSuccess();
|
return ResultSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Result CopyToUserspace(void *dst, const void *src, size_t size) {
|
static ALWAYS_INLINE Result CopyToUserspace(void *dst, const void *src, size_t size) {
|
||||||
R_UNLESS(UserspaceAccess::CopyMemoryToUserAligned64Bit(dst, src, size), svc::ResultInvalidPointer());
|
R_UNLESS(UserspaceAccess::CopyMemoryToUserAligned64Bit(dst, src, size), svc::ResultInvalidPointer());
|
||||||
return ResultSuccess();
|
return ResultSuccess();
|
||||||
}
|
}
|
||||||
@@ -110,26 +110,26 @@ namespace ams::kern::svc {
|
|||||||
private:
|
private:
|
||||||
CT *m_ptr;
|
CT *m_ptr;
|
||||||
private:
|
private:
|
||||||
Result CopyToImpl(void *p, size_t size) const {
|
ALWAYS_INLINE Result CopyToImpl(void *p, size_t size) const {
|
||||||
return Traits::CopyFromUserspace(p, m_ptr, size);
|
return Traits::CopyFromUserspace(p, m_ptr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result CopyFromImpl(const void *p, size_t size) const {
|
ALWAYS_INLINE Result CopyFromImpl(const void *p, size_t size) const {
|
||||||
return Traits::CopyToUserspace(m_ptr, p, size);
|
return Traits::CopyToUserspace(m_ptr, p, size);
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
Result CopyTo(T *p) const { return this->CopyToImpl(p, sizeof(*p)); }
|
ALWAYS_INLINE Result CopyTo(T *p) const { return this->CopyToImpl(p, sizeof(*p)); }
|
||||||
Result CopyFrom(const T *p) const { return this->CopyFromImpl(p, sizeof(*p)); }
|
ALWAYS_INLINE Result CopyFrom(const T *p) const { return this->CopyFromImpl(p, sizeof(*p)); }
|
||||||
|
|
||||||
Result CopyArrayElementTo(T *p, size_t index) const { return Traits::CopyFromUserspace(p, m_ptr + index, sizeof(*p)); }
|
ALWAYS_INLINE Result CopyArrayElementTo(T *p, size_t index) const { return Traits::CopyFromUserspace(p, m_ptr + index, sizeof(*p)); }
|
||||||
Result CopyArrayElementFrom(const T *p, size_t index) const { return Traits::CopyToUserspace(m_ptr + index, p, sizeof(*p)); }
|
ALWAYS_INLINE Result CopyArrayElementFrom(const T *p, size_t index) const { return Traits::CopyToUserspace(m_ptr + index, p, sizeof(*p)); }
|
||||||
|
|
||||||
Result CopyArrayTo(T *arr, size_t count) const { return this->CopyToImpl(arr, sizeof(*arr) * count); }
|
ALWAYS_INLINE Result CopyArrayTo(T *arr, size_t count) const { return this->CopyToImpl(arr, sizeof(*arr) * count); }
|
||||||
Result CopyArrayFrom(const T *arr, size_t count) const { return this->CopyFromImpl(arr, sizeof(*arr) * count); }
|
ALWAYS_INLINE Result CopyArrayFrom(const T *arr, size_t count) const { return this->CopyFromImpl(arr, sizeof(*arr) * count); }
|
||||||
|
|
||||||
constexpr bool IsNull() const { return m_ptr == nullptr; }
|
constexpr ALWAYS_INLINE bool IsNull() const { return m_ptr == nullptr; }
|
||||||
|
|
||||||
constexpr CT *GetUnsafePointer() const { return m_ptr; }
|
constexpr ALWAYS_INLINE CT *GetUnsafePointer() const { return m_ptr; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
@@ -142,19 +142,19 @@ namespace ams::kern::svc {
|
|||||||
private:
|
private:
|
||||||
const char *ptr;
|
const char *ptr;
|
||||||
protected:
|
protected:
|
||||||
Result CopyStringTo(char *dst, size_t size) const {
|
ALWAYS_INLINE Result CopyStringTo(char *dst, size_t size) const {
|
||||||
static_assert(sizeof(char) == 1);
|
static_assert(sizeof(char) == 1);
|
||||||
R_UNLESS(UserspaceAccess::CopyStringFromUser(dst, this->ptr, size) > 0, svc::ResultInvalidPointer());
|
R_UNLESS(UserspaceAccess::CopyStringFromUser(dst, this->ptr, size) > 0, svc::ResultInvalidPointer());
|
||||||
return ResultSuccess();
|
return ResultSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
Result CopyArrayElementTo(char *dst, size_t index) const {
|
ALWAYS_INLINE Result CopyArrayElementTo(char *dst, size_t index) const {
|
||||||
return Traits::CopyFromUserspace(dst, this->ptr + index, sizeof(*dst));
|
return Traits::CopyFromUserspace(dst, this->ptr + index, sizeof(*dst));
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr bool IsNull() const { return this->ptr == nullptr; }
|
constexpr ALWAYS_INLINE bool IsNull() const { return this->ptr == nullptr; }
|
||||||
|
|
||||||
constexpr const char *GetUnsafePointer() const { return this->ptr; }
|
constexpr ALWAYS_INLINE const char *GetUnsafePointer() const { return this->ptr; }
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ namespace ams::kern::arch::arm64::cpu {
|
|||||||
/* Wait for a request to come in. */
|
/* Wait for a request to come in. */
|
||||||
{
|
{
|
||||||
KScopedLightLock lk(m_cv_lock);
|
KScopedLightLock lk(m_cv_lock);
|
||||||
while ((m_target_cores & (1ul << core_id)) == 0) {
|
while ((m_target_cores.load() & (1ul << core_id)) == 0) {
|
||||||
m_cv.Wait(std::addressof(m_cv_lock));
|
m_cv.Wait(std::addressof(m_cv_lock));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -120,7 +120,7 @@ namespace ams::kern::arch::arm64::cpu {
|
|||||||
/* Broadcast, if there's nothing pending. */
|
/* Broadcast, if there's nothing pending. */
|
||||||
{
|
{
|
||||||
KScopedLightLock lk(m_cv_lock);
|
KScopedLightLock lk(m_cv_lock);
|
||||||
if (m_target_cores == 0) {
|
if (m_target_cores.load() == 0) {
|
||||||
m_cv.Broadcast();
|
m_cv.Broadcast();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -163,7 +163,7 @@ namespace ams::kern::arch::arm64::cpu {
|
|||||||
if ((op == Operation::InstructionMemoryBarrier) || (Kernel::GetState() == Kernel::State::Initializing)) {
|
if ((op == Operation::InstructionMemoryBarrier) || (Kernel::GetState() == Kernel::State::Initializing)) {
|
||||||
/* Check that there's no on-going operation. */
|
/* Check that there's no on-going operation. */
|
||||||
MESOSPHERE_ABORT_UNLESS(m_operation == Operation::Idle);
|
MESOSPHERE_ABORT_UNLESS(m_operation == Operation::Idle);
|
||||||
MESOSPHERE_ABORT_UNLESS(m_target_cores == 0);
|
MESOSPHERE_ABORT_UNLESS(m_target_cores.load() == 0);
|
||||||
|
|
||||||
/* Set operation. */
|
/* Set operation. */
|
||||||
m_operation = op;
|
m_operation = op;
|
||||||
@@ -171,12 +171,13 @@ namespace ams::kern::arch::arm64::cpu {
|
|||||||
/* For certain operations, we want to send an interrupt. */
|
/* For certain operations, we want to send an interrupt. */
|
||||||
m_target_cores = other_cores_mask;
|
m_target_cores = other_cores_mask;
|
||||||
|
|
||||||
const u64 target_mask = m_target_cores;
|
const u64 target_mask = m_target_cores.load();
|
||||||
|
|
||||||
DataSynchronizationBarrier();
|
DataSynchronizationBarrier();
|
||||||
Kernel::GetInterruptManager().SendInterProcessorInterrupt(KInterruptName_CacheOperation, target_mask);
|
Kernel::GetInterruptManager().SendInterProcessorInterrupt(KInterruptName_CacheOperation, target_mask);
|
||||||
|
|
||||||
this->ProcessOperation();
|
this->ProcessOperation();
|
||||||
while (m_target_cores != 0) {
|
while (m_target_cores.load() != 0) {
|
||||||
cpu::Yield();
|
cpu::Yield();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,7 +189,7 @@ namespace ams::kern::arch::arm64::cpu {
|
|||||||
|
|
||||||
/* Check that there's no on-going operation. */
|
/* Check that there's no on-going operation. */
|
||||||
MESOSPHERE_ABORT_UNLESS(m_operation == Operation::Idle);
|
MESOSPHERE_ABORT_UNLESS(m_operation == Operation::Idle);
|
||||||
MESOSPHERE_ABORT_UNLESS(m_target_cores == 0);
|
MESOSPHERE_ABORT_UNLESS(m_target_cores.load() == 0);
|
||||||
|
|
||||||
/* Set operation. */
|
/* Set operation. */
|
||||||
m_operation = op;
|
m_operation = op;
|
||||||
@@ -198,7 +199,7 @@ namespace ams::kern::arch::arm64::cpu {
|
|||||||
|
|
||||||
/* Use the condvar. */
|
/* Use the condvar. */
|
||||||
m_cv.Broadcast();
|
m_cv.Broadcast();
|
||||||
while (m_target_cores != 0) {
|
while (m_target_cores.load() != 0) {
|
||||||
m_cv.Wait(std::addressof(m_cv_lock));
|
m_cv.Wait(std::addressof(m_cv_lock));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -208,6 +208,8 @@ namespace ams::kern::arch::arm64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Result KInterruptManager::BindHandler(KInterruptHandler *handler, s32 irq, s32 core_id, s32 priority, bool manual_clear, bool level) {
|
Result KInterruptManager::BindHandler(KInterruptHandler *handler, s32 irq, s32 core_id, s32 priority, bool manual_clear, bool level) {
|
||||||
|
MESOSPHERE_UNUSED(core_id);
|
||||||
|
|
||||||
R_UNLESS(KInterruptController::IsGlobal(irq) || KInterruptController::IsLocal(irq), svc::ResultOutOfRange());
|
R_UNLESS(KInterruptController::IsGlobal(irq) || KInterruptController::IsLocal(irq), svc::ResultOutOfRange());
|
||||||
|
|
||||||
KScopedInterruptDisable di;
|
KScopedInterruptDisable di;
|
||||||
@@ -222,6 +224,8 @@ namespace ams::kern::arch::arm64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Result KInterruptManager::UnbindHandler(s32 irq, s32 core_id) {
|
Result KInterruptManager::UnbindHandler(s32 irq, s32 core_id) {
|
||||||
|
MESOSPHERE_UNUSED(core_id);
|
||||||
|
|
||||||
R_UNLESS(KInterruptController::IsGlobal(irq) || KInterruptController::IsLocal(irq), svc::ResultOutOfRange());
|
R_UNLESS(KInterruptController::IsGlobal(irq) || KInterruptController::IsLocal(irq), svc::ResultOutOfRange());
|
||||||
|
|
||||||
KScopedInterruptDisable di;
|
KScopedInterruptDisable di;
|
||||||
@@ -244,6 +248,8 @@ namespace ams::kern::arch::arm64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Result KInterruptManager::ClearInterrupt(s32 irq, s32 core_id) {
|
Result KInterruptManager::ClearInterrupt(s32 irq, s32 core_id) {
|
||||||
|
MESOSPHERE_UNUSED(core_id);
|
||||||
|
|
||||||
R_UNLESS(KInterruptController::IsGlobal(irq) || KInterruptController::IsLocal(irq), svc::ResultOutOfRange());
|
R_UNLESS(KInterruptController::IsGlobal(irq) || KInterruptController::IsLocal(irq), svc::ResultOutOfRange());
|
||||||
|
|
||||||
KScopedInterruptDisable di;
|
KScopedInterruptDisable di;
|
||||||
|
|||||||
@@ -583,15 +583,15 @@ namespace ams::kern::board::nintendo::nx {
|
|||||||
constinit KMemoryControllerInterruptTask g_mc_interrupt_task;
|
constinit KMemoryControllerInterruptTask g_mc_interrupt_task;
|
||||||
|
|
||||||
/* Memory controller utilities. */
|
/* Memory controller utilities. */
|
||||||
void SmmuSynchronizationBarrier() {
|
ALWAYS_INLINE void SmmuSynchronizationBarrier() {
|
||||||
ReadMcRegister(MC_SMMU_CONFIG);
|
ReadMcRegister(MC_SMMU_CONFIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InvalidatePtc() {
|
ALWAYS_INLINE void InvalidatePtc() {
|
||||||
WriteMcRegister(MC_SMMU_PTC_FLUSH_0, 0);
|
WriteMcRegister(MC_SMMU_PTC_FLUSH_0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InvalidatePtc(KPhysicalAddress address) {
|
ALWAYS_INLINE void InvalidatePtc(KPhysicalAddress address) {
|
||||||
WriteMcRegister(MC_SMMU_PTC_FLUSH_1, (static_cast<u64>(GetInteger(address)) >> 32));
|
WriteMcRegister(MC_SMMU_PTC_FLUSH_1, (static_cast<u64>(GetInteger(address)) >> 32));
|
||||||
WriteMcRegister(MC_SMMU_PTC_FLUSH_0, (GetInteger(address) & 0xFFFFFFF0u) | 1u);
|
WriteMcRegister(MC_SMMU_PTC_FLUSH_0, (GetInteger(address) & 0xFFFFFFF0u) | 1u);
|
||||||
}
|
}
|
||||||
@@ -606,15 +606,15 @@ namespace ams::kern::board::nintendo::nx {
|
|||||||
return ((match_asid ? 1u : 0u) << 31) | ((asid & 0x7F) << 24) | (((address & 0xFFC00000u) >> DevicePageBits)) | (match);
|
return ((match_asid ? 1u : 0u) << 31) | ((asid & 0x7F) << 24) | (((address & 0xFFC00000u) >> DevicePageBits)) | (match);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InvalidateTlb() {
|
ALWAYS_INLINE void InvalidateTlb() {
|
||||||
return WriteMcRegister(MC_SMMU_TLB_FLUSH, EncodeTlbFlushValue(false, 0, 0, TlbFlushVaMatch_All));
|
return WriteMcRegister(MC_SMMU_TLB_FLUSH, EncodeTlbFlushValue(false, 0, 0, TlbFlushVaMatch_All));
|
||||||
}
|
}
|
||||||
|
|
||||||
void InvalidateTlb(u8 asid) {
|
ALWAYS_INLINE void InvalidateTlb(u8 asid) {
|
||||||
return WriteMcRegister(MC_SMMU_TLB_FLUSH, EncodeTlbFlushValue(true, asid, 0, TlbFlushVaMatch_All));
|
return WriteMcRegister(MC_SMMU_TLB_FLUSH, EncodeTlbFlushValue(true, asid, 0, TlbFlushVaMatch_All));
|
||||||
}
|
}
|
||||||
|
|
||||||
void InvalidateTlbSection(u8 asid, KDeviceVirtualAddress address) {
|
ALWAYS_INLINE void InvalidateTlbSection(u8 asid, KDeviceVirtualAddress address) {
|
||||||
return WriteMcRegister(MC_SMMU_TLB_FLUSH, EncodeTlbFlushValue(true, asid, address, TlbFlushVaMatch_Section));
|
return WriteMcRegister(MC_SMMU_TLB_FLUSH, EncodeTlbFlushValue(true, asid, address, TlbFlushVaMatch_Section));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1163,6 +1163,7 @@ namespace ams::kern::board::nintendo::nx {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void KDevicePageTable::UnmapImpl(KDeviceVirtualAddress address, u64 size, bool force) {
|
void KDevicePageTable::UnmapImpl(KDeviceVirtualAddress address, u64 size, bool force) {
|
||||||
|
MESOSPHERE_UNUSED(force);
|
||||||
MESOSPHERE_ASSERT((address & ~DeviceVirtualAddressMask) == 0);
|
MESOSPHERE_ASSERT((address & ~DeviceVirtualAddressMask) == 0);
|
||||||
MESOSPHERE_ASSERT(((address + size - 1) & ~DeviceVirtualAddressMask) == 0);
|
MESOSPHERE_ASSERT(((address + size - 1) & ~DeviceVirtualAddressMask) == 0);
|
||||||
|
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ namespace ams::kern::board::nintendo::nx {
|
|||||||
do {
|
do {
|
||||||
bool res = smc::ReadWriteRegister(std::addressof(value), PmcPhysicalAddress + APBDEV_PMC_PWRGATE_STATUS, 0, 0);
|
bool res = smc::ReadWriteRegister(std::addressof(value), PmcPhysicalAddress + APBDEV_PMC_PWRGATE_STATUS, 0, 0);
|
||||||
MESOSPHERE_ASSERT(res);
|
MESOSPHERE_ASSERT(res);
|
||||||
|
MESOSPHERE_UNUSED(res);
|
||||||
} while ((value & PWRGATE_STATUS_CE123_MASK) != 0);
|
} while ((value & PWRGATE_STATUS_CE123_MASK) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -314,12 +314,12 @@ namespace ams::kern::board::nintendo::nx {
|
|||||||
g_secure_applet_memory_used = false;
|
g_secure_applet_memory_used = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 GetVersionIdentifier() {
|
u32 GetVersionIdentifier() {
|
||||||
u64 value = kern::GetTargetFirmware();
|
u32 value = 0;
|
||||||
value |= static_cast<u64>(ATMOSPHERE_RELEASE_VERSION_MICRO) << 32;
|
value |= static_cast<u64>(ATMOSPHERE_RELEASE_VERSION_MICRO) << 0;
|
||||||
value |= static_cast<u64>(ATMOSPHERE_RELEASE_VERSION_MINOR) << 40;
|
value |= static_cast<u64>(ATMOSPHERE_RELEASE_VERSION_MINOR) << 8;
|
||||||
value |= static_cast<u64>(ATMOSPHERE_RELEASE_VERSION_MAJOR) << 48;
|
value |= static_cast<u64>(ATMOSPHERE_RELEASE_VERSION_MAJOR) << 16;
|
||||||
value |= static_cast<u64>('M') << 56;
|
value |= static_cast<u64>('M') << 24;
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -584,8 +584,8 @@ namespace ams::kern::board::nintendo::nx {
|
|||||||
f_ctx->module_base = KMemoryLayout::GetKernelCodeRegionExtents().GetAddress();
|
f_ctx->module_base = KMemoryLayout::GetKernelCodeRegionExtents().GetAddress();
|
||||||
|
|
||||||
/* Set afsr1. */
|
/* Set afsr1. */
|
||||||
f_ctx->afsr0 = 0;
|
f_ctx->afsr0 = GetVersionIdentifier();
|
||||||
f_ctx->afsr1 = GetVersionIdentifier();
|
f_ctx->afsr1 = static_cast<u32>(kern::GetTargetFirmware());
|
||||||
|
|
||||||
/* Set efsr/far. */
|
/* Set efsr/far. */
|
||||||
f_ctx->far = cpu::GetFarEl1();
|
f_ctx->far = cpu::GetFarEl1();
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace ams::kern {
|
|||||||
/* Most fields have already been cleared by our constructor. */
|
/* Most fields have already been cleared by our constructor. */
|
||||||
|
|
||||||
/* Initial processes may run on all cores. */
|
/* Initial processes may run on all cores. */
|
||||||
m_core_mask = (1ul << cpu::NumCores) - 1;
|
m_core_mask = cpu::VirtualCoreMask;
|
||||||
|
|
||||||
/* Initial processes may use any user priority they like. */
|
/* Initial processes may use any user priority they like. */
|
||||||
m_priority_mask = ~0xFul;
|
m_priority_mask = ~0xFul;
|
||||||
@@ -55,18 +55,17 @@ namespace ams::kern {
|
|||||||
const auto max_prio = cap.Get<CorePriority::LowestThreadPriority>();
|
const auto max_prio = cap.Get<CorePriority::LowestThreadPriority>();
|
||||||
const auto min_prio = cap.Get<CorePriority::HighestThreadPriority>();
|
const auto min_prio = cap.Get<CorePriority::HighestThreadPriority>();
|
||||||
|
|
||||||
R_UNLESS(min_core <= max_core, svc::ResultInvalidCombination());
|
R_UNLESS(min_core <= max_core, svc::ResultInvalidCombination());
|
||||||
R_UNLESS(min_prio <= max_prio, svc::ResultInvalidCombination());
|
R_UNLESS(min_prio <= max_prio, svc::ResultInvalidCombination());
|
||||||
R_UNLESS(max_core < cpu::NumCores, svc::ResultInvalidCoreId());
|
R_UNLESS(max_core < cpu::NumVirtualCores, svc::ResultInvalidCoreId());
|
||||||
|
|
||||||
MESOSPHERE_ASSERT(max_core < BITSIZEOF(u64));
|
|
||||||
MESOSPHERE_ASSERT(max_prio < BITSIZEOF(u64));
|
MESOSPHERE_ASSERT(max_prio < BITSIZEOF(u64));
|
||||||
|
|
||||||
/* Set core mask. */
|
/* Set core mask. */
|
||||||
for (auto core_id = min_core; core_id <= max_core; core_id++) {
|
for (auto core_id = min_core; core_id <= max_core; core_id++) {
|
||||||
m_core_mask |= (1ul << core_id);
|
m_core_mask |= (1ul << core_id);
|
||||||
}
|
}
|
||||||
MESOSPHERE_ASSERT((m_core_mask & ((1ul << cpu::NumCores) - 1)) == m_core_mask);
|
MESOSPHERE_ASSERT((m_core_mask & cpu::VirtualCoreMask) == m_core_mask);
|
||||||
|
|
||||||
/* Set priority mask. */
|
/* Set priority mask. */
|
||||||
for (auto prio = min_prio; prio <= max_prio; prio++) {
|
for (auto prio = min_prio; prio <= max_prio; prio++) {
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ namespace ams::kern {
|
|||||||
MESOSPHERE_ASSERT(reserved == 0);
|
MESOSPHERE_ASSERT(reserved == 0);
|
||||||
MESOSPHERE_ASSERT(linear_id != 0);
|
MESOSPHERE_ASSERT(linear_id != 0);
|
||||||
MESOSPHERE_ASSERT(index < m_table_size);
|
MESOSPHERE_ASSERT(index < m_table_size);
|
||||||
|
MESOSPHERE_UNUSED(linear_id, reserved);
|
||||||
|
|
||||||
/* Free the entry. */
|
/* Free the entry. */
|
||||||
/* NOTE: This code does not check the linear id. */
|
/* NOTE: This code does not check the linear id. */
|
||||||
@@ -143,6 +144,7 @@ namespace ams::kern {
|
|||||||
MESOSPHERE_ASSERT(reserved == 0);
|
MESOSPHERE_ASSERT(reserved == 0);
|
||||||
MESOSPHERE_ASSERT(linear_id != 0);
|
MESOSPHERE_ASSERT(linear_id != 0);
|
||||||
MESOSPHERE_ASSERT(index < m_table_size);
|
MESOSPHERE_ASSERT(index < m_table_size);
|
||||||
|
MESOSPHERE_UNUSED(reserved);
|
||||||
|
|
||||||
/* Set the entry. */
|
/* Set the entry. */
|
||||||
Entry *entry = std::addressof(m_table[index]);
|
Entry *entry = std::addressof(m_table[index]);
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ namespace ams::kern {
|
|||||||
|
|
||||||
if (owner_thread->IsSuspended()) {
|
if (owner_thread->IsSuspended()) {
|
||||||
owner_thread->ContinueIfHasKernelWaiters();
|
owner_thread->ContinueIfHasKernelWaiters();
|
||||||
KScheduler::SetSchedulerUpdateNeeded();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,6 +52,7 @@ namespace ams::kern {
|
|||||||
KThread *owner_thread = cur_thread->GetLockOwner();
|
KThread *owner_thread = cur_thread->GetLockOwner();
|
||||||
if (AMS_UNLIKELY(owner_thread)) {
|
if (AMS_UNLIKELY(owner_thread)) {
|
||||||
owner_thread->RemoveWaiter(cur_thread);
|
owner_thread->RemoveWaiter(cur_thread);
|
||||||
|
KScheduler::SetSchedulerUpdateNeeded();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,9 +16,6 @@
|
|||||||
#include <mesosphere.hpp>
|
#include <mesosphere.hpp>
|
||||||
#include <mesosphere/kern_select_page_table.hpp>
|
#include <mesosphere/kern_select_page_table.hpp>
|
||||||
|
|
||||||
#undef ALWAYS_INLINE_LAMBDA
|
|
||||||
#define ALWAYS_INLINE_LAMBDA
|
|
||||||
|
|
||||||
namespace ams::kern {
|
namespace ams::kern {
|
||||||
|
|
||||||
Result KPageTableBase::InitializeForKernel(bool is_64_bit, void *table, KVirtualAddress start, KVirtualAddress end) {
|
Result KPageTableBase::InitializeForKernel(bool is_64_bit, void *table, KVirtualAddress start, KVirtualAddress end) {
|
||||||
@@ -3288,6 +3285,7 @@ namespace ams::kern {
|
|||||||
TraversalEntry next_entry;
|
TraversalEntry next_entry;
|
||||||
bool traverse_valid = src_impl.BeginTraversal(std::addressof(next_entry), std::addressof(context), aligned_src_start);
|
bool traverse_valid = src_impl.BeginTraversal(std::addressof(next_entry), std::addressof(context), aligned_src_start);
|
||||||
MESOSPHERE_ASSERT(traverse_valid);
|
MESOSPHERE_ASSERT(traverse_valid);
|
||||||
|
MESOSPHERE_UNUSED(traverse_valid);
|
||||||
|
|
||||||
/* Prepare tracking variables. */
|
/* Prepare tracking variables. */
|
||||||
KPhysicalAddress cur_block_addr = next_entry.phys_addr;
|
KPhysicalAddress cur_block_addr = next_entry.phys_addr;
|
||||||
|
|||||||
@@ -17,6 +17,9 @@
|
|||||||
|
|
||||||
namespace ams::kern {
|
namespace ams::kern {
|
||||||
|
|
||||||
|
#pragma GCC push_options
|
||||||
|
#pragma GCC optimize ("-O3")
|
||||||
|
|
||||||
bool KScheduler::s_scheduler_update_needed;
|
bool KScheduler::s_scheduler_update_needed;
|
||||||
KScheduler::LockType KScheduler::s_scheduler_lock;
|
KScheduler::LockType KScheduler::s_scheduler_lock;
|
||||||
KSchedulerPriorityQueue KScheduler::s_priority_queue;
|
KSchedulerPriorityQueue KScheduler::s_priority_queue;
|
||||||
@@ -607,4 +610,6 @@ namespace ams::kern {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma GCC pop_options
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace ams::kern {
|
|||||||
uintptr_t m_msg_buffer_end;
|
uintptr_t m_msg_buffer_end;
|
||||||
uintptr_t m_msg_buffer_space_end;
|
uintptr_t m_msg_buffer_space_end;
|
||||||
public:
|
public:
|
||||||
static constexpr int GetEntryCount(const ipc::MessageBuffer::MessageHeader &header) {
|
static constexpr ALWAYS_INLINE int GetEntryCount(const ipc::MessageBuffer::MessageHeader &header) {
|
||||||
const auto count = header.GetReceiveListCount();
|
const auto count = header.GetReceiveListCount();
|
||||||
switch (count) {
|
switch (count) {
|
||||||
case ipc::MessageBuffer::MessageHeader::ReceiveListCountType_None:
|
case ipc::MessageBuffer::MessageHeader::ReceiveListCountType_None:
|
||||||
@@ -82,7 +82,7 @@ namespace ams::kern {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr bool IsIndex() const {
|
constexpr ALWAYS_INLINE bool IsIndex() const {
|
||||||
return m_recv_list_count > ipc::MessageBuffer::MessageHeader::ReceiveListCountType_CountOffset;
|
return m_recv_list_count > ipc::MessageBuffer::MessageHeader::ReceiveListCountType_CountOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ namespace ams::kern {
|
|||||||
m_tls_address = Null<KProcessAddress>;
|
m_tls_address = Null<KProcessAddress>;
|
||||||
|
|
||||||
const uintptr_t kern_stack_top_address = reinterpret_cast<uintptr_t>(kern_stack_top);
|
const uintptr_t kern_stack_top_address = reinterpret_cast<uintptr_t>(kern_stack_top);
|
||||||
|
MESOSPHERE_UNUSED(kern_stack_top_address);
|
||||||
|
|
||||||
/* Next, assert things based on the type. */
|
/* Next, assert things based on the type. */
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@@ -1161,7 +1162,7 @@ namespace ams::kern {
|
|||||||
/* Determine if this is the first termination request. */
|
/* Determine if this is the first termination request. */
|
||||||
const bool first_request = [&] ALWAYS_INLINE_LAMBDA () -> bool {
|
const bool first_request = [&] ALWAYS_INLINE_LAMBDA () -> bool {
|
||||||
/* Perform an atomic compare-and-swap from false to true. */
|
/* Perform an atomic compare-and-swap from false to true. */
|
||||||
bool expected = false;
|
u8 expected = false;
|
||||||
return m_termination_requested.compare_exchange_strong(expected, true);
|
return m_termination_requested.compare_exchange_strong(expected, true);
|
||||||
}();
|
}();
|
||||||
|
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ namespace ams::kern::svc {
|
|||||||
case ams::svc::InfoType_ThreadTickCount:
|
case ams::svc::InfoType_ThreadTickCount:
|
||||||
{
|
{
|
||||||
/* Verify the requested core is valid. */
|
/* Verify the requested core is valid. */
|
||||||
const bool core_valid = (info_subtype == static_cast<u64>(-1ul)) || (info_subtype < util::size(cpu::VirtualToPhysicalCoreMap));
|
const bool core_valid = (info_subtype == static_cast<u64>(-1ul)) || (info_subtype < cpu::NumVirtualCores);
|
||||||
R_UNLESS(core_valid, svc::ResultInvalidCombination());
|
R_UNLESS(core_valid, svc::ResultInvalidCombination());
|
||||||
|
|
||||||
/* Get the thread from its handle. */
|
/* Get the thread from its handle. */
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace ams::kern::svc {
|
|||||||
Result SetHeapSize(uintptr_t *out_address, size_t size) {
|
Result SetHeapSize(uintptr_t *out_address, size_t size) {
|
||||||
/* Validate size. */
|
/* Validate size. */
|
||||||
R_UNLESS(util::IsAligned(size, ams::svc::HeapSizeAlignment), svc::ResultInvalidSize());
|
R_UNLESS(util::IsAligned(size, ams::svc::HeapSizeAlignment), svc::ResultInvalidSize());
|
||||||
R_UNLESS(size < ams::kern::MainMemorySize, svc::ResultInvalidSize());
|
R_UNLESS(size < ams::kern::MainMemorySizeMax, svc::ResultInvalidSize());
|
||||||
|
|
||||||
/* Set the heap size. */
|
/* Set the heap size. */
|
||||||
KProcessAddress address;
|
KProcessAddress address;
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ namespace ams::kern::svc {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
constexpr bool IsValidCoreId(int32_t core_id) {
|
constexpr bool IsValidVirtualCoreId(int32_t core_id) {
|
||||||
return (0 <= core_id && core_id < static_cast<int32_t>(cpu::NumCores));
|
return (0 <= core_id && core_id < static_cast<int32_t>(cpu::NumVirtualCores));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExitProcess() {
|
void ExitProcess() {
|
||||||
@@ -175,9 +175,9 @@ namespace ams::kern::svc {
|
|||||||
R_UNLESS(params.code_address + code_size - 1 <= map_end - 1, svc::ResultInvalidMemoryRegion());
|
R_UNLESS(params.code_address + code_size - 1 <= map_end - 1, svc::ResultInvalidMemoryRegion());
|
||||||
|
|
||||||
/* Check that the number of pages is valid for the kernel address space. */
|
/* Check that the number of pages is valid for the kernel address space. */
|
||||||
R_UNLESS(code_num_pages < (kern::MainMemorySize / PageSize), svc::ResultOutOfMemory());
|
R_UNLESS(code_num_pages < (kern::MainMemorySizeMax / PageSize), svc::ResultOutOfMemory());
|
||||||
R_UNLESS(system_resource_num_pages < (kern::MainMemorySize / PageSize), svc::ResultOutOfMemory());
|
R_UNLESS(system_resource_num_pages < (kern::MainMemorySizeMax / PageSize), svc::ResultOutOfMemory());
|
||||||
R_UNLESS(total_pages < (kern::MainMemorySize / PageSize), svc::ResultOutOfMemory());
|
R_UNLESS(total_pages < (kern::MainMemorySizeMax / PageSize), svc::ResultOutOfMemory());
|
||||||
|
|
||||||
/* Check that optimized memory allocation is used only for applications. */
|
/* Check that optimized memory allocation is used only for applications. */
|
||||||
const bool optimize_allocs = (params.flags & ams::svc::CreateProcessFlag_OptimizeMemoryAllocation) != 0;
|
const bool optimize_allocs = (params.flags & ams::svc::CreateProcessFlag_OptimizeMemoryAllocation) != 0;
|
||||||
@@ -275,7 +275,7 @@ namespace ams::kern::svc {
|
|||||||
R_UNLESS(process.IsNotNull(), svc::ResultInvalidHandle());
|
R_UNLESS(process.IsNotNull(), svc::ResultInvalidHandle());
|
||||||
|
|
||||||
/* Validate the core id. */
|
/* Validate the core id. */
|
||||||
R_UNLESS(IsValidCoreId(core_id), svc::ResultInvalidCoreId());
|
R_UNLESS(IsValidVirtualCoreId(core_id), svc::ResultInvalidCoreId());
|
||||||
R_UNLESS(((1ul << core_id) & process->GetCoreMask()) != 0, svc::ResultInvalidCoreId());
|
R_UNLESS(((1ul << core_id) & process->GetCoreMask()) != 0, svc::ResultInvalidCoreId());
|
||||||
|
|
||||||
/* Validate the priority. */
|
/* Validate the priority. */
|
||||||
|
|||||||
@@ -99,8 +99,8 @@ namespace ams::kern::svc {
|
|||||||
|
|
||||||
Result CreateSharedMemory(ams::svc::Handle *out, size_t size, ams::svc::MemoryPermission owner_perm, ams::svc::MemoryPermission remote_perm) {
|
Result CreateSharedMemory(ams::svc::Handle *out, size_t size, ams::svc::MemoryPermission owner_perm, ams::svc::MemoryPermission remote_perm) {
|
||||||
/* Validate the size. */
|
/* Validate the size. */
|
||||||
R_UNLESS(0 < size && size < kern::MainMemorySize, svc::ResultInvalidSize());
|
R_UNLESS(0 < size && size < kern::MainMemorySizeMax, svc::ResultInvalidSize());
|
||||||
R_UNLESS(util::IsAligned(size, PageSize), svc::ResultInvalidSize());
|
R_UNLESS(util::IsAligned(size, PageSize), svc::ResultInvalidSize());
|
||||||
|
|
||||||
/* Validate the permissions. */
|
/* Validate the permissions. */
|
||||||
R_UNLESS(IsValidSharedMemoryPermission(owner_perm), svc::ResultInvalidNewMemoryPermission());
|
R_UNLESS(IsValidSharedMemoryPermission(owner_perm), svc::ResultInvalidNewMemoryPermission());
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ namespace ams::kern::svc {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
constexpr bool IsValidCoreId(int32_t core_id) {
|
constexpr bool IsValidVirtualCoreId(int32_t core_id) {
|
||||||
return (0 <= core_id && core_id < static_cast<int32_t>(cpu::NumCores));
|
return (0 <= core_id && core_id < static_cast<int32_t>(cpu::NumVirtualCores));
|
||||||
}
|
}
|
||||||
|
|
||||||
Result CreateThread(ams::svc::Handle *out, ams::svc::ThreadFunc f, uintptr_t arg, uintptr_t stack_bottom, int32_t priority, int32_t core_id) {
|
Result CreateThread(ams::svc::Handle *out, ams::svc::ThreadFunc f, uintptr_t arg, uintptr_t stack_bottom, int32_t priority, int32_t core_id) {
|
||||||
@@ -33,7 +33,7 @@ namespace ams::kern::svc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Validate arguments. */
|
/* Validate arguments. */
|
||||||
R_UNLESS(IsValidCoreId(core_id), svc::ResultInvalidCoreId());
|
R_UNLESS(IsValidVirtualCoreId(core_id), svc::ResultInvalidCoreId());
|
||||||
R_UNLESS(((1ul << core_id) & process.GetCoreMask()) != 0, svc::ResultInvalidCoreId());
|
R_UNLESS(((1ul << core_id) & process.GetCoreMask()) != 0, svc::ResultInvalidCoreId());
|
||||||
|
|
||||||
R_UNLESS(ams::svc::HighestThreadPriority <= priority && priority <= ams::svc::LowestThreadPriority, svc::ResultInvalidPriority());
|
R_UNLESS(ams::svc::HighestThreadPriority <= priority && priority <= ams::svc::LowestThreadPriority, svc::ResultInvalidPriority());
|
||||||
@@ -168,7 +168,7 @@ namespace ams::kern::svc {
|
|||||||
R_UNLESS(affinity_mask != 0, svc::ResultInvalidCombination());
|
R_UNLESS(affinity_mask != 0, svc::ResultInvalidCombination());
|
||||||
|
|
||||||
/* Validate the core id. */
|
/* Validate the core id. */
|
||||||
if (IsValidCoreId(core_id)) {
|
if (IsValidVirtualCoreId(core_id)) {
|
||||||
R_UNLESS(((1ul << core_id) & affinity_mask) != 0, svc::ResultInvalidCombination());
|
R_UNLESS(((1ul << core_id) & affinity_mask) != 0, svc::ResultInvalidCombination());
|
||||||
} else {
|
} else {
|
||||||
R_UNLESS(core_id == ams::svc::IdealCoreNoUpdate || core_id == ams::svc::IdealCoreDontCare, svc::ResultInvalidCoreId());
|
R_UNLESS(core_id == ams::svc::IdealCoreNoUpdate || core_id == ams::svc::IdealCoreDontCare, svc::ResultInvalidCoreId());
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ include $(DEVKITPRO)/libnx/switch_rules
|
|||||||
# options for code generation
|
# options for code generation
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
PRECOMPILED_HEADERS := $(CURRENT_DIRECTORY)/include/stratosphere.hpp
|
PRECOMPILED_HEADERS := $(CURRENT_DIRECTORY)/include/stratosphere.hpp
|
||||||
|
#PRECOMPILED_HEADERS :=
|
||||||
|
|
||||||
DEFINES := $(ATMOSPHERE_DEFINES) -DATMOSPHERE_IS_STRATOSPHERE -D_GNU_SOURCE
|
DEFINES := $(ATMOSPHERE_DEFINES) -DATMOSPHERE_IS_STRATOSPHERE -D_GNU_SOURCE
|
||||||
SETTINGS := $(ATMOSPHERE_SETTINGS) -O2
|
SETTINGS := $(ATMOSPHERE_SETTINGS) -O2
|
||||||
@@ -121,6 +122,9 @@ $(OFILES) : $(GCH_FILES)
|
|||||||
|
|
||||||
$(OFILES_SRC) : $(HFILES_BIN)
|
$(OFILES_SRC) : $(HFILES_BIN)
|
||||||
|
|
||||||
|
ams_environment_weak.o: CXXFLAGS += -fno-lto
|
||||||
|
pm_info_api_weak.o: CXXFLAGS += -fno-lto
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
%_bin.h %.bin.o : %.bin
|
%_bin.h %.bin.o : %.bin
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
|
|||||||
7
libraries/libstratosphere/discard-ehframe.ld
Normal file
7
libraries/libstratosphere/discard-ehframe.ld
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
/* Discard .eh_frame section */
|
||||||
|
/DISCARD/ : { *(.group .comment .note .interp)
|
||||||
|
EXCLUDE_FILE(*crtbegin.o) *(.eh_frame_hdr .eh_frame)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -61,6 +61,7 @@
|
|||||||
#include <stratosphere/ncm.hpp>
|
#include <stratosphere/ncm.hpp>
|
||||||
#include <stratosphere/nim.hpp>
|
#include <stratosphere/nim.hpp>
|
||||||
#include <stratosphere/ns.hpp>
|
#include <stratosphere/ns.hpp>
|
||||||
|
#include <stratosphere/nsd.hpp>
|
||||||
#include <stratosphere/patcher.hpp>
|
#include <stratosphere/patcher.hpp>
|
||||||
#include <stratosphere/pcv.hpp>
|
#include <stratosphere/pcv.hpp>
|
||||||
#include <stratosphere/pgl.hpp>
|
#include <stratosphere/pgl.hpp>
|
||||||
@@ -74,9 +75,11 @@
|
|||||||
#include <stratosphere/settings.hpp>
|
#include <stratosphere/settings.hpp>
|
||||||
#include <stratosphere/sf.hpp>
|
#include <stratosphere/sf.hpp>
|
||||||
#include <stratosphere/sm.hpp>
|
#include <stratosphere/sm.hpp>
|
||||||
|
#include <stratosphere/socket.hpp>
|
||||||
#include <stratosphere/spl.hpp>
|
#include <stratosphere/spl.hpp>
|
||||||
#include <stratosphere/time.hpp>
|
#include <stratosphere/time.hpp>
|
||||||
#include <stratosphere/updater.hpp>
|
#include <stratosphere/updater.hpp>
|
||||||
|
#include <stratosphere/usb.hpp>
|
||||||
#include <stratosphere/wec.hpp>
|
#include <stratosphere/wec.hpp>
|
||||||
|
|
||||||
/* Include FS last. */
|
/* Include FS last. */
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ namespace ams::emummc {
|
|||||||
/* Get whether emummc is active. */
|
/* Get whether emummc is active. */
|
||||||
bool IsActive();
|
bool IsActive();
|
||||||
|
|
||||||
|
/* Get the active emummc id. */
|
||||||
|
u32 GetActiveId();
|
||||||
|
|
||||||
/* Get Nintendo redirection path. */
|
/* Get Nintendo redirection path. */
|
||||||
const char *GetNintendoDirPath();
|
const char *GetNintendoDirPath();
|
||||||
|
|
||||||
|
|||||||
@@ -26,4 +26,7 @@ namespace ams {
|
|||||||
void InitializeForBoot();
|
void InitializeForBoot();
|
||||||
void SetInitialRebootPayload(const void *src, size_t src_size);
|
void SetInitialRebootPayload(const void *src, size_t src_size);
|
||||||
|
|
||||||
|
void *Malloc(size_t size);
|
||||||
|
void Free(void *ptr);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,10 +109,16 @@ namespace ams::impl {
|
|||||||
AMS_DEFINE_SYSTEM_THREAD(21, settings, Main);
|
AMS_DEFINE_SYSTEM_THREAD(21, settings, Main);
|
||||||
AMS_DEFINE_SYSTEM_THREAD(21, settings, IpcServer);
|
AMS_DEFINE_SYSTEM_THREAD(21, settings, IpcServer);
|
||||||
|
|
||||||
|
/* Bus. */
|
||||||
|
AMS_DEFINE_SYSTEM_THREAD(-12, uart, IpcServer);
|
||||||
|
|
||||||
/* erpt. */
|
/* erpt. */
|
||||||
AMS_DEFINE_SYSTEM_THREAD(21, erpt, Main);
|
AMS_DEFINE_SYSTEM_THREAD(21, erpt, Main);
|
||||||
AMS_DEFINE_SYSTEM_THREAD(21, erpt, IpcServer);
|
AMS_DEFINE_SYSTEM_THREAD(21, erpt, IpcServer);
|
||||||
|
|
||||||
|
/* socket. */
|
||||||
|
AMS_DEFINE_SYSTEM_THREAD(29, socket, ResolverIpcServer);
|
||||||
|
|
||||||
/* jpegdec. */
|
/* jpegdec. */
|
||||||
AMS_DEFINE_SYSTEM_THREAD(21, jpegdec, Main);
|
AMS_DEFINE_SYSTEM_THREAD(21, jpegdec, Main);
|
||||||
|
|
||||||
|
|||||||
@@ -13,15 +13,15 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <vapours.hpp>
|
#include <vapours.hpp>
|
||||||
#include <stratosphere/dd/dd_types.hpp>
|
|
||||||
|
|
||||||
namespace ams::dd {
|
namespace ams::dd {
|
||||||
|
|
||||||
using ProcessHandle = ::Handle;
|
using ProcessHandle = ::Handle;
|
||||||
|
|
||||||
|
/* TODO gcc-11: using MemoryPermission = os::MemoryPermission; using enum os::MemoryPermission; */
|
||||||
|
|
||||||
enum MemoryPermission {
|
enum MemoryPermission {
|
||||||
MemoryPermission_None = 0,
|
MemoryPermission_None = 0,
|
||||||
MemoryPermission_ReadOnly = (1u << 0),
|
MemoryPermission_ReadOnly = (1u << 0),
|
||||||
|
|||||||
@@ -17,16 +17,12 @@
|
|||||||
#include <vapours.hpp>
|
#include <vapours.hpp>
|
||||||
#include <stratosphere/erpt/erpt_types.hpp>
|
#include <stratosphere/erpt/erpt_types.hpp>
|
||||||
|
|
||||||
namespace ams::erpt::sf {
|
#define AMS_ERPT_I_ATTACHMENT_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, Open, (const erpt::AttachmentId &attachment_id), (attachment_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, Read, (ams::sf::Out<u32> out_count, const ams::sf::OutBuffer &out_buffer), (out_count, out_buffer)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 2, Result, SetFlags, (erpt::AttachmentFlagSet flags), (flags)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 3, Result, GetFlags, (ams::sf::Out<erpt::AttachmentFlagSet> out), (out)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 4, Result, Close, (), ()) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 5, Result, GetSize, (ams::sf::Out<s64> out), (out))
|
||||||
|
|
||||||
#define AMS_ERPT_I_ATTACHMENT_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::erpt::sf, IAttachment, AMS_ERPT_I_ATTACHMENT_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, Open, (const AttachmentId &attachment_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, Read, (ams::sf::Out<u32> out_count, const ams::sf::OutBuffer &out_buffer)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, SetFlags, (AttachmentFlagSet flags)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 3, Result, GetFlags, (ams::sf::Out<AttachmentFlagSet> out)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 4, Result, Close, ()) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 5, Result, GetSize, (ams::sf::Out<s64> out))
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IAttachment, AMS_ERPT_I_ATTACHMENT_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -20,24 +20,20 @@
|
|||||||
#include <stratosphere/erpt/erpt_multiple_category_context.hpp>
|
#include <stratosphere/erpt/erpt_multiple_category_context.hpp>
|
||||||
#include <stratosphere/time/time_steady_clock_time_point.hpp>
|
#include <stratosphere/time/time_steady_clock_time_point.hpp>
|
||||||
|
|
||||||
namespace ams::erpt::sf {
|
#define AMS_ERPT_I_CONTEXT_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, SubmitContext, (const ams::sf::InBuffer &ctx_buffer, const ams::sf::InBuffer &str_buffer), (ctx_buffer, str_buffer)) \
|
||||||
#define AMS_ERPT_I_CONTEXT_INTERFACE_INFO(C, H) \
|
AMS_SF_METHOD_INFO(C, H, 1, Result, CreateReportV0, (erpt::ReportType report_type, const ams::sf::InBuffer &ctx_buffer, const ams::sf::InBuffer &str_buffer, const ams::sf::InBuffer &meta_buffer), (report_type, ctx_buffer, str_buffer, meta_buffer)) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, SubmitContext, (const ams::sf::InBuffer &ctx_buffer, const ams::sf::InBuffer &str_buffer)) \
|
AMS_SF_METHOD_INFO(C, H, 2, Result, SetInitialLaunchSettingsCompletionTime, (const time::SteadyClockTimePoint &time_point), (time_point), hos::Version_3_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, CreateReportV0, (ReportType report_type, const ams::sf::InBuffer &ctx_buffer, const ams::sf::InBuffer &str_buffer, const ams::sf::InBuffer &meta_buffer)) \
|
AMS_SF_METHOD_INFO(C, H, 3, Result, ClearInitialLaunchSettingsCompletionTime, (), (), hos::Version_3_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, SetInitialLaunchSettingsCompletionTime, (const time::SteadyClockTimePoint &time_point), hos::Version_3_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 4, Result, UpdatePowerOnTime, (), (), hos::Version_3_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 3, Result, ClearInitialLaunchSettingsCompletionTime, (), hos::Version_3_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 5, Result, UpdateAwakeTime, (), (), hos::Version_3_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 4, Result, UpdatePowerOnTime, (), hos::Version_3_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 6, Result, SubmitMultipleCategoryContext, (const erpt::MultipleCategoryContextEntry &ctx_entry, const ams::sf::InBuffer &str_buffer), (ctx_entry, str_buffer), hos::Version_5_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 5, Result, UpdateAwakeTime, (), hos::Version_3_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 7, Result, UpdateApplicationLaunchTime, (), (), hos::Version_6_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 6, Result, SubmitMultipleCategoryContext, (const MultipleCategoryContextEntry &ctx_entry, const ams::sf::InBuffer &str_buffer), hos::Version_5_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 8, Result, ClearApplicationLaunchTime, (), (), hos::Version_6_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 7, Result, UpdateApplicationLaunchTime, (), hos::Version_6_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 9, Result, SubmitAttachment, (ams::sf::Out<erpt::AttachmentId> out, const ams::sf::InBuffer &attachment_name, const ams::sf::InBuffer &attachment_data), (out, attachment_name, attachment_data), hos::Version_8_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 8, Result, ClearApplicationLaunchTime, (), hos::Version_6_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 10, Result, CreateReportWithAttachmentsDeprecated, (erpt::ReportType report_type, const ams::sf::InBuffer &ctx_buffer, const ams::sf::InBuffer &str_buffer, const ams::sf::InBuffer &attachment_ids_buffer), (report_type, ctx_buffer, str_buffer, attachment_ids_buffer), hos::Version_8_0_0, hos::Version_10_2_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 9, Result, SubmitAttachment, (ams::sf::Out<AttachmentId> out, const ams::sf::InBuffer &attachment_name, const ams::sf::InBuffer &attachment_data), hos::Version_8_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 10, Result, CreateReportWithAttachments, (erpt::ReportType report_type, const ams::sf::InBuffer &ctx_buffer, const ams::sf::InBuffer &str_buffer, const ams::sf::InBuffer &attachment_ids_buffer, Result result), (report_type, ctx_buffer, str_buffer, attachment_ids_buffer, result), hos::Version_11_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 10, Result, CreateReportWithAttachmentsDeprecated, (ReportType report_type, const ams::sf::InBuffer &ctx_buffer, const ams::sf::InBuffer &str_buffer, const ams::sf::InBuffer &attachment_ids_buffer), hos::Version_8_0_0, hos::Version_10_2_0) \
|
AMS_SF_METHOD_INFO(C, H, 11, Result, CreateReport, (erpt::ReportType report_type, const ams::sf::InBuffer &ctx_buffer, const ams::sf::InBuffer &str_buffer, const ams::sf::InBuffer &meta_buffer, Result result), (report_type, ctx_buffer, str_buffer, meta_buffer, result), hos::Version_11_0_0)
|
||||||
AMS_SF_METHOD_INFO(C, H, 10, Result, CreateReportWithAttachments, (ReportType report_type, const ams::sf::InBuffer &ctx_buffer, const ams::sf::InBuffer &str_buffer, const ams::sf::InBuffer &attachment_ids_buffer, Result result), hos::Version_11_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 11, Result, CreateReport, (ReportType report_type, const ams::sf::InBuffer &ctx_buffer, const ams::sf::InBuffer &str_buffer, const ams::sf::InBuffer &meta_buffer, Result result), hos::Version_11_0_0)
|
|
||||||
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IContext, AMS_ERPT_I_CONTEXT_INTERFACE_INFO)
|
AMS_SF_DEFINE_INTERFACE(ams::erpt::sf, IContext, AMS_ERPT_I_CONTEXT_INTERFACE_INFO)
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -17,17 +17,13 @@
|
|||||||
#include <vapours.hpp>
|
#include <vapours.hpp>
|
||||||
#include <stratosphere/erpt/erpt_types.hpp>
|
#include <stratosphere/erpt/erpt_types.hpp>
|
||||||
|
|
||||||
namespace ams::erpt::sf {
|
#define AMS_ERPT_I_MANAGER_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, GetReportList, (const ams::sf::OutBuffer &out_list, erpt::ReportType type_filter), (out_list, type_filter)) \
|
||||||
#define AMS_ERPT_I_MANAGER_INTERFACE_INFO(C, H) \
|
AMS_SF_METHOD_INFO(C, H, 1, Result, GetEvent, (ams::sf::OutCopyHandle out), (out)) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, GetReportList, (const ams::sf::OutBuffer &out_list, ReportType type_filter)) \
|
AMS_SF_METHOD_INFO(C, H, 2, Result, CleanupReports, (), (), hos::Version_4_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, GetEvent, (ams::sf::OutCopyHandle out)) \
|
AMS_SF_METHOD_INFO(C, H, 3, Result, DeleteReport, (const erpt::ReportId &report_id), (report_id), hos::Version_5_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, CleanupReports, (), hos::Version_4_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 4, Result, GetStorageUsageStatistics, (ams::sf::Out<erpt::StorageUsageStatistics> out), (out), hos::Version_5_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 3, Result, DeleteReport, (const ReportId &report_id), hos::Version_5_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 5, Result, GetAttachmentList, (const ams::sf::OutBuffer &out_buf, const erpt::ReportId &report_id), (out_buf, report_id), hos::Version_8_0_0)
|
||||||
AMS_SF_METHOD_INFO(C, H, 4, Result, GetStorageUsageStatistics, (ams::sf::Out<StorageUsageStatistics> out), hos::Version_5_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 5, Result, GetAttachmentList, (const ams::sf::OutBuffer &out_buf, const ReportId &report_id), hos::Version_8_0_0)
|
|
||||||
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IManager, AMS_ERPT_I_MANAGER_INTERFACE_INFO)
|
AMS_SF_DEFINE_INTERFACE(ams::erpt::sf, IManager, AMS_ERPT_I_MANAGER_INTERFACE_INFO)
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -17,17 +17,12 @@
|
|||||||
#include <vapours.hpp>
|
#include <vapours.hpp>
|
||||||
#include <stratosphere/erpt/erpt_types.hpp>
|
#include <stratosphere/erpt/erpt_types.hpp>
|
||||||
|
|
||||||
namespace ams::erpt::sf {
|
#define AMS_ERPT_I_REPORT_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, Open, (const erpt::ReportId &report_id), (report_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, Read, (ams::sf::Out<u32> out_count, const ams::sf::OutBuffer &out_buffer), (out_count, out_buffer)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 2, Result, SetFlags, (erpt::ReportFlagSet flags), (flags)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 3, Result, GetFlags, (ams::sf::Out<erpt::ReportFlagSet> out), (out)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 4, Result, Close, (), ()) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 5, Result, GetSize, (ams::sf::Out<s64> out), (out))
|
||||||
|
|
||||||
#define AMS_ERPT_I_REPORT_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::erpt::sf, IReport, AMS_ERPT_I_REPORT_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, Open, (const ReportId &report_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, Read, (ams::sf::Out<u32> out_count, const ams::sf::OutBuffer &out_buffer)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, SetFlags, (ReportFlagSet flags)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 3, Result, GetFlags, (ams::sf::Out<ReportFlagSet> out)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 4, Result, Close, ()) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 5, Result, GetSize, (ams::sf::Out<s64> out))
|
|
||||||
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IReport, AMS_ERPT_I_REPORT_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -20,13 +20,9 @@
|
|||||||
#include <stratosphere/erpt/sf/erpt_sf_i_manager.hpp>
|
#include <stratosphere/erpt/sf/erpt_sf_i_manager.hpp>
|
||||||
#include <stratosphere/erpt/sf/erpt_sf_i_attachment.hpp>
|
#include <stratosphere/erpt/sf/erpt_sf_i_attachment.hpp>
|
||||||
|
|
||||||
namespace ams::erpt::sf {
|
#define AMS_ERPT_I_SESSION_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, OpenReport, (ams::sf::Out<ams::sf::SharedPointer<erpt::sf::IReport>> out), (out)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, OpenManager, (ams::sf::Out<ams::sf::SharedPointer<erpt::sf::IManager>> out), (out)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 2, Result, OpenAttachment, (ams::sf::Out<ams::sf::SharedPointer<erpt::sf::IAttachment>> out), (out), hos::Version_8_0_0)
|
||||||
|
|
||||||
#define AMS_ERPT_I_SESSION_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::erpt::sf, ISession, AMS_ERPT_I_SESSION_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, OpenReport, (ams::sf::Out<std::shared_ptr<erpt::sf::IReport>> out)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, OpenManager, (ams::sf::Out<std::shared_ptr<erpt::sf::IManager>> out)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, OpenAttachment, (ams::sf::Out<std::shared_ptr<erpt::sf::IAttachment>> out), hos::Version_8_0_0)
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(ISession, AMS_ERPT_I_SESSION_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -19,11 +19,7 @@
|
|||||||
#include <stratosphere/fatal/fatal_types.hpp>
|
#include <stratosphere/fatal/fatal_types.hpp>
|
||||||
#include <stratosphere/sf.hpp>
|
#include <stratosphere/sf.hpp>
|
||||||
|
|
||||||
namespace ams::fatal::impl {
|
#define AMS_FATAL_I_PRIVATE_SERVICE_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, GetFatalEvent, (sf::OutCopyHandle out_h), (out_h))
|
||||||
|
|
||||||
#define AMS_FATAL_I_PRIVATE_SERVICE_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::fatal::impl, IPrivateService, AMS_FATAL_I_PRIVATE_SERVICE_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, GetFatalEvent, (sf::OutCopyHandle out_h))
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IPrivateService, AMS_FATAL_I_PRIVATE_SERVICE_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -19,13 +19,9 @@
|
|||||||
#include <stratosphere/fatal/fatal_types.hpp>
|
#include <stratosphere/fatal/fatal_types.hpp>
|
||||||
#include <stratosphere/sf.hpp>
|
#include <stratosphere/sf.hpp>
|
||||||
|
|
||||||
namespace ams::fatal::impl {
|
#define AMS_FATAL_I_SERVICE_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, ThrowFatal, (Result error, const sf::ClientProcessId &client_pid), (error, client_pid)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, ThrowFatalWithPolicy, (Result error, const sf::ClientProcessId &client_pid, FatalPolicy policy), (error, client_pid, policy)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 2, Result, ThrowFatalWithCpuContext, (Result error, const sf::ClientProcessId &client_pid, FatalPolicy policy, const fatal::CpuContext &cpu_ctx), (error, client_pid, policy, cpu_ctx))
|
||||||
|
|
||||||
#define AMS_FATAL_I_SERVICE_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::fatal::impl, IService, AMS_FATAL_I_SERVICE_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, ThrowFatal, (Result error, const sf::ClientProcessId &client_pid)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, ThrowFatalWithPolicy, (Result error, const sf::ClientProcessId &client_pid, FatalPolicy policy)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, ThrowFatalWithCpuContext, (Result error, const sf::ClientProcessId &client_pid, FatalPolicy policy, const CpuContext &cpu_ctx))
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IService, AMS_FATAL_I_SERVICE_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ namespace ams::fs {
|
|||||||
/* Format the path. */
|
/* Format the path. */
|
||||||
std::va_list va_list;
|
std::va_list va_list;
|
||||||
va_start(va_list, format);
|
va_start(va_list, format);
|
||||||
const size_t len = std::vsnprintf(dst->str, sizeof(dst->str), format, va_list);
|
const size_t len = util::VSNPrintf(dst->str, sizeof(dst->str), format, va_list);
|
||||||
va_end(va_list);
|
va_end(va_list);
|
||||||
|
|
||||||
/* Validate length. */
|
/* Validate length. */
|
||||||
|
|||||||
@@ -37,14 +37,14 @@ namespace ams::fssrv::impl {
|
|||||||
|
|
||||||
class FileSystemInterfaceAdapter;
|
class FileSystemInterfaceAdapter;
|
||||||
|
|
||||||
class FileInterfaceAdapter final {
|
class FileInterfaceAdapter {
|
||||||
NON_COPYABLE(FileInterfaceAdapter);
|
NON_COPYABLE(FileInterfaceAdapter);
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<FileSystemInterfaceAdapter> parent_filesystem;
|
ams::sf::SharedPointer<FileSystemInterfaceAdapter> parent_filesystem;
|
||||||
std::unique_ptr<fs::fsa::IFile> base_file;
|
std::unique_ptr<fs::fsa::IFile> base_file;
|
||||||
std::unique_lock<fssystem::SemaphoreAdapter> open_count_semaphore;
|
util::unique_lock<fssystem::SemaphoreAdapter> open_count_semaphore;
|
||||||
public:
|
public:
|
||||||
FileInterfaceAdapter(std::unique_ptr<fs::fsa::IFile> &&file, std::shared_ptr<FileSystemInterfaceAdapter> &&parent, std::unique_lock<fssystem::SemaphoreAdapter> &&sema);
|
FileInterfaceAdapter(std::unique_ptr<fs::fsa::IFile> &&file, FileSystemInterfaceAdapter *parent, util::unique_lock<fssystem::SemaphoreAdapter> &&sema);
|
||||||
~FileInterfaceAdapter();
|
~FileInterfaceAdapter();
|
||||||
private:
|
private:
|
||||||
void InvalidateCache();
|
void InvalidateCache();
|
||||||
@@ -59,14 +59,14 @@ namespace ams::fssrv::impl {
|
|||||||
};
|
};
|
||||||
static_assert(fssrv::sf::IsIFile<FileInterfaceAdapter>);
|
static_assert(fssrv::sf::IsIFile<FileInterfaceAdapter>);
|
||||||
|
|
||||||
class DirectoryInterfaceAdapter final {
|
class DirectoryInterfaceAdapter {
|
||||||
NON_COPYABLE(DirectoryInterfaceAdapter);
|
NON_COPYABLE(DirectoryInterfaceAdapter);
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<FileSystemInterfaceAdapter> parent_filesystem;
|
ams::sf::SharedPointer<FileSystemInterfaceAdapter> parent_filesystem;
|
||||||
std::unique_ptr<fs::fsa::IDirectory> base_dir;
|
std::unique_ptr<fs::fsa::IDirectory> base_dir;
|
||||||
std::unique_lock<fssystem::SemaphoreAdapter> open_count_semaphore;
|
util::unique_lock<fssystem::SemaphoreAdapter> open_count_semaphore;
|
||||||
public:
|
public:
|
||||||
DirectoryInterfaceAdapter(std::unique_ptr<fs::fsa::IDirectory> &&dir, std::shared_ptr<FileSystemInterfaceAdapter> &&parent, std::unique_lock<fssystem::SemaphoreAdapter> &&sema);
|
DirectoryInterfaceAdapter(std::unique_ptr<fs::fsa::IDirectory> &&dir, FileSystemInterfaceAdapter *parent, util::unique_lock<fssystem::SemaphoreAdapter> &&sema);
|
||||||
~DirectoryInterfaceAdapter();
|
~DirectoryInterfaceAdapter();
|
||||||
public:
|
public:
|
||||||
/* Command API */
|
/* Command API */
|
||||||
@@ -75,11 +75,11 @@ namespace ams::fssrv::impl {
|
|||||||
};
|
};
|
||||||
static_assert(fssrv::sf::IsIDirectory<DirectoryInterfaceAdapter>);
|
static_assert(fssrv::sf::IsIDirectory<DirectoryInterfaceAdapter>);
|
||||||
|
|
||||||
class FileSystemInterfaceAdapter final : public std::enable_shared_from_this<FileSystemInterfaceAdapter> {
|
class FileSystemInterfaceAdapter : public ams::sf::ISharedObject {
|
||||||
NON_COPYABLE(FileSystemInterfaceAdapter);
|
NON_COPYABLE(FileSystemInterfaceAdapter);
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<fs::fsa::IFileSystem> base_fs;
|
std::shared_ptr<fs::fsa::IFileSystem> base_fs;
|
||||||
std::unique_lock<fssystem::SemaphoreAdapter> mount_count_semaphore;
|
util::unique_lock<fssystem::SemaphoreAdapter> mount_count_semaphore;
|
||||||
os::ReadWriteLock invalidation_lock;
|
os::ReadWriteLock invalidation_lock;
|
||||||
bool open_count_limited;
|
bool open_count_limited;
|
||||||
bool deep_retry_enabled = false;
|
bool deep_retry_enabled = false;
|
||||||
@@ -103,8 +103,8 @@ namespace ams::fssrv::impl {
|
|||||||
Result RenameFile(const fssrv::sf::Path &old_path, const fssrv::sf::Path &new_path);
|
Result RenameFile(const fssrv::sf::Path &old_path, const fssrv::sf::Path &new_path);
|
||||||
Result RenameDirectory(const fssrv::sf::Path &old_path, const fssrv::sf::Path &new_path);
|
Result RenameDirectory(const fssrv::sf::Path &old_path, const fssrv::sf::Path &new_path);
|
||||||
Result GetEntryType(ams::sf::Out<u32> out, const fssrv::sf::Path &path);
|
Result GetEntryType(ams::sf::Out<u32> out, const fssrv::sf::Path &path);
|
||||||
Result OpenFile(ams::sf::Out<std::shared_ptr<fssrv::sf::IFile>> out, const fssrv::sf::Path &path, u32 mode);
|
Result OpenFile(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFile>> out, const fssrv::sf::Path &path, u32 mode);
|
||||||
Result OpenDirectory(ams::sf::Out<std::shared_ptr<fssrv::sf::IDirectory>> out, const fssrv::sf::Path &path, u32 mode);
|
Result OpenDirectory(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IDirectory>> out, const fssrv::sf::Path &path, u32 mode);
|
||||||
Result Commit();
|
Result Commit();
|
||||||
Result GetFreeSpaceSize(ams::sf::Out<s64> out, const fssrv::sf::Path &path);
|
Result GetFreeSpaceSize(ams::sf::Out<s64> out, const fssrv::sf::Path &path);
|
||||||
Result GetTotalSpaceSize(ams::sf::Out<s64> out, const fssrv::sf::Path &path);
|
Result GetTotalSpaceSize(ams::sf::Out<s64> out, const fssrv::sf::Path &path);
|
||||||
|
|||||||
@@ -27,19 +27,19 @@ namespace ams::fs {
|
|||||||
|
|
||||||
namespace ams::fssrv::impl {
|
namespace ams::fssrv::impl {
|
||||||
|
|
||||||
class StorageInterfaceAdapter final {
|
class StorageInterfaceAdapter {
|
||||||
NON_COPYABLE(StorageInterfaceAdapter);
|
NON_COPYABLE(StorageInterfaceAdapter);
|
||||||
private:
|
private:
|
||||||
/* TODO: Nintendo uses fssystem::AsynchronousAccessStorage here. */
|
/* TODO: Nintendo uses fssystem::AsynchronousAccessStorage here. */
|
||||||
std::shared_ptr<fs::IStorage> base_storage;
|
std::shared_ptr<fs::IStorage> base_storage;
|
||||||
std::unique_lock<fssystem::SemaphoreAdapter> open_count_semaphore;
|
util::unique_lock<fssystem::SemaphoreAdapter> open_count_semaphore;
|
||||||
os::ReadWriteLock invalidation_lock;
|
os::ReadWriteLock invalidation_lock;
|
||||||
/* TODO: DataStorageContext. */
|
/* TODO: DataStorageContext. */
|
||||||
bool deep_retry_enabled = false;
|
bool deep_retry_enabled = false;
|
||||||
public:
|
public:
|
||||||
StorageInterfaceAdapter(fs::IStorage *storage);
|
StorageInterfaceAdapter(fs::IStorage *storage);
|
||||||
StorageInterfaceAdapter(std::unique_ptr<fs::IStorage> storage);
|
StorageInterfaceAdapter(std::unique_ptr<fs::IStorage> storage);
|
||||||
explicit StorageInterfaceAdapter(std::shared_ptr<fs::IStorage> &&storage);
|
explicit StorageInterfaceAdapter(std::shared_ptr<fs::IStorage> storage);
|
||||||
/* TODO: Other constructors. */
|
/* TODO: Other constructors. */
|
||||||
|
|
||||||
~StorageInterfaceAdapter();
|
~StorageInterfaceAdapter();
|
||||||
|
|||||||
@@ -18,12 +18,8 @@
|
|||||||
#include <stratosphere/sf.hpp>
|
#include <stratosphere/sf.hpp>
|
||||||
#include <stratosphere/fs/fs_directory.hpp>
|
#include <stratosphere/fs/fs_directory.hpp>
|
||||||
|
|
||||||
namespace ams::fssrv::sf {
|
#define AMS_FSSRV_I_DIRECTORY_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, Read, (ams::sf::Out<s64> out, const ams::sf::OutBuffer &out_entries), (out, out_entries)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, GetEntryCount, (ams::sf::Out<s64> out), (out))
|
||||||
|
|
||||||
#define AMS_FSSRV_I_DIRECTORY_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::fssrv::sf, IDirectory, AMS_FSSRV_I_DIRECTORY_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, Read, (ams::sf::Out<s64> out, const ams::sf::OutBuffer &out_entries)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, GetEntryCount, (ams::sf::Out<s64> out))
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IDirectory, AMS_FSSRV_I_DIRECTORY_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -19,16 +19,12 @@
|
|||||||
#include <stratosphere/fs/fs_file.hpp>
|
#include <stratosphere/fs/fs_file.hpp>
|
||||||
#include <stratosphere/fs/fs_query_range.hpp>
|
#include <stratosphere/fs/fs_query_range.hpp>
|
||||||
|
|
||||||
namespace ams::fssrv::sf {
|
#define AMS_FSSRV_I_FILE_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, Read, (ams::sf::Out<s64> out, s64 offset, const ams::sf::OutNonSecureBuffer &buffer, s64 size, ams::fs::ReadOption option), (out, offset, buffer, size, option)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, Write, (s64 offset, const ams::sf::InNonSecureBuffer &buffer, s64 size, ams::fs::WriteOption option), (offset, buffer, size, option)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 2, Result, Flush, (), ()) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 3, Result, SetSize, (s64 size), (size)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 4, Result, GetSize, (ams::sf::Out<s64> out), (out)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 5, Result, OperateRange, (ams::sf::Out<ams::fs::FileQueryRangeInfo> out, s32 op_id, s64 offset, s64 size), (out, op_id, offset, size), hos::Version_4_0_0)
|
||||||
|
|
||||||
#define AMS_FSSRV_I_FILE_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::fssrv::sf, IFile, AMS_FSSRV_I_FILE_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, Read, (ams::sf::Out<s64> out, s64 offset, const ams::sf::OutNonSecureBuffer &buffer, s64 size, ams::fs::ReadOption option)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, Write, (s64 offset, const ams::sf::InNonSecureBuffer &buffer, s64 size, ams::fs::WriteOption option)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, Flush, ()) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 3, Result, SetSize, (s64 size)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 4, Result, GetSize, (ams::sf::Out<s64> out)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 5, Result, OperateRange, (ams::sf::Out<ams::fs::FileQueryRangeInfo> out, s32 op_id, s64 offset, s64 size), hos::Version_4_0_0) \
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IFile, AMS_FSSRV_I_FILE_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -22,26 +22,22 @@
|
|||||||
#include <stratosphere/fssrv/sf/fssrv_sf_ifile.hpp>
|
#include <stratosphere/fssrv/sf/fssrv_sf_ifile.hpp>
|
||||||
#include <stratosphere/fssrv/sf/fssrv_sf_idirectory.hpp>
|
#include <stratosphere/fssrv/sf/fssrv_sf_idirectory.hpp>
|
||||||
|
|
||||||
namespace ams::fssrv::sf {
|
#define AMS_FSSRV_I_FILESYSTEM_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, CreateFile, (const ams::fssrv::sf::Path &path, s64 size, s32 option), (path, size, option)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, DeleteFile, (const ams::fssrv::sf::Path &path), (path)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 2, Result, CreateDirectory, (const ams::fssrv::sf::Path &path), (path)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 3, Result, DeleteDirectory, (const ams::fssrv::sf::Path &path), (path)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 4, Result, DeleteDirectoryRecursively, (const ams::fssrv::sf::Path &path), (path)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 5, Result, RenameFile, (const ams::fssrv::sf::Path &old_path, const ams::fssrv::sf::Path &new_path), (old_path, new_path)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 6, Result, RenameDirectory, (const ams::fssrv::sf::Path &old_path, const ams::fssrv::sf::Path &new_path), (old_path, new_path)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 7, Result, GetEntryType, (ams::sf::Out<u32> out, const ams::fssrv::sf::Path &path), (out, path)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 8, Result, OpenFile, (ams::sf::Out<ams::sf::SharedPointer<ams::fssrv::sf::IFile>> out, const ams::fssrv::sf::Path &path, u32 mode), (out, path, mode)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 9, Result, OpenDirectory, (ams::sf::Out<ams::sf::SharedPointer<ams::fssrv::sf::IDirectory>> out, const ams::fssrv::sf::Path &path, u32 mode), (out, path, mode)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 10, Result, Commit, (), ()) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 11, Result, GetFreeSpaceSize, (ams::sf::Out<s64> out, const ams::fssrv::sf::Path &path), (out, path)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 12, Result, GetTotalSpaceSize, (ams::sf::Out<s64> out, const ams::fssrv::sf::Path &path), (out, path)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 13, Result, CleanDirectoryRecursively, (const ams::fssrv::sf::Path &path), (path), hos::Version_3_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 14, Result, GetFileTimeStampRaw, (ams::sf::Out<ams::fs::FileTimeStampRaw> out, const ams::fssrv::sf::Path &path), (out, path), hos::Version_3_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 15, Result, QueryEntry, (const ams::sf::OutBuffer &out_buf, const ams::sf::InBuffer &in_buf, s32 query_id, const ams::fssrv::sf::Path &path), (out_buf, in_buf, query_id, path), hos::Version_4_0_0)
|
||||||
|
|
||||||
#define AMS_FSSRV_I_FILESYSTEM_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::fssrv::sf, IFileSystem, AMS_FSSRV_I_FILESYSTEM_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, CreateFile, (const ams::fssrv::sf::Path &path, s64 size, s32 option)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, DeleteFile, (const ams::fssrv::sf::Path &path)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, CreateDirectory, (const ams::fssrv::sf::Path &path)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 3, Result, DeleteDirectory, (const ams::fssrv::sf::Path &path)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 4, Result, DeleteDirectoryRecursively, (const ams::fssrv::sf::Path &path)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 5, Result, RenameFile, (const ams::fssrv::sf::Path &old_path, const ams::fssrv::sf::Path &new_path)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 6, Result, RenameDirectory, (const ams::fssrv::sf::Path &old_path, const ams::fssrv::sf::Path &new_path)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 7, Result, GetEntryType, (ams::sf::Out<u32> out, const ams::fssrv::sf::Path &path)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 8, Result, OpenFile, (ams::sf::Out<std::shared_ptr<ams::fssrv::sf::IFile>> out, const ams::fssrv::sf::Path &path, u32 mode)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 9, Result, OpenDirectory, (ams::sf::Out<std::shared_ptr<ams::fssrv::sf::IDirectory>> out, const ams::fssrv::sf::Path &path, u32 mode)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 10, Result, Commit, ()) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 11, Result, GetFreeSpaceSize, (ams::sf::Out<s64> out, const ams::fssrv::sf::Path &path)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 12, Result, GetTotalSpaceSize, (ams::sf::Out<s64> out, const ams::fssrv::sf::Path &path)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 13, Result, CleanDirectoryRecursively, (const ams::fssrv::sf::Path &path), hos::Version_3_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 14, Result, GetFileTimeStampRaw, (ams::sf::Out<ams::fs::FileTimeStampRaw> out, const ams::fssrv::sf::Path &path), hos::Version_3_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 15, Result, QueryEntry, (const ams::sf::OutBuffer &out_buf, const ams::sf::InBuffer &in_buf, s32 query_id, const ams::fssrv::sf::Path &path), hos::Version_4_0_0)
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IFileSystem, AMS_FSSRV_I_FILESYSTEM_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -19,16 +19,12 @@
|
|||||||
#include <stratosphere/fs/fs_file.hpp>
|
#include <stratosphere/fs/fs_file.hpp>
|
||||||
#include <stratosphere/fs/fs_query_range.hpp>
|
#include <stratosphere/fs/fs_query_range.hpp>
|
||||||
|
|
||||||
namespace ams::fssrv::sf {
|
#define AMS_FSSRV_I_STORAGE_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, Read, (s64 offset, const ams::sf::OutNonSecureBuffer &buffer, s64 size), (offset, buffer, size)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, Write, (s64 offset, const ams::sf::InNonSecureBuffer &buffer, s64 size), (offset, buffer, size)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 2, Result, Flush, (), ()) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 3, Result, SetSize, (s64 size), (size)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 4, Result, GetSize, (ams::sf::Out<s64> out), (out)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 5, Result, OperateRange, (ams::sf::Out<ams::fs::StorageQueryRangeInfo> out, s32 op_id, s64 offset, s64 size), (out, op_id, offset, size), hos::Version_4_0_0)
|
||||||
|
|
||||||
#define AMS_FSSRV_I_STORAGE_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::fssrv::sf, IStorage, AMS_FSSRV_I_STORAGE_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, Read, (s64 offset, const ams::sf::OutNonSecureBuffer &buffer, s64 size)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, Write, (s64 offset, const ams::sf::InNonSecureBuffer &buffer, s64 size)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, Flush, ()) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 3, Result, SetSize, (s64 size)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 4, Result, GetSize, (ams::sf::Out<s64> out)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 5, Result, OperateRange, (ams::sf::Out<ams::fs::StorageQueryRangeInfo> out, s32 op_id, s64 offset, s64 size), hos::Version_4_0_0)
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IStorage, AMS_FSSRV_I_STORAGE_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -23,6 +23,6 @@ namespace ams::gpio {
|
|||||||
void Initialize();
|
void Initialize();
|
||||||
void Finalize();
|
void Finalize();
|
||||||
|
|
||||||
void InitializeWith(std::shared_ptr<gpio::sf::IManager> &&sp);
|
void InitializeWith(ams::sf::SharedPointer<gpio::sf::IManager> sp);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,6 @@
|
|||||||
|
|
||||||
namespace ams::gpio::server {
|
namespace ams::gpio::server {
|
||||||
|
|
||||||
std::shared_ptr<gpio::sf::IManager> GetServiceObject();
|
ams::sf::SharedPointer<gpio::sf::IManager> GetServiceObject();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,21 +21,17 @@
|
|||||||
#include <stratosphere/gpio/gpio_select_pad_name.hpp>
|
#include <stratosphere/gpio/gpio_select_pad_name.hpp>
|
||||||
#include <stratosphere/gpio/sf/gpio_sf_i_pad_session.hpp>
|
#include <stratosphere/gpio/sf/gpio_sf_i_pad_session.hpp>
|
||||||
|
|
||||||
namespace ams::gpio::sf {
|
#define AMS_GPIO_I_MANAGER_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, OpenSessionForDev, (ams::sf::Out<ams::sf::SharedPointer<gpio::sf::IPadSession>> out, s32 pad_descriptor), (out, pad_descriptor) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, OpenSession, (ams::sf::Out<ams::sf::SharedPointer<gpio::sf::IPadSession>> out, gpio::GpioPadName pad_name), (out, pad_name) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 2, Result, OpenSessionForTest, (ams::sf::Out<ams::sf::SharedPointer<gpio::sf::IPadSession>> out, gpio::GpioPadName pad_name), (out, pad_name) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 3, Result, IsWakeEventActive, (ams::sf::Out<bool> out, gpio::GpioPadName pad_name), (out, pad_name), hos::Version_Min, hos::Version_6_2_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 4, Result, GetWakeEventActiveFlagSet, (ams::sf::Out<gpio::WakeBitFlag> out), (out), hos::Version_Min, hos::Version_6_2_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 5, Result, SetWakeEventActiveFlagSetForDebug, (gpio::GpioPadName pad_name, bool is_enabled), (pad_name, is_enabled), hos::Version_Min, hos::Version_6_2_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 6, Result, SetWakePinDebugMode, (s32 mode), (mode) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 7, Result, OpenSession2, (ams::sf::Out<ams::sf::SharedPointer<gpio::sf::IPadSession>> out, DeviceCode device_code, ddsf::AccessMode access_mode), (out, device_code, access_mode), hos::Version_5_0_0 ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 8, Result, IsWakeEventActive2, (ams::sf::Out<bool> out, DeviceCode device_code), (out, device_code), hos::Version_5_0_0 ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 9, Result, SetWakeEventActiveFlagSetForDebug2, (DeviceCode device_code, bool is_enabled), (device_code, is_enabled), hos::Version_5_0_0 ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 10, Result, SetRetryValues, (u32 arg0, u32 arg1), (arg0, arg1), hos::Version_6_0_0 )
|
||||||
|
|
||||||
#define AMS_GPIO_I_MANAGER_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::gpio::sf, IManager, AMS_GPIO_I_MANAGER_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, OpenSessionForDev, (ams::sf::Out<std::shared_ptr<gpio::sf::IPadSession>> out, s32 pad_descriptor) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, OpenSession, (ams::sf::Out<std::shared_ptr<gpio::sf::IPadSession>> out, gpio::GpioPadName pad_name) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, OpenSessionForTest, (ams::sf::Out<std::shared_ptr<gpio::sf::IPadSession>> out, gpio::GpioPadName pad_name) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 3, Result, IsWakeEventActive, (ams::sf::Out<bool> out, gpio::GpioPadName pad_name), hos::Version_Min, hos::Version_6_2_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 4, Result, GetWakeEventActiveFlagSet, (ams::sf::Out<gpio::WakeBitFlag> out), hos::Version_Min, hos::Version_6_2_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 5, Result, SetWakeEventActiveFlagSetForDebug, (gpio::GpioPadName pad_name, bool is_enabled), hos::Version_Min, hos::Version_6_2_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 6, Result, SetWakePinDebugMode, (s32 mode) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 7, Result, OpenSession2, (ams::sf::Out<std::shared_ptr<gpio::sf::IPadSession>> out, DeviceCode device_code, ddsf::AccessMode access_mode), hos::Version_5_0_0 ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 8, Result, IsWakeEventActive2, (ams::sf::Out<bool> out, DeviceCode device_code), hos::Version_5_0_0 ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 9, Result, SetWakeEventActiveFlagSetForDebug2, (DeviceCode device_code, bool is_enabled), hos::Version_5_0_0 ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 10, Result, SetRetryValues, (u32 arg0, u32 arg1), hos::Version_6_0_0 )
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IManager, AMS_GPIO_I_MANAGER_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -18,28 +18,24 @@
|
|||||||
#include <vapours.hpp>
|
#include <vapours.hpp>
|
||||||
#include <stratosphere/gpio/gpio_types.hpp>
|
#include <stratosphere/gpio/gpio_types.hpp>
|
||||||
|
|
||||||
namespace ams::gpio::sf {
|
#define AMS_GPIO_I_PAD_SESSION_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, SetDirection, (gpio::Direction direction), (direction) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, GetDirection, (ams::sf::Out<gpio::Direction> out), (out) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 2, Result, SetInterruptMode, (gpio::InterruptMode mode), (mode) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 3, Result, GetInterruptMode, (ams::sf::Out<gpio::InterruptMode> out), (out) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 4, Result, SetInterruptEnable, (bool enable), (enable) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 5, Result, GetInterruptEnable, (ams::sf::Out<bool> out), (out) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 6, Result, GetInterruptStatus, (ams::sf::Out<gpio::InterruptStatus> out), (out) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 7, Result, ClearInterruptStatus, (), () ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 8, Result, SetValue, (gpio::GpioValue value), (value) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 9, Result, GetValue, (ams::sf::Out<gpio::GpioValue> out), (out) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 10, Result, BindInterrupt, (ams::sf::OutCopyHandle out), (out) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 11, Result, UnbindInterrupt, (), () ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 12, Result, SetDebounceEnabled, (bool enable), (enable) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 13, Result, GetDebounceEnabled, (ams::sf::Out<bool> out), (out) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 14, Result, SetDebounceTime, (s32 ms), (ms) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 15, Result, GetDebounceTime, (ams::sf::Out<s32> out), (out) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 16, Result, SetValueForSleepState, (gpio::GpioValue value), (value), hos::Version_4_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 16, Result, GetValueForSleepState, (ams::sf::Out<gpio::GpioValue> out), (out), hos::Version_6_0_0)
|
||||||
|
|
||||||
#define AMS_GPIO_I_PAD_SESSION_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::gpio::sf, IPadSession, AMS_GPIO_I_PAD_SESSION_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, SetDirection, (gpio::Direction direction) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, GetDirection, (ams::sf::Out<gpio::Direction> out) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, SetInterruptMode, (gpio::InterruptMode mode) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 3, Result, GetInterruptMode, (ams::sf::Out<gpio::InterruptMode> out) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 4, Result, SetInterruptEnable, (bool enable) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 5, Result, GetInterruptEnable, (ams::sf::Out<bool> out) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 6, Result, GetInterruptStatus, (ams::sf::Out<gpio::InterruptStatus> out) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 7, Result, ClearInterruptStatus, () ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 8, Result, SetValue, (gpio::GpioValue value) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 9, Result, GetValue, (ams::sf::Out<gpio::GpioValue> out) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 10, Result, BindInterrupt, (ams::sf::OutCopyHandle out) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 11, Result, UnbindInterrupt, () ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 12, Result, SetDebounceEnabled, (bool enable) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 13, Result, GetDebounceEnabled, (ams::sf::Out<bool> out) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 14, Result, SetDebounceTime, (s32 ms) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 15, Result, GetDebounceTime, (ams::sf::Out<s32> out) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 16, Result, SetValueForSleepState, (gpio::GpioValue value), hos::Version_4_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 16, Result, GetValueForSleepState, (ams::sf::Out<gpio::GpioValue> out), hos::Version_6_0_0)
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IPadSession, AMS_GPIO_I_PAD_SESSION_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
namespace ams::i2c {
|
namespace ams::i2c {
|
||||||
|
|
||||||
void InitializeWith(std::shared_ptr<i2c::sf::IManager> &&sp, std::shared_ptr<i2c::sf::IManager> &&sp_pcv);
|
void InitializeWith(ams::sf::SharedPointer<i2c::sf::IManager> sp, ams::sf::SharedPointer<i2c::sf::IManager> sp_pcv);
|
||||||
void InitializeEmpty();
|
void InitializeEmpty();
|
||||||
|
|
||||||
void Finalize();
|
void Finalize();
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
namespace ams::i2c::server {
|
namespace ams::i2c::server {
|
||||||
|
|
||||||
std::shared_ptr<i2c::sf::IManager> GetServiceObject();
|
ams::sf::SharedPointer<i2c::sf::IManager> GetServiceObject();
|
||||||
std::shared_ptr<i2c::sf::IManager> GetServiceObjectPowerBus();
|
ams::sf::SharedPointer<i2c::sf::IManager> GetServiceObjectPowerBus();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,15 +20,11 @@
|
|||||||
#include <stratosphere/i2c/i2c_select_device_name.hpp>
|
#include <stratosphere/i2c/i2c_select_device_name.hpp>
|
||||||
#include <stratosphere/i2c/sf/i2c_sf_i_session.hpp>
|
#include <stratosphere/i2c/sf/i2c_sf_i_session.hpp>
|
||||||
|
|
||||||
namespace ams::i2c::sf {
|
#define AMS_I2C_I_MANAGER_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, OpenSessionForDev, (ams::sf::Out<ams::sf::SharedPointer<i2c::sf::ISession>> out, s32 bus_idx, u16 slave_address, i2c::AddressingMode addressing_mode, i2c::SpeedMode speed_mode), (out, bus_idx, slave_address, addressing_mode, speed_mode) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, OpenSession, (ams::sf::Out<ams::sf::SharedPointer<i2c::sf::ISession>> out, i2c::I2cDevice device), (out, device) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 2, Result, HasDevice, (ams::sf::Out<bool> out, i2c::I2cDevice device), (out, device), hos::Version_Min, hos::Version_5_1_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 3, Result, HasDeviceForDev, (ams::sf::Out<bool> out, i2c::I2cDevice device), (out, device), hos::Version_Min, hos::Version_5_1_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 4, Result, OpenSession2, (ams::sf::Out<ams::sf::SharedPointer<i2c::sf::ISession>> out, DeviceCode device_code), (out, device_code), hos::Version_6_0_0 )
|
||||||
|
|
||||||
#define AMS_I2C_I_MANAGER_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::i2c::sf, IManager, AMS_I2C_I_MANAGER_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, OpenSessionForDev, (ams::sf::Out<std::shared_ptr<i2c::sf::ISession>> out, s32 bus_idx, u16 slave_address, i2c::AddressingMode addressing_mode, i2c::SpeedMode speed_mode) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, OpenSession, (ams::sf::Out<std::shared_ptr<i2c::sf::ISession>> out, i2c::I2cDevice device) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, HasDevice, (ams::sf::Out<bool> out, i2c::I2cDevice device), hos::Version_Min, hos::Version_5_1_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 3, Result, HasDeviceForDev, (ams::sf::Out<bool> out, i2c::I2cDevice device), hos::Version_Min, hos::Version_5_1_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 4, Result, OpenSession2, (ams::sf::Out<std::shared_ptr<i2c::sf::ISession>> out, DeviceCode device_code), hos::Version_6_0_0 )
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IManager, AMS_I2C_I_MANAGER_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -18,17 +18,13 @@
|
|||||||
#include <vapours.hpp>
|
#include <vapours.hpp>
|
||||||
#include <stratosphere/i2c/i2c_types.hpp>
|
#include <stratosphere/i2c/i2c_types.hpp>
|
||||||
|
|
||||||
namespace ams::i2c::sf {
|
#define AMS_I2C_I_SESSION_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, SendOld, (const ams::sf::InBuffer &in_data, i2c::TransactionOption option), (in_data, option), hos::Version_Min, hos::Version_5_1_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, ReceiveOld, (const ams::sf::OutBuffer &out_data, i2c::TransactionOption option), (out_data, option), hos::Version_Min, hos::Version_5_1_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 2, Result, ExecuteCommandListOld, (const ams::sf::OutBuffer &rcv_buf, const ams::sf::InPointerArray<i2c::I2cCommand> &command_list), (rcv_buf, command_list), hos::Version_Min, hos::Version_5_1_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 10, Result, Send, (const ams::sf::InAutoSelectBuffer &in_data, i2c::TransactionOption option), (in_data, option) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 11, Result, Receive, (const ams::sf::OutAutoSelectBuffer &out_data, i2c::TransactionOption option), (out_data, option) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 12, Result, ExecuteCommandList, (const ams::sf::OutAutoSelectBuffer &rcv_buf, const ams::sf::InPointerArray<i2c::I2cCommand> &command_list), (rcv_buf, command_list) ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 13, Result, SetRetryPolicy, (s32 max_retry_count, s32 retry_interval_us), (max_retry_count, retry_interval_us), hos::Version_6_0_0 )
|
||||||
|
|
||||||
#define AMS_I2C_I_SESSION_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::i2c::sf, ISession, AMS_I2C_I_SESSION_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, SendOld, (const ams::sf::InBuffer &in_data, i2c::TransactionOption option), hos::Version_Min, hos::Version_5_1_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, ReceiveOld, (const ams::sf::OutBuffer &out_data, i2c::TransactionOption option), hos::Version_Min, hos::Version_5_1_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, ExecuteCommandListOld, (const ams::sf::OutBuffer &rcv_buf, const ams::sf::InPointerArray<i2c::I2cCommand> &command_list), hos::Version_Min, hos::Version_5_1_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 10, Result, Send, (const ams::sf::InAutoSelectBuffer &in_data, i2c::TransactionOption option) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 11, Result, Receive, (const ams::sf::OutAutoSelectBuffer &out_data, i2c::TransactionOption option) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 12, Result, ExecuteCommandList, (const ams::sf::OutAutoSelectBuffer &rcv_buf, const ams::sf::InPointerArray<i2c::I2cCommand> &command_list) ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 13, Result, SetRetryPolicy, (s32 max_retry_count, s32 retry_interval_us), hos::Version_6_0_0 )
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(ISession, AMS_I2C_I_SESSION_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace ams::kvdb {
|
|||||||
|
|
||||||
std::va_list args;
|
std::va_list args;
|
||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
CheckLength(std::vsnprintf(string.buffer, N, format, args));
|
CheckLength(util::VSNPrintf(string.buffer, N, format, args));
|
||||||
string.buffer[N - 1] = 0;
|
string.buffer[N - 1] = 0;
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ namespace ams::kvdb {
|
|||||||
/* Format into the buffer, abort if too large. */
|
/* Format into the buffer, abort if too large. */
|
||||||
std::va_list args;
|
std::va_list args;
|
||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
CheckLength(std::vsnprintf(this->buffer, N, format, args));
|
CheckLength(util::VSNPrintf(this->buffer, N, format, args));
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ namespace ams::kvdb {
|
|||||||
const size_t length = GetLength();
|
const size_t length = GetLength();
|
||||||
std::va_list args;
|
std::va_list args;
|
||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
CheckLength(std::vsnprintf(this->buffer + length, N - length, format, args) + length);
|
CheckLength(util::VSNPrintf(this->buffer + length, N - length, format, args) + length);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,15 +19,11 @@
|
|||||||
#include <stratosphere/ldr/ldr_types.hpp>
|
#include <stratosphere/ldr/ldr_types.hpp>
|
||||||
#include <stratosphere/sf.hpp>
|
#include <stratosphere/sf.hpp>
|
||||||
|
|
||||||
namespace ams::ldr::impl {
|
#define AMS_LDR_I_DEBUG_MONITOR_INTERFACE_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, SetProgramArgumentsDeprecated, (ncm::ProgramId program_id, const sf::InPointerBuffer &args, u32 args_size), (program_id, args, args_size), hos::Version_Min, hos::Version_10_2_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, SetProgramArguments, (ncm::ProgramId program_id, const sf::InPointerBuffer &args), (program_id, args), hos::Version_11_0_0 ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, FlushArguments, (), ()) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 2, Result, GetProcessModuleInfo, (sf::Out<u32> count, const sf::OutPointerArray<ldr::ModuleInfo> &out, os::ProcessId process_id), (count, out, process_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 65000, void, AtmosphereHasLaunchedBootProgram, (sf::Out<bool> out, ncm::ProgramId program_id), (out, program_id))
|
||||||
|
|
||||||
#define AMS_LDR_I_DEBUG_MONITOR_INTERFACE_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::ldr::impl, IDebugMonitorInterface, AMS_LDR_I_DEBUG_MONITOR_INTERFACE_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, SetProgramArgumentsDeprecated, (ncm::ProgramId program_id, const sf::InPointerBuffer &args, u32 args_size), hos::Version_Min, hos::Version_10_2_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, SetProgramArguments, (ncm::ProgramId program_id, const sf::InPointerBuffer &args), hos::Version_11_0_0 ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, FlushArguments, ()) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, GetProcessModuleInfo, (sf::Out<u32> count, const sf::OutPointerArray<ModuleInfo> &out, os::ProcessId process_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 65000, void, AtmosphereHasLaunchedProgram, (sf::Out<bool> out, ncm::ProgramId program_id))
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IDebugMonitorInterface, AMS_LDR_I_DEBUG_MONITOR_INTERFACE_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -19,18 +19,14 @@
|
|||||||
#include <stratosphere/ldr/ldr_types.hpp>
|
#include <stratosphere/ldr/ldr_types.hpp>
|
||||||
#include <stratosphere/sf.hpp>
|
#include <stratosphere/sf.hpp>
|
||||||
|
|
||||||
namespace ams::ldr::impl {
|
#define AMS_LDR_I_PROCESS_MANAGER_INTERFACE_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, CreateProcess, (sf::OutMoveHandle proc_h, ldr::PinId id, u32 flags, sf::CopyHandle reslimit_h), (proc_h, id, flags, reslimit_h)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, GetProgramInfo, (sf::Out<ldr::ProgramInfo> out_program_info, const ncm::ProgramLocation &loc), (out_program_info, loc)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 2, Result, PinProgram, (sf::Out<ldr::PinId> out_id, const ncm::ProgramLocation &loc), (out_id, loc)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 3, Result, UnpinProgram, (ldr::PinId id), (id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 4, Result, SetEnabledProgramVerification, (bool enabled), (enabled), hos::Version_10_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 65000, void, AtmosphereHasLaunchedBootProgram, (sf::Out<bool> out, ncm::ProgramId program_id), (out, program_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 65001, Result, AtmosphereGetProgramInfo, (sf::Out<ldr::ProgramInfo> out_program_info, sf::Out<cfg::OverrideStatus> out_status, const ncm::ProgramLocation &loc), (out_program_info, out_status, loc)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 65002, Result, AtmospherePinProgram, (sf::Out<ldr::PinId> out_id, const ncm::ProgramLocation &loc, const cfg::OverrideStatus &override_status), (out_id, loc, override_status))
|
||||||
|
|
||||||
#define AMS_LDR_I_PROCESS_MANAGER_INTERFACE_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::ldr::impl, IProcessManagerInterface, AMS_LDR_I_PROCESS_MANAGER_INTERFACE_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, CreateProcess, (sf::OutMoveHandle proc_h, PinId id, u32 flags, sf::CopyHandle reslimit_h)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, GetProgramInfo, (sf::Out<ProgramInfo> out_program_info, const ncm::ProgramLocation &loc)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, PinProgram, (sf::Out<PinId> out_id, const ncm::ProgramLocation &loc)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 3, Result, UnpinProgram, (PinId id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 4, Result, SetEnabledProgramVerification, (bool enabled), hos::Version_10_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 65000, void, AtmosphereHasLaunchedProgram, (sf::Out<bool> out, ncm::ProgramId program_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 65001, Result, AtmosphereGetProgramInfo, (sf::Out<ProgramInfo> out_program_info, sf::Out<cfg::OverrideStatus> out_status, const ncm::ProgramLocation &loc)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 65002, Result, AtmospherePinProgram, (sf::Out<PinId> out_id, const ncm::ProgramLocation &loc, const cfg::OverrideStatus &override_status))
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IProcessManagerInterface, AMS_LDR_I_PROCESS_MANAGER_INTERFACE_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -19,15 +19,11 @@
|
|||||||
#include <stratosphere/ldr/ldr_types.hpp>
|
#include <stratosphere/ldr/ldr_types.hpp>
|
||||||
#include <stratosphere/sf.hpp>
|
#include <stratosphere/sf.hpp>
|
||||||
|
|
||||||
namespace ams::ldr::impl {
|
#define AMS_LDR_I_SHELL_INTERFACE_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, SetProgramArgumentsDeprecated, (ncm::ProgramId program_id, const sf::InPointerBuffer &args, u32 args_size), (program_id, args, args_size), hos::Version_Min, hos::Version_10_2_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, SetProgramArguments, (ncm::ProgramId program_id, const sf::InPointerBuffer &args), (program_id, args), hos::Version_11_0_0 ) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, FlushArguments, (), ()) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 65000, Result, AtmosphereRegisterExternalCode, (sf::OutMoveHandle out, ncm::ProgramId program_id), (out, program_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 65001, void, AtmosphereUnregisterExternalCode, (ncm::ProgramId program_id), (program_id))
|
||||||
|
|
||||||
#define AMS_LDR_I_SHELL_INTERFACE_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::ldr::impl, IShellInterface, AMS_LDR_I_SHELL_INTERFACE_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, SetProgramArgumentsDeprecated, (ncm::ProgramId program_id, const sf::InPointerBuffer &args, u32 args_size), hos::Version_Min, hos::Version_10_2_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, SetProgramArguments, (ncm::ProgramId program_id, const sf::InPointerBuffer &args), hos::Version_11_0_0 ) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, FlushArguments, ()) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 65000, Result, AtmosphereRegisterExternalCode, (sf::OutMoveHandle out, ncm::ProgramId program_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 65001, void, AtmosphereUnregisterExternalCode, (ncm::ProgramId program_id))
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IShellInterface, AMS_LDR_I_SHELL_INTERFACE_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace ams::ldr::pm {
|
|||||||
Result PinProgram(PinId *out, const ncm::ProgramLocation &loc);
|
Result PinProgram(PinId *out, const ncm::ProgramLocation &loc);
|
||||||
Result UnpinProgram(PinId pin_id);
|
Result UnpinProgram(PinId pin_id);
|
||||||
Result SetEnabledProgramVerification(bool enabled);
|
Result SetEnabledProgramVerification(bool enabled);
|
||||||
Result HasLaunchedProgram(bool *out, ncm::ProgramId program_id);
|
Result HasLaunchedBootProgram(bool *out, ncm::ProgramId program_id);
|
||||||
|
|
||||||
/* Atmosphere extension API. */
|
/* Atmosphere extension API. */
|
||||||
Result AtmosphereGetProgramInfo(ProgramInfo *out, cfg::OverrideStatus *out_status, const ncm::ProgramLocation &loc);
|
Result AtmosphereGetProgramInfo(ProgramInfo *out, cfg::OverrideStatus *out_status, const ncm::ProgramLocation &loc);
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ namespace ams::lr {
|
|||||||
class AddOnContentLocationResolver {
|
class AddOnContentLocationResolver {
|
||||||
NON_COPYABLE(AddOnContentLocationResolver);
|
NON_COPYABLE(AddOnContentLocationResolver);
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<IAddOnContentLocationResolver> interface;
|
sf::SharedPointer<IAddOnContentLocationResolver> interface;
|
||||||
public:
|
public:
|
||||||
AddOnContentLocationResolver() { /* ... */ }
|
AddOnContentLocationResolver() { /* ... */ }
|
||||||
explicit AddOnContentLocationResolver(std::shared_ptr<IAddOnContentLocationResolver> intf) : interface(std::move(intf)) { /* ... */ }
|
explicit AddOnContentLocationResolver(sf::SharedPointer<IAddOnContentLocationResolver> intf) : interface(intf) { /* ... */ }
|
||||||
|
|
||||||
AddOnContentLocationResolver(AddOnContentLocationResolver &&rhs) {
|
AddOnContentLocationResolver(AddOnContentLocationResolver &&rhs) {
|
||||||
this->interface = std::move(rhs.interface);
|
this->interface = std::move(rhs.interface);
|
||||||
|
|||||||
@@ -17,16 +17,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <stratosphere/lr/lr_types.hpp>
|
#include <stratosphere/lr/lr_types.hpp>
|
||||||
|
|
||||||
namespace ams::lr {
|
#define AMS_LR_I_ADD_ON_CONTENT_LOCATION_RESOLVER_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, ResolveAddOnContentPath, (sf::Out<lr::Path> out, ncm::DataId id), (out, id), hos::Version_2_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, RegisterAddOnContentStorageDeprecated, (ncm::DataId id, ncm::StorageId storage_id), (id, storage_id), hos::Version_2_0_0, hos::Version_8_1_1) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, RegisterAddOnContentStorage, (ncm::DataId id, ncm::ApplicationId application_id, ncm::StorageId storage_id), (id, application_id, storage_id), hos::Version_9_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 2, Result, UnregisterAllAddOnContentPath, (), (), hos::Version_2_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 3, Result, RefreshApplicationAddOnContent, (const sf::InArray<ncm::ApplicationId> &ids), (ids), hos::Version_9_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 4, Result, UnregisterApplicationAddOnContent, (ncm::ApplicationId id), (id), hos::Version_9_0_0)
|
||||||
|
|
||||||
#define AMS_LR_I_ADD_ON_CONTENT_LOCATION_RESOLVER_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::lr, IAddOnContentLocationResolver, AMS_LR_I_ADD_ON_CONTENT_LOCATION_RESOLVER_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, ResolveAddOnContentPath, (sf::Out<Path> out, ncm::DataId id), hos::Version_2_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, RegisterAddOnContentStorageDeprecated, (ncm::DataId id, ncm::StorageId storage_id), hos::Version_2_0_0, hos::Version_8_1_1) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, RegisterAddOnContentStorage, (ncm::DataId id, ncm::ApplicationId application_id, ncm::StorageId storage_id), hos::Version_9_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, UnregisterAllAddOnContentPath, (), hos::Version_2_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 3, Result, RefreshApplicationAddOnContent, (const sf::InArray<ncm::ApplicationId> &ids), hos::Version_9_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 4, Result, UnregisterApplicationAddOnContent, (ncm::ApplicationId id), hos::Version_9_0_0)
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IAddOnContentLocationResolver, AMS_LR_I_ADD_ON_CONTENT_LOCATION_RESOLVER_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -17,37 +17,33 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <stratosphere/lr/lr_types.hpp>
|
#include <stratosphere/lr/lr_types.hpp>
|
||||||
|
|
||||||
namespace ams::lr {
|
#define AMS_LR_I_LOCATION_RESOLVER_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, ResolveProgramPath, (sf::Out<lr::Path> out, ncm::ProgramId id), (out, id)) \
|
||||||
#define AMS_LR_I_LOCATION_RESOLVER_INTERFACE_INFO(C, H) \
|
AMS_SF_METHOD_INFO(C, H, 1, Result, RedirectProgramPath, (const lr::Path &path, ncm::ProgramId id), (path, id)) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, ResolveProgramPath, (sf::Out<Path> out, ncm::ProgramId id)) \
|
AMS_SF_METHOD_INFO(C, H, 2, Result, ResolveApplicationControlPath, (sf::Out<lr::Path> out, ncm::ProgramId id), (out, id)) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, RedirectProgramPath, (const Path &path, ncm::ProgramId id)) \
|
AMS_SF_METHOD_INFO(C, H, 3, Result, ResolveApplicationHtmlDocumentPath, (sf::Out<lr::Path> out, ncm::ProgramId id), (out, id)) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, ResolveApplicationControlPath, (sf::Out<Path> out, ncm::ProgramId id)) \
|
AMS_SF_METHOD_INFO(C, H, 4, Result, ResolveDataPath, (sf::Out<lr::Path> out, ncm::DataId id), (out, id)) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 3, Result, ResolveApplicationHtmlDocumentPath, (sf::Out<Path> out, ncm::ProgramId id)) \
|
AMS_SF_METHOD_INFO(C, H, 5, Result, RedirectApplicationControlPathDeprecated, (const lr::Path &path, ncm::ProgramId id), (path, id), hos::Version_1_0_0, hos::Version_8_1_1) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 4, Result, ResolveDataPath, (sf::Out<Path> out, ncm::DataId id)) \
|
AMS_SF_METHOD_INFO(C, H, 5, Result, RedirectApplicationControlPath, (const lr::Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), (path, id, owner_id), hos::Version_9_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 5, Result, RedirectApplicationControlPathDeprecated, (const Path &path, ncm::ProgramId id), hos::Version_1_0_0, hos::Version_8_1_1) \
|
AMS_SF_METHOD_INFO(C, H, 6, Result, RedirectApplicationHtmlDocumentPathDeprecated, (const lr::Path &path, ncm::ProgramId id), (path, id), hos::Version_1_0_0, hos::Version_8_1_1) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 5, Result, RedirectApplicationControlPath, (const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), hos::Version_9_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 6, Result, RedirectApplicationHtmlDocumentPath, (const lr::Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), (path, id, owner_id), hos::Version_9_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 6, Result, RedirectApplicationHtmlDocumentPathDeprecated, (const Path &path, ncm::ProgramId id), hos::Version_1_0_0, hos::Version_8_1_1) \
|
AMS_SF_METHOD_INFO(C, H, 7, Result, ResolveApplicationLegalInformationPath, (sf::Out<lr::Path> out, ncm::ProgramId id), (out, id)) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 6, Result, RedirectApplicationHtmlDocumentPath, (const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), hos::Version_9_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 8, Result, RedirectApplicationLegalInformationPathDeprecated, (const lr::Path &path, ncm::ProgramId id), (path, id), hos::Version_1_0_0, hos::Version_8_1_1) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 7, Result, ResolveApplicationLegalInformationPath, (sf::Out<Path> out, ncm::ProgramId id)) \
|
AMS_SF_METHOD_INFO(C, H, 8, Result, RedirectApplicationLegalInformationPath, (const lr::Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), (path, id, owner_id), hos::Version_9_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 8, Result, RedirectApplicationLegalInformationPathDeprecated, (const Path &path, ncm::ProgramId id), hos::Version_1_0_0, hos::Version_8_1_1) \
|
AMS_SF_METHOD_INFO(C, H, 9, Result, Refresh, (), ()) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 8, Result, RedirectApplicationLegalInformationPath, (const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), hos::Version_9_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 10, Result, RedirectApplicationProgramPathDeprecated, (const lr::Path &path, ncm::ProgramId id), (path, id), hos::Version_5_0_0, hos::Version_8_1_1) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 9, Result, Refresh, ()) \
|
AMS_SF_METHOD_INFO(C, H, 10, Result, RedirectApplicationProgramPath, (const lr::Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), (path, id, owner_id), hos::Version_9_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 10, Result, RedirectApplicationProgramPathDeprecated, (const Path &path, ncm::ProgramId id), hos::Version_5_0_0, hos::Version_8_1_1) \
|
AMS_SF_METHOD_INFO(C, H, 11, Result, ClearApplicationRedirectionDeprecated, (), (), hos::Version_5_0_0, hos::Version_8_1_1) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 10, Result, RedirectApplicationProgramPath, (const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), hos::Version_9_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 11, Result, ClearApplicationRedirection, (const sf::InArray<ncm::ProgramId> &excluding_ids), (excluding_ids), hos::Version_9_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 11, Result, ClearApplicationRedirectionDeprecated, (), hos::Version_5_0_0, hos::Version_8_1_1) \
|
AMS_SF_METHOD_INFO(C, H, 12, Result, EraseProgramRedirection, (ncm::ProgramId id), (id), hos::Version_5_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 11, Result, ClearApplicationRedirection, (const sf::InArray<ncm::ProgramId> &excluding_ids), hos::Version_9_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 13, Result, EraseApplicationControlRedirection, (ncm::ProgramId id), (id), hos::Version_5_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 12, Result, EraseProgramRedirection, (ncm::ProgramId id), hos::Version_5_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 14, Result, EraseApplicationHtmlDocumentRedirection, (ncm::ProgramId id), (id), hos::Version_5_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 13, Result, EraseApplicationControlRedirection, (ncm::ProgramId id), hos::Version_5_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 15, Result, EraseApplicationLegalInformationRedirection, (ncm::ProgramId id), (id), hos::Version_5_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 14, Result, EraseApplicationHtmlDocumentRedirection, (ncm::ProgramId id), hos::Version_5_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 16, Result, ResolveProgramPathForDebug, (sf::Out<lr::Path> out, ncm::ProgramId id), (out, id), hos::Version_7_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 15, Result, EraseApplicationLegalInformationRedirection, (ncm::ProgramId id), hos::Version_5_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 17, Result, RedirectProgramPathForDebug, (const lr::Path &path, ncm::ProgramId id), (path, id), hos::Version_7_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 16, Result, ResolveProgramPathForDebug, (sf::Out<Path> out, ncm::ProgramId id), hos::Version_7_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 18, Result, RedirectApplicationProgramPathForDebugDeprecated, (const lr::Path &path, ncm::ProgramId id), (path, id), hos::Version_7_0_0, hos::Version_8_1_1) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 17, Result, RedirectProgramPathForDebug, (const Path &path, ncm::ProgramId id), hos::Version_7_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 18, Result, RedirectApplicationProgramPathForDebug, (const lr::Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), (path, id, owner_id), hos::Version_9_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 18, Result, RedirectApplicationProgramPathForDebugDeprecated, (const Path &path, ncm::ProgramId id), hos::Version_7_0_0, hos::Version_8_1_1) \
|
AMS_SF_METHOD_INFO(C, H, 19, Result, EraseProgramRedirectionForDebug, (ncm::ProgramId id), (id), hos::Version_7_0_0)
|
||||||
AMS_SF_METHOD_INFO(C, H, 18, Result, RedirectApplicationProgramPathForDebug, (const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), hos::Version_9_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 19, Result, EraseProgramRedirectionForDebug, (ncm::ProgramId id), hos::Version_7_0_0)
|
|
||||||
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(ILocationResolver, AMS_LR_I_LOCATION_RESOLVER_INTERFACE_INFO)
|
AMS_SF_DEFINE_INTERFACE(ams::lr, ILocationResolver, AMS_LR_I_LOCATION_RESOLVER_INTERFACE_INFO)
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -20,14 +20,10 @@
|
|||||||
#include <stratosphere/lr/lr_i_add_on_content_location_resolver.hpp>
|
#include <stratosphere/lr/lr_i_add_on_content_location_resolver.hpp>
|
||||||
#include <stratosphere/lr/lr_i_registered_location_resolver.hpp>
|
#include <stratosphere/lr/lr_i_registered_location_resolver.hpp>
|
||||||
|
|
||||||
namespace ams::lr {
|
#define AMS_LR_I_LOCATION_RESOLVER_MANAGER_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, OpenLocationResolver, (sf::Out<ams::sf::SharedPointer<lr::ILocationResolver>> out, ncm::StorageId storage_id), (out, storage_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, OpenRegisteredLocationResolver, (sf::Out<ams::sf::SharedPointer<lr::IRegisteredLocationResolver>> out), (out)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 2, Result, RefreshLocationResolver, (ncm::StorageId storage_id), (storage_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 3, Result, OpenAddOnContentLocationResolver, (sf::Out<ams::sf::SharedPointer<lr::IAddOnContentLocationResolver>> out), (out), hos::Version_2_0_0)
|
||||||
|
|
||||||
#define AMS_LR_I_LOCATION_RESOLVER_MANAGER_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::lr, ILocationResolverManager, AMS_LR_I_LOCATION_RESOLVER_MANAGER_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, OpenLocationResolver, (sf::Out<std::shared_ptr<ILocationResolver>> out, ncm::StorageId storage_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, OpenRegisteredLocationResolver, (sf::Out<std::shared_ptr<IRegisteredLocationResolver>> out)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, RefreshLocationResolver, (ncm::StorageId storage_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 3, Result, OpenAddOnContentLocationResolver, (sf::Out<std::shared_ptr<IAddOnContentLocationResolver>> out), hos::Version_2_0_0)
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(ILocationResolverManager, AMS_LR_I_LOCATION_RESOLVER_MANAGER_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -17,24 +17,20 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <stratosphere/lr/lr_types.hpp>
|
#include <stratosphere/lr/lr_types.hpp>
|
||||||
|
|
||||||
namespace ams::lr {
|
#define AMS_LR_I_REGISTERED_LOCATION_RESOLVER_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, ResolveProgramPath, (sf::Out<lr::Path> out, ncm::ProgramId id), (out, id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, RegisterProgramPathDeprecated, (const lr::Path &path, ncm::ProgramId id), (path, id), hos::Version_1_0_0, hos::Version_8_1_1) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, RegisterProgramPath, (const lr::Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), (path, id, owner_id), hos::Version_9_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 2, Result, UnregisterProgramPath, (ncm::ProgramId id), (id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 3, Result, RedirectProgramPathDeprecated, (const lr::Path &path, ncm::ProgramId id), (path, id), hos::Version_1_0_0, hos::Version_8_1_1) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 3, Result, RedirectProgramPath, (const lr::Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), (path, id, owner_id), hos::Version_9_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 4, Result, ResolveHtmlDocumentPath, (sf::Out<lr::Path> out, ncm::ProgramId id), (out, id), hos::Version_2_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 5, Result, RegisterHtmlDocumentPathDeprecated, (const lr::Path &path, ncm::ProgramId id), (path, id), hos::Version_2_0_0, hos::Version_8_1_1) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 5, Result, RegisterHtmlDocumentPath, (const lr::Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), (path, id, owner_id), hos::Version_9_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 6, Result, UnregisterHtmlDocumentPath, (ncm::ProgramId id), (id), hos::Version_2_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 7, Result, RedirectHtmlDocumentPathDeprecated, (const lr::Path &path, ncm::ProgramId id), (path, id), hos::Version_2_0_0, hos::Version_8_1_1) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 7, Result, RedirectHtmlDocumentPath, (const lr::Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), (path, id, owner_id), hos::Version_9_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 8, Result, Refresh, (), (), hos::Version_7_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 9, Result, RefreshExcluding, (const sf::InArray<ncm::ProgramId> &ids), (ids), hos::Version_9_0_0)
|
||||||
|
|
||||||
#define AMS_LR_I_REGISTERED_LOCATION_RESOLVER_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::lr, IRegisteredLocationResolver, AMS_LR_I_REGISTERED_LOCATION_RESOLVER_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, ResolveProgramPath, (sf::Out<Path> out, ncm::ProgramId id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, RegisterProgramPathDeprecated, (const Path &path, ncm::ProgramId id), hos::Version_1_0_0, hos::Version_8_1_1) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, RegisterProgramPath, (const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), hos::Version_9_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, UnregisterProgramPath, (ncm::ProgramId id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 3, Result, RedirectProgramPathDeprecated, (const Path &path, ncm::ProgramId id), hos::Version_1_0_0, hos::Version_8_1_1) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 3, Result, RedirectProgramPath, (const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), hos::Version_9_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 4, Result, ResolveHtmlDocumentPath, (sf::Out<Path> out, ncm::ProgramId id), hos::Version_2_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 5, Result, RegisterHtmlDocumentPathDeprecated, (const Path &path, ncm::ProgramId id), hos::Version_2_0_0, hos::Version_8_1_1) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 5, Result, RegisterHtmlDocumentPath, (const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), hos::Version_9_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 6, Result, UnregisterHtmlDocumentPath, (ncm::ProgramId id), hos::Version_2_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 7, Result, RedirectHtmlDocumentPathDeprecated, (const Path &path, ncm::ProgramId id), hos::Version_2_0_0, hos::Version_8_1_1) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 7, Result, RedirectHtmlDocumentPath, (const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), hos::Version_9_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 8, Result, Refresh, (), hos::Version_7_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 9, Result, RefreshExcluding, (const sf::InArray<ncm::ProgramId> &ids), hos::Version_9_0_0)
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IRegisteredLocationResolver, AMS_LR_I_REGISTERED_LOCATION_RESOLVER_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -23,21 +23,21 @@ namespace ams::lr {
|
|||||||
class LocationResolver {
|
class LocationResolver {
|
||||||
NON_COPYABLE(LocationResolver);
|
NON_COPYABLE(LocationResolver);
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<ILocationResolver> interface;
|
sf::SharedPointer<ILocationResolver> interface;
|
||||||
public:
|
public:
|
||||||
LocationResolver() { /* ... */ }
|
LocationResolver() { /* ... */ }
|
||||||
explicit LocationResolver(std::shared_ptr<ILocationResolver> intf) : interface(std::move(intf)) { /* ... */ }
|
explicit LocationResolver(sf::SharedPointer<ILocationResolver> intf) : interface(intf) { /* ... */ }
|
||||||
|
|
||||||
LocationResolver(LocationResolver &&rhs) {
|
LocationResolver(LocationResolver &&rhs) {
|
||||||
this->interface = std::move(rhs.interface);
|
this->interface = std::move(rhs.interface);
|
||||||
}
|
}
|
||||||
|
|
||||||
LocationResolver &operator=(LocationResolver &&rhs) {
|
LocationResolver &operator=(LocationResolver &&rhs) {
|
||||||
LocationResolver(std::move(rhs)).Swap(*this);
|
LocationResolver(std::move(rhs)).swap(*this);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Swap(LocationResolver &rhs) {
|
void swap(LocationResolver &rhs) {
|
||||||
std::swap(this->interface, rhs.interface);
|
std::swap(this->interface, rhs.interface);
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -21,20 +21,20 @@
|
|||||||
|
|
||||||
namespace ams::lr {
|
namespace ams::lr {
|
||||||
|
|
||||||
class LocationResolverManagerImpl final {
|
class LocationResolverManagerImpl {
|
||||||
private:
|
private:
|
||||||
/* Resolver storage. */
|
/* Resolver storage. */
|
||||||
ncm::BoundedMap<ncm::StorageId, std::shared_ptr<ILocationResolver>, 5> location_resolvers;
|
ncm::BoundedMap<ncm::StorageId, sf::SharedPointer<ILocationResolver>, 5> location_resolvers;
|
||||||
std::shared_ptr<IRegisteredLocationResolver> registered_location_resolver = nullptr;
|
sf::SharedPointer<IRegisteredLocationResolver> registered_location_resolver = nullptr;
|
||||||
std::shared_ptr<IAddOnContentLocationResolver> add_on_content_location_resolver = nullptr;
|
sf::SharedPointer<IAddOnContentLocationResolver> add_on_content_location_resolver = nullptr;
|
||||||
|
|
||||||
os::Mutex mutex{false};
|
os::Mutex mutex{false};
|
||||||
public:
|
public:
|
||||||
/* Actual commands. */
|
/* Actual commands. */
|
||||||
Result OpenLocationResolver(sf::Out<std::shared_ptr<ILocationResolver>> out, ncm::StorageId storage_id);
|
Result OpenLocationResolver(sf::Out<sf::SharedPointer<ILocationResolver>> out, ncm::StorageId storage_id);
|
||||||
Result OpenRegisteredLocationResolver(sf::Out<std::shared_ptr<IRegisteredLocationResolver>> out);
|
Result OpenRegisteredLocationResolver(sf::Out<sf::SharedPointer<IRegisteredLocationResolver>> out);
|
||||||
Result RefreshLocationResolver(ncm::StorageId storage_id);
|
Result RefreshLocationResolver(ncm::StorageId storage_id);
|
||||||
Result OpenAddOnContentLocationResolver(sf::Out<std::shared_ptr<IAddOnContentLocationResolver>> out);
|
Result OpenAddOnContentLocationResolver(sf::Out<sf::SharedPointer<IAddOnContentLocationResolver>> out);
|
||||||
};
|
};
|
||||||
static_assert(IsILocationResolverManager<LocationResolverManagerImpl>);
|
static_assert(IsILocationResolverManager<LocationResolverManagerImpl>);
|
||||||
|
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ namespace ams::lr {
|
|||||||
class RegisteredLocationResolver {
|
class RegisteredLocationResolver {
|
||||||
NON_COPYABLE(RegisteredLocationResolver);
|
NON_COPYABLE(RegisteredLocationResolver);
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<IRegisteredLocationResolver> interface;
|
sf::SharedPointer<IRegisteredLocationResolver> interface;
|
||||||
public:
|
public:
|
||||||
RegisteredLocationResolver() { /* ... */ }
|
RegisteredLocationResolver() { /* ... */ }
|
||||||
explicit RegisteredLocationResolver(std::shared_ptr<IRegisteredLocationResolver> intf) : interface(std::move(intf)) { /* ... */ }
|
explicit RegisteredLocationResolver(sf::SharedPointer<IRegisteredLocationResolver> intf) : interface(intf) { /* ... */ }
|
||||||
|
|
||||||
RegisteredLocationResolver(RegisteredLocationResolver &&rhs) {
|
RegisteredLocationResolver(RegisteredLocationResolver &&rhs) {
|
||||||
this->interface = std::move(rhs.interface);
|
this->interface = std::move(rhs.interface);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace ams::ncm {
|
|||||||
void Initialize();
|
void Initialize();
|
||||||
void Finalize();
|
void Finalize();
|
||||||
|
|
||||||
void InitializeWithObject(std::shared_ptr<IContentManager> manager_object);
|
void InitializeWithObject(sf::SharedPointer<IContentManager> manager_object);
|
||||||
|
|
||||||
/* Service API. */
|
/* Service API. */
|
||||||
Result CreateContentStorage(StorageId storage_id);
|
Result CreateContentStorage(StorageId storage_id);
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ namespace ams::ncm {
|
|||||||
};
|
};
|
||||||
static_assert(util::is_pod<SystemSaveDataInfo>::value);
|
static_assert(util::is_pod<SystemSaveDataInfo>::value);
|
||||||
|
|
||||||
class ContentManagerImpl final {
|
class ContentManagerImpl {
|
||||||
private:
|
private:
|
||||||
constexpr static size_t MaxContentStorageRoots = 8;
|
constexpr static size_t MaxContentStorageRoots = 8;
|
||||||
constexpr static size_t MaxContentMetaDatabaseRoots = 8;
|
constexpr static size_t MaxContentMetaDatabaseRoots = 8;
|
||||||
@@ -80,7 +80,7 @@ namespace ams::ncm {
|
|||||||
char path[128];
|
char path[128];
|
||||||
StorageId storage_id;
|
StorageId storage_id;
|
||||||
fs::ContentStorageId content_storage_id;
|
fs::ContentStorageId content_storage_id;
|
||||||
std::shared_ptr<IContentStorage> content_storage;
|
sf::SharedPointer<IContentStorage> content_storage;
|
||||||
|
|
||||||
ContentStorageRoot() { /* ... */ }
|
ContentStorageRoot() { /* ... */ }
|
||||||
};
|
};
|
||||||
@@ -93,7 +93,7 @@ namespace ams::ncm {
|
|||||||
char path[128];
|
char path[128];
|
||||||
StorageId storage_id;
|
StorageId storage_id;
|
||||||
SystemSaveDataInfo info;
|
SystemSaveDataInfo info;
|
||||||
std::shared_ptr<IContentMetaDatabase> content_meta_database;
|
sf::SharedPointer<IContentMetaDatabase> content_meta_database;
|
||||||
std::optional<kvdb::MemoryKeyValueStore<ContentMetaKey>> kvs;
|
std::optional<kvdb::MemoryKeyValueStore<ContentMetaKey>> kvs;
|
||||||
ContentMetaMemoryResource *memory_resource;
|
ContentMetaMemoryResource *memory_resource;
|
||||||
u32 max_content_metas;
|
u32 max_content_metas;
|
||||||
@@ -135,8 +135,8 @@ namespace ams::ncm {
|
|||||||
Result CreateContentMetaDatabase(StorageId storage_id);
|
Result CreateContentMetaDatabase(StorageId storage_id);
|
||||||
Result VerifyContentStorage(StorageId storage_id);
|
Result VerifyContentStorage(StorageId storage_id);
|
||||||
Result VerifyContentMetaDatabase(StorageId storage_id);
|
Result VerifyContentMetaDatabase(StorageId storage_id);
|
||||||
Result OpenContentStorage(sf::Out<std::shared_ptr<IContentStorage>> out, StorageId storage_id);
|
Result OpenContentStorage(sf::Out<sf::SharedPointer<IContentStorage>> out, StorageId storage_id);
|
||||||
Result OpenContentMetaDatabase(sf::Out<std::shared_ptr<IContentMetaDatabase>> out, StorageId storage_id);
|
Result OpenContentMetaDatabase(sf::Out<sf::SharedPointer<IContentMetaDatabase>> out, StorageId storage_id);
|
||||||
Result CloseContentStorageForcibly(StorageId storage_id);
|
Result CloseContentStorageForcibly(StorageId storage_id);
|
||||||
Result CloseContentMetaDatabaseForcibly(StorageId storage_id);
|
Result CloseContentMetaDatabaseForcibly(StorageId storage_id);
|
||||||
Result CleanupContentMetaDatabase(StorageId storage_id);
|
Result CleanupContentMetaDatabase(StorageId storage_id);
|
||||||
|
|||||||
@@ -26,21 +26,21 @@ namespace ams::ncm {
|
|||||||
s32 total;
|
s32 total;
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<IContentMetaDatabase> interface;
|
sf::SharedPointer<IContentMetaDatabase> interface;
|
||||||
public:
|
public:
|
||||||
ContentMetaDatabase() { /* ... */ }
|
ContentMetaDatabase() { /* ... */ }
|
||||||
explicit ContentMetaDatabase(std::shared_ptr<IContentMetaDatabase> intf) : interface(std::move(intf)) { /* ... */ }
|
explicit ContentMetaDatabase(sf::SharedPointer<IContentMetaDatabase> intf) : interface(intf) { /* ... */ }
|
||||||
|
|
||||||
ContentMetaDatabase(ContentMetaDatabase &&rhs) {
|
ContentMetaDatabase(ContentMetaDatabase &&rhs) {
|
||||||
this->interface = std::move(rhs.interface);
|
this->interface = std::move(rhs.interface);
|
||||||
}
|
}
|
||||||
|
|
||||||
ContentMetaDatabase &operator=(ContentMetaDatabase &&rhs) {
|
ContentMetaDatabase &operator=(ContentMetaDatabase &&rhs) {
|
||||||
ContentMetaDatabase(std::move(rhs)).Swap(*this);
|
ContentMetaDatabase(std::move(rhs)).swap(*this);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Swap(ContentMetaDatabase &rhs) {
|
void swap(ContentMetaDatabase &rhs) {
|
||||||
std::swap(this->interface, rhs.interface);
|
std::swap(this->interface, rhs.interface);
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -21,21 +21,21 @@ namespace ams::ncm {
|
|||||||
class ContentStorage {
|
class ContentStorage {
|
||||||
NON_COPYABLE(ContentStorage);
|
NON_COPYABLE(ContentStorage);
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<IContentStorage> interface;
|
sf::SharedPointer<IContentStorage> interface;
|
||||||
public:
|
public:
|
||||||
ContentStorage() { /* ... */ }
|
ContentStorage() { /* ... */ }
|
||||||
explicit ContentStorage(std::shared_ptr<IContentStorage> intf) : interface(std::move(intf)) { /* ... */ }
|
explicit ContentStorage(sf::SharedPointer<IContentStorage> intf) : interface(intf) { /* ... */ }
|
||||||
|
|
||||||
ContentStorage(ContentStorage &&rhs) {
|
ContentStorage(ContentStorage &&rhs) {
|
||||||
this->interface = std::move(rhs.interface);
|
this->interface = std::move(rhs.interface);
|
||||||
}
|
}
|
||||||
|
|
||||||
ContentStorage &operator=(ContentStorage &&rhs) {
|
ContentStorage &operator=(ContentStorage &&rhs) {
|
||||||
ContentStorage(std::move(rhs)).Swap(*this);
|
ContentStorage(std::move(rhs)).swap(*this);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Swap(ContentStorage &rhs) {
|
void swap(ContentStorage &rhs) {
|
||||||
std::swap(this->interface, rhs.interface);
|
std::swap(this->interface, rhs.interface);
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -18,25 +18,21 @@
|
|||||||
#include <stratosphere/ncm/ncm_i_content_meta_database.hpp>
|
#include <stratosphere/ncm/ncm_i_content_meta_database.hpp>
|
||||||
#include <stratosphere/ncm/ncm_memory_report.hpp>
|
#include <stratosphere/ncm/ncm_memory_report.hpp>
|
||||||
|
|
||||||
namespace ams::ncm {
|
#define AMS_NCM_I_CONTENT_MANAGER_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, CreateContentStorage, (ncm::StorageId storage_id), (storage_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, CreateContentMetaDatabase, (ncm::StorageId storage_id), (storage_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 2, Result, VerifyContentStorage, (ncm::StorageId storage_id), (storage_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 3, Result, VerifyContentMetaDatabase, (ncm::StorageId storage_id), (storage_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 4, Result, OpenContentStorage, (sf::Out<sf::SharedPointer<ncm::IContentStorage>> out, ncm::StorageId storage_id), (out, storage_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 5, Result, OpenContentMetaDatabase, (sf::Out<sf::SharedPointer<ncm::IContentMetaDatabase>> out, ncm::StorageId storage_id), (out, storage_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 6, Result, CloseContentStorageForcibly, (ncm::StorageId storage_id), (storage_id), hos::Version_1_0_0, hos::Version_1_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 7, Result, CloseContentMetaDatabaseForcibly, (ncm::StorageId storage_id), (storage_id), hos::Version_1_0_0, hos::Version_1_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 8, Result, CleanupContentMetaDatabase, (ncm::StorageId storage_id), (storage_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 9, Result, ActivateContentStorage, (ncm::StorageId storage_id), (storage_id), hos::Version_2_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 10, Result, InactivateContentStorage, (ncm::StorageId storage_id), (storage_id), hos::Version_2_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 11, Result, ActivateContentMetaDatabase, (ncm::StorageId storage_id), (storage_id), hos::Version_2_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 12, Result, InactivateContentMetaDatabase, (ncm::StorageId storage_id), (storage_id), hos::Version_2_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 13, Result, InvalidateRightsIdCache, (), (), hos::Version_9_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 14, Result, GetMemoryReport, (sf::Out<ncm::MemoryReport> out), (out), hos::Version_10_0_0)
|
||||||
|
|
||||||
#define AMS_NCM_I_CONTENT_MANAGER_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::ncm, IContentManager, AMS_NCM_I_CONTENT_MANAGER_INTERFACE_INFO);
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, CreateContentStorage, (StorageId storage_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, CreateContentMetaDatabase, (StorageId storage_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, VerifyContentStorage, (StorageId storage_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 3, Result, VerifyContentMetaDatabase, (StorageId storage_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 4, Result, OpenContentStorage, (sf::Out<std::shared_ptr<IContentStorage>> out, StorageId storage_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 5, Result, OpenContentMetaDatabase, (sf::Out<std::shared_ptr<IContentMetaDatabase>> out, StorageId storage_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 6, Result, CloseContentStorageForcibly, (StorageId storage_id), hos::Version_1_0_0, hos::Version_1_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 7, Result, CloseContentMetaDatabaseForcibly, (StorageId storage_id), hos::Version_1_0_0, hos::Version_1_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 8, Result, CleanupContentMetaDatabase, (StorageId storage_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 9, Result, ActivateContentStorage, (StorageId storage_id), hos::Version_2_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 10, Result, InactivateContentStorage, (StorageId storage_id), hos::Version_2_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 11, Result, ActivateContentMetaDatabase, (StorageId storage_id), hos::Version_2_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 12, Result, InactivateContentMetaDatabase, (StorageId storage_id), hos::Version_2_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 13, Result, InvalidateRightsIdCache, (), hos::Version_9_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 14, Result, GetMemoryReport, (sf::Out<MemoryReport> out), hos::Version_10_0_0)
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IContentManager, AMS_NCM_I_CONTENT_MANAGER_INTERFACE_INFO);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -17,33 +17,29 @@
|
|||||||
#include <stratosphere/sf.hpp>
|
#include <stratosphere/sf.hpp>
|
||||||
#include <stratosphere/ncm/ncm_content_meta.hpp>
|
#include <stratosphere/ncm/ncm_content_meta.hpp>
|
||||||
|
|
||||||
namespace ams::ncm {
|
#define AMS_NCM_I_CONTENT_META_DATABASE_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, Set, (const ncm::ContentMetaKey &key, const sf::InBuffer &value), (key, value)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, Get, (sf::Out<u64> out_size, const ncm::ContentMetaKey &key, const sf::OutBuffer &out_value), (out_size, key, out_value)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 2, Result, Remove, (const ncm::ContentMetaKey &key), (key)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 3, Result, GetContentIdByType, (sf::Out<ncm::ContentId> out_content_id, const ncm::ContentMetaKey &key, ncm::ContentType type), (out_content_id, key, type)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 4, Result, ListContentInfo, (sf::Out<s32> out_entries_written, const sf::OutArray<ncm::ContentInfo> &out_info, const ncm::ContentMetaKey &key, s32 offset), (out_entries_written, out_info, key, offset)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 5, Result, List, (sf::Out<s32> out_entries_total, sf::Out<s32> out_entries_written, const sf::OutArray<ncm::ContentMetaKey> &out_info, ncm::ContentMetaType meta_type, ncm::ApplicationId application_id, u64 min, u64 max, ncm::ContentInstallType install_type), (out_entries_total, out_entries_written, out_info, meta_type, application_id, min, max, install_type)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 6, Result, GetLatestContentMetaKey, (sf::Out<ncm::ContentMetaKey> out_key, u64 id), (out_key, id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 7, Result, ListApplication, (sf::Out<s32> out_entries_total, sf::Out<s32> out_entries_written, const sf::OutArray<ncm::ApplicationContentMetaKey> &out_keys, ncm::ContentMetaType meta_type), (out_entries_total, out_entries_written, out_keys, meta_type)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 8, Result, Has, (sf::Out<bool> out, const ncm::ContentMetaKey &key), (out, key)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 9, Result, HasAll, (sf::Out<bool> out, const sf::InArray<ncm::ContentMetaKey> &keys), (out, keys)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 10, Result, GetSize, (sf::Out<u64> out_size, const ncm::ContentMetaKey &key), (out_size, key)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 11, Result, GetRequiredSystemVersion, (sf::Out<u32> out_version, const ncm::ContentMetaKey &key), (out_version, key)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 12, Result, GetPatchId, (sf::Out<ncm::PatchId> out_patch_id, const ncm::ContentMetaKey &key), (out_patch_id, key)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 13, Result, DisableForcibly, (), ()) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 14, Result, LookupOrphanContent, (const sf::OutArray<bool> &out_orphaned, const sf::InArray<ncm::ContentId> &content_ids), (out_orphaned, content_ids)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 15, Result, Commit, (), ()) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 16, Result, HasContent, (sf::Out<bool> out, const ncm::ContentMetaKey &key, const ncm::ContentId &content_id), (out, key, content_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 17, Result, ListContentMetaInfo, (sf::Out<s32> out_entries_written, const sf::OutArray<ncm::ContentMetaInfo> &out_meta_info, const ncm::ContentMetaKey &key, s32 offset), (out_entries_written, out_meta_info, key, offset)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 18, Result, GetAttributes, (sf::Out<u8> out_attributes, const ncm::ContentMetaKey &key), (out_attributes, key)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 19, Result, GetRequiredApplicationVersion, (sf::Out<u32> out_version, const ncm::ContentMetaKey &key), (out_version, key), hos::Version_2_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 20, Result, GetContentIdByTypeAndIdOffset, (sf::Out<ncm::ContentId> out_content_id, const ncm::ContentMetaKey &key, ncm::ContentType type, u8 id_offset), (out_content_id, key, type, id_offset), hos::Version_5_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 21, Result, GetCount, (sf::Out<u32> out_count), (out_count), hos::Version_10_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 22, Result, GetOwnerApplicationId, (sf::Out<ncm::ApplicationId> out_id, const ncm::ContentMetaKey &key), (out_id, key), hos::Version_10_0_0)
|
||||||
|
|
||||||
#define AMS_NCM_I_CONTENT_META_DATABASE_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::ncm, IContentMetaDatabase, AMS_NCM_I_CONTENT_META_DATABASE_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, Set, (const ContentMetaKey &key, sf::InBuffer value)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, Get, (sf::Out<u64> out_size, const ContentMetaKey &key, sf::OutBuffer out_value)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, Remove, (const ContentMetaKey &key)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 3, Result, GetContentIdByType, (sf::Out<ContentId> out_content_id, const ContentMetaKey &key, ContentType type)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 4, Result, ListContentInfo, (sf::Out<s32> out_entries_written, const sf::OutArray<ContentInfo> &out_info, const ContentMetaKey &key, s32 offset)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 5, Result, List, (sf::Out<s32> out_entries_total, sf::Out<s32> out_entries_written, const sf::OutArray<ContentMetaKey> &out_info, ContentMetaType meta_type, ApplicationId application_id, u64 min, u64 max, ContentInstallType install_type)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 6, Result, GetLatestContentMetaKey, (sf::Out<ContentMetaKey> out_key, u64 id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 7, Result, ListApplication, (sf::Out<s32> out_entries_total, sf::Out<s32> out_entries_written, const sf::OutArray<ApplicationContentMetaKey> &out_keys, ContentMetaType meta_type)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 8, Result, Has, (sf::Out<bool> out, const ContentMetaKey &key)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 9, Result, HasAll, (sf::Out<bool> out, const sf::InArray<ContentMetaKey> &keys)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 10, Result, GetSize, (sf::Out<u64> out_size, const ContentMetaKey &key)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 11, Result, GetRequiredSystemVersion, (sf::Out<u32> out_version, const ContentMetaKey &key)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 12, Result, GetPatchId, (sf::Out<PatchId> out_patch_id, const ContentMetaKey &key)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 13, Result, DisableForcibly, ()) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 14, Result, LookupOrphanContent, (const sf::OutArray<bool> &out_orphaned, const sf::InArray<ContentId> &content_ids)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 15, Result, Commit, ()) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 16, Result, HasContent, (sf::Out<bool> out, const ContentMetaKey &key, const ContentId &content_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 17, Result, ListContentMetaInfo, (sf::Out<s32> out_entries_written, const sf::OutArray<ContentMetaInfo> &out_meta_info, const ContentMetaKey &key, s32 offset)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 18, Result, GetAttributes, (sf::Out<u8> out_attributes, const ContentMetaKey &key)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 19, Result, GetRequiredApplicationVersion, (sf::Out<u32> out_version, const ContentMetaKey &key), hos::Version_2_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 20, Result, GetContentIdByTypeAndIdOffset, (sf::Out<ContentId> out_content_id, const ContentMetaKey &key, ContentType type, u8 id_offset), hos::Version_5_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 21, Result, GetCount, (sf::Out<u32> out_count), hos::Version_10_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 22, Result, GetOwnerApplicationId, (sf::Out<ApplicationId> out_id, const ContentMetaKey &key), hos::Version_10_0_0)
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IContentMetaDatabase, AMS_NCM_I_CONTENT_META_DATABASE_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -20,40 +20,36 @@
|
|||||||
#include <stratosphere/ncm/ncm_path.hpp>
|
#include <stratosphere/ncm/ncm_path.hpp>
|
||||||
#include <stratosphere/ncm/ncm_rights_id.hpp>
|
#include <stratosphere/ncm/ncm_rights_id.hpp>
|
||||||
|
|
||||||
namespace ams::ncm {
|
#define AMS_NCM_I_CONTENT_STORAGE_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, GeneratePlaceHolderId, (sf::Out<ncm::PlaceHolderId> out), (out)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, CreatePlaceHolder, (ncm::PlaceHolderId placeholder_id, ncm::ContentId content_id, s64 size), (placeholder_id, content_id, size)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 2, Result, DeletePlaceHolder, (ncm::PlaceHolderId placeholder_id), (placeholder_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 3, Result, HasPlaceHolder, (sf::Out<bool> out, ncm::PlaceHolderId placeholder_id), (out, placeholder_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 4, Result, WritePlaceHolder, (ncm::PlaceHolderId placeholder_id, s64 offset, const sf::InBuffer &data), (placeholder_id, offset, data)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 5, Result, Register, (ncm::PlaceHolderId placeholder_id, ncm::ContentId content_id), (placeholder_id, content_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 6, Result, Delete, (ncm::ContentId content_id), (content_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 7, Result, Has, (sf::Out<bool> out, ncm::ContentId content_id), (out, content_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 8, Result, GetPath, (sf::Out<ncm::Path> out, ncm::ContentId content_id), (out, content_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 9, Result, GetPlaceHolderPath, (sf::Out<ncm::Path> out, ncm::PlaceHolderId placeholder_id), (out, placeholder_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 10, Result, CleanupAllPlaceHolder, (), ()) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 11, Result, ListPlaceHolder, (sf::Out<s32> out_count, const sf::OutArray<ncm::PlaceHolderId> &out_buf), (out_count, out_buf)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 12, Result, GetContentCount, (sf::Out<s32> out_count), (out_count)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 13, Result, ListContentId, (sf::Out<s32> out_count, const sf::OutArray<ncm::ContentId> &out_buf, s32 start_offset), (out_count, out_buf, start_offset)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 14, Result, GetSizeFromContentId, (sf::Out<s64> out_size, ncm::ContentId content_id), (out_size, content_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 15, Result, DisableForcibly, (), ()) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 16, Result, RevertToPlaceHolder, (ncm::PlaceHolderId placeholder_id, ncm::ContentId old_content_id, ncm::ContentId new_content_id), (placeholder_id, old_content_id, new_content_id), hos::Version_2_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 17, Result, SetPlaceHolderSize, (ncm::PlaceHolderId placeholder_id, s64 size), (placeholder_id, size), hos::Version_2_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 18, Result, ReadContentIdFile, (const sf::OutBuffer &buf, ncm::ContentId content_id, s64 offset), (buf, content_id, offset), hos::Version_2_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 19, Result, GetRightsIdFromPlaceHolderIdDeprecated, (sf::Out<ams::fs::RightsId> out_rights_id, ncm::PlaceHolderId placeholder_id), (out_rights_id, placeholder_id), hos::Version_2_0_0, hos::Version_2_3_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 19, Result, GetRightsIdFromPlaceHolderId, (sf::Out<ncm::RightsId> out_rights_id, ncm::PlaceHolderId placeholder_id), (out_rights_id, placeholder_id), hos::Version_3_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 20, Result, GetRightsIdFromContentIdDeprecated, (sf::Out<ams::fs::RightsId> out_rights_id, ncm::ContentId content_id), (out_rights_id, content_id), hos::Version_2_0_0, hos::Version_2_3_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 20, Result, GetRightsIdFromContentId, (sf::Out<ncm::RightsId> out_rights_id, ncm::ContentId content_id), (out_rights_id, content_id), hos::Version_3_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 21, Result, WriteContentForDebug, (ncm::ContentId content_id, s64 offset, const sf::InBuffer &data), (content_id, offset, data), hos::Version_2_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 22, Result, GetFreeSpaceSize, (sf::Out<s64> out_size), (out_size), hos::Version_2_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 23, Result, GetTotalSpaceSize, (sf::Out<s64> out_size), (out_size), hos::Version_2_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 24, Result, FlushPlaceHolder, (), (), hos::Version_3_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 25, Result, GetSizeFromPlaceHolderId, (sf::Out<s64> out, ncm::PlaceHolderId placeholder_id), (out, placeholder_id), hos::Version_4_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 26, Result, RepairInvalidFileAttribute, (), (), hos::Version_4_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 27, Result, GetRightsIdFromPlaceHolderIdWithCache, (sf::Out<ncm::RightsId> out_rights_id, ncm::PlaceHolderId placeholder_id, ncm::ContentId cache_content_id), (out_rights_id, placeholder_id, cache_content_id), hos::Version_8_0_0)
|
||||||
|
|
||||||
#define AMS_NCM_I_CONTENT_STORAGE_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::ncm, IContentStorage, AMS_NCM_I_CONTENT_STORAGE_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, GeneratePlaceHolderId, (sf::Out<PlaceHolderId> out)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, CreatePlaceHolder, (PlaceHolderId placeholder_id, ContentId content_id, s64 size)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, DeletePlaceHolder, (PlaceHolderId placeholder_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 3, Result, HasPlaceHolder, (sf::Out<bool> out, PlaceHolderId placeholder_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 4, Result, WritePlaceHolder, (PlaceHolderId placeholder_id, s64 offset, sf::InBuffer data)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 5, Result, Register, (PlaceHolderId placeholder_id, ContentId content_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 6, Result, Delete, (ContentId content_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 7, Result, Has, (sf::Out<bool> out, ContentId content_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 8, Result, GetPath, (sf::Out<Path> out, ContentId content_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 9, Result, GetPlaceHolderPath, (sf::Out<Path> out, PlaceHolderId placeholder_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 10, Result, CleanupAllPlaceHolder, ()) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 11, Result, ListPlaceHolder, (sf::Out<s32> out_count, const sf::OutArray<PlaceHolderId> &out_buf)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 12, Result, GetContentCount, (sf::Out<s32> out_count)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 13, Result, ListContentId, (sf::Out<s32> out_count, const sf::OutArray<ContentId> &out_buf, s32 start_offset)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 14, Result, GetSizeFromContentId, (sf::Out<s64> out_size, ContentId content_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 15, Result, DisableForcibly, ()) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 16, Result, RevertToPlaceHolder, (PlaceHolderId placeholder_id, ContentId old_content_id, ContentId new_content_id), hos::Version_2_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 17, Result, SetPlaceHolderSize, (PlaceHolderId placeholder_id, s64 size), hos::Version_2_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 18, Result, ReadContentIdFile, (sf::OutBuffer buf, ContentId content_id, s64 offset), hos::Version_2_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 19, Result, GetRightsIdFromPlaceHolderIdDeprecated, (sf::Out<ams::fs::RightsId> out_rights_id, PlaceHolderId placeholder_id), hos::Version_2_0_0, hos::Version_2_3_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 19, Result, GetRightsIdFromPlaceHolderId, (sf::Out<ncm::RightsId> out_rights_id, PlaceHolderId placeholder_id), hos::Version_3_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 20, Result, GetRightsIdFromContentIdDeprecated, (sf::Out<ams::fs::RightsId> out_rights_id, ContentId content_id), hos::Version_2_0_0, hos::Version_2_3_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 20, Result, GetRightsIdFromContentId, (sf::Out<ncm::RightsId> out_rights_id, ContentId content_id), hos::Version_3_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 21, Result, WriteContentForDebug, (ContentId content_id, s64 offset, sf::InBuffer data), hos::Version_2_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 22, Result, GetFreeSpaceSize, (sf::Out<s64> out_size), hos::Version_2_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 23, Result, GetTotalSpaceSize, (sf::Out<s64> out_size), hos::Version_2_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 24, Result, FlushPlaceHolder, (), hos::Version_3_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 25, Result, GetSizeFromPlaceHolderId, (sf::Out<s64> out, PlaceHolderId placeholder_id), hos::Version_4_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 26, Result, RepairInvalidFileAttribute, (), hos::Version_4_0_0) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 27, Result, GetRightsIdFromPlaceHolderIdWithCache, (sf::Out<ncm::RightsId> out_rights_id, PlaceHolderId placeholder_id, ContentId cache_content_id), hos::Version_8_0_0)
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IContentStorage, AMS_NCM_I_CONTENT_STORAGE_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -19,13 +19,9 @@
|
|||||||
#include <stratosphere/err/err_error_context.hpp>
|
#include <stratosphere/err/err_error_context.hpp>
|
||||||
#include <stratosphere/sf.hpp>
|
#include <stratosphere/sf.hpp>
|
||||||
|
|
||||||
namespace ams::ns::impl {
|
#define AMS_NS_I_ASYNC_RESULT_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, Get, (), ()) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, Cancel, (), ()) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 2, Result, GetErrorContext, (::ams::sf::Out<::ams::err::ErrorContext> out), (out))
|
||||||
|
|
||||||
#define AMS_NS_I_ASYNC_RESULT_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::ns::impl, IAsyncResult, AMS_NS_I_ASYNC_RESULT_INTERFACE_INFO)
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, Get, ()) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, Cancel, ()) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, GetErrorContext, (::ams::sf::Out<::ams::err::ErrorContext> out))
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IAsyncResult, AMS_NS_I_ASYNC_RESULT_INTERFACE_INFO)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -14,10 +14,5 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <stratosphere.hpp>
|
#include <stratosphere/nsd/nsd_types.hpp>
|
||||||
|
#include <stratosphere/nsd/impl/device/nsd_device.hpp>
|
||||||
namespace ams::mitm {
|
|
||||||
|
|
||||||
void ThrowResultForDebug(Result res);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -13,15 +13,12 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "hid_shim.h"
|
#pragma once
|
||||||
#include <stratosphere/sf/sf_mitm_dispatch.h>
|
#include <vapours.hpp>
|
||||||
|
#include <stratosphere/nsd/nsd_types.hpp>
|
||||||
|
|
||||||
|
namespace ams::nsd::impl::device {
|
||||||
|
|
||||||
|
const EnvironmentIdentifier &GetEnvironmentIdentifierFromSettings();
|
||||||
|
|
||||||
/* Command forwarders. */
|
|
||||||
Result hidSetSupportedNpadStyleSetFwd(Service* s, u64 process_id, u64 aruid, u32 style_set) {
|
|
||||||
const struct {
|
|
||||||
u32 style_set;
|
|
||||||
u32 pad;
|
|
||||||
u64 aruid;
|
|
||||||
} in = { style_set, 0, aruid };
|
|
||||||
return serviceMitmDispatchIn(s, 100, in, .in_send_pid = true, .override_pid = process_id);
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018-2020 Atmosphère-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/>.
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
#include <vapours.hpp>
|
||||||
|
|
||||||
|
namespace ams::nsd {
|
||||||
|
|
||||||
|
struct EnvironmentIdentifier {
|
||||||
|
static constexpr size_t Size = 8;
|
||||||
|
char value[Size];
|
||||||
|
|
||||||
|
constexpr friend bool operator==(const EnvironmentIdentifier &lhs, const EnvironmentIdentifier &rhs) {
|
||||||
|
return util::Strncmp(lhs.value, rhs.value, Size) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr friend bool operator!=(const EnvironmentIdentifier &lhs, const EnvironmentIdentifier &rhs) {
|
||||||
|
return !(lhs == rhs);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
constexpr inline const EnvironmentIdentifier EnvironmentIdentifierOfProductDevice = {"lp1"};
|
||||||
|
constexpr inline const EnvironmentIdentifier EnvironmentIdentifierOfNotProductDevice = {"dd1"};
|
||||||
|
|
||||||
|
}
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
#include <stratosphere/os/os_common_types.hpp>
|
#include <stratosphere/os/os_common_types.hpp>
|
||||||
#include <stratosphere/os/os_tick.hpp>
|
#include <stratosphere/os/os_tick.hpp>
|
||||||
#include <stratosphere/os/os_memory_common.hpp>
|
#include <stratosphere/os/os_memory_common.hpp>
|
||||||
|
#include <stratosphere/os/os_memory_fence.hpp>
|
||||||
#include <stratosphere/os/os_memory_permission.hpp>
|
#include <stratosphere/os/os_memory_permission.hpp>
|
||||||
#include <stratosphere/os/os_memory_heap_api.hpp>
|
#include <stratosphere/os/os_memory_heap_api.hpp>
|
||||||
#include <stratosphere/os/os_memory_virtual_address_api.hpp>
|
#include <stratosphere/os/os_memory_virtual_address_api.hpp>
|
||||||
@@ -38,6 +39,7 @@
|
|||||||
#include <stratosphere/os/os_timer_event.hpp>
|
#include <stratosphere/os/os_timer_event.hpp>
|
||||||
#include <stratosphere/os/os_thread_local_storage.hpp>
|
#include <stratosphere/os/os_thread_local_storage.hpp>
|
||||||
#include <stratosphere/os/os_sdk_thread_local_storage.hpp>
|
#include <stratosphere/os/os_sdk_thread_local_storage.hpp>
|
||||||
|
#include <stratosphere/os/os_sdk_reply_and_receive.hpp>
|
||||||
#include <stratosphere/os/os_thread.hpp>
|
#include <stratosphere/os/os_thread.hpp>
|
||||||
#include <stratosphere/os/os_message_queue.hpp>
|
#include <stratosphere/os/os_message_queue.hpp>
|
||||||
#include <stratosphere/os/os_waitable.hpp>
|
#include <stratosphere/os/os_waitable.hpp>
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018-2020 Atmosphère-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/>.
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
#include <vapours.hpp>
|
||||||
|
|
||||||
|
namespace ams::os::impl {
|
||||||
|
|
||||||
|
#if defined(ATMOSPHERE_ARCH_ARM64)
|
||||||
|
|
||||||
|
ALWAYS_INLINE void FenceMemoryStoreStore() { __asm__ __volatile__("dmb ishst" ::: "memory"); }
|
||||||
|
ALWAYS_INLINE void FenceMemoryStoreLoad() { __asm__ __volatile__("dmb ish" ::: "memory"); }
|
||||||
|
ALWAYS_INLINE void FenceMemoryStoreAny() { __asm__ __volatile__("dmb ish" ::: "memory"); }
|
||||||
|
|
||||||
|
ALWAYS_INLINE void FenceMemoryLoadStore() { __asm__ __volatile__("dmb ishld" ::: "memory"); }
|
||||||
|
ALWAYS_INLINE void FenceMemoryLoadLoad() { __asm__ __volatile__("dmb ishld" ::: "memory"); }
|
||||||
|
ALWAYS_INLINE void FenceMemoryLoadAny() { __asm__ __volatile__("dmb ishld" ::: "memory"); }
|
||||||
|
|
||||||
|
ALWAYS_INLINE void FenceMemoryAnyStore() { __asm__ __volatile__("dmb ish" ::: "memory"); }
|
||||||
|
ALWAYS_INLINE void FenceMemoryAnyLoad() { __asm__ __volatile__("dmb ish" ::: "memory"); }
|
||||||
|
ALWAYS_INLINE void FenceMemoryAnyAny() { __asm__ __volatile__("dmb ish" ::: "memory"); }
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#error "Unknown architecture for os::impl::FenceMemory* (Horizon)"
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018-2020 Atmosphère-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/>.
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
#include <stratosphere/os/os_memory_fence_api.hpp>
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018-2020 Atmosphère-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/>.
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
#include <vapours.hpp>
|
||||||
|
|
||||||
|
#if defined(ATMOSPHERE_OS_HORIZON)
|
||||||
|
#include <stratosphere/os/impl/os_memory_fence_api.os.horizon.hpp>
|
||||||
|
#else
|
||||||
|
#error "Unknown os for os::MemoryFence*"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace ams::os {
|
||||||
|
|
||||||
|
ALWAYS_INLINE void FenceMemoryStoreStore() { return impl::FenceMemoryStoreStore(); }
|
||||||
|
ALWAYS_INLINE void FenceMemoryStoreLoad() { return impl::FenceMemoryStoreLoad(); }
|
||||||
|
ALWAYS_INLINE void FenceMemoryStoreAny() { return impl::FenceMemoryStoreAny(); }
|
||||||
|
|
||||||
|
ALWAYS_INLINE void FenceMemoryLoadStore() { return impl::FenceMemoryLoadStore(); }
|
||||||
|
ALWAYS_INLINE void FenceMemoryLoadLoad() { return impl::FenceMemoryLoadLoad(); }
|
||||||
|
ALWAYS_INLINE void FenceMemoryLoadAny() { return impl::FenceMemoryLoadAny(); }
|
||||||
|
|
||||||
|
ALWAYS_INLINE void FenceMemoryAnyStore() { return impl::FenceMemoryLoadStore(); }
|
||||||
|
ALWAYS_INLINE void FenceMemoryAnyLoad() { return impl::FenceMemoryLoadLoad(); }
|
||||||
|
ALWAYS_INLINE void FenceMemoryAnyAny() { return impl::FenceMemoryLoadAny(); }
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018-2020 Atmosphère-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/>.
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
#include <vapours.hpp>
|
||||||
|
|
||||||
|
namespace ams::os {
|
||||||
|
|
||||||
|
struct WaitableHolderType;
|
||||||
|
struct WaitableManagerType;
|
||||||
|
|
||||||
|
Result SdkReplyAndReceive(os::WaitableHolderType **out, Handle reply_target, WaitableManagerType *manager);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -25,10 +25,10 @@ namespace ams::pgl {
|
|||||||
class EventObserver {
|
class EventObserver {
|
||||||
NON_COPYABLE(EventObserver);
|
NON_COPYABLE(EventObserver);
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<pgl::sf::IEventObserver> interface;
|
ams::sf::SharedPointer<pgl::sf::IEventObserver> interface;
|
||||||
public:
|
public:
|
||||||
EventObserver() { /* ... */ }
|
EventObserver() { /* ... */ }
|
||||||
explicit EventObserver(std::shared_ptr<pgl::sf::IEventObserver> intf) : interface(std::move(intf)) { /* ... */ }
|
explicit EventObserver(ams::sf::SharedPointer<pgl::sf::IEventObserver> intf) : interface(intf) { /* ... */ }
|
||||||
|
|
||||||
EventObserver(EventObserver &&rhs) {
|
EventObserver(EventObserver &&rhs) {
|
||||||
this->interface = std::move(rhs.interface);
|
this->interface = std::move(rhs.interface);
|
||||||
|
|||||||
@@ -20,12 +20,8 @@
|
|||||||
#include <stratosphere/pm.hpp>
|
#include <stratosphere/pm.hpp>
|
||||||
#include <stratosphere/pgl/pgl_types.hpp>
|
#include <stratosphere/pgl/pgl_types.hpp>
|
||||||
|
|
||||||
namespace ams::pgl::sf {
|
#define AMS_PGL_I_EVENT_OBSERVER_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, GetProcessEventHandle, (ams::sf::OutCopyHandle out), (out)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, GetProcessEventInfo, (ams::sf::Out<pm::ProcessEventInfo> out), (out))
|
||||||
|
|
||||||
#define AMS_PGL_I_EVENT_OBSERVER_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::pgl::sf, IEventObserver, AMS_PGL_I_EVENT_OBSERVER_INTERFACE_INFO);
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, GetProcessEventHandle, (ams::sf::OutCopyHandle out)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, GetProcessEventInfo, (ams::sf::Out<pm::ProcessEventInfo> out))
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IEventObserver, AMS_PGL_I_EVENT_OBSERVER_INTERFACE_INFO);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -21,25 +21,19 @@
|
|||||||
#include <stratosphere/pgl/pgl_types.hpp>
|
#include <stratosphere/pgl/pgl_types.hpp>
|
||||||
#include <stratosphere/pgl/sf/pgl_sf_i_event_observer.hpp>
|
#include <stratosphere/pgl/sf/pgl_sf_i_event_observer.hpp>
|
||||||
|
|
||||||
namespace ams::pgl::sf {
|
#define AMS_PGL_I_SHELL_INTERFACE_INTERFACE_INFO(C, H) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 0, Result, LaunchProgram, (ams::sf::Out<os::ProcessId> out, const ncm::ProgramLocation &loc, u32 pm_flags, u8 pgl_flags), (out, loc, pm_flags, pgl_flags)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 1, Result, TerminateProcess, (os::ProcessId process_id), (process_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 2, Result, LaunchProgramFromHost, (ams::sf::Out<os::ProcessId> out, const ams::sf::InBuffer &content_path, u32 pm_flags), (out, content_path, pm_flags)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 4, Result, GetHostContentMetaInfo, (ams::sf::Out<pgl::ContentMetaInfo> out, const ams::sf::InBuffer &content_path), (out, content_path)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 5, Result, GetApplicationProcessId, (ams::sf::Out<os::ProcessId> out), (out)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 6, Result, BoostSystemMemoryResourceLimit, (u64 size), (size)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 7, Result, IsProcessTracked, (ams::sf::Out<bool> out, os::ProcessId process_id), (out, process_id)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 8, Result, EnableApplicationCrashReport, (bool enabled), (enabled)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 9, Result, IsApplicationCrashReportEnabled, (ams::sf::Out<bool> out), (out)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 10, Result, EnableApplicationAllThreadDumpOnCrash, (bool enabled), (enabled)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 12, Result, TriggerApplicationSnapShotDumper, (pgl::SnapShotDumpType dump_type, const ams::sf::InBuffer &arg), (dump_type, arg)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 20, Result, GetShellEventObserver, (ams::sf::Out<ams::sf::SharedPointer<pgl::sf::IEventObserver>> out), (out)) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 21, Result, Command21NotImplemented, (ams::sf::Out<u64> out, u32 in, const ams::sf::InBuffer &buf1, const ams::sf::InBuffer &buf2), (out, in, buf1, buf2), hos::Version_11_0_0)
|
||||||
|
|
||||||
#define AMS_PGL_I_SHELL_INTERFACE_INTERFACE_INFO(C, H) \
|
AMS_SF_DEFINE_INTERFACE(ams::pgl::sf, IShellInterface, AMS_PGL_I_SHELL_INTERFACE_INTERFACE_INFO);
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, LaunchProgram, (ams::sf::Out<os::ProcessId> out, const ncm::ProgramLocation &loc, u32 pm_flags, u8 pgl_flags)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, TerminateProcess, (os::ProcessId process_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, LaunchProgramFromHost, (ams::sf::Out<os::ProcessId> out, const ams::sf::InBuffer &content_path, u32 pm_flags)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 4, Result, GetHostContentMetaInfo, (ams::sf::Out<pgl::ContentMetaInfo> out, const ams::sf::InBuffer &content_path)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 5, Result, GetApplicationProcessId, (ams::sf::Out<os::ProcessId> out)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 6, Result, BoostSystemMemoryResourceLimit, (u64 size)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 7, Result, IsProcessTracked, (ams::sf::Out<bool> out, os::ProcessId process_id)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 8, Result, EnableApplicationCrashReport, (bool enabled)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 9, Result, IsApplicationCrashReportEnabled, (ams::sf::Out<bool> out)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 10, Result, EnableApplicationAllThreadDumpOnCrash, (bool enabled)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 12, Result, TriggerApplicationSnapShotDumper, (SnapShotDumpType dump_type, const ams::sf::InBuffer &arg)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 20, Result, GetShellEventObserver, (ams::sf::Out<std::shared_ptr<pgl::sf::IEventObserver>> out)) \
|
|
||||||
AMS_SF_METHOD_INFO(C, H, 21, Result, Command21NotImplemented, (ams::sf::Out<u64> out, u32 in, const ams::sf::InBuffer &buf1, const ams::sf::InBuffer &buf2), hos::Version_11_0_0)
|
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(IShellInterface, AMS_PGL_I_SHELL_INTERFACE_INTERFACE_INFO);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user