hv: clean up function definitions in sbuf.h

separate the function definitions into debug/release directories
to better distinguish debug/release libraries

v1 -> v2:
 - sbuf_get is defined in 'debug/sbuf.c' but not used anywhere.
   remove the declaration in 'include/debug/sbuf.h' and keep the
   definition in 'debug/sbuf.c' in case it will used later.
 - sbuf_put and sbuf_share_setup is not used under RELEASE version.
   remove the file 'release/sbuf.c'.

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
This commit is contained in:
Shiqing Gao 2018-12-03 11:05:17 +08:00 committed by wenlingz
parent e7d1cdd9e2
commit e8e25bd6fc

View File

@ -58,13 +58,7 @@ struct shared_buf {
uint32_t padding[6]; uint32_t padding[6];
}; };
#ifdef HV_DEBUG
/**
*@pre sbuf != NULL
*@pre data != NULL
*/
uint32_t sbuf_get(struct shared_buf *sbuf, uint8_t *data);
/** /**
*@pre sbuf != NULL *@pre sbuf != NULL
*@pre data != NULL *@pre data != NULL
@ -73,29 +67,4 @@ uint32_t sbuf_put(struct shared_buf *sbuf, uint8_t *data);
int sbuf_share_setup(uint16_t pcpu_id, uint32_t sbuf_id, uint64_t *hva); int sbuf_share_setup(uint16_t pcpu_id, uint32_t sbuf_id, uint64_t *hva);
uint32_t sbuf_next_ptr(uint32_t pos, uint32_t span, uint32_t scope); uint32_t sbuf_next_ptr(uint32_t pos, uint32_t span, uint32_t scope);
#else /* HV_DEBUG */
static inline int sbuf_get(
__unused struct shared_buf *sbuf,
__unused uint8_t *data)
{
return 0;
}
static inline int sbuf_put(
__unused struct shared_buf *sbuf,
__unused uint8_t *data)
{
return 0;
}
static inline int sbuf_share_setup(
__unused uint16_t pcpu_id,
__unused uint32_t sbuf_id,
__unused uint64_t *hva)
{
return -1;
}
#endif /* HV_DEBUG */
#endif /* SHARED_BUFFER_H */ #endif /* SHARED_BUFFER_H */