Skip to content

Commit

Permalink
address some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexicon226 committed Jan 21, 2025
1 parent 567f07b commit a5a2d79
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/svm/elf.zig
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ pub const Elf = struct {
for (instructions, 0..) |inst, i| {
if (inst.opcode == .call_imm and
inst.imm != ~@as(u32, 0) and
!(version.usesStaticSyscalls() and inst.src == .r0))
!(version.enableStaticSyscalls() and inst.src == .r0))
{
const target_pc = @as(i64, @intCast(i)) +| @as(i32, @bitCast(inst.imm)) +| 1;
if (target_pc < 0 or target_pc >= instructions.len)
Expand Down
1 change: 1 addition & 0 deletions src/svm/executable.zig
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ pub const Config = struct {
minimum_version: sbpf.SBPFVersion = .v2,
stack_frame_size: u64 = 4096,
max_call_depth: u64 = 64,

pub fn stackSize(config: Config) u64 {
return config.stack_frame_size * config.max_call_depth;
}
Expand Down
4 changes: 0 additions & 4 deletions src/svm/sbpf.zig
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ pub const SBPFVersion = enum {
// v3,
// reserved,

pub fn usesStaticSyscalls(version: SBPFVersion) bool {
return version != .v1;
}

pub fn enableDynamicStackFrames(version: SBPFVersion) bool {
return version != .v1;
}
Expand Down

0 comments on commit a5a2d79

Please sign in to comment.