diff options
Diffstat (limited to 'vppinfra')
-rw-r--r-- | vppinfra/vppinfra/byte_order.h | 2 | ||||
-rw-r--r-- | vppinfra/vppinfra/cache.h | 2 | ||||
-rw-r--r-- | vppinfra/vppinfra/hash.c | 4 | ||||
-rw-r--r-- | vppinfra/vppinfra/hash.h | 2 | ||||
-rw-r--r-- | vppinfra/vppinfra/longjmp.S | 4 | ||||
-rw-r--r-- | vppinfra/vppinfra/macros.c | 2 | ||||
-rw-r--r-- | vppinfra/vppinfra/random_isaac.c | 2 | ||||
-rw-r--r-- | vppinfra/vppinfra/test_vec.c | 4 | ||||
-rw-r--r-- | vppinfra/vppinfra/time.h | 10 | ||||
-rw-r--r-- | vppinfra/vppinfra/vector.h | 2 |
10 files changed, 20 insertions, 14 deletions
diff --git a/vppinfra/vppinfra/byte_order.h b/vppinfra/vppinfra/byte_order.h index 4f385f152df..b2c26e5fdee 100644 --- a/vppinfra/vppinfra/byte_order.h +++ b/vppinfra/vppinfra/byte_order.h @@ -40,7 +40,7 @@ #include <vppinfra/clib.h> -#if defined(__x86_64__) || defined(i386) || defined(__aarch64__) +#if (__BYTE_ORDER__)==( __ORDER_LITTLE_ENDIAN__) #define CLIB_ARCH_IS_BIG_ENDIAN (0) #define CLIB_ARCH_IS_LITTLE_ENDIAN (1) #else diff --git a/vppinfra/vppinfra/cache.h b/vppinfra/vppinfra/cache.h index fea111698a2..92e1e8cf777 100644 --- a/vppinfra/vppinfra/cache.h +++ b/vppinfra/vppinfra/cache.h @@ -45,7 +45,7 @@ */ #ifndef CLIB_LOG2_CACHE_LINE_BYTES -#ifdef __x86_64__ +#if defined(__x86_64__) || defined(__ARM_ARCH_7A__) #define CLIB_LOG2_CACHE_LINE_BYTES 6 #endif diff --git a/vppinfra/vppinfra/hash.c b/vppinfra/vppinfra/hash.c index 9e038b4fd8c..adadf010a0c 100644 --- a/vppinfra/vppinfra/hash.c +++ b/vppinfra/vppinfra/hash.c @@ -88,7 +88,7 @@ static inline u64 zap64 (u64 x, word n) return x & masks_little_endian[n]; } -u64 hash_memory64 (void * p, word n_bytes, u64 state) +static inline u64 hash_memory64 (void * p, word n_bytes, u64 state) { u64 * q = p; u64 a, b, c, n; @@ -155,7 +155,7 @@ static inline u32 zap32 (u32 x, word n) return x & masks_little_endian[n]; } -u32 hash_memory32 (void * p, word n_bytes, u32 state) +static inline u32 hash_memory32 (void * p, word n_bytes, u32 state) { u32 * q = p; u32 a, b, c, n; diff --git a/vppinfra/vppinfra/hash.h b/vppinfra/vppinfra/hash.h index 3c4daada48b..978230b6ca0 100644 --- a/vppinfra/vppinfra/hash.h +++ b/vppinfra/vppinfra/hash.h @@ -586,8 +586,6 @@ do { \ hash_v3_finalize_step_2_u32x(a,b,c); \ } while (0) -extern u64 hash_memory64 (void * p, word n_bytes, u64 state); -extern u32 hash_memory32 (void * p, word n_bytes, u32 state); extern uword hash_memory (void * p, word n_bytes, uword state); extern uword mem_key_sum (hash_t * h, uword key); diff --git a/vppinfra/vppinfra/longjmp.S b/vppinfra/vppinfra/longjmp.S index 9ba237d4489..d4dd4c7d916 100644 --- a/vppinfra/vppinfra/longjmp.S +++ b/vppinfra/vppinfra/longjmp.S @@ -478,7 +478,7 @@ clib_setjmp: #endif /* Give back user's return value. */ - mov r1, r0 + mov r0, r1 bx lr .global clib_longjmp @@ -501,7 +501,7 @@ clib_longjmp: #endif /* Give back user's return value. */ - mov r1, r0 + mov r0, r1 bx lr .global clib_calljmp diff --git a/vppinfra/vppinfra/macros.c b/vppinfra/vppinfra/macros.c index 4107464e99e..f16948ef0e4 100644 --- a/vppinfra/vppinfra/macros.c +++ b/vppinfra/vppinfra/macros.c @@ -214,7 +214,7 @@ void clib_macro_init(macro_main_t * mm) { if (mm->the_builtin_eval_hash != 0) { - clib_warning ("mm %llx already initialized", (u64)mm); + clib_warning ("mm %p already initialized", mm); return; } diff --git a/vppinfra/vppinfra/random_isaac.c b/vppinfra/vppinfra/random_isaac.c index e9287402e52..ad2c165da46 100644 --- a/vppinfra/vppinfra/random_isaac.c +++ b/vppinfra/vppinfra/random_isaac.c @@ -110,7 +110,7 @@ void isaac2 (isaac_t * ctx, uword * results) u32 a##n, b##n, c##n, x##n, y##n, * m##n, * mm##n, * m2##n, * r##n, * mend##n _ (0); _ (1); - + (void)mend1; /* "set but unused variable" error on mend1 with gcc 4.9 */ #undef _ #define _(n) \ diff --git a/vppinfra/vppinfra/test_vec.c b/vppinfra/vppinfra/test_vec.c index 12c0603ec8d..80832bf52fd 100644 --- a/vppinfra/vppinfra/test_vec.c +++ b/vppinfra/vppinfra/test_vec.c @@ -1050,7 +1050,7 @@ int test_vec_main (unformat_input_t * input) u8 * bigboy = 0; u64 one_gig = (1<<30); u64 size; - i64 index; + u64 index; fformat (stdout, "giant vector test..."); size = 5ULL * one_gig; @@ -1090,7 +1090,7 @@ int main (int argc, char * argv[]) unformat_input_t i; int ret; - mheap_alloc (0, 10ULL<<30); + mheap_alloc (0, (uword)10ULL<<30); verbose = (argc > 1); unformat_init_command_line (&i, argv); diff --git a/vppinfra/vppinfra/time.h b/vppinfra/vppinfra/time.h index 3c481082ced..29398f3baea 100644 --- a/vppinfra/vppinfra/time.h +++ b/vppinfra/vppinfra/time.h @@ -113,7 +113,14 @@ always_inline u64 clib_cpu_time_now (void) } #elif defined (__arm__) - +#if defined(__ARM_ARCH_7A__) +always_inline u64 clib_cpu_time_now (void) +{ + u64 tsc; + asm volatile("mrrc p15, 0, %Q0, %R0, c9" : "=r" (tsc)); + return tsc; +} +#else always_inline u64 clib_cpu_time_now (void) { u32 lo; @@ -121,6 +128,7 @@ always_inline u64 clib_cpu_time_now (void) : [lo] "=r" (lo)); return (u64) lo; } +#endif #elif defined (__xtensa__) diff --git a/vppinfra/vppinfra/vector.h b/vppinfra/vppinfra/vector.h index 84c52a2836d..a6f4111e88c 100644 --- a/vppinfra/vppinfra/vector.h +++ b/vppinfra/vppinfra/vector.h @@ -61,7 +61,7 @@ #define _vector_size(n) __attribute__ ((vector_size (n))) -#if defined (__aarch64__) +#if defined (__aarch64__) || defined (__arm__) typedef unsigned int u32x4 _vector_size (16); #endif |