[Skiboot] [PATCH 3/6] io: Add io_complete() helper

Michael Neuling mikey at neuling.org
Thu Dec 7 14:11:42 AEDT 2017


On Wed, 2017-12-06 at 11:39 -0600, Benjamin Herrenschmidt wrote:
> This uses the standard form twi/isync pair to ensure a load
> is consumed by the core before continuing.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> ---
>  include/io.h | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/include/io.h b/include/io.h
> index 45a385ed..93a65e70 100644
> --- a/include/io.h
> +++ b/include/io.h
> @@ -170,6 +170,12 @@ static inline void out_le64(volatile uint64_t *addr,
> uint64_t val)
>  #define in_le8	in_8
>  #define out_le8	out_8
>  
> +/* Ensure completion of a load */
> +static inline void in_complete(uint64_t data)

io_complete() not in_complete().

I don't really like either name though.. 

mikey

> +{
> +	asm volatile("twi 0,%0,0;isync" : : "r" (data) : "memory");
> +}
> +
>  #endif /* __ASSEMBLY__ */
>  
>  #endif /* __IO_H */


More information about the Skiboot mailing list