summaryrefslogtreecommitdiffstats
path: root/qemu/roms/u-boot/include/hwconfig.h
diff options
context:
space:
mode:
authorYang Zhang <yang.z.zhang@intel.com>2015-08-28 09:58:54 +0800
committerYang Zhang <yang.z.zhang@intel.com>2015-09-01 12:44:00 +0800
commite44e3482bdb4d0ebde2d8b41830ac2cdb07948fb (patch)
tree66b09f592c55df2878107a468a91d21506104d3f /qemu/roms/u-boot/include/hwconfig.h
parent9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00 (diff)
Add qemu 2.4.0
Change-Id: Ic99cbad4b61f8b127b7dc74d04576c0bcbaaf4f5 Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
Diffstat (limited to 'qemu/roms/u-boot/include/hwconfig.h')
-rw-r--r--qemu/roms/u-boot/include/hwconfig.h100
1 files changed, 100 insertions, 0 deletions
diff --git a/qemu/roms/u-boot/include/hwconfig.h b/qemu/roms/u-boot/include/hwconfig.h
new file mode 100644
index 000000000..def7ad03d
--- /dev/null
+++ b/qemu/roms/u-boot/include/hwconfig.h
@@ -0,0 +1,100 @@
+/*
+ * An inteface for configuring a hardware via u-boot environment.
+ *
+ * Copyright (c) 2009 MontaVista Software, Inc.
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ *
+ * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef _HWCONFIG_H
+#define _HWCONFIG_H
+
+#include <linux/types.h>
+#include <asm/errno.h>
+
+#ifdef CONFIG_HWCONFIG
+
+extern int hwconfig_f(const char *opt, char *buf);
+extern const char *hwconfig_arg_f(const char *opt, size_t *arglen, char *buf);
+extern int hwconfig_arg_cmp_f(const char *opt, const char *arg, char *buf);
+extern int hwconfig_sub_f(const char *opt, const char *subopt, char *buf);
+extern const char *hwconfig_subarg_f(const char *opt, const char *subopt,
+ size_t *subarglen, char *buf);
+extern int hwconfig_subarg_cmp_f(const char *opt, const char *subopt,
+ const char *subarg, char *buf);
+#else
+
+static inline int hwconfig_f(const char *opt, char *buf)
+{
+ return -ENOSYS;
+}
+
+static inline const char *hwconfig_arg_f(const char *opt, size_t *arglen,
+ char *buf)
+{
+ *arglen = 0;
+ return "";
+}
+
+static inline int hwconfig_arg_cmp_f(const char *opt, const char *arg,
+ char *buf)
+{
+ return -ENOSYS;
+}
+
+static inline int hwconfig_sub_f(const char *opt, const char *subopt, char *buf)
+{
+ return -ENOSYS;
+}
+
+static inline const char *hwconfig_subarg_f(const char *opt, const char *subopt,
+ size_t *subarglen, char *buf)
+{
+ *subarglen = 0;
+ return "";
+}
+
+static inline int hwconfig_subarg_cmp_f(const char *opt, const char *subopt,
+ const char *subarg, char *buf)
+{
+ return -ENOSYS;
+}
+
+#endif /* CONFIG_HWCONFIG */
+
+static inline int hwconfig(const char *opt)
+{
+ return hwconfig_f(opt, NULL);
+}
+
+static inline const char *hwconfig_arg(const char *opt, size_t *arglen)
+{
+ return hwconfig_arg_f(opt, arglen, NULL);
+}
+
+static inline int hwconfig_arg_cmp(const char *opt, const char *arg)
+{
+ return hwconfig_arg_cmp_f(opt, arg, NULL);
+}
+
+static inline int hwconfig_sub(const char *opt, const char *subopt)
+{
+ return hwconfig_sub_f(opt, subopt, NULL);
+}
+
+static inline const char *hwconfig_subarg(const char *opt, const char *subopt,
+ size_t *subarglen)
+{
+ return hwconfig_subarg_f(opt, subopt, subarglen, NULL);
+}
+
+static inline int hwconfig_subarg_cmp(const char *opt, const char *subopt,
+ const char *subarg)
+{
+ return hwconfig_subarg_cmp_f(opt, subopt, subarg, NULL);
+}
+
+#endif /* _HWCONFIG_H */