Type: fix
Change-Id: If59a66aae658dd35dbcb4987ab00c306b3c6e2e2
Signed-off-by: Damjan Marion <damarion@cisco.com>
17 files changed:
#define BIIHASH_MIN_ALLOC_LOG2_PAGES 10
#endif
#define BIIHASH_MIN_ALLOC_LOG2_PAGES 10
#endif
+#ifndef BIHASH_USE_HEAP
+#define BIHASH_USE_HEAP 1
+#endif
+
static inline void *BV (alloc_aligned) (BVT (clib_bihash) * h, uword nbytes)
{
uword rv;
static inline void *BV (alloc_aligned) (BVT (clib_bihash) * h, uword nbytes)
{
uword rv;
return p ? vec_elt_at_index (em->sections, p[0]) : 0;
}
return p ? vec_elt_at_index (em->sections, p[0]) : 0;
}
-clib_error_t *
-elf_get_section_by_start_address (elf_main_t * em, uword start_address,
- elf_section_t ** result)
+__clib_export clib_error_t *
+elf_get_section_by_start_address (elf_main_t *em, uword start_address,
+ elf_section_t **result)
{
elf_section_t *s =
elf_get_section_by_start_address_no_check (em, start_address);
{
elf_section_t *s =
elf_get_section_by_start_address_no_check (em, start_address);
(i64) s2->header.virtual_address);
}
(i64) s2->header.virtual_address);
}
-u8 *
-format_elf_main (u8 * s, va_list * args)
+__clib_export u8 *
+format_elf_main (u8 *s, va_list *args)
{
elf_main_t *em = va_arg (*args, elf_main_t *);
u32 verbose = va_arg (*args, u32);
{
elf_main_t *em = va_arg (*args, elf_main_t *);
u32 verbose = va_arg (*args, u32);
-void
-elf_set_dynamic_entries (elf_main_t * em)
+__clib_export void
+elf_set_dynamic_entries (elf_main_t *em)
-clib_error_t *
-elf_write_file (elf_main_t * em, char *file_name)
+__clib_export clib_error_t *
+elf_write_file (elf_main_t *em, char *file_name)
-u8 *
-format_elog_track_name (u8 * s, va_list * va)
+__clib_export u8 *
+format_elog_track_name (u8 *s, va_list *va)
{
elog_main_t *em = va_arg (*va, elog_main_t *);
elog_event_t *e = va_arg (*va, elog_event_t *);
{
elog_main_t *em = va_arg (*va, elog_main_t *);
elog_event_t *e = va_arg (*va, elog_event_t *);
/*
* merge two event logs. Complicated and cranky.
*/
/*
* merge two event logs. Complicated and cranky.
*/
-void
-elog_merge (elog_main_t * dst, u8 * dst_tag, elog_main_t * src, u8 * src_tag,
+__clib_export void
+elog_merge (elog_main_t *dst, u8 *dst_tag, elog_main_t *src, u8 *src_tag,
f64 align_tweak)
{
elog_event_t *e;
f64 align_tweak)
{
elog_event_t *e;
vec_foreach (e, em->events) serialize (m, serialize_elog_event, em, e);
}
vec_foreach (e, em->events) serialize (m, serialize_elog_event, em, e);
}
-void
-unserialize_elog_main (serialize_main_t * m, va_list * va)
+__clib_export void
+unserialize_elog_main (serialize_main_t *m, va_list *va)
{
elog_main_t *em = va_arg (*va, elog_main_t *);
uword i;
{
elog_main_t *em = va_arg (*va, elog_main_t *);
uword i;
return lookup (v, key, GET, 0, 0);
}
return lookup (v, key, GET, 0, 0);
}
-hash_pair_t *
-hash_next (void *v, hash_next_t * hn)
+__clib_export hash_pair_t *
+hash_next (void *v, hash_next_t *hn)
{
hash_t *h = hash_header (v);
hash_pair_t *p;
{
hash_t *h = hash_header (v);
hash_pair_t *p;
-u8 *
-format_hash (u8 * s, va_list * va)
+__clib_export u8 *
+format_hash (u8 *s, va_list *va)
{
void *v = va_arg (*va, void *);
int verbose = va_arg (*va, int);
{
void *v = va_arg (*va, void *);
int verbose = va_arg (*va, int);
return unformat_hash_string_internal (input, va, /* is_vec */ 0);
}
return unformat_hash_string_internal (input, va, /* is_vec */ 0);
}
+__clib_export clib_error_t *
hash_validate (void *v)
{
hash_t *h = hash_header (v);
hash_validate (void *v)
{
hash_t *h = hash_header (v);
set_free_elt (v, elt_at (h, g.index), g.bin_index);
}
set_free_elt (v, elt_at (h, g.index), g.bin_index);
}
heap_len (void *v, word handle)
{
heap_header_t *h = heap_header (v);
heap_len (void *v, word handle)
{
heap_header_t *h = heap_header (v);
-u8 *
-format_heap (u8 * s, va_list * va)
+__clib_export u8 *
+format_heap (u8 *s, va_list *va)
{
void *v = va_arg (*va, void *);
uword verbose = va_arg (*va, uword);
{
void *v = va_arg (*va, void *);
uword verbose = va_arg (*va, uword);
heap_validate (void *v)
{
heap_header_t *h = heap_header (v);
heap_validate (void *v)
{
heap_header_t *h = heap_header (v);
* eval: takes a string, returns a vector.
* looks up $foobar in the variable table.
*/
* eval: takes a string, returns a vector.
* looks up $foobar in the variable table.
*/
-i8 *
-clib_macro_eval_dollar (clib_macro_main_t * mm, i8 * s, i32 complain)
+__clib_export i8 *
+clib_macro_eval_dollar (clib_macro_main_t *mm, i8 *s, i32 complain)
* @param[in/out] a init args structure
* @return 0 => success, <0 => failure
*/
* @param[in/out] a init args structure
* @return 0 => success, <0 => failure
*/
-int
-clib_maplog_init (clib_maplog_init_args_t * a)
+__clib_export int
+clib_maplog_init (clib_maplog_init_args_t *a)
{
int i, fd, limit;
int rv = 0;
{
int i, fd, limit;
int rv = 0;
/* slow path: unmap a full log segment, and replace it */
/* slow path: unmap a full log segment, and replace it */
-u8 *
-_clib_maplog_get_entry_slowpath (clib_maplog_main_t * mm, u64 my_record_index)
+__clib_export u8 *
+_clib_maplog_get_entry_slowpath (clib_maplog_main_t *mm, u64 my_record_index)
*
* @param[in/out] mm mapped log object
*/
*
* @param[in/out] mm mapped log object
*/
-void
-clib_maplog_close (clib_maplog_main_t * mm)
+__clib_export void
+clib_maplog_close (clib_maplog_main_t *mm)
{
int i, limit;
u64 file_size_in_bytes;
{
int i, limit;
u64 file_size_in_bytes;
* @param [in] h clib_maplog_header_t pointer
* @param [in] verbose self-explanatory
*/
* @param [in] h clib_maplog_header_t pointer
* @param [in] verbose self-explanatory
*/
-u8 *
-format_maplog_header (u8 * s, va_list * args)
+__clib_export u8 *
+format_maplog_header (u8 *s, va_list *args)
{
clib_maplog_header_t *h = va_arg (*args, clib_maplog_header_t *);
int verbose = va_arg (*args, int);
{
clib_maplog_header_t *h = va_arg (*args, clib_maplog_header_t *);
int verbose = va_arg (*args, int);
* @param [in] file_basename Same basename supplied to clib_maplog_init
* @param [in] fp_arg Callback function pointer
*/
* @param [in] file_basename Same basename supplied to clib_maplog_init
* @param [in] fp_arg Callback function pointer
*/
clib_maplog_process (char *file_basename, void *fp_arg)
{
clib_maplog_header_t _h, *h = &_h;
clib_maplog_process (char *file_basename, void *fp_arg)
{
clib_maplog_header_t _h, *h = &_h;
clib_mem_vm_unmap (base);
}
clib_mem_vm_unmap (base);
}
-u8 *
-format_clib_mem_usage (u8 * s, va_list * va)
+__clib_export u8 *
+format_clib_mem_usage (u8 *s, va_list *va)
{
int verbose = va_arg (*va, int);
return format (s, "$$$$ heap at %llx verbose %d", clib_mem_get_heap (),
{
int verbose = va_arg (*va, int);
return format (s, "$$$$ heap at %llx verbose %d", clib_mem_get_heap (),
CLIB_PMALLOC_NUMA_LOCAL);
}
CLIB_PMALLOC_NUMA_LOCAL);
}
-void *
-clib_pmalloc_alloc_from_arena (clib_pmalloc_main_t * pm, void *arena_va,
+__clib_export void *
+clib_pmalloc_alloc_from_arena (clib_pmalloc_main_t *pm, void *arena_va,
uword size, uword align)
{
clib_pmalloc_arena_t *a = clib_pmalloc_get_arena (pm, arena_va);
uword size, uword align)
{
clib_pmalloc_arena_t *a = clib_pmalloc_get_arena (pm, arena_va);
* @return d - Pearson's X2 test statistic
*/
* @return d - Pearson's X2 test statistic
*/
-f64
-clib_chisquare (u64 * values)
+__clib_export f64
+clib_chisquare (u64 *values)
{
u32 i, len;
f64 d, delta_d, actual_frequency, expected_frequency;
{
u32 i, len;
f64 d, delta_d, actual_frequency, expected_frequency;
*(r++) = b = ind32(mm,y>>ISAAC_LOG2_SIZE) + x; \
}
*(r++) = b = ind32(mm,y>>ISAAC_LOG2_SIZE) + x; \
}
-void
-isaac (isaac_t * ctx, uword * results)
+__clib_export void
+isaac (isaac_t *ctx, uword *results)
{
u32 a, b, c, x, y, *m, *mm, *m2, *r, *mend;
{
u32 a, b, c, x, y, *m, *mm, *m2, *r, *mend;
-void
-isaac_init (isaac_t * ctx, uword * seeds)
+__clib_export void
+isaac_init (isaac_t *ctx, uword *seeds)
{
word i;
u32 a, b, c, d, e, f, g, h, *m, *r;
{
word i;
u32 a, b, c, d, e, f, g, h, *m, *r;
*(r++) = b = ind64(mm,y>>ISAAC_LOG2_SIZE) + x; \
}
*(r++) = b = ind64(mm,y>>ISAAC_LOG2_SIZE) + x; \
}
-void
-isaac (isaac_t * ctx, uword * results)
+__clib_export void
+isaac (isaac_t *ctx, uword *results)
{
u64 a, b, c, x, y, *m, *mm, *m2, *r, *mend;
{
u64 a, b, c, x, y, *m, *mm, *m2, *r, *mend;
h-=d; e^=g<<14; g+=h; \
}
h-=d; e^=g<<14; g+=h; \
}
-void
-isaac_init (isaac_t * ctx, uword * seeds)
+__clib_export void
+isaac_init (isaac_t *ctx, uword *seeds)
{
word i;
u64 a, b, c, d, e, f, g, h, *m, *r;
{
word i;
u64 a, b, c, d, e, f, g, h, *m, *r;
-void
-serialize_multiple_1 (serialize_main_t * m,
- void *data, uword data_stride, uword n_data)
+__clib_export void
+serialize_multiple_1 (serialize_main_t *m, void *data, uword data_stride,
+ uword n_data)
-void
-serialize_multiple_2 (serialize_main_t * m,
- void *data, uword data_stride, uword n_data)
+__clib_export void
+serialize_multiple_2 (serialize_main_t *m, void *data, uword data_stride,
+ uword n_data)
{
void *d = data;
u16 *p;
{
void *d = data;
u16 *p;
-void
-serialize_multiple_4 (serialize_main_t * m,
- void *data, uword data_stride, uword n_data)
+__clib_export void
+serialize_multiple_4 (serialize_main_t *m, void *data, uword data_stride,
+ uword n_data)
{
void *d = data;
u32 *p;
{
void *d = data;
u32 *p;
-void
-unserialize_multiple_1 (serialize_main_t * m,
- void *data, uword data_stride, uword n_data)
+__clib_export void
+unserialize_multiple_1 (serialize_main_t *m, void *data, uword data_stride,
+ uword n_data)
-void
-unserialize_multiple_2 (serialize_main_t * m,
- void *data, uword data_stride, uword n_data)
+__clib_export void
+unserialize_multiple_2 (serialize_main_t *m, void *data, uword data_stride,
+ uword n_data)
{
void *d = data;
u16 *p;
{
void *d = data;
u16 *p;
-void
-unserialize_multiple_4 (serialize_main_t * m,
- void *data, uword data_stride, uword n_data)
+__clib_export void
+unserialize_multiple_4 (serialize_main_t *m, void *data, uword data_stride,
+ uword n_data)
{
void *d = data;
u32 *p;
{
void *d = data;
u32 *p;
- clib_mem_validate ();
-
if ((error = hash_validate (h)))
goto done;
if ((error = hash_validate (h)))
goto done;
|| (i + 1) % ht->n_iterations_per_validate)
continue;
|| (i + 1) % ht->n_iterations_per_validate)
continue;
- clib_mem_validate ();
-
if ((error = hash_validate (h)))
goto done;
if ((error = hash_validate (h)))
goto done;
|| (i + 1) % ht->n_iterations_per_validate)
continue;
|| (i + 1) % ht->n_iterations_per_validate)
continue;
- clib_mem_validate ();
-
if ((error = hash_validate (h)))
goto done;
if ((error = hash_validate (h)))
goto done;
|| (i + 1) % ht->n_iterations_per_validate)
continue;
|| (i + 1) % ht->n_iterations_per_validate)
continue;
- clib_mem_validate ();
-
if ((error = hash_validate (h)))
goto done;
if ((error = hash_validate (h)))
goto done;
clib_macro_main_t clib_macro_main;
clib_macro_main_t clib_macro_main;
-int
-test_macros_main (unformat_input_t * input)
+__clib_export int
+test_macros_main (unformat_input_t *input)
{
clib_macro_main_t *mm = &clib_macro_main;
{
clib_macro_main_t *mm = &clib_macro_main;
dump_call_stats (g_call_stats);
prob_free ();
dump_call_stats (g_call_stats);
prob_free ();
- if (verbose)
- {
- memory_snap ();
- }
void os_panic (void) __attribute__ ((weak));
void os_panic (void) __attribute__ ((weak));
os_panic (void)
{
abort ();
os_panic (void)
{
abort ();
chunks, the chunk fusion algorithm won't merge them.
*/
chunks, the chunk fusion algorithm won't merge them.
*/
-void
-clib_valloc_add_chunk (clib_valloc_main_t * vam,
- clib_valloc_chunk_t * template)
+__clib_export void
+clib_valloc_add_chunk (clib_valloc_main_t *vam, clib_valloc_chunk_t *template)
{
clib_valloc_chunk_t *ch, *new_ch;
u32 index;
{
clib_valloc_chunk_t *ch, *new_ch;
u32 index;
@param verbose - int - verbosity level
@return u8 vector
*/
@param verbose - int - verbosity level
@return u8 vector
*/
-u8 *
-format_valloc (u8 * s, va_list * va)
+__clib_export u8 *
+format_valloc (u8 *s, va_list *va)
{
clib_valloc_main_t *vam = va_arg (*va, clib_valloc_main_t *);
int verbose = va_arg (*va, int);
{
clib_valloc_main_t *vam = va_arg (*va, clib_valloc_main_t *);
int verbose = va_arg (*va, int);