2 * Copyright (C) 2006 Atmel Corporation
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 #include <linux/linkage.h>
12 * unsigned long find_first_zero_bit(const unsigned long *addr,
15 ENTRY(find_first_zero_bit)
28 * unsigned long find_next_zero_bit(const unsigned long *addr,
30 * unsigned long offset)
32 ENTRY(find_next_zero_bit)
42 /* offset is not word-aligned. Handle the first (32 - r10) bits */
49 /* r9 = r9 - (32 - r10) = r9 + r10 - 32 */
54 /* Main loop. offset must be word-aligned */
63 /* Common return path for when a bit is actually found. */
70 /* XXX: If we don't have to return exactly "size" when the bit
71 is not found, we may drop this "min" thing */
76 * unsigned long find_first_bit(const unsigned long *addr,
92 * unsigned long find_next_bit(const unsigned long *addr,
94 * unsigned long offset)
106 /* offset is not word-aligned. Handle the first (32 - r10) bits */
112 /* r9 = r9 - (32 - r10) = r9 + r10 - 32 */
117 /* Main loop. offset must be word-aligned */
126 ENTRY(find_next_bit_le)
136 /* offset is not word-aligned. Handle the first (32 - r10) bits */
142 /* r9 = r9 - (32 - r10) = r9 + r10 - 32 */
147 /* Main loop. offset must be word-aligned */
148 1: ldswp.w r8, r12[0]
156 ENTRY(find_next_zero_bit_le)
166 /* offset is not word-aligned. Handle the first (32 - r10) bits */
173 /* r9 = r9 - (32 - r10) = r9 + r10 - 32 */
178 /* Main loop. offset must be word-aligned */
179 1: ldswp.w r8, r12[0]