aboutsummaryrefslogtreecommitdiffstats
path: root/prog/decodeexec.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-07-07 20:07:30 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-07-08 22:52:24 +0200
commit306ca0571c5d906ce76df97bd1ea54f4e0e50240 (patch)
treea579718e096c53dc5386f4af2fbabb3318eaf1ed /prog/decodeexec.go
parent93213ec0d3c4522c8844a51b718eb56ce62f395b (diff)
prog, pkg/compiler: support fmt type
fmt type allows to convert intergers and resources to string representation.
Diffstat (limited to 'prog/decodeexec.go')
-rw-r--r--prog/decodeexec.go9
1 files changed, 6 insertions, 3 deletions
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(),