blob: f6df8b610734bc8f03a26d738276aca48b1ef5c8 [file] [log] [blame]
Mike Frysinger53c65742009-07-23 16:37:48 -04001/*
Martin Dorwigcb2c2862015-01-26 15:22:54 -07002 * You need to use #ifdef around functions that may not exist
Mike Frysinger53c65742009-07-23 16:37:48 -04003 * in the final configuration (such as i2c).
Martin Dorwigcb2c2862015-01-26 15:22:54 -07004 * use a dummyfunction as first parameter to EXPORT_FUNC.
5 * As an example see the CONFIG_CMD_I2C section below
Mike Frysinger53c65742009-07-23 16:37:48 -04006 */
Martin Dorwigcb2c2862015-01-26 15:22:54 -07007#ifndef EXPORT_FUNC
8#define EXPORT_FUNC(a, b, c, ...)
9#endif
10 EXPORT_FUNC(get_version, unsigned long, get_version, void)
Heinrich Schuchardtc4954fb2020-10-07 18:11:48 +020011 EXPORT_FUNC(getchar, int, getc, void)
Martin Dorwigcb2c2862015-01-26 15:22:54 -070012 EXPORT_FUNC(tstc, int, tstc, void)
13 EXPORT_FUNC(putc, void, putc, const char)
14 EXPORT_FUNC(puts, void, puts, const char *)
15 EXPORT_FUNC(printf, int, printf, const char*, ...)
Simon Glasscd2c5212016-09-25 21:33:31 -060016#if (defined(CONFIG_X86) && !defined(CONFIG_X86_64)) || defined(CONFIG_PPC)
Martin Dorwigcb2c2862015-01-26 15:22:54 -070017 EXPORT_FUNC(irq_install_handler, void, install_hdlr,
18 int, interrupt_handler_t, void*)
19
20 EXPORT_FUNC(irq_free_handler, void, free_hdlr, int)
21#else
22 EXPORT_FUNC(dummy, void, install_hdlr, void)
23 EXPORT_FUNC(dummy, void, free_hdlr, void)
24#endif
25 EXPORT_FUNC(malloc, void *, malloc, size_t)
Hans de Goede9f9df6f2015-09-13 14:45:15 +020026#if !CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE)
Martin Dorwigcb2c2862015-01-26 15:22:54 -070027 EXPORT_FUNC(free, void, free, void *)
Simon Glassf5f2b0e2015-03-03 08:03:01 -070028#endif
Martin Dorwigcb2c2862015-01-26 15:22:54 -070029 EXPORT_FUNC(udelay, void, udelay, unsigned long)
30 EXPORT_FUNC(get_timer, unsigned long, get_timer, unsigned long)
31 EXPORT_FUNC(vprintf, int, vprintf, const char *, va_list)
Simon Glassed38aef2020-05-10 11:40:03 -060032 EXPORT_FUNC(do_reset, int, do_reset, struct cmd_tbl *,
Martin Dorwigcb2c2862015-01-26 15:22:54 -070033 int , int , char * const [])
Simon Glass64b723f2017-08-03 12:22:12 -060034 EXPORT_FUNC(env_get, char *, env_get, const char*)
Simon Glass6a38e412017-08-03 12:22:09 -060035 EXPORT_FUNC(env_set, int, env_set, const char *, const char *)
Martin Dorwigcb2c2862015-01-26 15:22:54 -070036 EXPORT_FUNC(simple_strtoul, unsigned long, simple_strtoul,
37 const char *, char **, unsigned int)
38 EXPORT_FUNC(strict_strtoul, int, strict_strtoul,
39 const char *, unsigned int , unsigned long *)
40 EXPORT_FUNC(simple_strtol, long, simple_strtol,
41 const char *, char **, unsigned int)
42 EXPORT_FUNC(strcmp, int, strcmp, const char *cs, const char *ct)
Igor Opaniukf7c91762021-02-09 13:52:45 +020043#if defined(CONFIG_CMD_I2C) && !CONFIG_IS_ENABLED(DM_I2C)
Martin Dorwigcb2c2862015-01-26 15:22:54 -070044 EXPORT_FUNC(i2c_write, int, i2c_write, uchar, uint, int , uchar * , int)
45 EXPORT_FUNC(i2c_read, int, i2c_read, uchar, uint, int , uchar * , int)
46#else
47 EXPORT_FUNC(dummy, void, i2c_write, void)
48 EXPORT_FUNC(dummy, void, i2c_read, void)
49#endif
50
51#if !defined(CONFIG_CMD_SPI) || defined(CONFIG_DM_SPI)
Martin Dorwigcb2c2862015-01-26 15:22:54 -070052 EXPORT_FUNC(dummy, void, spi_setup_slave, void)
53 EXPORT_FUNC(dummy, void, spi_free_slave, void)
54#else
Martin Dorwigcb2c2862015-01-26 15:22:54 -070055 EXPORT_FUNC(spi_setup_slave, struct spi_slave *, spi_setup_slave,
56 unsigned int, unsigned int, unsigned int, unsigned int)
57 EXPORT_FUNC(spi_free_slave, void, spi_free_slave, struct spi_slave *)
58#endif
59#ifndef CONFIG_CMD_SPI
60 EXPORT_FUNC(dummy, void, spi_claim_bus, void)
61 EXPORT_FUNC(dummy, void, spi_release_bus, void)
62 EXPORT_FUNC(dummy, void, spi_xfer, void)
63#else
64 EXPORT_FUNC(spi_claim_bus, int, spi_claim_bus, struct spi_slave *)
65 EXPORT_FUNC(spi_release_bus, void, spi_release_bus, struct spi_slave *)
66 EXPORT_FUNC(spi_xfer, int, spi_xfer, struct spi_slave *,
67 unsigned int, const void *, void *, unsigned long)
68#endif
69 EXPORT_FUNC(ustrtoul, unsigned long, ustrtoul,
70 const char *, char **, unsigned int)
71 EXPORT_FUNC(ustrtoull, unsigned long long, ustrtoull,
72 const char *, char **, unsigned int)
Prabhakar Kushwaha7b3a6bc2015-06-28 11:03:59 +053073 EXPORT_FUNC(strcpy, char *, strcpy, char *dest, const char *src)
74 EXPORT_FUNC(mdelay, void, mdelay, unsigned long msec)
Shaohui Xiefd4d7bb2016-09-07 17:56:07 +080075 EXPORT_FUNC(memset, void *, memset, void *, int, size_t)
Prabhakar Kushwaha7b3a6bc2015-06-28 11:03:59 +053076#ifdef CONFIG_PHY_AQUANTIA
77 EXPORT_FUNC(mdio_get_current_dev, struct mii_dev *,
78 mdio_get_current_dev, void)
79 EXPORT_FUNC(phy_find_by_mask, struct phy_device *, phy_find_by_mask,
Marek BehĂșn3927efb2022-04-07 00:33:08 +020080 struct mii_dev *bus, unsigned phy_mask)
Prabhakar Kushwaha7b3a6bc2015-06-28 11:03:59 +053081 EXPORT_FUNC(mdio_phydev_for_ethname, struct phy_device *,
82 mdio_phydev_for_ethname, const char *ethname)
83 EXPORT_FUNC(miiphy_set_current_dev, int, miiphy_set_current_dev,
84 const char *devname)
85#endif