From 306ca0571c5d906ce76df97bd1ea54f4e0e50240 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 7 Jul 2018 20:07:30 +0200 Subject: prog, pkg/compiler: support fmt type fmt type allows to convert intergers and resources to string representation. --- prog/decodeexec.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'prog/decodeexec.go') diff --git a/prog/decodeexec.go b/prog/decodeexec.go index f8c29a517..5866d8627 100644 --- a/prog/decodeexec.go +++ b/prog/decodeexec.go @@ -35,15 +35,16 @@ type ExecArg interface{} // one of ExecArg* type ExecArgConst struct { Size uint64 + Format BinaryFormat Value uint64 BitfieldOffset uint64 BitfieldLength uint64 PidStride uint64 - BigEndian bool } type ExecArgResult struct { Size uint64 + Format BinaryFormat Index uint64 DivOp uint64 AddOp uint64 @@ -139,14 +140,16 @@ func (dec *execDecoder) readArg() ExecArg { return ExecArgConst{ Value: dec.read(), Size: meta & 0xff, + Format: BinaryFormat((meta >> 8) & 0xff), BitfieldOffset: (meta >> 16) & 0xff, BitfieldLength: (meta >> 24) & 0xff, PidStride: meta >> 32, - BigEndian: (meta & (1 << 8)) != 0, } case execArgResult: + meta := dec.read() arg := ExecArgResult{ - Size: dec.read(), + Size: meta & 0xff, + Format: BinaryFormat((meta >> 8) & 0xff), Index: dec.read(), DivOp: dec.read(), AddOp: dec.read(), -- cgit mrf-deployment