mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-08 00:23:14 +00:00
2006-09-01 Joel Sherrill <joel@OARcorp.com>
* libcsupport/src/malloc.c, libnetworking/rtems/rtems_glue.c, libnetworking/sys/mbuf.h: Remove warnings -- use uintptr_t or properly sized integers.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2006-09-01 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
|
* libcsupport/src/malloc.c, libnetworking/rtems/rtems_glue.c,
|
||||||
|
libnetworking/sys/mbuf.h: Remove warnings -- use uintptr_t or
|
||||||
|
properly sized integers.
|
||||||
|
|
||||||
2006-08-30 Joel Sherrill <joel@OARcorp.com>
|
2006-08-30 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
* ftpd/ftpd.c, libcsupport/include/sys/ioccom.h,
|
* ftpd/ftpd.c, libcsupport/include/sys/ioccom.h,
|
||||||
|
|||||||
@@ -111,8 +111,8 @@ void RTEMS_Malloc_Initialize(
|
|||||||
{
|
{
|
||||||
rtems_status_code status;
|
rtems_status_code status;
|
||||||
void *starting_address;
|
void *starting_address;
|
||||||
uint32_t old_address;
|
uintptr_t old_address;
|
||||||
uint32_t u32_address;
|
uintptr_t uaddress;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize the garbage collection list to start with nothing on it.
|
* Initialize the garbage collection list to start with nothing on it.
|
||||||
@@ -129,25 +129,25 @@ void RTEMS_Malloc_Initialize(
|
|||||||
RTEMS_Malloc_Sbrk_amount = sbrk_amount;
|
RTEMS_Malloc_Sbrk_amount = sbrk_amount;
|
||||||
|
|
||||||
if (!starting_address) {
|
if (!starting_address) {
|
||||||
u32_address = (unsigned int)sbrk(length);
|
uaddress = (uintptr_t)sbrk(length);
|
||||||
|
|
||||||
if (u32_address == (uint32_t ) -1) {
|
if (uaddress == (uintptr_t) -1) {
|
||||||
rtems_fatal_error_occurred( RTEMS_NO_MEMORY );
|
rtems_fatal_error_occurred( RTEMS_NO_MEMORY );
|
||||||
/* DOES NOT RETURN!!! */
|
/* DOES NOT RETURN!!! */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (u32_address & (CPU_HEAP_ALIGNMENT-1)) {
|
if (uaddress & (CPU_HEAP_ALIGNMENT-1)) {
|
||||||
old_address = u32_address;
|
old_address = uaddress;
|
||||||
u32_address = (u32_address + CPU_HEAP_ALIGNMENT) & ~(CPU_HEAP_ALIGNMENT-1);
|
uaddress = (uaddress + CPU_HEAP_ALIGNMENT) & ~(CPU_HEAP_ALIGNMENT-1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* adjust the length by whatever we aligned by
|
* adjust the length by whatever we aligned by
|
||||||
*/
|
*/
|
||||||
|
|
||||||
length -= u32_address - old_address;
|
length -= uaddress - old_address;
|
||||||
}
|
}
|
||||||
|
|
||||||
starting_address = (void *)u32_address;
|
starting_address = (void *)uaddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ void sysctl_register_all(void *arg);
|
|||||||
/*
|
/*
|
||||||
* Memory allocation
|
* Memory allocation
|
||||||
*/
|
*/
|
||||||
static int nmbuf = (64 * 1024) / MSIZE;
|
static uint32_t nmbuf = (64L * 1024L) / MSIZE;
|
||||||
int nmbclusters = (128 * 1024) / MCLBYTES;
|
uint32_t nmbclusters = (128L * 1024L) / MCLBYTES;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Network task synchronization
|
* Network task synchronization
|
||||||
@@ -175,7 +175,7 @@ bsd_init (void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
p = rtems_bsdnet_malloc_mbuf(nmbuf * MSIZE + MSIZE - 1,MBUF_MALLOC_MBUF);
|
p = rtems_bsdnet_malloc_mbuf(nmbuf * MSIZE + MSIZE - 1,MBUF_MALLOC_MBUF);
|
||||||
p = (char *)(((unsigned int)p + MSIZE - 1) & ~(MSIZE - 1));
|
p = (char *)(((uintptr_t)p + MSIZE - 1) & ~(MSIZE - 1));
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
printf ("Can't get network memory.\n");
|
printf ("Can't get network memory.\n");
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -404,8 +404,8 @@ union mcluster {
|
|||||||
extern struct mbuf *mbutl; /* virtual address of mclusters */
|
extern struct mbuf *mbutl; /* virtual address of mclusters */
|
||||||
extern char *mclrefcnt; /* cluster reference counts */
|
extern char *mclrefcnt; /* cluster reference counts */
|
||||||
extern struct mbstat mbstat;
|
extern struct mbstat mbstat;
|
||||||
extern int nmbclusters;
|
extern uint32_t nmbclusters;
|
||||||
extern int nmbufs;
|
extern uint32_t nmbufs;
|
||||||
extern struct mbuf *mmbfree;
|
extern struct mbuf *mmbfree;
|
||||||
extern union mcluster *mclfree;
|
extern union mcluster *mclfree;
|
||||||
extern int max_linkhdr; /* largest link-level header */
|
extern int max_linkhdr; /* largest link-level header */
|
||||||
|
|||||||
Reference in New Issue
Block a user