Commit Graph

103 Commits

Author SHA1 Message Date
8f054c47f6 svc: Implement SetResourceLimitLimitValues
* Also correct existing name and add missing error codes
2023-11-30 14:27:05 +02:00
a8d869c347 core: Refactor resource limits 2023-11-30 13:03:18 +02:00
6ec079ede8 core: De-globalize HLE lock (#7212) 2023-11-28 14:15:27 -08:00
3f1f0aa7c2 arm: De-virtualize ThreadContext (#7119)
* arm: Move ARM_Interface to core namespace

* arm: De-virtualize ThreadContext
2023-11-06 17:55:30 -08:00
88ea66053e Miscallenious fixes to gl backend and qt frontend (#6834)
* renderer_gl: Make rasterizer normal class member

* It doesn't need to be heap allocated anymore

* gl_rasterizer: Remove default_texture

* It's unused

* gl_rasterizer: General cleanup

* gl_rasterizer: Lower case lambdas

* Match style with review comments from vulkan backend

* rasterizer_cache: Prevent memory leak

* Since the switch from shared_ptr these surfaces were no longer being destroyed properly. Use our garbage collector for that purpose to destroy it safely for both backends

* rasterizer_cache: Make temp copy of old surface

* The custom surface would override the memory region of the old region resulting in garbage data, this ensures the custom surface is constructed correctly

* citra_qt: Manually create dialog tabs

* Allows for custom constructors which is very useful. While at it, global state is now eliminated from configuration

* citra_qt: Eliminate global system usage

* core: Remove global system usage in memory and HIO

* citra_qt: Use qOverload

* tests: Run clang format

* gl_texture_runtime: Fix surface scaling
2023-08-02 01:40:39 +03:00
f8b8b6e53c core: De-globalize movie (#6659) 2023-08-01 02:57:38 +02:00
9cb14044ec kernel: Improvements to process cleanup. (#6680)
* kernel: Properly clean up process threads on exit.

* kernel: Track process-owned memory and free on destruction.

* apt: Implement DoApplicationJump via home menu when available.

* kernel: Move TLS allocation management to owning process.
2023-07-16 17:54:29 -07:00
cf9bb90ae3 code: Use std::span where appropriate (#6658)
* code: Use std::span when possible

* code: Prefix memcpy and memcmp with std::
2023-07-07 01:52:40 +03:00
4ccd9f24fb Merge pull request #6638 from GPUCode/new-log
common: Backport yuzu log improvements
2023-07-06 23:44:54 +03:00
2126c240cd core: backport some ResultCode updates (#6645)
Co-authored-by: Lioncash <mathew1800@gmail.com>
Co-authored-by: Morph <39850852+Morph1984@users.noreply.github.com>
2023-07-03 02:23:53 +02:00
b4c38372d1 common/log: Move Log namespace into the Common namespace
Forgot to move this over when I moved the rest of the source files with
lacking namespaces over.
2023-06-30 12:15:51 +03:00
34de77d429 Various miscelaneous changes (#6496) 2023-05-03 17:24:10 +02:00
41f13456c0 Chore: Enable warnings as errors on MSVC (#6456)
* tests: add Sanity test for SplitFilename83

fix test

fix test

* disable `C4715:not all control paths return a value` for nihstro includes

nihstro: no warn

* Chore: Enable warnings as errors on msvc + fix warnings

fixes

some more warnings

clang-format

* more fixes

* Externals: Add target_compile_options `/W0` nihstro-headers and ...

Revert "disable `C4715:not all control paths return a value` for nihstro includes"
This reverts commit 606d79b55d3044b744fb835025b8eb0f4ea5b757.

* src\citra\config.cpp: ReadSetting: simplify type casting

* settings.cpp: Get*Name: remove superflous logs
2023-05-01 22:38:58 +03:00
6e45de760e Cleanup new code, add docs and error handling 2023-04-04 13:13:24 -04:00
83138e0c63 Fix some build + impl errors with HIO
After rebase there were some API changes, also fix continuation logic in
the main gdbstub.
2023-03-31 14:05:57 -04:00
f92f494cab Stop execution when performing HIO request
Since the HIO request is basically treated like a syscall, we need to
stop emulation while waiting for the GDB client to reply with the
result. This ensures any memory queries etc. that GDB makes to fulfill
the HIO request are accessing memory as it was at the time of the
request, instead of afterwards.
2023-03-29 09:09:32 -04:00
6f23ee43ae Initial port of luma3ds' gdb_hio to Citra 2023-03-29 09:09:32 -04:00
f1c282775d kernel: Set system error status on svcBreak. 2023-03-21 14:19:42 -07:00
3fb48716c5 CreateThread invalid processor ID return error instead of assert. (#6354) 2023-03-21 17:06:07 +01:00
c96f54f022 Implement app management support (suspend, resume, close, etc) (#6322) 2023-03-10 00:44:26 +01:00
9c6035f254 Implement svcGetHandleInfo, svcOpenProcess/Thread, svcGetProcessList (#6243)
* Implement svcGetHandleInfo, svcOpenProcess/Thread, svcGetProcessList

* Apply suggestions

* Add comment to stubbed enum values in svcGetHandleInfo

* Revert u32 -> size_t
2023-01-15 21:50:54 +05:30
016ce6c286 Add 3GX plugin loader (#6172)
* Initial plugin loader support

* More plugin loader progress

* Organize code and more plugin features

* Fix clang-format

* Fix compilation and add android gui

* Fix clang-format

* Fix macos build

* Fix copy-paste bug and clang-format

* More merge fixes

* Make suggestions

* Move global variable to static member

* Fix typo

* Apply suggestions

* Proper initialization order

* Allocate plugin memory from SYSTEM instead of APPLICATION

* Do not mark free pages as RWX

* Fix plugins in old 3DS mode.

* Implement KernelSetState and notif 0x203

* Apply changes

* Remove unused variable

* Fix dynarmic commit

* Sublicense files with MIT License

* Remove non-ascii characters from license
2022-12-11 10:08:58 +02:00
1ddea27ac8 code: Cleanup and warning fixes from the Vulkan PR (#6163)
Co-authored-by: emufan4568 <geoster3d@gmail.com>
Co-authored-by: Kyle Kienapfel <Docteh@users.noreply.github.com>
2022-11-04 23:32:57 +01:00
593b0b2d8f Add svcGetSystemInfo 0x20000 to get citra information (#5955) 2022-04-14 19:58:44 +05:30
de3d7cf49f kernel/thread: Change owner_process to std::weak_ptr (#5325)
* kernel/thread: Change owner_process to std::weak_ptr

Previously this leaked almost all kernel objects. In short, Threads own Processes which own HandleTables which own maps of Objects which include Threads.

Changing this to weak_ptr at least got the camera interfaces to destruct properly. Did not really check the other objects though, and I think there are probably more leaks.

* hle/kernel: Lock certain objects while deserializing

When deserializing other kernel objects, these objects (`MemoryRegion`s and `VMManager`s) can possibly get modified. To avoid inconsistent state caused by destructor side-effects, we may as well simply lock them until loading is fully completed.

* Fix silly typo

Somehow this didn't break?!
2020-11-15 12:59:45 +01:00
LC
8ce81b19be General: Remove usages of ARRAY_SIZE where applicable. (#5392)
Same behavior, but without our own boilerplate function.
2020-06-19 09:10:45 -05:00
Ben
39463f1f6d ArmInterface: return ref instead of copy for GetTimer (#5227)
* ArmInterface: return ref instead of copy for GetTimer

* ArmInterface: add const ref GetTimer

* ArmInterface: return raw pointer instead of shared_ptr in GetTimer

* remove more unnecessary shared_ptr usage

* Fix save states

* fix unit tests
2020-04-22 07:44:58 +02:00
e6b40486c5 Add a couple of useful SVC logs 2020-04-11 19:47:06 +01:00
8f059ae398 Apply suggestions from code review
Co-Authored-By: Mat M. <mathew1800@gmail.com>
2020-03-29 11:39:46 +01:00
da3ab3d56e Merge branch 'master' into feature/savestates-2 2020-03-07 21:23:08 +00:00
Ben
55ec7031cc Core timing 2.0 (#4913)
* Core::Timing: Add multiple timer, one for each core

* revert clang-format; work on tests for CoreTiming

* Kernel:: Add support for multiple cores, asserts in HandleSyncRequest because Thread->status == WaitIPC

* Add some TRACE_LOGs

* fix tests

* make some adjustments to qt-debugger, cheats and gdbstub(probably still broken)

* Make ARM_Interface::id private, rework ARM_Interface ctor

* ReRename TimingManager to Timing for smaler diff

* addressed review comments
2020-02-21 19:31:32 +01:00
9525d81344 More base-derived fixes 2020-02-13 17:42:07 +08:00
116d22d562 Refactor out the wakeup_callback function pointer 2020-02-13 17:42:05 +08:00
a27dfc269a kernel: Add LLE request/reply recording
The 'translate' function is a great place to put this in IMO as it is possible to get both untranslated and translated cmdbufs. However a kernel reference has to be passed here, but it is not too hard fortunately.
2019-08-20 03:07:29 +08:00
cb0bd6530c kernel/svc: Add request registering
All necessary objects are available here, making this a great place for the registering part.
2019-08-20 03:07:27 +08:00
42535468c3 kernel/server_session: Return a std::pair from CreateSessionPair()
Keeps the return type consistent with the function name. While we're at
it, we can also reduce the amount of boilerplate involved with handling
these by using structured bindings.
2019-04-15 21:46:57 +02:00
1afc2c72d6 kernel/server_port: Return a std::pair from CreatePortPair()
Returns the same type that the function name describes.
2019-04-15 18:42:17 +02:00
21c71d21ae general: Use deducation guides for std::lock_guard and std::unique_lock
Since C++17, the introduction of deduction guides for locking facilities
means that we no longer need to hardcode the mutex type into the locks
themselves, making it easier to switch mutex types, should it ever be
necessary in the future.
2019-04-07 15:14:29 +02:00
5f11c5f733 Kernel: replace boost::intrusive_ptr with std::shared_ptr 2019-03-24 14:32:11 -04:00
5f6d9f1915 Kernel/IPC: use MemorySystem from parameter 2019-02-14 14:04:46 -05:00
c6b3186475 Memory: IsValidVirtualAddress can be global 2018-12-05 20:21:14 -05:00
2582d64fb3 Memory: move block operations into class 2018-12-05 20:21:14 -05:00
323990d402 Memory: move Read/Write8/16/32/64 and ReadCString into class 2018-12-05 20:21:14 -05:00
405218c3a7 Memory: move IsValidVirtualAddress into class 2018-12-05 20:21:14 -05:00
7e90abec78 Merge pull request #4442 from wwylele/memory-no-kernel
Memory: decouple from Kernel
2018-11-28 11:24:41 -05:00
86c36cb176 kernel/shared_memory: Make Map() and Unmap() take the target process by reference rather than as a pointer
Both member functions assume the passed in target process will not be
null. Instead of making this assumption implicit, we can change the
functions to be references and enforce this at the type-system level.
2018-11-23 17:00:12 +01:00
8871f5a4ac Memory: remove ReadBlock with current process 2018-11-19 11:16:55 -05:00
7308b8d294 Memory: remove IsValidVirtualAddress with current process 2018-11-19 11:16:55 -05:00
2b768da531 Merge pull request #4433 from wwylele/vmmanager-simple
VMManager: remove shared_ptr<vector> backing type
2018-11-19 11:13:22 -05:00
803f783f07 Merge pull request #4427 from wwylele/query-memory-merge
SVC: QueryMemory merges similar VMA
2018-11-19 11:10:15 -05:00