singrdk/base/Kernel/Singularity.Hal.Acpi/Dsdt.cs

47 lines
1.2 KiB
C#
Raw Normal View History

2008-03-05 09:52:00 -05:00
///////////////////////////////////////////////////////////////////////////////
//
// Microsoft Research Singularity
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: Dsdt.cs
//
namespace Microsoft.Singularity.Hal.Acpi
{
using System;
using Microsoft.Singularity.Io;
public class Dsdt
{
public const string Signature = "DSDT";
private IoMemory region;
private SystemTableHeader header;
public Dsdt(IoMemory region, SystemTableHeader header)
{
this.region = region;
this.header = header;
}
public IoMemory Region
{
get { return region; }
}
public static Dsdt Create(SystemTableHeader header)
{
IoMemory region = IoMemory.MapPhysicalMemory(header.PostHeaderAddress,
header.PostHeaderLength,
true, false);
int sum = (header.Checksum + AcpiChecksum.Compute(region)) & 0xff;
2008-11-17 18:29:00 -05:00
if (sum != 0) {
2008-03-05 09:52:00 -05:00
return null;
}
return new Dsdt(region, header);
}
}
}