diff options
author | Yuji Mano <yuji.mano@am.sony.com> | 2009-05-26 16:57:09 -0700 |
---|---|---|
committer | Yuji Mano <yuji.mano@am.sony.com> | 2009-05-26 16:57:09 -0700 |
commit | e80e7d4a8407b3fcda803bb6fdeac0bfd51fd871 (patch) | |
tree | 5d67a95995c6c530d979d458f7f1dd3d1ce2065d | |
parent | e81ad676eaf3fde8aa99f9004615ace24736548a (diff) | |
download | mars-src-e80e7d4a8407b3fcda803bb6fdeac0bfd51fd871.tar.gz |
base: Add api to get num mpus
This adds a new API to the base library to return the number of MPUs
allocated for the specified MARS context.
Signed-off-by: Yuji Mano <yuji.mano@am.sony.com>
Acked-by: Kazunori Asayama <asayama@sm.sony.co.jp>
-rw-r--r-- | base/include/host/mars/context.h | 13 | ||||
-rw-r--r-- | base/src/host/lib/context.c | 9 |
2 files changed, 22 insertions, 0 deletions
diff --git a/base/include/host/mars/context.h b/base/include/host/mars/context.h index db39470..06c0ce4 100644 --- a/base/include/host/mars/context.h +++ b/base/include/host/mars/context.h @@ -117,6 +117,19 @@ int mars_context_create(struct mars_context **mars, uint32_t num_mpus, uint8_t s */ int mars_context_destroy(struct mars_context *mars); +/** + * \ingroup group_mars_context + * \brief <b>[host]</b> Returns number of MPUs allocated for MARS context. + * + * This function returns the number of MPUs allocated for the MARS context. + * + * \param[in] mars - pointer to MARS context + * \return + * non-zero - number of MPUs + * 0 - invalid MARS context + */ +uint32_t mars_context_get_num_mpus(struct mars_context *mars); + #if defined(__cplusplus) } #endif diff --git a/base/src/host/lib/context.c b/base/src/host/lib/context.c index 22dbbc9..6e29027 100644 --- a/base/src/host/lib/context.c +++ b/base/src/host/lib/context.c @@ -380,3 +380,12 @@ error: return ret; } + +uint32_t mars_context_get_num_mpus(struct mars_context *mars) +{ + /* check function params */ + if (!mars) + return 0; + + return mars->mpu_context_count; +} |