Changeset 11f3b9a in rtems for bsps/sparc/include


Ignore:
Timestamp:
Nov 26, 2018, 2:55:38 PM (15 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
75e1009f
Parents:
8b59916
git-author:
Sebastian Huber <sebastian.huber@…> (11/26/18 14:55:38)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/21/18 13:54:13)
Message:

bsps/sparc: Add grlib_malloc(), grlib_calloc()

This avoids a dependency to errno in device driver code.

Location:
bsps/sparc/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bsps/sparc/include/bsp/gr1553rt.h

    r8b59916 r11f3b9a  
    7575         * !!Array must at least be of length bd_cnt!!
    7676         */
    77         unsigned short bds[1];          /* Array of BDIDs, -1 unused/end */
     77        unsigned short bds[0];          /* Array of BDIDs */
    7878};
    7979
  • bsps/sparc/include/grlib_impl.h

    r8b59916 r11f3b9a  
    1111
    1212#include <rtems/score/basedefs.h>
     13#include <rtems/malloc.h>
    1314
    1415/*
     
    6465#endif
    6566
     67#if (((__RTEMS_MAJOR__ << 16) | (__RTEMS_MINOR__ << 8) | __RTEMS_REVISION__) >= 0x050000)
     68
     69RTEMS_INLINE_ROUTINE void *grlib_malloc(size_t size)
     70{
     71 return rtems_malloc(size);
     72}
     73
     74RTEMS_INLINE_ROUTINE void *grlib_calloc(size_t nelem, size_t elsize)
     75{
     76 return rtems_calloc(nelem, elsize);
     77}
     78
     79#else
     80
     81RTEMS_INLINE_ROUTINE void *grlib_malloc(size_t size)
     82{
     83 return malloc(size);
     84}
     85
     86RTEMS_INLINE_ROUTINE void *grlib_calloc(size_t nelem, size_t elsize)
     87{
     88 return calloc(nelem, elsize);
     89}
     90
     91#endif
     92
    6693#ifdef __cplusplus
    6794}
Note: See TracChangeset for help on using the changeset viewer.