Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes #209

Merged
merged 2 commits into from
Sep 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ U = user
KR = kernel-rs

RUST_TARGET = riscv64gc-unknown-none-elfhf
ifndef RUST_MODE
RUST_MODE = debug
endif

ifeq ($(RUST_MODE),release)
CARGOFLAGS = --release
else
CARGOFLAGS =
endif

# OBJS = \
# $K/entry.o \
Expand Down Expand Up @@ -95,7 +103,7 @@ $U/initcode: $U/initcode.S
$(OBJDUMP) -S $U/initcode.o > $U/initcode.asm

$(KR)/target/$(RUST_TARGET)/$(RUST_MODE)/librv6_kernel.a: $(shell find $(KR) -type f)
cargo build --manifest-path kernel-rs/Cargo.toml --target kernel-rs/$(RUST_TARGET).json
cargo build --manifest-path kernel-rs/Cargo.toml --target kernel-rs/$(RUST_TARGET).json $(CARGOFLAGS)

tags: $(OBJS) _init
etags *.S *.c
Expand Down
3 changes: 3 additions & 0 deletions kernel-rs/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use core::sync::atomic::spin_loop_hint;

// HACK(@efenniht): Block inlining to avoid an infinite loop miscompilation of LLVM:
// https://github.com/rust-lang/rust/issues/28728.
#[inline(never)]
pub fn spin_loop() -> ! {
loop {
spin_loop_hint();
Expand Down