# HG changeset patch # User asl # Date 1168181214 0 # Node ID 0550d98ae68608327d6923c978ef35e04384e9b8 # Parent 07b0f2be3596dd69521b91fda974d3a24b704a6e * src/dhcp_support.c: * cdl/net.cdl: Added CDL to control the size of the stack used by the DHCP management thread. diff --git a/packages/net/common/current/ChangeLog b/packages/net/common/current/ChangeLog --- a/packages/net/common/current/ChangeLog +++ b/packages/net/common/current/ChangeLog @@ -1,3 +1,10 @@ +2007-01-07 Andrew Lunn + + * src/dhcp_support.c: + * cdl/net.cdl: + Added CDL to control the size of the stack used by + the DHCP management thread. + 2006-12-18 Sergei Gavrikov * tests/ga_server_test.c: Updated flags argument in call of diff --git a/packages/net/common/current/cdl/net.cdl b/packages/net/common/current/cdl/net.cdl --- a/packages/net/common/current/cdl/net.cdl +++ b/packages/net/common/current/cdl/net.cdl @@ -271,6 +271,17 @@ cdl_package CYGPKG_NET { network thread itself." } + cdl_option CYGPKG_NET_DHCP_THREAD_STACK_SIZE { + display "Stack size for DHCP management threads." + flavor data + default_value { "(CYGNUM_HAL_STACK_SIZE_TYPICAL+sizeof(struct bootp))" } + description " + This option controls the size of the stack used for the + DHCP mamagement thread. The default should be + sufficient for most cases but some applications my + require bigger stacks when using for example diag_printf." + } + cdl_option CYGOPT_NET_DHCP_PARM_REQ_LIST_REPLACE { display "Replace DHCP request options" flavor booldata diff --git a/packages/net/common/current/src/dhcp_support.c b/packages/net/common/current/src/dhcp_support.c --- a/packages/net/common/current/src/dhcp_support.c +++ b/packages/net/common/current/src/dhcp_support.c @@ -222,22 +222,21 @@ void dhcp_mgt_entry( cyg_addrword_t loop cyg_handle_t dhcp_mgt_thread_h = 0; cyg_thread dhcp_mgt_thread; -#define STACK_SIZE (CYGNUM_HAL_STACK_SIZE_TYPICAL + sizeof(struct bootp)) -static cyg_uint8 dhcp_mgt_stack[ STACK_SIZE ]; +static cyg_uint8 dhcp_mgt_stack[ CYGPKG_NET_DHCP_THREAD_STACK_SIZE ]; void dhcp_start_dhcp_mgt_thread( void ) { if ( ! dhcp_mgt_thread_h ) { cyg_semaphore_init( &dhcp_needs_attention, 0 ); cyg_thread_create( - CYGPKG_NET_DHCP_THREAD_PRIORITY, /* scheduling info (eg pri) */ - dhcp_mgt_entry, /* entry point function */ + CYGPKG_NET_DHCP_THREAD_PRIORITY, /* scheduling info (eg pri) */ + dhcp_mgt_entry, /* entry point function */ CYGOPT_NET_DHCP_DHCP_THREAD_PARAM, /* entry data */ - "DHCP lease mgt", /* optional thread name */ - dhcp_mgt_stack, /* stack base, NULL = alloc */ - STACK_SIZE, /* stack size, 0 = default */ - &dhcp_mgt_thread_h, /* returned thread handle */ - &dhcp_mgt_thread /* put thread here */ + "DHCP lease mgt", /* optional thread name */ + dhcp_mgt_stack, /* stack base, NULL = alloc */ + CYGPKG_NET_DHCP_THREAD_STACK_SIZE, /* stack size, 0 = default */ + &dhcp_mgt_thread_h, /* returned thread handle */ + &dhcp_mgt_thread /* put thread here */ ); cyg_thread_resume(dhcp_mgt_thread_h);