diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2015-06-17 03:15:34 (GMT) |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-07-15 00:03:16 (GMT) |
commit | 780bfdd3c72a058ba24cda0df66ca75f0a7d8b18 (patch) | |
tree | dd9f729d8aad1da238271df2be85d08c04ff7435 /include | |
parent | 4c71322b41a657596ee5e5777393ed83e80139c6 (diff) | |
download | u-boot-780bfdd3c72a058ba24cda0df66ca75f0a7d8b18.tar.xz |
dm: cpu: Add a new get_count method to cpu uclass
Introduce a new method 'get_count' in the UCLASS_CPU ops to get
the number of CPUs in the system.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/cpu.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/cpu.h b/include/cpu.h index 34c60bc..bfb0db2 100644 --- a/include/cpu.h +++ b/include/cpu.h @@ -58,6 +58,14 @@ struct cpu_ops { * @return 0 if OK, -ve on error */ int (*get_info)(struct udevice *dev, struct cpu_info *info); + + /** + * get_count() - Get number of CPUs + * + * @dev: Device to check (UCLASS_CPU) + * @return CPU count if OK, -ve on error + */ + int (*get_count)(struct udevice *dev); }; #define cpu_get_ops(dev) ((struct cpu_ops *)(dev)->driver->ops) @@ -81,4 +89,12 @@ int cpu_get_desc(struct udevice *dev, char *buf, int size); */ int cpu_get_info(struct udevice *dev, struct cpu_info *info); +/** + * cpu_get_count() - Get number of CPUs + * + * @dev: Device to check (UCLASS_CPU) + * @return CPU count if OK, -ve on error + */ +int cpu_get_count(struct udevice *dev); + #endif |