?????????????е???????????????????????ж??????????????????????????????????ɡ???????????????????????????????????????????????????????????????????????Щ??????????ж????????????????????????????????????????????????????????????????????????bitmap?????????????????????????????bit_search_first_one?????????????????bitmap???飬????????????????????????????????????μ?????????????????????????????????????????????

/*For 32 bit cpu*/
 RAW_S32 bit_search_first_one(RAW_U32 *base?? RAW_S32 offset??  RAW_S32 width)
 {
     register RAW_U32 *cp?? v;
     register RAW_S32 position;
 
     cp = base;
     cp += offset >> 5;
   
     if (offset & 31) {
 #if (CONFIG_RAW_LITTLE_ENDIAN > 0)
         v = *cp & ~(((RAW_U32)1 << (offset & 31)) - 1);
 #else
     v = *cp & (((RAW_U32)1 << (32 - (offset & 31))) - 1);
 #endif
     }
   
  else {
         v = *cp;
     }
 
     position = 0;
     while (position < width) {
         if (v) {            /* includes 1 --> search bit of 1 */
             if (!position) position -= (offset & 31);
       
 #if  (CONFIG_RAW_LITTLE_ENDIAN > 0)
 
     if (!(v & 0xffff)) {
                 v >>= 16;
                 position += 16;
             }
             if (!(v & 0xff)) {
                 v >>= 8;
                 position += 8;
             }
             if (!(v & 0xf)) {
                 v >>= 4;
                 position += 4;
             }
             if (!(v & 0x3)) {
                 v >>= 2;
                 position += 2;
             }
             if (!(v & 0x1)) {
                 ++position;
             }
            
 #else
           
    if (!(v & 0xffff0000)) {
     v <<= 16;
     position += 16;
    }
    
    if (!(v & 0xff000000)) {
     v <<= 8;
     position += 8;
    }
    
    if (!(v & 0xf0000000)) {
     v <<= 4;
     position += 4;
    }
    
    if (!(v & 0xc0000000)) {
     v <<= 2;
     position += 2;
    }
    
    if (!(v & 0x80000000)) {
     ++position;
    }
       
 #endif
             if (position < width) {
        
                 return position;
         
             } else {
      
                 return -1;
         
             }
         } else {              /* all bits are 0 --> 1 Word skip */
             if (position) {
                 position += 32;
             } else {
                 position = 32 - (offset & 31);
             }
             v = *++cp;
         }
     }
 
     return -1;
 }

???????????????????????????????32λcpu??????????8λcpu????????????????????????????????Σ?????????????????С????????С????x86????cpu???????powerpc????cpu?????????????????????????????????????????????????????ucos?????????????????????????????????????豸???????????????????????治????????????????????д???????????????????????????????????