[PciDevice] Add EnableBusMaster

This commit is contained in:
KingLuigi4932 2017-12-22 16:24:04 +03:00 committed by GitHub
parent 30572e9e90
commit 098963a1ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -198,6 +198,20 @@ namespace Cosmos.HAL
WriteRegister16(0x04, command);
}
public void EnableBusMaster(bool enable)
{
UInt16 command = ReadRegister16(0x04);
UInt16 flags = (1 << 2);
if (enable)
command |= flags;
else
command &= (ushort)~flags;
WriteRegister16(0x04, command);
}
public class DeviceClass
{
public static string GetString(PCIDevice device)
@ -345,4 +359,4 @@ namespace Cosmos.HAL
get { return isIO; }
}
}
}
}