diff options
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/arm32/include/bits/profile.h | 2 | ||||
-rw-r--r-- | src/arch/arm64/include/bits/profile.h | 2 | ||||
-rw-r--r-- | src/arch/i386/include/bits/profile.h | 6 | ||||
-rw-r--r-- | src/arch/loong64/include/bits/profile.h | 2 | ||||
-rw-r--r-- | src/arch/riscv/include/bits/profile.h (renamed from src/arch/riscv64/include/bits/profile.h) | 4 | ||||
-rw-r--r-- | src/arch/riscv32/include/bits/profile.h | 36 | ||||
-rw-r--r-- | src/arch/x86_64/include/bits/profile.h | 2 |
7 files changed, 9 insertions, 45 deletions
diff --git a/src/arch/arm32/include/bits/profile.h b/src/arch/arm32/include/bits/profile.h index 2b15d1604..4e4bf48a3 100644 --- a/src/arch/arm32/include/bits/profile.h +++ b/src/arch/arm32/include/bits/profile.h @@ -16,7 +16,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); * * @ret timestamp Timestamp */ -static inline __attribute__ (( always_inline )) uint64_t +static inline __attribute__ (( always_inline )) unsigned long profile_timestamp ( void ) { uint32_t cycles; diff --git a/src/arch/arm64/include/bits/profile.h b/src/arch/arm64/include/bits/profile.h index 62ffa3772..4a5b3f7a1 100644 --- a/src/arch/arm64/include/bits/profile.h +++ b/src/arch/arm64/include/bits/profile.h @@ -16,7 +16,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); * * @ret timestamp Timestamp */ -static inline __attribute__ (( always_inline )) uint64_t +static inline __attribute__ (( always_inline )) unsigned long profile_timestamp ( void ) { uint64_t cycles; diff --git a/src/arch/i386/include/bits/profile.h b/src/arch/i386/include/bits/profile.h index e184d7b51..21c216a81 100644 --- a/src/arch/i386/include/bits/profile.h +++ b/src/arch/i386/include/bits/profile.h @@ -16,12 +16,12 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); * * @ret timestamp Timestamp */ -static inline __attribute__ (( always_inline )) uint64_t +static inline __attribute__ (( always_inline )) unsigned long profile_timestamp ( void ) { - uint64_t tsc; + uint32_t tsc; /* Read timestamp counter */ - __asm__ __volatile__ ( "rdtsc" : "=A" ( tsc ) ); + __asm__ __volatile__ ( "rdtsc" : "=a" ( tsc ) : : "edx" ); return tsc; } diff --git a/src/arch/loong64/include/bits/profile.h b/src/arch/loong64/include/bits/profile.h index 9f597ce2d..02f8d4b7c 100644 --- a/src/arch/loong64/include/bits/profile.h +++ b/src/arch/loong64/include/bits/profile.h @@ -16,7 +16,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); * * @ret timestamp Timestamp */ -static inline __attribute__ (( always_inline )) uint64_t +static inline __attribute__ (( always_inline )) unsigned long profile_timestamp ( void ) { uint64_t cycles; diff --git a/src/arch/riscv64/include/bits/profile.h b/src/arch/riscv/include/bits/profile.h index 2c8e29a22..e9e003dab 100644 --- a/src/arch/riscv64/include/bits/profile.h +++ b/src/arch/riscv/include/bits/profile.h @@ -16,9 +16,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); * * @ret timestamp Timestamp */ -static inline __attribute__ (( always_inline )) uint64_t +static inline __attribute__ (( always_inline )) unsigned long profile_timestamp ( void ) { - uint64_t cycles; + unsigned long cycles; /* Read timestamp counter */ __asm__ __volatile__ ( "rdcycle %0" : "=r" ( cycles ) ); diff --git a/src/arch/riscv32/include/bits/profile.h b/src/arch/riscv32/include/bits/profile.h deleted file mode 100644 index cb969077d..000000000 --- a/src/arch/riscv32/include/bits/profile.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _BITS_PROFILE_H -#define _BITS_PROFILE_H - -/** @file - * - * Profiling - * - */ - -FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); - -#include <stdint.h> - -/** - * Get profiling timestamp - * - * @ret timestamp Timestamp - */ -static inline __attribute__ (( always_inline )) uint64_t -profile_timestamp ( void ) { - uint32_t cycles_lo; - uint32_t cycles_hi; - uint32_t tmp; - - /* Read timestamp counter */ - __asm__ __volatile__ ( "\n1:\n\t" - "rdcycleh %1\n\t" - "rdcycle %0\n\t" - "rdcycleh %2\n\t" - "bne %1, %2, 1b\n\t" - : "=r" ( cycles_lo ), "=r" ( cycles_hi ), - "=r" ( tmp ) ); - return ( ( ( ( uint64_t ) cycles_hi ) << 32 ) | cycles_lo ); -} - -#endif /* _BITS_PROFILE_H */ diff --git a/src/arch/x86_64/include/bits/profile.h b/src/arch/x86_64/include/bits/profile.h index b7c74fbe7..c85b6fe5c 100644 --- a/src/arch/x86_64/include/bits/profile.h +++ b/src/arch/x86_64/include/bits/profile.h @@ -16,7 +16,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); * * @ret timestamp Timestamp */ -static inline __attribute__ (( always_inline )) uint64_t +static inline __attribute__ (( always_inline )) unsigned long profile_timestamp ( void ) { uint32_t eax; uint32_t edx; |