summaryrefslogtreecommitdiffstats
path: root/build-root/rpm
AgeCommit message (Expand)AuthorFilesLines
2017-01-27package only the vpp binaries (rpm)Gabriel Ganne1-1/+1
2017-01-20Add dpdk development packagingDamjan Marion1-1/+0
2017-01-17fix rpm warnings for defattr directory of lua/*Gabriel Ganne1-1/+1
2017-01-13vppctl: new bash completion for vppctl commandsPadraig Connolly1-0/+6
2017-01-11Remove unnecessary build macro to fix slow builds.Thomas F Herbert1-4/+0
2017-01-10Revert "vppctl: bash completion for vppctl commands"Damjan Marion1-6/+0
2017-01-09vppctl: bash completion for vppctl commandsPadraig Connolly1-0/+6
2017-01-03Do not require external vppapigen when not cross-compilingDamjan Marion1-1/+0
2017-01-01Move java,lua api and remaining plugins to src/Damjan Marion1-21/+49
2016-12-28Reorganize source tree to use single autotools instanceDamjan Marion1-7/+17
2016-12-21fix sample-plugin rpm packagingGabriel Ganne1-2/+2
2016-12-20Remove RPATH from binaries before creating .deb and .rpm packagesDamjan Marion1-1/+6
2016-12-09python api rpm packaging - json files are not executablesGabriel Ganne1-2/+2
2016-12-08vpp-python-api packaging - use easy_install to install the python apiGabriel Ganne1-7/+10
2016-12-02API: Packaging of JSON files.Ole Troan1-2/+18
2016-11-17remove reference to Intel with dpdk docsPadraig Connolly1-1/+1
2016-11-04VPP-498: Prepare vpp RPM packaging for use by downstream distros.Thomas F Herbert1-19/+29
2016-11-03Fix vpp-plugins rpmsEd Warnicke1-6/+6
2016-10-26Fix description of devel package.Thomas F Herbert1-10/+8
2016-10-11VPP-474 Revert "FIX sysctl configuration directory"Miroslav Miklus1-3/+3
2016-10-11Rebind kernel drivers on VPP uninstallPeter Ginchev1-1/+25
2016-10-10platform: rewrote vppctl script to include historyPadraig1-1/+1
2016-09-30Remove RPM package dependency on vpp-develJohn DeNisco1-1/+1
2016-09-27Fix RPM packaging dependenciesJohn DeNisco1-1/+1
2016-09-27FIX sysctl configuration directoryMiroslav Miklus1-3/+3
2016-09-23Python API: Preparation for RPM/DEB packaging.Ole Troan1-0/+32
2016-09-12Provide vpp-plugins rpm packagingEd Warnicke1-0/+31
2016-09-07VPP-390: include *.so symlinks in vpp-libEd Warnicke1-0/+2
2016-09-02VPP-374: getting jvppgen.py into rpm vpp-devel packageEd Warnicke1-0/+11
2016-06-18Enhanced RPM build process to make rpm for any given platformSachin1-1/+1
2016-06-09VPP-127 Removed spurious use of sudoEd Warnicke1-1/+1
2016-06-08VPP-127: Make rpm/deb provide vpp group to access vpp-apiEd Warnicke1-0/+4
2016-06-08VPP-124: Fix rpms to work out of the box.Ed Warnicke2-1/+3
2016-01-25Fix rpm packaging bit-rotDave Barach1-0/+1
2016-01-20Rename vpe binary name to avoid collision with latexDamjan Marion2-6/+6
2015-12-08Initial commit of vpp code.v1.0.0Ed Warnicke2-0/+139
cate: offset = heap_alloc (heap, size, handle); New object is heap[offset] ... heap[offset + size] Handle is used to free/query object. To free object: heap_dealloc (heap, handle); To query the size of an object: heap_size (heap, handle) */ #ifndef included_heap_h #define included_heap_h #include <vppinfra/clib.h> #include <vppinfra/cache.h> #include <vppinfra/hash.h> #include <vppinfra/format.h> #include <vppinfra/bitmap.h> /* Doubly linked list of elements. */ typedef struct { /* Offset of this element (plus free bit). If element is free, data at offset contains pointer to free list. */ u32 offset; /* Index of next and previous elements relative to current element. */ i32 next, prev; } heap_elt_t; /* Use high bit of offset as free bit. */ #define HEAP_ELT_FREE_BIT (1 << 31) always_inline uword heap_is_free (heap_elt_t * e) { return (e->offset & HEAP_ELT_FREE_BIT) != 0; } always_inline uword heap_offset (heap_elt_t * e) { return e->offset & ~HEAP_ELT_FREE_BIT; } always_inline heap_elt_t * heap_next (heap_elt_t * e) { return e + e->next; } always_inline heap_elt_t * heap_prev (heap_elt_t * e) { return e + e->prev; } always_inline uword heap_elt_size (void *v, heap_elt_t * e) { heap_elt_t *n = heap_next (e); uword next_offset = n != e ? heap_offset (n) : vec_len (v); return next_offset - heap_offset (e); } /* Sizes are binned. Sizes 1 to 2^log2_small_bins have their own free lists. Larger sizes are grouped in powers of two. */ #define HEAP_LOG2_SMALL_BINS (5) #define HEAP_SMALL_BINS (1 << HEAP_LOG2_SMALL_BINS) #define HEAP_N_BINS (2 * HEAP_SMALL_BINS) /* Header for heaps. */ typedef struct { /* Vector of used and free elements. */ heap_elt_t *elts; /* For elt_bytes < sizeof (u32) we need some extra space per elt to store free list index. */ u32 *small_free_elt_free_index; /* Vector of free indices of elts array. */ u32 *free_elts; /* Indices of free elts indexed by size bin. */ u32 **free_lists; format_function_t *format_elt; /* Used for validation/debugging. */ uword *used_elt_bitmap; /* First and last element of doubly linked chain of elements. */ u32 head, tail; u32 used_count, max_len; /* Number of bytes in a help element. */ u32 elt_bytes; u32 flags; /* Static heaps are made from external memory given to us by user and are not re-sizable vectors. */ #define HEAP_IS_STATIC (1) } heap_header_t; /* Start of heap elements is always cache aligned. */ #define HEAP_DATA_ALIGN (CLIB_CACHE_LINE_BYTES) always_inline heap_header_t * heap_header (void *v) { return vec_header (v, sizeof (heap_header_t)); } always_inline uword heap_header_bytes () { return vec_header_bytes (sizeof (heap_header_t)); } always_inline void heap_dup_header (heap_header_t * old, heap_header_t * new) { uword i; new[0] = old[0]; new->elts = vec_dup (new->elts); new->free_elts = vec_dup (new->free_elts); new->free_lists = vec_dup (new->free_lists); for (i = 0; i < vec_len (new->free_lists); i++) new->free_lists[i] = vec_dup (new->free_lists[i]); new->used_elt_bitmap = clib_bitmap_dup (new->used_elt_bitmap); new->small_free_elt_free_index = vec_dup (new->small_free_elt_free_index); } /* Make a duplicate copy of a heap. */ #define heap_dup(v) _heap_dup(v, vec_len (v) * sizeof (v[0])) always_inline void * _heap_dup (void *v_old, uword v_bytes) { heap_header_t *h_old, *h_new; void *v_new; h_old = heap_header (v_old); if (!v_old) return v_old; v_new = 0; v_new = _vec_resize (v_new, _vec_len (v_old), v_bytes, sizeof (heap_header_t), HEAP_DATA_ALIGN); h_new = heap_header (v_new); heap_dup_header (h_old, h_new); clib_memcpy_fast (v_new, v_old, v_bytes); return v_new; } always_inline uword heap_elts (void *v) { heap_header_t *h = heap_header (v); return h->used_count; } uword heap_bytes (void *v); always_inline void * _heap_new (u32 len, u32 n_elt_bytes) { void *v = _vec_resize ((void *) 0, len, (uword) len * n_elt_bytes, sizeof (heap_header_t), HEAP_DATA_ALIGN); heap_header (v)->elt_bytes = n_elt_bytes; return v; } #define heap_new(v) (v) = _heap_new (0, sizeof ((v)[0])) always_inline void heap_set_format (void *v, format_function_t * format_elt) { ASSERT (v); heap_header (v)->format_elt = format_elt; } always_inline void heap_set_max_len (void *v, uword max_len) { ASSERT (v); heap_header (v)->max_len = max_len; } always_inline uword heap_get_max_len (void *v) { return v ? heap_header (v)->max_len : 0; } /* Create fixed size heap with given block of memory. */ always_inline void * heap_create_from_memory (void *memory, uword max_len, uword elt_bytes) { heap_header_t *h; void *v; if (max_len * elt_bytes < sizeof (h[0])) return 0; h = memory; clib_memset (h, 0, sizeof (h[0])); h->max_len = max_len; h->elt_bytes = elt_bytes; h->flags = HEAP_IS_STATIC; v = (void *) (memory + heap_header_bytes ()); _vec_len (v) = 0; return v; } /* Execute BODY for each allocated heap element. */ #define heap_foreach(var,len,heap,body) \ do { \ if (vec_len (heap) > 0) \ { \ heap_header_t * _h = heap_header (heap); \ heap_elt_t * _e = _h->elts + _h->head; \ heap_elt_t * _end = _h->elts + _h->tail; \ while (1) \ { \ if (! heap_is_free (_e)) \ { \ (var) = (heap) + heap_offset (_e); \ (len) = heap_elt_size ((heap), _e); \ do { body; } while (0); \ } \ if (_e == _end) \ break; \ _e = heap_next (_e); \ } \ } \ } while (0) #define heap_elt_at_index(v,index) vec_elt_at_index(v,index) always_inline heap_elt_t * heap_get_elt (void *v, uword handle) { heap_header_t *h = heap_header (v); heap_elt_t *e = vec_elt_at_index (h->elts, handle); ASSERT (!heap_is_free (e)); return e; } #define heap_elt_with_handle(v,handle) \ ({ \ heap_elt_t * _e = heap_get_elt ((v), (handle)); \ (v) + heap_offset (_e); \ }) always_inline uword heap_is_free_handle (void *v, uword heap_handle) { heap_header_t *h = heap_header (v); heap_elt_t *e = vec_elt_at_index (h->elts, heap_handle); return heap_is_free (e); } extern uword heap_len (void *v, word handle); /* Low level allocation call. */ extern void *_heap_alloc (void *v, uword size, uword alignment, uword elt_bytes, uword * offset, uword * handle); #define heap_alloc_aligned(v,size,align,handle) \ ({ \ uword _o, _h; \ uword _a = (align); \ uword _s = (size); \ (v) = _heap_alloc ((v), _s, _a, sizeof ((v)[0]), &_o, &_h); \ (handle) = _h; \ _o; \ }) #define heap_alloc(v,size,handle) heap_alloc_aligned((v),(size),0,(handle)) extern void heap_dealloc (void *v, uword handle); extern void heap_validate (void *v); /* Format heap internal data structures as string. */ extern u8 *format_heap (u8 * s, va_list * va); void *_heap_free (void *v); #define heap_free(v) (v)=_heap_free(v) #endif /* included_heap_h */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */