From 86e29b2baaa4d0359e05dfe63024e003fec5e172 Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Thu, 1 Sep 2016 16:39:34 +0100 Subject: [PATCH] Remove unnecessary "memory" clobbers for naked function asm --- src/arch/or1k.rs | 6 +++--- src/arch/x86.rs | 6 +++--- src/arch/x86_64.rs | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/arch/or1k.rs b/src/arch/or1k.rs index b706762..912595d 100644 --- a/src/arch/or1k.rs +++ b/src/arch/or1k.rs @@ -73,7 +73,7 @@ pub unsafe fn init(stack: &Stack, f: unsafe extern "C" fn(usize) -> !) -> StackP .Lend: .size __morestack, .Lend-__morestack "# - : : "s" (trampoline_2 as usize) : "memory" : "volatile") + : : "s" (trampoline_2 as usize) : : "volatile") } #[naked] @@ -89,7 +89,7 @@ pub unsafe fn init(stack: &Stack, f: unsafe extern "C" fn(usize) -> !) -> StackP l.jr r9 l.nop "# - : : : "memory" : "volatile") + : : : : "volatile") } unsafe fn push(sp: &mut StackPointer, val: usize) { @@ -139,7 +139,7 @@ pub unsafe fn swap(arg: usize, old_sp: *mut StackPointer, new_sp: *const StackPo l.jr r9 l.nop "# - : : : "memory" : "volatile") + : : : : "volatile") } let ret: usize; diff --git a/src/arch/x86.rs b/src/arch/x86.rs index 1b3c449..a34ac98 100644 --- a/src/arch/x86.rs +++ b/src/arch/x86.rs @@ -72,7 +72,7 @@ pub unsafe fn init(stack: &Stack, f: unsafe extern "C" fn(usize) -> !) -> StackP .Lend: .size __morestack, .Lend-__morestack "# - : : "s" (trampoline_2 as usize) : "memory" : "volatile") + : : "s" (trampoline_2 as usize) : : "volatile") } #[naked] @@ -89,7 +89,7 @@ pub unsafe fn init(stack: &Stack, f: unsafe extern "C" fn(usize) -> !) -> StackP # Call the provided function. call *8(%esp) "# - : : : "memory" : "volatile") + : : : : "volatile") } unsafe fn push(sp: &mut StackPointer, val: usize) { @@ -135,7 +135,7 @@ pub unsafe fn swap(arg: usize, old_sp: *mut StackPointer, new_sp: *const StackPo popl %ebx jmpl *%ebx "# - : : : "memory" : "volatile") + : : : : "volatile") } let ret: usize; diff --git a/src/arch/x86_64.rs b/src/arch/x86_64.rs index a3d30d7..09ce504 100644 --- a/src/arch/x86_64.rs +++ b/src/arch/x86_64.rs @@ -77,7 +77,7 @@ pub unsafe fn init(stack: &Stack, f: unsafe extern "C" fn(usize) -> !) -> StackP .Lend: .size __morestack, .Lend-__morestack "# - : : "s" (trampoline_2 as usize) : "memory" : "volatile") + : : "s" (trampoline_2 as usize) : : "volatile") } #[cfg(target_vendor = "apple")] @@ -92,7 +92,7 @@ pub unsafe fn init(stack: &Stack, f: unsafe extern "C" fn(usize) -> !) -> StackP .cfi_offset %rbp, -16 call ${0:c} "# - : : "s" (trampoline_2 as usize) : "memory" : "volatile") + : : "s" (trampoline_2 as usize) : : "volatile") } #[naked] @@ -115,7 +115,7 @@ pub unsafe fn init(stack: &Stack, f: unsafe extern "C" fn(usize) -> !) -> StackP # Call the provided function. call *8(%rsp) "# - : : : "memory" : "volatile") + : : : : "volatile") } unsafe fn push(sp: &mut StackPointer, val: usize) { @@ -162,7 +162,7 @@ pub unsafe fn swap(arg: usize, old_sp: *mut StackPointer, new_sp: *const StackPo popq %rbx jmpq *%rbx "# - : : : "memory" : "volatile") + : : : : "volatile") } let ret: usize;