mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 12:12:45 +00:00 
			
		
		
		
	 398d271a46
			
		
	
	
		398d271a46
		
	
	
	
	
		
			
			About half of the Processor code is common across architectures, so let's share it with a templated base class. Also, other code that can be shared in some ways, like FPUState and TrapFrame functions, is adjusted here. Functions which cannot be shared trivially (without internal refactoring) are left alone for now.
		
			
				
	
	
		
			34 lines
		
	
	
	
		
			659 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
	
		
			659 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/Types.h>
 | |
| 
 | |
| #include <AK/Platform.h>
 | |
| VALIDATE_IS_X86()
 | |
| 
 | |
| namespace Kernel {
 | |
| 
 | |
| struct RegisterState;
 | |
| 
 | |
| struct TrapFrame {
 | |
|     FlatPtr prev_irq_level;
 | |
|     TrapFrame* next_trap;
 | |
|     RegisterState* regs; // must be last
 | |
| 
 | |
|     TrapFrame() = delete;
 | |
|     TrapFrame(TrapFrame const&) = delete;
 | |
|     TrapFrame(TrapFrame&&) = delete;
 | |
|     TrapFrame& operator=(TrapFrame const&) = delete;
 | |
|     TrapFrame& operator=(TrapFrame&&) = delete;
 | |
| };
 | |
| 
 | |
| #define TRAP_FRAME_SIZE (3 * 8)
 | |
| 
 | |
| static_assert(AssertSize<TrapFrame, TRAP_FRAME_SIZE>());
 | |
| 
 | |
| }
 |