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
35dca6a2
Commit
35dca6a2
authored
Apr 22, 2003
by
Pete Zaitcev
Committed by
David S. Miller
Apr 22, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SPARC]: Colin Gibbs gcc-3.x support.
parent
5ac8451a
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
189 additions
and
240 deletions
+189
-240
arch/sparc/kernel/entry.S
arch/sparc/kernel/entry.S
+89
-81
arch/sparc/kernel/etrap.S
arch/sparc/kernel/etrap.S
+2
-2
arch/sparc/kernel/head.S
arch/sparc/kernel/head.S
+1
-1
arch/sparc/kernel/process.c
arch/sparc/kernel/process.c
+17
-66
arch/sparc/kernel/rtrap.S
arch/sparc/kernel/rtrap.S
+9
-9
arch/sparc/kernel/signal.c
arch/sparc/kernel/signal.c
+1
-1
arch/sparc/kernel/sunos_asm.S
arch/sparc/kernel/sunos_asm.S
+10
-10
arch/sparc/kernel/trampoline.S
arch/sparc/kernel/trampoline.S
+4
-4
arch/sparc/kernel/windows.c
arch/sparc/kernel/windows.c
+1
-1
arch/sparc/kernel/wof.S
arch/sparc/kernel/wof.S
+1
-1
arch/sparc/kernel/wuf.S
arch/sparc/kernel/wuf.S
+1
-1
include/asm-sparc/kgdb.h
include/asm-sparc/kgdb.h
+28
-28
include/asm-sparc/processor.h
include/asm-sparc/processor.h
+1
-1
include/asm-sparc/ptrace.h
include/asm-sparc/ptrace.h
+0
-2
include/asm-sparc/winmacro.h
include/asm-sparc/winmacro.h
+24
-32
No files found.
arch/sparc/kernel/entry.S
View file @
35dca6a2
...
...
@@ -40,6 +40,14 @@
#define NR_SYSCALLS 256 /* Each OS is different... */
/*
These
are
just
handy
.
*/
#define _SV save %sp, -STACKFRAME_SZ, %sp
#define _RS restore
#define FLUSH_ALL_KERNEL_WINDOWS \
_SV
; _SV; _SV; _SV; _SV; _SV; _SV; \
_RS
; _RS; _RS; _RS; _RS; _RS; _RS;
/*
First
,
KGDB
low
level
things
.
This
is
a
rewrite
*
of
the
routines
found
in
the
sparc
-
stub
.
c
asm
()
statement
*
from
the
gdb
distribution
.
This
is
also
dual
-
purpose
...
...
@@ -73,11 +81,11 @@ C_LABEL(trap_low):
/
*
Make
sure
kgdb
sees
the
same
state
we
just
saved
.
*/
LOAD_PT_GLOBALS
(
sp
)
LOAD_PT_INS
(
sp
)
ld
[%
sp
+
REGWIN
_SZ
+
PT_Y
],
%
l4
ld
[%
sp
+
REGWIN
_SZ
+
PT_WIM
],
%
l3
ld
[%
sp
+
REGWIN
_SZ
+
PT_PSR
],
%
l0
ld
[%
sp
+
REGWIN
_SZ
+
PT_PC
],
%
l1
ld
[%
sp
+
REGWIN
_SZ
+
PT_NPC
],
%
l2
ld
[%
sp
+
STACKFRAME
_SZ
+
PT_Y
],
%
l4
ld
[%
sp
+
STACKFRAME
_SZ
+
PT_WIM
],
%
l3
ld
[%
sp
+
STACKFRAME
_SZ
+
PT_PSR
],
%
l0
ld
[%
sp
+
STACKFRAME
_SZ
+
PT_PC
],
%
l1
ld
[%
sp
+
STACKFRAME
_SZ
+
PT_NPC
],
%
l2
rd
%
tbr
,
%
l5
/*
Never
changes
...
*/
/
*
Make
kgdb
exception
frame
.
*/
...
...
@@ -97,7 +105,7 @@ C_LABEL(trap_low):
WRITE_PAUSE
call
C_LABEL
(
handle_exception
)
add
%
sp
,
REGWIN
_SZ
,
%
o0
!
Pass
address
of
registers
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
!
Pass
address
of
registers
/
*
Load
new
kgdb
register
set
.
*/
LOAD_KGDB_GLOBALS
(
sp
)
...
...
@@ -266,7 +274,7 @@ floppy_dosoftint:
mov
11
,
%
o0
!
floppy
irq
level
(
unused
anyway
)
mov
%
g0
,
%
o1
!
devid
is
not
used
in
fast
interrupts
call
C_LABEL
(
sparc_floppy_irq
)
add
%
sp
,
REGWIN
_SZ
,
%
o2
!
struct
pt_regs
*
regs
add
%
sp
,
STACKFRAME
_SZ
,
%
o2
!
struct
pt_regs
*
regs
RESTORE_ALL
...
...
@@ -315,7 +323,7 @@ real_irq_continue:
mov
%
l7
,
%
o0
!
irq
level
patch_handler_irq
:
call
C_LABEL
(
handler_irq
)
add
%
sp
,
REGWIN
_SZ
,
%
o1
!
pt_regs
ptr
add
%
sp
,
STACKFRAME
_SZ
,
%
o1
!
pt_regs
ptr
or
%
l0
,
PSR_PIL
,
%
g2
!
restore
PIL
after
handler_irq
wr
%
g2
,
PSR_ET
,
%
psr
!
keep
ET
up
WRITE_PAUSE
...
...
@@ -332,7 +340,7 @@ smp4m_ticker:
wr
%
g2
,
PSR_ET
,
%
psr
WRITE_PAUSE
call
C_LABEL
(
smp4m_percpu_timer_interrupt
)
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
wr
%
l0
,
PSR_ET
,
%
psr
WRITE_PAUSE
RESTORE_ALL
...
...
@@ -439,7 +447,7 @@ smp4d_ticker:
wr
%
g2
,
PSR_ET
,
%
psr
WRITE_PAUSE
call
C_LABEL
(
smp4d_percpu_timer_interrupt
)
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
wr
%
l0
,
PSR_ET
,
%
psr
WRITE_PAUSE
RESTORE_ALL
...
...
@@ -501,7 +509,7 @@ bad_instruction:
wr
%
l0
,
PSR_ET
,
%
psr
!
re
-
enable
traps
WRITE_PAUSE
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
mov
%
l1
,
%
o1
mov
%
l2
,
%
o2
call
C_LABEL
(
do_illegal_instruction
)
...
...
@@ -521,7 +529,7 @@ priv_instruction:
wr
%
l0
,
PSR_ET
,
%
psr
WRITE_PAUSE
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
mov
%
l1
,
%
o1
mov
%
l2
,
%
o2
call
C_LABEL
(
do_priv_instruction
)
...
...
@@ -544,7 +552,7 @@ mna_handler:
ld
[%
l1
],
%
o1
call
C_LABEL
(
kernel_unaligned_trap
)
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
RESTORE_ALL
...
...
@@ -556,7 +564,7 @@ mna_fromuser:
ld
[%
l1
],
%
o1
call
C_LABEL
(
user_unaligned_trap
)
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
RESTORE_ALL
...
...
@@ -569,7 +577,7 @@ fpd_trap_handler:
wr
%
l0
,
PSR_ET
,
%
psr
!
re
-
enable
traps
WRITE_PAUSE
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
mov
%
l1
,
%
o1
mov
%
l2
,
%
o2
call
C_LABEL
(
do_fpd_trap
)
...
...
@@ -608,7 +616,7 @@ fpe_trap_handler:
wr
%
l0
,
PSR_ET
,
%
psr
!
re
-
enable
traps
WRITE_PAUSE
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
mov
%
l1
,
%
o1
mov
%
l2
,
%
o2
call
C_LABEL
(
do_fpe_trap
)
...
...
@@ -625,7 +633,7 @@ do_tag_overflow:
wr
%
l0
,
PSR_ET
,
%
psr
!
re
-
enable
traps
WRITE_PAUSE
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
mov
%
l1
,
%
o1
mov
%
l2
,
%
o2
call
C_LABEL
(
handle_tag_overflow
)
...
...
@@ -642,7 +650,7 @@ do_watchpoint:
wr
%
l0
,
PSR_ET
,
%
psr
!
re
-
enable
traps
WRITE_PAUSE
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
mov
%
l1
,
%
o1
mov
%
l2
,
%
o2
call
C_LABEL
(
handle_watchpoint
)
...
...
@@ -659,7 +667,7 @@ do_reg_access:
wr
%
l0
,
PSR_ET
,
%
psr
!
re
-
enable
traps
WRITE_PAUSE
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
mov
%
l1
,
%
o1
mov
%
l2
,
%
o2
call
C_LABEL
(
handle_reg_access
)
...
...
@@ -676,7 +684,7 @@ do_cp_disabled:
wr
%
l0
,
PSR_ET
,
%
psr
!
re
-
enable
traps
WRITE_PAUSE
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
mov
%
l1
,
%
o1
mov
%
l2
,
%
o2
call
C_LABEL
(
handle_cp_disabled
)
...
...
@@ -693,7 +701,7 @@ do_cp_exception:
wr
%
l0
,
PSR_ET
,
%
psr
!
re
-
enable
traps
WRITE_PAUSE
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
mov
%
l1
,
%
o1
mov
%
l2
,
%
o2
call
C_LABEL
(
handle_cp_exception
)
...
...
@@ -710,7 +718,7 @@ do_hw_divzero:
wr
%
l0
,
PSR_ET
,
%
psr
!
re
-
enable
traps
WRITE_PAUSE
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
mov
%
l1
,
%
o1
mov
%
l2
,
%
o2
call
C_LABEL
(
handle_hw_divzero
)
...
...
@@ -734,10 +742,10 @@ do_flush_windows:
nop
/
*
Advance
over
the
trap
instruction
.
*/
ld
[%
sp
+
REGWIN
_SZ
+
PT_NPC
],
%
l1
ld
[%
sp
+
STACKFRAME
_SZ
+
PT_NPC
],
%
l1
add
%
l1
,
0x4
,
%
l2
st
%
l1
,
[%
sp
+
REGWIN
_SZ
+
PT_PC
]
st
%
l2
,
[%
sp
+
REGWIN
_SZ
+
PT_NPC
]
st
%
l1
,
[%
sp
+
STACKFRAME
_SZ
+
PT_PC
]
st
%
l2
,
[%
sp
+
STACKFRAME
_SZ
+
PT_NPC
]
RESTORE_ALL
...
...
@@ -749,10 +757,10 @@ flush_patch_one:
FLUSH_ALL_KERNEL_WINDOWS
/
*
Advance
over
the
trap
instruction
.
*/
ld
[%
sp
+
REGWIN
_SZ
+
PT_NPC
],
%
l1
ld
[%
sp
+
STACKFRAME
_SZ
+
PT_NPC
],
%
l1
add
%
l1
,
0x4
,
%
l2
st
%
l1
,
[%
sp
+
REGWIN
_SZ
+
PT_PC
]
st
%
l2
,
[%
sp
+
REGWIN
_SZ
+
PT_NPC
]
st
%
l1
,
[%
sp
+
STACKFRAME
_SZ
+
PT_PC
]
st
%
l2
,
[%
sp
+
STACKFRAME
_SZ
+
PT_NPC
]
RESTORE_ALL
...
...
@@ -821,7 +829,7 @@ linux_trap_nmi_sun4c:
sub
%
o0
,
0x4
,
%
o0
lda
[%
o0
]
ASI_CONTROL
,
%
o3
!
async
error
call
C_LABEL
(
sparc_lvl15_nmi
)
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
RESTORE_ALL
...
...
@@ -1155,7 +1163,7 @@ sun4c_fault_fromuser:
WRITE_PAUSE
call
C_LABEL
(
do_sun4c_fault
)
add
%
sp
,
REGWIN
_SZ
,
%
o0
!
arg1
=
pt_regs
ptr
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
!
arg1
=
pt_regs
ptr
RESTORE_ALL
...
...
@@ -1189,7 +1197,7 @@ C_LABEL(srmmu_fault):
WRITE_PAUSE
call
C_LABEL
(
do_sparc_fault
)
add
%
sp
,
REGWIN
_SZ
,
%
o0
!
arg1
=
pt_regs
ptr
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
!
arg1
=
pt_regs
ptr
RESTORE_ALL
...
...
@@ -1227,7 +1235,7 @@ C_LABEL(sunos_indir):
.
globl
C_LABEL
(
sys_nis_syscall
)
C_LABEL
(
sys_nis_syscall
):
mov
%
o7
,
%
l5
add
%
sp
,
REGWIN
_SZ
,
%
o0
!
pt_regs
*
regs
arg
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
!
pt_regs
*
regs
arg
call
C_LABEL
(
c_sys_nis_syscall
)
mov
%
l5
,
%
o7
...
...
@@ -1235,7 +1243,7 @@ C_LABEL(sys_nis_syscall):
.
globl
C_LABEL
(
sys_ptrace
)
C_LABEL
(
sys_ptrace
):
call
C_LABEL
(
do_ptrace
)
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
ld
[%
curptr
+
TI_TASK
],
%
l5
ld
[%
l5
+
AOFF_task_ptrace
],
%
l5
...
...
@@ -1253,7 +1261,7 @@ C_LABEL(sys_ptrace):
.
globl
C_LABEL
(
sys_execve
)
C_LABEL
(
sys_execve
):
mov
%
o7
,
%
l5
add
%
sp
,
REGWIN
_SZ
,
%
o0
!
pt_regs
*
regs
arg
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
!
pt_regs
*
regs
arg
call
C_LABEL
(
sparc_execve
)
mov
%
l5
,
%
o7
...
...
@@ -1261,7 +1269,7 @@ C_LABEL(sys_execve):
.
globl
C_LABEL
(
sys_pipe
)
C_LABEL
(
sys_pipe
):
mov
%
o7
,
%
l5
add
%
sp
,
REGWIN
_SZ
,
%
o0
!
pt_regs
*
regs
arg
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
!
pt_regs
*
regs
arg
call
C_LABEL
(
sparc_pipe
)
mov
%
l5
,
%
o7
...
...
@@ -1286,7 +1294,7 @@ C_LABEL(sys_sigstack):
C_LABEL
(
sys_sigpause
):
/
*
Note
:
%
o0
already
has
correct
value
...
*/
call
C_LABEL
(
do_sigpause
)
add
%
sp
,
REGWIN
_SZ
,
%
o1
add
%
sp
,
STACKFRAME
_SZ
,
%
o1
ld
[%
curptr
+
TI_TASK
],
%
l5
ld
[%
l5
+
AOFF_task_ptrace
],
%
l5
...
...
@@ -1305,7 +1313,7 @@ C_LABEL(sys_sigpause):
.
globl
C_LABEL
(
sys_sigsuspend
)
C_LABEL
(
sys_sigsuspend
):
call
C_LABEL
(
do_sigsuspend
)
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
ld
[%
curptr
+
TI_TASK
],
%
l5
ld
[%
l5
+
AOFF_task_ptrace
],
%
l5
...
...
@@ -1325,7 +1333,7 @@ C_LABEL(sys_sigsuspend):
C_LABEL
(
sys_rt_sigsuspend
):
/
*
Note
:
%
o0
,
%
o1
already
have
correct
value
...
*/
call
C_LABEL
(
do_rt_sigsuspend
)
add
%
sp
,
REGWIN
_SZ
,
%
o2
add
%
sp
,
STACKFRAME
_SZ
,
%
o2
ld
[%
curptr
+
TI_TASK
],
%
l5
ld
[%
l5
+
AOFF_task_ptrace
],
%
l5
...
...
@@ -1344,7 +1352,7 @@ C_LABEL(sys_rt_sigsuspend):
.
globl
C_LABEL
(
sys_sigreturn
)
C_LABEL
(
sys_sigreturn
):
call
C_LABEL
(
do_sigreturn
)
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
ld
[%
curptr
+
TI_TASK
],
%
l5
ld
[%
l5
+
AOFF_task_ptrace
],
%
l5
...
...
@@ -1365,7 +1373,7 @@ C_LABEL(sys_sigreturn):
.
globl
C_LABEL
(
sys_rt_sigreturn
)
C_LABEL
(
sys_rt_sigreturn
):
call
C_LABEL
(
do_rt_sigreturn
)
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
ld
[%
curptr
+
TI_TASK
],
%
l5
ld
[%
l5
+
AOFF_task_ptrace
],
%
l5
...
...
@@ -1401,7 +1409,7 @@ flush_patch_two:
WRITE_PAUSE
mov
%
fp
,
%
o1
!
arg1
:
usp
std
%
g4
,
[%
o4
+
AOFF_task_thread
+
AOFF_thread_fork_kpsr
]
add
%
sp
,
REGWIN
_SZ
,
%
o2
!
arg2
:
pt_regs
ptr
add
%
sp
,
STACKFRAME
_SZ
,
%
o2
!
arg2
:
pt_regs
ptr
mov
0
,
%
o3
call
C_LABEL
(
sparc_do_fork
)
mov
%
l5
,
%
o7
...
...
@@ -1425,7 +1433,7 @@ flush_patch_three:
andn
%
o1
,
7
,
%
o1
!
no
,
align
to
8
bytes
1
:
std
%
g4
,
[%
o4
+
AOFF_task_thread
+
AOFF_thread_fork_kpsr
]
add
%
sp
,
REGWIN
_SZ
,
%
o2
!
arg2
:
pt_regs
ptr
add
%
sp
,
STACKFRAME
_SZ
,
%
o2
!
arg2
:
pt_regs
ptr
mov
0
,
%
o3
call
C_LABEL
(
sparc_do_fork
)
mov
%
l5
,
%
o7
...
...
@@ -1447,7 +1455,7 @@ flush_patch_four:
sethi
%
hi
(
C_LABEL
(
sparc_do_fork
)),
%
l1
mov
0
,
%
o3
jmpl
%
l1
+
%
lo
(
C_LABEL
(
sparc_do_fork
)),
%
g0
add
%
sp
,
REGWIN
_SZ
,
%
o2
add
%
sp
,
STACKFRAME
_SZ
,
%
o2
.
align
4
linux_sparc_ni_syscall
:
...
...
@@ -1478,7 +1486,7 @@ C_LABEL(ret_from_fork):
call
schedule_tail
mov
%
g3
,
%
o0
b
C_LABEL
(
ret_sys_call
)
ld
[%
sp
+
REGWIN
_SZ
+
PT_I0
],
%
o0
ld
[%
sp
+
STACKFRAME
_SZ
+
PT_I0
],
%
o0
/
*
Linux
native
and
SunOS
system
calls
enter
here
...
*/
.
align
4
...
...
@@ -1514,14 +1522,14 @@ syscall_is_too_hard:
call
%
l7
mov
%
i5
,
%
o5
st
%
o0
,
[%
sp
+
REGWIN
_SZ
+
PT_I0
]
st
%
o0
,
[%
sp
+
STACKFRAME
_SZ
+
PT_I0
]
.
globl
C_LABEL
(
ret_sys_call
)
C_LABEL
(
ret_sys_call
):
ld
[%
curptr
+
TI_TASK
],
%
l6
ld
[%
l6
+
AOFF_task_ptrace
],
%
l6
cmp
%
o0
,
-
ENOIOCTLCMD
ld
[%
sp
+
REGWIN
_SZ
+
PT_PSR
],
%
g3
ld
[%
sp
+
STACKFRAME
_SZ
+
PT_PSR
],
%
g3
set
PSR_C
,
%
g2
bgeu
1
f
andcc
%
l6
,
0x02
,
%
l6
...
...
@@ -1529,35 +1537,35 @@ C_LABEL(ret_sys_call):
/
*
System
call
success
,
clear
Carry
condition
code
.
*/
andn
%
g3
,
%
g2
,
%
g3
clr
%
l6
st
%
g3
,
[%
sp
+
REGWIN
_SZ
+
PT_PSR
]
st
%
g3
,
[%
sp
+
STACKFRAME
_SZ
+
PT_PSR
]
bne
linux_syscall_trace2
ld
[%
sp
+
REGWIN
_SZ
+
PT_NPC
],
%
l1
/*
pc
=
npc
*/
ld
[%
sp
+
STACKFRAME
_SZ
+
PT_NPC
],
%
l1
/*
pc
=
npc
*/
add
%
l1
,
0x4
,
%
l2
/*
npc
=
npc
+
4
*/
st
%
l1
,
[%
sp
+
REGWIN
_SZ
+
PT_PC
]
st
%
l1
,
[%
sp
+
STACKFRAME
_SZ
+
PT_PC
]
b
ret_trap_entry
st
%
l2
,
[%
sp
+
REGWIN
_SZ
+
PT_NPC
]
st
%
l2
,
[%
sp
+
STACKFRAME
_SZ
+
PT_NPC
]
1
:
/
*
System
call
failure
,
set
Carry
condition
code
.
*
Also
,
get
abs
(
errno
)
to
return
to
the
process
.
*/
sub
%
g0
,
%
o0
,
%
o0
or
%
g3
,
%
g2
,
%
g3
st
%
o0
,
[%
sp
+
REGWIN
_SZ
+
PT_I0
]
st
%
o0
,
[%
sp
+
STACKFRAME
_SZ
+
PT_I0
]
mov
1
,
%
l6
st
%
g3
,
[%
sp
+
REGWIN
_SZ
+
PT_PSR
]
st
%
g3
,
[%
sp
+
STACKFRAME
_SZ
+
PT_PSR
]
bne
linux_syscall_trace2
ld
[%
sp
+
REGWIN
_SZ
+
PT_NPC
],
%
l1
/*
pc
=
npc
*/
ld
[%
sp
+
STACKFRAME
_SZ
+
PT_NPC
],
%
l1
/*
pc
=
npc
*/
add
%
l1
,
0x4
,
%
l2
/*
npc
=
npc
+
4
*/
st
%
l1
,
[%
sp
+
REGWIN
_SZ
+
PT_PC
]
st
%
l1
,
[%
sp
+
STACKFRAME
_SZ
+
PT_PC
]
b
ret_trap_entry
st
%
l2
,
[%
sp
+
REGWIN
_SZ
+
PT_NPC
]
st
%
l2
,
[%
sp
+
STACKFRAME
_SZ
+
PT_NPC
]
linux_syscall_trace2
:
call
C_LABEL
(
syscall_trace
)
add
%
l1
,
0x4
,
%
l2
/*
npc
=
npc
+
4
*/
st
%
l1
,
[%
sp
+
REGWIN
_SZ
+
PT_PC
]
st
%
l1
,
[%
sp
+
STACKFRAME
_SZ
+
PT_PC
]
b
ret_trap_entry
st
%
l2
,
[%
sp
+
REGWIN
_SZ
+
PT_NPC
]
st
%
l2
,
[%
sp
+
STACKFRAME
_SZ
+
PT_NPC
]
/
*
...
...
@@ -1595,19 +1603,19 @@ solaris_syscall:
mov
%
i0
,
%
l5
call
C_LABEL
(
do_solaris_syscall
)
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
st
%
o0
,
[%
sp
+
REGWIN
_SZ
+
PT_I0
]
st
%
o0
,
[%
sp
+
STACKFRAME
_SZ
+
PT_I0
]
set
PSR_C
,
%
g2
cmp
%
o0
,
-
ENOIOCTLCMD
bgeu
1
f
ld
[%
sp
+
REGWIN
_SZ
+
PT_PSR
],
%
g3
ld
[%
sp
+
STACKFRAME
_SZ
+
PT_PSR
],
%
g3
/
*
System
call
success
,
clear
Carry
condition
code
.
*/
andn
%
g3
,
%
g2
,
%
g3
clr
%
l6
b
2
f
st
%
g3
,
[%
sp
+
REGWIN
_SZ
+
PT_PSR
]
st
%
g3
,
[%
sp
+
STACKFRAME
_SZ
+
PT_PSR
]
1
:
/
*
System
call
failure
,
set
Carry
condition
code
.
...
...
@@ -1615,9 +1623,9 @@ solaris_syscall:
*/
sub
%
g0
,
%
o0
,
%
o0
mov
1
,
%
l6
st
%
o0
,
[%
sp
+
REGWIN
_SZ
+
PT_I0
]
st
%
o0
,
[%
sp
+
STACKFRAME
_SZ
+
PT_I0
]
or
%
g3
,
%
g2
,
%
g3
st
%
g3
,
[%
sp
+
REGWIN
_SZ
+
PT_PSR
]
st
%
g3
,
[%
sp
+
STACKFRAME
_SZ
+
PT_PSR
]
/
*
Advance
the
pc
and
npc
over
the
trap
instruction
.
*
If
the
npc
is
unaligned
(
has
a
1
in
the
lower
byte
),
it
means
...
...
@@ -1626,19 +1634,19 @@ solaris_syscall:
*
nPC
(
setcontext
)
.
*/
2
:
ld
[%
sp
+
REGWIN
_SZ
+
PT_NPC
],
%
l1
/*
pc
=
npc
*/
ld
[%
sp
+
STACKFRAME
_SZ
+
PT_NPC
],
%
l1
/*
pc
=
npc
*/
andcc
%
l1
,
1
,
%
g0
bne
1
f
add
%
l1
,
0x4
,
%
l2
/*
npc
=
npc
+
4
*/
st
%
l1
,
[%
sp
+
REGWIN
_SZ
+
PT_PC
]
st
%
l1
,
[%
sp
+
STACKFRAME
_SZ
+
PT_PC
]
b
ret_trap_entry
st
%
l2
,
[%
sp
+
REGWIN
_SZ
+
PT_NPC
]
st
%
l2
,
[%
sp
+
STACKFRAME
_SZ
+
PT_NPC
]
/
*
kernel
knows
what
it
is
doing
,
fixup
npc
and
continue
*/
1
:
sub
%
l1
,
1
,
%
l1
b
ret_trap_entry
st
%
l1
,
[%
sp
+
REGWIN
_SZ
+
PT_NPC
]
st
%
l1
,
[%
sp
+
STACKFRAME
_SZ
+
PT_NPC
]
#ifndef CONFIG_SUNOS_EMUL
.
align
4
...
...
@@ -1651,7 +1659,7 @@ sunos_syscall:
nop
mov
%
i0
,
%
l5
call
C_LABEL
(
do_sunos_syscall
)
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
#endif
/
*
{
net
,
open
}
bsd
system
calls
enter
here
...
*/
...
...
@@ -1688,17 +1696,17 @@ bsd_is_too_hard:
call
%
l7
mov
%
i5
,
%
o5
st
%
o0
,
[%
sp
+
REGWIN
_SZ
+
PT_I0
]
st
%
o0
,
[%
sp
+
STACKFRAME
_SZ
+
PT_I0
]
set
PSR_C
,
%
g2
cmp
%
o0
,
-
ENOIOCTLCMD
bgeu
1
f
ld
[%
sp
+
REGWIN
_SZ
+
PT_PSR
],
%
g3
ld
[%
sp
+
STACKFRAME
_SZ
+
PT_PSR
],
%
g3
/
*
System
call
success
,
clear
Carry
condition
code
.
*/
andn
%
g3
,
%
g2
,
%
g3
clr
%
l6
b
2
f
st
%
g3
,
[%
sp
+
REGWIN
_SZ
+
PT_PSR
]
st
%
g3
,
[%
sp
+
STACKFRAME
_SZ
+
PT_PSR
]
1
:
/
*
System
call
failure
,
set
Carry
condition
code
.
...
...
@@ -1712,17 +1720,17 @@ bsd_is_too_hard:
ld
[%
o3
+
%
o0
],
%
o0
#endif
mov
1
,
%
l6
st
%
o0
,
[%
sp
+
REGWIN
_SZ
+
PT_I0
]
st
%
o0
,
[%
sp
+
STACKFRAME
_SZ
+
PT_I0
]
or
%
g3
,
%
g2
,
%
g3
st
%
g3
,
[%
sp
+
REGWIN
_SZ
+
PT_PSR
]
st
%
g3
,
[%
sp
+
STACKFRAME
_SZ
+
PT_PSR
]
/
*
Advance
the
pc
and
npc
over
the
trap
instruction
.
*/
2
:
ld
[%
sp
+
REGWIN
_SZ
+
PT_NPC
],
%
l1
/*
pc
=
npc
*/
ld
[%
sp
+
STACKFRAME
_SZ
+
PT_NPC
],
%
l1
/*
pc
=
npc
*/
add
%
l1
,
0x4
,
%
l2
/*
npc
=
npc
+
4
*/
st
%
l1
,
[%
sp
+
REGWIN
_SZ
+
PT_PC
]
st
%
l1
,
[%
sp
+
STACKFRAME
_SZ
+
PT_PC
]
b
ret_trap_entry
st
%
l2
,
[%
sp
+
REGWIN
_SZ
+
PT_NPC
]
st
%
l2
,
[%
sp
+
STACKFRAME
_SZ
+
PT_NPC
]
/*
Saving
and
restoring
the
FPU
state
is
best
done
from
lowlevel
code
.
*
...
...
@@ -1810,7 +1818,7 @@ C_LABEL(fpload):
.
globl
C_LABEL
(
ndelay
)
C_LABEL
(
ndelay
):
save
%
sp
,
-
REGWIN
_SZ
,
%
sp
save
%
sp
,
-
STACKFRAME
_SZ
,
%
sp
mov
%
i0
,
%
o0
call
.
umul
mov
5
,
%
o1
...
...
@@ -1819,7 +1827,7 @@ C_LABEL(ndelay):
.
globl
C_LABEL
(
udelay
)
C_LABEL
(
udelay
):
save
%
sp
,
-
REGWIN
_SZ
,
%
sp
save
%
sp
,
-
STACKFRAME
_SZ
,
%
sp
mov
%
i0
,
%
o0
sethi
%
hi
(
0x10c6
),
%
o1
call
.
umul
...
...
@@ -1856,9 +1864,9 @@ breakpoint_trap:
wr
%
l0
,
PSR_ET
,
%
psr
WRITE_PAUSE
st
%
i0
,
[%
sp
+
REGWIN
_SZ
+
PT_G0
]
!
for
restarting
syscalls
st
%
i0
,
[%
sp
+
STACKFRAME
_SZ
+
PT_G0
]
!
for
restarting
syscalls
call
C_LABEL
(
sparc_breakpoint
)
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
RESTORE_ALL
...
...
@@ -1953,7 +1961,7 @@ linux_trap_ipi15_pcic:
WRITE_PAUSE
call
C_LABEL
(
pcic_nmi
)
add
%
sp
,
REGWIN
_SZ
,
%
o1
!
struct
pt_regs
*
regs
add
%
sp
,
STACKFRAME
_SZ
,
%
o1
!
struct
pt_regs
*
regs
RESTORE_ALL
.
globl
C_LABEL
(
pcic_nmi_trap_patch
)
...
...
arch/sparc/kernel/etrap.S
View file @
35dca6a2
...
...
@@ -88,7 +88,7 @@ trap_setup:
/
*
From
kernel
,
allocate
more
kernel
stack
and
*
build
a
pt_regs
trap
frame
.
*/
sub
%
fp
,
(
REGWIN
_SZ
+
TRACEREG_SZ
),
%
t_kstack
sub
%
fp
,
(
STACKFRAME
_SZ
+
TRACEREG_SZ
),
%
t_kstack
STORE_PT_ALL
(
t_kstack
,
t_psr
,
t_pc
,
t_npc
,
g2
)
/
*
See
if
we
are
in
the
trap
window
.
*/
...
...
@@ -129,7 +129,7 @@ tsetup_patch2:
jmpl
%
t_retpc
+
0x8
,
%
g0
!
return
to
caller
mov
%
t_kstack
,
%
sp
!
and
onto
new
kernel
stack
#define STACK_OFFSET (THREAD_SIZE -
(TRACEREG_SZ + REGWIN_SZ)
)
#define STACK_OFFSET (THREAD_SIZE -
TRACEREG_SZ - STACKFRAME_SZ
)
trap_setup_from_user
:
/
*
We
can
't use %curptr yet. */
...
...
arch/sparc/kernel/head.S
View file @
35dca6a2
...
...
@@ -1012,7 +1012,7 @@ sun4c_continue_boot:
/
*
I
want
a
kernel
stack
NOW
!
*/
set
C_LABEL
(
init_thread_union
),
%
g1
set
(
THREAD_SIZE
-
REGWIN
_SZ
),
%
g2
set
(
THREAD_SIZE
-
STACKFRAME
_SZ
),
%
g2
add
%
g1
,
%
g2
,
%
sp
mov
0
,
%
fp
/*
And
for
good
luck
*/
...
...
arch/sparc/kernel/process.c
View file @
35dca6a2
...
...
@@ -377,60 +377,12 @@ void flush_thread(void)
current
->
thread
.
flags
&=
~
SPARC_FLAG_KTHREAD
;
/* We must fixup kregs as well. */
/* XXX This was not fixed for ti for a while, worked. Unused? */
current
->
thread
.
kregs
=
(
struct
pt_regs
*
)
(((
unsigned
long
)
current
)
+
(
THREAD_SIZE
-
TRACEREG_SZ
));
((
char
*
)
current
->
thread_info
+
(
THREAD_SIZE
-
TRACEREG_SZ
));
}
}
static
__inline__
void
copy_regs
(
struct
pt_regs
*
dst
,
struct
pt_regs
*
src
)
{
__asm__
__volatile__
(
"ldd
\t
[%1 + 0x00], %%g2
\n\t
"
"ldd
\t
[%1 + 0x08], %%g4
\n\t
"
"ldd
\t
[%1 + 0x10], %%o4
\n\t
"
"std
\t
%%g2, [%0 + 0x00]
\n\t
"
"std
\t
%%g4, [%0 + 0x08]
\n\t
"
"std
\t
%%o4, [%0 + 0x10]
\n\t
"
"ldd
\t
[%1 + 0x18], %%g2
\n\t
"
"ldd
\t
[%1 + 0x20], %%g4
\n\t
"
"ldd
\t
[%1 + 0x28], %%o4
\n\t
"
"std
\t
%%g2, [%0 + 0x18]
\n\t
"
"std
\t
%%g4, [%0 + 0x20]
\n\t
"
"std
\t
%%o4, [%0 + 0x28]
\n\t
"
"ldd
\t
[%1 + 0x30], %%g2
\n\t
"
"ldd
\t
[%1 + 0x38], %%g4
\n\t
"
"ldd
\t
[%1 + 0x40], %%o4
\n\t
"
"std
\t
%%g2, [%0 + 0x30]
\n\t
"
"std
\t
%%g4, [%0 + 0x38]
\n\t
"
"ldd
\t
[%1 + 0x48], %%g2
\n\t
"
"std
\t
%%o4, [%0 + 0x40]
\n\t
"
"std
\t
%%g2, [%0 + 0x48]
\n\t
"
:
:
"r"
(
dst
),
"r"
(
src
)
:
"g2"
,
"g3"
,
"g4"
,
"g5"
,
"o4"
,
"o5"
);
}
static
__inline__
void
copy_regwin
(
struct
reg_window
*
dst
,
struct
reg_window
*
src
)
{
__asm__
__volatile__
(
"ldd
\t
[%1 + 0x00], %%g2
\n\t
"
"ldd
\t
[%1 + 0x08], %%g4
\n\t
"
"ldd
\t
[%1 + 0x10], %%o4
\n\t
"
"std
\t
%%g2, [%0 + 0x00]
\n\t
"
"std
\t
%%g4, [%0 + 0x08]
\n\t
"
"std
\t
%%o4, [%0 + 0x10]
\n\t
"
"ldd
\t
[%1 + 0x18], %%g2
\n\t
"
"ldd
\t
[%1 + 0x20], %%g4
\n\t
"
"ldd
\t
[%1 + 0x28], %%o4
\n\t
"
"std
\t
%%g2, [%0 + 0x18]
\n\t
"
"std
\t
%%g4, [%0 + 0x20]
\n\t
"
"std
\t
%%o4, [%0 + 0x28]
\n\t
"
"ldd
\t
[%1 + 0x30], %%g2
\n\t
"
"ldd
\t
[%1 + 0x38], %%g4
\n\t
"
"std
\t
%%g2, [%0 + 0x30]
\n\t
"
"std
\t
%%g4, [%0 + 0x38]
\n\t
"
:
:
"r"
(
dst
),
"r"
(
src
)
:
"g2"
,
"g3"
,
"g4"
,
"g5"
,
"o4"
,
"o5"
);
}
static
__inline__
struct
sparc_stackf
*
clone_stackframe
(
struct
sparc_stackf
*
dst
,
struct
sparc_stackf
*
src
)
{
...
...
@@ -495,8 +447,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
{
struct
thread_info
*
ti
=
p
->
thread_info
;
struct
pt_regs
*
childregs
;
struct
reg_window
*
new_stack
;
unsigned
long
stack_offset
;
char
*
new_stack
;
#ifndef CONFIG_SMP
if
(
last_task_used_math
==
current
)
{
...
...
@@ -513,15 +464,18 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
p
->
set_child_tid
=
p
->
clear_child_tid
=
NULL
;
/* Calculate offset to stack_frame & pt_regs */
stack_offset
=
THREAD_SIZE
-
TRACEREG_SZ
;
if
(
regs
->
psr
&
PSR_PS
)
stack_offset
-=
REGWIN_SZ
;
childregs
=
((
struct
pt_regs
*
)
(((
unsigned
long
)
ti
)
+
stack_offset
));
copy_regs
(
childregs
,
regs
);
new_stack
=
(((
struct
reg_window
*
)
childregs
)
-
1
);
copy_regwin
(
new_stack
,
(((
struct
reg_window
*
)
regs
)
-
1
));
/*
* p->thread_info new_stack childregs
* ! ! ! {if(PSR_PS) }
* V V (stk.fr.) V (pt_regs) { (stk.fr.) }
* +----- - - - - - ------+===========+============={+==========}+
*/
new_stack
=
(
char
*
)
ti
+
THREAD_SIZE
;
if
(
regs
->
psr
&
PSR_PS
)
new_stack
-=
STACKFRAME_SZ
;
new_stack
-=
STACKFRAME_SZ
+
TRACEREG_SZ
;
memcpy
(
new_stack
,
(
char
*
)
regs
-
STACKFRAME_SZ
,
STACKFRAME_SZ
+
TRACEREG_SZ
);
childregs
=
(
struct
pt_regs
*
)
(
new_stack
+
STACKFRAME_SZ
);
/*
* A new process must start with interrupts closed in 2.5,
...
...
@@ -542,14 +496,11 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
extern
struct
pt_regs
fake_swapper_regs
;
p
->
thread
.
kregs
=
&
fake_swapper_regs
;
new_stack
=
(
struct
reg_window
*
)
((((
unsigned
long
)
ti
)
+
(
THREAD_SIZE
))
-
REGWIN_SZ
);
new_stack
+=
STACKFRAME_SZ
+
TRACEREG_SZ
;
childregs
->
u_regs
[
UREG_FP
]
=
(
unsigned
long
)
new_stack
;
p
->
thread
.
flags
|=
SPARC_FLAG_KTHREAD
;
p
->
thread
.
current_ds
=
KERNEL_DS
;
memcpy
((
void
*
)
new_stack
,
(
void
*
)
regs
->
u_regs
[
UREG_FP
],
sizeof
(
struct
reg_window
));
memcpy
(
new_stack
,
(
void
*
)
regs
->
u_regs
[
UREG_FP
],
STACKFRAME_SZ
);
childregs
->
u_regs
[
UREG_G6
]
=
(
unsigned
long
)
ti
;
}
else
{
p
->
thread
.
kregs
=
childregs
;
...
...
arch/sparc/kernel/rtrap.S
View file @
35dca6a2
...
...
@@ -72,16 +72,16 @@ C_LABEL(ret_trap_lockless_ipi):
signal_p
:
andcc
%
g2
,
(
_TIF_NOTIFY_RESUME
|
_TIF_SIGPENDING
),
%
g0
bz
,
a
ret_trap_continue
ld
[%
sp
+
REGWIN
_SZ
+
PT_PSR
],
%
t_psr
ld
[%
sp
+
STACKFRAME
_SZ
+
PT_PSR
],
%
t_psr
clr
%
o0
mov
%
l5
,
%
o2
mov
%
l6
,
%
o3
call
C_LABEL
(
do_signal
)
add
%
sp
,
REGWIN
_SZ
,
%
o1
!
pt_regs
ptr
add
%
sp
,
STACKFRAME
_SZ
,
%
o1
!
pt_regs
ptr
/
*
Fall
through
.
*/
ld
[%
sp
+
REGWIN
_SZ
+
PT_PSR
],
%
t_psr
ld
[%
sp
+
STACKFRAME
_SZ
+
PT_PSR
],
%
t_psr
clr
%
l6
ret_trap_continue
:
wr
%
t_psr
,
0x0
,
%
psr
...
...
@@ -98,7 +98,7 @@ ret_trap_continue:
mov
1
,
%
o1
call
C_LABEL
(
try_to_clear_window_buffer
)
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
b
signal_p
ld
[%
curptr
+
TI_FLAGS
],
%
g2
...
...
@@ -145,7 +145,7 @@ ret_trap_userwins_ok:
nop
b
ret_trap_unaligned_pc
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
1
:
LOAD_PT_YREG
(
sp
,
g1
)
...
...
@@ -158,9 +158,9 @@ ret_trap_userwins_ok:
rett
%
t_npc
ret_trap_unaligned_pc
:
ld
[%
sp
+
REGWIN
_SZ
+
PT_PC
],
%
o1
ld
[%
sp
+
REGWIN
_SZ
+
PT_NPC
],
%
o2
ld
[%
sp
+
REGWIN
_SZ
+
PT_PSR
],
%
o3
ld
[%
sp
+
STACKFRAME
_SZ
+
PT_PC
],
%
o1
ld
[%
sp
+
STACKFRAME
_SZ
+
PT_NPC
],
%
o2
ld
[%
sp
+
STACKFRAME
_SZ
+
PT_PSR
],
%
o3
wr
%
t_wim
,
0x0
,
%
wim
!
or
else
...
...
...
@@ -218,7 +218,7 @@ ret_trap_user_stack_is_bolixed:
WRITE_PAUSE
call
C_LABEL
(
window_ret_fault
)
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
b
signal_p
ld
[%
curptr
+
TI_FLAGS
],
%
g2
...
...
arch/sparc/kernel/signal.c
View file @
35dca6a2
...
...
@@ -753,7 +753,7 @@ setup_svr4_frame(struct sigaction *sa, unsigned long pc, unsigned long npc,
synchronize_user_stack
();
sfp
=
(
svr4_signal_frame_t
__user
*
)
get_sigframe
(
sa
,
regs
,
SVR4_SF_ALIGNED
+
REGWIN_SZ
);
get_sigframe
(
sa
,
regs
,
SVR4_SF_ALIGNED
+
sizeof
(
struct
reg_window
)
);
if
(
invalid_frame_pointer
(
sfp
,
sizeof
(
*
sfp
)))
goto
sigill_and_return
;
...
...
arch/sparc/kernel/sunos_asm.S
View file @
35dca6a2
...
...
@@ -16,7 +16,7 @@
.
align
4
/
*
When
calling
ret_sys_call
,
%
o0
should
contain
the
same
*
value
as
in
[%
sp
+
REGWIN
_SZ
+
PT_I0
]
*/
*
value
as
in
[%
sp
+
STACKFRAME
_SZ
+
PT_I0
]
*/
/
*
SunOS
getpid
()
returns
pid
in
%
o0
and
ppid
in
%
o1
*/
.
globl
C_LABEL
(
sunos_getpid
)
...
...
@@ -25,10 +25,10 @@ C_LABEL(sunos_getpid):
nop
call
C_LABEL
(
sys_getpid
)
st
%
o0
,
[%
sp
+
REGWIN
_SZ
+
PT_I1
]
st
%
o0
,
[%
sp
+
STACKFRAME
_SZ
+
PT_I1
]
b
C_LABEL
(
ret_sys_call
)
st
%
o0
,
[%
sp
+
REGWIN
_SZ
+
PT_I0
]
st
%
o0
,
[%
sp
+
STACKFRAME
_SZ
+
PT_I0
]
/
*
SunOS
getuid
()
returns
uid
in
%
o0
and
euid
in
%
o1
*/
.
globl
C_LABEL
(
sunos_getuid
)
...
...
@@ -37,10 +37,10 @@ C_LABEL(sunos_getuid):
nop
call
C_LABEL
(
sys_getuid16
)
st
%
o0
,
[%
sp
+
REGWIN
_SZ
+
PT_I1
]
st
%
o0
,
[%
sp
+
STACKFRAME
_SZ
+
PT_I1
]
b
C_LABEL
(
ret_sys_call
)
st
%
o0
,
[%
sp
+
REGWIN
_SZ
+
PT_I0
]
st
%
o0
,
[%
sp
+
STACKFRAME
_SZ
+
PT_I0
]
/
*
SunOS
getgid
()
returns
gid
in
%
o0
and
egid
in
%
o1
*/
.
globl
C_LABEL
(
sunos_getgid
)
...
...
@@ -49,20 +49,20 @@ C_LABEL(sunos_getgid):
nop
call
C_LABEL
(
sys_getgid16
)
st
%
o0
,
[%
sp
+
REGWIN
_SZ
+
PT_I1
]
st
%
o0
,
[%
sp
+
STACKFRAME
_SZ
+
PT_I1
]
b
C_LABEL
(
ret_sys_call
)
st
%
o0
,
[%
sp
+
REGWIN
_SZ
+
PT_I0
]
st
%
o0
,
[%
sp
+
STACKFRAME
_SZ
+
PT_I0
]
/
*
SunOS
's execv() call only specifies the argv argument, the
*
environment
settings
are
the
same
as
the
calling
processes
.
*/
.
globl
C_LABEL
(
sunos_execv
)
C_LABEL
(
sunos_execv
):
st
%
g0
,
[%
sp
+
REGWIN
_SZ
+
PT_I2
]
st
%
g0
,
[%
sp
+
STACKFRAME
_SZ
+
PT_I2
]
call
C_LABEL
(
sparc_execve
)
add
%
sp
,
REGWIN
_SZ
,
%
o0
add
%
sp
,
STACKFRAME
_SZ
,
%
o0
b
C_LABEL
(
ret_sys_call
)
ld
[%
sp
+
REGWIN
_SZ
+
PT_I0
],
%
o0
ld
[%
sp
+
STACKFRAME
_SZ
+
PT_I0
],
%
o0
arch/sparc/kernel/trampoline.S
View file @
35dca6a2
...
...
@@ -63,8 +63,8 @@ cpu3_startup:
and
%
g4
,
0xc
,
%
g4
ld
[%
g5
+
%
g4
],
%
g6
sethi
%
hi
(
THREAD_SIZE
-
REGWIN
_SZ
),
%
sp
or
%
sp
,
%
lo
(
THREAD_SIZE
-
REGWIN
_SZ
),
%
sp
sethi
%
hi
(
THREAD_SIZE
-
STACKFRAME
_SZ
),
%
sp
or
%
sp
,
%
lo
(
THREAD_SIZE
-
STACKFRAME
_SZ
),
%
sp
add
%
g6
,
%
sp
,
%
sp
/
*
Turn
on
traps
(
PSR_ET
)
.
*/
...
...
@@ -142,8 +142,8 @@ C_LABEL(sun4d_cpu_startup):
srl
%
g3
,
1
,
%
g4
ld
[%
g5
+
%
g4
],
%
g6
sethi
%
hi
(
THREAD_SIZE
-
REGWIN
_SZ
),
%
sp
or
%
sp
,
%
lo
(
THREAD_SIZE
-
REGWIN
_SZ
),
%
sp
sethi
%
hi
(
THREAD_SIZE
-
STACKFRAME
_SZ
),
%
sp
or
%
sp
,
%
lo
(
THREAD_SIZE
-
STACKFRAME
_SZ
),
%
sp
add
%
g6
,
%
sp
,
%
sp
/
*
Turn
on
traps
(
PSR_ET
)
.
*/
...
...
arch/sparc/kernel/windows.c
View file @
35dca6a2
...
...
@@ -120,7 +120,7 @@ void try_to_clear_window_buffer(struct pt_regs *regs, int who)
unsigned
long
sp
=
tp
->
rwbuf_stkptrs
[
window
];
if
((
sp
&
7
)
||
copy_to_user
((
char
*
)
sp
,
&
tp
->
reg_window
[
window
],
REGWIN_SZ
))
copy_to_user
((
char
*
)
sp
,
&
tp
->
reg_window
[
window
],
sizeof
(
struct
reg_window
)
))
do_exit
(
SIGILL
);
}
tp
->
w_saved
=
0
;
...
...
arch/sparc/kernel/wof.S
View file @
35dca6a2
...
...
@@ -238,7 +238,7 @@ spwin_user_stack_is_bolixed:
spnwin_patch3
:
and
%
twin_tmp
,
0xff
,
%
twin_tmp
!
patched
on
7
win
Sparcs
st
%
twin_tmp
,
[%
curptr
+
TI_UWINMASK
]
#define STACK_OFFSET
(THREAD_SIZE - TRACEREG_SZ - REGWIN
_SZ)
#define STACK_OFFSET
(THREAD_SIZE - TRACEREG_SZ - STACKFRAME
_SZ)
sethi
%
hi
(
STACK_OFFSET
),
%
sp
or
%
sp
,
%
lo
(
STACK_OFFSET
),
%
sp
...
...
arch/sparc/kernel/wuf.S
View file @
35dca6a2
...
...
@@ -140,7 +140,7 @@ fwin_from_user:
C_LABEL
(
fwin_mmu_patchme
):
b
C_LABEL
(
sun4c_fwin_stackchk
)
andcc
%
sp
,
0x7
,
%
g0
#define STACK_OFFSET (THREAD_SIZE - TRACEREG_SZ -
REGWIN
_SZ)
#define STACK_OFFSET (THREAD_SIZE - TRACEREG_SZ -
STACKFRAME
_SZ)
fwin_user_stack_is_bolixed
:
/
*
LOCATION
:
Window
'W'
*/
...
...
include/asm-sparc/kgdb.h
View file @
35dca6a2
...
...
@@ -52,43 +52,43 @@ struct kgdb_frame {
#define KGDB_NPC 0x114
#define SAVE_KGDB_GLOBALS(reg) \
std %g0, [%reg +
REGWIN
_SZ + KGDB_G0]; \
std %g2, [%reg +
REGWIN
_SZ + KGDB_G2]; \
std %g4, [%reg +
REGWIN
_SZ + KGDB_G4]; \
std %g6, [%reg +
REGWIN
_SZ + KGDB_G6];
std %g0, [%reg +
STACKFRAME
_SZ + KGDB_G0]; \
std %g2, [%reg +
STACKFRAME
_SZ + KGDB_G2]; \
std %g4, [%reg +
STACKFRAME
_SZ + KGDB_G4]; \
std %g6, [%reg +
STACKFRAME
_SZ + KGDB_G6];
#define SAVE_KGDB_INS(reg) \
std %i0, [%reg +
REGWIN
_SZ + KGDB_I0]; \
std %i2, [%reg +
REGWIN
_SZ + KGDB_I2]; \
std %i4, [%reg +
REGWIN
_SZ + KGDB_I4]; \
std %i6, [%reg +
REGWIN
_SZ + KGDB_I6];
std %i0, [%reg +
STACKFRAME
_SZ + KGDB_I0]; \
std %i2, [%reg +
STACKFRAME
_SZ + KGDB_I2]; \
std %i4, [%reg +
STACKFRAME
_SZ + KGDB_I4]; \
std %i6, [%reg +
STACKFRAME
_SZ + KGDB_I6];
#define SAVE_KGDB_SREGS(reg, reg_y, reg_psr, reg_wim, reg_tbr, reg_pc, reg_npc) \
st %reg_y, [%reg +
REGWIN
_SZ + KGDB_Y]; \
st %reg_psr, [%reg +
REGWIN
_SZ + KGDB_PSR]; \
st %reg_wim, [%reg +
REGWIN
_SZ + KGDB_WIM]; \
st %reg_tbr, [%reg +
REGWIN
_SZ + KGDB_TBR]; \
st %reg_pc, [%reg +
REGWIN
_SZ + KGDB_PC]; \
st %reg_npc, [%reg +
REGWIN
_SZ + KGDB_NPC];
st %reg_y, [%reg +
STACKFRAME
_SZ + KGDB_Y]; \
st %reg_psr, [%reg +
STACKFRAME
_SZ + KGDB_PSR]; \
st %reg_wim, [%reg +
STACKFRAME
_SZ + KGDB_WIM]; \
st %reg_tbr, [%reg +
STACKFRAME
_SZ + KGDB_TBR]; \
st %reg_pc, [%reg +
STACKFRAME
_SZ + KGDB_PC]; \
st %reg_npc, [%reg +
STACKFRAME
_SZ + KGDB_NPC];
#define LOAD_KGDB_GLOBALS(reg) \
ld [%reg +
REGWIN
_SZ + KGDB_G1], %g1; \
ldd [%reg +
REGWIN
_SZ + KGDB_G2], %g2; \
ldd [%reg +
REGWIN
_SZ + KGDB_G4], %g4; \
ldd [%reg +
REGWIN
_SZ + KGDB_G6], %g6;
ld [%reg +
STACKFRAME
_SZ + KGDB_G1], %g1; \
ldd [%reg +
STACKFRAME
_SZ + KGDB_G2], %g2; \
ldd [%reg +
STACKFRAME
_SZ + KGDB_G4], %g4; \
ldd [%reg +
STACKFRAME
_SZ + KGDB_G6], %g6;
#define LOAD_KGDB_INS(reg) \
ldd [%reg +
REGWIN
_SZ + KGDB_I0], %i0; \
ldd [%reg +
REGWIN
_SZ + KGDB_I2], %i2; \
ldd [%reg +
REGWIN
_SZ + KGDB_I4], %i4; \
ldd [%reg +
REGWIN
_SZ + KGDB_I6], %i6;
ldd [%reg +
STACKFRAME
_SZ + KGDB_I0], %i0; \
ldd [%reg +
STACKFRAME
_SZ + KGDB_I2], %i2; \
ldd [%reg +
STACKFRAME
_SZ + KGDB_I4], %i4; \
ldd [%reg +
STACKFRAME
_SZ + KGDB_I6], %i6;
#define LOAD_KGDB_SREGS(reg, reg_y, reg_psr, reg_wim, reg_tbr, reg_pc, reg_npc) \
ld [%reg +
REGWIN
_SZ + KGDB_Y], %reg_y; \
ld [%reg +
REGWIN
_SZ + KGDB_PSR], %reg_psr; \
ld [%reg +
REGWIN
_SZ + KGDB_WIM], %reg_wim; \
ld [%reg +
REGWIN
_SZ + KGDB_TBR], %reg_tbr; \
ld [%reg +
REGWIN
_SZ + KGDB_PC], %reg_pc; \
ld [%reg +
REGWIN
_SZ + KGDB_NPC], %reg_npc;
ld [%reg +
STACKFRAME
_SZ + KGDB_Y], %reg_y; \
ld [%reg +
STACKFRAME
_SZ + KGDB_PSR], %reg_psr; \
ld [%reg +
STACKFRAME
_SZ + KGDB_WIM], %reg_wim; \
ld [%reg +
STACKFRAME
_SZ + KGDB_TBR], %reg_tbr; \
ld [%reg +
STACKFRAME
_SZ + KGDB_PC], %reg_pc; \
ld [%reg +
STACKFRAME
_SZ + KGDB_NPC], %reg_npc;
#endif
/* !(_SPARC_KGDB_H) */
include/asm-sparc/processor.h
View file @
35dca6a2
...
...
@@ -131,7 +131,7 @@ extern __inline__ void start_thread(struct pt_regs * regs, unsigned long pc,
"std
\t
%%g0, [%0 + %3 + 0x30]
\n\t
"
"st
\t
%1, [%0 + %3 + 0x38]
\n\t
"
"st
\t
%%g0, [%0 + %3 + 0x3c]"
:
:
"r"
(
regs
),
"r"
(
sp
-
REGWIN_SZ
),
"r"
(
zero
),
:
:
"r"
(
regs
),
"r"
(
sp
-
sizeof
(
struct
reg_window
)
),
"r"
(
zero
),
"i"
((
const
unsigned
long
)(
&
((
struct
pt_regs
*
)
0
)
->
u_regs
[
0
])));
}
...
...
include/asm-sparc/ptrace.h
View file @
35dca6a2
...
...
@@ -58,7 +58,6 @@ struct sparc_stackf {
#define TRACEREG_SZ sizeof(struct pt_regs)
#define STACKFRAME_SZ sizeof(struct sparc_stackf)
#define REGWIN_SZ sizeof(struct reg_window)
#ifdef __KERNEL__
#define user_mode(regs) (!((regs)->psr & PSR_PS))
...
...
@@ -70,7 +69,6 @@ extern void show_regs(struct pt_regs *);
/* For assembly code. */
#define TRACEREG_SZ 0x50
#define STACKFRAME_SZ 0x60
#define REGWIN_SZ 0x40
#endif
/*
...
...
include/asm-sparc/winmacro.h
View file @
35dca6a2
...
...
@@ -11,14 +11,6 @@
#include <asm/ptrace.h>
#include <asm/psr.h>
/* These are just handy. */
#define _SV save %sp, -REGWIN_SZ, %sp
#define _RS restore
#define FLUSH_ALL_KERNEL_WINDOWS \
_SV; _SV; _SV; _SV; _SV; _SV; _SV; \
_RS; _RS; _RS; _RS; _RS; _RS; _RS;
/* Store the register window onto the 8-byte aligned area starting
* at %reg. It might be %sp, it might not, we don't care.
*/
...
...
@@ -45,25 +37,25 @@
/* Loading and storing struct pt_reg trap frames. */
#define LOAD_PT_INS(base_reg) \
ldd [%base_reg +
REGWIN
_SZ + PT_I0], %i0; \
ldd [%base_reg +
REGWIN
_SZ + PT_I2], %i2; \
ldd [%base_reg +
REGWIN
_SZ + PT_I4], %i4; \
ldd [%base_reg +
REGWIN
_SZ + PT_I6], %i6;
ldd [%base_reg +
STACKFRAME
_SZ + PT_I0], %i0; \
ldd [%base_reg +
STACKFRAME
_SZ + PT_I2], %i2; \
ldd [%base_reg +
STACKFRAME
_SZ + PT_I4], %i4; \
ldd [%base_reg +
STACKFRAME
_SZ + PT_I6], %i6;
#define LOAD_PT_GLOBALS(base_reg) \
ld [%base_reg +
REGWIN
_SZ + PT_G1], %g1; \
ldd [%base_reg +
REGWIN
_SZ + PT_G2], %g2; \
ldd [%base_reg +
REGWIN
_SZ + PT_G4], %g4; \
ldd [%base_reg +
REGWIN
_SZ + PT_G6], %g6;
ld [%base_reg +
STACKFRAME
_SZ + PT_G1], %g1; \
ldd [%base_reg +
STACKFRAME
_SZ + PT_G2], %g2; \
ldd [%base_reg +
STACKFRAME
_SZ + PT_G4], %g4; \
ldd [%base_reg +
STACKFRAME
_SZ + PT_G6], %g6;
#define LOAD_PT_YREG(base_reg, scratch) \
ld [%base_reg +
REGWIN
_SZ + PT_Y], %scratch; \
ld [%base_reg +
STACKFRAME
_SZ + PT_Y], %scratch; \
wr %scratch, 0x0, %y;
#define LOAD_PT_PRIV(base_reg, pt_psr, pt_pc, pt_npc) \
ld [%base_reg +
REGWIN
_SZ + PT_PSR], %pt_psr; \
ld [%base_reg +
REGWIN
_SZ + PT_PC], %pt_pc; \
ld [%base_reg +
REGWIN
_SZ + PT_NPC], %pt_npc;
ld [%base_reg +
STACKFRAME
_SZ + PT_PSR], %pt_psr; \
ld [%base_reg +
STACKFRAME
_SZ + PT_PC], %pt_pc; \
ld [%base_reg +
STACKFRAME
_SZ + PT_NPC], %pt_npc;
#define LOAD_PT_ALL(base_reg, pt_psr, pt_pc, pt_npc, scratch) \
LOAD_PT_YREG(base_reg, scratch) \
...
...
@@ -72,25 +64,25 @@
LOAD_PT_PRIV(base_reg, pt_psr, pt_pc, pt_npc)
#define STORE_PT_INS(base_reg) \
std %i0, [%base_reg +
REGWIN
_SZ + PT_I0]; \
std %i2, [%base_reg +
REGWIN
_SZ + PT_I2]; \
std %i4, [%base_reg +
REGWIN
_SZ + PT_I4]; \
std %i6, [%base_reg +
REGWIN
_SZ + PT_I6];
std %i0, [%base_reg +
STACKFRAME
_SZ + PT_I0]; \
std %i2, [%base_reg +
STACKFRAME
_SZ + PT_I2]; \
std %i4, [%base_reg +
STACKFRAME
_SZ + PT_I4]; \
std %i6, [%base_reg +
STACKFRAME
_SZ + PT_I6];
#define STORE_PT_GLOBALS(base_reg) \
st %g1, [%base_reg +
REGWIN
_SZ + PT_G1]; \
std %g2, [%base_reg +
REGWIN
_SZ + PT_G2]; \
std %g4, [%base_reg +
REGWIN
_SZ + PT_G4]; \
std %g6, [%base_reg +
REGWIN
_SZ + PT_G6];
st %g1, [%base_reg +
STACKFRAME
_SZ + PT_G1]; \
std %g2, [%base_reg +
STACKFRAME
_SZ + PT_G2]; \
std %g4, [%base_reg +
STACKFRAME
_SZ + PT_G4]; \
std %g6, [%base_reg +
STACKFRAME
_SZ + PT_G6];
#define STORE_PT_YREG(base_reg, scratch) \
rd %y, %scratch; \
st %scratch, [%base_reg +
REGWIN
_SZ + PT_Y];
st %scratch, [%base_reg +
STACKFRAME
_SZ + PT_Y];
#define STORE_PT_PRIV(base_reg, pt_psr, pt_pc, pt_npc) \
st %pt_psr, [%base_reg +
REGWIN
_SZ + PT_PSR]; \
st %pt_pc, [%base_reg +
REGWIN
_SZ + PT_PC]; \
st %pt_npc, [%base_reg +
REGWIN
_SZ + PT_NPC];
st %pt_psr, [%base_reg +
STACKFRAME
_SZ + PT_PSR]; \
st %pt_pc, [%base_reg +
STACKFRAME
_SZ + PT_PC]; \
st %pt_npc, [%base_reg +
STACKFRAME
_SZ + PT_NPC];
#define STORE_PT_ALL(base_reg, reg_psr, reg_pc, reg_npc, g_scratch) \
STORE_PT_PRIV(base_reg, reg_psr, reg_pc, reg_npc) \
...
...
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