From a12dcb7595cfefcac05a1ffc5c13b6ec6659d0ff Mon Sep 17 00:00:00 2001 From: WangRunji Date: Mon, 18 Feb 2019 14:33:17 +0800 Subject: [PATCH] user: add target i686 --- user/rcore-ulib/src/syscall.rs | 6 ++++++ user/targets/i686-rcore.json | 15 +++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 user/targets/i686-rcore.json diff --git a/user/rcore-ulib/src/syscall.rs b/user/rcore-ulib/src/syscall.rs index ecc5a24..5c21bcd 100644 --- a/user/rcore-ulib/src/syscall.rs +++ b/user/rcore-ulib/src/syscall.rs @@ -10,6 +10,12 @@ fn sys_call(syscall_id: SyscallId, arg0: usize, arg1: usize, arg2: usize, arg3: : "{x10}" (id), "{x11}" (arg0), "{x12}" (arg1), "{x13}" (arg2), "{x14}" (arg3), "{x15}" (arg4), "{x16}" (arg5) : "memory" : "volatile"); + #[cfg(target_arch = "x86")] + asm!("int 0x80" + : "={eax}" (ret) + : "{eax}" (id), "{edx}" (arg0), "{ecx}" (arg1), "{ebx}" (arg2), "{edi}" (arg3), "{esi}" (arg4) + : "memory" + : "intel" "volatile"); #[cfg(target_arch = "x86_64")] asm!("int 0x40" : "={rax}" (ret) diff --git a/user/targets/i686-rcore.json b/user/targets/i686-rcore.json new file mode 100644 index 0000000..b5138ec --- /dev/null +++ b/user/targets/i686-rcore.json @@ -0,0 +1,15 @@ +{ + "arch": "x86", + "cpu": "pentium4", + "data-layout": "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128", + "executables": true, + "linker-flavor": "ld.lld", + "linker": "rust-lld", + "llvm-target": "i686", + "max-atomic-width": 64, + "os": "none", + "target-c-int-width": "32", + "target-endian": "little", + "target-pointer-width": "32", + "features": "-mmx,-sse,+soft-float" +} \ No newline at end of file