From 72cd8ae920ec85a703434d7d9f829e6c8d82d41a Mon Sep 17 00:00:00 2001 From: Jiaqi Gao Date: Tue, 24 Dec 2024 21:04:56 -0500 Subject: [PATCH] td-exception: public `InterruptCallback::new` `InterruptCallback::new` shall be set as pub to make it possible for user of this crate to register callback via `register_interrupt_callback`. Publicly use `td_exception::interrupt::*` in `td-payload` crate can help reduce redundant references to the `td-exception` crate. Signed-off-by: Jiaqi Gao --- td-exception/src/interrupt.rs | 2 +- td-payload/src/arch/x86_64/idt.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/td-exception/src/interrupt.rs b/td-exception/src/interrupt.rs index c5b53f06..3b8b3095 100644 --- a/td-exception/src/interrupt.rs +++ b/td-exception/src/interrupt.rs @@ -98,7 +98,7 @@ pub struct InterruptCallback { } impl InterruptCallback { - const fn new(func: fn(&mut InterruptStack)) -> Self { + pub const fn new(func: fn(&mut InterruptStack)) -> Self { InterruptCallback { func } } } diff --git a/td-payload/src/arch/x86_64/idt.rs b/td-payload/src/arch/x86_64/idt.rs index 24399694..6302c305 100644 --- a/td-payload/src/arch/x86_64/idt.rs +++ b/td-payload/src/arch/x86_64/idt.rs @@ -3,6 +3,7 @@ // SPDX-License-Identifier: BSD-2-Clause-Patent pub use td_exception::idt::*; +pub use td_exception::interrupt::*; pub const PAGE_FAULT_EXCEPTION: u8 = 14; pub const PAGE_FAULT_IST: u8 = 1;