From 39ffdbb3e73bd7ab2388cc86d5b44aadd8804dde Mon Sep 17 00:00:00 2001 From: Jiajie Chen Date: Mon, 15 Jun 2020 16:56:21 +0800 Subject: [PATCH] Bump to nightly-2020-06-04 and use llvm_asm instead of asm --- kernel/Cargo.lock | 138 +++++++----------- kernel/Cargo.toml | 2 +- kernel/src/arch/aarch64/interrupt/context.rs | 2 +- kernel/src/arch/aarch64/interrupt/mod.rs | 4 +- kernel/src/arch/aarch64/mod.rs | 4 +- kernel/src/arch/riscv/context.rs | 6 +- kernel/src/arch/riscv/cpu.rs | 4 +- kernel/src/arch/riscv/memory.rs | 2 +- kernel/src/arch/riscv/mod.rs | 4 +- kernel/src/arch/riscv/paging.rs | 4 +- kernel/src/arch/riscv/sbi.rs | 2 +- kernel/src/arch/x86_64/cpu.rs | 4 +- kernel/src/arch/x86_64/driver/ide.rs | 6 +- kernel/src/arch/x86_64/interrupt/handler.rs | 2 +- kernel/src/arch/x86_64/interrupt/mod.rs | 4 +- kernel/src/arch/x86_64/interrupt/trapframe.rs | 2 +- kernel/src/arch/x86_64/mod.rs | 4 +- kernel/src/arch/x86_64/paging.rs | 2 +- kernel/src/backtrace.rs | 16 +- kernel/src/lib.rs | 2 +- kernel/src/sync/mutex.rs | 12 +- kernel/src/syscall/mod.rs | 2 +- rboot | 2 +- rust-toolchain | 2 +- 24 files changed, 103 insertions(+), 129 deletions(-) diff --git a/kernel/Cargo.lock b/kernel/Cargo.lock index 09a84468..98b99c5d 100644 --- a/kernel/Cargo.lock +++ b/kernel/Cargo.lock @@ -35,19 +35,11 @@ dependencies = [ [[package]] name = "apic" version = "0.1.0" -source = "git+https://github.com/rcore-os/apic-rs#3bc93873eaa4d21f09fc4134853d0a1ff917951b" +source = "git+https://github.com/rcore-os/apic-rs#fb86bd7c798608a18cbb48755637d97d4266eb89" dependencies = [ - "bit_field 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bit_field 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "x86 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "array-init" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "x86 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -229,11 +221,6 @@ dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "nodrop" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "num" version = "0.2.1" @@ -260,9 +247,9 @@ name = "num-derive" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -317,9 +304,9 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -342,7 +329,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "proc-macro2" -version = "1.0.10" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -350,10 +337,10 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.3" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -361,16 +348,6 @@ name = "radium" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "raw-cpuid" -version = "6.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cc 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "raw-cpuid" version = "7.0.3" @@ -381,13 +358,24 @@ dependencies = [ "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "raw-cpuid" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rboot" -version = "0.1.2" +version = "0.1.3" dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "uefi 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "x86_64 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rlibc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "uefi 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "x86_64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "xmas-elf 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -419,7 +407,7 @@ dependencies = [ "pc-keyboard 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "pci 0.0.1 (git+https://github.com/rcore-os/pci-rs)", "raw-cpuid 7.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rboot 0.1.2", + "rboot 0.1.3", "rcore-console 0.1.0 (git+https://github.com/rcore-os/rcore-console?rev=b7bacf9)", "rcore-fs 0.1.0 (git+https://github.com/rcore-os/rcore-fs?rev=1fb7c0ee)", "rcore-fs-devfs 0.1.0 (git+https://github.com/rcore-os/rcore-fs?rev=1fb7c0ee)", @@ -432,10 +420,10 @@ dependencies = [ "rlibc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "smoltcp 0.5.0 (git+https://github.com/rcore-os/smoltcp?rev=5bd87c7c)", "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "uart_16550 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "uart_16550 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "virtio-drivers 0.1.0 (git+https://github.com/rcore-os/virtio-drivers?rev=dfa70e14)", "volatile 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "x86_64 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "x86_64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "xmas-elf 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -560,9 +548,9 @@ name = "rustversion" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -601,11 +589,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "syn" -version = "1.0.18" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -621,11 +609,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "uart_16550" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "x86_64 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "x86_64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -638,23 +626,23 @@ dependencies = [ [[package]] name = "uefi" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "ucs2 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "uefi-macros 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "uefi-macros 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "uefi-macros" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -721,28 +709,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "x86" -version = "0.15.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "bit_field 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "raw-cpuid 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "raw-cpuid 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "x86_64" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "array-init 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "bit_field 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "ux 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "x86_64" -version = "0.9.6" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bit_field 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -767,7 +744,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum acpi 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2c18d706bdc322dd4f8f7930a5879ad8df3d78d4452a678d5419c72f9f69acea" "checksum aml 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b7669e841017880c2710777c46ec654272163379bbe55de6e17a2a2388d44d92" "checksum apic 0.1.0 (git+https://github.com/rcore-os/apic-rs)" = "" -"checksum array-init 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "23589ecb866b460d3a0f1278834750268c607e8e28a1b982c907219f3178cd72" "checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" "checksum bare-metal 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" "checksum bcm2837 2.5.1 (git+https://github.com/rcore-os/bcm2837)" = "" @@ -793,7 +769,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" "checksum managed 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fdcec5e97041c7f0f1c5b7d93f12e57293c831c646f4cc7a5db59460c7ea8de6" "checksum mips 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "053a14b59d7b828efefebf92b557015d99383264f4714a959b1d970d8c6c32fb" -"checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" "checksum num 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" "checksum num-complex 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" "checksum num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0c8b15b261814f992e33760b1fca9fe8b693d8a65299f20c9901688636cfb746" @@ -806,11 +781,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum pc-keyboard 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c48392db76c4e9a69e0b3be356c5f97ebb7b14413c5e4fd0af4755dbf86e2fce" "checksum pci 0.0.1 (git+https://github.com/rcore-os/pci-rs)" = "" "checksum proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)" = "0d659fe7c6d27f25e9d80a1a094c223f5246f6a6596453e09d7229bf42750b63" -"checksum proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "df246d292ff63439fea9bc8c0a270bed0e390d5ebd4db4ba15aba81111b5abe3" -"checksum quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" +"checksum proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa" +"checksum quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" "checksum radium 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "def50a86306165861203e7f84ecffbbdfdea79f0e51039b33de1e952358c47ac" -"checksum raw-cpuid 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "30a9d219c32c9132f7be513c18be77c9881c7107d2ab5569d205a6a0f0e6dc7d" "checksum raw-cpuid 7.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b4a349ca83373cfa5d6dbb66fd76e58b2cca08da71a5f6400de0a0a6a9bceeaf" +"checksum raw-cpuid 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9e9c0f2091b865a94bc3c9d34896cc4bbda04453453c391f7eb224491be9ae1d" "checksum rcore-console 0.1.0 (git+https://github.com/rcore-os/rcore-console?rev=b7bacf9)" = "" "checksum rcore-fs 0.1.0 (git+https://github.com/rcore-os/rcore-fs?rev=1fb7c0ee)" = "" "checksum rcore-fs-devfs 0.1.0 (git+https://github.com/rcore-os/rcore-fs?rev=1fb7c0ee)" = "" @@ -829,13 +804,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum smoltcp 0.5.0 (git+https://github.com/rcore-os/smoltcp?rev=5bd87c7c)" = "" "checksum spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" "checksum static_assertions 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7f3eb36b47e512f8f1c9e3d10c2c1965bc992bd9cdb024fa581e2194501c83d3" -"checksum syn 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "410a7488c0a728c7ceb4ad59b9567eb4053d02e8cc7f5c0e0eeeb39518369213" +"checksum syn 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)" = "b5304cfdf27365b7585c25d4af91b35016ed21ef88f17ced89c7093b43dba8b6" "checksum tock-registers 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3a385d94f3f62e60445a0adb9ff8d9621faa272234530d4c0f848ec98f88e316" "checksum typenum 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" -"checksum uart_16550 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e983688170873ec9a3f21a6afc751fb706cf02836ed9d28a68d2e247dff7ae52" +"checksum uart_16550 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "e58fc40dc1712664fc9b0a7bd8ca2f21ab49960924fb245a80a05e1e92f3dfe9" "checksum ucs2 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "85061f4e43545a613c0da6b87725bf23f8da8613cf2473719c4f71a270c4ce8a" -"checksum uefi 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5cec6a2850639f588cc8042140b5deaa2f2170c23db5adb08f4316fa04cdb4a0" -"checksum uefi-macros 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c7d4a1b0215dc72e83d8d501b3275eb59477d3b595be8861abfb8ab110180955" +"checksum uefi 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab1f1403ecbad37d25120161acc3db12066febf3446efcc40b7631d30678505d" +"checksum uefi-macros 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7a69fa8dd920e84d783769c44560484ade81f6c765cde2e1cc46c754ddf95947" "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" "checksum usize_conversions 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f70329e2cbe45d6c97a5112daad40c34cd9a4e18edb5a2a18fefeb584d8d25e5" "checksum utf8parse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8772a4ccbb4e89959023bc5b7cb8623a795caa7092d99f3aa9501b9484d4557d" @@ -846,8 +821,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -"checksum x86 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f21eecbd666e3a8edbf0b26d36f270f7a613d8986ca0eafb8205e324f7336dab" -"checksum x86_64 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1f27d9168654aee1b0c1b73746caeb4aa33248f8b8c8f6e100e697fcc2a794b2" -"checksum x86_64 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4206b60c9f99766329b66962aa8ddc01df6c7edd02edc046b7a69d5df9fcdbcf" +"checksum x86 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2786ac694ed572ab5d2bbcd9e188805dba26b3501973dd69718914fb3d4a5a69" +"checksum x86_64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "365de37eb7c6da582cbb510dd0f3f1235d24ff6309a8a96e8a9909cc9bfd608f" "checksum xmas-elf 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e74de9a366f6ab8c405fa6b371d9ac24943921fa14b3d64afcb202065c405f11" "checksum zero 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5f1bc8a6b2005884962297587045002d8cfb8dcec9db332f4ca216ddc5de82c5" diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index 91e982d3..d8c5e732 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -80,7 +80,7 @@ pc-keyboard = "0.5" [target.'cfg(target_arch = "x86_64")'.dependencies] rboot = { path = "../rboot", default-features = false } apic = { git = "https://github.com/rcore-os/apic-rs" } -x86_64 = "0.7" +x86_64 = "0.11" raw-cpuid = "7.0" uart_16550 = "0.2" acpi = "0.4" diff --git a/kernel/src/arch/aarch64/interrupt/context.rs b/kernel/src/arch/aarch64/interrupt/context.rs index 9a628c83..34389e25 100644 --- a/kernel/src/arch/aarch64/interrupt/context.rs +++ b/kernel/src/arch/aarch64/interrupt/context.rs @@ -104,7 +104,7 @@ impl Context { #[naked] #[inline(never)] unsafe extern "C" fn __switch(_self_stack: &mut usize, _target_stack: &mut usize) { - asm!( + llvm_asm!( " mov x10, #-(12 * 8) add x8, sp, x10 diff --git a/kernel/src/arch/aarch64/interrupt/mod.rs b/kernel/src/arch/aarch64/interrupt/mod.rs index c7f00509..e861a454 100644 --- a/kernel/src/arch/aarch64/interrupt/mod.rs +++ b/kernel/src/arch/aarch64/interrupt/mod.rs @@ -20,13 +20,13 @@ pub fn init() { /// Enable the interrupt (only IRQ). #[inline(always)] pub unsafe fn enable() { - asm!("msr daifclr, #2"); + llvm_asm!("msr daifclr, #2"); } /// Disable the interrupt (only IRQ). #[inline(always)] pub unsafe fn disable() { - asm!("msr daifset, #2"); + llvm_asm!("msr daifset, #2"); } /// Disable the interrupt and store the status. diff --git a/kernel/src/arch/aarch64/mod.rs b/kernel/src/arch/aarch64/mod.rs index ee9acc89..38eecb7d 100644 --- a/kernel/src/arch/aarch64/mod.rs +++ b/kernel/src/arch/aarch64/mod.rs @@ -71,13 +71,13 @@ const LOGO: &str = r#" pub fn get_sp() -> usize { let sp: usize; unsafe { - asm!("mov sp, $0" : "=r"(sp)); + llvm_asm!("mov sp, $0" : "=r"(sp)); } sp } pub fn set_sp(sp: usize) { unsafe { - asm!("mov $0, sp" :: "r" (sp) : "memory"); + llvm_asm!("mov $0, sp" :: "r" (sp) : "memory"); } } diff --git a/kernel/src/arch/riscv/context.rs b/kernel/src/arch/riscv/context.rs index 8204ebe5..4af58cfb 100644 --- a/kernel/src/arch/riscv/context.rs +++ b/kernel/src/arch/riscv/context.rs @@ -145,7 +145,7 @@ impl Context { #[inline(never)] pub unsafe extern "C" fn switch(&mut self, _target: &mut Self) { #[cfg(target_arch = "riscv32")] - asm!( + llvm_asm!( r" .equ XLENB, 4 .macro Load reg, mem @@ -156,7 +156,7 @@ impl Context { .endm" ); #[cfg(target_arch = "riscv64")] - asm!( + llvm_asm!( r" .equ XLENB, 8 .macro Load reg, mem @@ -166,7 +166,7 @@ impl Context { sd \reg, \mem .endm" ); - asm!(" + llvm_asm!(" // save from's registers addi sp, sp, (-XLENB*14) Store sp, 0(a0) diff --git a/kernel/src/arch/riscv/cpu.rs b/kernel/src/arch/riscv/cpu.rs index ec58597e..4c0aa167 100644 --- a/kernel/src/arch/riscv/cpu.rs +++ b/kernel/src/arch/riscv/cpu.rs @@ -1,11 +1,11 @@ pub unsafe fn set_cpu_id(cpu_id: usize) { - asm!("mv gp, $0" : : "r"(cpu_id)); + llvm_asm!("mv gp, $0" : : "r"(cpu_id)); } pub fn id() -> usize { let cpu_id; unsafe { - asm!("mv $0, gp" : "=r"(cpu_id)); + llvm_asm!("mv $0, gp" : "=r"(cpu_id)); } cpu_id } diff --git a/kernel/src/arch/riscv/memory.rs b/kernel/src/arch/riscv/memory.rs index 620ec15b..45f047cd 100644 --- a/kernel/src/arch/riscv/memory.rs +++ b/kernel/src/arch/riscv/memory.rs @@ -22,7 +22,7 @@ pub fn init(dtb: usize) { pub fn init_other() { unsafe { sstatus::set_sum(); // Allow user memory access - asm!("csrw satp, $0; sfence.vma" :: "r"(SATP) :: "volatile"); + llvm_asm!("csrw satp, $0; sfence.vma" :: "r"(SATP) :: "volatile"); } } diff --git a/kernel/src/arch/riscv/mod.rs b/kernel/src/arch/riscv/mod.rs index 9581601c..f003ab46 100644 --- a/kernel/src/arch/riscv/mod.rs +++ b/kernel/src/arch/riscv/mod.rs @@ -124,13 +124,13 @@ global_asm!(include_str!("boot/trap.asm")); pub fn get_sp() -> usize { let sp: usize; unsafe { - asm!("mv $0, sp" : "=r"(sp)); + llvm_asm!("mv $0, sp" : "=r"(sp)); } sp } pub fn set_sp(sp: usize) { unsafe { - asm!("mv sp, $0" :: "r" (sp) : "memory"); + llvm_asm!("mv sp, $0" :: "r" (sp) : "memory"); } } diff --git a/kernel/src/arch/riscv/paging.rs b/kernel/src/arch/riscv/paging.rs index c4e4ee9b..0948bbf9 100644 --- a/kernel/src/arch/riscv/paging.rs +++ b/kernel/src/arch/riscv/paging.rs @@ -252,13 +252,13 @@ impl PageTableExt for PageTableImpl { } unsafe fn set_token(token: usize) { - asm!("csrw satp, $0" :: "r"(token) :: "volatile"); + llvm_asm!("csrw satp, $0" :: "r"(token) :: "volatile"); } fn active_token() -> usize { let mut token; unsafe { - asm!("csrr $0, satp" : "=r"(token) ::: "volatile"); + llvm_asm!("csrr $0, satp" : "=r"(token) ::: "volatile"); } token } diff --git a/kernel/src/arch/riscv/sbi.rs b/kernel/src/arch/riscv/sbi.rs index babfa796..98b78798 100644 --- a/kernel/src/arch/riscv/sbi.rs +++ b/kernel/src/arch/riscv/sbi.rs @@ -5,7 +5,7 @@ fn sbi_call(which: usize, arg0: usize, arg1: usize, arg2: usize) -> usize { let ret; unsafe { - asm!("ecall" + llvm_asm!("ecall" : "={x10}" (ret) : "{x10}" (arg0), "{x11}" (arg1), "{x12}" (arg2), "{x17}" (which) : "memory" diff --git a/kernel/src/arch/x86_64/cpu.rs b/kernel/src/arch/x86_64/cpu.rs index 7875953a..1c3862c6 100644 --- a/kernel/src/arch/x86_64/cpu.rs +++ b/kernel/src/arch/x86_64/cpu.rs @@ -43,10 +43,10 @@ pub fn init() { // enable FPU, the manual Volume 3 Chapter 13 let mut value: u64; unsafe { - asm!("mov %cr4, $0" : "=r" (value)); + llvm_asm!("mov %cr4, $0" : "=r" (value)); // OSFXSR | OSXMMEXCPT value |= 1 << 9 | 1 << 10; - asm!("mov $0, %cr4" :: "r" (value) : "memory"); + llvm_asm!("mov $0, %cr4" :: "r" (value) : "memory"); Cr0::update(|cr0| { cr0.remove(Cr0Flags::EMULATE_COPROCESSOR); cr0.insert(Cr0Flags::MONITOR_COPROCESSOR); diff --git a/kernel/src/arch/x86_64/driver/ide.rs b/kernel/src/arch/x86_64/driver/ide.rs index fff15340..477dbdea 100644 --- a/kernel/src/arch/x86_64/driver/ide.rs +++ b/kernel/src/arch/x86_64/driver/ide.rs @@ -54,7 +54,7 @@ impl IDE { if self.wait_error() { return Err(()); } - asm!("rep insl" :: "{dx}"(self.base), "{rdi}"(ptr), "{cx}"(SECTOR_SIZE) : "rdi" : "volatile"); + llvm_asm!("rep insl" :: "{dx}"(self.base), "{rdi}"(ptr), "{cx}"(SECTOR_SIZE) : "rdi" : "volatile"); } } Ok(()) @@ -71,7 +71,7 @@ impl IDE { if self.wait_error() { return Err(()); } - asm!("rep outsl" :: "{dx}"(self.base), "{rsi}"(ptr), "{cx}"(SECTOR_SIZE) : "rsi" : "volatile"); + llvm_asm!("rep outsl" :: "{dx}"(self.base), "{rsi}"(ptr), "{cx}"(SECTOR_SIZE) : "rsi" : "volatile"); } } Ok(()) @@ -105,7 +105,7 @@ impl IDE { // ??? let data = [0; SECTOR_SIZE]; - asm!("rep insl" :: "{dx}"(self.base + ISA_DATA), "{rdi}"(data.as_ptr()), "{cx}"(SECTOR_SIZE) : "rdi" : "volatile"); + llvm_asm!("rep insl" :: "{dx}"(self.base + ISA_DATA), "{rdi}"(data.as_ptr()), "{cx}"(SECTOR_SIZE) : "rdi" : "volatile"); } } diff --git a/kernel/src/arch/x86_64/interrupt/handler.rs b/kernel/src/arch/x86_64/interrupt/handler.rs index d45004d6..54cbe315 100644 --- a/kernel/src/arch/x86_64/interrupt/handler.rs +++ b/kernel/src/arch/x86_64/interrupt/handler.rs @@ -141,7 +141,7 @@ fn double_fault(tf: &TrapFrame) { fn page_fault(tf: &mut TrapFrame) { let addr: usize; unsafe { - asm!("mov %cr2, $0" : "=r" (addr)); + llvm_asm!("mov %cr2, $0" : "=r" (addr)); } bitflags! { diff --git a/kernel/src/arch/x86_64/interrupt/mod.rs b/kernel/src/arch/x86_64/interrupt/mod.rs index ae0c4471..a7fd4d88 100644 --- a/kernel/src/arch/x86_64/interrupt/mod.rs +++ b/kernel/src/arch/x86_64/interrupt/mod.rs @@ -21,13 +21,13 @@ pub unsafe fn disable() { #[inline(always)] pub unsafe fn disable_and_store() -> usize { let r: usize; - asm!("pushfq; popq $0; cli" : "=r"(r) :: "memory"); + llvm_asm!("pushfq; popq $0; cli" : "=r"(r) :: "memory"); r } #[inline(always)] pub unsafe fn restore(flags: usize) { - asm!("pushq $0; popfq" :: "r"(flags) : "memory" "flags"); + llvm_asm!("pushq $0; popfq" :: "r"(flags) : "memory" "flags"); } #[inline(always)] diff --git a/kernel/src/arch/x86_64/interrupt/trapframe.rs b/kernel/src/arch/x86_64/interrupt/trapframe.rs index 8eb8b5b2..c1fcef85 100644 --- a/kernel/src/arch/x86_64/interrupt/trapframe.rs +++ b/kernel/src/arch/x86_64/interrupt/trapframe.rs @@ -183,7 +183,7 @@ impl Context { #[naked] #[inline(never)] pub unsafe extern "C" fn switch(&mut self, _target: &mut Self) { - asm!( + llvm_asm!( " // push rip (by caller) diff --git a/kernel/src/arch/x86_64/mod.rs b/kernel/src/arch/x86_64/mod.rs index 74381f42..1c71c4d1 100644 --- a/kernel/src/arch/x86_64/mod.rs +++ b/kernel/src/arch/x86_64/mod.rs @@ -97,13 +97,13 @@ fn other_start() -> ! { pub fn get_sp() -> usize { let sp: usize; unsafe { - asm!("mov %rsp, $0" : "=r"(sp)); + llvm_asm!("mov %rsp, $0" : "=r"(sp)); } sp } pub fn set_sp(sp: usize) { unsafe { - asm!("mov $0, %rsp" :: "r" (sp) : "memory"); + llvm_asm!("mov $0, %rsp" :: "r" (sp) : "memory"); } } diff --git a/kernel/src/arch/x86_64/paging.rs b/kernel/src/arch/x86_64/paging.rs index 9a637577..61a8a394 100644 --- a/kernel/src/arch/x86_64/paging.rs +++ b/kernel/src/arch/x86_64/paging.rs @@ -277,7 +277,7 @@ unsafe impl FrameAllocator for FrameAllocatorForX86 { } impl FrameDeallocator for FrameAllocatorForX86 { - fn deallocate_frame(&mut self, frame: Frame) { + unsafe fn deallocate_frame(&mut self, frame: Frame) { dealloc_frame(frame.start_address().as_u64() as usize); } } diff --git a/kernel/src/backtrace.rs b/kernel/src/backtrace.rs index 6a41652e..2ead2cb2 100644 --- a/kernel/src/backtrace.rs +++ b/kernel/src/backtrace.rs @@ -11,20 +11,20 @@ pub fn fp() -> usize { let ptr: usize; #[cfg(target_arch = "aarch64")] unsafe { - asm!("mov $0, x29" : "=r"(ptr)); + llvm_asm!("mov $0, x29" : "=r"(ptr)); } #[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))] unsafe { - asm!("mv $0, s0" : "=r"(ptr)); + llvm_asm!("mv $0, s0" : "=r"(ptr)); } #[cfg(target_arch = "x86_64")] unsafe { - asm!("mov %rbp, $0" : "=r"(ptr)); + llvm_asm!("mov %rbp, $0" : "=r"(ptr)); } #[cfg(any(target_arch = "mips"))] unsafe { // read $sp - asm!("ori $0, $$29, 0" : "=r"(ptr)); + llvm_asm!("ori $0, $$29, 0" : "=r"(ptr)); } ptr @@ -36,20 +36,20 @@ pub fn lr() -> usize { let ptr: usize; #[cfg(target_arch = "aarch64")] unsafe { - asm!("mov $0, x30" : "=r"(ptr)); + llvm_asm!("mov $0, x30" : "=r"(ptr)); } #[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))] unsafe { - asm!("mv $0, ra" : "=r"(ptr)); + llvm_asm!("mv $0, ra" : "=r"(ptr)); } #[cfg(target_arch = "x86_64")] unsafe { - asm!("movq 8(%rbp), $0" : "=r"(ptr)); + llvm_asm!("movq 8(%rbp), $0" : "=r"(ptr)); } #[cfg(target_arch = "mips")] unsafe { - asm!("ori $0, $$31, 0" : "=r"(ptr)); + llvm_asm!("ori $0, $$31, 0" : "=r"(ptr)); } ptr diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs index 3b498a4a..dcaafa23 100644 --- a/kernel/src/lib.rs +++ b/kernel/src/lib.rs @@ -1,7 +1,7 @@ #![feature(lang_items)] #![feature(naked_functions)] #![feature(untagged_unions)] -#![feature(asm)] +#![feature(llvm_asm)] #![feature(optin_builtin_traits)] #![feature(panic_info_message)] #![feature(global_asm)] diff --git a/kernel/src/sync/mutex.rs b/kernel/src/sync/mutex.rs index c095c8fa..4987ea78 100644 --- a/kernel/src/sync/mutex.rs +++ b/kernel/src/sync/mutex.rs @@ -269,11 +269,11 @@ impl MutexSupport for Spin { fn cpu_relax(&self) { unsafe { #[cfg(target_arch = "x86_64")] - asm!("pause" :::: "volatile"); + llvm_asm!("pause" :::: "volatile"); #[cfg(any(target_arch = "riscv32", target_arch = "riscv64", target_arch = "mips"))] - asm!("nop" :::: "volatile"); + llvm_asm!("nop" :::: "volatile"); #[cfg(target_arch = "aarch64")] - asm!("yield" :::: "volatile"); + llvm_asm!("yield" :::: "volatile"); } } fn before_lock() -> Self::GuardData {} @@ -307,11 +307,11 @@ impl MutexSupport for SpinNoIrq { fn cpu_relax(&self) { unsafe { #[cfg(target_arch = "x86_64")] - asm!("pause" :::: "volatile"); + llvm_asm!("pause" :::: "volatile"); #[cfg(any(target_arch = "riscv32", target_arch = "riscv64", target_arch = "mips"))] - asm!("nop" :::: "volatile"); + llvm_asm!("nop" :::: "volatile"); #[cfg(target_arch = "aarch64")] - asm!("yield" :::: "volatile"); + llvm_asm!("yield" :::: "volatile"); } } fn before_lock() -> Self::GuardData { diff --git a/kernel/src/syscall/mod.rs b/kernel/src/syscall/mod.rs index 6bc365ed..9976ab97 100644 --- a/kernel/src/syscall/mod.rs +++ b/kernel/src/syscall/mod.rs @@ -467,7 +467,7 @@ impl Syscall<'_> { } unsafe { - asm!("mtc0 $0, $$4, 2": :"r"(args[0])); + llvm_asm!("mtc0 $0, $$4, 2": :"r"(args[0])); *(_cur_tls as *mut usize) = args[0]; } Ok(0) diff --git a/rboot b/rboot index 048fa09b..e610182b 160000 --- a/rboot +++ b/rboot @@ -1 +1 @@ -Subproject commit 048fa09b6b9614ceee52f8d7a8e4587ae3ca61e8 +Subproject commit e610182ba0c12bb19394e40b79b0ab0c26436e49 diff --git a/rust-toolchain b/rust-toolchain index 8bd4ff0a..039471e8 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2020-04-06 +nightly-2020-06-04