summaryrefslogtreecommitdiff
path: root/common/exports.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-07-24 23:38:38 +0000
committerwdenk <wdenk>2003-07-24 23:38:38 +0000
commit27b207fd0a0941b03f27e2a82c0468b1a090c745 (patch)
tree4d339d7a2a00889f09a876425ce430be57de56e9 /common/exports.c
parent2535d60277cc295adf75cd5721dcecd840c69a63 (diff)
downloadu-boot-imx-27b207fd0a0941b03f27e2a82c0468b1a090c745.zip
u-boot-imx-27b207fd0a0941b03f27e2a82c0468b1a090c745.tar.gz
u-boot-imx-27b207fd0a0941b03f27e2a82c0468b1a090c745.tar.bz2
* Implement new mechanism to export U-Boot's functions to standalone
applications: instead of using (PPC-specific) system calls we now use a jump table; please see doc/README.standalone for details * Patch by Dave Westwood, 24 Jul 2003: added support for Unity OS (a proprietary OS)
Diffstat (limited to 'common/exports.c')
-rw-r--r--common/exports.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/common/exports.c b/common/exports.c
new file mode 100644
index 0000000..22002cc
--- /dev/null
+++ b/common/exports.c
@@ -0,0 +1,31 @@
+#include <common.h>
+#include <exports.h>
+
+static void dummy(void)
+{
+}
+
+unsigned long get_version(void)
+{
+ return XF_VERSION;
+}
+
+void jumptable_init (void)
+{
+ DECLARE_GLOBAL_DATA_PTR;
+ int i;
+
+ gd->jt = (void **) malloc (XF_MAX * sizeof (void *));
+ for (i = 0; i < XF_MAX; i++)
+ gd->jt[i] = (void *) dummy;
+
+ gd->jt[XF_get_version] = (void *) get_version;
+ gd->jt[XF_malloc] = (void *) malloc;
+ gd->jt[XF_free] = (void *) free;
+ gd->jt[XF_get_timer] = (void *)get_timer;
+ gd->jt[XF_udelay] = (void *)udelay;
+#if defined(CONFIG_I386) || defined(CONFIG_PPC)
+ gd->jt[XF_install_hdlr] = (void *) irq_install_handler;
+ gd->jt[XF_free_hdlr] = (void *) irq_free_handler;
+#endif
+}