Exemple #1
0
 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;
     }
 }
Exemple #2
0
 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;
 }
Exemple #3
0
 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;
     }
 }
Exemple #4
0
        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);
        }
Exemple #5
0
 public void hwConnect(IPCHardware hw)
 {
     mem.map(hw);
 }
Exemple #6
0
 public void hwConnect(IPCHardware hw)
 {
     mem.map(hw);
 }