59 Commits

Author SHA1 Message Date
TuxSH
fcd08d6614 Patch kernel11 to remove checks on core2/3 thread creation
This stubs checks in SvcCreateThread and SvcSetProcessIdealProcessor
that applied when creating threads on core2 and core3. This allows
non-sysmodules to create threads on core3.

Please note, core2 access was already being automatically granted to
3dsx apps for a long time (this is controlled through a kernel flag),
and other apps that needed it had that flag too.
This commit thus changes nothing for all these applications.

Do not create threads on core3 unless you know exactly what you're doing.
On N3DS, gsp (GPU sysmodule) depends on qtm (head-tracking sysmodule) which
runs many threads at very high priority on core3. Running code that needs the
GPU (including printf) on core3 can thus result in thread starvation /
deadlock.

If you just need an extra application core, just use core2 as it is intended
for that exact purpose and is by default completely idle.

Closes #1668
2022-12-17 23:47:19 +01:00
TuxSH
4de0375bde kext: fix bug in rosalinaThreadLockPredicate (thanks @hax0kartik) 2022-05-21 20:19:36 +01:00
TuxSH
6573fc4247 k11ext: fix wrong condition bug 2022-05-02 15:57:59 +01:00
TuxSH
d957494d45 kext: even more perf improvements
Turns out the undef handler path is quite hot, as only one thread per core can have VFP enabled at a time.
2022-04-12 23:55:08 +01:00
TuxSH
cb398f1e4a ldr => ldrb 2022-04-11 01:06:59 +01:00
TuxSH
ef842dda2a Fix extremely obnoxious race-cond+uninit handle bug
This is mostly a libctru bug (well, sort of).

This can only happen to built-in sysmodules, and to
processes waiting for err:f, that fail to obtain
handles through svcConnectToPort first try; and only
prior to 11.0.

Prior to fw 11.0, kernel didn't zero-initialize output
handles, and thus the output handle gets filled with
junk (leaked kernel stack data) in case of failure.
Libctru does not account for this, and closes such
handles anyway (in srvInit, errfInit, and possibly
more).

The problem is that, in our case, that garbage was
equal to 0x8000, actually a valid handle, in fact
the first handle to be created (and not closed) in
a process... a handle to KAddressArbiter.

Accidentally closing this handle resulted in one or
more KIPs spin-waiting and starving core1, resulting
in an inability to boot.

We fix this simply by replicating what recent k11 does,
in kext (for svcConnectToPort). For srvGetServiceHandle,
add two layers of safety.
2022-04-10 22:19:32 +01:00
TuxSH
859b11a27d Fix k11ext regression 2022-04-10 00:05:36 +01:00
TuxSH
c64f94bc82 kernel ext: perf improvements 2022-04-05 22:23:09 +01:00
TuxSH
676bbf0d88 Moved config file to INI, and more
- Add support for saving screen filters color temperature and NTP timezone offset (you still need to go to misc->save config)
- some advanced options moved to "in ini file only"; "patch games" is now enabled by default
- ntp: fix support for UTC+12 to +14
- remove deprecated custom svc 0x2e
2022-03-28 20:30:02 +01:00
TuxSH
99a2b8e3b2 Disable gcc 11 false positives 2021-04-30 19:08:50 +01:00
TuxSH
87fa35ccfd arm9 exception handlers: add arm9 mem dumping feature 2020-11-22 00:00:12 +00:00
TuxSH
ba26ae0f1c k11ext: refactor ndm:u workaround 2020-07-15 17:33:47 +01:00
TuxSH
786adf0268 k11ext: fix oops 2020-07-15 00:56:25 +01:00
TuxSH
2af05220c2 rosalina: properly rewrite luminance-setting menu, etc. 2020-07-14 22:10:13 +01:00
TuxSH
991f51831d kext: add hid/ir thread locking 2020-07-07 23:27:15 +01:00
TuxSH
704e08dc23 revert the memory map to the old one (mostly) 2020-05-18 22:15:34 +01:00
TuxSH
19d95782e1 kext: fix outer memory cacheability on newer versions 2020-05-18 20:48:54 +01:00
TuxSH
adda19ecb2 so bascially rosalina's image...
was in BASE (hardcoded by kernel) while its heaps were in SYSTEM. Fix this; also put the kext where BASE was.
2020-05-18 01:15:44 +01:00
TuxSH
b02d0346fd rosalina: add hidden debug info menu 2020-05-17 22:48:26 +01:00
TuxSH
0da90f61fc Fix ODR bugs 2020-05-05 18:13:32 +01:00
TuxSH
166bdbeb7d Add option to run rosalina on N3DS SAFE_FIRM.
Also enables a qtm error bypass
2020-05-02 23:32:21 +01:00
TuxSH
d4dcf1a3e9 k11ext: support SAFE_FIRM in rosalinaThreadLockPredicate 2020-05-02 14:44:39 +01:00
TuxSH
43fd137d55 Use kernel version minor 2020-05-02 12:35:44 +01:00
TuxSH
c7a3a0278c add quick luma detection getinfo 2020-04-28 10:42:30 +01:00
TuxSH
cd68b66c03 change kext base address to 0x70000000 2020-04-28 02:39:57 +01:00
TuxSH
33431cb939 pm/kext: make pm terminate Rosalina, removing the need for a dodgy kext hook 2020-04-26 20:33:24 +01:00
TuxSH
31891efbca Current year is 2020 2020-04-25 13:42:10 +01:00
TuxSH
58f3edda12 ARM => Arm 2020-04-25 13:17:23 +01:00
TuxSH
09b2bf5fb1 fix build with newer gcc 2019-06-16 23:20:40 +02:00
TuxSH
e688ec9257 move patches to pm 2019-03-29 19:07:24 +01:00
TuxSH
ae1f85d341 K11Ext: add GetSystemInfo k11extSize 2019-03-29 18:23:52 +01:00
TuxSH
68b8c99ad0 Fix parallel building 2019-03-16 13:10:30 +01:00
TuxSH
244409fc98 Change k11 mapping logic again 2019-03-15 23:03:24 +01:00
TuxSH
f3b2a6c30d Fix some of the bugs 2019-03-15 23:03:24 +01:00
TuxSH
35ad240018 Rewrite k11ext mmu mapping func + linker script 2019-03-15 23:03:23 +01:00
TuxSH
e64f267e4c Fix section declarations in .s files 2019-03-15 23:03:23 +01:00
TuxSH
d28e961adc Use <string.h> & <3ds/exheader.h>, fix some bugs, etc.
also fix all warnings and use -Werror
2019-03-15 23:03:23 +01:00
TuxSH
9e7e967a5f Fix bss being PROGBITS, etc. 2019-03-15 23:03:22 +01:00
TuxSH
4b40dd52f4 Give a proper build system for each sysmodule, k11ext, arm11.
Previously, these Makefiles didn't correctly track header changes.
The project doesn't build as a whole, future commits will fix it.
2019-03-15 23:03:19 +01:00
BuildTools
1c7b55ee1e Bump copyright year 2019-02-24 18:04:32 -07:00
Aurora Wright
53622d777b Fix https://github.com/AuroraWright/Luma3DS/issues/1095 and https://github.com/AuroraWright/Luma3DS/issues/1118 2018-08-21 18:57:45 +02:00
TuxSH
1600171ffa Bump copyright year 2018-06-14 18:13:57 +02:00
Nanquitas
dc195dffad
Fix KProcessHandleTable__ToKThread on latest fw 2018-04-26 19:30:50 +02:00
TuxSH
6a68a77973 Rewrite the ARM9 exception handlers, ...
- Fix patchArm9ExceptionHandlersInstall for older versions

- Fix some bugs in the ARM11 exception handlers

- Other, minor, changes
2018-01-04 18:40:11 +01:00
Mikaela RJ Szekely
93561003e8 Implement #989: Add configurable splash duration 2017-12-28 21:50:06 -05:00
TuxSH
506b16db37 Fix watchpoints handling (huge thanks to @Nanquitas) 2017-11-22 01:24:35 +01:00
TuxSH
22a8661fe1 Always patch FS and P9, remove SM service checks 2017-11-02 21:52:14 +01:00
Aurora Wright
13317b9548 Change ntrboot behavior, turn Luma into a chainloader when used as ntrboot FIRM as it can not be functional, disable FIRM protection when ran from ntrboot B9S 2017-08-20 16:08:54 +02:00
TuxSH
3907c46980 Follow ARM's documentation on hw watchpoints to the letter 2017-07-20 00:56:08 +02:00
TuxSH
cfc6cf24bf Some kext refactoring 2017-07-16 18:58:20 +02:00