[coreboot] [PATCH] libpayload - add block io functions

Peter Stuge peter at stuge.se
Fri Aug 8 22:17:17 CEST 2008


On Fri, Aug 08, 2008 at 05:15:32PM +0200, Stefan Reinauer wrote:
> add block io functions
> 
> Signed-off-by: Stefan Reinauer <stepan at coresystems.de>

Acked-by: Peter Stuge <peter at stuge.se>


> Index: include/arch/io.h
> ===================================================================
> --- include/arch/io.h	(revision 3488)
> +++ include/arch/io.h	(working copy)
> @@ -2,6 +2,7 @@
>   * This file is part of the libpayload project.
>   *
>   * Copyright (C) 2008 Advanced Micro Devices, Inc.
> + * Copyright (C) 2008 coresystems GmbH
>   *
>   * Redistribution and use in source and binary forms, with or without
>   * modification, are permitted provided that the following conditions
> @@ -74,4 +75,34 @@
>  	__asm__ __volatile__("outb %b0, %w1" : : "a"(val), "Nd"(port));
>  }
>  
> +static inline void outsl(int port, const void *addr, unsigned long count)
> +{
> +	__asm__ __volatile__("rep; outsl" : "+S"(addr), "+c"(count) : "d"(port));
> +}
> +
> +static inline void outsw(int port, const void *addr, unsigned long count)
> +{
> +	__asm__ __volatile__("rep; outsw" : "+S"(addr), "+c"(count) : "d"(port));
> +}
> +
> +static inline void outsb(int port, const void *addr, unsigned long count)
> +{
> +	__asm__ __volatile__("rep; outsb" : "+S"(addr), "+c"(count) : "d"(port));
> +}
> +
> +static inline void insl(int port, void *addr, unsigned long count)
> +{
> +	__asm__ __volatile__("rep; insl" : "+D"(addr), "+c"(count) : "d"(port));
> +}
> +
> +static inline void insw(int port, void *addr, unsigned long count)
> +{
> +	__asm__ __volatile__("rep; insw" : "+D"(addr), "+c"(count) : "d"(port));
> +}
> +
> +static inline void insb(int port, void *addr, unsigned long count)
> +{
> +	__asm__ __volatile__("rep; insb" : "+D"(addr), "+c"(count) : "d"(port));
> +}
> +
>  #endif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20080808/8963aef8/attachment.sig>


More information about the coreboot mailing list