summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/hle/kernel/process.h2
-rw-r--r--src/core/hle/kernel/svc.cpp19
-rw-r--r--src/core/hle/kernel/svc.h13
-rw-r--r--src/core/hle/kernel/vm_manager.cpp4
-rw-r--r--src/core/hle/service/am/applet_oe.cpp53
-rw-r--r--src/core/memory.h4
6 files changed, 90 insertions, 5 deletions
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h
index 20b4e401c..add98472f 100644
--- a/src/core/hle/kernel/process.h
+++ b/src/core/hle/kernel/process.h
@@ -131,6 +131,8 @@ public:
131 /// Bitmask of allowed CPUs that this process' threads can run on. TODO(Subv): Actually parse 131 /// Bitmask of allowed CPUs that this process' threads can run on. TODO(Subv): Actually parse
132 /// this value from the process header. 132 /// this value from the process header.
133 u32 allowed_processor_mask = THREADPROCESSORID_DEFAULT_MASK; 133 u32 allowed_processor_mask = THREADPROCESSORID_DEFAULT_MASK;
134 u32 allowed_thread_priority_mask = 0xFFFFFFFF;
135 u32 is_virtual_address_memory_enabled = 0;
134 /// Current status of the process 136 /// Current status of the process
135 ProcessStatus status; 137 ProcessStatus status;
136 138
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 6b3fd13c9..056ba28ef 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -312,6 +312,15 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id)
312 case GetInfoType::AllowedCpuIdBitmask: 312 case GetInfoType::AllowedCpuIdBitmask:
313 *result = g_current_process->allowed_processor_mask; 313 *result = g_current_process->allowed_processor_mask;
314 break; 314 break;
315 case GetInfoType::AllowedThreadPrioBitmask:
316 *result = g_current_process->allowed_thread_priority_mask;
317 break;
318 case GetInfoType::MapRegionBaseAddr:
319 *result = vm_manager.GetAddressSpaceBaseAddr();
320 break;
321 case GetInfoType::MapRegionSize:
322 *result = vm_manager.GetAddressSpaceSize();
323 break;
315 case GetInfoType::TotalMemoryUsage: 324 case GetInfoType::TotalMemoryUsage:
316 *result = vm_manager.GetTotalMemoryUsage(); 325 *result = vm_manager.GetTotalMemoryUsage();
317 break; 326 break;
@@ -333,6 +342,9 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id)
333 case GetInfoType::NewMapRegionSize: 342 case GetInfoType::NewMapRegionSize:
334 *result = vm_manager.GetNewMapRegionSize(); 343 *result = vm_manager.GetNewMapRegionSize();
335 break; 344 break;
345 case GetInfoType::IsVirtualAddressMemoryEnabled:
346 *result = g_current_process->is_virtual_address_memory_enabled;
347 break;
336 default: 348 default:
337 UNIMPLEMENTED(); 349 UNIMPLEMENTED();
338 } 350 }
@@ -707,6 +719,11 @@ static ResultCode CreateTransferMemory(Handle* handle, VAddr addr, u64 size, u32
707 return RESULT_SUCCESS; 719 return RESULT_SUCCESS;
708} 720}
709 721
722static ResultCode SetThreadCoreMask(u64, u64, u64) {
723 LOG_WARNING(Kernel_SVC, "(STUBBED) called");
724 return RESULT_SUCCESS;
725}
726
710namespace { 727namespace {
711struct FunctionDef { 728struct FunctionDef {
712 using Func = void(); 729 using Func = void();
@@ -733,7 +750,7 @@ static const FunctionDef SVC_Table[] = {
733 {0x0C, SvcWrap<GetThreadPriority>, "GetThreadPriority"}, 750 {0x0C, SvcWrap<GetThreadPriority>, "GetThreadPriority"},
734 {0x0D, SvcWrap<SetThreadPriority>, "SetThreadPriority"}, 751 {0x0D, SvcWrap<SetThreadPriority>, "SetThreadPriority"},
735 {0x0E, nullptr, "GetThreadCoreMask"}, 752 {0x0E, nullptr, "GetThreadCoreMask"},
736 {0x0F, nullptr, "SetThreadCoreMask"}, 753 {0x0F, SvcWrap<SetThreadCoreMask>, "SetThreadCoreMask"},
737 {0x10, SvcWrap<GetCurrentProcessorNumber>, "GetCurrentProcessorNumber"}, 754 {0x10, SvcWrap<GetCurrentProcessorNumber>, "GetCurrentProcessorNumber"},
738 {0x11, nullptr, "SignalEvent"}, 755 {0x11, nullptr, "SignalEvent"},
739 {0x12, nullptr, "ClearEvent"}, 756 {0x12, nullptr, "ClearEvent"},
diff --git a/src/core/hle/kernel/svc.h b/src/core/hle/kernel/svc.h
index 610cd1d7d..a56fd3602 100644
--- a/src/core/hle/kernel/svc.h
+++ b/src/core/hle/kernel/svc.h
@@ -24,14 +24,27 @@ struct PageInfo {
24enum class GetInfoType : u64 { 24enum class GetInfoType : u64 {
25 // 1.0.0+ 25 // 1.0.0+
26 AllowedCpuIdBitmask = 0, 26 AllowedCpuIdBitmask = 0,
27 AllowedThreadPrioBitmask = 1,
28 MapRegionBaseAddr = 2,
29 MapRegionSize = 3,
30 HeapRegionBaseAddr = 4,
31 HeapRegionSize = 5,
27 TotalMemoryUsage = 6, 32 TotalMemoryUsage = 6,
28 TotalHeapUsage = 7, 33 TotalHeapUsage = 7,
34 IsCurrentProcessBeingDebugged = 8,
35 ResourceHandleLimit = 9,
36 IdleTickCount = 10,
29 RandomEntropy = 11, 37 RandomEntropy = 11,
38 PerformanceCounter = 0xF0000002,
30 // 2.0.0+ 39 // 2.0.0+
31 AddressSpaceBaseAddr = 12, 40 AddressSpaceBaseAddr = 12,
32 AddressSpaceSize = 13, 41 AddressSpaceSize = 13,
33 NewMapRegionBaseAddr = 14, 42 NewMapRegionBaseAddr = 14,
34 NewMapRegionSize = 15, 43 NewMapRegionSize = 15,
44 // 3.0.0+
45 IsVirtualAddressMemoryEnabled = 16,
46 TitleId = 18,
47 PrivilegedProcessId = 19,
35}; 48};
36 49
37void CallSVC(u32 immediate); 50void CallSVC(u32 immediate);
diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp
index 650d47925..bf261699e 100644
--- a/src/core/hle/kernel/vm_manager.cpp
+++ b/src/core/hle/kernel/vm_manager.cpp
@@ -357,12 +357,12 @@ void VMManager::UpdatePageTableForVMA(const VirtualMemoryArea& vma) {
357 357
358u64 VMManager::GetTotalMemoryUsage() { 358u64 VMManager::GetTotalMemoryUsage() {
359 LOG_WARNING(Kernel, "(STUBBED) called"); 359 LOG_WARNING(Kernel, "(STUBBED) called");
360 return 0x400000; 360 return 0xBE000000;
361} 361}
362 362
363u64 VMManager::GetTotalHeapUsage() { 363u64 VMManager::GetTotalHeapUsage() {
364 LOG_WARNING(Kernel, "(STUBBED) called"); 364 LOG_WARNING(Kernel, "(STUBBED) called");
365 return 0x10000; 365 return 0x0;
366} 366}
367 367
368VAddr VMManager::GetAddressSpaceBaseAddr() { 368VAddr VMManager::GetAddressSpaceBaseAddr() {
diff --git a/src/core/hle/service/am/applet_oe.cpp b/src/core/hle/service/am/applet_oe.cpp
index f65d6b9f5..b629ac509 100644
--- a/src/core/hle/service/am/applet_oe.cpp
+++ b/src/core/hle/service/am/applet_oe.cpp
@@ -54,7 +54,14 @@ class ISelfController final : public ServiceFramework<ISelfController> {
54public: 54public:
55 ISelfController() : ServiceFramework("ISelfController") { 55 ISelfController() : ServiceFramework("ISelfController") {
56 static const FunctionInfo functions[] = { 56 static const FunctionInfo functions[] = {
57 {11, &ISelfController::SetOperationModeChangedNotification,
58 "SetOperationModeChangedNotification"},
59 {12, &ISelfController::SetPerformanceModeChangedNotification,
60 "SetPerformanceModeChangedNotification"},
57 {13, &ISelfController::SetFocusHandlingMode, "SetFocusHandlingMode"}, 61 {13, &ISelfController::SetFocusHandlingMode, "SetFocusHandlingMode"},
62 {14, &ISelfController::SetRestartMessageEnabled, "SetRestartMessageEnabled"},
63 {16, &ISelfController::SetOutOfFocusSuspendingEnabled,
64 "SetOutOfFocusSuspendingEnabled"},
58 }; 65 };
59 RegisterHandlers(functions); 66 RegisterHandlers(functions);
60 } 67 }
@@ -69,6 +76,37 @@ private:
69 76
70 LOG_WARNING(Service, "(STUBBED) called"); 77 LOG_WARNING(Service, "(STUBBED) called");
71 } 78 }
79
80 void SetRestartMessageEnabled(Kernel::HLERequestContext& ctx) {
81 IPC::RequestBuilder rb{ctx, 2};
82 rb.Push(RESULT_SUCCESS);
83
84 LOG_WARNING(Service, "(STUBBED) called");
85 }
86
87 void SetPerformanceModeChangedNotification(Kernel::HLERequestContext& ctx) {
88 IPC::RequestBuilder rb{ctx, 2};
89 rb.Push(RESULT_SUCCESS);
90
91 LOG_WARNING(Service, "(STUBBED) called");
92 }
93
94 void SetOperationModeChangedNotification(Kernel::HLERequestContext& ctx) {
95 IPC::RequestBuilder rb{ctx, 2};
96 rb.Push(RESULT_SUCCESS);
97
98 LOG_WARNING(Service, "(STUBBED) called");
99 }
100
101 void SetOutOfFocusSuspendingEnabled(Kernel::HLERequestContext& ctx) {
102 // Takes 3 input u8s with each field located immediately after the previous u8, these are
103 // bool flags. No output.
104
105 IPC::RequestBuilder rb{ctx, 2};
106 rb.Push(RESULT_SUCCESS);
107
108 LOG_WARNING(Service, "(STUBBED) called");
109 }
72}; 110};
73 111
74class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> { 112class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> {
@@ -119,6 +157,9 @@ public:
119 IApplicationFunctions() : ServiceFramework("IApplicationFunctions") { 157 IApplicationFunctions() : ServiceFramework("IApplicationFunctions") {
120 static const FunctionInfo functions[] = { 158 static const FunctionInfo functions[] = {
121 {22, &IApplicationFunctions::SetTerminateResult, "SetTerminateResult"}, 159 {22, &IApplicationFunctions::SetTerminateResult, "SetTerminateResult"},
160 {66, &IApplicationFunctions::InitializeGamePlayRecording,
161 "InitializeGamePlayRecording"},
162 {67, &IApplicationFunctions::SetGamePlayRecordingState, "SetGamePlayRecordingState"},
122 }; 163 };
123 RegisterHandlers(functions); 164 RegisterHandlers(functions);
124 } 165 }
@@ -136,6 +177,18 @@ private:
136 177
137 LOG_WARNING(Service, "(STUBBED) called, result=0x%08X", result); 178 LOG_WARNING(Service, "(STUBBED) called, result=0x%08X", result);
138 } 179 }
180
181 void InitializeGamePlayRecording(Kernel::HLERequestContext& ctx) {
182 IPC::RequestBuilder rb{ctx, 2};
183 rb.Push(RESULT_SUCCESS);
184 LOG_WARNING(Service, "(STUBBED) called");
185 }
186
187 void SetGamePlayRecordingState(Kernel::HLERequestContext& ctx) {
188 IPC::RequestBuilder rb{ctx, 2};
189 rb.Push(RESULT_SUCCESS);
190 LOG_WARNING(Service, "(STUBBED) called");
191 }
139}; 192};
140 193
141class ILibraryAppletCreator final : public ServiceFramework<ILibraryAppletCreator> { 194class ILibraryAppletCreator final : public ServiceFramework<ILibraryAppletCreator> {
diff --git a/src/core/memory.h b/src/core/memory.h
index 91bd4d889..7e554f394 100644
--- a/src/core/memory.h
+++ b/src/core/memory.h
@@ -136,7 +136,7 @@ enum : VAddr {
136 136
137 /// Application heap (includes stack). 137 /// Application heap (includes stack).
138 HEAP_VADDR = 0x108000000, 138 HEAP_VADDR = 0x108000000,
139 HEAP_SIZE = 0x18000000, 139 HEAP_SIZE = 0xF0000000,
140 HEAP_VADDR_END = HEAP_VADDR + HEAP_SIZE, 140 HEAP_VADDR_END = HEAP_VADDR + HEAP_SIZE,
141 141
142 /// Area where shared memory buffers are mapped onto. 142 /// Area where shared memory buffers are mapped onto.
@@ -177,7 +177,7 @@ enum : VAddr {
177 SHARED_PAGE_VADDR_END = SHARED_PAGE_VADDR + SHARED_PAGE_SIZE, 177 SHARED_PAGE_VADDR_END = SHARED_PAGE_VADDR + SHARED_PAGE_SIZE,
178 178
179 /// Area where TLS (Thread-Local Storage) buffers are allocated. 179 /// Area where TLS (Thread-Local Storage) buffers are allocated.
180 TLS_AREA_VADDR = 0x1FF82000, 180 TLS_AREA_VADDR = 0x228000000,
181 TLS_ENTRY_SIZE = 0x200, 181 TLS_ENTRY_SIZE = 0x200,
182 182
183 /// Equivalent to LINEAR_HEAP_VADDR, but expanded to cover the extra memory in the New 3DS. 183 /// Equivalent to LINEAR_HEAP_VADDR, but expanded to cover the extra memory in the New 3DS.