aboutsummaryrefslogtreecommitdiffstats
path: root/arch/unicore32/lib/findbit.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/unicore32/lib/findbit.S')
-rw-r--r--arch/unicore32/lib/findbit.S14
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/unicore32/lib/findbit.S b/arch/unicore32/lib/findbit.S
index c360ce905d8b..c77746247d36 100644
--- a/arch/unicore32/lib/findbit.S
+++ b/arch/unicore32/lib/findbit.S
@@ -17,7 +17,7 @@
17 * Purpose : Find a 'zero' bit 17 * Purpose : Find a 'zero' bit
18 * Prototype: int find_first_zero_bit(void *addr, unsigned int maxbit); 18 * Prototype: int find_first_zero_bit(void *addr, unsigned int maxbit);
19 */ 19 */
20__uc32_find_first_zero_bit: 20ENTRY(find_first_zero_bit)
21 cxor.a r1, #0 21 cxor.a r1, #0
22 beq 3f 22 beq 3f
23 mov r2, #0 23 mov r2, #0
@@ -29,13 +29,14 @@ __uc32_find_first_zero_bit:
29 bub 1b 29 bub 1b
303: mov r0, r1 @ no free bits 303: mov r0, r1 @ no free bits
31 mov pc, lr 31 mov pc, lr
32ENDPROC(find_first_zero_bit)
32 33
33/* 34/*
34 * Purpose : Find next 'zero' bit 35 * Purpose : Find next 'zero' bit
35 * Prototype: int find_next_zero_bit 36 * Prototype: int find_next_zero_bit
36 * (void *addr, unsigned int maxbit, int offset) 37 * (void *addr, unsigned int maxbit, int offset)
37 */ 38 */
38ENTRY(__uc32_find_next_zero_bit) 39ENTRY(find_next_zero_bit)
39 cxor.a r1, #0 40 cxor.a r1, #0
40 beq 3b 41 beq 3b
41 and.a ip, r2, #7 42 and.a ip, r2, #7
@@ -47,14 +48,14 @@ ENTRY(__uc32_find_next_zero_bit)
47 or r2, r2, #7 @ if zero, then no bits here 48 or r2, r2, #7 @ if zero, then no bits here
48 add r2, r2, #1 @ align bit pointer 49 add r2, r2, #1 @ align bit pointer
49 b 2b @ loop for next bit 50 b 2b @ loop for next bit
50ENDPROC(__uc32_find_next_zero_bit) 51ENDPROC(find_next_zero_bit)
51 52
52/* 53/*
53 * Purpose : Find a 'one' bit 54 * Purpose : Find a 'one' bit
54 * Prototype: int find_first_bit 55 * Prototype: int find_first_bit
55 * (const unsigned long *addr, unsigned int maxbit); 56 * (const unsigned long *addr, unsigned int maxbit);
56 */ 57 */
57__uc32_find_first_bit: 58ENTRY(find_first_bit)
58 cxor.a r1, #0 59 cxor.a r1, #0
59 beq 3f 60 beq 3f
60 mov r2, #0 61 mov r2, #0
@@ -66,13 +67,14 @@ __uc32_find_first_bit:
66 bub 1b 67 bub 1b
673: mov r0, r1 @ no free bits 683: mov r0, r1 @ no free bits
68 mov pc, lr 69 mov pc, lr
70ENDPROC(find_first_bit)
69 71
70/* 72/*
71 * Purpose : Find next 'one' bit 73 * Purpose : Find next 'one' bit
72 * Prototype: int find_next_zero_bit 74 * Prototype: int find_next_zero_bit
73 * (void *addr, unsigned int maxbit, int offset) 75 * (void *addr, unsigned int maxbit, int offset)
74 */ 76 */
75ENTRY(__uc32_find_next_bit) 77ENTRY(find_next_bit)
76 cxor.a r1, #0 78 cxor.a r1, #0
77 beq 3b 79 beq 3b
78 and.a ip, r2, #7 80 and.a ip, r2, #7
@@ -83,7 +85,7 @@ ENTRY(__uc32_find_next_bit)
83 or r2, r2, #7 @ if zero, then no bits here 85 or r2, r2, #7 @ if zero, then no bits here
84 add r2, r2, #1 @ align bit pointer 86 add r2, r2, #1 @ align bit pointer
85 b 2b @ loop for next bit 87 b 2b @ loop for next bit
86ENDPROC(__uc32_find_next_bit) 88ENDPROC(find_next_bit)
87 89
88/* 90/*
89 * One or more bits in the LSB of r3 are assumed to be set. 91 * One or more bits in the LSB of r3 are assumed to be set.