.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * linux/arch/arm/lib/findbit.S |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 1995-2000 Russell King |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or modify |
---|
7 | | - * it under the terms of the GNU General Public License version 2 as |
---|
8 | | - * published by the Free Software Foundation. |
---|
9 | 6 | * |
---|
10 | 7 | * 16th March 2001 - John Ripley <jripley@sonicblue.com> |
---|
11 | 8 | * Fixed so that "size" is an exclusive not an inclusive quantity. |
---|
.. | .. |
---|
43 | 40 | * Prototype: int find_next_zero_bit(void *addr, unsigned int maxbit, int offset) |
---|
44 | 41 | */ |
---|
45 | 42 | ENTRY(_find_next_zero_bit_le) |
---|
46 | | - teq r1, #0 |
---|
47 | | - beq 3b |
---|
| 43 | + cmp r2, r1 |
---|
| 44 | + bhs 3b |
---|
48 | 45 | ands ip, r2, #7 |
---|
49 | 46 | beq 1b @ If new byte, goto old routine |
---|
50 | 47 | ARM( ldrb r3, [r0, r2, lsr #3] ) |
---|
.. | .. |
---|
84 | 81 | * Prototype: int find_next_zero_bit(void *addr, unsigned int maxbit, int offset) |
---|
85 | 82 | */ |
---|
86 | 83 | ENTRY(_find_next_bit_le) |
---|
87 | | - teq r1, #0 |
---|
88 | | - beq 3b |
---|
| 84 | + cmp r2, r1 |
---|
| 85 | + bhs 3b |
---|
89 | 86 | ands ip, r2, #7 |
---|
90 | 87 | beq 1b @ If new byte, goto old routine |
---|
91 | 88 | ARM( ldrb r3, [r0, r2, lsr #3] ) |
---|
.. | .. |
---|
118 | 115 | ENDPROC(_find_first_zero_bit_be) |
---|
119 | 116 | |
---|
120 | 117 | ENTRY(_find_next_zero_bit_be) |
---|
121 | | - teq r1, #0 |
---|
122 | | - beq 3b |
---|
| 118 | + cmp r2, r1 |
---|
| 119 | + bhs 3b |
---|
123 | 120 | ands ip, r2, #7 |
---|
124 | 121 | beq 1b @ If new byte, goto old routine |
---|
125 | 122 | eor r3, r2, #0x18 @ big endian byte ordering |
---|
.. | .. |
---|
152 | 149 | ENDPROC(_find_first_bit_be) |
---|
153 | 150 | |
---|
154 | 151 | ENTRY(_find_next_bit_be) |
---|
155 | | - teq r1, #0 |
---|
156 | | - beq 3b |
---|
| 152 | + cmp r2, r1 |
---|
| 153 | + bhs 3b |
---|
157 | 154 | ands ip, r2, #7 |
---|
158 | 155 | beq 1b @ If new byte, goto old routine |
---|
159 | 156 | eor r3, r2, #0x18 @ big endian byte ordering |
---|