minor optimizations

This commit is contained in:
Stefan Lankes 2011-10-16 22:10:04 -07:00
parent 4ec5d69ed6
commit 14d3aba6ed

View file

@ -132,14 +132,6 @@ static struct netif* mynetif;
inline static void* memcpy_from_nc(void *dest, const void *src, size_t count)
{
#if 0
size_t i;
for(i=0; i<count; i++)
((uint8_t*) dest)[i] = ((uint8_t*) src)[i];
return dest;
#else
int32_t h, i, j, k, l, m;
asm volatile ("cld;\n\t"
@ -173,19 +165,10 @@ inline static void* memcpy_from_nc(void *dest, const void *src, size_t count)
: "0"(count / 32), "1"(dest), "2"(src), "3"(count) : "memory","cc");
return dest;
#endif
}
inline static void* memcpy_to_nc(void* dest, const void *src, size_t count)
{
#if 0
size_t i;
for(i=0; i<count; i++)
((uint8_t*) dest)[i] = ((uint8_t*) src)[i];
return dest;
#else
int32_t i, j, k;
asm volatile (
@ -197,7 +180,6 @@ inline static void* memcpy_to_nc(void* dest, const void *src, size_t count)
: "0"(count/4), "g"(count), "1"(dest), "2"(src) : "memory","cc");
return dest;
#endif
}
static int read_emac(int num_emac, int offset, int core)
@ -412,7 +394,7 @@ again:
length = U16(addr);
// Check for over/underflow
if ((length < 20) || (length > 1536)) {
if (BUILTIN_EXPECT((length < 20) || (length > 1536), 0)) {
LWIP_DEBUGF(NETIF_DEBUG, ("rckemacif_rx_handler(): illegal packet length %d => drop\n", length));
LWIP_DEBUGF(NETIF_DEBUG, ("start read at %d; write_offset at %d; addr: %p, packet len: %d\n", read_offset, write_offset, addr, length));
@ -443,7 +425,7 @@ again:
//LWIP_DEBUGF(NETIF_DEBUG, ("length %u, read_offset %u, write_offset %u\n", length, read_offset, write_offset));
p = pbuf_alloc(PBUF_RAW, length, PBUF_POOL);
if (p) {
if (BUILTIN_EXPECT(p != NULL, 1)) {
#if ETH_PAD_SIZE
pbuf_header(p, -ETH_PAD_SIZE); /* drop the padding word */
#endif