• Home
  • Raw
  • Download

Lines Matching refs:w

59 	w := &execContext{
66 w.csumMap, w.csumUses = calcChecksumsCall(c)
67 w.serializeCall(c)
69 w.write(execInstrEOF)
70 if w.eof {
73 return len(buffer) - len(w.buf), nil
76 func (w *execContext) serializeCall(c *Call) {
79 w.writeCopyin(c)
82 w.writeChecksums()
84 w.write(uint64(c.Meta.ID))
86 if _, ok := w.args[c.Ret]; ok {
89 w.args[c.Ret] = argInfo{Idx: w.copyoutSeq, Ret: true}
90 w.write(w.copyoutSeq)
91 w.copyoutSeq++
93 w.write(ExecNoCopyout)
95 w.write(uint64(len(c.Args)))
97 w.writeArg(arg)
100 w.writeCopyout(c)
127 func (w *execContext) writeCopyin(c *Call) {
132 addr := w.target.PhysicalAddr(ctx.Base) + ctx.Offset
133 if w.willBeUsed(arg) {
134 w.args[arg] = argInfo{Addr: addr}
144 w.write(execInstrCopyin)
145 w.write(addr)
146 w.writeArg(arg)
150 func (w *execContext) willBeUsed(arg Arg) bool {
154 _, ok1 := w.csumMap[arg]
155 _, ok2 := w.csumUses[arg]
159 func (w *execContext) writeChecksums() {
160 if len(w.csumMap) == 0 {
163 csumArgs := make([]Arg, 0, len(w.csumMap))
164 for arg := range w.csumMap {
168 return w.args[csumArgs[i]].Addr < w.args[csumArgs[j]].Addr
172 info := w.csumMap[arg]
176 w.write(execInstrCopyin)
177 w.write(w.args[arg].Addr)
178 w.write(execArgCsum)
179 w.write(arg.Size())
182 w.write(ExecArgCsumInet)
183 w.write(uint64(len(info.Chunks)))
187 w.write(ExecArgCsumChunkData)
188 w.write(w.args[chunk.Arg].Addr)
189 w.write(chunk.Arg.Size())
191 w.write(ExecArgCsumChunkConst)
192 w.write(chunk.Value)
193 w.write(chunk.Size)
204 func (w *execContext) writeCopyout(c *Call) {
208 info := w.args[arg]
212 info.Idx = w.copyoutSeq
213 w.copyoutSeq++
214 w.args[arg] = info
215 w.write(execInstrCopyout)
216 w.write(info.Idx)
217 w.write(info.Addr)
218 w.write(arg.Size())
223 func (w *execContext) write(v uint64) {
224 if len(w.buf) < 8 {
225 w.eof = true
228 w.buf[0] = byte(v >> 0)
229 w.buf[1] = byte(v >> 8)
230 w.buf[2] = byte(v >> 16)
231 w.buf[3] = byte(v >> 24)
232 w.buf[4] = byte(v >> 32)
233 w.buf[5] = byte(v >> 40)
234 w.buf[6] = byte(v >> 48)
235 w.buf[7] = byte(v >> 56)
236 w.buf = w.buf[8:]
239 func (w *execContext) writeArg(arg Arg) {
244w.writeConstArg(a.Size(), val, typ.BitfieldOffset(), typ.BitfieldLength(), pidStride, typ.Format())
247 w.writeConstArg(a.Size(), a.Val, 0, 0, 0, a.Type().Format())
249 info, ok := w.args[a.Res]
253 w.write(execArgResult)
255 w.write(meta)
256 w.write(info.Idx)
257 w.write(a.OpDiv)
258 w.write(a.OpAdd)
259 w.write(a.Type().(*ResourceType).Default())
262 w.writeConstArg(a.Size(), w.target.PhysicalAddr(a), 0, 0, 0, FormatNative)
265 w.write(execArgData)
266 w.write(uint64(len(data)))
271 if len(w.buf) < padded {
272 w.eof = true
274 copy(w.buf, data)
275 w.buf = w.buf[padded:]
278 w.writeArg(a.Option)
284 func (w *execContext) writeConstArg(size, val, bfOffset, bfLength, pidStride uint64, bf BinaryForma…
285 w.write(execArgConst)
287 w.write(meta)
288 w.write(val)