diff options
author | Aaron Durbin <adurbin@chromium.org> | 2018-09-13 02:10:45 -0600 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2018-09-14 08:16:37 +0000 |
commit | 75a62e76486f63f6dadb5492c205570ace81e9d5 (patch) | |
tree | c3338d2ddd7b2f9f51f35432a24087fc289999fb /src/include/cpu/x86/cr.h | |
parent | cf9ea55473cde8b9a2b9494eca452df7783376e5 (diff) |
complier.h: add __always_inline and use it in code base
Add a __always_inline macro that wraps __attribute__((always_inline))
and replace current users with the macro, excluding files under
src/vendorcode.
Change-Id: Ic57e474c1d2ca7cc0405ac677869f78a28d3e529
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/28587
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@google.com>
Diffstat (limited to 'src/include/cpu/x86/cr.h')
-rw-r--r-- | src/include/cpu/x86/cr.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/include/cpu/x86/cr.h b/src/include/cpu/x86/cr.h index 5183c77f89..229a67d422 100644 --- a/src/include/cpu/x86/cr.h +++ b/src/include/cpu/x86/cr.h @@ -18,6 +18,7 @@ #if !defined(__ASSEMBLER__) +#include <compiler.h> #include <stdint.h> #include <arch/cpu.h> @@ -37,7 +38,7 @@ #define CRx_IN "r" #define CRx_RET "=r" #endif -static alwaysinline CRx_TYPE read_cr0(void) +static __always_inline CRx_TYPE read_cr0(void) { CRx_TYPE value; __asm__ __volatile__ ( @@ -49,7 +50,7 @@ static alwaysinline CRx_TYPE read_cr0(void) return value; } -static alwaysinline void write_cr0(CRx_TYPE data) +static __always_inline void write_cr0(CRx_TYPE data) { __asm__ __volatile__ ( "mov %0, %%cr0" @@ -59,7 +60,7 @@ static alwaysinline void write_cr0(CRx_TYPE data) ); } -static alwaysinline CRx_TYPE read_cr2(void) +static __always_inline CRx_TYPE read_cr2(void) { CRx_TYPE value; __asm__ __volatile__ ( @@ -71,7 +72,7 @@ static alwaysinline CRx_TYPE read_cr2(void) return value; } -static alwaysinline CRx_TYPE read_cr3(void) +static __always_inline CRx_TYPE read_cr3(void) { CRx_TYPE value; __asm__ __volatile__ ( @@ -83,7 +84,7 @@ static alwaysinline CRx_TYPE read_cr3(void) return value; } -static alwaysinline void write_cr3(CRx_TYPE data) +static __always_inline void write_cr3(CRx_TYPE data) { __asm__ __volatile__ ( "mov %0, %%cr3" @@ -92,7 +93,7 @@ static alwaysinline void write_cr3(CRx_TYPE data) : COMPILER_BARRIER ); } -static alwaysinline CRx_TYPE read_cr4(void) +static __always_inline CRx_TYPE read_cr4(void) { CRx_TYPE value; __asm__ __volatile__ ( @@ -104,7 +105,7 @@ static alwaysinline CRx_TYPE read_cr4(void) return value; } -static alwaysinline void write_cr4(CRx_TYPE data) +static __always_inline void write_cr4(CRx_TYPE data) { __asm__ __volatile__ ( "mov %0, %%cr4" |