public void hwConnect(IPCHardware hw) { try { hw.connect(); memory.hwConnect(hw); hw.recInterruptHandle(new InterruptHandle(this)); hardware.AddLast(hw); } catch (Exception e) { //memory.hwDisconnect(hw);//implement, pronto hardware.Remove(hw); try { hw.disconnect(); } catch { } throw e; } }
public bool map(IPCHardware hw) { //read ammount of segments from hw int segCount = hw.getSegmentCount(); //for each segment, allocate it for (int i = 0; i < segCount; ++i) { Tuple<UInt16, int> segment = hw.getSegment(i); for (int j = 0; j < segment.Item2; ++j) { if (deviceMap[j + segment.Item1] != null) { throw new ArgumentException("Intersecting segments are not allowed; collision between " + deviceMap[j + segment.Item1].GetType().ToString() + " and " + hw.GetType().ToString()); } else { deviceMap[j + segment.Item1] = hw; } } } //devices.AddLast(hw); return true; }
public bool map(IPCHardware hw) { //read ammount of segments from hw int segCount = hw.getSegmentCount(); //for each segment, allocate it for (int i = 0; i < segCount; ++i) { Tuple <UInt16, int> segment = hw.getSegment(i); for (int j = 0; j < segment.Item2; ++j) { if (deviceMap[j + segment.Item1] != null) { throw new ArgumentException("Intersecting segments are not allowed; collision between " + deviceMap[j + segment.Item1].GetType().ToString() + " and " + hw.GetType().ToString()); } else { deviceMap[j + segment.Item1] = hw; } } } //devices.AddLast(hw); return(true); }
public void hwConnect(IPCHardware hw) { mem.map(hw); }