projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
arm: Kirkwood: Correct header define
[oweals/u-boot.git]
/
include
/
asm-blackfin
/
bitops.h
diff --git
a/include/asm-blackfin/bitops.h
b/include/asm-blackfin/bitops.h
index 65d2c2534572f5c313cc4c4f630c88183a08a0a0..2e55b6a619998c234aee9042be7f70e960a112d3 100644
(file)
--- a/
include/asm-blackfin/bitops.h
+++ b/
include/asm-blackfin/bitops.h
@@
-1,7
+1,7
@@
/*
* U-boot - bitops.h Routines for bit operations
*
/*
* U-boot - bitops.h Routines for bit operations
*
- * Copyright (c) 2005
blackfin.uclinux.org
+ * Copyright (c) 2005
-2007 Analog Devices Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* See file CREDITS for list of people who contributed to this
* project.
@@
-18,8
+18,8
@@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 5
9 Temple Place, Suite 330
, Boston,
- * MA 0211
1-1307
USA
+ * Foundation, Inc., 5
1 Franklin St, Fifth Floor
, Boston,
+ * MA 0211
0-1301
USA
*/
#ifndef _BLACKFIN_BITOPS_H
*/
#ifndef _BLACKFIN_BITOPS_H
@@
-59,20
+59,20
@@
static __inline__ unsigned long ffz(unsigned long word)
static __inline__ void set_bit(int nr, volatile void *addr)
{
static __inline__ void set_bit(int nr, volatile void *addr)
{
- int *a = (int *)
addr;
+ int *a = (int *)addr;
int mask;
unsigned long flags;
a += nr >> 5;
mask = 1 << (nr & 0x1f);
int mask;
unsigned long flags;
a += nr >> 5;
mask = 1 << (nr & 0x1f);
-
save_and_cli
(flags);
+
local_irq_save
(flags);
*a |= mask;
*a |= mask;
-
restore_flags
(flags);
+
local_irq_restore
(flags);
}
static __inline__ void __set_bit(int nr, volatile void *addr)
{
}
static __inline__ void __set_bit(int nr, volatile void *addr)
{
- int *a = (int *)
addr;
+ int *a = (int *)addr;
int mask;
a += nr >> 5;
int mask;
a += nr >> 5;
@@
-88,33
+88,33
@@
static __inline__ void __set_bit(int nr, volatile void *addr)
static __inline__ void clear_bit(int nr, volatile void *addr)
{
static __inline__ void clear_bit(int nr, volatile void *addr)
{
- int *a = (int *)
addr;
+ int *a = (int *)addr;
int mask;
unsigned long flags;
a += nr >> 5;
mask = 1 << (nr & 0x1f);
int mask;
unsigned long flags;
a += nr >> 5;
mask = 1 << (nr & 0x1f);
-
save_and_cli
(flags);
+
local_irq_save
(flags);
*a &= ~mask;
*a &= ~mask;
-
restore_flags
(flags);
+
local_irq_restore
(flags);
}
static __inline__ void change_bit(int nr, volatile void *addr)
{
int mask, flags;
}
static __inline__ void change_bit(int nr, volatile void *addr)
{
int mask, flags;
- unsigned long *ADDR = (unsigned long *)
addr;
+ unsigned long *ADDR = (unsigned long *)addr;
ADDR += nr >> 5;
mask = 1 << (nr & 31);
ADDR += nr >> 5;
mask = 1 << (nr & 31);
-
save_and_cli
(flags);
+
local_irq_save
(flags);
*ADDR ^= mask;
*ADDR ^= mask;
-
restore_flags
(flags);
+
local_irq_restore
(flags);
}
static __inline__ void __change_bit(int nr, volatile void *addr)
{
int mask;
}
static __inline__ void __change_bit(int nr, volatile void *addr)
{
int mask;
- unsigned long *ADDR = (unsigned long *)
addr;
+ unsigned long *ADDR = (unsigned long *)addr;
ADDR += nr >> 5;
mask = 1 << (nr & 31);
ADDR += nr >> 5;
mask = 1 << (nr & 31);
@@
-124,15
+124,15
@@
static __inline__ void __change_bit(int nr, volatile void *addr)
static __inline__ int test_and_set_bit(int nr, volatile void *addr)
{
int mask, retval;
static __inline__ int test_and_set_bit(int nr, volatile void *addr)
{
int mask, retval;
- volatile unsigned int *a = (volatile unsigned int *)
addr;
+ volatile unsigned int *a = (volatile unsigned int *)addr;
unsigned long flags;
a += nr >> 5;
mask = 1 << (nr & 0x1f);
unsigned long flags;
a += nr >> 5;
mask = 1 << (nr & 0x1f);
-
save_and_cli
(flags);
+
local_irq_save
(flags);
retval = (mask & *a) != 0;
*a |= mask;
retval = (mask & *a) != 0;
*a |= mask;
-
restore_flags
(flags);
+
local_irq_restore
(flags);
return retval;
}
return retval;
}
@@
-140,7
+140,7
@@
static __inline__ int test_and_set_bit(int nr, volatile void *addr)
static __inline__ int __test_and_set_bit(int nr, volatile void *addr)
{
int mask, retval;
static __inline__ int __test_and_set_bit(int nr, volatile void *addr)
{
int mask, retval;
- volatile unsigned int *a = (volatile unsigned int *)
addr;
+ volatile unsigned int *a = (volatile unsigned int *)addr;
a += nr >> 5;
mask = 1 << (nr & 0x1f);
a += nr >> 5;
mask = 1 << (nr & 0x1f);
@@
-152,15
+152,15
@@
static __inline__ int __test_and_set_bit(int nr, volatile void *addr)
static __inline__ int test_and_clear_bit(int nr, volatile void *addr)
{
int mask, retval;
static __inline__ int test_and_clear_bit(int nr, volatile void *addr)
{
int mask, retval;
- volatile unsigned int *a = (volatile unsigned int *)
addr;
+ volatile unsigned int *a = (volatile unsigned int *)addr;
unsigned long flags;
a += nr >> 5;
mask = 1 << (nr & 0x1f);
unsigned long flags;
a += nr >> 5;
mask = 1 << (nr & 0x1f);
-
save_and_cli
(flags);
+
local_irq_save
(flags);
retval = (mask & *a) != 0;
*a &= ~mask;
retval = (mask & *a) != 0;
*a &= ~mask;
-
restore_flags
(flags);
+
local_irq_restore
(flags);
return retval;
}
return retval;
}
@@
-168,7
+168,7
@@
static __inline__ int test_and_clear_bit(int nr, volatile void *addr)
static __inline__ int __test_and_clear_bit(int nr, volatile void *addr)
{
int mask, retval;
static __inline__ int __test_and_clear_bit(int nr, volatile void *addr)
{
int mask, retval;
- volatile unsigned int *a = (volatile unsigned int *)
addr;
+ volatile unsigned int *a = (volatile unsigned int *)addr;
a += nr >> 5;
mask = 1 << (nr & 0x1f);
a += nr >> 5;
mask = 1 << (nr & 0x1f);
@@
-180,15
+180,15
@@
static __inline__ int __test_and_clear_bit(int nr, volatile void *addr)
static __inline__ int test_and_change_bit(int nr, volatile void *addr)
{
int mask, retval;
static __inline__ int test_and_change_bit(int nr, volatile void *addr)
{
int mask, retval;
- volatile unsigned int *a = (volatile unsigned int *)
addr;
+ volatile unsigned int *a = (volatile unsigned int *)addr;
unsigned long flags;
a += nr >> 5;
mask = 1 << (nr & 0x1f);
unsigned long flags;
a += nr >> 5;
mask = 1 << (nr & 0x1f);
-
save_and_cli
(flags);
+
local_irq_save
(flags);
retval = (mask & *a) != 0;
*a ^= mask;
retval = (mask & *a) != 0;
*a ^= mask;
-
restore_flags
(flags);
+
local_irq_restore
(flags);
return retval;
}
return retval;
}
@@
-196,7
+196,7
@@
static __inline__ int test_and_change_bit(int nr, volatile void *addr)
static __inline__ int __test_and_change_bit(int nr, volatile void *addr)
{
int mask, retval;
static __inline__ int __test_and_change_bit(int nr, volatile void *addr)
{
int mask, retval;
- volatile unsigned int *a = (volatile unsigned int *)
addr;
+ volatile unsigned int *a = (volatile unsigned int *)addr;
a += nr >> 5;
mask = 1 << (nr & 0x1f);
a += nr >> 5;
mask = 1 << (nr & 0x1f);
@@
-208,16
+208,15
@@
static __inline__ int __test_and_change_bit(int nr, volatile void *addr)
/*
* This routine doesn't need to be atomic.
*/
/*
* This routine doesn't need to be atomic.
*/
-static __inline__ int __constant_test_bit(int nr,
- const volatile void *addr)
+static __inline__ int __constant_test_bit(int nr, const volatile void *addr)
{
return ((1UL << (nr & 31)) &
{
return ((1UL << (nr & 31)) &
- (((const volatile unsigned int *)
addr)[nr >> 5])) != 0;
+ (((const volatile unsigned int *)addr)[nr >> 5])) != 0;
}
static __inline__ int __test_bit(int nr, volatile void *addr)
{
}
static __inline__ int __test_bit(int nr, volatile void *addr)
{
- int *a = (int *)
addr;
+ int *a = (int *)addr;
int mask;
a += nr >> 5;
int mask;
a += nr >> 5;
@@
-235,7
+234,7
@@
static __inline__ int __test_bit(int nr, volatile void *addr)
static __inline__ int find_next_zero_bit(void *addr, int size, int offset)
{
static __inline__ int find_next_zero_bit(void *addr, int size, int offset)
{
- unsigned long *p = ((unsigned long *)
addr) + (offset >> 5);
+ unsigned long *p = ((unsigned long *)addr) + (offset >> 5);
unsigned long result = offset & ~31UL;
unsigned long tmp;
unsigned long result = offset & ~31UL;
unsigned long tmp;
@@
-290,14
+289,14
@@
static __inline__ int ext2_set_bit(int nr, volatile void *addr)
{
int mask, retval;
unsigned long flags;
{
int mask, retval;
unsigned long flags;
- volatile unsigned char *ADDR = (unsigned char *)
addr;
+ volatile unsigned char *ADDR = (unsigned char *)addr;
ADDR += nr >> 3;
mask = 1 << (nr & 0x07);
ADDR += nr >> 3;
mask = 1 << (nr & 0x07);
-
save_and_cli
(flags);
+
local_irq_save
(flags);
retval = (mask & *ADDR) != 0;
*ADDR |= mask;
retval = (mask & *ADDR) != 0;
*ADDR |= mask;
-
restore_flags
(flags);
+
local_irq_restore
(flags);
return retval;
}
return retval;
}
@@
-305,21
+304,21
@@
static __inline__ int ext2_clear_bit(int nr, volatile void *addr)
{
int mask, retval;
unsigned long flags;
{
int mask, retval;
unsigned long flags;
- volatile unsigned char *ADDR = (unsigned char *)
addr;
+ volatile unsigned char *ADDR = (unsigned char *)addr;
ADDR += nr >> 3;
mask = 1 << (nr & 0x07);
ADDR += nr >> 3;
mask = 1 << (nr & 0x07);
-
save_and_cli
(flags);
+
local_irq_save
(flags);
retval = (mask & *ADDR) != 0;
*ADDR &= ~mask;
retval = (mask & *ADDR) != 0;
*ADDR &= ~mask;
-
restore_flags
(flags);
+
local_irq_restore
(flags);
return retval;
}
static __inline__ int ext2_test_bit(int nr, const volatile void *addr)
{
int mask;
return retval;
}
static __inline__ int ext2_test_bit(int nr, const volatile void *addr)
{
int mask;
- const volatile unsigned char *ADDR = (const unsigned char *)
addr;
+ const volatile unsigned char *ADDR = (const unsigned char *)addr;
ADDR += nr >> 3;
mask = 1 << (nr & 0x07);
ADDR += nr >> 3;
mask = 1 << (nr & 0x07);
@@
-331,10
+330,9
@@
static __inline__ int ext2_test_bit(int nr, const volatile void *addr)
static __inline__ unsigned long ext2_find_next_zero_bit(void *addr,
unsigned long size,
static __inline__ unsigned long ext2_find_next_zero_bit(void *addr,
unsigned long size,
- unsigned long
- offset)
+ unsigned long offset)
{
{
- unsigned long *p = ((unsigned long *)
addr) + (offset >> 5);
+ unsigned long *p = ((unsigned long *)addr) + (offset >> 5);
unsigned long result = offset & ~31UL;
unsigned long tmp;
unsigned long result = offset & ~31UL;
unsigned long tmp;