1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Helper functions to initialize the CPU states on systems bootstrapping.
pub use init_gdt;
pub use init_idt;
pub use init_syscall;
/// Initializes the per-CPU data structures.
///
/// It calls the initialization function of the [`percpu`] crate. It (or other
/// alternative initialization) should be called before [`init_trap`].
///
/// [`percpu`]: https://docs.rs/percpu/latest/percpu/index.html
/// Initializes trap handling on the current CPU.
///
/// In detail, it initializes the GDT, IDT on x86_64 platforms ([`init_gdt`] and
/// [`init_idt`]). If the `uspace` feature is enabled, it also initializes
/// relevant model-specific registers to configure the handler for `syscall`
/// instruction ([`init_syscall`]).
///
/// # Notes
/// Before calling this function, the initialization function of the [`percpu`] crate
/// should have been invoked to ensure that the per-CPU data structures are set up
/// correctly (i.e., by calling [`init_percpu`]).
///
/// [`percpu`]: https://docs.rs/percpu/latest/percpu/index.html