2015-04-16 18:08:44 +08:00
|
|
|
// Copyright (c) 2015, edef <edef@edef.eu>
|
|
|
|
// See the LICENSE file included in this distribution.
|
2015-02-03 03:17:23 +08:00
|
|
|
#![feature(asm, test)]
|
2015-01-14 14:01:43 +08:00
|
|
|
extern crate test;
|
|
|
|
use test::Bencher;
|
|
|
|
|
|
|
|
#[bench]
|
|
|
|
fn kernel_swap(b: &mut Bencher) {
|
|
|
|
b.iter(|| unsafe {
|
|
|
|
asm!("movq $$102, %rax\n\
|
|
|
|
syscall"
|
|
|
|
:
|
|
|
|
:
|
|
|
|
: "rax", "rcx"
|
|
|
|
: "volatile");
|
|
|
|
});
|
|
|
|
}
|