diff options
Diffstat (limited to 'arch/msp430/src/lib.rs')
| -rw-r--r-- | arch/msp430/src/lib.rs | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/arch/msp430/src/lib.rs b/arch/msp430/src/lib.rs index 7654b33c..b5465554 100644 --- a/arch/msp430/src/lib.rs +++ b/arch/msp430/src/lib.rs @@ -2,8 +2,14 @@ extern crate binaryninja; extern crate log; extern crate msp430_asm; +use binaryninja::{ + add_optional_plugin_dependency, + architecture::ArchitectureExt, + calling_convention, + custom_binary_view::{BinaryViewType, BinaryViewTypeExt}, + Endianness, +}; use log::LevelFilter; -use binaryninja::{add_optional_plugin_dependency, architecture::ArchitectureExt, callingconvention, custombinaryview::{BinaryViewType, BinaryViewTypeExt}, Endianness}; mod architecture; mod flag; @@ -17,10 +23,10 @@ use binaryninja::logger::Logger; #[allow(non_snake_case)] pub extern "C" fn CorePluginInit() -> bool { Logger::new("MSP430").with_level(LevelFilter::Info).init(); - let arch = binaryninja::architecture::register_architecture( - "msp430", - |custom_handle, handle| Msp430::new(handle, custom_handle), - ); + let arch = + binaryninja::architecture::register_architecture("msp430", |custom_handle, handle| { + Msp430::new(handle, custom_handle) + }); // we may need to introduce additional calling conventions here to // support additional ABIs. MSPGCC's calling convention (what @@ -30,13 +36,13 @@ pub extern "C" fn CorePluginInit() -> bool { // https://www.ti.com/lit/an/slaa664/slaa664.pdf?ts=1613210655081. MSPGCC // appears to be a legacy calling convention while EABI is the newer // standardized one that is compatible with TI's compiler - let default = callingconvention::ConventionBuilder::new(arch) + let default = calling_convention::ConventionBuilder::new(arch) .is_eligible_for_heuristics(true) .int_arg_registers(&["r15", "r14", "r13", "r12"]) .return_int_reg("r15") .return_hi_int_reg("r14") .register("default"); - callingconvention::ConventionBuilder::new(arch) + calling_convention::ConventionBuilder::new(arch) .is_eligible_for_heuristics(true) .return_int_reg("r15") .return_hi_int_reg("r14") @@ -55,4 +61,4 @@ pub extern "C" fn CorePluginInit() -> bool { #[allow(non_snake_case)] pub extern "C" fn CorePluginDependencies() { add_optional_plugin_dependency("view_elf"); -}
\ No newline at end of file +} |
