public override BlockEvent WriteAsync(long sector_idx, long sector_count, byte[] buf, int buf_offset) { ata.Cmd c = new ata.Cmd(); c.is_write = false; c.sector_idx = (ulong)sector_idx; c.sector_count = (ulong)sector_count; c.cur_sector = c.sector_idx; c.buf = buf; c.buf_offset = buf_offset; c.ev = new BlockEvent(); c.d = d; lock (a.cmds) { a.cmds.Add(c); } return(c.ev); }
public override BlockEvent ReadAsync(long sector_idx, long sector_count, byte[] buf, int buf_offset) { System.Diagnostics.Debugger.Log(0, "ata", "Drive: ReadAsync(" + sector_idx.ToString() + ", " + sector_count.ToString() + ", , )"); ata.Cmd c = new ata.Cmd(); c.is_write = false; c.sector_idx = (ulong)sector_idx; c.sector_count = (ulong)sector_count; c.cur_sector = c.sector_idx; c.buf = buf; c.buf_offset = buf_offset; c.ev = new BlockEvent(); c.d = d; lock (a.cmds) { a.cmds.Add(c); } System.Diagnostics.Debugger.Log(0, "ata", "Drive: ReadAsync returning"); return(c.ev); }