예제 #1
0
파일: Ram.cs 프로젝트: andy-uq/TinyOS
 public Ram(byte[] ram, uint frameSize)
 {
     VirtualAddressCalculator = new VirtualAddressCalculator(frameSize);
     FrameSize = frameSize;
     _ram = ram;
     _pageTable = Enumerable.Range(0, (int) (ram.Length/frameSize))
         .Select(x => CreateFrame(0, (uint) x))
         .Select(x => new List<Frame> {x})
         .ToArray();
 }
예제 #2
0
 public Ram(byte[] ram, uint frameSize)
 {
     VirtualAddressCalculator = new VirtualAddressCalculator(frameSize);
     FrameSize  = frameSize;
     _ram       = ram;
     _pageTable = Enumerable.Range(0, (int)(ram.Length / frameSize))
                  .Select(x => CreateFrame(0, (uint)x))
                  .Select(x => new List <Frame> {
         x
     })
                  .ToArray();
 }
예제 #3
0
 public void SetUp()
 {
     _calculator = new VirtualAddressCalculator(4096);
     Assert.That(_calculator.PageSize, Is.EqualTo(4096));
     Assert.That(_calculator.MaxPages, Is.EqualTo(1 << 20));
     Assert.That(_calculator.PageShift, Is.EqualTo(12));
     Assert.That(_calculator.OffsetMask, Is.EqualTo(4095));
 }
예제 #4
0
파일: RamTests.cs 프로젝트: andy-uq/TinyOS
 public void VirtualAddressCalculations()
 {
     var c = new VirtualAddressCalculator(16);
     Assert.That(c.PageSize, Is.EqualTo(16));
     Assert.That(c.MaxPages, Is.EqualTo(1 << 28));
 }
예제 #5
0
 public VirtualAddress ToVirtualAddress(Page page)
 {
     return(VirtualAddressCalculator.New(0, (int)page.PageNumber));
 }