mirror of
https://github.com/danbulant/Cosmos
synced 2026-06-12 11:11:45 +00:00
[PciDevice] Add EnableBusMaster
This commit is contained in:
parent
30572e9e90
commit
098963a1ff
1 changed files with 16 additions and 2 deletions
|
|
@ -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; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue