pub struct AbiRegistry {
factories: HashMap<String, fn() -> Box<dyn AbiModule>>,
}
Expand description
ABI registry.
This struct is responsible for managing the registration and instantiation of ABI modules in the Scarlet kernel.
Fields§
§factories: HashMap<String, fn() -> Box<dyn AbiModule>>
Implementations§
Source§impl AbiRegistry
impl AbiRegistry
fn new() -> Self
pub fn global() -> &'static Mutex<AbiRegistry>
pub fn register<T>()where
T: AbiModule + Default + 'static,
pub fn instantiate(name: &str) -> Option<Box<dyn AbiModule>>
Sourcepub fn detect_best_abi(
file_object: &KernelObject,
file_path: &str,
) -> Option<(String, u8)>
pub fn detect_best_abi( file_object: &KernelObject, file_path: &str, ) -> Option<(String, u8)>
Detect the best ABI for a binary from all registered ABI modules
This method tries all registered ABIs and selects the one with the highest confidence score. Each ABI internally handles inheritance bonuses and compatibility logic based on the current task’s ABI.
§Arguments
file_object
- Binary file to checkfile_path
- File path
§Returns
Some((abi_name, confidence))
- Best ABI name and confidence levelNone
- No executable ABI found