forked from M-Labs/libfringe
Remove unnecessary "memory" clobbers for naked function asm
This commit is contained in:
parent
38ff4126b6
commit
86e29b2baa
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user