Added workflow?
This commit is contained in:
@@ -61,6 +61,7 @@ impl<T> fmt::Debug for Entry<T> {
|
||||
}
|
||||
}
|
||||
|
||||
// spell:off
|
||||
impl<F> Entry<F> {
|
||||
/// Create a valid non-present IDT entry.
|
||||
#[inline]
|
||||
@@ -111,7 +112,9 @@ impl<F> Entry<F> {
|
||||
))
|
||||
}
|
||||
}
|
||||
// spell:on
|
||||
|
||||
// spell:off
|
||||
impl<F: HandlerFuncType> Entry<F> {
|
||||
/// Sets the handler address for the IDT entry and sets the following defaults:
|
||||
/// - The code selector is the code segment currently active in the CPU
|
||||
@@ -125,3 +128,4 @@ impl<F: HandlerFuncType> Entry<F> {
|
||||
unsafe { self.set_handler_addr(handler.to_virt_addr()) }
|
||||
}
|
||||
}
|
||||
// spell:on
|
||||
|
||||
@@ -50,9 +50,9 @@ bitflags! {
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// MARK: types
|
||||
///
|
||||
//
|
||||
// MARK: types
|
||||
//
|
||||
|
||||
/// A handler function for an interrupt or an exception without error code.
|
||||
pub type HandlerFunc = extern "x86-interrupt" fn(InterruptStackFrame);
|
||||
@@ -84,6 +84,7 @@ pub unsafe trait HandlerFuncType {
|
||||
unsafe impl HandlerFuncType for HandlerFunc {
|
||||
#[inline]
|
||||
fn to_virt_addr(self) -> VirtAddr {
|
||||
#[expect(clippy::fn_to_numeric_cast_with_truncation)]
|
||||
VirtAddr::new(self as u32)
|
||||
}
|
||||
}
|
||||
@@ -91,6 +92,7 @@ unsafe impl HandlerFuncType for HandlerFunc {
|
||||
unsafe impl HandlerFuncType for HandlerFuncWithErrCode {
|
||||
#[inline]
|
||||
fn to_virt_addr(self) -> VirtAddr {
|
||||
#[expect(clippy::fn_to_numeric_cast_with_truncation)]
|
||||
VirtAddr::new(self as u32)
|
||||
}
|
||||
}
|
||||
@@ -98,6 +100,7 @@ unsafe impl HandlerFuncType for HandlerFuncWithErrCode {
|
||||
unsafe impl HandlerFuncType for DivergingHandlerFunc {
|
||||
#[inline]
|
||||
fn to_virt_addr(self) -> VirtAddr {
|
||||
#[expect(clippy::fn_to_numeric_cast_with_truncation)]
|
||||
VirtAddr::new(self as u32)
|
||||
}
|
||||
}
|
||||
@@ -105,6 +108,7 @@ unsafe impl HandlerFuncType for DivergingHandlerFunc {
|
||||
unsafe impl HandlerFuncType for DivergingHandlerFuncWithErrCode {
|
||||
#[inline]
|
||||
fn to_virt_addr(self) -> VirtAddr {
|
||||
#[expect(clippy::fn_to_numeric_cast_with_truncation)]
|
||||
VirtAddr::new(self as u32)
|
||||
}
|
||||
}
|
||||
@@ -112,6 +116,7 @@ unsafe impl HandlerFuncType for DivergingHandlerFuncWithErrCode {
|
||||
unsafe impl HandlerFuncType for PageFaultHandlerFunc {
|
||||
#[inline]
|
||||
fn to_virt_addr(self) -> VirtAddr {
|
||||
#[expect(clippy::fn_to_numeric_cast_with_truncation)]
|
||||
VirtAddr::new(self as u32)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ use super::{
|
||||
|
||||
// TODO: comments
|
||||
#[repr(C, packed(2))]
|
||||
struct IDTR {
|
||||
struct Idtr {
|
||||
size: u16,
|
||||
offset: u32,
|
||||
}
|
||||
@@ -16,6 +16,7 @@ struct IDTR {
|
||||
// MARK: idt
|
||||
//
|
||||
|
||||
// spell:off
|
||||
#[derive(Clone, Debug)]
|
||||
#[repr(C)]
|
||||
#[repr(align(8))]
|
||||
@@ -410,6 +411,7 @@ pub struct InterruptDescriptorTable {
|
||||
/// instruction pointer points to the instruction after the INTn.
|
||||
interrupts: [Entry<HandlerFunc>; 256 - 32],
|
||||
}
|
||||
// spell:on
|
||||
|
||||
//
|
||||
// MARK: impl
|
||||
@@ -469,7 +471,7 @@ impl InterruptDescriptorTable {
|
||||
#[inline]
|
||||
pub unsafe fn load_unsafe(&self) {
|
||||
let idtr = {
|
||||
IDTR {
|
||||
Idtr {
|
||||
size: (size_of::<InterruptDescriptorTable>() - 1) as u16,
|
||||
offset: self as *const _ as u32,
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ pub fn rust_begin_unwind(info: &PanicInfo<'_>) -> ! {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[no_mangle]
|
||||
/// Required to handle panics
|
||||
pub extern "C" fn _Unwind_Resume() -> ! {
|
||||
|
||||
@@ -2,7 +2,6 @@ use core::ptr;
|
||||
|
||||
use super::THUNK_STACK_ADDR;
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
#[repr(C, packed)]
|
||||
pub struct ThunkData {
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
{
|
||||
"llvm-target": "i686-unknown-none",
|
||||
"target-endian": "little",
|
||||
"target-pointer-width": "32",
|
||||
"target-c-int-width": "32",
|
||||
"data-layout": "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128",
|
||||
"arch": "x86",
|
||||
"os": "none",
|
||||
"env": "",
|
||||
"vendor": "unknown",
|
||||
"linker-flavor": "gcc",
|
||||
"panic-strategy": "abort",
|
||||
"pre-link-args": {
|
||||
"gcc": ["-m32", "-nostdlib", "-static"]
|
||||
},
|
||||
"features": "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2,+soft-float",
|
||||
"dynamic-linking": false,
|
||||
"executables": false,
|
||||
"relocation-model": "static",
|
||||
"code-model": "large",
|
||||
"disable-redzone": true,
|
||||
"frame-pointer": "always",
|
||||
"exe-suffix": "",
|
||||
"has-rpath": false,
|
||||
"no-default-libraries": true,
|
||||
"position-independent-executables": false,
|
||||
"tls-model": "global-dynamic"
|
||||
"llvm-target": "i686-unknown-none",
|
||||
"target-endian": "little",
|
||||
"target-pointer-width": "32",
|
||||
"target-c-int-width": "32",
|
||||
"data-layout": "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128",
|
||||
"arch": "x86",
|
||||
"os": "none",
|
||||
"env": "",
|
||||
"vendor": "unknown",
|
||||
"linker-flavor": "gcc",
|
||||
"panic-strategy": "abort",
|
||||
"pre-link-args": {
|
||||
"gcc": ["-m32", "-nostdlib", "-static"]
|
||||
},
|
||||
"features": "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float",
|
||||
"dynamic-linking": false,
|
||||
"executables": false,
|
||||
"relocation-model": "static",
|
||||
"code-model": "large",
|
||||
"disable-redzone": true,
|
||||
"frame-pointer": "always",
|
||||
"exe-suffix": "",
|
||||
"has-rpath": false,
|
||||
"no-default-libraries": true,
|
||||
"position-independent-executables": false,
|
||||
"tls-model": "global-dynamic"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user