Skip to content

Commit 5fae96c

Browse files
hoshinolinaslp
authored andcommitted
x11bridge: Gate off aarch64-specific code on !aarch64
Signed-off-by: Asahi Lina <[email protected]>
1 parent 38ac185 commit 5fae96c

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

crates/muvm/src/x11bridge/bin/muvm-x11bridge.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,12 +639,15 @@ impl Drop for FutexWatcherThread {
639639
}
640640
}
641641

642+
#[allow(dead_code)]
642643
struct RemoteCaller {
643644
pid: Pid,
644645
regs: user_regs_struct,
645646
}
646647

647648
impl RemoteCaller {
649+
// This is arch-specific, so gate it off of x86_64 builds done for CI purposes
650+
#[cfg(target_arch = "aarch64")]
648651
fn with<R, F>(pid: Pid, f: F) -> Result<R>
649652
where
650653
F: FnOnce(&RemoteCaller) -> Result<R>,
@@ -710,6 +713,9 @@ impl RemoteCaller {
710713
)
711714
.map(|x| x as i32)
712715
}
716+
717+
// This is arch-specific, so gate it off of x86_64 builds done for CI purposes
718+
#[cfg(target_arch = "aarch64")]
713719
fn syscall(&self, syscall_no: c_long, args: [c_ulonglong; 6]) -> Result<c_ulonglong> {
714720
let mut regs = self.regs;
715721
regs.regs[..6].copy_from_slice(&args);
@@ -723,6 +729,18 @@ impl RemoteCaller {
723729
regs = ptrace::getregs(self.pid)?;
724730
Ok(regs.regs[0])
725731
}
732+
733+
#[cfg(not(target_arch = "aarch64"))]
734+
fn with<R, F>(_pid: Pid, _f: F) -> Result<R>
735+
where
736+
F: FnOnce(&RemoteCaller) -> Result<R>,
737+
{
738+
Err(Errno::EOPNOTSUPP.into())
739+
}
740+
#[cfg(not(target_arch = "aarch64"))]
741+
fn syscall(&self, _syscall_no: c_long, _args: [c_ulonglong; 6]) -> Result<c_ulonglong> {
742+
Err(Errno::EOPNOTSUPP.into())
743+
}
726744
}
727745

728746
fn wait_for_stop(pid: Pid) -> Result<()> {
@@ -1178,6 +1196,8 @@ impl Client {
11781196
// Allow everything in /dev/shm (including paths with trailing '(deleted)')
11791197
let shmem_file = if filename.starts_with(SHM_DIR) {
11801198
File::from(memfd)
1199+
} else if cfg!(not(target_arch = "aarch64")) {
1200+
return Err(Errno::EOPNOTSUPP.into());
11811201
} else {
11821202
let (fd, shmem_path) = mkstemp(SHM_TEMPLATE)?;
11831203
let mut shmem_file = unsafe { File::from_raw_fd(fd) };

0 commit comments

Comments
 (0)