-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dbgutil: automatically switch to the kernel if booting from preboot
- Loading branch information
Showing
8 changed files
with
95 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//! Stubs and other internal functionality for the `dbgutil` suite | ||
//! of Oro-specific GDB debugging utilities. | ||
#[cfg(not(debug_assertions))] | ||
compile_error!("The `dbgutil` module should only be used in debug builds."); | ||
|
||
use core::arch::asm; | ||
|
||
/// Transfer marker stub for `gdbutil` that allows the debugger to switch | ||
/// to the kernel image at an opportune time. | ||
#[no_mangle] | ||
#[link_section = ".text.force_keep"] | ||
pub extern "C" fn __oro_dbgutil_kernel_will_transfer() { | ||
// SAFETY(qix-): This is a marker function for GDB to switch to the kernel image. | ||
unsafe { | ||
asm!("nop", options(nostack, nomem, preserves_flags)); | ||
} | ||
} |
This file contains 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 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