Changeset 2486c492 in rtems


Ignore:
Timestamp:
Dec 16, 2013, 7:36:18 PM (5 years ago)
Author:
javamonn <javamonn@…>
Branches:
4.11, master
Children:
2f16001
Parents:
50a50313
git-author:
javamonn <javamonn@…> (12/16/13 19:36:18)
git-committer:
Gedare Bloom <gedare@…> (01/22/15 21:15:42)
Message:

grspw: descriptor tables no longer statically allocated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/shared/spw/grspw.c

    r50a50313 r2486c492  
    8585#include <ctype.h>
    8686#include <rtems/bspIo.h>
     87#include <rtems/malloc.h>
    8788#include <ambapp.h>
    8889#include <grlib.h>
     
    149150
    150151#define BUFMEM_PER_LINK (SPACEWIRE_TXBUFS_NR*(SPACEWIRE_TXD_SIZE+SPACEWIRE_TXH_SIZE) + SPACEWIRE_RXBUFS_NR*SPACEWIRE_RXPCK_SIZE)
    151 
    152 #define SPW_ALIGN(p,c) ((((unsigned int)(p))+((c)-1))&~((c)-1))
    153152
    154153typedef struct {
     
    191190#ifdef GRSPW_STATIC_MEM
    192191   unsigned int membase, memend, mem_bdtable;
    193 #else
    194    char _rxtable[SPACEWIRE_BDTABLE_SIZE*2];
    195    char _txtable[SPACEWIRE_BDTABLE_SIZE*2];
    196192#endif
    197193
     
    13841380        pDev->tx = (SPACEWIRE_RXBD *) pDev->mem_bdtable + SPACEWIRE_BDTABLE_SIZE;
    13851381#else
    1386         pDev->rx = (SPACEWIRE_RXBD *) SPW_ALIGN(&pDev->_rxtable, SPACEWIRE_BDTABLE_SIZE);
    1387         pDev->tx = (SPACEWIRE_TXBD *) SPW_ALIGN(&pDev->_txtable, SPACEWIRE_BDTABLE_SIZE);
     1382        pDev->rx = (SPACEWIRE_RXBD *) rtems_heap_allocate_aligned_with_boundry( SPACEWIRE_BDTABLE_SIZE, 1024, 0 );
     1383        pDev->tx = (SPACEWIRE_TXBD *) rtems_heap_allocate_aligned_with_boundry( SPACEWIRE_BDTABLE_SIZE, 1024, 0 );
    13881384#endif
    13891385        SPACEWIRE_DBG("hw_init [minor %i]\n", pDev->minor);
     
    14261422                         SPW_STATUS_WE | SPW_STATUS_IA | SPW_STATUS_EE); /*clear status*/
    14271423        SPW_CTRL_WRITE(pDev, SPW_CTRL_LINKSTART); /*start link core*/
     1424        #ifndef GRSPW_STATIC_MEM
     1425                free(pDev->rx);
     1426                free(pDec->tx);
     1427        #endif
    14281428}
    14291429
Note: See TracChangeset for help on using the changeset viewer.