Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
16b529d1
Commit
16b529d1
authored
Nov 20, 2008
by
Paul Mundt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sh: Convert to generic bitops for IRQ-toggling implementation.
Signed-off-by:
Paul Mundt
<
lethal@linux-sh.org
>
parent
709420dd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
95 deletions
+7
-95
arch/sh/include/asm/bitops-grb.h
arch/sh/include/asm/bitops-grb.h
+3
-0
arch/sh/include/asm/bitops-irq.h
arch/sh/include/asm/bitops-irq.h
+0
-91
arch/sh/include/asm/bitops-llsc.h
arch/sh/include/asm/bitops-llsc.h
+2
-0
arch/sh/include/asm/bitops.h
arch/sh/include/asm/bitops.h
+2
-4
No files found.
arch/sh/include/asm/bitops-grb.h
View file @
16b529d1
...
...
@@ -166,4 +166,7 @@ static inline int test_and_change_bit(int nr, volatile void * addr)
return
retval
;
}
#include <asm-generic/bitops/non-atomic.h>
#endif
/* __ASM_SH_BITOPS_GRB_H */
arch/sh/include/asm/bitops-irq.h
deleted
100644 → 0
View file @
709420dd
#ifndef __ASM_SH_BITOPS_IRQ_H
#define __ASM_SH_BITOPS_IRQ_H
static
inline
void
set_bit
(
int
nr
,
volatile
void
*
addr
)
{
int
mask
;
volatile
unsigned
int
*
a
=
addr
;
unsigned
long
flags
;
a
+=
nr
>>
5
;
mask
=
1
<<
(
nr
&
0x1f
);
local_irq_save
(
flags
);
*
a
|=
mask
;
local_irq_restore
(
flags
);
}
static
inline
void
clear_bit
(
int
nr
,
volatile
void
*
addr
)
{
int
mask
;
volatile
unsigned
int
*
a
=
addr
;
unsigned
long
flags
;
a
+=
nr
>>
5
;
mask
=
1
<<
(
nr
&
0x1f
);
local_irq_save
(
flags
);
*
a
&=
~
mask
;
local_irq_restore
(
flags
);
}
static
inline
void
change_bit
(
int
nr
,
volatile
void
*
addr
)
{
int
mask
;
volatile
unsigned
int
*
a
=
addr
;
unsigned
long
flags
;
a
+=
nr
>>
5
;
mask
=
1
<<
(
nr
&
0x1f
);
local_irq_save
(
flags
);
*
a
^=
mask
;
local_irq_restore
(
flags
);
}
static
inline
int
test_and_set_bit
(
int
nr
,
volatile
void
*
addr
)
{
int
mask
,
retval
;
volatile
unsigned
int
*
a
=
addr
;
unsigned
long
flags
;
a
+=
nr
>>
5
;
mask
=
1
<<
(
nr
&
0x1f
);
local_irq_save
(
flags
);
retval
=
(
mask
&
*
a
)
!=
0
;
*
a
|=
mask
;
local_irq_restore
(
flags
);
return
retval
;
}
static
inline
int
test_and_clear_bit
(
int
nr
,
volatile
void
*
addr
)
{
int
mask
,
retval
;
volatile
unsigned
int
*
a
=
addr
;
unsigned
long
flags
;
a
+=
nr
>>
5
;
mask
=
1
<<
(
nr
&
0x1f
);
local_irq_save
(
flags
);
retval
=
(
mask
&
*
a
)
!=
0
;
*
a
&=
~
mask
;
local_irq_restore
(
flags
);
return
retval
;
}
static
inline
int
test_and_change_bit
(
int
nr
,
volatile
void
*
addr
)
{
int
mask
,
retval
;
volatile
unsigned
int
*
a
=
addr
;
unsigned
long
flags
;
a
+=
nr
>>
5
;
mask
=
1
<<
(
nr
&
0x1f
);
local_irq_save
(
flags
);
retval
=
(
mask
&
*
a
)
!=
0
;
*
a
^=
mask
;
local_irq_restore
(
flags
);
return
retval
;
}
#endif
/* __ASM_SH_BITOPS_IRQ_H */
arch/sh/include/asm/bitops-llsc.h
View file @
16b529d1
...
...
@@ -141,4 +141,6 @@ static inline int test_and_change_bit(int nr, volatile void * addr)
return
retval
!=
0
;
}
#include <asm-generic/bitops/non-atomic.h>
#endif
/* __ASM_SH_BITOPS_LLSC_H */
arch/sh/include/asm/bitops.h
View file @
16b529d1
...
...
@@ -16,18 +16,16 @@
#elif defined(CONFIG_CPU_SH4A)
#include <asm/bitops-llsc.h>
#else
#include <asm/bitops-irq.h>
#include <asm-generic/bitops/atomic.h>
#include <asm-generic/bitops/non-atomic.h>
#endif
/*
* clear_bit() doesn't provide any barrier for the compiler.
*/
#define smp_mb__before_clear_bit() barrier()
#define smp_mb__after_clear_bit() barrier()
#include <asm-generic/bitops/non-atomic.h>
#ifdef CONFIG_SUPERH32
static
inline
unsigned
long
ffz
(
unsigned
long
word
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment