diff options
author | Shaun Ruffell <sruffell@digium.com> | 2011-02-10 16:22:55 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2011-02-10 16:22:55 +0000 |
commit | 56fd3bd04747080f5998dbd3e6b60ef9c0ab08b9 (patch) | |
tree | da1a2dfaae68be280186ce82f6ebe5125320a26b /drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.c | |
parent | 297c3d20046a3e52526934c8916a0d4e9289c906 (diff) |
wct4xxp: Reduce stack usage in oct612x API.
Reduce the stack usage by replacing the mOCT6100_RETRIEVE_NLP_CONF_DWORD
and mOCT6100_SAVE_NLP_CONF_DWORD macros with functions. Some compilers
do a better job of optimizing the local variables declared in those
macros than others.
For example, with gcc 4.3.0, running
]# make stackcheck | grep Oct6100 | head -n 20 | sed -e 's/^0\S* //g' | uniq
Before:
Oct6100ApiWriteVqeNlpMemory [wct4xxp]: 1112
Oct6100ApiInvalidateChanPlayoutStructs [wct4xxp]:520
Oct6100ApiSetChannelLevelControl [wct4xxp]: 392
Oct6100ApiBridgeEventRemove [wct4xxp]: 344
Oct6100ApiDebugChannelOpen [wct4xxp]: 312
Oct6100ApiWriteVqeAfMemory [wct4xxp]: 296
Oct6100ApiSetChannelTailConfiguration [wct4xxp]:264
Oct6100ApiRandomMemoryWrite [wct4xxp]: 248
Oct6100ApiTransferToneEvents [wct4xxp]: 248
Oct6100ApiModifyChannelStructs [wct4xxp]: 232
After:
Oct6100ApiBridgeEventRemove [wct4xxp]: 344
Oct6100ApiDebugChannelOpen [wct4xxp]: 312
Oct6100ApiRandomMemoryWrite [wct4xxp]: 248
Oct6100ApiTransferToneEvents [wct4xxp]: 248
Oct6100ApiInvalidateChanPlayoutStructs [wct4xxp]:248
Oct6100ApiModifyChannelStructs [wct4xxp]: 232
Oct6100ApiBridgeRemoveParticipantFromChannel [wct4xxp]:216
Oct6100ApiWriteVqeNlpMemory [wct4xxp]: 200
Oct6100ApiInitChannels [wct4xxp]: 168
Oct6100ApiProgramNLP [wct4xxp]: 168
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9751 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.c')
-rw-r--r-- | drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.c b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.c index 63c458a..1fc539e 100644 --- a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.c +++ b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.c @@ -2703,11 +2703,10 @@ UINT32 Oct6100ApiBridgeEventAdd( UINT32 ulFeatureBitOffset = pSharedInfo->MemoryMap.RinLevelControlOfst.byBitOffset; UINT32 ulFeatureFieldLength = pSharedInfo->MemoryMap.RinLevelControlOfst.byFieldSize; - mOCT6100_RETRIEVE_NLP_CONF_DWORD( f_pApiInstance, + ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance, pEchoChanEntry, ulBaseAddress + ulFeatureBytesOffset, - &ulTempData, - ulResult ); + &ulTempData); if ( ulResult != cOCT6100_ERR_OK ) return ulResult; @@ -2720,11 +2719,10 @@ UINT32 Oct6100ApiBridgeEventAdd( ulTempData |= ( cOCT6100_PASS_THROUGH_LEVEL_CONTROL << ulFeatureBitOffset ); /* First read the DWORD where the field is located. */ - mOCT6100_SAVE_NLP_CONF_DWORD( f_pApiInstance, + ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance, pEchoChanEntry, ulBaseAddress + ulFeatureBytesOffset, - ulTempData, - ulResult ); + ulTempData); if ( ulResult != cOCT6100_ERR_OK ) return ulResult; } @@ -7583,11 +7581,10 @@ UINT32 Oct6100ApiBridgeSetDominantSpeaker( ulFeatureFieldLength = f_pApiInstance->pSharedInfo->MemoryMap.DominantSpeakerFieldOfst.byFieldSize; /* Retrieve the current configuration. */ - mOCT6100_RETRIEVE_NLP_CONF_DWORD( f_pApiInstance, + ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance, pEchoChanEntry, ulBaseAddress + ulFeatureBytesOffset, - &ulTempData, - ulResult ); + &ulTempData); if ( ulResult != cOCT6100_ERR_OK ) return ulResult; @@ -7598,11 +7595,10 @@ UINT32 Oct6100ApiBridgeSetDominantSpeaker( ulTempData |= ( ( f_usDominantSpeakerIndex ) << ulFeatureBitOffset ); /* Save the new dominant speaker. */ - mOCT6100_SAVE_NLP_CONF_DWORD( f_pApiInstance, + ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance, pEchoChanEntry, ulBaseAddress + ulFeatureBytesOffset, - ulTempData, - ulResult ); + ulTempData); if ( ulResult != cOCT6100_ERR_OK ) return ulResult; |