diff options
Diffstat (limited to 'arch/sparc64/kernel/entry.S')
-rw-r--r-- | arch/sparc64/kernel/entry.S | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S index d3973d8a7195..d781f10adc52 100644 --- a/arch/sparc64/kernel/entry.S +++ b/arch/sparc64/kernel/entry.S | |||
@@ -22,8 +22,6 @@ | |||
22 | #include <asm/estate.h> | 22 | #include <asm/estate.h> |
23 | #include <asm/auxio.h> | 23 | #include <asm/auxio.h> |
24 | 24 | ||
25 | /* #define SYSCALL_TRACING 1 */ | ||
26 | |||
27 | #define curptr g6 | 25 | #define curptr g6 |
28 | 26 | ||
29 | #define NR_SYSCALLS 284 /* Each OS is different... */ | 27 | #define NR_SYSCALLS 284 /* Each OS is different... */ |
@@ -1554,11 +1552,12 @@ sys_ptrace: add %sp, PTREGS_OFF, %o0 | |||
1554 | nop | 1552 | nop |
1555 | .align 32 | 1553 | .align 32 |
1556 | 1: ldx [%curptr + TI_FLAGS], %l5 | 1554 | 1: ldx [%curptr + TI_FLAGS], %l5 |
1557 | andcc %l5, _TIF_SYSCALL_TRACE, %g0 | 1555 | andcc %l5, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT), %g0 |
1558 | be,pt %icc, rtrap | 1556 | be,pt %icc, rtrap |
1559 | clr %l6 | 1557 | clr %l6 |
1558 | add %sp, PTREGS_OFF, %o0 | ||
1560 | call syscall_trace | 1559 | call syscall_trace |
1561 | nop | 1560 | mov 1, %o1 |
1562 | 1561 | ||
1563 | ba,pt %xcc, rtrap | 1562 | ba,pt %xcc, rtrap |
1564 | clr %l6 | 1563 | clr %l6 |
@@ -1642,18 +1641,20 @@ linux_sparc_ni_syscall: | |||
1642 | or %l7, %lo(sys_ni_syscall), %l7 | 1641 | or %l7, %lo(sys_ni_syscall), %l7 |
1643 | 1642 | ||
1644 | linux_syscall_trace32: | 1643 | linux_syscall_trace32: |
1644 | add %sp, PTREGS_OFF, %o0 | ||
1645 | call syscall_trace | 1645 | call syscall_trace |
1646 | nop | 1646 | clr %o1 |
1647 | srl %i0, 0, %o0 | 1647 | srl %i0, 0, %o0 |
1648 | mov %i4, %o4 | 1648 | srl %i4, 0, %o4 |
1649 | srl %i1, 0, %o1 | 1649 | srl %i1, 0, %o1 |
1650 | srl %i2, 0, %o2 | 1650 | srl %i2, 0, %o2 |
1651 | b,pt %xcc, 2f | 1651 | b,pt %xcc, 2f |
1652 | srl %i3, 0, %o3 | 1652 | srl %i3, 0, %o3 |
1653 | 1653 | ||
1654 | linux_syscall_trace: | 1654 | linux_syscall_trace: |
1655 | add %sp, PTREGS_OFF, %o0 | ||
1655 | call syscall_trace | 1656 | call syscall_trace |
1656 | nop | 1657 | clr %o1 |
1657 | mov %i0, %o0 | 1658 | mov %i0, %o0 |
1658 | mov %i1, %o1 | 1659 | mov %i1, %o1 |
1659 | mov %i2, %o2 | 1660 | mov %i2, %o2 |
@@ -1671,11 +1672,6 @@ linux_sparc_syscall32: | |||
1671 | bgeu,pn %xcc, linux_sparc_ni_syscall ! CTI | 1672 | bgeu,pn %xcc, linux_sparc_ni_syscall ! CTI |
1672 | srl %i0, 0, %o0 ! IEU0 | 1673 | srl %i0, 0, %o0 ! IEU0 |
1673 | sll %g1, 2, %l4 ! IEU0 Group | 1674 | sll %g1, 2, %l4 ! IEU0 Group |
1674 | #ifdef SYSCALL_TRACING | ||
1675 | call syscall_trace_entry | ||
1676 | add %sp, PTREGS_OFF, %o0 | ||
1677 | srl %i0, 0, %o0 | ||
1678 | #endif | ||
1679 | srl %i4, 0, %o4 ! IEU1 | 1675 | srl %i4, 0, %o4 ! IEU1 |
1680 | lduw [%l7 + %l4], %l7 ! Load | 1676 | lduw [%l7 + %l4], %l7 ! Load |
1681 | srl %i1, 0, %o1 ! IEU0 Group | 1677 | srl %i1, 0, %o1 ! IEU0 Group |
@@ -1683,7 +1679,7 @@ linux_sparc_syscall32: | |||
1683 | 1679 | ||
1684 | srl %i5, 0, %o5 ! IEU1 | 1680 | srl %i5, 0, %o5 ! IEU1 |
1685 | srl %i2, 0, %o2 ! IEU0 Group | 1681 | srl %i2, 0, %o2 ! IEU0 Group |
1686 | andcc %l0, _TIF_SYSCALL_TRACE, %g0 ! IEU0 Group | 1682 | andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT), %g0 |
1687 | bne,pn %icc, linux_syscall_trace32 ! CTI | 1683 | bne,pn %icc, linux_syscall_trace32 ! CTI |
1688 | mov %i0, %l5 ! IEU1 | 1684 | mov %i0, %l5 ! IEU1 |
1689 | call %l7 ! CTI Group brk forced | 1685 | call %l7 ! CTI Group brk forced |
@@ -1699,11 +1695,6 @@ linux_sparc_syscall: | |||
1699 | bgeu,pn %xcc, linux_sparc_ni_syscall ! CTI | 1695 | bgeu,pn %xcc, linux_sparc_ni_syscall ! CTI |
1700 | mov %i0, %o0 ! IEU0 | 1696 | mov %i0, %o0 ! IEU0 |
1701 | sll %g1, 2, %l4 ! IEU0 Group | 1697 | sll %g1, 2, %l4 ! IEU0 Group |
1702 | #ifdef SYSCALL_TRACING | ||
1703 | call syscall_trace_entry | ||
1704 | add %sp, PTREGS_OFF, %o0 | ||
1705 | mov %i0, %o0 | ||
1706 | #endif | ||
1707 | mov %i1, %o1 ! IEU1 | 1698 | mov %i1, %o1 ! IEU1 |
1708 | lduw [%l7 + %l4], %l7 ! Load | 1699 | lduw [%l7 + %l4], %l7 ! Load |
1709 | 4: mov %i2, %o2 ! IEU0 Group | 1700 | 4: mov %i2, %o2 ! IEU0 Group |
@@ -1711,7 +1702,7 @@ linux_sparc_syscall: | |||
1711 | 1702 | ||
1712 | mov %i3, %o3 ! IEU1 | 1703 | mov %i3, %o3 ! IEU1 |
1713 | mov %i4, %o4 ! IEU0 Group | 1704 | mov %i4, %o4 ! IEU0 Group |
1714 | andcc %l0, _TIF_SYSCALL_TRACE, %g0 ! IEU1 Group+1 bubble | 1705 | andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT), %g0 |
1715 | bne,pn %icc, linux_syscall_trace ! CTI Group | 1706 | bne,pn %icc, linux_syscall_trace ! CTI Group |
1716 | mov %i0, %l5 ! IEU0 | 1707 | mov %i0, %l5 ! IEU0 |
1717 | 2: call %l7 ! CTI Group brk forced | 1708 | 2: call %l7 ! CTI Group brk forced |
@@ -1720,12 +1711,6 @@ linux_sparc_syscall: | |||
1720 | 1711 | ||
1721 | 3: stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] | 1712 | 3: stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] |
1722 | ret_sys_call: | 1713 | ret_sys_call: |
1723 | #ifdef SYSCALL_TRACING | ||
1724 | mov %o0, %o1 | ||
1725 | call syscall_trace_exit | ||
1726 | add %sp, PTREGS_OFF, %o0 | ||
1727 | mov %o1, %o0 | ||
1728 | #endif | ||
1729 | ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %g3 | 1714 | ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %g3 |
1730 | ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc | 1715 | ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc |
1731 | sra %o0, 0, %o0 | 1716 | sra %o0, 0, %o0 |
@@ -1745,7 +1730,7 @@ ret_sys_call: | |||
1745 | 1: | 1730 | 1: |
1746 | cmp %o0, -ERESTART_RESTARTBLOCK | 1731 | cmp %o0, -ERESTART_RESTARTBLOCK |
1747 | bgeu,pn %xcc, 1f | 1732 | bgeu,pn %xcc, 1f |
1748 | andcc %l0, _TIF_SYSCALL_TRACE, %l6 | 1733 | andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT), %l6 |
1749 | 80: | 1734 | 80: |
1750 | /* System call success, clear Carry condition code. */ | 1735 | /* System call success, clear Carry condition code. */ |
1751 | andn %g3, %g2, %g3 | 1736 | andn %g3, %g2, %g3 |
@@ -1760,7 +1745,7 @@ ret_sys_call: | |||
1760 | /* System call failure, set Carry condition code. | 1745 | /* System call failure, set Carry condition code. |
1761 | * Also, get abs(errno) to return to the process. | 1746 | * Also, get abs(errno) to return to the process. |
1762 | */ | 1747 | */ |
1763 | andcc %l0, _TIF_SYSCALL_TRACE, %l6 | 1748 | andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT), %l6 |
1764 | sub %g0, %o0, %o0 | 1749 | sub %g0, %o0, %o0 |
1765 | or %g3, %g2, %g3 | 1750 | or %g3, %g2, %g3 |
1766 | stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] | 1751 | stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] |
@@ -1773,8 +1758,9 @@ ret_sys_call: | |||
1773 | b,pt %xcc, rtrap | 1758 | b,pt %xcc, rtrap |
1774 | stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] | 1759 | stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] |
1775 | linux_syscall_trace2: | 1760 | linux_syscall_trace2: |
1761 | add %sp, PTREGS_OFF, %o0 | ||
1776 | call syscall_trace | 1762 | call syscall_trace |
1777 | nop | 1763 | mov 1, %o1 |
1778 | stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC] | 1764 | stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC] |
1779 | ba,pt %xcc, rtrap | 1765 | ba,pt %xcc, rtrap |
1780 | stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] | 1766 | stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] |