mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 20:12:43 +00:00 
			
		
		
		
	 9b8b8c0e04
			
		
	
	
		9b8b8c0e04
		
	
	
	
	
		
			
			Instead of using ifdefs to use the correct platform-specific methods, we can just use the same pattern we use for the microseconds_delay function which has specific implementations for each Arch CPU subdirectory. When linking a kernel image, the actual correct and platform-specific power-state changing methods will be called in Firmware/PowerState.cpp file.
		
			
				
	
	
		
			24 lines
		
	
	
	
		
			387 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
	
		
			387 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2023, Liav A. <liavalb@hotmail.co.il>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include <Kernel/Arch/PowerState.h>
 | |
| #include <Kernel/Arch/x86_64/I8042Reboot.h>
 | |
| #include <Kernel/Arch/x86_64/Shutdown.h>
 | |
| 
 | |
| namespace Kernel {
 | |
| 
 | |
| void arch_specific_reboot()
 | |
| {
 | |
|     i8042_reboot();
 | |
| }
 | |
| 
 | |
| void arch_specific_poweroff()
 | |
| {
 | |
|     qemu_shutdown();
 | |
|     virtualbox_shutdown();
 | |
| }
 | |
| 
 | |
| }
 |