wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 1 | #include <common.h> |
| 2 | #include <exports.h> |
| 3 | |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 4 | DECLARE_GLOBAL_DATA_PTR; |
| 5 | |
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 6 | static void dummy(void) |
| 7 | { |
| 8 | } |
| 9 | |
| 10 | unsigned long get_version(void) |
| 11 | { |
| 12 | return XF_VERSION; |
| 13 | } |
| 14 | |
| 15 | void jumptable_init (void) |
| 16 | { |
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 17 | int i; |
| 18 | |
| 19 | gd->jt = (void **) malloc (XF_MAX * sizeof (void *)); |
| 20 | for (i = 0; i < XF_MAX; i++) |
| 21 | gd->jt[i] = (void *) dummy; |
| 22 | |
| 23 | gd->jt[XF_get_version] = (void *) get_version; |
| 24 | gd->jt[XF_malloc] = (void *) malloc; |
| 25 | gd->jt[XF_free] = (void *) free; |
Detlev Zundel | d7c2a02 | 2006-09-01 15:00:02 +0200 | [diff] [blame] | 26 | gd->jt[XF_getenv] = (void *) getenv; |
| 27 | gd->jt[XF_setenv] = (void *) setenv; |
| 28 | gd->jt[XF_get_timer] = (void *) get_timer; |
| 29 | gd->jt[XF_simple_strtoul] = (void *) simple_strtoul; |
| 30 | gd->jt[XF_udelay] = (void *) udelay; |
Martin Krause | 8092fef | 2006-12-12 14:26:01 +0100 | [diff] [blame] | 31 | gd->jt[XF_simple_strtol] = (void *) simple_strtol; |
| 32 | gd->jt[XF_strcmp] = (void *) strcmp; |
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 33 | #if defined(CONFIG_I386) || defined(CONFIG_PPC) |
| 34 | gd->jt[XF_install_hdlr] = (void *) irq_install_handler; |
| 35 | gd->jt[XF_free_hdlr] = (void *) irq_free_handler; |
wdenk | 4f7cb08 | 2003-09-11 23:06:34 +0000 | [diff] [blame] | 36 | #endif /* I386 || PPC */ |
Jon Loeliger | c3517f9 | 2007-07-08 18:10:08 -0500 | [diff] [blame] | 37 | #if defined(CONFIG_CMD_I2C) |
wdenk | 4f7cb08 | 2003-09-11 23:06:34 +0000 | [diff] [blame] | 38 | gd->jt[XF_i2c_write] = (void *) i2c_write; |
| 39 | gd->jt[XF_i2c_read] = (void *) i2c_read; |
Jon Loeliger | c3517f9 | 2007-07-08 18:10:08 -0500 | [diff] [blame] | 40 | #endif |
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 41 | } |