From aef19f3958262a57b1254b011e622e19ea27e661 Mon Sep 17 00:00:00 2001 From: jamcleod Date: Thu, 31 Oct 2024 13:13:10 -0400 Subject: [PATCH] Add mips64el support to syscall-injection --- panda-rs/src/abi.rs | 2 +- panda-rs/src/syscall_injection.rs | 1 + panda-rs/src/syscall_injection/arch.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/panda-rs/src/abi.rs b/panda-rs/src/abi.rs index 532a1be..10171b4 100644 --- a/panda-rs/src/abi.rs +++ b/panda-rs/src/abi.rs @@ -106,7 +106,7 @@ pub mod syscall { syscall_number = V0; } - #[cfg(arch = "mips64")] { + #[cfg(arch = "mips64", arch = "mips64el")] { // n32 ABI args = [A0, A1, A2, A3, T0, T1]; return = V0; diff --git a/panda-rs/src/syscall_injection.rs b/panda-rs/src/syscall_injection.rs index 9b86c88..b92a798 100644 --- a/panda-rs/src/syscall_injection.rs +++ b/panda-rs/src/syscall_injection.rs @@ -203,6 +203,7 @@ fn restart_syscall(cpu: &mut CPUState, pc: target_ulong) { } } +#[cfg(any(feature = "x86_64", feature = "i386"))] const SYSENTER_INSTR: &[u8] = &[0xf, 0x34]; /// Run a syscall injector in the form as an async block/value to be evaluated. If diff --git a/panda-rs/src/syscall_injection/arch.rs b/panda-rs/src/syscall_injection/arch.rs index 6eb009a..9ae8d30 100644 --- a/panda-rs/src/syscall_injection/arch.rs +++ b/panda-rs/src/syscall_injection/arch.rs @@ -14,7 +14,7 @@ pub(crate) const VFORK: target_ulong = 190; pub(crate) const VFORK: target_ulong = 220; // TODO: mips needs to be changed to VFORK -#[cfg(feature = "mips64")] +#[cfg(any(feature = "mips64", feature = "mips64el"))] pub(crate) const VFORK: target_ulong = 4002; #[cfg(any(feature = "mips", feature = "mipsel"))]