-
Notifications
You must be signed in to change notification settings - Fork 143
Decouple instructions into a separate feature flag. #179
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
52fc1d0
Decouple instructions into a separate feature flag.
h33p 66a37da
Remove array-init dependency, move wr/rd base instructions to segment…
h33p b8aedfb
Provide default impl for PageTable
h33p 22356fc
Fix build script architecture check
h33p fb9e04c
Update CI for other architectures
h33p 2c70f6a
Disable OffsetPageTable on non-64 bit architectures
h33p c1eafd6
Test for pointer_width in doc tests
h33p 8f9cb5c
Fix pointer_width -> target_pointer_width, make doc tests check for i…
h33p 8a5b527
Re-enable const variant for PageTable::new
h33p File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,52 @@ | ||
#[cfg(feature = "inline_asm")] | ||
fn main() {} | ||
|
||
#[cfg(all(not(feature = "inline_asm"), not(feature = "stable")))] | ||
fn main() { | ||
compile_error!("Neither feature \"stable\" nor \"nightly\" was set!"); | ||
} | ||
println!("cargo:rerun-if-changed=build.rs"); | ||
|
||
#[cfg(all(not(feature = "inline_asm"), feature = "stable"))] | ||
fn main() { | ||
use std::ffi::OsString; | ||
use std::fs; | ||
#[cfg(all(feature = "external_asm", windows))] | ||
compile_error!("\"external_asm\" feature is not available on windows!"); | ||
|
||
println!("cargo:rerun-if-changed=build.rs"); | ||
#[cfg(all(feature = "instructions", not(target_arch = "x86_64")))] | ||
compile_error!("\"instructions\" feature is only available for x86_64 targets!"); | ||
|
||
let entries = fs::read_dir("src/asm") | ||
.unwrap() | ||
.filter_map(|f| { | ||
f.ok().and_then(|e| { | ||
let path = e.path(); | ||
match path.extension() { | ||
Some(ext) if ext.eq(&OsString::from("s")) => Some(path), | ||
_ => None, | ||
} | ||
#[cfg(all( | ||
feature = "instructions", | ||
not(feature = "inline_asm"), | ||
not(feature = "external_asm") | ||
))] | ||
compile_error!("\"instructions\" feature is enabled, but neither feature \"external_asm\" nor \"inline_asm\" was set!"); | ||
|
||
#[cfg(all(feature = "inline_asm", feature = "external_asm"))] | ||
compile_error!( | ||
"\"inline_asm\" and \"external_asm\" features can not be enabled at the same time!" | ||
); | ||
phil-opp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
#[cfg(all(feature = "instructions", feature = "external_asm"))] | ||
{ | ||
use std::ffi::OsString; | ||
use std::fs; | ||
|
||
let entries = fs::read_dir("src/asm") | ||
.unwrap() | ||
.filter_map(|f| { | ||
f.ok().and_then(|e| { | ||
let path = e.path(); | ||
match path.extension() { | ||
Some(ext) if ext.eq(&OsString::from("s")) => Some(path), | ||
_ => None, | ||
} | ||
}) | ||
}) | ||
}) | ||
.collect::<Vec<_>>(); | ||
|
||
cc::Build::new() | ||
.no_default_flags(true) | ||
.files(&entries) | ||
.pic(true) | ||
.static_flag(true) | ||
.shared_flag(false) | ||
.compile("x86_64_asm"); | ||
|
||
for e in entries { | ||
println!("cargo:rerun-if-changed={}", e.to_str().unwrap()); | ||
.collect::<Vec<_>>(); | ||
|
||
cc::Build::new() | ||
.no_default_flags(true) | ||
.files(&entries) | ||
.pic(true) | ||
.static_flag(true) | ||
.shared_flag(false) | ||
.compile("x86_64_asm"); | ||
|
||
for e in entries { | ||
println!("cargo:rerun-if-changed={}", e.to_str().unwrap()); | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.