Commit graph

1644 commits

Author SHA1 Message Date
Lioncash a49970f85a k_thread: Remove [[nodiscard]] attribute from ClearWaitCancelled()
This function has a void return value, so this attribute doesn't apply
to it.
2021-04-12 10:17:38 -04:00
bunnei aee4fd29c9 Merge pull request #6099 from bunnei/derive-mem
Kernel Rework: Derive memory regions from board layout.
2021-04-10 00:02:52 -07:00
bunnei 9e80ed0809 Merge pull request #6156 from lioncash/lock-discard
kernel: Mark lock helper classes as [[nodiscard]]
2021-04-09 21:42:26 -07:00
bunnei f82684b920 Merge pull request #6155 from ameerj/kernel-12-rescnt
kernel: Increase event and session counts
2021-04-08 18:21:00 -07:00
bunnei 1ecfc8c501 Merge pull request #6154 from lioncash/svcrange2
svc: Expand SVC tables
2021-04-08 09:21:55 -07:00
Lioncash a875393fdb Amend bizarre clang-format suggestions 2021-04-07 01:52:08 -04:00
Lioncash 1af23a44b4 k_scoped_scheduler_lock_and_sleep: Mark class as [[nodiscard]]
Prevents logic bugs from slipping through.
2021-04-07 01:45:04 -04:00
Lioncash e295cb0474 k_scoped_lock: delete copy and move assignment operators
If we delete the copy and move constructor, we should also be deleting
the copy and move assignment operators (and even if this were intended,
it would be pretty odd to not document why it's done this way).
2021-04-07 01:25:57 -04:00
Lioncash 923efb53d7 k_scoped_lock: Mark class as [[nodiscard]]
Prevents logic bugs of the kind described in the previous commit from
slipping through.
2021-04-07 01:23:08 -04:00
Lioncash cd6ea98890 k_scheduler: Mark KScopedSchedulerLock as [[nodiscard]]
Prevents logic bugs like:

KScopedSchedulerLock{kernel};

instead of:

KScopedSchedulerLock lk{kernel};

from slipping through.
2021-04-07 01:19:29 -04:00
ameerj c7a0ebbba7 kernel: Increase event and session counts
12.x increased the number of available sessions and event resource counts
2021-04-07 01:01:05 -04:00
Lioncash 840fadc3e4 svc: Expand SVC tables
12.x expanded the range of SVC entries from 0x7F to 0xBF (with all new
entries being unused), so we can expand it to also match.
2021-04-07 00:55:33 -04:00
Lioncash 7737db89aa process_capability: Handle extended SVC range
12.x extended the range of SVC IDs, so we need to expand the range of
bits that need to be tested.

The upside of this is that we can eliminate a range check, given the
whole range is used.
2021-04-07 00:35:49 -04:00
bunnei e8dd3eca47 hle: kernel: Initialize preemption task after schedulers.
- Fixes a startup crash that occurs if CoreTiming tries to preempt before kernel initialization completes.
2021-03-27 10:04:13 -07:00
bunnei 50cdb650af hle: kernel: Breakup InitializeMemoryLayout. 2021-03-23 18:47:16 -07:00
bunnei abec6f016a hle: kernel: k_memory_region_type: Minor code cleanup. 2021-03-23 18:42:04 -07:00
bunnei f5173e80c5 hle: kernel: k_memory_region: Minor code cleanup. 2021-03-23 18:37:39 -07:00
bunnei 9d36ad5242 hle: kernel: k_memory_layout: Use pair instead of tuple. 2021-03-23 18:35:01 -07:00
bunnei 14f631b8c3 hle: kernel: k_system_control: Remove unnecessary inline. 2021-03-23 18:33:29 -07:00
bunnei 9fe89ad30d common: common_sizes: Move sizes to the Common namespace. 2021-03-23 18:31:46 -07:00
bunnei 9bfc12af71 hle: kernel: Merge KMemoryRegionAttr and KMemoryRegionType.
- Fixes clang errors with mixed enum arithmetic.
2021-03-21 15:53:21 -07:00
bunnei dc2507fce2 hle: kernel: Remove unused variable. 2021-03-21 15:47:24 -07:00
bunnei 8517b156ae hle: kernel: k_memory_region_type: Remove extra ". 2021-03-21 15:47:05 -07:00
bunnei 18c6e7e8df hle: kernel: k_memory_layout: Move KMemoryRegionAllocator out of global. 2021-03-21 14:45:13 -07:00
bunnei 79ca47ab3a hle: kernel: k_memory_layout: Derive memory regions based on board layout. 2021-03-21 14:45:13 -07:00
bunnei 643bc5bbc4 common: common_sizes: Move Invalid to Size_* prefix and add missing values. 2021-03-21 14:45:03 -07:00
bunnei 4387edcaa3 hle: kernel: k_memory_region: Refactor to simplify code. 2021-03-21 14:45:03 -07:00
bunnei c59d82d4cf hle: kernel: board: k_system_control: Extend to include memory region sizes. 2021-03-21 14:45:03 -07:00
bunnei 3eabb45a13 hle: kernel: board: Add secure_monitor module. 2021-03-21 14:45:03 -07:00
bunnei 60e9e9beb4 common: Move common sizes to their own header for code reuse. 2021-03-21 14:45:03 -07:00
bunnei 6775f9d758 hle: kernel: k_address_space_info: Cleanup. 2021-03-21 14:45:02 -07:00
bunnei cd09055341 hle: kernel: Add k_trace module. 2021-03-21 14:45:02 -07:00
bunnei 0e413fe782 hle: kernel: KSystemControl: Update to reflect board-specific behavior. 2021-03-21 14:45:02 -07:00
bunnei 74f0ee726c hle: kernel: KMemoryManager: Add CalculateManagementOverheadSize. 2021-03-21 14:45:02 -07:00
bunnei 693f08cd8b hle: kernel: KMemoryManager: Add aliases. 2021-03-21 14:45:02 -07:00
bunnei d25a181956 hle: kernel: Add architecture and board specific memory regions. 2021-03-21 14:45:02 -07:00
bunnei 0f5efc8f29 hle: kernel: KMemoryRegion: Derive region values. 2021-03-21 14:45:02 -07:00
bunnei 0aac780e5d hle: kernel: Migrate some code from Common::SpinLock to KSpinLock. 2021-03-21 14:45:02 -07:00
bunnei bbc5e3a0aa hle: kernel: Add initial KMemoryRegionType module. 2021-03-21 14:45:02 -07:00
bunnei 3000ebbf08 hle: kernel: Move KMemoryRegion to its own module and update. 2021-03-21 14:45:02 -07:00
bunnei e4b692bd16 common: Fiber: use a reference for YieldTo.
- Fixes another small leak.
2021-03-07 13:46:53 -08:00
bunnei 75519d107f hle: kernel: KThread: Rework dummy threads & fix memory leak.
- Dummy threads are created on thread local storage for all host threads.
- Fixes a leak by removing creation of fibers, which are not applicable here.
2021-03-05 17:10:57 -08:00
bunnei 845a217d5e Revert "core: Switch to unique_ptr for usage of Common::Fiber." 2021-03-05 17:08:17 -08:00
bunnei 3322f10f84 core: Switch to unique_ptr for usage of Common::Fiber.
- With using unique_ptr instead of shared_ptr, we have more explicit ownership of the context.
- Fixes a memory leak due to circular reference of the shared pointer.
2021-02-27 11:56:04 -08:00
bunnei cfe967f1ac Merge pull request #5953 from bunnei/memory-refactor-1
Kernel Rework: Memory updates and refactoring (Part 1)
2021-02-27 12:48:35 -07:00
ameerj 0d9fb9ca27 kernel: Fix resource release exception on exit
After rewriting the resource limit, objects releasing reserved resources require a live kernel instance.
This commit fixes exceptions that occur due to the kernel being destroyed before some objects released their resources, allowing for a graceful exit.
2021-02-20 20:51:11 -05:00
bunnei 5dbcaa2970 hle: kernel: Migrate PageHeap/PageTable to KPageHeap/KPageTable. 2021-02-18 16:16:25 -08:00
bunnei c21aa2479a hle: kernel: Migrate MemoryManager to KMemoryManager. 2021-02-18 16:16:25 -08:00
bunnei 21a22af0c5 hle: kernel: Migrate PageLinkedList to KPageLinkedList. 2021-02-18 16:16:25 -08:00
bunnei a4c5e6d964 hle: kernel: Migrate to KMemoryBlock, KMemoryBlockManager, and others. 2021-02-18 16:16:25 -08:00