コード例 #1
0
        /// <summary>
        /// Handle reading the value from a socket device of a
        /// specified type into a register.
        /// </summary>
        /// <param name="aAddr">The socket device address.</param>
        /// <param name="aReg">
        /// The register into which the value read from the device
        /// should be placed.
        /// </param>
        /// <param name="aVm">
        /// The virtual machine instance in which the interrupt
        /// should be handled.
        /// </param>
        /// <param name="aContext">
        /// The security context to be used when writing this
        /// value into the register.
        /// </param>
        public static void Read(SocketAddresses aAddr,
                                Registers aReg,
                                VirtualMachine aVm,
                                SecurityContext aContext)
        {
            if (!ReadSockets.TryGetValue(aAddr, out var device))
            {
                throw new Exception($"Read: unmapped socket address 0x{aAddr:X}.");
            }

            device.HandleRead(aAddr, aReg, aVm, aContext);
        }
コード例 #2
0
ファイル: SelectSocket.cs プロジェクト: fdgonthier/TbxUtils
 public bool InRead(Socket sock)
 {
     return(ReadSockets.Contains(sock) || ErrorSockets.Contains(sock));
 }