x86/registers/bits32/
mod.rs

1// Licensed under the Apache License, Version 2.0 or the MIT License.
2// SPDX-License-Identifier: Apache-2.0 OR MIT
3// Copyright Tock Contributors 2025.
4
5// This is inspired and adapted for Tock from the [x86](https://github.com/gz/rust-x86) crate.
6
7//! Data structures and functions used by 32-bit mode.
8
9pub mod eflags;
10pub mod paging;
11// pub mod segmentation;
12pub mod task;
13
14#[cfg(target_arch = "x86")]
15use core::arch::asm;
16
17#[cfg(target_arch = "x86")]
18#[inline(always)]
19pub unsafe fn stack_jmp(stack: *mut (), ip: *const ()) -> ! {
20    unsafe {
21        asm!("movl {0}, %esp; jmp {1}", in(reg) stack, in(reg) ip, options(att_syntax));
22    }
23
24    unreachable!()
25}
26
27//For CI only
28
29#[cfg(not(any(doc, target_arch = "x86")))]
30pub unsafe fn stack_jmp(_stack: *mut (), _ip: *const ()) -> ! {
31    unimplemented!()
32}