| 
									
										
										
										
											2020-12-28 22:42:16 -08:00
										 |  |  | // Copyright 2020 yuzu emulator team
 | 
					
						
							|  |  |  | // Licensed under GPLv2 or any later version
 | 
					
						
							|  |  |  | // Refer to the license.txt file included.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "common/common_types.h"
 | 
					
						
							| 
									
										
										
										
											2021-12-28 00:18:41 -08:00
										 |  |  | #include "common/literals.h"
 | 
					
						
							| 
									
										
										
										
											2020-12-28 22:42:16 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-24 02:40:31 -07:00
										 |  |  | namespace Kernel { | 
					
						
							|  |  |  | using Handle = u32; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-28 22:42:16 -08:00
										 |  |  | namespace Kernel::Svc { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-28 00:18:41 -08:00
										 |  |  | using namespace Common::Literals; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-30 01:14:02 -08:00
										 |  |  | constexpr s32 ArgumentHandleCountMax = 0x40; | 
					
						
							| 
									
										
										
										
											2020-12-28 22:42:16 -08:00
										 |  |  | constexpr u32 HandleWaitMask{1u << 30}; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-28 00:18:41 -08:00
										 |  |  | constexpr inline std::size_t HeapSizeAlignment = 2_MiB; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-24 02:40:31 -07:00
										 |  |  | constexpr inline Handle InvalidHandle = Handle(0); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | enum PseudoHandle : Handle { | 
					
						
							|  |  |  |     CurrentThread = 0xFFFF8000, | 
					
						
							|  |  |  |     CurrentProcess = 0xFFFF8001, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-01 12:53:37 -07:00
										 |  |  | constexpr bool IsPseudoHandle(Handle handle) { | 
					
						
							| 
									
										
										
										
											2021-04-24 02:40:31 -07:00
										 |  |  |     return handle == PseudoHandle::CurrentProcess || handle == PseudoHandle::CurrentThread; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-28 22:42:16 -08:00
										 |  |  | } // namespace Kernel::Svc
 |