Skip to content

Commit 94587f7

Browse files
committed
X86: support x86 (i386) and x86_64
1 parent 2fa229a commit 94587f7

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ let qemu_exit_handle = qemu_exit::RISCV64::new(addr);
2424

2525
// io_base: I/O-base of isa-debug-exit.
2626
// custom_exit_success: A custom success code; Must be an odd number.
27-
#[cfg(target_arch = "x86_64")]
27+
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
2828
let qemu_exit_handle = qemu_exit::X86::new(io_base, custom_exit_success);
2929

3030
qemu_exit_handle.exit(1337);
@@ -48,7 +48,7 @@ You need to chose a machine with the `sifive_test` device, for exemple `-M virt`
4848
qemu-system-riscv64 -M virt -nographic -monitor none -serial stdio -kernel kernel.elf
4949
```
5050

51-
### x86_64
51+
### x86/x86_64
5252

5353
Add the special ISA debug exit device by passing the flags:
5454
```

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
//!
2222
//! // io_base: I/O-base of isa-debug-exit.
2323
//! // custom_exit_success: A custom success code; Must be an odd number.
24-
//! #[cfg(target_arch = "x86_64")]
24+
//! #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
2525
//! let qemu_exit_handle = qemu_exit::X86::new(io_base, custom_exit_success);
2626
//!
2727
//! qemu_exit_handle.exit(1337);
@@ -84,10 +84,10 @@ pub mod riscv64;
8484
#[cfg(target_arch = "riscv64")]
8585
pub use riscv64::*;
8686

87-
#[cfg(target_arch = "x86_64")]
87+
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
8888
pub mod x86;
8989

90-
#[cfg(target_arch = "x86_64")]
90+
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
9191
pub use x86::*;
9292

9393
/// Generic interface for exiting QEMU.

src/x86.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
//
33
// Copyright (c) 2019-2022 Andre Richter <andre.o.richter@gmail.com>
44

5-
//! x86.
5+
//! x86 (i386) and x86_64.
66
77
use crate::QEMUExit;
88
use core::arch::asm;
99

1010
const EXIT_FAILURE: u32 = 0; // since ((0 << 1) | 1) = 1.
1111

12-
/// x86 configuration.
12+
/// x86/x86_64 configuration.
1313
pub struct X86 {
1414
/// Port number of the isa-debug-exit device.
1515
io_base: u16,

tests/exit_13.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ mod riscv64_virt;
3434
// x86
3535
//--------------------------------------------------------------------------------------------------
3636

37-
#[cfg(target_arch = "x86_64")]
37+
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
3838
const QEMU_EXIT_HANDLE: qemu_exit::X86 = qemu_exit::X86::new(0xf4, 5);
3939

4040
//--------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)