X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=blobdiff_plain;f=common%2Fexports.c;h=333107c74c3c68f9244eea3cdbd44a6f0c1c2802;hp=fc8060ae530b02ae66823cddb6906f48c5aec12a;hb=b6abcbe91215ee2dd4421399b8579fcaddd3a948;hpb=b453960d4fdb87b3970d96119b90df2ed024fc4a diff --git a/common/exports.c b/common/exports.c index fc8060ae53..333107c74c 100644 --- a/common/exports.c +++ b/common/exports.c @@ -1,9 +1,11 @@ #include #include +#include +#include DECLARE_GLOBAL_DATA_PTR; -static void dummy(void) +__attribute__((unused)) static void dummy(void) { } @@ -12,28 +14,10 @@ unsigned long get_version(void) return XF_VERSION; } -void jumptable_init (void) -{ - int i; - - gd->jt = (void **) malloc (XF_MAX * sizeof (void *)); - for (i = 0; i < XF_MAX; i++) - gd->jt[i] = (void *) dummy; +#define EXPORT_FUNC(f, a, x, ...) gd->jt->x = f; - gd->jt[XF_get_version] = (void *) get_version; - gd->jt[XF_malloc] = (void *) malloc; - gd->jt[XF_free] = (void *) free; - gd->jt[XF_getenv] = (void *) getenv; - gd->jt[XF_setenv] = (void *) setenv; - gd->jt[XF_get_timer] = (void *) get_timer; - gd->jt[XF_simple_strtoul] = (void *) simple_strtoul; - 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 /* I386 || PPC */ -#if (CONFIG_COMMANDS & CFG_CMD_I2C) || defined(CONFIG_CMD_I2C) - gd->jt[XF_i2c_write] = (void *) i2c_write; - gd->jt[XF_i2c_read] = (void *) i2c_read; -#endif /* CFG_CMD_I2C */ +void jumptable_init(void) +{ + gd->jt = malloc(sizeof(struct jt_funcs)); +#include <_exports.h> }