Пример #1
0
        public void RemoveDevice(ISystemBusDevice device)
        {
            for (var i = 0UL; i < this.MaxId; i++)
            {
                if (this.devices[i] == device)
                {
                    this.devices[i] = null;

                    device.Dispose();
                }
            }
        }
Пример #2
0
        public ulong AddDevice(ISystemBusDevice device)
        {
            if (this.nextDeviceId > this.MaxId - 1)
            {
                throw new InvalidOperationException("Max devices exceeded.");
            }

            device.Id                  = this.nextDeviceId;
            device.BusController       = this;
            device.InterruptController = this.InterruptController;

            this.devices[this.nextDeviceId] = device;

            return(this.nextDeviceId++);
        }