summaryrefslogtreecommitdiff
path: root/i386/i386at/acpi_parse_apic.c
AgeCommit message (Collapse)Author
2025-06-24kdb: Fix printf format warning for phys_addr_tMilos Nikic
When building without PAE support, phys_addr_t is defined as unsigned long, but the kdb printf call uses %llx, which expects an unsigned long long. This triggers a -Wformat warning due to a type mismatch. Fix this by explicitly casting the phys_addr_t value to unsigned long long, ensuring the format string and argument type always match. This avoids build warnings while preserving existing type definitions. Message-ID: <20250624013544.842-1-nikic.milos@gmail.com>
2024-12-22apic: Add extended feature registers for local apic unitDamien Zammit via Bug reports for the GNU Hurd
Add workaround for broken systems that advertise 8 bit APIC ids but only match IPIs on 4 bits of the APIC id. Message-ID: <20241222014306.430098-4-damien@zamaudio.com>
2024-12-21acpi_parse_apic: Check CAPABLE bit field on lapic MADT flagDamien Zammit via Bug reports for the GNU Hurd
Previously, we were ignoring cpus that were not enabled but online-capable. Message-ID: <20241221023937.384420-1-damien@zamaudio.com>
2024-10-22fix a compile warning.jbranso@dismail.de
* i386/i386at/acpi_parse_apci.c (acpi_print_info): %lx -> %llx i386/i386at/acpi_parse_apic.c: In function 'acpi_print_info': i386/i386at/acpi_parse_apic.c:51:25: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'phys_addr_t' {aka 'long long unsigned int'} [-Wformat=] 51 | printf(" rsdp = 0x%lx\n", rsdp); | ~~^ ~~~~ | | | | | phys_addr_t {aka long long unsigned int} | long unsigned int | %llx Message-ID: <20241022173641.2774-2-jbranso@dismail.de>
2024-02-08Add HPET timer for small accurate delaysDamien Zammit
TESTED: This works in qemu correctly TESTED: This works on an AMD board with ACPI v2.0 correctly Message-ID: <20240207050158.1640853-3-damien@zamaudio.com>
2024-02-01ACPI: Support XSDT (ACPI >= v2.0)Damien Zammit
This enables gnumach to additionally parse the XSDT table if the revision of ACPI is 2. TESTED: Still works on qemu (ACPI v1.0) TESTED: Works on a x86 board with XSDT (ACPI v2.0) Message-ID: <20240131021218.1335821-1-damien@zamaudio.com>
2024-01-29Support up to two IOAPICs with up to 32 GSIs on eachDamien Zammit
Previously, only IOAPIC[0] was supported. Now this supports up to two IOAPICs. Message-ID: <20240129100652.1262126-1-damien@zamaudio.com>
2023-08-05cpu_number: Look up cpu kernel_id via lookup tableDamien Zammit
This speeds up smp slightly by reducing the cpu_number() complexity to have no branching, just a look up table. It also addresses the problem that CPU_NUMBER was only using raw apic_id as an approximation of the kernel_id. Other improvements were to remove unnecessary checks now that the lookup table always resolves to a valid value. Message-Id: <20230805074945.1983707-1-damien@zamaudio.com>
2023-05-21x86_64: fix APIC initializationLuca Dariz
* i386/i386at/acpi_parse_apic.c: use vm_offset_t instead of uint32_t for vm addresses * x86_64/Makefrag.am: support --enable-apic Message-Id: <20230521204918.492957-1-luca@orpolo.org>
2023-01-24Fix several warnings for -Wmissing-prototypesFlavio Cruz
* device/ds_routines.c: use static qualifier. * device/subrs.c: delete unused functions. * i386/i386/ast_check.c: include prototypes in kern/ast.h * i386/i386/db_disasm.c: Include prototypes in ddb/db_examine.h * i386/i386/db_interface.h: Define prototype for kdb_kentry. Expose debug methods feep and kd_debug_put. * i386/i386/db_trace.c: delete left over cthreads support, functions are not used. * i386/i386/model_dep.h: Define prototype for c_boot_entry. * i386/i386at/acpi_parse_apic.c: Static qualifiers. * i386/i386at/autoconf.c: Include header file for prototypes and remove dead code. * i386/i386at/autoconf.h: Fix prototype. * i386/i386at/com.c: Add static qualifiers, delete dead code. * i386/i386at/com.c: ditto. * i386/i386at/com.h: Define prototypes for debug functions. * i386/i386at/int_init.c: Include header. * i386/i386at/kd.c: Include header for debug interface. Remove dead kd_cmdreg_read and make xga_getpos static. * i386/i386at/kd_mouse.c: Static qualifiers. * i386/i386at/lpr.c: Dead lprpr. * i386/i386at/model_dep.c: Remove exit function. * kern/mach_clock.c: Include mig prototypes. * kern/mach_clock.h: Remove duplicates of mig prototypes. * kern/machine.c: Use static. * kern/startup.c: slave_main is unused. * kern/thread.h: Define thread_stats that is useful for debugging. * kern/timer.c: Keep db_thread_times since it can be used for debugging. * kern/timer.h: ditto. * linux/dev/glue/misc.c: Use mig header for host_get_time. Message-Id: <Y8oyiecaflCaYhaW@mercury.tail36e24.ts.net>
2022-12-19Remove custom stdint.h and rely on freestanding headersFlavio Cruz
GCC already provides this so we don't need to have our own. Message-Id: <Y5+02FVA6jf4GPgA@mars>
2022-10-25acpi: Add lapic_addrDamien Zammit
Message-Id: <20221025105502.222708-5-damien@zamaudio.com> Co-authored-by: Almudena Garcia <liberamenso10000@gmail.com>
2021-03-28Existing SMP apic code improvementsDamien Zammit
* i386/i386/apic.c (acpi_get_irq_override): New function. (apic_get_ioapic): Make it return IoApicData* rather than IoApicData. (apic_print_info): Manage IoApicData* rather than IoApicData. * i386/i386/apic.h (struct ApicReg): Use uint32_t instead of unsigned. (struct ioapic_route_entry): New structure. (union ioapic_route_entry_union): New union. (ApicLocalUnit): Rename base to gsi_base. Add ioapic field. (APIC_IRQ_OVERRIDE_POLARITY_MASK, APIC_IRQ_OVERRIDE_TRIGGER_MASK): New macros. (acpi_get_irq_override, ): New prototype. (apic_get_ioapic): Update prototype. (lapic): New declaration. (IMCR_SELECT, IMCR_DATA, MODE_IMCR, IMCR_USE_PIC, IMCR_USE_APIC, LAPIC_ENABLE, LAPIC_NMI, LAPIC_DISABLE, LAPIC_TIMER_PERIODIC, LAPIC_TIMER_DIVIDE_2, LAPIC_TIMER_DIVIDE_4, LAPIC_TIMER_DIVIDE_8, LAPIC_TIMER_DIVIDE_16, LAPIC_TIMER_BASEDIV, NINTR, IOAPIC_FIXED, IOAPIC_PHYSICAL, IOAPIC_LOGICAL, IOAPIC_NMI, IOAPIC_EXTINT, IOAPIC_ACTIVE_HIGH, IOAPIC_ACTIVE_LOW, IOAPIC_EDGE_TRIGGERED, IOAPIC_LEVEL_TRIGGERED, IOAPIC_MASK_ENABLED, IOAPIC_MASK_DISABLED): New macros. * i386/i386at/acpi_parse_apic.h (struct acpi_apic_ioapic): Rename base field to gsi_base. * i386/i386at/acpi_parse_apic.c (acpi_apic_add_ioapic): Update to gsi_base new name. Set ioapic field. (acpi_apic_setup): Rename lapic to lapic_unit. Message-Id: <20210328060320.36194-5-damien@zamaudio.com>
2021-03-28Don't allow writing to acpi table in memoryDamien Zammit
* i386/i386at/acpi_parse_apic.c (acpi_get_apic): Map rsdt entries read-only. Message-Id: <20210328060320.36194-4-damien@zamaudio.com>
2021-03-28fixup acpi base table searchDamien Zammit
* i386/i386at/acpi_parse_apic.c (acpi_check_rsdp_align): Make it take a void* instead of uint32_t. (acpi_get_rsdp): Apply phystokv on the EBDA base and 0xE0000. (acpi_apic_setup): Drop spurious negation. Message-Id: <20210328060320.36194-3-damien@zamaudio.com>
2020-09-19acpi parser: Fix build warningsSamuel Thibault
2020-09-19smp: Add APIC finder and parserAlmudena Garcia
To find the processors, It's necessary to find the APIC (MADT) table This table is found inside ACPI tables. This set of functions find the MADT table, and parse it to find the APIC structures and register it in the kernel. *acpi_parse_apic.h: ACPI structures and function prototypes. *acpi_parse_apic.c: ACPI/APIC function definitions.