mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	kernel/timer: Make data members private where applicable
Instead, we can just expose functions that return the queryable state instead of letting anything modify it.
This commit is contained in:
		
							parent
							
								
									4a3c4f5f67
								
							
						
					
					
						commit
						8e103d0675
					
				
					 3 changed files with 23 additions and 10 deletions
				
			
		|  | @ -981,8 +981,9 @@ static ResultCode ClearEvent(Handle handle) { | |||
| 
 | ||||
| /// Creates a timer
 | ||||
| static ResultCode CreateTimer(Handle* out_handle, u32 reset_type) { | ||||
|     SharedPtr<Timer> timer = Timer::Create(static_cast<ResetType>(reset_type)); | ||||
|     timer->name = Common::StringFromFormat("timer-%08x", Core::CPU().GetReg(14)); | ||||
|     SharedPtr<Timer> timer = | ||||
|         Timer::Create(static_cast<ResetType>(reset_type), | ||||
|                       Common::StringFromFormat("timer-%08x", Core::CPU().GetReg(14))); | ||||
|     CASCADE_RESULT(*out_handle, g_handle_table.Create(std::move(timer))); | ||||
| 
 | ||||
|     LOG_TRACE(Kernel_SVC, "called reset_type=0x{:08X} : created handle=0x{:08X}", reset_type, | ||||
|  |  | |||
|  | @ -32,13 +32,17 @@ public: | |||
|         return HANDLE_TYPE; | ||||
|     } | ||||
| 
 | ||||
|     ResetType reset_type; ///< The ResetType of this timer
 | ||||
|     ResetType GetResetType() const { | ||||
|         return reset_type; | ||||
|     } | ||||
| 
 | ||||
|     bool signaled;    ///< Whether the timer has been signaled or not
 | ||||
|     std::string name; ///< Name of timer (optional)
 | ||||
|     u64 GetInitialDelay() const { | ||||
|         return initial_delay; | ||||
|     } | ||||
| 
 | ||||
|     u64 initial_delay;  ///< The delay until the timer fires for the first time
 | ||||
|     u64 interval_delay; ///< The delay until the timer fires after the first time
 | ||||
|     u64 GetIntervalDelay() const { | ||||
|         return interval_delay; | ||||
|     } | ||||
| 
 | ||||
|     bool ShouldWait(Thread* thread) const override; | ||||
|     void Acquire(Thread* thread) override; | ||||
|  | @ -67,6 +71,14 @@ private: | |||
|     Timer(); | ||||
|     ~Timer() override; | ||||
| 
 | ||||
|     ResetType reset_type; ///< The ResetType of this timer
 | ||||
| 
 | ||||
|     u64 initial_delay;  ///< The delay until the timer fires for the first time
 | ||||
|     u64 interval_delay; ///< The delay until the timer fires after the first time
 | ||||
| 
 | ||||
|     bool signaled;    ///< Whether the timer has been signaled or not
 | ||||
|     std::string name; ///< Name of timer (optional)
 | ||||
| 
 | ||||
|     /// Handle used as userdata to reference this object when inserting into the CoreTiming queue.
 | ||||
|     Handle callback_handle; | ||||
| }; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue