dpaa: Add and use bman_new_pool_for_bpid()

Update #3277.
This commit is contained in:
Sebastian Huber 2018-01-12 13:22:10 +01:00
parent 95fe5b1f46
commit a7d252c645
3 changed files with 19 additions and 0 deletions

View File

@ -571,6 +571,11 @@ static int dpaa_bp_alloc_pool(struct dpaa_bp *dpaa_bp)
dpaa_bp->bpid = (u8)bman_get_bpid(dpaa_bp->pool); dpaa_bp->bpid = (u8)bman_get_bpid(dpaa_bp->pool);
} }
#ifdef __rtems__
else {
dpaa_bp->pool = bman_new_pool_for_bpid(dpaa_bp->bpid);
}
#endif /* __rtems__ */
if (dpaa_bp->seed_cb) { if (dpaa_bp->seed_cb) {
err = dpaa_bp->seed_cb(dpaa_bp); err = dpaa_bp->seed_cb(dpaa_bp);

View File

@ -720,6 +720,17 @@ err:
return NULL; return NULL;
} }
EXPORT_SYMBOL(bman_new_pool); EXPORT_SYMBOL(bman_new_pool);
#ifdef __rtems__
struct bman_pool *
bman_new_pool_for_bpid(u8 bpid)
{
struct bman_pool *pool;
pool = malloc(sizeof(*pool), M_KMALLOC, M_WAITOK | M_ZERO);
pool->bpid = bpid;
return (pool);
}
#endif /* __rtems__ */
void bman_free_pool(struct bman_pool *pool) void bman_free_pool(struct bman_pool *pool)
{ {

View File

@ -86,6 +86,9 @@ struct bman_pool;
* Creates a pool object, and returns a reference to it or NULL on error. * Creates a pool object, and returns a reference to it or NULL on error.
*/ */
struct bman_pool *bman_new_pool(void); struct bman_pool *bman_new_pool(void);
#ifdef __rtems__
struct bman_pool *bman_new_pool_for_bpid(u8 bpid);
#endif /* __rtems__ */
/** /**
* bman_free_pool - Deallocates a Buffer Pool object * bman_free_pool - Deallocates a Buffer Pool object