Skip to content

Commit 575de31

Browse files
authored
Merge pull request #329 from toku-sa-n/fix_asm
fix: build error on the latest nightly
2 parents 55d5fad + 449f6b9 commit 575de31

File tree

11 files changed

+52
-10
lines changed

11 files changed

+52
-10
lines changed

.github/workflows/build.yml

+29-10
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,6 @@ jobs:
5050
rustc -Vv
5151
cargo -Vv
5252
53-
- name: Cache binaries
54-
id: cache-bin
55-
uses: actions/cache@v1
56-
with:
57-
path: binaries
58-
key: ${{ runner.OS }}-binaries
59-
- name: Add binaries/bin to PATH
60-
run: echo "$GITHUB_WORKSPACE/binaries/bin" >> $GITHUB_PATH
61-
shell: bash
62-
6353
- name: "Run cargo build"
6454
uses: actions-rs/cargo@v1
6555
with:
@@ -131,6 +121,35 @@ jobs:
131121
cargo build --target i686-unknown-linux-gnu --no-default-features --features nightly
132122
cargo build --target thumbv7em-none-eabihf --no-default-features --features nightly
133123
124+
bootloader-test:
125+
name: "Bootloader Integration Test"
126+
127+
strategy:
128+
fail-fast: false
129+
matrix:
130+
platform: [
131+
ubuntu-latest,
132+
macos-latest,
133+
windows-latest
134+
]
135+
136+
runs-on: ${{ matrix.platform }}
137+
timeout-minutes: 15
138+
139+
steps:
140+
- name: "Checkout Repository"
141+
uses: actions/checkout@v1
142+
143+
- name: Cache binaries
144+
id: cache-bin
145+
uses: actions/cache@v1
146+
with:
147+
path: binaries
148+
key: ${{ runner.OS }}-binaries
149+
- name: Add binaries/bin to PATH
150+
run: echo "$GITHUB_WORKSPACE/binaries/bin" >> $GITHUB_PATH
151+
shell: bash
152+
134153
- name: "Install Rustup Components"
135154
run: rustup component add rust-src llvm-tools-preview
136155
- name: "Install cargo-xbuild"

src/instructions/interrupts.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
//! Enabling and disabling interrupts
22
3+
#[cfg(feature = "inline_asm")]
4+
use core::arch::asm;
5+
36
/// Returns whether interrupts are enabled.
47
#[inline]
58
pub fn are_enabled() -> bool {

src/instructions/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ pub mod segmentation;
99
pub mod tables;
1010
pub mod tlb;
1111

12+
#[cfg(feature = "inline_asm")]
13+
use core::arch::asm;
14+
1215
/// Halts the CPU until the next interrupt arrives.
1316
#[inline]
1417
pub fn hlt() {

src/instructions/port.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! Access to I/O ports
22
3+
#[cfg(feature = "inline_asm")]
4+
use core::arch::asm;
35
use core::fmt;
46
use core::marker::PhantomData;
57

src/instructions/segmentation.rs

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ use crate::{
66
structures::gdt::SegmentSelector,
77
VirtAddr,
88
};
9+
#[cfg(feature = "inline_asm")]
10+
use core::arch::asm;
911

1012
macro_rules! get_reg_impl {
1113
($name:literal, $asm_get:ident) => {

src/instructions/tables.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
33
use crate::structures::gdt::SegmentSelector;
44
use crate::VirtAddr;
5+
#[cfg(feature = "inline_asm")]
6+
use core::arch::asm;
57

68
pub use crate::structures::DescriptorTablePointer;
79

src/instructions/tlb.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//! Functions to flush the translation lookaside buffer (TLB).
22
33
use crate::VirtAddr;
4+
#[cfg(feature = "inline_asm")]
5+
use core::arch::asm;
46

57
/// Invalidate the given address in the TLB using the `invlpg` instruction.
68
#[inline]

src/registers/control.rs

+2
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ bitflags! {
161161
mod x86_64 {
162162
use super::*;
163163
use crate::{instructions::tlb::Pcid, structures::paging::PhysFrame, PhysAddr, VirtAddr};
164+
#[cfg(feature = "inline_asm")]
165+
use core::arch::asm;
164166

165167
impl Cr0 {
166168
/// Read the current set of CR0 flags.

src/registers/model_specific.rs

+2
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ mod x86_64 {
127127
control::Cr4Flags,
128128
segmentation::{Segment, Segment64, CS, SS},
129129
};
130+
#[cfg(feature = "inline_asm")]
131+
use core::arch::asm;
130132

131133
impl Msr {
132134
/// Read 64 bits msr register.

src/registers/rflags.rs

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ bitflags! {
6565
#[cfg(feature = "instructions")]
6666
mod x86_64 {
6767
use super::*;
68+
#[cfg(feature = "inline_asm")]
69+
use core::arch::asm;
6870

6971
/// Returns the current value of the RFLAGS register.
7072
///

src/registers/xcontrol.rs

+3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ bitflags! {
5454
#[cfg(feature = "instructions")]
5555
mod x86_64 {
5656
use super::*;
57+
#[cfg(feature = "inline_asm")]
58+
use core::arch::asm;
59+
5760
impl XCr0 {
5861
/// Read the current set of XCR0 flags.
5962
#[inline]

0 commit comments

Comments
 (0)