x86-alignment-check 0.1.1

x86 aligment check flag manipulation
Documentation

x86-alignment-check

crate Docs Rust Version Apache2/MIT licensed Test ubu Test mac Test win

x86-alignment-check is set ac flag in eflags on x86 or x86_64

Features

  • set ac flag bit into ON, its included eflags of x86.
  • x86_64 are supported too.
  • #![no_std]

Example: If your code is correctly controlled by alignment

First, add the following to Cargo.toml:

[target.'cfg(any(target_arch = "x86_64", target_arch = "x86"))'.dev-dependencies]
x86-alignment-check = "*"

Second, enclose your test code with x86_alighment_check() as follows:

    use x86_alignment_check::x86_alighment_check;
    //
    let old_flag = x86_alighment_check(true);
    //
    // here your test codes, processing anythings, a bus error may occur.
    //
    let _ = x86_alighment_check(old_flag);

Finally execute cargo test

Changelogs

This crate's changelog here.

License

This project is licensed under either of

at your option.