summaryrefslogtreecommitdiffstats
path: root/arch/sparc/net/bpf_jit_asm.S
diff options
context:
space:
mode:
authorDavid S. Miller2012-04-17 22:38:16 +0200
committerDavid S. Miller2012-04-17 22:43:46 +0200
commit584c5e2ad3ada1a5ccfffa68347b79c3681cc36e (patch)
tree462835521cf30f6ceb29471bc2cb6cf37dd9bc94 /arch/sparc/net/bpf_jit_asm.S
parentnet: filter: Fix some minor issues in sparc JIT. (diff)
downloadkernel-qcow2-linux-584c5e2ad3ada1a5ccfffa68347b79c3681cc36e.tar.gz
kernel-qcow2-linux-584c5e2ad3ada1a5ccfffa68347b79c3681cc36e.tar.xz
kernel-qcow2-linux-584c5e2ad3ada1a5ccfffa68347b79c3681cc36e.zip
net: filter: Fix some more small issues in sparc JIT.
Fix mixed space and tabs. Put bpf_jit_load_*[] externs into bpf_jit.h "while(0)" --> "while (0)" "COND (X)" --> "COND(X)" Document branch offset calculations, and bpf_error's return sequence. Document the reason we need to emit three nops between the %y register write and the divide instruction. Remove erroneous trailing semicolons from emit_read_y() and emit_write_y(). Based upon feedback from Sam Ravnborg. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/net/bpf_jit_asm.S')
-rw-r--r--arch/sparc/net/bpf_jit_asm.S6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/sparc/net/bpf_jit_asm.S b/arch/sparc/net/bpf_jit_asm.S
index 46d8f59f14c5..9d016c7017f7 100644
--- a/arch/sparc/net/bpf_jit_asm.S
+++ b/arch/sparc/net/bpf_jit_asm.S
@@ -195,5 +195,11 @@ bpf_jit_load_byte_msh_negative_offset:
sll r_OFF, 2, r_X
bpf_error:
+ /* Make the JIT program return zero. The JIT epilogue
+ * stores away the original %o7 into r_saved_O7. The
+ * normal leaf function return is to use "retl" which
+ * would evalute to "jmpl %o7 + 8, %g0" but we want to
+ * use the saved value thus the sequence you see here.
+ */
jmpl r_saved_O7 + 8, %g0
clr %o0