fincs
3a5d0dae35
Linker script refactoring, see details:
...
- Added separate relro "segment" (introduced by [17.0.0+])
- Reordered sections to better reflect official layout
- Fixed handling of TLS segment alignment
2023-10-21 00:18:04 +02:00
MasaGratoR
d219884bfa
tmem: Add tmemCloseHandle(), tmemWaitForPermission(), use those functions in nv.c to fix a race condition ( #606 )
2023-04-14 18:33:16 +02:00
Michael Scire
1543e84627
svc: add MapInsecureMemory/UnmapInsecureMemory
2022-10-11 20:18:30 -07:00
Michael Scire
62755bebe0
svc: fix wrong ids for (Un)MapIoRegion
2022-06-27 17:34:41 +02:00
fincs
74c639ec3a
random.c: Avoid UB type punning that results in miscompilation
2021-12-05 19:31:42 +01:00
Michael Scire
49507b86a8
svc: add 13.0.0 svc changes
2021-09-18 12:34:58 +02:00
Michael Scire
d90afaacde
thread: set arguments/fields before CreateThread
2021-07-20 18:13:10 +02:00
fincs
95fca6753d
virtmem: Allow rng algorithm override
2021-05-02 18:26:40 +02:00
fincs
076657fd31
Allow user override of dynamic memory allocation functions throughout libnx
2021-01-22 18:37:46 +01:00
fincs
d53150f855
thread: Allow user override of automatic stack memory allocation
2021-01-17 17:48:08 +01:00
fincs
649f308d4b
Delete old virtmem API 🦀 🦀
2021-01-17 17:05:29 +01:00
fincs
74b295827f
Add svcGetResourceLimitPeakValue [11.0.0+]
2020-12-01 13:49:15 +01:00
Michael Scire
e5ae43f4c2
results: use R_VALUE for comparisons
2020-12-01 02:26:26 +01:00
fincs
8310f438ca
virtmem: Add memory reservation system
...
jit: Use virtmemFindCodeMemory on both codepaths; use virtmem reservations
in order to support the JitType_SetProcessMemoryPermission codepath
2020-10-30 16:07:38 +01:00
fincs
490d96e6eb
virtmem: Add virtmemFindCodeMemory to work around a quirk in 1.x kernel
2020-10-30 00:16:03 +01:00
fincs
970d982e57
Add diagAbortWithResult, see details:
...
- This is a (weak/overridable) function meant to be called when the
program encounters an unrecoverable error, but it's not fatal enough
to bring down the entire system with it.
- The default implementation uses svcBreak, passing the result code
in the user buffer.
- Replaced all usages of fatalThrow with diagAbortWithResult throughout
the entire library.
2020-10-29 13:40:35 +01:00
fincs
a05a44fca8
virtmem: Major rewrite to support ASLR, see details:
...
- Added virtmemLock/Unlock, needed for atomic find-and-map operations
- Added virtmemFindAslr, which looks for a random free area in AslrRegion
- virtmemReserve still exists for legacy callers who rely on sequential
allocation in order to avoid race conditions from concurrent uses
- Added virtmemFindStack, which searches within StackRegion instead
- Removed virtmemReserveStack/FreeStack
- Changed shmem/thread/tmem/codememory-jit to use the new virtmem API
- Legacy jit still uses virtmemReserve
2020-10-27 12:27:32 +01:00
fincs
7c6d7849f5
Remove obsolete kernel detection code
2020-10-27 12:27:32 +01:00
fincs
8d51f7de1c
jit: Transfer the responsibility of detecting whether CodeMemory syscalls are available/usable to the homebrew environment
2020-10-27 12:27:31 +01:00
fincs
4c6abe1e41
svcBreak: fix prototype, add and use BreakReason enum
2020-10-27 12:27:31 +01:00
fincs
e0c1dfe2ce
Add light event synchronization primitive [4.0.0+]
2020-10-27 12:27:20 +01:00
Michael Scire
3d726ed78c
mutex: rewrite to optimize
2020-05-17 17:46:59 +02:00
fincs
b0494c1acb
Update outdated comments and naming in jit.h/c
2020-04-27 13:46:55 +02:00
Michael Scire
cb7c1f87a8
svc: QueryIoMapping ABI change in 10.x
2020-04-14 21:29:38 +02:00
fincs
bf5331d178
shmemMap: Fix invalid libnx result
2020-04-10 17:16:57 +02:00
SciresM
4746827513
thread: add threadGetSelf(), add main thread to thread list. ( #392 )
2020-04-07 01:47:06 +02:00
Michael Scire
5d57c70a3e
fix calls to svcSetThreadActivity
2020-03-29 18:42:19 +02:00
Michael Scire
43549f4596
svc: fix definitions to better match kernel
2020-03-29 18:42:19 +02:00
SciresM
e5c501e5b6
svc: Add all missing SVC stubs ( #364 )
2020-01-18 21:39:05 +01:00
SciresM
afe030f08b
rwlock: revamp completely ( #350 )
...
Implements rwlockTryReadLock and rwlockTryWriteLock.
Also implements rwlockIsWriteLockHeldByCurrentThread and
rwlockIsOwnedByCurrentThread.
Also re-designs RwLock to have semantics identical to
Nintendo's (nn::os::ReaderWriterLock). The upshot is mostly
that the lock is now fully recursive/write-preferring.
2019-12-03 23:16:40 +01:00
Michael Scire
07ad046acf
svc: change TitleId to ProgramId
2019-10-28 12:17:55 +01:00
fincs
4ab2384449
fatal: Rename functions/types to match official names more closely
2019-10-24 23:25:07 +02:00
Michael Scire
145ad1ba87
virtmem: fix incorrect bounds check
2019-10-22 12:42:07 +02:00
SciresM
415adf5b93
threads: support using existing mem as stack ( #336 )
2019-10-19 04:25:23 +02:00
yellows8
4177031ebe
Use the same style for all system-versions.
2019-08-26 13:05:49 -04:00
fincs
21de119c68
Run TLS destructor after clearing TLS value, as per standard
2019-08-04 21:03:04 +02:00
SciresM
e1a6a463c2
Add enums for GetInfo/GetSystemInfo ( #292 )
2019-06-22 00:05:56 +02:00
Michael Scire
6b50fddd9b
Implement svcQueryProcessMemory
2019-04-21 13:48:59 +02:00
fincs
1c832bebd6
Avoid overwriting TLS[0x100] and TLS[0x102] as per 8.0.0
2019-04-20 19:19:34 +02:00
fincs
626b07fac8
Implement TLS slot support (with destructors)
2019-03-29 18:40:26 +01:00
plutoo
b7fe92f3a2
rwlock: Move over to condvar implementation. ( #255 )
...
This one is superior to the previous because it is write-preferring.
2019-03-28 23:53:04 +01:00
fincs
bf13da990a
Critical fix in new barrier impl
2019-02-23 21:09:41 +01:00
plutooo
e8f3964475
barrier: More efficient impl, maybe
2019-02-23 21:05:39 +01:00
fincs
11b7bece4a
Change all services except fatal to use hosversion* instead of kernelAboveXYZ
2019-02-18 21:48:49 +01:00
fincs
61cc738730
Introduce hosversion.h - HOS version detection utilities
...
- Simplify kernel/detect.h logic; introduce detectKernelVersion()
- Use set:sys (if available) during __appInit in order to initialize
the current HOS version
2019-02-18 21:48:41 +01:00
fincs
ee2e19ce38
Improve names/documentation for jit kernel patch functions in detect.h/c + codestylefixes
2019-02-16 16:42:08 +01:00
plutooo
17731d750e
Add function to test OFW behavior under CFW
2019-02-14 22:03:47 +01:00
plutooo
fc557cbf2a
Detect and use the CFW jit patch.
2019-02-13 22:40:00 +01:00
yellows8
00d0174c0a
Removed the buffer memset from tmemCreateFromMemory, tmemCreateFromMemory should not write to the user buffer.
2018-12-23 22:18:24 -05:00
fincs
252e8ef9ff
Add tmemCreateFromMemory
2018-12-20 16:12:22 +01:00