MCPcopy
hub / github.com/cilium/ebpf / LoadMapValue

Function LoadMapValue

asm/load_store.go:251–263  ·  view source on GitHub ↗

LoadMapValue stores a pointer to the value at a certain offset of a map.

(dst Register, fd int, offset uint32)

Source from the content-addressed store, hash-verified

249
250// LoadMapValue stores a pointer to the value at a certain offset of a map.
251func LoadMapValue(dst Register, fd int, offset uint32) Instruction {
252 if fd < 0 {
253 return Instruction{OpCode: InvalidOpCode}
254 }
255
256 fdAndOffset := (uint64(offset) << 32) | uint64(uint32(fd))
257 return Instruction{
258 OpCode: LoadImmOp(DWord),
259 Dst: dst,
260 Src: PseudoMapValue,
261 Constant: int64(fdAndOffset),
262 }
263}
264
265// LoadIndOp returns the OpCode for loading a value of given size from an sk_buff.
266func LoadIndOp(size Size) OpCode {

Callers 1

Calls 1

LoadImmOpFunction · 0.85

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…