Changeset c48572d9 in rtems


Ignore:
Timestamp:
May 31, 2010, 1:27:07 PM (9 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, master
Children:
eea48e2f
Parents:
2d76aa8
Message:

2010-05-31 Ralf Corsépius <ralf.corsepius@…>

  • libchip/network/greth.c: Misc. hacks to allow compilation on 16bit targets.
Location:
c/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/ChangeLog

    r2d76aa8 rc48572d9  
     12010-05-31      Ralf Corsépius <ralf.corsepius@rtems.org>
     2
     3        * libchip/network/greth.c: Misc. hacks to allow compilation on
     4        16bit targets.
     5
    162010-05-31      Ralf Corsépius <ralf.corsepius@rtems.org>
    27
  • c/src/libchip/network/greth.c

    r2d76aa8 rc48572d9  
    170170        char *tmp;
    171171        tmp = calloc(1,2*sz);
    172         tmp = (char *) (((int)tmp+sz) & ~(sz -1));
     172        tmp = (char *) (((uintptr_t)tmp+sz) & ~(sz -1));
    173173        return(tmp);
    174174}
     
    417417    sc->tx_cnt = 0;
    418418    sc->rx_ptr = 0;
    419     regs->txdesc = (int) sc->txdesc;
    420     regs->rxdesc = (int) sc->rxdesc;
     419    regs->txdesc = (uintptr_t) sc->txdesc;
     420    regs->rxdesc = (uintptr_t) sc->rxdesc;
    421421
    422422    sc->rxmbuf = calloc(sc->rxbufs, sizeof(*sc->rxmbuf));
     
    453453    regs->mac_addr_msb =
    454454      sc->arpcom.ac_enaddr[0] << 8 | sc->arpcom.ac_enaddr[1];
    455     regs->mac_addr_lsb =
    456       sc->arpcom.ac_enaddr[2] << 24 | sc->arpcom.ac_enaddr[3] << 16 |
    457       sc->arpcom.ac_enaddr[4] << 8 | sc->arpcom.ac_enaddr[5];
     455
     456    uint32_t mac_addr_lsb;
     457    mac_addr_lsb = sc->arpcom.ac_enaddr[2];
     458    mac_addr_lsb <<= 8;
     459    mac_addr_lsb |= sc->arpcom.ac_enaddr[3];
     460    mac_addr_lsb <<= 8;
     461    mac_addr_lsb |= sc->arpcom.ac_enaddr[4];
     462    mac_addr_lsb <<= 8;
     463    mac_addr_lsb |= sc->arpcom.ac_enaddr[5];
     464    regs->mac_addr_lsb = mac_addr_lsb;
    458465
    459466    /* install interrupt vector */
Note: See TracChangeset for help on using the changeset viewer.