From nobody Fri Dec 06 17:54:50 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Y4f6M25Cdz5gcnB; Fri, 06 Dec 2024 17:54:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y4f6M1LPcz4nbM; Fri, 6 Dec 2024 17:54:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733507691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sYeIpif01LLA324pq9gu6/9JMbYB6mLptJxmtz8dUho=; b=Hexj3YcDKiBNF3tVB08C9IjBXq9TgxWhVqxe+kLeu7t2wYHL4PPrq6pGjHMFSUViW1lEzH 8daHcH94x+/qsGC5Tdlzi8LKfXF7Z1taMnOydCNFeuxmzWV8Ijzq5770/Jtb6ctEMjKngW C6bhIbt+YaEWE8TLddg5tBNYYdtvH0DcquJNUwycCDSr8hTUJmvfgObnyWHcuVrELZegzg onSIWDSh/yfYs4lcLur5V4Hi6XLhaWGovqU15G+q6kRK4ToqwMuUenas4U5RC+XdtI/FSv O9c0IzigPn/7fzCrv4LHkPWy2Rsn3W7PBK/4qs4Lz2was3OXbvx6J43E/o8mug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733507691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sYeIpif01LLA324pq9gu6/9JMbYB6mLptJxmtz8dUho=; b=jUv04ViGBePti02VIxyNVQ/pLHPNrfTVEPRx8WOzY+p5sN6yBPsNPrLfevwSHMVR/YEEII kc9d/pHpSDKMcT/yBmhKx/ZOgkBjAq43n2/sj1QaS0djfEfobblwij/AghEBXjiu/LTdV+ ud9PqYTvcf3R7O/GAlFXunY5Pj96CzbtNCCcSR7GMYnmgUjidVozpP5HQvttGD2PQk33pq 5azOW1ljglZmLm/r37GRQhC9JeGcFbaxYq/UP2IU5itwT1aP0/02q5e3ZdFXb4UHTrDXnk 8//1X7EImoCgKhHHzqem8/AdcicgUGUH57wFlZ2T0PdbE1WXeUlQLNA2us3XAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733507691; a=rsa-sha256; cv=none; b=Dev2IYzsp7zw5dd1hO6gfMHcbs7IXXdldhJvYSlhFguTEAFIWqyPvsrXi9SL1pNRL5wNBV fUIE2DGqbp5jzwxPtDM+lrvKrJAOv4N6qdsmdh/u3LkwEgWuwShkrCi9MY1mkYhBEPUr93 7+J+fiUOlDRZZL57LmwVTHY1adyrDK2TOA+4sqrRcOsigFmNH1D0y38NA/rX1lwP5iBD6e YcGM/0LXf7O078qwWQ1vG5XStCGdaUOquD8LzUlAwnxJqiawbC6qR+gHz+wsD8V2o8udoR IkvuxDJ13ekpS3Sx07qyeSMhTxTwt/hzisLvrFvqLs+RV6oIWny5LPQHbHe6zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Y4f6M0qBQzndY; Fri, 6 Dec 2024 17:54:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4B6HsojW066637; Fri, 6 Dec 2024 17:54:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B6Hsopt066634; Fri, 6 Dec 2024 17:54:50 GMT (envelope-from git) Date: Fri, 6 Dec 2024 17:54:50 GMT Message-Id: <202412061754.4B6Hsopt066634@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 7b16a4a75dc1 - main - sys/intr.h: Make it safe to include from assembler List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b16a4a75dc14224efc72f1ff2cc98f6f857f757 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7b16a4a75dc14224efc72f1ff2cc98f6f857f757 commit 7b16a4a75dc14224efc72f1ff2cc98f6f857f757 Author: Warner Losh AuthorDate: 2024-12-06 17:30:02 +0000 Commit: Warner Losh CommitDate: 2024-12-06 17:31:36 +0000 sys/intr.h: Make it safe to include from assembler Sometimes we need defines from this file in assembler code. Today we do the heavyweight approach of using genassym for that. However, they are just #defines, so in the future we want to include sys/intr.h to pick up the needed constants in exception.S. PR: 283041 Sponsored by: Netflix Reviewed by: mmel, andrew Differential Revision: https://reviews.freebsd.org/D47846 --- sys/arm/include/intr.h | 6 ++++-- sys/arm64/include/intr.h | 10 ++++++---- sys/riscv/include/intr.h | 2 ++ sys/sys/intr.h | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/sys/arm/include/intr.h b/sys/arm/include/intr.h index e64edd47dad2..5facd5dbccdb 100644 --- a/sys/arm/include/intr.h +++ b/sys/arm/include/intr.h @@ -39,14 +39,16 @@ #ifndef _MACHINE_INTR_H_ #define _MACHINE_INTR_H_ +#ifndef LOCORE #ifdef FDT #include #endif +void arm_irq_memory_barrier(uintptr_t); +#endif /* !LOCORE */ + #ifndef NIRQ #define NIRQ 1024 /* XXX - It should be an option. */ #endif -void arm_irq_memory_barrier(uintptr_t); - #endif /* _MACHINE_INTR_H */ diff --git a/sys/arm64/include/intr.h b/sys/arm64/include/intr.h index 38cba6ae8b0d..56bce911cd32 100644 --- a/sys/arm64/include/intr.h +++ b/sys/arm64/include/intr.h @@ -27,18 +27,20 @@ #ifndef _MACHINE_INTR_H_ #define _MACHINE_INTR_H_ +#ifndef LOCORE #ifdef FDT #include #endif -#ifndef NIRQ -#define NIRQ 16384 /* XXX - It should be an option. */ -#endif - static inline void arm_irq_memory_barrier(uintptr_t irq) { } +#endif /* !LOCORE */ + +#ifndef NIRQ +#define NIRQ 16384 /* XXX - It should be an option. */ +#endif #ifdef DEV_ACPI #define ACPI_INTR_XREF 1 diff --git a/sys/riscv/include/intr.h b/sys/riscv/include/intr.h index 657781efb620..ea98f0632108 100644 --- a/sys/riscv/include/intr.h +++ b/sys/riscv/include/intr.h @@ -39,6 +39,7 @@ #define NIRQ 1024 #endif +#ifndef LOCORE enum { IRQ_SOFTWARE_USER, IRQ_SOFTWARE_SUPERVISOR, @@ -53,5 +54,6 @@ enum { IRQ_EXTERNAL_HYPERVISOR, IRQ_EXTERNAL_MACHINE, }; +#endif /* !LOCORE */ #endif /* !_MACHINE_INTR_MACHDEP_H_ */ diff --git a/sys/sys/intr.h b/sys/sys/intr.h index f11e96777927..d60eac937d93 100644 --- a/sys/sys/intr.h +++ b/sys/sys/intr.h @@ -33,14 +33,14 @@ #error Need INTRNG for this file #endif -#include - #include #define INTR_IRQ_INVALID 0xFFFFFFFF #define INTR_ROOT_IRQ 0 +#ifndef LOCORE + enum intr_map_data_type { INTR_MAP_DATA_ACPI = 0, INTR_MAP_DATA_FDT, @@ -171,4 +171,6 @@ void intr_ipi_dispatch(u_int ipi); /* Main interrupt handler called from asm on most archs except riscv. */ void intr_irq_handler(struct trapframe *tf, uint32_t rootnum); +#endif /* !LOCORE */ + #endif /* _SYS_INTR_H */