RTEMS | bsps/i386: Refactor LAPIC code into shared apic.c module (!1121)

Mohammed Anees (@DonutAnees) gitlab at rtems.org
Wed Mar 11 19:57:59 UTC 2026



Mohammed Anees created a merge request: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1121

Project:Branches: DonutAnees/rtems:feat/i386-apic to rtems/rtos/rtems:main
Author:   Mohammed Anees



## Summary

bsps/i386: Refactor LAPIC code into shared apic.c module

Move Local APIC initialization, IPI, and utility functions out of smp-imps.c into a file bsps/i386/shared/irq/apic.c for lapic driver. This decouples the LAPIC driver from the MPS table parsing code.

- Add apic.c with lapic_initialize(), lapic_enable(), lapic_send_ipi(), lapic_clear_errors(), lapic_reset_and_start_ap(), and lapic_reset_ap()
- Extend apic.h with LAPIC register offset macros, inline helpers lapic_get_id() and lapic_send_eoi(), and function declarations
- Replace IMPS_LAPIC_READ/WRITE macros with direct register access through the i386_lapic_base pointer
- Replace imps_cpu_apic_map/imps_apic_cpu_map with i386_cpu_to_lapic_map/i386_lapic_to_cpu_map
- Remove send_ipi(), imps_lapic_addr, and related globals from smp-imps.c and smp-imps.h
- Update bspsmp.c and asm.h to use the new LAPIC API

Closes #5518

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1121
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260311/dd1924ed/attachment.htm>


More information about the bugs mailing list