summaryrefslogtreecommitdiff
path: root/components/drivers/pic/pic.c
AgeCommit message (Collapse)Author
2026-07-08drivers: pic: Fix PIRQ lookup upper boundOld-Ding
rt_pic_linear_irq() stores irq_nr as a count and assigns pic->pirqs to the first entry in that range. rt_pic_find_pirq() therefore must treat the upper bound as exclusive. The inclusive check could return pic->pirqs[irq_nr] when irq equals irq_start + irq_nr, which is one entry past the allocated range. Generated-by: OpenAI Codex Signed-off-by: Old-Ding <[email protected]>
2026-01-31[components][clock_time] Refactor time subsystem around clock_time (#11111)Bernard Xiong
* [components][clock_time] Refactor time subsystem around clock_time Introduce the clock_time core with clock source/event separation, high-resolution scheduling, and boot-time helpers, plus clock_timer adapters for timer peripherals. Remove legacy ktime/cputime/hwtimer implementations and migrate arch and BSP time paths to the new subsystem while keeping POSIX time integration functional. Update drivers, Kconfig/SConscript wiring, documentation, and tests; add clock_time overview docs and align naming to clock_boottime/clock_hrtimer/clock_timer. * [components][clock_time] Use BSP-provided clock timer frequency on riscv64 * [risc-v] Use runtime clock timer frequency for tick and delays * [bsp] Add clock timer frequency hooks for riscv64 boards * [bsp] Update Renesas RA driver doc clock_timer link * [bsp] Sync zynqmp-r5-axu4ev rtconfig after config refresh * [bsp][rk3500] Update rk3500 clock configuration * [bsp][hpmicro] Add rt_hw_us_delay hook and update board delays * [bsp][stm32l496-st-nucleo] enable clock_time for hwtimer sample in ci * [bsp][hpmicro] Fix rtconfig include scope for hpm6750evk Move rtconfig.h include outside the ENET_MULTIPLE_PORT guard for hpm6750evk and hpm6750evk2 so configuration macros are available regardless of ENET settings. * [bsp][raspi3] select clock time for systimer * [bsp][hpm5300evk] Trim trailing blank line * [bsp][hpm5301evklite] Trim trailing blank line * [bsp][hpm5e00evk] Trim trailing blank line * [bsp][hpm6200evk] Trim trailing blank line * [bsp][hpm6300evk] Trim trailing blank line * [bsp][hpm6750evk] Trim trailing blank line * [bsp][hpm6750evk2] Trim trailing blank line * [bsp][hpm6750evkmini] Trim trailing blank line * [bsp][hpm6800evk] Trim trailing blank line * [bsp][hpm6e00evk] Trim trailing blank line * [bsp][nxp] switch lpc178x to gcc and remove mcx timer source * [bsp][stm32] fix the CONFIG_RT_USING_CLOCK_TIME issue. * [docs][clock_time] add clock time documentation * [docs][clock_time] Update clock time subsystem documentation - Update device driver index to use correct page reference - Clarify upper layer responsibilities in architecture overview - Update README to describe POSIX/libc, Soft RTC, and device driver usage - Refine architecture diagram with improved layout and color scheme - Remove obsolete clock_timer.md file * [kernel][utest] Trim trailing space * [clock_time] Fix hrtimer wrap handling * [clock_time] fix the static rt_inline issue * [clock_time] fix the rt_clock_hrtimer_control result issue
2025-12-09[DM][PIC] Fix #10998 (#11024)GUI
* [DM/PIC] Fixup SMP CPU mask list when CPU < 4 * [DM][PIC] Fix #10998 The size of cpumask is `RT_CPUS_NR`, memset force to space will overflow in stack. Signed-off-by: GuEe-GUI <[email protected]>
2025-12-07[DM/PIC] Fixup SMP CPU mask list when CPU < 4GuEe-GUI
Signed-off-by: GuEe-GUI <[email protected]>
2025-07-12[DM/PIC] Fixup the interrput info list formatGuEe-GUI
Signed-off-by: GuEe-GUI <[email protected]>
2025-07-12[DM/PIC] Config IPI by RT_MAX_IPIGuEe-GUI
Signed-off-by: GuEe-GUI <[email protected]>
2025-02-11[DM] Replace spinlock static init by RT_DEFINE_SPINLOCKGuEe-GUI
Signed-off-by: GuEe-GUI <[email protected]>
2024-12-13[DM/FIXUP] Fixup PIC ktime dependsGuEe-GUI
Signed-off-by: GuEe-GUI <[email protected]>
2024-11-03feat: smp_call: added signaling call_reqShell
This patch introduces `rt_smp_call_request` API to handle queued requests across cores with user provided data buffer, which provides a way to request IPI through a non-blocking pattern. It also resolved several issues in the old implementation: - Multiple requests from different cores can not be queued in the work object of the target core. - Data racing on `rt_smp_work` of same core. If multiple requests came in turns, or if the call is used by the target cpu, while a new request is coming, the value will be overwrite. - Memory vulnerability. The rt_smp_event is allocated on stack, though the caller may not wait until the call is done. - API naming problem. Actually we don't provide a way to issue an IPI to ANY core in mask. What the API do is aligned to MANY pattern. - FUNC_IPI registering to PIC. Changes: - Declared and configured the new `RT_SMP_CALL_IPI` to support functional IPIs for task requests across cores. - Replaced the single `rt_smp_work` array with `call_req_cores` to manage per-core call requests safely. - Added `_call_req_take` and `_call_req_release` functions for atomic handling of request lifetimes, preventing data race conditions. - Replaced single event handling with a queue-based approach (`call_queue`) for efficient multi-request processing per core. - Introduced `rt_smp_call_ipi_handler` to process queued requests, reducing IPI contention by only sending new requests when needed. - Implemented `_smp_call_remote_request` to handle remote requests with specific flags, enabling more flexible core-to-core task signaling. - Refined `rt_smp_call_req_init` to initialize and track requests with atomic usage flags, mitigating potential memory vulnerabilities. Signed-off-by: Shell <[email protected]>
2024-09-19[FEATURE/PIC] support PIC cancel (only in debug)GuEe-GUI
PIC may free because some wrongs in debug. We should remove in PIC list or there are some undefined behavior will happen. Signed-off-by: GuEe-GUI <[email protected]>
2024-09-19[FIXUP/PIC] pirq's child handler should lock lessGuEe-GUI
When call the child handler, the PIC ops needn't lock again. Critical zone protection by PIC implementers. Signed-off-by: GuEe-GUI <[email protected]>
2024-09-19[FIXUP/PIC] set interrupt status when do trapsGuEe-GUI
Signed-off-by: GuEe-GUI <[email protected]>
2024-09-19[PIC/FIXUP] pirq reinit failGuEe-GUI
don't reinit pirq's list if cascade Signed-off-by: GuEe-GUI <[email protected]>
2024-06-23[components][ktime]support period ktime timeout and multiple ktimer_hrtimer ↵zms123456
(#8972) * support period time * enable multiple ktimer * mv set delay_cnt to hrtimer_start * add ktime debug info * change current_irq_begin to local var * fix bug: setting current timer and setting timeout in driver aren't atomicly * create->init * refactoring ktime
2024-05-31[DM/feature] Implement PIC irq state { get; set } (#9006)GUI
* [DM/feature] Implement PIC irq state { get; set } There are some common state for irq: 1. Pending: IRQ was triggered, but software not ACK. 2. Active: IRQ was ACK, but not EOI. 3. Masked: IRQ was masked or umasked. Signed-off-by: GuEe-GUI <[email protected]> * [DM/pic] Support IRQ state { get; set } for ARM GICv2/v3 Signed-off-by: GuEe-GUI <[email protected]> --------- Signed-off-by: GuEe-GUI <[email protected]>
2024-05-28 [PIC] Make affinity helper interface (#8995)GUI
* [PIC] Make affinity helper interface Signed-off-by: GuEe-GUI <[email protected]> * [PIC/GIC] Fixup GIC affinity init GICv2 is not support if current CPU is not startup, but RT-Thread SMP is startup after the devices init in the `main` thread. This patch fixup the cpumask to init once and check the init status in affinity interface. Signed-off-by: GuEe-GUI <[email protected]> --------- Signed-off-by: GuEe-GUI <[email protected]>
2024-05-21[components][driver]add isr statistics (#8955)zms123456
add isr statistics
2024-05-10remove intr disablezhao maosheng
2024-05-10add percpu interrupt infozhao maosheng
2024-02-29[components][drivers]add pic-gic (#8388)zms123456
2023-07-13【dd2.0】Support the Core API for dd2.0 (#7791)ErikChanHub
2023-07-05Drivers: Support Open Firmware API and model of PICwusongjie
We support OFW API to replace fdt old API, and add IRQ, IO, Platform-Bus, CPUs ... OFW node contorl. To support work with Device Tree or ACPI in drivers that use IRQ, we make a programmable interrupt controller driver's model. Signed-off-by: GuEe-GUI <[email protected]>