diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-03-09 21:12:20 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-03-09 21:12:20 +0000 |
commit | dda5be5c1fc672b5d9cb3a910b5e0cb0a41046c5 (patch) | |
tree | 0af32db840a032a50312791977b7d129def1d5b3 /nuttx/net | |
parent | 2ac33dcffabd9422659c3b013ed8624c09ae90e4 (diff) | |
download | px4-nuttx-dda5be5c1fc672b5d9cb3a910b5e0cb0a41046c5.tar.gz px4-nuttx-dda5be5c1fc672b5d9cb3a910b5e0cb0a41046c5.tar.bz2 px4-nuttx-dda5be5c1fc672b5d9cb3a910b5e0cb0a41046c5.zip |
More changes for a kernel-mode allocator (more to be done)
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5724 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/net')
-rw-r--r-- | nuttx/net/uip/uip_igmpgroup.c | 8 | ||||
-rw-r--r-- | nuttx/net/uip/uip_tcpbacklog.c | 7 | ||||
-rw-r--r-- | nuttx/net/uip/uip_tcpreadahead.c | 4 |
3 files changed, 10 insertions, 9 deletions
diff --git a/nuttx/net/uip/uip_igmpgroup.c b/nuttx/net/uip/uip_igmpgroup.c index b92db5476..a530f954c 100644 --- a/nuttx/net/uip/uip_igmpgroup.c +++ b/nuttx/net/uip/uip_igmpgroup.c @@ -2,7 +2,7 @@ * net/uip/uip_igmpgroup.c * IGMP group data structure management logic * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2010, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * The NuttX implementation of IGMP was inspired by the IGMP add-on for the @@ -114,7 +114,7 @@ * Private Data ****************************************************************************/ -/* malloc() cannot be called from an interrupt handler. To work around this, +/* kmalloc() cannot be called from an interrupt handler. To work around this, * a small number of IGMP groups are preallocated just for use in interrupt * handling logic. */ @@ -139,13 +139,13 @@ static FAR sq_queue_t g_freelist; * Allocate a new group from heap memory. * * Assumptions: - * Calls malloc and so cannot be called from an interrupt handler. + * Calls kmalloc and so cannot be called from an interrupt handler. * ****************************************************************************/ static inline FAR struct igmp_group_s *uip_grpheapalloc(void) { - return (FAR struct igmp_group_s *)zalloc(sizeof(struct igmp_group_s)); + return (FAR struct igmp_group_s *)kzalloc(sizeof(struct igmp_group_s)); } /**************************************************************************** diff --git a/nuttx/net/uip/uip_tcpbacklog.c b/nuttx/net/uip/uip_tcpbacklog.c index 459d54312..068e7a8eb 100644 --- a/nuttx/net/uip/uip_tcpbacklog.c +++ b/nuttx/net/uip/uip_tcpbacklog.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/uip/uip_tcpbacklog.c * - * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2011-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -46,6 +46,7 @@ #include <queue.h> #include <debug.h> +#include <nuttx/kmalloc.h> #include <nuttx/net/uip/uip.h> #include <nuttx/net/uip/uip-tcp.h> @@ -113,7 +114,7 @@ int uip_backlogcreate(FAR struct uip_conn *conn, int nblg) /* Then allocate that much */ - bls = (FAR struct uip_backlog_s *)zalloc(size); + bls = (FAR struct uip_backlog_s *)kzalloc(size); if (!bls) { nlldbg("Failed to allocate backlog\n"); @@ -203,7 +204,7 @@ int uip_backlogdestroy(FAR struct uip_conn *conn) /* Then free the entire backlog structure */ - free(blg); + lib_free(blg); } return OK; diff --git a/nuttx/net/uip/uip_tcpreadahead.c b/nuttx/net/uip/uip_tcpreadahead.c index a304925a8..dadb809cc 100644 --- a/nuttx/net/uip/uip_tcpreadahead.c +++ b/nuttx/net/uip/uip_tcpreadahead.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/uip/uip_tcpreadahead.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -96,7 +96,7 @@ void uip_tcpreadaheadinit(void) * Allocate a TCP read-ahead buffer by taking a pre-allocated buffer from * the free list. This function is called from TCP logic when new, * incoming TCP data is received but there is no user logic recving the - * the data. Note: malloc() cannot be used because this function is + * the data. Note: kmalloc() cannot be used because this function is * called from interrupt level. * * Assumptions: |