bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2 gnumach] Fix missing cpu_pause symbol


From: Samuel Thibault
Subject: Re: [PATCH 1/2 gnumach] Fix missing cpu_pause symbol
Date: Wed, 15 Feb 2023 11:00:57 +0100
User-agent: NeoMutt/20170609 (1.8.3)

Damien Zammit, le mer. 15 févr. 2023 09:57:30 +0000, a ecrit:
> ---
>  i386/i386/smp.c | 5 +++++
>  i386/i386/smp.h | 3 +--
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/i386/i386/smp.c b/i386/i386/smp.c
> index c0149a3b..f493bdc0 100644
> --- a/i386/i386/smp.c
> +++ b/i386/i386/smp.c
> @@ -45,6 +45,11 @@ static void smp_data_init(void)
> 
>  }
> 
> +inline void cpu_pause(void)
> +{
> +    asm volatile ("pause" : : : "memory");
> +}

No, for a single instruction, better keep inline. No need for paying a function 
call cost.

>  void smp_pmap_update(unsigned apic_id)
>  {
>      unsigned long flags;
> diff --git a/i386/i386/smp.h b/i386/i386/smp.h
> index 1faa39cd..3b5ad144 100644
> --- a/i386/i386/smp.h
> +++ b/i386/i386/smp.h
> @@ -24,7 +24,6 @@
>  int smp_init(void);
>  void smp_pmap_update(unsigned apic_id);
>  void smp_startup_cpu(unsigned apic_id, unsigned vector);
> -
> -#define cpu_pause() asm volatile ("pause" : : : "memory")
> +inline void cpu_pause(void);
> 
>  #endif
> --
> 2.34.1
> 
> 
> 

-- 
Samuel
---
Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'Inria.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]