summaryrefslogtreecommitdiffstats
path: root/bsps/sparc/shared/tmtc/grtc.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-11-26 15:55:38 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-12-21 14:54:13 +0100
commit11f3b9a535ced87882a9792b01b3b7800d355482 (patch)
tree7e641e16744706f9d72a411e775429a30a7b02e5 /bsps/sparc/shared/tmtc/grtc.c
parentspcxx01: Add test case (diff)
downloadrtems-11f3b9a535ced87882a9792b01b3b7800d355482.tar.bz2
bsps/sparc: Add grlib_malloc(), grlib_calloc()
This avoids a dependency to errno in device driver code.
Diffstat (limited to '')
-rw-r--r--bsps/sparc/shared/tmtc/grtc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/bsps/sparc/shared/tmtc/grtc.c b/bsps/sparc/shared/tmtc/grtc.c
index 4e877465ab..35f67f6a4c 100644
--- a/bsps/sparc/shared/tmtc/grtc.c
+++ b/bsps/sparc/shared/tmtc/grtc.c
@@ -15,7 +15,6 @@
#include <string.h>
#include <assert.h>
#include <ctype.h>
-#include <malloc.h>
#include <rtems/bspIo.h>
#include <drvmgr/drvmgr.h>
@@ -617,7 +616,7 @@ static int grtc_data_avail(struct grtc_priv *pDev)
static void *grtc_memalign(unsigned int boundary, unsigned int length, void *realbuf)
{
- *(int *)realbuf = (int)malloc(length+(~GRTC_ASR_BUFST)+1);
+ *(int *)realbuf = (int)grlib_malloc(length+(~GRTC_ASR_BUFST)+1);
DBG("GRTC: Alloced %d (0x%x) bytes, requested: %d\n",length+(~GRTC_ASR_BUFST)+1,length+(~GRTC_ASR_BUFST)+1,length);
return (void *)(((*(unsigned int *)realbuf)+(~GRTC_ASR_BUFST)+1) & ~(boundary-1));
}
@@ -1779,7 +1778,7 @@ static rtems_device_driver grtc_ioctl(rtems_device_major_number major, rtems_dev
if ( pDev->pools ) {
free(pDev->pools);
}
- pDev->pools = malloc(pocfg->pool_cnt * sizeof(struct grtc_frame_pool));
+ pDev->pools = grlib_malloc(pocfg->pool_cnt * sizeof(*pDev->pools));
if ( !pDev->pools ) {
pDev->pool_cnt = 0;
return RTEMS_NO_MEMORY;