Commit Graph

21 Commits

Author SHA1 Message Date
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
fincs
076657fd31
Allow user override of dynamic memory allocation functions throughout libnx 2021-01-22 18:37:46 +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
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
plutooo
fb42ebe53a Fix memory leak in tmemCreate 2018-08-11 15:01:12 +02:00
plutoo
e112ab6968 Fix ipc session close race properly 2018-03-11 13:21:36 +01:00
plutoo
e162da18ff Fix race condition in tmem 2018-03-10 21:03:31 +01:00
yellows8
f7335b7ae5 Only clear allocated tmem when alloc was successful. 2018-03-01 22:57:44 -05:00
yellows8
20a549b46b Clear allocated tmem. 2018-03-01 22:55:17 -05:00
fincs
41da28eb5c Document kernel/: shmem.h, thread.h, tmem.h, virtmem.h 2018-02-10 22:40:11 +01:00
plutoo
6fa8370bfb This looks better 2018-01-22 20:11:55 +01:00
TuxSH
5abc4873d8 Include only what is really necessary...
add pragma once in every header, etc.
2018-01-22 18:42:57 +01:00
plutoo
e54bbc54ea Fix codestyle for results 2018-01-21 18:40:23 +01:00
plutoo
22e9a0fcc3 Jit bringup, improvements to virtmem 2018-01-20 13:56:12 +01:00
plutoo
b877e1b1c1 Why is this not crashing 2018-01-20 12:26:31 +01:00
plutoo
3ca6e65984 Aligning code style of kernel primitives 2018-01-06 06:10:55 +01:00
plutoo
99bd9c76aa Attempt to introduce newlib heap implementation 2017-10-09 21:24:11 +02:00
plutoo
3926969ebc Minor changes
* Refactored system/*
* Implemented all of tmem
* Introduced virtmem
2017-10-07 15:32:57 +02:00
plutoo
30650b5d69 Implemented heap, transfer memory, bsd cmd0 2017-09-10 23:17:57 +02:00