Skip to content

Commit

Permalink
unicore32: fix build error for find bitops
Browse files Browse the repository at this point in the history
Remove the __uc32_ prefix in find bitops functions.
Move find_* macros behind asm-generic/bitops.h inclusion.
see commit <19de85ef574c3a2182e3ccad9581805052f14946>
  bitops: add #ifndef for each of find bitops
also see commit <63e424c84429903c92a0f1e9654c31ccaf6694d0>
  arch: remove CONFIG_GENERIC_FIND_{NEXT_BIT,BIT_LE,LAST_BIT}

Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
Guan Xuetao committed Nov 15, 2011
1 parent 7f80850 commit e13b91c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
12 changes: 6 additions & 6 deletions arch/unicore32/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
#ifndef __UNICORE_BITOPS_H__
#define __UNICORE_BITOPS_H__

#define find_next_bit __uc32_find_next_bit
#define find_next_zero_bit __uc32_find_next_zero_bit

#define find_first_bit __uc32_find_first_bit
#define find_first_zero_bit __uc32_find_first_zero_bit

#define _ASM_GENERIC_BITOPS_FLS_H_
#define _ASM_GENERIC_BITOPS___FLS_H_
#define _ASM_GENERIC_BITOPS_FFS_H_
Expand All @@ -44,4 +38,10 @@ static inline int fls(int x)

#include <asm-generic/bitops.h>

/* following definitions: to avoid using codes in lib/find_*.c */
#define find_next_bit find_next_bit
#define find_next_zero_bit find_next_zero_bit
#define find_first_bit find_first_bit
#define find_first_zero_bit find_first_zero_bit

#endif /* __UNICORE_BITOPS_H__ */
4 changes: 2 additions & 2 deletions arch/unicore32/kernel/ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

#include "ksyms.h"

EXPORT_SYMBOL(__uc32_find_next_zero_bit);
EXPORT_SYMBOL(__uc32_find_next_bit);
EXPORT_SYMBOL(find_next_zero_bit);
EXPORT_SYMBOL(find_next_bit);

EXPORT_SYMBOL(__backtrace);

Expand Down
14 changes: 8 additions & 6 deletions arch/unicore32/lib/findbit.S
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Purpose : Find a 'zero' bit
* Prototype: int find_first_zero_bit(void *addr, unsigned int maxbit);
*/
__uc32_find_first_zero_bit:
ENTRY(find_first_zero_bit)
cxor.a r1, #0
beq 3f
mov r2, #0
Expand All @@ -29,13 +29,14 @@ __uc32_find_first_zero_bit:
bub 1b
3: mov r0, r1 @ no free bits
mov pc, lr
ENDPROC(find_first_zero_bit)

/*
* Purpose : Find next 'zero' bit
* Prototype: int find_next_zero_bit
* (void *addr, unsigned int maxbit, int offset)
*/
ENTRY(__uc32_find_next_zero_bit)
ENTRY(find_next_zero_bit)
cxor.a r1, #0
beq 3b
and.a ip, r2, #7
Expand All @@ -47,14 +48,14 @@ ENTRY(__uc32_find_next_zero_bit)
or r2, r2, #7 @ if zero, then no bits here
add r2, r2, #1 @ align bit pointer
b 2b @ loop for next bit
ENDPROC(__uc32_find_next_zero_bit)
ENDPROC(find_next_zero_bit)

/*
* Purpose : Find a 'one' bit
* Prototype: int find_first_bit
* (const unsigned long *addr, unsigned int maxbit);
*/
__uc32_find_first_bit:
ENTRY(find_first_bit)
cxor.a r1, #0
beq 3f
mov r2, #0
Expand All @@ -66,13 +67,14 @@ __uc32_find_first_bit:
bub 1b
3: mov r0, r1 @ no free bits
mov pc, lr
ENDPROC(find_first_bit)

/*
* Purpose : Find next 'one' bit
* Prototype: int find_next_zero_bit
* (void *addr, unsigned int maxbit, int offset)
*/
ENTRY(__uc32_find_next_bit)
ENTRY(find_next_bit)
cxor.a r1, #0
beq 3b
and.a ip, r2, #7
Expand All @@ -83,7 +85,7 @@ ENTRY(__uc32_find_next_bit)
or r2, r2, #7 @ if zero, then no bits here
add r2, r2, #1 @ align bit pointer
b 2b @ loop for next bit
ENDPROC(__uc32_find_next_bit)
ENDPROC(find_next_bit)

/*
* One or more bits in the LSB of r3 are assumed to be set.
Expand Down

0 comments on commit e13b91c

Please sign in to comment.