Changeset b82a4b4 in rtems


Ignore:
Timestamp:
Mar 6, 2019, 12:06:27 PM (6 weeks ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
85d5f6c
Parents:
847638a
git-author:
Sebastian Huber <sebastian.huber@…> (03/06/19 12:06:27)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/06/19 12:07:17)
Message:

bsp/atsam: Optimize XDMAD_Handler()

Load the channel interrupt mask only once.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bsps/arm/atsam/contrib/libraries/libchip/source/xdmad.c

    r847638a rb82a4b4  
    308308        sXdmad *pDmad;
    309309        Xdmac *pXdmac;
    310         sXdmadChannel *pCh;
    311         uint32_t xdmaChannelIntStatus, xdmaGlobaIntStatus, xdmaGlobalChStatus;
    312         uint8_t bExec;
    313         uint8_t _iChannel;
     310        uint32_t xdmaGlobaIntStatus, xdmaGlobalChStatus;
    314311
    315312        pDmad = arg;
     
    319316
    320317        while (xdmaGlobaIntStatus != 0) {
     318                uint8_t _iChannel;
     319                sXdmadChannel *pCh;
     320                uint8_t bExec;
     321
    321322                _iChannel = 31 - __builtin_clz(xdmaGlobaIntStatus);
    322                 xdmaGlobaIntStatus &= ~(UINT32_C(1) << _iChannel);
    323 
    324323                pCh = &pDmad->XdmaChannels[_iChannel];
    325324                bExec = 0;
    326325
     326                xdmaGlobaIntStatus &= ~(UINT32_C(1) << _iChannel);
     327
    327328                if ((xdmaGlobalChStatus & (XDMAC_GS_ST0 << _iChannel)) == 0) {
    328                         xdmaChannelIntStatus = XDMAC_GetMaskChannelIsr(pXdmac, _iChannel);
     329                        uint32_t xdmaChannelIntMask;
     330                        uint32_t xdmaChannelIntStatus;
     331
     332                        xdmaChannelIntMask = XDMAC_GetChannelItMask(pXdmac, _iChannel);
     333                        xdmaChannelIntStatus = XDMAC_GetChannelIsr(pXdmac, _iChannel);
     334                        xdmaChannelIntStatus &= xdmaChannelIntMask;
    329335
    330336                        if (xdmaChannelIntStatus & XDMAC_CIS_BIS) {
    331                                 if ((XDMAC_GetChannelItMask(pXdmac, _iChannel) & XDMAC_CIM_LIM) == 0) {
     337                                if ((xdmaChannelIntMask & XDMAC_CIM_LIM) == 0) {
    332338                                        pCh->state = XDMAD_STATE_DONE;
    333339                                        bExec = 1;
Note: See TracChangeset for help on using the changeset viewer.