~ubuntu-branches/ubuntu/utopic/xen/utopic

« back to all changes in this revision

Viewing changes to tools/libxc/ia64/dom_fw_acpi.c

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2010-05-06 15:47:38 UTC
  • mto: (1.3.1) (15.1.1 sid) (4.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20100506154738-agoz0rlafrh1fnq7
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <inttypes.h>
 
2
#include "xc_dom_ia64_util.h"
 
3
#include <xen/acpi.h>
 
4
#include <acpi/actables.h>
 
5
 
 
6
/* stolen from xen/drivers/acpi/tables/tbutils.c */
 
7
 
 
8
/*******************************************************************************
 
9
 *
 
10
 * FUNCTION:    acpi_tb_checksum
 
11
 *
 
12
 * PARAMETERS:  Buffer          - Pointer to memory region to be checked
 
13
 *              Length          - Length of this memory region
 
14
 *
 
15
 * RETURN:      Checksum (u8)
 
16
 *
 
17
 * DESCRIPTION: Calculates circular checksum of memory region.
 
18
 *
 
19
 ******************************************************************************/
 
20
 
 
21
u8 acpi_tb_checksum(u8 * buffer, acpi_native_uint length)
 
22
{
 
23
        u8 sum = 0;
 
24
        u8 *end = buffer + length;
 
25
 
 
26
        while (buffer < end) {
 
27
                sum = (u8) (sum + *(buffer++));
 
28
        }
 
29
 
 
30
        return sum;
 
31
}