Update post to use x86_64 v0.13.2

This commit is contained in:
Philipp Oppermann
2021-02-02 11:01:53 +01:00
parent 18930ccad7
commit c5eeea29e2
14 changed files with 94 additions and 94 deletions

View File

@@ -179,18 +179,18 @@ test-args = ["-device", "isa-debug-exit,iobase=0xf4,iosize=0x04"]
به جای فراخوانی دستی دستورالعمل های اسمبلی `in` و `out`، ما از انتزاعات ارائه شده توسط کریت [`x86_64`] استفاده می‌کنیم. برای افزودن یک وابستگی به آن کریت، آن را به بخش `dependencies` در `Cargo.toml` اضافه می‌کنیم:
[`x86_64`]: https://docs.rs/x86_64/0.12.1/x86_64/
[`x86_64`]: https://docs.rs/x86_64/0.13.2/x86_64/
```toml
# in Cargo.toml
[dependencies]
x86_64 = "0.12.1"
x86_64 = "0.13.2"
```
اکنون می‌توانیم از نوع [`Port`] ارائه شده توسط کریت برای ایجاد عملکرد `exit_qemu` استفاده کنیم:
[`Port`]: https://docs.rs/x86_64/0.12.1/x86_64/instructions/port/struct.Port.html
[`Port`]: https://docs.rs/x86_64/0.13.2/x86_64/instructions/port/struct.Port.html
```rust
// in src/main.rs

View File

@@ -183,18 +183,18 @@ CPUと<ruby>周辺機器<rp> (</rp><rt>ペリフェラル</rt><rp>) </rp></ruby>
`in``out`のアセンブリ命令を手動で呼び出す代わりに、[`x86_64`]クレートによって提供される<ruby>abstraction<rp> (</rp><rt>抽象化されたもの</rt><rp>) </rp></ruby>を使います。このクレートへの依存を追加するため、`Cargo.toml``dependencies`セクションにこれを追加しましょう:
[`x86_64`]: https://docs.rs/x86_64/0.12.1/x86_64/
[`x86_64`]: https://docs.rs/x86_64/0.13.2/x86_64/
```toml
# in Cargo.toml
[dependencies]
x86_64 = "0.12.1"
x86_64 = "0.13.2"
```
これで、このクレートによって提供される[`Port`]型を使って`exit_qemu`関数を作ることができます。
[`Port`]: https://docs.rs/x86_64/0.12.1/x86_64/instructions/port/struct.Port.html
[`Port`]: https://docs.rs/x86_64/0.13.2/x86_64/instructions/port/struct.Port.html
```rust
// in src/main.rs

View File

@@ -174,18 +174,18 @@ The functionality of the `isa-debug-exit` device is very simple. When a `value`
Instead of manually invoking the `in` and `out` assembly instructions, we use the abstractions provided by the [`x86_64`] crate. To add a dependency on that crate, we add it to the `dependencies` section in our `Cargo.toml`:
[`x86_64`]: https://docs.rs/x86_64/0.12.1/x86_64/
[`x86_64`]: https://docs.rs/x86_64/0.13.2/x86_64/
```toml
# in Cargo.toml
[dependencies]
x86_64 = "0.12.1"
x86_64 = "0.13.2"
```
Now we can use the [`Port`] type provided by the crate to create an `exit_qemu` function:
[`Port`]: https://docs.rs/x86_64/0.12.1/x86_64/instructions/port/struct.Port.html
[`Port`]: https://docs.rs/x86_64/0.13.2/x86_64/instructions/port/struct.Port.html
```rust
// in src/main.rs