Code cleanup.

This commit is contained in:
José Pedro 2018-12-01 22:55:14 +00:00
parent 53ddb83209
commit 945a1cce72
No known key found for this signature in database
GPG key ID: B8247B9301707B83
4 changed files with 35 additions and 61 deletions

View file

@ -1,8 +0,0 @@
[*.cs]
indent_size=4
[Global.cs]
indent_size = 2
[BlockDevice/Ata.cs]
indent_size = 2

View file

@ -1,16 +1,14 @@
using System; using Cosmos.Debug.Kernel;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cosmos.Debug.Kernel;
namespace Cosmos.HAL.BlockDevice { namespace Cosmos.HAL.BlockDevice
{
public abstract class Ata : BlockDevice public abstract class Ata : BlockDevice
{ {
internal static Debugger AtaDebugger = new Debugger("HAL", "Ata"); internal static Debugger AtaDebugger = new Debugger("HAL", "Ata");
protected Ata() { protected Ata()
{
mBlockSize = 512; mBlockSize = 512;
} }
@ -18,15 +16,11 @@ namespace Cosmos.HAL.BlockDevice {
// Or maybe they all have Primary and Secondary on them as well. // Or maybe they all have Primary and Secondary on them as well.
public enum ControllerIdEnum { Primary, Secondary } public enum ControllerIdEnum { Primary, Secondary }
protected ControllerIdEnum mControllerID; protected ControllerIdEnum mControllerID;
public ControllerIdEnum ControllerID { public ControllerIdEnum ControllerID => mControllerID;
get { return mControllerID; }
}
public enum BusPositionEnum { Master, Slave } public enum BusPositionEnum { Master, Slave }
protected BusPositionEnum mBusPosition; protected BusPositionEnum mBusPosition;
public BusPositionEnum BusPosition { public BusPositionEnum BusPosition => mBusPosition;
get { return mBusPosition; }
}
public override string ToString() public override string ToString()
{ {

View file

@ -1,8 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cosmos.Debug.Kernel;
namespace Cosmos.HAL.BlockDevice namespace Cosmos.HAL.BlockDevice
{ {
@ -23,16 +20,10 @@ namespace Cosmos.HAL.BlockDevice
} }
protected UInt64 mBlockCount = 0; protected UInt64 mBlockCount = 0;
public UInt64 BlockCount public UInt64 BlockCount => mBlockCount;
{
get { return mBlockCount; }
}
protected UInt64 mBlockSize = 0; protected UInt64 mBlockSize = 0;
public UInt64 BlockSize public UInt64 BlockSize => mBlockSize;
{
get { return mBlockSize; }
}
// Only allow reading and writing whole blocks because many of the hardware // Only allow reading and writing whole blocks because many of the hardware
// command work that way and we dont want to add complexity at the BlockDevice level. // command work that way and we dont want to add complexity at the BlockDevice level.

View file

@ -1,14 +1,11 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Cosmos.HAL.BlockDevice namespace Cosmos.HAL.BlockDevice
{ {
public class Partition : BlockDevice public class Partition : BlockDevice
{ {
BlockDevice mHost; private readonly BlockDevice mHost;
UInt64 mStartingSector; private readonly UInt64 mStartingSector;
public Partition(BlockDevice aHost, UInt64 aStartingSector, UInt64 aSectorCount) public Partition(BlockDevice aHost, UInt64 aStartingSector, UInt64 aSectorCount)
{ {