//--------moje
#include <strings.h>
#include <stdbool.h>
+#include <stdlib.h>
#include <bsp/tms570.h>
#include <bsp/tms570-pinmux.h>
#include "arch/cc.h"
static void
tms570_eth_init_set_pinmux(void)
{
+#if defined(__rtems__)
TMS570_IOMM.KICK_REG0 = 0x83E70B13U;
TMS570_IOMM.KICK_REG1 = 0x95A4F1E0U;
TMS570_IOMM.KICK_REG0 = 0;
TMS570_IOMM.KICK_REG1 = 0;
+#endif /*__rtems__*/
}
static err_t
alloc_rq_bytes,
PBUF_POOL);
if (new_pbuf == NULL) {
+ #if defined(__GNUC__) && !defined(__TI_COMPILER_VERSION__)
alloc_rq_bytes = (1 << (30-__builtin_clz(alloc_rq_bytes)));
+ #else /*__GNUC__*/
+ {
+ int n;
+ while ((1 << n) < alloc_rq_bytes)
+ n++;
+ alloc_rq_bytes = 1 << (n - 1);
+ }
+ #endif /*__GNUC__*/
if (alloc_rq_bytes <= PBUF_POOL_BUFSIZE) {
tms570_eth_debug_printf("not enough memory\n");
break;