1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//! Architecture-specific types and operations.

use memory_addr::VirtAddr;
#[derive(Debug)]
/// To describe the relocation pair in the ELF
pub struct RelocatePair {
    /// the source address of the relocation
    pub src: VirtAddr,
    /// the destination address of the relocation
    pub dst: VirtAddr,
    /// the set of bits affected by this relocation
    pub count: usize,
}

cfg_if::cfg_if! {
    if #[cfg(target_arch = "x86_64")] {
        mod x86_64;
        pub use x86_64::*;
    } else if #[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))] {
        mod riscv;
        pub use riscv::*;
    } else if #[cfg(target_arch = "aarch64")]{
        mod aarch64;
        pub use self::aarch64::*;
    }
}