VOID AppendCSDNum ( DEVICE_CONSIST_MAPPING_INFO *MappingItem, UINT64 Num ) { ASSERT(MappingItem != NULL); if (MappingItem->Digital) { CatPrint (&MappingItem->CSD, L"%ld", Num); } else { AppendCSDNum2 (&MappingItem->CSD, Num); } MappingItem->Digital = (BOOLEAN)!(MappingItem->Digital); }
VOID AppendCSDNum2 ( IN OUT POOL_PRINT *Str, IN UINT64 Num ) { UINT64 Result; UINTN Rem; ASSERT(Str != NULL); Result = DivU64x32 (Num, 25, &Rem); if (Result > 0) { AppendCSDNum2 (Str, Result); } CatPrint (Str, L"%c", Rem + 'a'); }
/** Function to append a 64 bit number onto the mapping info. @param[in, out] MappingItem The mapping info object to append onto. @param[in] Num The info to append. @retval EFI_INVALID_PARAMETER A parameter was NULL. @retval EFI_SUCCESS The appending was successful. **/ EFI_STATUS EFIAPI AppendCSDNum ( IN OUT DEVICE_CONSIST_MAPPING_INFO *MappingItem, IN UINT64 Num ) { if (MappingItem == NULL) { return EFI_INVALID_PARAMETER; } if (MappingItem->Digital) { CatPrint (&MappingItem->Csd, L"%ld", Num); } else { AppendCSDNum2 (&MappingItem->Csd, Num); } MappingItem->Digital = (BOOLEAN)!(MappingItem->Digital); return (EFI_SUCCESS); }
/** Function to append a 64 bit number / 25 onto the string. @param[in, out] Str The string so append onto. @param[in] Num The number to divide and append. @retval EFI_INVALID_PARAMETER A parameter was NULL. @retval EFI_SUCCESS The appending was successful. **/ EFI_STATUS EFIAPI AppendCSDNum2 ( IN OUT POOL_PRINT *Str, IN UINT64 Num ) { UINT64 Result; UINT32 Rem; if (Str == NULL) { return (EFI_INVALID_PARAMETER); } Result = DivU64x32Remainder (Num, 25, &Rem); if (Result > 0) { AppendCSDNum2 (Str, Result); } CatPrint (Str, L"%c", Rem + 'a'); return (EFI_SUCCESS); }