Commit Graph

23 Commits

Author SHA1 Message Date
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
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
yellows8
4177031ebe
Use the same style for all system-versions. 2019-08-26 13:05:49 -04:00
SciresM
e1a6a463c2 Add enums for GetInfo/GetSystemInfo (#292) 2019-06-22 00:05:56 +02:00
fincs
11b7bece4a Change all services except fatal to use hosversion* instead of kernelAboveXYZ 2019-02-18 21:48:49 +01:00
plutooo
6977cb24f5 virtmem: Fix minor regression
We need to fetch alias region to make sure virtmemReserve() avoids returning addresses inside of it
2018-10-23 04:07:01 +02:00
Michael Scire
e942b9cc25 virtmem: Fix stack region mapping on 1.0.0 2018-10-22 22:34:11 +02: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
fincs
a8a15f7d16 Make fatalSimple error codes unique 2018-01-15 22:48:46 +01:00
plutoo
edcf789b6e C was developed in 1972 2018-01-06 13:54:59 +01:00
plutoo
282fdefe2b Align code style of MemoryInfo 2018-01-06 06:04:35 +01:00
plutoo
5739fda64a Make allocation of virtmem regions thread-safe 2018-01-01 22:35:54 +01:00
plutoo
5cad71213b Cache version values, fix guard paging of threads on 2.0.0+ 2018-01-01 22:28:12 +01:00
plutoo
de52de8e88 Fixes for 1.0.0 2017-11-26 20:44:42 +01:00
plutoo
85538c9fb3 Introducing thread.. 2017-10-08 18:39:33 +02:00
plutoo
a9555bb5b5 Implement virtual memory allocator 2017-10-08 15:11:59 +02:00
plutoo
3926969ebc Minor changes
* Refactored system/*
* Implemented all of tmem
* Introduced virtmem
2017-10-07 15:32:57 +02:00