On Thu, Feb 5, 2015 at 3:57 AM, Petri Savolainen < [email protected]> wrote:
> This file contains cpu related API calls. The calls are > renames from odp_thread_cpu() and odp_sys_cpu_count(). > > Signed-off-by: Petri Savolainen <[email protected]> > Reviewed-by: Bill Fischofer <[email protected]> > --- > include/odp.h | 1 + > include/odp/api/cpu.h | 54 > ++++++++++++++++++++++++++++++++ > platform/linux-generic/Makefile.am | 2 ++ > platform/linux-generic/include/odp/cpu.h | 26 +++++++++++++++ > 4 files changed, 83 insertions(+) > create mode 100644 include/odp/api/cpu.h > create mode 100644 platform/linux-generic/include/odp/cpu.h > > diff --git a/include/odp.h b/include/odp.h > index 139abdf..777b327 100644 > --- a/include/odp.h > +++ b/include/odp.h > @@ -27,6 +27,7 @@ extern "C" { > #include <odp/hints.h> > #include <odp/debug.h> > #include <odp/byteorder.h> > +#include <odp/cpu.h> > #include <odp/cpumask.h> > #include <odp/barrier.h> > #include <odp/spinlock.h> > diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h > new file mode 100644 > index 0000000..c389093 > --- /dev/null > +++ b/include/odp/api/cpu.h > @@ -0,0 +1,54 @@ > +/* Copyright (c) 2015, Linaro Limited > + * All rights reserved. > + * > + * SPDX-License-Identifier: BSD-3-Clause > + */ > + > + > +/** > + * @file > + * > + * ODP CPU API > + */ > + > +#ifndef ODP_CPU_H_ > +#define ODP_CPU_H_ > + > +#ifdef __cplusplus > +extern "C" { > +#endif > + > +/** @defgroup odp_cpu ODP CPU > + * @{ > + */ > + > + > +/** > + * CPU identifier > + * > + * Determine CPU identifier on which the calling is running. CPU > numbering is > + * system specific. > + * > + * @return CPU identifier > + */ > +int odp_cpu_id(void); > + > +/** > + * CPU count > + * > + * Report the number of CPU's available to this ODP program. > + * This may be smaller than the number of (online) CPU's in the system. > + * > + * @return Number of available CPU's > + */ > +int odp_cpu_count(void); > + > +/** > + * @} > + */ > + > +#ifdef __cplusplus > +} > +#endif > + > +#endif > diff --git a/platform/linux-generic/Makefile.am > b/platform/linux-generic/Makefile.am > index 05f5378..7ebf7a3 100644 > --- a/platform/linux-generic/Makefile.am > +++ b/platform/linux-generic/Makefile.am > @@ -18,6 +18,7 @@ odpinclude_HEADERS = \ > > $(top_srcdir)/platform/linux-generic/include/odp/classification.h \ > > $(top_srcdir)/platform/linux-generic/include/odp/compiler.h \ > > $(top_srcdir)/platform/linux-generic/include/odp/config.h \ > + $(top_srcdir)/platform/linux-generic/include/odp/cpu.h \ > > $(top_srcdir)/platform/linux-generic/include/odp/cpumask.h \ > > $(top_srcdir)/platform/linux-generic/include/odp/crypto.h \ > $(top_srcdir)/platform/linux-generic/include/odp/debug.h > \ > @@ -71,6 +72,7 @@ odpapiinclude_HEADERS = \ > $(top_srcdir)/include/odp/api/classification.h \ > $(top_srcdir)/include/odp/api/compiler.h \ > $(top_srcdir)/include/odp/api/config.h \ > + $(top_srcdir)/include/odp/api/cpu.h \ > $(top_srcdir)/include/odp/api/cpumask.h \ > $(top_srcdir)/include/odp/api/crypto.h \ > $(top_srcdir)/include/odp/api/debug.h \ > diff --git a/platform/linux-generic/include/odp/cpu.h > b/platform/linux-generic/include/odp/cpu.h > new file mode 100644 > index 0000000..b5b5320 > --- /dev/null > +++ b/platform/linux-generic/include/odp/cpu.h > @@ -0,0 +1,26 @@ > +/* Copyright (c) 2015, Linaro Limited > + * All rights reserved. > + * > + * SPDX-License-Identifier: BSD-3-Clause > + */ > + > +/** > + * @file > + * > + * ODP CPU > + */ > + > +#ifndef ODP_PLAT_CPU_H_ > +#define ODP_PLAT_CPU_H_ > + > +#ifdef __cplusplus > +extern "C" { > +#endif > + > +#include <odp/api/cpu.h> > + > +#ifdef __cplusplus > +} > +#endif > + > +#endif > -- > 2.2.2 > > > _______________________________________________ > lng-odp mailing list > [email protected] > http://lists.linaro.org/mailman/listinfo/lng-odp >
_______________________________________________ lng-odp mailing list [email protected] http://lists.linaro.org/mailman/listinfo/lng-odp
