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
nexedi
linux
Commits
313ef38b
Commit
313ef38b
authored
Feb 10, 2005
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge nuts.davemloft.net:/disk1/BK/sparcwork-2.6
into nuts.davemloft.net:/disk1/BK/sparc-2.6
parents
eeca3f34
8bf95585
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
146 additions
and
133 deletions
+146
-133
Documentation/atomic_ops.txt
Documentation/atomic_ops.txt
+9
-9
arch/sparc/kernel/pcic.c
arch/sparc/kernel/pcic.c
+24
-18
arch/sparc/kernel/ptrace.c
arch/sparc/kernel/ptrace.c
+6
-6
arch/sparc/kernel/signal.c
arch/sparc/kernel/signal.c
+2
-2
arch/sparc/kernel/sparc_ksyms.c
arch/sparc/kernel/sparc_ksyms.c
+4
-0
arch/sparc/kernel/sys_sparc.c
arch/sparc/kernel/sys_sparc.c
+1
-2
arch/sparc/lib/atomic32.c
arch/sparc/lib/atomic32.c
+2
-1
arch/sparc64/kernel/ptrace.c
arch/sparc64/kernel/ptrace.c
+3
-3
arch/sparc64/prom/memory.c
arch/sparc64/prom/memory.c
+5
-5
drivers/net/sunlance.c
drivers/net/sunlance.c
+69
-66
include/asm-sparc/checksum.h
include/asm-sparc/checksum.h
+4
-4
include/asm-sparc/elf.h
include/asm-sparc/elf.h
+2
-2
include/asm-sparc/floppy.h
include/asm-sparc/floppy.h
+1
-1
include/asm-sparc/io.h
include/asm-sparc/io.h
+6
-6
include/asm-sparc/svr4.h
include/asm-sparc/svr4.h
+3
-3
include/asm-sparc/system.h
include/asm-sparc/system.h
+1
-1
include/asm-sparc64/fbio.h
include/asm-sparc64/fbio.h
+2
-2
include/asm-sparc64/io.h
include/asm-sparc64/io.h
+2
-2
No files found.
Documentation/atomic_ops.txt
View file @
313ef38b
...
...
@@ -119,15 +119,15 @@ If a caller requires memory barrier semantics around an atomic_t
operation which does not return a value, a set of interfaces are
defined which accomplish this:
void sm
b
_mb__before_atomic_dec(void);
void sm
b
_mb__after_atomic_dec(void);
void sm
b
_mb__before_atomic_inc(void);
void sm
b
_mb__after_atomic_dec(void);
void sm
p
_mb__before_atomic_dec(void);
void sm
p
_mb__after_atomic_dec(void);
void sm
p
_mb__before_atomic_inc(void);
void sm
p
_mb__after_atomic_dec(void);
For example, sm
b
_mb__before_atomic_dec() can be used like so:
For example, sm
p
_mb__before_atomic_dec() can be used like so:
obj->dead = 1;
sm
b
_mb__before_atomic_dec();
sm
p
_mb__before_atomic_dec();
atomic_dec(&obj->ref_count);
It makes sure that all memory operations preceeding the atomic_dec()
...
...
@@ -136,14 +136,14 @@ operation. In the above example, it guarentees that the assignment of
"1" to obj->dead will be globally visible to other cpus before the
atomic counter decrement.
Without the explicitl sm
b
_mb__before_atomic_dec() call, the
Without the explicitl sm
p
_mb__before_atomic_dec() call, the
implementation could legally allow the atomic counter update visible
to other cpus before the "obj->dead = 1;" assignment.
The other three interfaces listed are used to provide explicit
ordering with respect to memory operations after an atomic_dec() call
(sm
b
_mb__after_atomic_dec()) and around atomic_inc() calls
(sm
b
_mb__{before,after}_atomic_inc()).
(sm
p
_mb__after_atomic_dec()) and around atomic_inc() calls
(sm
p
_mb__{before,after}_atomic_inc()).
A missing memory barrier in the cases where they are required by the
atomic_t implementation above can have disasterous results. Here is
...
...
arch/sparc/kernel/pcic.c
View file @
313ef38b
...
...
@@ -975,60 +975,66 @@ int pcibios_assign_resource(struct pci_dev *pdev, int resource)
* We do not use horroble macroses here because we want to
* advance pointer by sizeof(size).
*/
void
outsb
(
void
*
__iomem
addr
,
const
void
*
src
,
unsigned
long
count
)
{
void
outsb
(
unsigned
long
addr
,
const
void
*
src
,
unsigned
long
count
)
{
while
(
count
)
{
count
-=
1
;
write
b
(
*
(
const
char
*
)
src
,
addr
);
out
b
(
*
(
const
char
*
)
src
,
addr
);
src
+=
1
;
addr
+=
1
;
/* addr += 1; */
}
}
void
outsw
(
void
*
__iomem
addr
,
const
void
*
src
,
unsigned
long
count
)
{
void
outsw
(
unsigned
long
addr
,
const
void
*
src
,
unsigned
long
count
)
{
while
(
count
)
{
count
-=
2
;
write
w
(
*
(
const
short
*
)
src
,
addr
);
out
w
(
*
(
const
short
*
)
src
,
addr
);
src
+=
2
;
addr
+=
2
;
/* addr += 2; */
}
}
void
outsl
(
void
*
__iomem
addr
,
const
void
*
src
,
unsigned
long
count
)
{
void
outsl
(
unsigned
long
addr
,
const
void
*
src
,
unsigned
long
count
)
{
while
(
count
)
{
count
-=
4
;
write
l
(
*
(
const
long
*
)
src
,
addr
);
out
l
(
*
(
const
long
*
)
src
,
addr
);
src
+=
4
;
addr
+=
4
;
/* addr += 4; */
}
}
void
insb
(
void
*
__iomem
addr
,
void
*
dst
,
unsigned
long
count
)
{
void
insb
(
unsigned
long
addr
,
void
*
dst
,
unsigned
long
count
)
{
while
(
count
)
{
count
-=
1
;
*
(
unsigned
char
*
)
dst
=
read
b
(
addr
);
*
(
unsigned
char
*
)
dst
=
in
b
(
addr
);
dst
+=
1
;
addr
+=
1
;
/* addr += 1; */
}
}
void
insw
(
void
*
__iomem
addr
,
void
*
dst
,
unsigned
long
count
)
{
void
insw
(
unsigned
long
addr
,
void
*
dst
,
unsigned
long
count
)
{
while
(
count
)
{
count
-=
2
;
*
(
unsigned
short
*
)
dst
=
read
w
(
addr
);
*
(
unsigned
short
*
)
dst
=
in
w
(
addr
);
dst
+=
2
;
addr
+=
2
;
/* addr += 2; */
}
}
void
insl
(
void
*
__iomem
addr
,
void
*
dst
,
unsigned
long
count
)
{
void
insl
(
unsigned
long
addr
,
void
*
dst
,
unsigned
long
count
)
{
while
(
count
)
{
count
-=
4
;
/*
* XXX I am sure we are in for an unaligned trap here.
*/
*
(
unsigned
long
*
)
dst
=
read
l
(
addr
);
*
(
unsigned
long
*
)
dst
=
in
l
(
addr
);
dst
+=
4
;
addr
+=
4
;
/* addr += 4; */
}
}
...
...
arch/sparc/kernel/ptrace.c
View file @
313ef38b
...
...
@@ -48,9 +48,9 @@ static inline void pt_succ_return(struct pt_regs *regs, unsigned long value)
}
static
void
pt_succ_return_linux
(
struct
pt_regs
*
regs
,
unsigned
long
value
,
long
*
addr
)
pt_succ_return_linux
(
struct
pt_regs
*
regs
,
unsigned
long
value
,
long
__user
*
addr
)
{
if
(
put_user
(
value
,
(
long
__user
*
)
addr
))
{
if
(
put_user
(
value
,
addr
))
{
pt_error_return
(
regs
,
EFAULT
);
return
;
}
...
...
@@ -61,7 +61,7 @@ pt_succ_return_linux(struct pt_regs *regs, unsigned long value, long *addr)
}
static
void
pt_os_succ_return
(
struct
pt_regs
*
regs
,
unsigned
long
val
,
long
*
addr
)
pt_os_succ_return
(
struct
pt_regs
*
regs
,
unsigned
long
val
,
long
__user
*
addr
)
{
if
(
current
->
personality
==
PER_SUNOS
)
pt_succ_return
(
regs
,
val
);
...
...
@@ -71,7 +71,7 @@ pt_os_succ_return (struct pt_regs *regs, unsigned long val, long *addr)
/* Fuck me gently with a chainsaw... */
static
inline
void
read_sunos_user
(
struct
pt_regs
*
regs
,
unsigned
long
offset
,
struct
task_struct
*
tsk
,
long
*
addr
)
struct
task_struct
*
tsk
,
long
__user
*
addr
)
{
struct
pt_regs
*
cregs
=
tsk
->
thread
.
kregs
;
struct
thread_info
*
t
=
tsk
->
thread_info
;
...
...
@@ -345,14 +345,14 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
if
(
access_process_vm
(
child
,
addr
,
&
tmp
,
sizeof
(
tmp
),
0
)
==
sizeof
(
tmp
))
pt_os_succ_return
(
regs
,
tmp
,
(
long
*
)
data
);
pt_os_succ_return
(
regs
,
tmp
,
(
long
__user
*
)
data
);
else
pt_error_return
(
regs
,
EIO
);
goto
out_tsk
;
}
case
PTRACE_PEEKUSR
:
read_sunos_user
(
regs
,
addr
,
child
,
(
long
*
)
data
);
read_sunos_user
(
regs
,
addr
,
child
,
(
long
__user
*
)
data
);
goto
out_tsk
;
case
PTRACE_POKEUSR
:
...
...
arch/sparc/kernel/signal.c
View file @
313ef38b
...
...
@@ -535,7 +535,7 @@ setup_frame(struct sigaction *sa, struct pt_regs *regs, int signr, sigset_t *old
sig_address
=
NULL
;
}
}
err
|=
__put_user
((
long
)
sig_address
,
&
sframep
->
sig_address
);
err
|=
__put_user
((
unsigned
long
)
sig_address
,
&
sframep
->
sig_address
);
err
|=
__put_user
(
sig_code
,
&
sframep
->
sig_code
);
err
|=
__put_user
(
sc
,
&
sframep
->
sig_scptr
);
if
(
err
)
...
...
@@ -832,7 +832,7 @@ setup_svr4_frame(struct sigaction *sa, unsigned long pc, unsigned long npc,
* to flush the user windows.
*/
for
(
window
=
0
;
window
<
tp
->
w_saved
;
window
++
)
{
err
|=
__put_user
((
int
*
)
&
(
gw
->
win
[
window
]),
&
gw
->
winptr
[
window
]);
err
|=
__put_user
((
int
__user
*
)
&
(
gw
->
win
[
window
]),
&
gw
->
winptr
[
window
]);
err
|=
__copy_to_user
(
&
gw
->
win
[
window
],
&
tp
->
reg_window
[
window
],
sizeof
(
svr4_rwindow_t
));
...
...
arch/sparc/kernel/sparc_ksyms.c
View file @
313ef38b
...
...
@@ -202,6 +202,10 @@ EXPORT_SYMBOL(sbus_ioremap);
#endif
#ifdef CONFIG_PCI
EXPORT_SYMBOL
(
ebus_chain
);
EXPORT_SYMBOL
(
insb
);
EXPORT_SYMBOL
(
outsb
);
EXPORT_SYMBOL
(
insw
);
EXPORT_SYMBOL
(
outsw
);
EXPORT_SYMBOL
(
insl
);
EXPORT_SYMBOL
(
outsl
);
EXPORT_SYMBOL
(
pci_alloc_consistent
);
...
...
arch/sparc/kernel/sys_sparc.c
View file @
313ef38b
...
...
@@ -197,8 +197,7 @@ asmlinkage int sys_ipc (uint call, int first, int second, int third, void __user
goto
out
;
}
case
1
:
/* iBCS2 emulator entry point */
err
=
do_shmat
(
first
,
(
char
__user
*
)
ptr
,
second
,
(
ulong
*
)
third
);
err
=
-
EINVAL
;
goto
out
;
}
case
SHMDT
:
...
...
arch/sparc/lib/atomic32.c
View file @
313ef38b
...
...
@@ -20,8 +20,9 @@ spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] = {
#else
/* SMP */
static
spinlock_t
dummy
=
SPIN_LOCK_UNLOCKED
;
#define ATOMIC_HASH_SIZE 1
#define ATOMIC_HASH(a)
0
#define ATOMIC_HASH(a)
(&dummy)
#endif
/* SMP */
...
...
arch/sparc64/kernel/ptrace.c
View file @
313ef38b
...
...
@@ -50,7 +50,7 @@ static inline void pt_succ_return(struct pt_regs *regs, unsigned long value)
}
static
inline
void
pt_succ_return_linux
(
struct
pt_regs
*
regs
,
unsigned
long
value
,
long
*
addr
)
pt_succ_return_linux
(
struct
pt_regs
*
regs
,
unsigned
long
value
,
void
__user
*
addr
)
{
if
(
test_thread_flag
(
TIF_32BIT
))
{
if
(
put_user
(
value
,
(
unsigned
int
__user
*
)
addr
))
{
...
...
@@ -70,7 +70,7 @@ pt_succ_return_linux(struct pt_regs *regs, unsigned long value, long *addr)
}
static
void
pt_os_succ_return
(
struct
pt_regs
*
regs
,
unsigned
long
val
,
long
*
addr
)
pt_os_succ_return
(
struct
pt_regs
*
regs
,
unsigned
long
val
,
void
__user
*
addr
)
{
if
(
current
->
personality
==
PER_SUNOS
)
pt_succ_return
(
regs
,
val
);
...
...
@@ -226,7 +226,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
if
(
res
<
0
)
pt_error_return
(
regs
,
-
res
);
else
pt_os_succ_return
(
regs
,
tmp64
,
(
long
*
)
data
);
pt_os_succ_return
(
regs
,
tmp64
,
(
void
__user
*
)
data
);
goto
flush_and_out
;
}
...
...
arch/sparc64/prom/memory.c
View file @
313ef38b
...
...
@@ -45,9 +45,9 @@ prom_sortmemlist(struct linux_mlist_p1275 *thislist)
unsigned
long
tmpaddr
,
tmpsize
;
unsigned
long
lowest
;
for
(
i
=
0
;
thislist
[
i
].
theres_more
!=
0
;
i
++
)
{
for
(
i
=
0
;
thislist
[
i
].
theres_more
;
i
++
)
{
lowest
=
thislist
[
i
].
start_adr
;
for
(
mitr
=
i
+
1
;
thislist
[
mitr
-
1
].
theres_more
!=
0
;
mitr
++
)
for
(
mitr
=
i
+
1
;
thislist
[
mitr
-
1
].
theres_more
;
mitr
++
)
if
(
thislist
[
mitr
].
start_adr
<
lowest
)
{
lowest
=
thislist
[
mitr
].
start_adr
;
swapi
=
mitr
;
...
...
@@ -83,7 +83,7 @@ void __init prom_meminit(void)
prom_phys_avail
[
iter
].
theres_more
=
&
prom_phys_avail
[
iter
+
1
];
}
prom_phys_avail
[
iter
-
1
].
theres_more
=
0x0
;
prom_phys_avail
[
iter
-
1
].
theres_more
=
NULL
;
num_regs
=
prom_getproperty
(
node
,
"reg"
,
(
char
*
)
prom_reg_memlist
,
...
...
@@ -97,7 +97,7 @@ void __init prom_meminit(void)
prom_phys_total
[
iter
].
theres_more
=
&
prom_phys_total
[
iter
+
1
];
}
prom_phys_total
[
iter
-
1
].
theres_more
=
0x0
;
prom_phys_total
[
iter
-
1
].
theres_more
=
NULL
;
node
=
prom_finddevice
(
"/virtual-memory"
);
num_regs
=
prom_getproperty
(
node
,
"available"
,
...
...
@@ -116,7 +116,7 @@ void __init prom_meminit(void)
prom_prom_taken
[
iter
].
theres_more
=
&
prom_prom_taken
[
iter
+
1
];
}
prom_prom_taken
[
iter
-
1
].
theres_more
=
0x0
;
prom_prom_taken
[
iter
-
1
].
theres_more
=
NULL
;
prom_sortmemlist
(
prom_prom_taken
);
...
...
drivers/net/sunlance.c
View file @
313ef38b
...
...
@@ -232,7 +232,8 @@ struct lance_init_block {
struct
lance_private
{
void
__iomem
*
lregs
;
/* Lance RAP/RDP regs. */
void
__iomem
*
dregs
;
/* DMA controller regs. */
struct
lance_init_block
*
init_block
;
struct
lance_init_block
__iomem
*
init_block_iomem
;
struct
lance_init_block
*
init_block_mem
;
spinlock_t
lock
;
...
...
@@ -314,7 +315,7 @@ static void load_csrs(struct lance_private *lp)
static
void
lance_init_ring_dvma
(
struct
net_device
*
dev
)
{
struct
lance_private
*
lp
=
netdev_priv
(
dev
);
struct
lance_init_block
*
ib
=
lp
->
init_block
;
struct
lance_init_block
*
ib
=
lp
->
init_block
_mem
;
dma_addr_t
aib
=
lp
->
init_block_dvma
;
__u32
leptr
;
int
i
;
...
...
@@ -371,7 +372,7 @@ static void lance_init_ring_dvma(struct net_device *dev)
static
void
lance_init_ring_pio
(
struct
net_device
*
dev
)
{
struct
lance_private
*
lp
=
netdev_priv
(
dev
);
struct
lance_init_block
*
ib
=
lp
->
init_block
;
struct
lance_init_block
__iomem
*
ib
=
lp
->
init_block_iomem
;
u32
leptr
;
int
i
;
...
...
@@ -501,7 +502,7 @@ static int init_restart_lance(struct lance_private *lp)
static
void
lance_rx_dvma
(
struct
net_device
*
dev
)
{
struct
lance_private
*
lp
=
netdev_priv
(
dev
);
struct
lance_init_block
*
ib
=
lp
->
init_block
;
struct
lance_init_block
*
ib
=
lp
->
init_block
_mem
;
struct
lance_rx_desc
*
rd
;
u8
bits
;
int
len
,
entry
=
lp
->
rx_new
;
...
...
@@ -564,7 +565,7 @@ static void lance_rx_dvma(struct net_device *dev)
static
void
lance_tx_dvma
(
struct
net_device
*
dev
)
{
struct
lance_private
*
lp
=
netdev_priv
(
dev
);
struct
lance_init_block
*
ib
=
lp
->
init_block
;
struct
lance_init_block
*
ib
=
lp
->
init_block
_mem
;
int
i
,
j
;
spin_lock
(
&
lp
->
lock
);
...
...
@@ -674,8 +675,8 @@ static void lance_piocopy_to_skb(struct sk_buff *skb, void __iomem *piobuf, int
static
void
lance_rx_pio
(
struct
net_device
*
dev
)
{
struct
lance_private
*
lp
=
netdev_priv
(
dev
);
struct
lance_init_block
*
ib
=
lp
->
init_block
;
struct
lance_rx_desc
*
rd
;
struct
lance_init_block
__iomem
*
ib
=
lp
->
init_block_iomem
;
struct
lance_rx_desc
__iomem
*
rd
;
unsigned
char
bits
;
int
len
,
entry
;
struct
sk_buff
*
skb
;
...
...
@@ -736,14 +737,14 @@ static void lance_rx_pio(struct net_device *dev)
static
void
lance_tx_pio
(
struct
net_device
*
dev
)
{
struct
lance_private
*
lp
=
netdev_priv
(
dev
);
struct
lance_init_block
*
ib
=
lp
->
init_block
;
struct
lance_init_block
__iomem
*
ib
=
lp
->
init_block_iomem
;
int
i
,
j
;
spin_lock
(
&
lp
->
lock
);
j
=
lp
->
tx_old
;
for
(
i
=
j
;
i
!=
lp
->
tx_new
;
i
=
j
)
{
struct
lance_tx_desc
*
td
=
&
ib
->
btx_ring
[
i
];
struct
lance_tx_desc
__iomem
*
td
=
&
ib
->
btx_ring
[
i
];
u8
bits
=
sbus_readb
(
&
td
->
tmd1_bits
);
/* If we hit a packet not owned by us, stop */
...
...
@@ -880,15 +881,13 @@ static irqreturn_t lance_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static
void
build_fake_packet
(
struct
lance_private
*
lp
)
{
struct
net_device
*
dev
=
lp
->
dev
;
struct
lance_init_block
*
ib
=
lp
->
init_block
;
u16
*
packet
;
struct
ethhdr
*
eth
;
int
i
,
entry
;
entry
=
lp
->
tx_new
&
TX_RING_MOD_MASK
;
packet
=
(
u16
*
)
&
(
ib
->
tx_buf
[
entry
][
0
]);
eth
=
(
struct
ethhdr
*
)
packet
;
if
(
lp
->
pio_buffer
)
{
struct
lance_init_block
__iomem
*
ib
=
lp
->
init_block_iomem
;
u16
__iomem
*
packet
=
(
u16
__iomem
*
)
&
(
ib
->
tx_buf
[
entry
][
0
]);
struct
ethhdr
__iomem
*
eth
=
(
struct
ethhdr
__iomem
*
)
packet
;
for
(
i
=
0
;
i
<
(
ETH_ZLEN
/
sizeof
(
u16
));
i
++
)
sbus_writew
(
0
,
&
packet
[
i
]);
for
(
i
=
0
;
i
<
6
;
i
++
)
{
...
...
@@ -899,6 +898,9 @@ static void build_fake_packet(struct lance_private *lp)
sbus_writew
(
0
,
&
ib
->
btx_ring
[
entry
].
misc
);
sbus_writeb
(
LE_T1_POK
|
LE_T1_OWN
,
&
ib
->
btx_ring
[
entry
].
tmd1_bits
);
}
else
{
struct
lance_init_block
*
ib
=
lp
->
init_block_mem
;
u16
*
packet
=
(
u16
*
)
&
(
ib
->
tx_buf
[
entry
][
0
]);
struct
ethhdr
*
eth
=
(
struct
ethhdr
*
)
packet
;
memset
(
packet
,
0
,
ETH_ZLEN
);
for
(
i
=
0
;
i
<
6
;
i
++
)
{
eth
->
h_dest
[
i
]
=
dev
->
dev_addr
[
i
];
...
...
@@ -916,7 +918,6 @@ struct net_device *last_dev;
static
int
lance_open
(
struct
net_device
*
dev
)
{
struct
lance_private
*
lp
=
netdev_priv
(
dev
);
struct
lance_init_block
*
ib
=
lp
->
init_block
;
int
status
=
0
;
last_dev
=
dev
;
...
...
@@ -943,10 +944,12 @@ static int lance_open(struct net_device *dev)
* BTW it is common bug in all lance drivers! --ANK
*/
if
(
lp
->
pio_buffer
)
{
struct
lance_init_block
__iomem
*
ib
=
lp
->
init_block_iomem
;
sbus_writew
(
0
,
&
ib
->
mode
);
sbus_writel
(
0
,
&
ib
->
filter
[
0
]);
sbus_writel
(
0
,
&
ib
->
filter
[
1
]);
}
else
{
struct
lance_init_block
*
ib
=
lp
->
init_block_mem
;
ib
->
mode
=
0
;
ib
->
filter
[
0
]
=
0
;
ib
->
filter
[
1
]
=
0
;
...
...
@@ -1113,7 +1116,6 @@ static void lance_tx_timeout(struct net_device *dev)
static
int
lance_start_xmit
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
struct
lance_private
*
lp
=
netdev_priv
(
dev
);
struct
lance_init_block
*
ib
=
lp
->
init_block
;
int
entry
,
skblen
,
len
;
skblen
=
skb
->
len
;
...
...
@@ -1126,6 +1128,7 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
entry
=
lp
->
tx_new
&
TX_RING_MOD_MASK
;
if
(
lp
->
pio_buffer
)
{
struct
lance_init_block
__iomem
*
ib
=
lp
->
init_block_iomem
;
sbus_writew
((
-
len
)
|
0xf000
,
&
ib
->
btx_ring
[
entry
].
length
);
sbus_writew
(
0
,
&
ib
->
btx_ring
[
entry
].
misc
);
lance_piocopy_from_skb
(
&
ib
->
tx_buf
[
entry
][
0
],
skb
->
data
,
skblen
);
...
...
@@ -1133,6 +1136,7 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
lance_piozero
(
&
ib
->
tx_buf
[
entry
][
skblen
],
len
-
skblen
);
sbus_writeb
(
LE_T1_POK
|
LE_T1_OWN
,
&
ib
->
btx_ring
[
entry
].
tmd1_bits
);
}
else
{
struct
lance_init_block
*
ib
=
lp
->
init_block_mem
;
ib
->
btx_ring
[
entry
].
length
=
(
-
len
)
|
0xf000
;
ib
->
btx_ring
[
entry
].
misc
=
0
;
memcpy
((
char
*
)
&
ib
->
tx_buf
[
entry
][
0
],
skb
->
data
,
skblen
);
...
...
@@ -1174,33 +1178,31 @@ static struct net_device_stats *lance_get_stats(struct net_device *dev)
static
void
lance_load_multicast
(
struct
net_device
*
dev
)
{
struct
lance_private
*
lp
=
netdev_priv
(
dev
);
struct
lance_init_block
*
ib
=
lp
->
init_block
;
u16
*
mcast_table
=
(
u16
*
)
&
ib
->
filter
;
struct
dev_mc_list
*
dmi
=
dev
->
mc_list
;
char
*
addrs
;
int
i
;
u32
crc
;
u32
val
;
/* set all multicast bits */
if
(
dev
->
flags
&
IFF_ALLMULTI
)
{
if
(
lp
->
pio_buffer
)
{
sbus_writel
(
0xffffffff
,
&
ib
->
filter
[
0
]);
sbus_writel
(
0xffffffff
,
&
ib
->
filter
[
1
]);
}
else
{
ib
->
filter
[
0
]
=
0xffffffff
;
ib
->
filter
[
1
]
=
0xffffffff
;
}
return
;
}
/* clear the multicast filter */
if
(
dev
->
flags
&
IFF_ALLMULTI
)
val
=
~
0
;
else
val
=
0
;
if
(
lp
->
pio_buffer
)
{
sbus_writel
(
0
,
&
ib
->
filter
[
0
]);
sbus_writel
(
0
,
&
ib
->
filter
[
1
]);
struct
lance_init_block
__iomem
*
ib
=
lp
->
init_block_iomem
;
sbus_writel
(
val
,
&
ib
->
filter
[
0
]);
sbus_writel
(
val
,
&
ib
->
filter
[
1
]);
}
else
{
ib
->
filter
[
0
]
=
0
;
ib
->
filter
[
1
]
=
0
;
struct
lance_init_block
*
ib
=
lp
->
init_block_mem
;
ib
->
filter
[
0
]
=
val
;
ib
->
filter
[
1
]
=
val
;
}
if
(
dev
->
flags
&
IFF_ALLMULTI
)
return
;
/* Add addresses */
for
(
i
=
0
;
i
<
dev
->
mc_count
;
i
++
)
{
addrs
=
dmi
->
dmi_addr
;
...
...
@@ -1212,10 +1214,14 @@ static void lance_load_multicast(struct net_device *dev)
crc
=
ether_crc_le
(
6
,
addrs
);
crc
=
crc
>>
26
;
if
(
lp
->
pio_buffer
)
{
struct
lance_init_block
__iomem
*
ib
=
lp
->
init_block_iomem
;
u16
__iomem
*
mcast_table
=
(
u16
__iomem
*
)
&
ib
->
filter
;
u16
tmp
=
sbus_readw
(
&
mcast_table
[
crc
>>
4
]);
tmp
|=
1
<<
(
crc
&
0xf
);
sbus_writew
(
tmp
,
&
mcast_table
[
crc
>>
4
]);
}
else
{
struct
lance_init_block
*
ib
=
lp
->
init_block_mem
;
u16
*
mcast_table
=
(
u16
*
)
&
ib
->
filter
;
mcast_table
[
crc
>>
4
]
|=
1
<<
(
crc
&
0xf
);
}
}
...
...
@@ -1224,7 +1230,8 @@ static void lance_load_multicast(struct net_device *dev)
static
void
lance_set_multicast
(
struct
net_device
*
dev
)
{
struct
lance_private
*
lp
=
netdev_priv
(
dev
);
struct
lance_init_block
*
ib
=
lp
->
init_block
;
struct
lance_init_block
*
ib_mem
=
lp
->
init_block_mem
;
struct
lance_init_block
__iomem
*
ib_iomem
=
lp
->
init_block_iomem
;
u16
mode
;
if
(
!
netif_running
(
dev
))
...
...
@@ -1242,21 +1249,21 @@ static void lance_set_multicast(struct net_device *dev)
lp
->
init_ring
(
dev
);
if
(
lp
->
pio_buffer
)
mode
=
sbus_readw
(
&
ib
->
mode
);
mode
=
sbus_readw
(
&
ib
_iomem
->
mode
);
else
mode
=
ib
->
mode
;
mode
=
ib
_mem
->
mode
;
if
(
dev
->
flags
&
IFF_PROMISC
)
{
mode
|=
LE_MO_PROM
;
if
(
lp
->
pio_buffer
)
sbus_writew
(
mode
,
&
ib
->
mode
);
sbus_writew
(
mode
,
&
ib
_iomem
->
mode
);
else
ib
->
mode
=
mode
;
ib
_mem
->
mode
=
mode
;
}
else
{
mode
&=
~
LE_MO_PROM
;
if
(
lp
->
pio_buffer
)
sbus_writew
(
mode
,
&
ib
->
mode
);
sbus_writew
(
mode
,
&
ib
_iomem
->
mode
);
else
ib
->
mode
=
mode
;
ib
_mem
->
mode
=
mode
;
lance_load_multicast
(
dev
);
}
load_csrs
(
lp
);
...
...
@@ -1275,16 +1282,14 @@ static void lance_free_hwresources(struct lance_private *lp)
{
if
(
lp
->
lregs
)
sbus_iounmap
(
lp
->
lregs
,
LANCE_REG_SIZE
);
if
(
lp
->
init_block
!=
NULL
)
{
if
(
lp
->
pio_buffer
)
{
sbus_iounmap
(
lp
->
init_block
,
sizeof
(
struct
lance_init_block
));
}
else
{
sbus_free_consistent
(
lp
->
sdev
,
sizeof
(
struct
lance_init_block
),
lp
->
init_block
,
lp
->
init_block_dvma
);
}
if
(
lp
->
init_block_iomem
)
{
sbus_iounmap
(
lp
->
init_block_iomem
,
sizeof
(
struct
lance_init_block
));
}
else
if
(
lp
->
init_block_mem
)
{
sbus_free_consistent
(
lp
->
sdev
,
sizeof
(
struct
lance_init_block
),
lp
->
init_block_mem
,
lp
->
init_block_dvma
);
}
}
...
...
@@ -1326,6 +1331,7 @@ static int __init sparc_lance_init(struct sbus_dev *sdev,
return
-
ENOMEM
;
lp
=
netdev_priv
(
dev
);
memset
(
lp
,
0
,
sizeof
(
*
lp
));
if
(
sparc_lance_debug
&&
version_printed
++
==
0
)
printk
(
KERN_INFO
"%s"
,
version
);
...
...
@@ -1342,17 +1348,22 @@ static int __init sparc_lance_init(struct sbus_dev *sdev,
/* Get the IO region */
lp
->
lregs
=
sbus_ioremap
(
&
sdev
->
resource
[
0
],
0
,
LANCE_REG_SIZE
,
lancestr
);
if
(
lp
->
lregs
==
0UL
)
{
if
(
!
lp
->
lregs
)
{
printk
(
KERN_ERR
"SunLance: Cannot map registers.
\n
"
);
goto
fail
;
}
lp
->
sdev
=
sdev
;
if
(
lebuffer
)
{
lp
->
init_block
=
/* sanity check */
if
(
lebuffer
->
resource
[
0
].
start
&
7
)
{
printk
(
KERN_ERR
"SunLance: ERROR: Rx and Tx rings not on even boundary.
\n
"
);
goto
fail
;
}
lp
->
init_block_iomem
=
sbus_ioremap
(
&
lebuffer
->
resource
[
0
],
0
,
sizeof
(
struct
lance_init_block
),
"lebuffer"
);
if
(
lp
->
init_block
==
NULL
)
{
if
(
!
lp
->
init_block_iomem
)
{
printk
(
KERN_ERR
"SunLance: Cannot map PIO buffer.
\n
"
);
goto
fail
;
}
...
...
@@ -1362,11 +1373,10 @@ static int __init sparc_lance_init(struct sbus_dev *sdev,
lp
->
rx
=
lance_rx_pio
;
lp
->
tx
=
lance_tx_pio
;
}
else
{
lp
->
init_block
=
lp
->
init_block
_mem
=
sbus_alloc_consistent
(
sdev
,
sizeof
(
struct
lance_init_block
),
&
lp
->
init_block_dvma
);
if
(
lp
->
init_block
==
NULL
||
lp
->
init_block_dvma
==
0
)
{
if
(
!
lp
->
init_block_mem
||
lp
->
init_block_dvma
==
0
)
{
printk
(
KERN_ERR
"SunLance: Cannot allocate consistent DMA memory.
\n
"
);
goto
fail
;
}
...
...
@@ -1449,13 +1459,7 @@ static int __init sparc_lance_init(struct sbus_dev *sdev,
udelay
(
200
);
sbus_writel
(
csr
&
~
DMA_RST_ENET
,
lp
->
dregs
+
DMA_CSR
);
}
else
lp
->
dregs
=
0
;
/* This should never happen. */
if
((
unsigned
long
)(
lp
->
init_block
->
brx_ring
)
&
0x07
)
{
printk
(
KERN_ERR
"SunLance: ERROR: Rx and Tx rings not on even boundary.
\n
"
);
goto
fail
;
}
lp
->
dregs
=
NULL
;
lp
->
dev
=
dev
;
SET_MODULE_OWNER
(
dev
);
...
...
@@ -1499,8 +1503,7 @@ static int __init sparc_lance_init(struct sbus_dev *sdev,
return
0
;
fail:
if
(
lp
!=
NULL
)
lance_free_hwresources
(
lp
);
lance_free_hwresources
(
lp
);
free_netdev
(
dev
);
return
-
ENODEV
;
}
...
...
@@ -1539,7 +1542,7 @@ static int __init sparc_lance_probe(void)
memset
(
&
sdev
,
0
,
sizeof
(
sdev
));
sdev
.
reg_addrs
[
0
].
phys_addr
=
sun4_eth_physaddr
;
sdev
.
irqs
[
0
]
=
6
;
return
sparc_lance_init
(
&
sdev
,
0
,
0
);
return
sparc_lance_init
(
&
sdev
,
NULL
,
NULL
);
}
return
-
ENODEV
;
}
...
...
include/asm-sparc/checksum.h
View file @
313ef38b
...
...
@@ -61,7 +61,7 @@ csum_partial_copy_nocheck (const unsigned char *src, unsigned char *dst, int len
}
static
inline
unsigned
int
csum_partial_copy_from_user
(
const
unsigned
char
*
src
,
unsigned
char
*
dst
,
int
len
,
csum_partial_copy_from_user
(
const
unsigned
char
__user
*
src
,
unsigned
char
*
dst
,
int
len
,
unsigned
int
sum
,
int
*
err
)
{
if
(
!
access_ok
(
VERIFY_READ
,
src
,
len
))
{
...
...
@@ -69,7 +69,7 @@ csum_partial_copy_from_user(const unsigned char *src, unsigned char *dst, int le
memset
(
dst
,
0
,
len
);
return
sum
;
}
else
{
register
unsigned
int
ret
asm
(
"o0"
)
=
(
unsigned
int
)
src
;
register
unsigned
long
ret
asm
(
"o0"
)
=
(
unsigned
long
)
src
;
register
char
*
d
asm
(
"o1"
)
=
dst
;
register
int
l
asm
(
"g1"
)
=
len
;
register
unsigned
int
s
asm
(
"g7"
)
=
sum
;
...
...
@@ -98,8 +98,8 @@ csum_partial_copy_to_user(const unsigned char *src, unsigned char __user *dst, i
*
err
=
-
EFAULT
;
return
sum
;
}
else
{
register
unsigned
int
ret
asm
(
"o0"
)
=
(
unsigned
int
)
src
;
register
char
*
d
asm
(
"o1"
)
=
dst
;
register
unsigned
long
ret
asm
(
"o0"
)
=
(
unsigned
long
)
src
;
register
char
__user
*
d
asm
(
"o1"
)
=
dst
;
register
int
l
asm
(
"g1"
)
=
len
;
register
unsigned
int
s
asm
(
"g7"
)
=
sum
;
...
...
include/asm-sparc/elf.h
View file @
313ef38b
...
...
@@ -88,11 +88,11 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG];
#define ELF_CORE_COPY_REGS(__elf_regs, __pt_regs) \
do { unsigned long *dest = &(__elf_regs[0]); \
struct pt_regs *src = (__pt_regs); \
unsigned long
*sp;
\
unsigned long
__user *sp;
\
memcpy(&dest[0], &src->u_regs[0], \
sizeof(unsigned long) * 16); \
/* Don't try this at home kids... */
\
sp = (unsigned long
*) src->u_regs[14];
\
sp = (unsigned long
__user *) src->u_regs[14];
\
copy_from_user(&dest[16], sp, \
sizeof(unsigned long) * 16); \
dest[32] = src->psr; \
...
...
include/asm-sparc/floppy.h
View file @
313ef38b
...
...
@@ -213,7 +213,7 @@ unsigned long pdma_size;
volatile
int
doing_pdma
=
0
;
/* This is software state */
char
*
pdma_base
=
0
;
char
*
pdma_base
=
NULL
;
unsigned
long
pdma_areasize
;
/* Common routines to all controller types on the Sparc. */
...
...
include/asm-sparc/io.h
View file @
313ef38b
...
...
@@ -134,12 +134,12 @@ static inline void __writel(u32 l, volatile void __iomem *addr)
#define inl_p(__addr) inl(__addr)
#define outl_p(__l, __addr) outl(__l, __addr)
void
outsb
(
void
*
__iomem
addr
,
const
void
*
src
,
unsigned
long
cnt
);
void
outsw
(
void
*
__iomem
addr
,
const
void
*
src
,
unsigned
long
cnt
);
void
outsl
(
void
*
__iomem
addr
,
const
void
*
src
,
unsigned
long
cnt
);
void
insb
(
void
*
__iomem
addr
,
void
*
dst
,
unsigned
long
count
);
void
insw
(
void
*
__iomem
addr
,
void
*
dst
,
unsigned
long
count
);
void
insl
(
void
*
__iomem
addr
,
void
*
dst
,
unsigned
long
count
);
void
outsb
(
unsigned
long
addr
,
const
void
*
src
,
unsigned
long
cnt
);
void
outsw
(
unsigned
long
addr
,
const
void
*
src
,
unsigned
long
cnt
);
void
outsl
(
unsigned
long
addr
,
const
void
*
src
,
unsigned
long
cnt
);
void
insb
(
unsigned
long
addr
,
void
*
dst
,
unsigned
long
count
);
void
insw
(
unsigned
long
addr
,
void
*
dst
,
unsigned
long
count
);
void
insl
(
unsigned
long
addr
,
void
*
dst
,
unsigned
long
count
);
#define IO_SPACE_LIMIT 0xffffffff
...
...
include/asm-sparc/svr4.h
View file @
313ef38b
...
...
@@ -49,7 +49,7 @@ typedef struct {
typedef
struct
{
int
count
;
int
*
winptr
[
SVR4_MAXWIN
];
/* pointer to the windows */
int
__user
*
winptr
[
SVR4_MAXWIN
];
/* pointer to the windows */
svr4_rwindow_t
win
[
SVR4_MAXWIN
];
/* the windows */
}
svr4_gwindows_t
;
...
...
@@ -72,7 +72,7 @@ typedef struct {
/* Machine dependent context */
typedef
struct
{
svr4_gregset_t
greg
;
/* registers 0..19 (see top) */
svr4_gwindows_t
*
gwin
;
/* may point to register windows */
svr4_gwindows_t
__user
*
gwin
;
/* may point to register windows */
svr4_fregset_t
freg
;
/* floating point registers */
svr4_xrs_t
xrs
;
/* mhm? */
long
pad
[
19
];
...
...
@@ -86,7 +86,7 @@ enum svr4_stack_flags {
/* signal stack exection place, unsupported */
typedef
struct
svr4_stack_t
{
char
*
sp
;
char
__user
*
sp
;
int
size
;
int
flags
;
}
svr4_stack_t
;
...
...
include/asm-sparc/system.h
View file @
313ef38b
...
...
@@ -200,7 +200,7 @@ static inline unsigned long getipl(void)
#define smp_wmb() __asm__ __volatile__("":::"memory")
#define smp_read_barrier_depends() do { } while(0)
#define nop() __asm__ __volatile__ ("nop")
;
#define nop() __asm__ __volatile__ ("nop")
/* This has special calling conventions */
#ifndef CONFIG_SMP
...
...
include/asm-sparc64/fbio.h
View file @
313ef38b
...
...
@@ -102,8 +102,8 @@ struct fbcursor {
struct
fbcurpos
hot
;
/* cursor hot spot */
struct
fbcmap
cmap
;
/* color map info */
struct
fbcurpos
size
;
/* cursor bit map size */
char
*
image
;
/* cursor image bits */
char
*
mask
;
/* cursor mask bits */
char
__user
*
image
;
/* cursor image bits */
char
__user
*
mask
;
/* cursor mask bits */
};
/* set/get cursor attributes/shape */
...
...
include/asm-sparc64/io.h
View file @
313ef38b
...
...
@@ -417,13 +417,13 @@ _memcpy_toio(volatile void __iomem *dst, const void *src, __kernel_size_t n)
#define memcpy_toio(d,s,sz) _memcpy_toio(d,s,sz)
static
inline
int
check_signature
(
unsigned
long
io_addr
,
static
inline
int
check_signature
(
void
__iomem
*
io_addr
,
const
unsigned
char
*
signature
,
int
length
)
{
int
retval
=
0
;
do
{
if
(
readb
(
(
void
__iomem
*
)
io_addr
)
!=
*
signature
++
)
if
(
readb
(
io_addr
)
!=
*
signature
++
)
goto
out
;
io_addr
++
;
}
while
(
--
length
);
...
...
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