MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / CalculateSum16

Function CalculateSum16

BaseTools/Source/C/Common/CommonLib.c:410–445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

408}
409
410UINT16
411CalculateSum16 (
412 IN UINT16 *Buffer,
413 IN UINTN Size
414 )
415/*++
416
417Routine Description:
418
419 This function calculates the UINT16 sum for the requested region.
420
421Arguments:
422
423 Buffer Pointer to buffer containing byte data of component.
424 Size Size of the buffer
425
426Returns:
427
428 The 16 bit checksum
429
430--*/
431{
432 UINTN Index;
433 UINT16 Sum;
434
435 Sum = 0;
436
437 //
438 // Perform the word sum for buffer
439 //
440 for (Index = 0; Index < Size; Index++) {
441 Sum = (UINT16) (Sum + Buffer[Index]);
442 }
443
444 return (UINT16) Sum;
445}
446
447EFI_STATUS
448PrintGuid (

Callers 2

CalculateChecksum16Function · 0.70
VerifyFvFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected