git: 38f941deb6fa - main - x86: Add intr_enable_src()

From: Aymeric Wibo <obiwac_at_FreeBSD.org>
Date: Tue, 13 Jan 2026 22:43:10 UTC
The branch main has been updated by obiwac:

URL: https://cgit.FreeBSD.org/src/commit/?id=38f941deb6faa0c22ffd5bf2f848c62dc6fce434

commit 38f941deb6faa0c22ffd5bf2f848c62dc6fce434
Author:     Aymeric Wibo <obiwac@FreeBSD.org>
AuthorDate: 2026-01-13 22:15:55 +0000
Commit:     Aymeric Wibo <obiwac@FreeBSD.org>
CommitDate: 2026-01-13 22:21:05 +0000

    x86: Add intr_enable_src()
    
    Function to enable specific IRQ source.
    
    This will be used by the s2idle code to enable just SCIs on x86 to break
    the CPU out of idle.
    
    Reviewed by:    olce
    Approved by:    olce
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D48734
---
 sys/x86/include/intr_machdep.h | 1 +
 sys/x86/x86/intr_machdep.c     | 9 +++++++++
 2 files changed, 10 insertions(+)

diff --git a/sys/x86/include/intr_machdep.h b/sys/x86/include/intr_machdep.h
index 497c89b0a7eb..6d6b1962b6bd 100644
--- a/sys/x86/include/intr_machdep.h
+++ b/sys/x86/include/intr_machdep.h
@@ -151,6 +151,7 @@ int	intr_register_source(struct intsrc *isrc);
 int	intr_remove_handler(void *cookie);
 void	intr_resume(bool suspend_cancelled);
 void	intr_suspend(void);
+void	intr_enable_src(u_int irq);
 void	intr_reprogram(void);
 void	intrcnt_add(const char *name, u_long **countp);
 void	nexus_add_irq(u_long irq);
diff --git a/sys/x86/x86/intr_machdep.c b/sys/x86/x86/intr_machdep.c
index a16d2ced8dba..7e57c97a7291 100644
--- a/sys/x86/x86/intr_machdep.c
+++ b/sys/x86/x86/intr_machdep.c
@@ -405,6 +405,15 @@ intr_suspend(void)
 	mtx_unlock(&intrpic_lock);
 }
 
+void
+intr_enable_src(u_int irq)
+{
+	struct intsrc *is;
+
+	is = interrupt_sources[irq];
+	is->is_pic->pic_enable_source(is);
+}
+
 static int
 intr_assign_cpu(void *arg, int cpu)
 {