Commit Graph

1785 Commits

Author SHA1 Message Date
97e2604575 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
24900674b7 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
55fc808d64 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
03dda80e2b 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
cb7f2e5616 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
10d6e9f32b hle: kernel: Breakup InitializeMemoryLayout. 2021-03-23 18:47:16 -07:00
fb91647bca hle: kernel: k_memory_region_type: Minor code cleanup. 2021-03-23 18:42:04 -07:00
4eac8703d2 hle: kernel: k_memory_region: Minor code cleanup. 2021-03-23 18:37:39 -07:00
9032d21365 hle: kernel: k_memory_layout: Use pair instead of tuple. 2021-03-23 18:35:01 -07:00
a32190d0c2 hle: kernel: k_system_control: Remove unnecessary inline. 2021-03-23 18:33:29 -07:00
ab5995c7ae common: common_sizes: Move sizes to the Common namespace. 2021-03-23 18:31:46 -07:00
1d78190843 hle: kernel: Merge KMemoryRegionAttr and KMemoryRegionType.
- Fixes clang errors with mixed enum arithmetic.
2021-03-21 15:53:21 -07:00
3ffbe50e7d hle: kernel: Remove unused variable. 2021-03-21 15:47:24 -07:00
fc5205fc84 hle: kernel: k_memory_region_type: Remove extra ". 2021-03-21 15:47:05 -07:00
1996cae9cb hle: kernel: k_memory_layout: Move KMemoryRegionAllocator out of global. 2021-03-21 14:45:13 -07:00
343eaecd38 hle: kernel: k_memory_layout: Derive memory regions based on board layout. 2021-03-21 14:45:13 -07:00
8d0ba7ee49 common: common_sizes: Move Invalid to Size_* prefix and add missing values. 2021-03-21 14:45:03 -07:00
80688362cf hle: kernel: k_memory_region: Refactor to simplify code. 2021-03-21 14:45:03 -07:00
edbc505e52 hle: kernel: board: k_system_control: Extend to include memory region sizes. 2021-03-21 14:45:03 -07:00
10265ad0e4 hle: kernel: board: Add secure_monitor module. 2021-03-21 14:45:03 -07:00
28be8aec9a common: Move common sizes to their own header for code reuse. 2021-03-21 14:45:03 -07:00
01f04fee32 hle: kernel: k_address_space_info: Cleanup. 2021-03-21 14:45:02 -07:00
f2e1441567 hle: kernel: Add k_trace module. 2021-03-21 14:45:02 -07:00
5762517728 hle: kernel: KSystemControl: Update to reflect board-specific behavior. 2021-03-21 14:45:02 -07:00
a439867f2c hle: kernel: KMemoryManager: Add CalculateManagementOverheadSize. 2021-03-21 14:45:02 -07:00
43a29b5803 hle: kernel: KMemoryManager: Add aliases. 2021-03-21 14:45:02 -07:00
c17beefe3d hle: kernel: Add architecture and board specific memory regions. 2021-03-21 14:45:02 -07:00
3fb64da452 hle: kernel: KMemoryRegion: Derive region values. 2021-03-21 14:45:02 -07:00
5872561077 hle: kernel: Migrate some code from Common::SpinLock to KSpinLock. 2021-03-21 14:45:02 -07:00
541b4353e4 hle: kernel: Add initial KMemoryRegionType module. 2021-03-21 14:45:02 -07:00
778e0f8ec1 hle: kernel: Move KMemoryRegion to its own module and update. 2021-03-21 14:45:02 -07:00
8f7eb194af common: Fiber: use a reference for YieldTo.
- Fixes another small leak.
2021-03-07 13:46:53 -08:00
47af34003b 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
a5ab85ac37 Revert "core: Switch to unique_ptr for usage of Common::Fiber." 2021-03-05 17:08:17 -08:00
51fb0a6f96 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
09f7c355c6 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
8e4c9c9852 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
93e20867b0 hle: kernel: Migrate PageHeap/PageTable to KPageHeap/KPageTable. 2021-02-18 16:16:25 -08:00
b1e27890e8 hle: kernel: Migrate MemoryManager to KMemoryManager. 2021-02-18 16:16:25 -08:00
93109c870e hle: kernel: Migrate PageLinkedList to KPageLinkedList. 2021-02-18 16:16:25 -08:00
65e0178cc0 hle: kernel: Migrate to KMemoryBlock, KMemoryBlockManager, and others. 2021-02-18 16:16:25 -08:00
9e520e8f12 hle: kernel: Migrate SlabHeap to KSlabHeap. 2021-02-18 16:16:25 -08:00
1d162f28d1 hle: kernel: Migrate MemoryLayout to KMemoryLayout. 2021-02-18 16:16:25 -08:00
7ed5dd0d62 hle: kernel: Migrate AddressSpaceInfo to KAddressSpaceInfo. 2021-02-18 16:16:25 -08:00
701ef616b2 hle: kernel: memory_manager: Rename AllocateContinuous to AllocateContinuous. 2021-02-18 16:16:24 -08:00
f7a008d77f hle: kernel: KSystemControl does not belong in Memory namespace. 2021-02-18 16:16:24 -08:00
6a19086001 hle: kernel: memory: PageHeap: Migrate to KPageBitmap class. 2021-02-18 16:16:24 -08:00
a02566136c hle: kernel: Add KPageBitmap class. 2021-02-18 16:16:24 -08:00
e7c33d1ad6 hle: kernel: system_control: Add function GenerateRandomU64. 2021-02-18 16:16:24 -08:00
6da91da08e hle: kernel: Add KSpinLock implementation. 2021-02-18 16:16:24 -08:00