Skip to content

Commit

Permalink
Update linux.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
byeongkeunahn committed Oct 8, 2024
1 parent 05afd47 commit db2528e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions basm-std/src/platform/os/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ use super::super::allocator;
use super::super::malloc::{dlmalloc, dlmalloc_linux};

pub mod syscall {
#[cfg(not(target_arch = "x86"))]
use core::arch::asm;
#[cfg(target_arch = "x86")]
use core::arch::naked_asm;

pub const PROT_READ: i32 = 0x01;
pub const PROT_WRITE: i32 = 0x02;
pub const MAP_PRIVATE: i32 = 0x02;
Expand Down Expand Up @@ -140,7 +144,7 @@ pub mod syscall {
arg5: usize,
) -> usize {
unsafe {
asm!(
naked_asm!(
"push ebp",
"push ebx",
"push esi",
Expand All @@ -157,8 +161,7 @@ pub mod syscall {
"pop esi",
"pop ebx",
"pop ebp",
"ret",
options(noreturn)
"ret"
);
}
}
Expand Down

0 comments on commit db2528e

Please sign in to comment.