Mike Frysinger | 53c6574 | 2009-07-23 16:37:48 -0400 | [diff] [blame] | 1 | /* |
Martin Dorwig | cb2c286 | 2015-01-26 15:22:54 -0700 | [diff] [blame] | 2 | * You need to use #ifdef around functions that may not exist |
Mike Frysinger | 53c6574 | 2009-07-23 16:37:48 -0400 | [diff] [blame] | 3 | * in the final configuration (such as i2c). |
Martin Dorwig | cb2c286 | 2015-01-26 15:22:54 -0700 | [diff] [blame] | 4 | * use a dummyfunction as first parameter to EXPORT_FUNC. |
| 5 | * As an example see the CONFIG_CMD_I2C section below |
Mike Frysinger | 53c6574 | 2009-07-23 16:37:48 -0400 | [diff] [blame] | 6 | */ |
Martin Dorwig | cb2c286 | 2015-01-26 15:22:54 -0700 | [diff] [blame] | 7 | #ifndef EXPORT_FUNC |
| 8 | #define EXPORT_FUNC(a, b, c, ...) |
| 9 | #endif |
| 10 | EXPORT_FUNC(get_version, unsigned long, get_version, void) |
Heinrich Schuchardt | c4954fb | 2020-10-07 18:11:48 +0200 | [diff] [blame] | 11 | EXPORT_FUNC(getchar, int, getc, void) |
Martin Dorwig | cb2c286 | 2015-01-26 15:22:54 -0700 | [diff] [blame] | 12 | EXPORT_FUNC(tstc, int, tstc, void) |
| 13 | EXPORT_FUNC(putc, void, putc, const char) |
| 14 | EXPORT_FUNC(puts, void, puts, const char *) |
Pali Rohár | 5aceb26 | 2022-09-05 11:31:17 +0200 | [diff] [blame] | 15 | #ifdef CONFIG_CONSOLE_FLUSH_SUPPORT |
| 16 | EXPORT_FUNC(flush, void, flush, void) |
| 17 | #endif |
Martin Dorwig | cb2c286 | 2015-01-26 15:22:54 -0700 | [diff] [blame] | 18 | EXPORT_FUNC(printf, int, printf, const char*, ...) |
Simon Glass | cd2c521 | 2016-09-25 21:33:31 -0600 | [diff] [blame] | 19 | #if (defined(CONFIG_X86) && !defined(CONFIG_X86_64)) || defined(CONFIG_PPC) |
Martin Dorwig | cb2c286 | 2015-01-26 15:22:54 -0700 | [diff] [blame] | 20 | EXPORT_FUNC(irq_install_handler, void, install_hdlr, |
| 21 | int, interrupt_handler_t, void*) |
| 22 | |
| 23 | EXPORT_FUNC(irq_free_handler, void, free_hdlr, int) |
| 24 | #else |
| 25 | EXPORT_FUNC(dummy, void, install_hdlr, void) |
| 26 | EXPORT_FUNC(dummy, void, free_hdlr, void) |
| 27 | #endif |
| 28 | EXPORT_FUNC(malloc, void *, malloc, size_t) |
Hans de Goede | 9f9df6f | 2015-09-13 14:45:15 +0200 | [diff] [blame] | 29 | #if !CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE) |
Martin Dorwig | cb2c286 | 2015-01-26 15:22:54 -0700 | [diff] [blame] | 30 | EXPORT_FUNC(free, void, free, void *) |
Simon Glass | f5f2b0e | 2015-03-03 08:03:01 -0700 | [diff] [blame] | 31 | #endif |
Martin Dorwig | cb2c286 | 2015-01-26 15:22:54 -0700 | [diff] [blame] | 32 | EXPORT_FUNC(udelay, void, udelay, unsigned long) |
| 33 | EXPORT_FUNC(get_timer, unsigned long, get_timer, unsigned long) |
| 34 | EXPORT_FUNC(vprintf, int, vprintf, const char *, va_list) |
Simon Glass | ed38aef | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 35 | EXPORT_FUNC(do_reset, int, do_reset, struct cmd_tbl *, |
Martin Dorwig | cb2c286 | 2015-01-26 15:22:54 -0700 | [diff] [blame] | 36 | int , int , char * const []) |
Simon Glass | 64b723f | 2017-08-03 12:22:12 -0600 | [diff] [blame] | 37 | EXPORT_FUNC(env_get, char *, env_get, const char*) |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 38 | EXPORT_FUNC(env_set, int, env_set, const char *, const char *) |
Martin Dorwig | cb2c286 | 2015-01-26 15:22:54 -0700 | [diff] [blame] | 39 | EXPORT_FUNC(simple_strtoul, unsigned long, simple_strtoul, |
| 40 | const char *, char **, unsigned int) |
| 41 | EXPORT_FUNC(strict_strtoul, int, strict_strtoul, |
| 42 | const char *, unsigned int , unsigned long *) |
| 43 | EXPORT_FUNC(simple_strtol, long, simple_strtol, |
| 44 | const char *, char **, unsigned int) |
| 45 | EXPORT_FUNC(strcmp, int, strcmp, const char *cs, const char *ct) |
Igor Opaniuk | f7c9176 | 2021-02-09 13:52:45 +0200 | [diff] [blame] | 46 | #if defined(CONFIG_CMD_I2C) && !CONFIG_IS_ENABLED(DM_I2C) |
Martin Dorwig | cb2c286 | 2015-01-26 15:22:54 -0700 | [diff] [blame] | 47 | EXPORT_FUNC(i2c_write, int, i2c_write, uchar, uint, int , uchar * , int) |
| 48 | EXPORT_FUNC(i2c_read, int, i2c_read, uchar, uint, int , uchar * , int) |
| 49 | #else |
| 50 | EXPORT_FUNC(dummy, void, i2c_write, void) |
| 51 | EXPORT_FUNC(dummy, void, i2c_read, void) |
| 52 | #endif |
| 53 | |
| 54 | #if !defined(CONFIG_CMD_SPI) || defined(CONFIG_DM_SPI) |
Martin Dorwig | cb2c286 | 2015-01-26 15:22:54 -0700 | [diff] [blame] | 55 | EXPORT_FUNC(dummy, void, spi_setup_slave, void) |
| 56 | EXPORT_FUNC(dummy, void, spi_free_slave, void) |
| 57 | #else |
Martin Dorwig | cb2c286 | 2015-01-26 15:22:54 -0700 | [diff] [blame] | 58 | EXPORT_FUNC(spi_setup_slave, struct spi_slave *, spi_setup_slave, |
| 59 | unsigned int, unsigned int, unsigned int, unsigned int) |
| 60 | EXPORT_FUNC(spi_free_slave, void, spi_free_slave, struct spi_slave *) |
| 61 | #endif |
| 62 | #ifndef CONFIG_CMD_SPI |
| 63 | EXPORT_FUNC(dummy, void, spi_claim_bus, void) |
| 64 | EXPORT_FUNC(dummy, void, spi_release_bus, void) |
| 65 | EXPORT_FUNC(dummy, void, spi_xfer, void) |
| 66 | #else |
| 67 | EXPORT_FUNC(spi_claim_bus, int, spi_claim_bus, struct spi_slave *) |
| 68 | EXPORT_FUNC(spi_release_bus, void, spi_release_bus, struct spi_slave *) |
| 69 | EXPORT_FUNC(spi_xfer, int, spi_xfer, struct spi_slave *, |
| 70 | unsigned int, const void *, void *, unsigned long) |
| 71 | #endif |
| 72 | EXPORT_FUNC(ustrtoul, unsigned long, ustrtoul, |
| 73 | const char *, char **, unsigned int) |
| 74 | EXPORT_FUNC(ustrtoull, unsigned long long, ustrtoull, |
| 75 | const char *, char **, unsigned int) |
Prabhakar Kushwaha | 7b3a6bc | 2015-06-28 11:03:59 +0530 | [diff] [blame] | 76 | EXPORT_FUNC(strcpy, char *, strcpy, char *dest, const char *src) |
| 77 | EXPORT_FUNC(mdelay, void, mdelay, unsigned long msec) |
Shaohui Xie | fd4d7bb | 2016-09-07 17:56:07 +0800 | [diff] [blame] | 78 | EXPORT_FUNC(memset, void *, memset, void *, int, size_t) |
Prabhakar Kushwaha | 7b3a6bc | 2015-06-28 11:03:59 +0530 | [diff] [blame] | 79 | #ifdef CONFIG_PHY_AQUANTIA |
| 80 | EXPORT_FUNC(mdio_get_current_dev, struct mii_dev *, |
| 81 | mdio_get_current_dev, void) |
| 82 | EXPORT_FUNC(phy_find_by_mask, struct phy_device *, phy_find_by_mask, |
Marek Behún | 3927efb | 2022-04-07 00:33:08 +0200 | [diff] [blame] | 83 | struct mii_dev *bus, unsigned phy_mask) |
Prabhakar Kushwaha | 7b3a6bc | 2015-06-28 11:03:59 +0530 | [diff] [blame] | 84 | EXPORT_FUNC(mdio_phydev_for_ethname, struct phy_device *, |
| 85 | mdio_phydev_for_ethname, const char *ethname) |
| 86 | EXPORT_FUNC(miiphy_set_current_dev, int, miiphy_set_current_dev, |
| 87 | const char *devname) |
| 88 | #endif |