[edk2-devel] [Patch v2 05/11] MdePkg BaseIoLibIntrinsic: Remove __inline__ attribute for IO functions

Philippe Mathieu-Daudé philmd at redhat.com
Tue Oct 15 09:26:54 UTC 2019


On 10/15/19 2:26 AM, Liming Gao wrote:
> __inline__ has no functional difference effect with the GCC48 / GCC49 / GCC5
> toolchains, but it breaks the build with CLANG9. Remove __inline__.

I never understod how the compiler can optimize inlining such functions, 
and always considered this behavior buggy. Either declare a function as 
inlined in the header exposing it and define it here, or do not declare 
it as inlinable.

Reviewed-by: Philippe Mathieu-Daude <philmd at redhat.com>

> Signed-off-by: Liming Gao <liming.gao at intel.com>
> Acked-by: Laszlo Ersek <lersek at redhat.com>
> ---
>   MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c | 6 ------
>   1 file changed, 6 deletions(-)
> 
> diff --git a/MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c b/MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c
> index 055f0a947e..b3a1a20256 100644
> --- a/MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c
> +++ b/MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c
> @@ -32,7 +32,6 @@
>     @return The value read.
>   
>   **/
> -__inline__
>   UINT8
>   EFIAPI
>   IoRead8 (
> @@ -60,7 +59,6 @@ IoRead8 (
>     @return The value written the I/O port.
>   
>   **/
> -__inline__
>   UINT8
>   EFIAPI
>   IoWrite8 (
> @@ -87,7 +85,6 @@ IoWrite8 (
>     @return The value read.
>   
>   **/
> -__inline__
>   UINT16
>   EFIAPI
>   IoRead16 (
> @@ -117,7 +114,6 @@ IoRead16 (
>     @return The value written the I/O port.
>   
>   **/
> -__inline__
>   UINT16
>   EFIAPI
>   IoWrite16 (
> @@ -145,7 +141,6 @@ IoWrite16 (
>     @return The value read.
>   
>   **/
> -__inline__
>   UINT32
>   EFIAPI
>   IoRead32 (
> @@ -175,7 +170,6 @@ IoRead32 (
>     @return The value written the I/O port.
>   
>   **/
> -__inline__
>   UINT32
>   EFIAPI
>   IoWrite32 (
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48990): https://edk2.groups.io/g/devel/message/48990
Mute This Topic: https://groups.io/mt/34540587/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list