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
a1952ca9
Commit
a1952ca9
authored
Aug 03, 2002
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPARC64 NS87303: Replace cli/sti with spinlocking.
parent
0b9daf11
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
arch/sparc64/kernel/devices.c
arch/sparc64/kernel/devices.c
+6
-0
arch/sparc64/kernel/sparc64_ksyms.c
arch/sparc64/kernel/sparc64_ksyms.c
+4
-0
include/asm-sparc64/ns87303.h
include/asm-sparc64/ns87303.h
+8
-2
No files found.
arch/sparc64/kernel/devices.c
View file @
a1952ca9
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
#include <linux/init.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/ioport.h>
#include <linux/string.h>
#include <linux/string.h>
#include <linux/spinlock.h>
#include <asm/page.h>
#include <asm/page.h>
#include <asm/oplib.h>
#include <asm/oplib.h>
...
@@ -17,6 +18,11 @@
...
@@ -17,6 +18,11 @@
#include <asm/smp.h>
#include <asm/smp.h>
#include <asm/spitfire.h>
#include <asm/spitfire.h>
/* Used to synchronize acceses to NatSemi SUPER I/O chip configure
* operations in asm/ns87303.h
*/
spinlock_t
ns87303_lock
=
SPIN_LOCK_UNLOCKED
;
struct
prom_cpuinfo
linux_cpus
[
NR_CPUS
]
__initdata
=
{
{
0
}
};
struct
prom_cpuinfo
linux_cpus
[
NR_CPUS
]
__initdata
=
{
{
0
}
};
unsigned
prom_cpu_nodes
[
NR_CPUS
];
unsigned
prom_cpu_nodes
[
NR_CPUS
];
int
linux_num_cpus
=
0
;
int
linux_num_cpus
=
0
;
...
...
arch/sparc64/kernel/sparc64_ksyms.c
View file @
a1952ca9
...
@@ -52,6 +52,7 @@
...
@@ -52,6 +52,7 @@
#include <asm/isa.h>
#include <asm/isa.h>
#endif
#endif
#include <asm/a.out.h>
#include <asm/a.out.h>
#include <asm/ns87303.h>
struct
poll
{
struct
poll
{
int
fd
;
int
fd
;
...
@@ -373,3 +374,6 @@ EXPORT_SYMBOL(kbd_pt_regs);
...
@@ -373,3 +374,6 @@ EXPORT_SYMBOL(kbd_pt_regs);
#ifdef CONFIG_DEBUG_BUGVERBOSE
#ifdef CONFIG_DEBUG_BUGVERBOSE
EXPORT_SYMBOL
(
do_BUG
);
EXPORT_SYMBOL
(
do_BUG
);
#endif
#endif
/* for ns8703 */
EXPORT_SYMBOL
(
ns87303_lock
);
include/asm-sparc64/ns87303.h
View file @
a1952ca9
...
@@ -78,9 +78,13 @@
...
@@ -78,9 +78,13 @@
#ifdef __KERNEL__
#ifdef __KERNEL__
#include <linux/spinlock.h>
#include <asm/system.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/io.h>
extern
spinlock_t
ns87303_lock
;
static
__inline__
int
ns87303_modify
(
unsigned
long
port
,
unsigned
int
index
,
static
__inline__
int
ns87303_modify
(
unsigned
long
port
,
unsigned
int
index
,
unsigned
char
clr
,
unsigned
char
set
)
unsigned
char
clr
,
unsigned
char
set
)
{
{
...
@@ -96,14 +100,16 @@ static __inline__ int ns87303_modify(unsigned long port, unsigned int index,
...
@@ -96,14 +100,16 @@ static __inline__ int ns87303_modify(unsigned long port, unsigned int index,
if
(
index
>
0x0d
)
if
(
index
>
0x0d
)
return
-
EINVAL
;
return
-
EINVAL
;
save_flags
(
flags
);
cli
();
spin_lock_irqsave
(
&
ns87303_lock
,
flags
);
outb
(
index
,
port
);
outb
(
index
,
port
);
value
=
inb
(
port
+
1
);
value
=
inb
(
port
+
1
);
value
&=
~
(
reserved
[
index
]
|
clr
);
value
&=
~
(
reserved
[
index
]
|
clr
);
value
|=
set
;
value
|=
set
;
outb
(
value
,
port
+
1
);
outb
(
value
,
port
+
1
);
outb
(
value
,
port
+
1
);
outb
(
value
,
port
+
1
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
ns87303_lock
,
flags
);
return
0
;
return
0
;
}
}
...
...
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