Commit Graph

37 Commits

Author SHA1 Message Date
Yuri Kunde Schlesner 2cdb40d709 Kernel: Centralize error definitions in errors.h 2017-05-24 21:06:00 -07:00
Yuri Kunde Schlesner 84fbbe2629 Use negative priorities to avoid special-casing the self-include 2016-09-21 00:15:56 -07:00
Emmanuel Gil Peyrot ebdae19fd2 Remove empty newlines in #include blocks.
This makes clang-format useful on those.

Also add a bunch of forgotten transitive includes, which otherwise
prevented compilation.
2016-09-21 11:15:47 +09:00
Yuri Kunde Schlesner 396a8d91a4 Manually tweak source formatting and then re-run clang-format 2016-09-18 21:14:25 -07:00
Emmanuel Gil Peyrot dc8479928c Sources: Run clang-format on everything. 2016-09-18 09:38:01 +09:00
Subv ac2de12ed8 HLE/Applets: Give each applet its own block of heap memory, and use that when creating the framebuffer shared memory block. 2016-05-12 20:01:59 -05:00
Subv d261984f54 Kernel: Account for automatically-allocated shared memories in the amount of used linear heap memory. 2016-05-12 20:01:59 -05:00
Subv 5679d066b5 Kernel/SharedMemory: Log an error when Map fails. 2016-05-12 20:01:27 -05:00
Subv 0fb6d2a247 Kernel: Implemented shared memory permissions. 2016-05-12 20:01:26 -05:00
Subv 1bd0cf542f Kernel/SharedMemory: Properly implemented shared memory support.
Applications can request the kernel to allocate a piece of the linear heap for them when creating a shared memory object.
Shared memory areas are now properly mapped into the target processes when calling svcMapMemoryBlock.

Removed the APT Shared Font hack as it is no longer needed.
2016-05-12 20:00:32 -05:00
Subv d90d5a0ee6 HLE/SVC: Implement UnmapMemoryBlock.
This implementation will need to be (almost completely) changed when we implement multiprocess support.
2016-01-14 11:29:19 -05:00
Yuri Kunde Schlesner 687d973980 Core: Improve APT Shared Font hack
Should fix invalid read loops in some games
2015-08-26 21:28:58 -03:00
Yuri Kunde Schlesner 7ada357b2d Memmap: Re-organize memory function in two files
memory.cpp/h contains definitions related to acessing memory and
configuring the address space
mem_map.cpp/h contains higher-level definitions related to configuring
the address space accoording to the kernel and allocating memory.
2015-05-15 00:04:38 -03:00
Yuri Kunde Schlesner 774eea8374 Kernel: Zero-fill shared memory blocks when mapping
This works around crashes related to GSP/HID/etc. shared memory blocks
having garbage values. The proper fix requires proper management of
mapped memory blocks in the process.
2015-05-10 20:05:29 -03:00
Yuri Kunde Schlesner c96f22490a Kernel: Capture SharedMemory attributes at creation, not when mapping 2015-05-10 19:47:07 -03:00
Yuri Kunde Schlesner e1fbac3ca1 Common: Remove common.h 2015-05-07 15:45:22 -03:00
Gareth Higgins 25a43cd2ec Initialize base address to 0x0 2015-04-08 20:34:41 -04:00
Yuri Kunde Schlesner 88a4a808c6 Kernel: Stop creating useless Handles during object creation
They're finally unnecessary, and will stop cluttering the application's
handle table.
2015-02-02 15:37:09 -02:00
Yuri Kunde Schlesner 7725256f64 Explicitly instantiate constructors/destructors for Kernel objects
This should speed up compile times a bit, as well as enable more liberal
use of forward declarations. (Due to SharedPtr not trying to emit the
destructor anymore.)
2015-02-02 15:37:07 -02:00
Yuri Kunde Schlesner 869ec46683 Kernel: Introduce unique Object ids for debugging 2015-02-02 15:37:03 -02:00
Lioncash 96c174aed4 shared_memory: Fix assignments in SharedMemory::Map 2015-01-30 11:37:53 -05:00
Yuri Kunde Schlesner 4bb33dfc30 Kernel: Convert SharedMemory to not use Handles 2015-01-30 11:47:04 -02:00
Yuri Kunde Schlesner 9a345de2bd Kernel: Remove useless/duplicated comments; mark functions static 2015-01-30 11:47:01 -02:00
Yuri Kunde Schlesner 8ad41775cc Kernel: Start using boost::intrusive_ptr for lifetime management 2015-01-09 19:43:52 -02:00
Yuri Kunde Schlesner 7e2903cb74 Kernel: New handle manager
This handle manager more closely mirrors the behaviour of the CTR-OS
one. In addition object ref-counts and support for DuplicateHandle have
been added.

Note that support for DuplicateHandle is still experimental, since parts
of the kernel still use Handles internally, which will likely cause
troubles if two different handles to the same object are used to e.g.
wait on a synchronization primitive.
2014-12-28 11:52:55 -02:00
Yuri Kunde Schlesner 23f2142009 Kernel: Replace GetStaticHandleType by HANDLE_TYPE constants 2014-12-28 11:52:53 -02:00
Yuri Kunde Schlesner 73fba22c01 Rename ObjectPool to HandleTable 2014-12-28 11:52:52 -02:00
purpasmart96 ebfd831ccb License change 2014-12-20 21:20:24 -08:00
Yuri Kunde Schlesner 0600e2d8b5 Convert old logging calls to new logging macros 2014-12-13 02:08:02 -02:00
Yuri Kunde Schlesner 22c86824a4 Remove duplicated docs/update them for changed parameters. 2014-11-24 17:08:36 -02:00
Yuri Kunde Schlesner c2588403c0 HLE: Revamp error handling throrough the HLE code
All service calls in the CTR OS return result codes indicating the
success or failure of the call. Previous to this commit, Citra's HLE
emulation of services and the kernel universally either ignored errors
or returned dummy -1 error codes.

This commit makes an initial effort to provide an infrastructure for
error reporting and propagation which can be use going forward to make
HLE calls accurately return errors as the original system. A few parts
of the code have been updated to use the new system where applicable.

One part of this effort is the definition of the `ResultCode` type,
which provides facilities for constructing and parsing error codes in
the structured format used by the CTR.

The `ResultVal` type builds on `ResultCode` by providing a container for
values returned by function that can report errors. It enforces that
correct error checking will be done on function returns by preventing
the use of the return value if the function returned an error code.

Currently this change is mostly internal since errors are still
suppressed on the ARM<->HLE border, as a temporary compatibility hack.
As functionality is implemented and tested this hack can be eventually
removed.
2014-11-24 17:08:36 -02:00
Emmanuel Gil Peyrot f5d38649c7 Remove trailing spaces in every file but the ones imported from SkyEye, AOSP or generated 2014-11-19 09:03:07 +00:00
Lioncash ac58b76e71 Fix two format strings. 2014-11-14 12:08:26 -05:00
Yuri Kunde Schlesner d72708c1f5 Add `override` keyword through the code.
This was automated using `clang-modernize`.
2014-10-26 16:18:05 -02:00
Lioncash 98fa3f7cba Core: Alter the kernel string functions to use std::string instead of const char*.
Most functions already operate on std::strings. This also removes the need to manually null terminate thread names.
2014-08-17 23:12:20 -04:00
bunnei 7ff92c36ed SharedMemory: Updated MapSharedMemory to use an enum for permissions.
- Also added some safety checks to MapSharedMemory.
2014-07-05 10:24:54 -04:00
bunnei e547128185 Kernel: Added support for shared memory objects.
SharedMemory: Added optional name field for tracking known objects.
2014-07-05 01:21:05 -04:00