mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 07:12:43 +00:00 
			
		
		
		
	 a43b115a6c
			
		
	
	
		a43b115a6c
		
	
	
	
	
		
			
			Kernel modules can now be unloaded via a syscall. They get a chance to run some code of course. Before deallocating them, we call their "module_fini" symbol.
		
			
				
	
	
		
			16 lines
		
	
	
	
		
			311 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
	
		
			311 B
		
	
	
	
		
			C
		
	
	
	
	
	
| #pragma once
 | |
| 
 | |
| #include <AK/String.h>
 | |
| #include <AK/Vector.h>
 | |
| #include <Kernel/KBuffer.h>
 | |
| 
 | |
| typedef void* (*ModuleInitPtr)();
 | |
| typedef void* (*ModuleFiniPtr)();
 | |
| 
 | |
| struct Module {
 | |
|     String name;
 | |
|     Vector<KBuffer> sections;
 | |
| 
 | |
|     ModuleInitPtr module_init { nullptr };
 | |
|     ModuleFiniPtr module_fini { nullptr };
 | |
| };
 |