From e04defa422bd7d365d9d8389fde13e675e9783a2 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Mon, 11 Jul 2016 22:11:36 +0200 Subject: lib: shm_du_map: PCI allocation / deallocation Correct implementation of allocation for the Protocol Control Information. Also removes stale code checking for a corner case when the du map still wrapped multi-block SDU's. --- include/ouroboros/shm_du_map.h | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/ouroboros/shm_du_map.h b/include/ouroboros/shm_du_map.h index 23c0c3aa..11fe35c6 100644 --- a/include/ouroboros/shm_du_map.h +++ b/include/ouroboros/shm_du_map.h @@ -50,16 +50,18 @@ int shm_du_map_read(uint8_t ** dst, struct shm_du_map * dum, ssize_t idx); int shm_du_map_remove(struct shm_du_map * dum, - ssize_t idx); - -/* FIXME: use shm_du_map * and index */ -uint8_t * shm_du_buff_head_alloc(struct shm_du_buff * sdb, - size_t size); -uint8_t * shm_du_buff_tail_alloc(struct shm_du_buff * sdb, - size_t size); -int shm_du_buff_head_release(struct shm_du_buff * sdb, - size_t size); -int shm_du_buff_tail_release(struct shm_du_buff * sdb, - size_t size); + ssize_t idx); +uint8_t * shm_du_buff_head_alloc(struct shm_du_map * dum, + int idx, + ssize_t size); +uint8_t * shm_du_buff_tail_alloc(struct shm_du_map * dum, + int idx, + ssize_t size); +int shm_du_buff_head_release(struct shm_du_map * dum, + int idx, + ssize_t size); +int shm_du_buff_tail_release(struct shm_du_map * dum, + int idx, + ssize_t size); #endif /* OUROBOROS_SHM_DU_MAP_H */ -- cgit v1.2.3