[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/5 gnumach] i386/apic: Fix logical id numbering
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 1/5 gnumach] i386/apic: Fix logical id numbering |
Date: |
Tue, 10 Dec 2024 19:07:27 +0100 |
Applied, thanks!
Damien Zammit via Bug reports for the GNU Hurd, le mar. 10 déc. 2024 07:29:43
+0000, a ecrit:
> The number is actually a mask bit per cpu.
> ---
> i386/i386/apic.c | 2 +-
> i386/i386/apic.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/i386/i386/apic.c b/i386/i386/apic.c
> index 7ec8c49b..e0941c6a 100644
> --- a/i386/i386/apic.c
> +++ b/i386/i386/apic.c
> @@ -337,7 +337,7 @@ lapic_setup(void)
>
> /* Every 8th cpu is in the same logical group */
> dummy = lapic->logical_dest.r;
> - lapic->logical_dest.r = 0x01000000 << (APIC_LOGICAL_ID(cpu));
> + lapic->logical_dest.r = APIC_LOGICAL_ID(cpu) << 24;
>
> dummy = lapic->lvt_lint0.r;
> lapic->lvt_lint0.r = dummy | LAPIC_DISABLE;
> diff --git a/i386/i386/apic.h b/i386/i386/apic.h
> index ec910456..cb700c44 100644
> --- a/i386/i386/apic.h
> +++ b/i386/i386/apic.h
> @@ -314,7 +314,7 @@ extern uint32_t *hpet_addr;
>
> /* Since Logical Destination Register only has 8 bits of mask,
> * we can only address 8 unique groups of cpus for IPIs. */
> -#define APIC_LOGICAL_ID(cpu) ((cpu) % 8)
> +#define APIC_LOGICAL_ID(cpu) (1u << ((cpu) % 8))
>
> /* Set or clear a bit in a 255-bit APIC mask register.
> These registers are spread through eight 32-bit registers. */
> --
> 2.45.2
>
>
>
--
Samuel
<i8b4uUnderground> d-_-b
<BonyNoMore> how u make that inverted b?
<BonyNoMore> wait
<BonyNoMore> never mind
- [PATCH 0/5 gnumach] smp: Parallel SMP init, Damien Zammit, 2024/12/10
- [PATCH 1/5 gnumach] i386/apic: Fix logical id numbering, Damien Zammit, 2024/12/10
- Re: [PATCH 1/5 gnumach] i386/apic: Fix logical id numbering,
Samuel Thibault <=
- [PATCH 2/5 gnumach] smp: Remove early GS access, Damien Zammit, 2024/12/10
- [PATCH 3/5 gnumach] smp: Delay setting spl_init flag until after smp bringup, Damien Zammit, 2024/12/10
- [PATCH 4/5 gnumach] smp: Make sure BSP is cpu 0 when starting other cpus, Damien Zammit, 2024/12/10
- [PATCH 5/5 gnumach] smp: Parallel SMP init, Damien Zammit, 2024/12/10