예제 #1
0
 private void InnerReset()
 {
     registers             = new regs();
     writeOccured          = false;
     commandLength         = 0;
     receiveFIFODataCount  = 0;
     transferFIFODataCount = 0;
 }
예제 #2
0
파일: GaislerEth.cs 프로젝트: rasomc/emul8
 public override void Reset()
 {
     registers = new regs();
     MAC       = new MACAddress();
     transmitDescriptorBase   = 0;
     transmitDescriptorOffset = 0;
     receiveDescriptorBase    = 0;
     transmitDescriptorOffset = 0;
 }
예제 #3
0
파일: GaislerEth.cs 프로젝트: rte-se/emul8
 public override void Reset()
 {
     registers = new regs();
     MAC = new MACAddress();
     transmitDescriptorBase = 0;
     transmitDescriptorOffset = 0;
     receiveDescriptorBase = 0;
     transmitDescriptorOffset = 0;
 }
예제 #4
0
 public ZynqEthernet(Machine machine) : base(machine)
 {
     registers = new regs();
     IRQ       = new GPIO();
     //crc = new Crc16();
     MAC  = EmulationManager.Instance.CurrentEmulation.MACRepository.GenerateUniqueMAC();
     sync = new object();
     Reset();
 }
예제 #5
0
파일: CadenceGEM.cs 프로젝트: rte-se/emul8
 public CadenceGEM(Machine machine) : base(machine)
 {
     registers = new regs();        
     IRQ = new GPIO();
     Link = new NetworkLink(this);
     //crc = new Crc16();
     MAC = EmulationManager.Instance.CurrentEmulation.MACRepository.GenerateUniqueMAC();
     sync = new object();
     Reset();
 }
예제 #6
0
 public CadenceGEM(Machine machine) : base(machine)
 {
     registers = new regs();
     IRQ       = new GPIO();
     Link      = new NetworkLink(this);
     //crc = new Crc16();
     MAC  = EmulationManager.Instance.CurrentEmulation.MACRepository.GenerateUniqueMAC();
     sync = new object();
     Reset();
 }
 public GaislerGPIO(Machine machine, int numberOfPorts, int numberOfInterrupts) : base(machine, numberOfPorts)
 {
     this.numberOfPorts = numberOfPorts;
     if (numberOfPorts < 2 || numberOfPorts > 32)
     {
         throw new RecoverableException("Port number has to be in [2, 32].");
     }
     interrupts = new GPIO[numberOfInterrupts];
     for (var i = 0; i < interrupts.Length; i++)
     {
         interrupts[i] = new GPIO();
     }
     //interruptMap = new int[numberOfInterrupts];
     registers = new regs();
     Reset();
 }
예제 #8
0
파일: GaislerGPIO.cs 프로젝트: rte-se/emul8
 public GaislerGPIO(Machine machine, int numberOfPorts, int numberOfInterrupts) : base(machine, numberOfPorts)
 {
     this.numberOfPorts = numberOfPorts;
     if(numberOfPorts < 2 || numberOfPorts > 32)
     {
         throw new RecoverableException("Port number has to be in [2, 32].");
     }
     interrupts = new GPIO[numberOfInterrupts];
     for(var i = 0; i < interrupts.Length; i++)
     {
         interrupts[i] = new GPIO();
     }
     //interruptMap = new int[numberOfInterrupts];
     registers = new regs();
     Reset();
 }
예제 #9
0
        private void DebuggerInterruptCallback(
            uint lwpid,
            uint status,
            string tdname,
            regs regs,
            fpregs fpregs,
            dbregs dbregs)
        {
            var tabControlDelegate =
                // new Action<object, object>((_param1, _param2) => this.TabControl.SelectedIndex = 0);
                new Action(() => this.TabControl.SelectedIndex = 0);
            var registersTextBoxDelegate = new Action(() =>
                                                      this.RegistersTextBox.Text = "r15 = 0x" + regs.r_r15.ToString("X") +
                                                                                   ", r14 = 0x" + regs.r_r14.ToString("X") +
                                                                                   ", r13 = 0x" + regs.r_r13.ToString("X") +
                                                                                   ", r12 = 0x" + regs.r_r12.ToString("X") +
                                                                                   ", r11 = 0x" + regs.r_r11.ToString("X") +
                                                                                   ", r10 = 0x" + regs.r_r10.ToString("X") +
                                                                                   ", r9 = 0x" + regs.r_r9.ToString("X") +
                                                                                   ", r8 = 0x" + regs.r_r8.ToString("X") +
                                                                                   ", rdi = 0x" + regs.r_rdi.ToString("X") +
                                                                                   ", rsi = 0x" + regs.r_rsi.ToString("X") +
                                                                                   ", rbp = 0x" + regs.r_rbp.ToString("X") +
                                                                                   ", rbx = 0x" + regs.r_rbx.ToString("X") +
                                                                                   ", rdx = 0x" + regs.r_rdx.ToString("X") +
                                                                                   ", rcx = 0x" + regs.r_rcx.ToString("X") +
                                                                                   ", rax = 0x" + regs.r_rax.ToString("X") +
                                                                                   ", trapno = 0x" + regs.r_trapno.ToString("X") +
                                                                                   ", fs = 0x" + regs.r_fs.ToString("X") +
                                                                                   ", gs = 0x" + regs.r_gs.ToString("X") +
                                                                                   ", err = 0x" + regs.r_err.ToString("X") +
                                                                                   ", es = 0x" + regs.r_es.ToString("X") +
                                                                                   ", ds = 0x" + regs.r_ds.ToString("X") +
                                                                                   ", rip = 0x" + regs.r_rip.ToString("X") +
                                                                                   ", cs = 0x" + regs.r_cs.ToString("X") +
                                                                                   ", rflags = 0x" + regs.r_rflags.ToString("X") +
                                                                                   ", rsp = 0x" + regs.r_rsp.ToString("X") +
                                                                                   ", ss = 0x" + regs.r_ss.ToString("X"));
            var addressTextBoxDelegate = new Action(() =>
                                                    this.AddressTextBox.Text = "0x" + regs.r_rip.ToString("X"));
            var tryFindButtonDelegate = new Action(() =>
                                                   this.TryFindButton_Click((object)null, (EventArgs)null));

            this.ps4.Notify(222, "interrupt hit\n(thread: " + tdname + " id: " + (object)lwpid + ")");
            this.TabControl.Invoke(tabControlDelegate);
            this.RegistersTextBox.Invoke(registersTextBoxDelegate);
            this.AddressTextBox.Invoke(addressTextBoxDelegate);
            this.TryFindButton.Invoke(tryFindButtonDelegate);
            this.data = this.ps4.ReadMemory(this.attachpid, this.address, this.length);
            string[]      lines         = this.GetDisassembly(this.address, this.data);
            StringBuilder stringBuilder = new StringBuilder();

            for (int index = 1; index < lines.Length; ++index)
            {
                stringBuilder.AppendLine(lines[index]);
            }
            string after = stringBuilder.ToString();
            var    disassemblyTextBoxDelegate = new Action(() =>
            {
                this.DisassemblyTextBox.Clear();
                this.DisassemblyTextBox.AppendText(lines[0] + Environment.NewLine, Color.Salmon);
                this.DisassemblyTextBox.AppendText(after);
            });

            this.DisassemblyTextBox.Invoke(disassemblyTextBoxDelegate);
        }