aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/net/bpf_jit.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/net/bpf_jit.S')
-rw-r--r--arch/s390/net/bpf_jit.S28
1 files changed, 16 insertions, 12 deletions
diff --git a/arch/s390/net/bpf_jit.S b/arch/s390/net/bpf_jit.S
index 7e45d13816c1..ba44c9f55346 100644
--- a/arch/s390/net/bpf_jit.S
+++ b/arch/s390/net/bpf_jit.S
@@ -22,8 +22,8 @@
22 * skb_copy_bits takes 4 parameters: 22 * skb_copy_bits takes 4 parameters:
23 * %r2 = skb pointer 23 * %r2 = skb pointer
24 * %r3 = offset into skb data 24 * %r3 = offset into skb data
25 * %r4 = length to copy 25 * %r4 = pointer to temp buffer
26 * %r5 = pointer to temp buffer 26 * %r5 = length to copy
27 */ 27 */
28#define SKBDATA %r8 28#define SKBDATA %r8
29 29
@@ -44,8 +44,9 @@ ENTRY(sk_load_word)
44 44
45sk_load_word_slow: 45sk_load_word_slow:
46 lgr %r9,%r2 # save %r2 46 lgr %r9,%r2 # save %r2
47 lhi %r4,4 # 4 bytes 47 lgr %r3,%r1 # offset
48 la %r5,160(%r15) # pointer to temp buffer 48 la %r4,160(%r15) # pointer to temp buffer
49 lghi %r5,4 # 4 bytes
49 brasl %r14,skb_copy_bits # get data from skb 50 brasl %r14,skb_copy_bits # get data from skb
50 l %r5,160(%r15) # load result from temp buffer 51 l %r5,160(%r15) # load result from temp buffer
51 ltgr %r2,%r2 # set cc to (%r2 != 0) 52 ltgr %r2,%r2 # set cc to (%r2 != 0)
@@ -69,8 +70,9 @@ ENTRY(sk_load_half)
69 70
70sk_load_half_slow: 71sk_load_half_slow:
71 lgr %r9,%r2 # save %r2 72 lgr %r9,%r2 # save %r2
72 lhi %r4,2 # 2 bytes 73 lgr %r3,%r1 # offset
73 la %r5,162(%r15) # pointer to temp buffer 74 la %r4,162(%r15) # pointer to temp buffer
75 lghi %r5,2 # 2 bytes
74 brasl %r14,skb_copy_bits # get data from skb 76 brasl %r14,skb_copy_bits # get data from skb
75 xc 160(2,%r15),160(%r15) 77 xc 160(2,%r15),160(%r15)
76 l %r5,160(%r15) # load result from temp buffer 78 l %r5,160(%r15) # load result from temp buffer
@@ -95,8 +97,9 @@ ENTRY(sk_load_byte)
95 97
96sk_load_byte_slow: 98sk_load_byte_slow:
97 lgr %r9,%r2 # save %r2 99 lgr %r9,%r2 # save %r2
98 lhi %r4,1 # 1 bytes 100 lgr %r3,%r1 # offset
99 la %r5,163(%r15) # pointer to temp buffer 101 la %r4,163(%r15) # pointer to temp buffer
102 lghi %r5,1 # 1 byte
100 brasl %r14,skb_copy_bits # get data from skb 103 brasl %r14,skb_copy_bits # get data from skb
101 xc 160(3,%r15),160(%r15) 104 xc 160(3,%r15),160(%r15)
102 l %r5,160(%r15) # load result from temp buffer 105 l %r5,160(%r15) # load result from temp buffer
@@ -104,11 +107,11 @@ sk_load_byte_slow:
104 lgr %r2,%r9 # restore %r2 107 lgr %r2,%r9 # restore %r2
105 br %r8 108 br %r8
106 109
107 /* A = (*(u8 *)(skb->data+K) & 0xf) << 2 */ 110 /* X = (*(u8 *)(skb->data+K) & 0xf) << 2 */
108ENTRY(sk_load_byte_msh) 111ENTRY(sk_load_byte_msh)
109 llgfr %r1,%r3 # extend offset 112 llgfr %r1,%r3 # extend offset
110 clr %r11,%r3 # hlen < offset ? 113 clr %r11,%r3 # hlen < offset ?
111 jle sk_load_byte_slow 114 jle sk_load_byte_msh_slow
112 lhi %r12,0 115 lhi %r12,0
113 ic %r12,0(%r1,%r10) # get byte from skb 116 ic %r12,0(%r1,%r10) # get byte from skb
114 nill %r12,0x0f 117 nill %r12,0x0f
@@ -118,8 +121,9 @@ ENTRY(sk_load_byte_msh)
118 121
119sk_load_byte_msh_slow: 122sk_load_byte_msh_slow:
120 lgr %r9,%r2 # save %r2 123 lgr %r9,%r2 # save %r2
121 lhi %r4,2 # 2 bytes 124 lgr %r3,%r1 # offset
122 la %r5,162(%r15) # pointer to temp buffer 125 la %r4,163(%r15) # pointer to temp buffer
126 lghi %r5,1 # 1 byte
123 brasl %r14,skb_copy_bits # get data from skb 127 brasl %r14,skb_copy_bits # get data from skb
124 xc 160(3,%r15),160(%r15) 128 xc 160(3,%r15),160(%r15)
125 l %r12,160(%r15) # load result from temp buffer 129 l %r12,160(%r15) # load result from temp buffer