2019-06-04 01:11:33 -07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2005-04-16 15:20:36 -07:00
|
|
|
/*
|
|
|
|
* linux/arch/arm/kernel/iwmmxt.S
|
|
|
|
*
|
|
|
|
* XScale iWMMXt (Concan) context switching and handling
|
|
|
|
*
|
|
|
|
* Initial code:
|
|
|
|
* Copyright (c) 2003, Intel Corporation
|
|
|
|
*
|
|
|
|
* Full lazy switching support, optimizations and more, by Nicolas Pitre
|
|
|
|
* Copyright (c) 2003-2004, MontaVista Software, Inc.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/linkage.h>
|
|
|
|
#include <asm/ptrace.h>
|
|
|
|
#include <asm/thread_info.h>
|
2005-09-09 12:08:59 -07:00
|
|
|
#include <asm/asm-offsets.h>
|
2014-04-22 08:14:27 -07:00
|
|
|
#include <asm/assembler.h>
|
2020-11-17 15:11:36 -07:00
|
|
|
#include "iwmmxt.h"
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
#define MMX_WR0 (0x00)
|
|
|
|
#define MMX_WR1 (0x08)
|
|
|
|
#define MMX_WR2 (0x10)
|
|
|
|
#define MMX_WR3 (0x18)
|
|
|
|
#define MMX_WR4 (0x20)
|
|
|
|
#define MMX_WR5 (0x28)
|
|
|
|
#define MMX_WR6 (0x30)
|
|
|
|
#define MMX_WR7 (0x38)
|
|
|
|
#define MMX_WR8 (0x40)
|
|
|
|
#define MMX_WR9 (0x48)
|
|
|
|
#define MMX_WR10 (0x50)
|
|
|
|
#define MMX_WR11 (0x58)
|
|
|
|
#define MMX_WR12 (0x60)
|
|
|
|
#define MMX_WR13 (0x68)
|
|
|
|
#define MMX_WR14 (0x70)
|
|
|
|
#define MMX_WR15 (0x78)
|
|
|
|
#define MMX_WCSSF (0x80)
|
|
|
|
#define MMX_WCASF (0x84)
|
|
|
|
#define MMX_WCGR0 (0x88)
|
|
|
|
#define MMX_WCGR1 (0x8C)
|
|
|
|
#define MMX_WCGR2 (0x90)
|
|
|
|
#define MMX_WCGR3 (0x94)
|
|
|
|
|
|
|
|
#define MMX_SIZE (0x98)
|
|
|
|
|
|
|
|
.text
|
2014-11-25 05:31:46 -07:00
|
|
|
.arm
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2023-03-19 16:07:20 -07:00
|
|
|
ENTRY(iwmmxt_undef_handler)
|
|
|
|
push {r9, r10, lr}
|
|
|
|
get_thread_info r10
|
|
|
|
mov r9, pc
|
|
|
|
b iwmmxt_task_enable
|
|
|
|
mov r0, #0
|
|
|
|
pop {r9, r10, pc}
|
|
|
|
ENDPROC(iwmmxt_undef_handler)
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
/*
|
|
|
|
* Lazy switching of Concan coprocessor context
|
|
|
|
*
|
2023-03-19 16:07:20 -07:00
|
|
|
* r0 = struct pt_regs pointer
|
2005-04-16 15:20:36 -07:00
|
|
|
* r10 = struct thread_info pointer
|
|
|
|
* r9 = ret_from_exception
|
|
|
|
* lr = undefined instr exit
|
|
|
|
*
|
2014-04-22 08:14:29 -07:00
|
|
|
* called from prefetch exception handler with interrupts enabled
|
2005-04-16 15:20:36 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
ENTRY(iwmmxt_task_enable)
|
2014-04-22 08:14:27 -07:00
|
|
|
inc_preempt_count r10, r3
|
2005-04-16 15:20:36 -07:00
|
|
|
|
ARM: 9352/1: iwmmxt: Remove support for PJ4/PJ4B cores
PJ4 is a v7 core that incorporates a iWMMXt coprocessor. However, GCC
does not support this combination (its iWMMXt configuration always
implies v5te), and so there is no v6/v7 user space that actually makes
use of this, beyond generic support for things like setjmp() that
preserve/restore the iWMMXt register file using generic LDC/STC
instructions emitted in assembler. As [0] appears to imply, this logic
is triggered for the init process at boot, and so most user threads will
have a iWMMXt register context associated with it, even though it is
never used.
At this point, it is highly unlikely that such GCC support will ever
materialize (and Clang does not implement support for iWMMXt to begin
with).
This means that advertising iWMMXt support on these cores results in
context switch overhead without any associated benefit, and so it is
better to simply ignore the iWMMXt unit on these systems. So rip out the
support. Doing so also fixes the issue reported in [0] related to UNDEF
handling of co-processor #0/#1 instructions issued from user space
running in Thumb2 mode.
The PJ4 cores are used in four platforms: Armada 370/xp, Dove (Cubox,
d2plug), MMP2 (xo-1.75) and Berlin (Google TV). Out of these, only the
first is still widely used, but that one actually doesn't have iWMMXt
but instead has only VFPV3-D16, and so it is not impacted by this
change.
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218427 [0]
Fixes: 8bcba70cb5c22 ("ARM: entry: Disregard Thumb undef exception ...")
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-02-14 00:03:24 -07:00
|
|
|
mrc p15, 0, r2, c15, c1, 0
|
2010-11-23 20:54:25 -07:00
|
|
|
@ CP0 and CP1 accessible?
|
ARM: 9352/1: iwmmxt: Remove support for PJ4/PJ4B cores
PJ4 is a v7 core that incorporates a iWMMXt coprocessor. However, GCC
does not support this combination (its iWMMXt configuration always
implies v5te), and so there is no v6/v7 user space that actually makes
use of this, beyond generic support for things like setjmp() that
preserve/restore the iWMMXt register file using generic LDC/STC
instructions emitted in assembler. As [0] appears to imply, this logic
is triggered for the init process at boot, and so most user threads will
have a iWMMXt register context associated with it, even though it is
never used.
At this point, it is highly unlikely that such GCC support will ever
materialize (and Clang does not implement support for iWMMXt to begin
with).
This means that advertising iWMMXt support on these cores results in
context switch overhead without any associated benefit, and so it is
better to simply ignore the iWMMXt unit on these systems. So rip out the
support. Doing so also fixes the issue reported in [0] related to UNDEF
handling of co-processor #0/#1 instructions issued from user space
running in Thumb2 mode.
The PJ4 cores are used in four platforms: Armada 370/xp, Dove (Cubox,
d2plug), MMP2 (xo-1.75) and Berlin (Google TV). Out of these, only the
first is still widely used, but that one actually doesn't have iWMMXt
but instead has only VFPV3-D16, and so it is not impacted by this
change.
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218427 [0]
Fixes: 8bcba70cb5c22 ("ARM: entry: Disregard Thumb undef exception ...")
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-02-14 00:03:24 -07:00
|
|
|
tst r2, #0x3
|
2014-04-22 08:14:27 -07:00
|
|
|
bne 4f @ if so no business here
|
2010-11-23 20:54:25 -07:00
|
|
|
@ enable access to CP0 and CP1
|
ARM: 9352/1: iwmmxt: Remove support for PJ4/PJ4B cores
PJ4 is a v7 core that incorporates a iWMMXt coprocessor. However, GCC
does not support this combination (its iWMMXt configuration always
implies v5te), and so there is no v6/v7 user space that actually makes
use of this, beyond generic support for things like setjmp() that
preserve/restore the iWMMXt register file using generic LDC/STC
instructions emitted in assembler. As [0] appears to imply, this logic
is triggered for the init process at boot, and so most user threads will
have a iWMMXt register context associated with it, even though it is
never used.
At this point, it is highly unlikely that such GCC support will ever
materialize (and Clang does not implement support for iWMMXt to begin
with).
This means that advertising iWMMXt support on these cores results in
context switch overhead without any associated benefit, and so it is
better to simply ignore the iWMMXt unit on these systems. So rip out the
support. Doing so also fixes the issue reported in [0] related to UNDEF
handling of co-processor #0/#1 instructions issued from user space
running in Thumb2 mode.
The PJ4 cores are used in four platforms: Armada 370/xp, Dove (Cubox,
d2plug), MMP2 (xo-1.75) and Berlin (Google TV). Out of these, only the
first is still widely used, but that one actually doesn't have iWMMXt
but instead has only VFPV3-D16, and so it is not impacted by this
change.
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218427 [0]
Fixes: 8bcba70cb5c22 ("ARM: entry: Disregard Thumb undef exception ...")
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-02-14 00:03:24 -07:00
|
|
|
orr r2, r2, #0x3
|
|
|
|
mcr p15, 0, r2, c15, c1, 0
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
ldr r3, =concan_owner
|
2023-03-19 16:07:20 -07:00
|
|
|
ldr r2, [r0, #S_PC] @ current task pc value
|
2005-04-16 15:20:36 -07:00
|
|
|
ldr r1, [r3] @ get current Concan owner
|
|
|
|
sub r2, r2, #4 @ adjust pc back
|
2023-03-19 16:07:20 -07:00
|
|
|
str r2, [r0, #S_PC]
|
|
|
|
add r0, r10, #TI_IWMMXT_STATE @ get task Concan save area
|
|
|
|
str r0, [r3] @ this task now owns Concan regs
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
mrc p15, 0, r2, c2, c0, 0
|
|
|
|
mov r2, r2 @ cpwait
|
ARM: 8100/1: Fix preemption disable in iwmmxt_task_enable()
commit 431a84b1a4f7d1a0085d5b91330c5053cc8e8b12
("ARM: 8034/1: Disable preemption in iwmmxt_task_enable()")
introduced macros {inc,dec}_preempt_count to iwmmxt_task_enable
to make it run with preemption disabled.
Unfortunately, other functions in iwmmxt.S also use concan_{save,dump,load}
sections located in iwmmxt_task_enable() to deal with iWMMXt coprocessor.
This causes an unbalanced preempt_count due to excessive dec_preempt_count
and destroyed return addresses in callers of concan_ labels due to a register
collision:
Linux version 3.16.0-rc3-00062-gd92a333-dirty (jef@armhf) (gcc version 4.8.3 (Debian 4.8.3-4) ) #5 PREEMPT Thu Jul 3 19:46:39 CEST 2014
CPU: ARMv7 Processor [560f5815] revision 5 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
Machine model: SolidRun CuBox
...
PJ4 iWMMXt v2 coprocessor enabled.
...
Unable to handle kernel paging request at virtual address fffffffe
pgd = bb25c000
[fffffffe] *pgd=3bfde821, *pte=00000000, *ppte=00000000
Internal error: Oops: 80000007 [#1] PREEMPT ARM
Modules linked in:
CPU: 0 PID: 62 Comm: startpar Not tainted 3.16.0-rc3-00062-gd92a333-dirty #5
task: bb230b80 ti: bb256000 task.ti: bb256000
PC is at 0xfffffffe
LR is at iwmmxt_task_copy+0x44/0x4c
pc : [<fffffffe>] lr : [<800130ac>] psr: 40000033
sp : bb257de8 ip : 00000013 fp : bb257ea4
r10: bb256000 r9 : fffffdfe r8 : 76e898e6
r7 : bb257ec8 r6 : bb256000 r5 : 7ea12760 r4 : 000000a0
r3 : ffffffff r2 : 00000003 r1 : bb257df8 r0 : 00000000
Flags: nZcv IRQs on FIQs on Mode SVC_32 ISA Thumb Segment user
Control: 10c5387d Table: 3b25c019 DAC: 00000015
Process startpar (pid: 62, stack limit = 0xbb256248)
This patch fixes the issue by moving concan_{save,dump,load} into separate
code sections and make iwmmxt_task_enable() call them in the same way the
other functions use concan_ symbols. The test for valid ownership is moved
to concan_save and is safe for the other user of it, iwmmxt_task_disable().
The register collision is also resolved by moving concan_ symbols as
{inc,dec}_preempt_count are now local to iwmmxt_task_enable().
Fixes: 431a84b1a4f7 ("ARM: 8034/1: Disable preemption in iwmmxt_task_enable()")
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-07-14 08:23:29 -07:00
|
|
|
bl concan_save
|
2005-04-16 15:20:36 -07:00
|
|
|
|
ARM: 8100/1: Fix preemption disable in iwmmxt_task_enable()
commit 431a84b1a4f7d1a0085d5b91330c5053cc8e8b12
("ARM: 8034/1: Disable preemption in iwmmxt_task_enable()")
introduced macros {inc,dec}_preempt_count to iwmmxt_task_enable
to make it run with preemption disabled.
Unfortunately, other functions in iwmmxt.S also use concan_{save,dump,load}
sections located in iwmmxt_task_enable() to deal with iWMMXt coprocessor.
This causes an unbalanced preempt_count due to excessive dec_preempt_count
and destroyed return addresses in callers of concan_ labels due to a register
collision:
Linux version 3.16.0-rc3-00062-gd92a333-dirty (jef@armhf) (gcc version 4.8.3 (Debian 4.8.3-4) ) #5 PREEMPT Thu Jul 3 19:46:39 CEST 2014
CPU: ARMv7 Processor [560f5815] revision 5 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
Machine model: SolidRun CuBox
...
PJ4 iWMMXt v2 coprocessor enabled.
...
Unable to handle kernel paging request at virtual address fffffffe
pgd = bb25c000
[fffffffe] *pgd=3bfde821, *pte=00000000, *ppte=00000000
Internal error: Oops: 80000007 [#1] PREEMPT ARM
Modules linked in:
CPU: 0 PID: 62 Comm: startpar Not tainted 3.16.0-rc3-00062-gd92a333-dirty #5
task: bb230b80 ti: bb256000 task.ti: bb256000
PC is at 0xfffffffe
LR is at iwmmxt_task_copy+0x44/0x4c
pc : [<fffffffe>] lr : [<800130ac>] psr: 40000033
sp : bb257de8 ip : 00000013 fp : bb257ea4
r10: bb256000 r9 : fffffdfe r8 : 76e898e6
r7 : bb257ec8 r6 : bb256000 r5 : 7ea12760 r4 : 000000a0
r3 : ffffffff r2 : 00000003 r1 : bb257df8 r0 : 00000000
Flags: nZcv IRQs on FIQs on Mode SVC_32 ISA Thumb Segment user
Control: 10c5387d Table: 3b25c019 DAC: 00000015
Process startpar (pid: 62, stack limit = 0xbb256248)
This patch fixes the issue by moving concan_{save,dump,load} into separate
code sections and make iwmmxt_task_enable() call them in the same way the
other functions use concan_ symbols. The test for valid ownership is moved
to concan_save and is safe for the other user of it, iwmmxt_task_disable().
The register collision is also resolved by moving concan_ symbols as
{inc,dec}_preempt_count are now local to iwmmxt_task_enable().
Fixes: 431a84b1a4f7 ("ARM: 8034/1: Disable preemption in iwmmxt_task_enable()")
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-07-14 08:23:29 -07:00
|
|
|
#ifdef CONFIG_PREEMPT_COUNT
|
|
|
|
get_thread_info r10
|
|
|
|
#endif
|
|
|
|
4: dec_preempt_count r10, r3
|
2014-08-05 02:27:13 -07:00
|
|
|
ret r9 @ normal exit from exception
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
concan_save:
|
|
|
|
|
ARM: 8100/1: Fix preemption disable in iwmmxt_task_enable()
commit 431a84b1a4f7d1a0085d5b91330c5053cc8e8b12
("ARM: 8034/1: Disable preemption in iwmmxt_task_enable()")
introduced macros {inc,dec}_preempt_count to iwmmxt_task_enable
to make it run with preemption disabled.
Unfortunately, other functions in iwmmxt.S also use concan_{save,dump,load}
sections located in iwmmxt_task_enable() to deal with iWMMXt coprocessor.
This causes an unbalanced preempt_count due to excessive dec_preempt_count
and destroyed return addresses in callers of concan_ labels due to a register
collision:
Linux version 3.16.0-rc3-00062-gd92a333-dirty (jef@armhf) (gcc version 4.8.3 (Debian 4.8.3-4) ) #5 PREEMPT Thu Jul 3 19:46:39 CEST 2014
CPU: ARMv7 Processor [560f5815] revision 5 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
Machine model: SolidRun CuBox
...
PJ4 iWMMXt v2 coprocessor enabled.
...
Unable to handle kernel paging request at virtual address fffffffe
pgd = bb25c000
[fffffffe] *pgd=3bfde821, *pte=00000000, *ppte=00000000
Internal error: Oops: 80000007 [#1] PREEMPT ARM
Modules linked in:
CPU: 0 PID: 62 Comm: startpar Not tainted 3.16.0-rc3-00062-gd92a333-dirty #5
task: bb230b80 ti: bb256000 task.ti: bb256000
PC is at 0xfffffffe
LR is at iwmmxt_task_copy+0x44/0x4c
pc : [<fffffffe>] lr : [<800130ac>] psr: 40000033
sp : bb257de8 ip : 00000013 fp : bb257ea4
r10: bb256000 r9 : fffffdfe r8 : 76e898e6
r7 : bb257ec8 r6 : bb256000 r5 : 7ea12760 r4 : 000000a0
r3 : ffffffff r2 : 00000003 r1 : bb257df8 r0 : 00000000
Flags: nZcv IRQs on FIQs on Mode SVC_32 ISA Thumb Segment user
Control: 10c5387d Table: 3b25c019 DAC: 00000015
Process startpar (pid: 62, stack limit = 0xbb256248)
This patch fixes the issue by moving concan_{save,dump,load} into separate
code sections and make iwmmxt_task_enable() call them in the same way the
other functions use concan_ symbols. The test for valid ownership is moved
to concan_save and is safe for the other user of it, iwmmxt_task_disable().
The register collision is also resolved by moving concan_ symbols as
{inc,dec}_preempt_count are now local to iwmmxt_task_enable().
Fixes: 431a84b1a4f7 ("ARM: 8034/1: Disable preemption in iwmmxt_task_enable()")
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-07-14 08:23:29 -07:00
|
|
|
teq r1, #0 @ test for last ownership
|
|
|
|
beq concan_load @ no owner, skip save
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
tmrc r2, wCon
|
|
|
|
|
|
|
|
@ CUP? wCx
|
|
|
|
tst r2, #0x1
|
|
|
|
beq 1f
|
|
|
|
|
|
|
|
concan_dump:
|
|
|
|
|
2020-11-17 15:11:36 -07:00
|
|
|
wstrw wCSSF, r1, MMX_WCSSF
|
|
|
|
wstrw wCASF, r1, MMX_WCASF
|
|
|
|
wstrw wCGR0, r1, MMX_WCGR0
|
|
|
|
wstrw wCGR1, r1, MMX_WCGR1
|
|
|
|
wstrw wCGR2, r1, MMX_WCGR2
|
|
|
|
wstrw wCGR3, r1, MMX_WCGR3
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
1: @ MUP? wRn
|
|
|
|
tst r2, #0x2
|
|
|
|
beq 2f
|
|
|
|
|
2020-11-17 15:11:36 -07:00
|
|
|
wstrd wR0, r1, MMX_WR0
|
|
|
|
wstrd wR1, r1, MMX_WR1
|
|
|
|
wstrd wR2, r1, MMX_WR2
|
|
|
|
wstrd wR3, r1, MMX_WR3
|
|
|
|
wstrd wR4, r1, MMX_WR4
|
|
|
|
wstrd wR5, r1, MMX_WR5
|
|
|
|
wstrd wR6, r1, MMX_WR6
|
|
|
|
wstrd wR7, r1, MMX_WR7
|
|
|
|
wstrd wR8, r1, MMX_WR8
|
|
|
|
wstrd wR9, r1, MMX_WR9
|
|
|
|
wstrd wR10, r1, MMX_WR10
|
|
|
|
wstrd wR11, r1, MMX_WR11
|
|
|
|
wstrd wR12, r1, MMX_WR12
|
|
|
|
wstrd wR13, r1, MMX_WR13
|
|
|
|
wstrd wR14, r1, MMX_WR14
|
|
|
|
wstrd wR15, r1, MMX_WR15
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
2: teq r0, #0 @ anything to load?
|
2014-08-05 02:27:13 -07:00
|
|
|
reteq lr @ if not, return
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
concan_load:
|
|
|
|
|
|
|
|
@ Load wRn
|
2020-11-17 15:11:36 -07:00
|
|
|
wldrd wR0, r0, MMX_WR0
|
|
|
|
wldrd wR1, r0, MMX_WR1
|
|
|
|
wldrd wR2, r0, MMX_WR2
|
|
|
|
wldrd wR3, r0, MMX_WR3
|
|
|
|
wldrd wR4, r0, MMX_WR4
|
|
|
|
wldrd wR5, r0, MMX_WR5
|
|
|
|
wldrd wR6, r0, MMX_WR6
|
|
|
|
wldrd wR7, r0, MMX_WR7
|
|
|
|
wldrd wR8, r0, MMX_WR8
|
|
|
|
wldrd wR9, r0, MMX_WR9
|
|
|
|
wldrd wR10, r0, MMX_WR10
|
|
|
|
wldrd wR11, r0, MMX_WR11
|
|
|
|
wldrd wR12, r0, MMX_WR12
|
|
|
|
wldrd wR13, r0, MMX_WR13
|
|
|
|
wldrd wR14, r0, MMX_WR14
|
|
|
|
wldrd wR15, r0, MMX_WR15
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
@ Load wCx
|
2020-11-17 15:11:36 -07:00
|
|
|
wldrw wCSSF, r0, MMX_WCSSF
|
|
|
|
wldrw wCASF, r0, MMX_WCASF
|
|
|
|
wldrw wCGR0, r0, MMX_WCGR0
|
|
|
|
wldrw wCGR1, r0, MMX_WCGR1
|
|
|
|
wldrw wCGR2, r0, MMX_WCGR2
|
|
|
|
wldrw wCGR3, r0, MMX_WCGR3
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
@ clear CUP/MUP (only if r1 != 0)
|
|
|
|
teq r1, #0
|
|
|
|
mov r2, #0
|
2014-08-05 02:27:13 -07:00
|
|
|
reteq lr
|
2014-04-22 08:14:27 -07:00
|
|
|
|
ARM: 8100/1: Fix preemption disable in iwmmxt_task_enable()
commit 431a84b1a4f7d1a0085d5b91330c5053cc8e8b12
("ARM: 8034/1: Disable preemption in iwmmxt_task_enable()")
introduced macros {inc,dec}_preempt_count to iwmmxt_task_enable
to make it run with preemption disabled.
Unfortunately, other functions in iwmmxt.S also use concan_{save,dump,load}
sections located in iwmmxt_task_enable() to deal with iWMMXt coprocessor.
This causes an unbalanced preempt_count due to excessive dec_preempt_count
and destroyed return addresses in callers of concan_ labels due to a register
collision:
Linux version 3.16.0-rc3-00062-gd92a333-dirty (jef@armhf) (gcc version 4.8.3 (Debian 4.8.3-4) ) #5 PREEMPT Thu Jul 3 19:46:39 CEST 2014
CPU: ARMv7 Processor [560f5815] revision 5 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
Machine model: SolidRun CuBox
...
PJ4 iWMMXt v2 coprocessor enabled.
...
Unable to handle kernel paging request at virtual address fffffffe
pgd = bb25c000
[fffffffe] *pgd=3bfde821, *pte=00000000, *ppte=00000000
Internal error: Oops: 80000007 [#1] PREEMPT ARM
Modules linked in:
CPU: 0 PID: 62 Comm: startpar Not tainted 3.16.0-rc3-00062-gd92a333-dirty #5
task: bb230b80 ti: bb256000 task.ti: bb256000
PC is at 0xfffffffe
LR is at iwmmxt_task_copy+0x44/0x4c
pc : [<fffffffe>] lr : [<800130ac>] psr: 40000033
sp : bb257de8 ip : 00000013 fp : bb257ea4
r10: bb256000 r9 : fffffdfe r8 : 76e898e6
r7 : bb257ec8 r6 : bb256000 r5 : 7ea12760 r4 : 000000a0
r3 : ffffffff r2 : 00000003 r1 : bb257df8 r0 : 00000000
Flags: nZcv IRQs on FIQs on Mode SVC_32 ISA Thumb Segment user
Control: 10c5387d Table: 3b25c019 DAC: 00000015
Process startpar (pid: 62, stack limit = 0xbb256248)
This patch fixes the issue by moving concan_{save,dump,load} into separate
code sections and make iwmmxt_task_enable() call them in the same way the
other functions use concan_ symbols. The test for valid ownership is moved
to concan_save and is safe for the other user of it, iwmmxt_task_disable().
The register collision is also resolved by moving concan_ symbols as
{inc,dec}_preempt_count are now local to iwmmxt_task_enable().
Fixes: 431a84b1a4f7 ("ARM: 8034/1: Disable preemption in iwmmxt_task_enable()")
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-07-14 08:23:29 -07:00
|
|
|
tmcr wCon, r2
|
2014-06-30 08:29:12 -07:00
|
|
|
ret lr
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2014-11-25 05:31:46 -07:00
|
|
|
ENDPROC(iwmmxt_task_enable)
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
/*
|
|
|
|
* Back up Concan regs to save area and disable access to them
|
|
|
|
* (mainly for gdb or sleep mode usage)
|
|
|
|
*
|
|
|
|
* r0 = struct thread_info pointer of target task or NULL for any
|
|
|
|
*/
|
|
|
|
|
|
|
|
ENTRY(iwmmxt_task_disable)
|
|
|
|
|
|
|
|
stmfd sp!, {r4, lr}
|
|
|
|
|
|
|
|
mrs ip, cpsr
|
|
|
|
orr r2, ip, #PSR_I_BIT @ disable interrupts
|
|
|
|
msr cpsr_c, r2
|
|
|
|
|
|
|
|
ldr r3, =concan_owner
|
|
|
|
add r2, r0, #TI_IWMMXT_STATE @ get task Concan save area
|
|
|
|
ldr r1, [r3] @ get current Concan owner
|
|
|
|
teq r1, #0 @ any current owner?
|
|
|
|
beq 1f @ no: quit
|
|
|
|
teq r0, #0 @ any owner?
|
|
|
|
teqne r1, r2 @ or specified one?
|
|
|
|
bne 1f @ no: quit
|
|
|
|
|
2010-11-23 20:54:25 -07:00
|
|
|
@ enable access to CP0 and CP1
|
ARM: 9352/1: iwmmxt: Remove support for PJ4/PJ4B cores
PJ4 is a v7 core that incorporates a iWMMXt coprocessor. However, GCC
does not support this combination (its iWMMXt configuration always
implies v5te), and so there is no v6/v7 user space that actually makes
use of this, beyond generic support for things like setjmp() that
preserve/restore the iWMMXt register file using generic LDC/STC
instructions emitted in assembler. As [0] appears to imply, this logic
is triggered for the init process at boot, and so most user threads will
have a iWMMXt register context associated with it, even though it is
never used.
At this point, it is highly unlikely that such GCC support will ever
materialize (and Clang does not implement support for iWMMXt to begin
with).
This means that advertising iWMMXt support on these cores results in
context switch overhead without any associated benefit, and so it is
better to simply ignore the iWMMXt unit on these systems. So rip out the
support. Doing so also fixes the issue reported in [0] related to UNDEF
handling of co-processor #0/#1 instructions issued from user space
running in Thumb2 mode.
The PJ4 cores are used in four platforms: Armada 370/xp, Dove (Cubox,
d2plug), MMP2 (xo-1.75) and Berlin (Google TV). Out of these, only the
first is still widely used, but that one actually doesn't have iWMMXt
but instead has only VFPV3-D16, and so it is not impacted by this
change.
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218427 [0]
Fixes: 8bcba70cb5c22 ("ARM: entry: Disregard Thumb undef exception ...")
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-02-14 00:03:24 -07:00
|
|
|
mrc p15, 0, r4, c15, c1, 0
|
|
|
|
orr r4, r4, #0x3
|
|
|
|
mcr p15, 0, r4, c15, c1, 0
|
2010-11-23 20:54:25 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
mov r0, #0 @ nothing to load
|
|
|
|
str r0, [r3] @ no more current owner
|
|
|
|
mrc p15, 0, r2, c2, c0, 0
|
|
|
|
mov r2, r2 @ cpwait
|
|
|
|
bl concan_save
|
|
|
|
|
2010-11-23 20:54:25 -07:00
|
|
|
@ disable access to CP0 and CP1
|
ARM: 9352/1: iwmmxt: Remove support for PJ4/PJ4B cores
PJ4 is a v7 core that incorporates a iWMMXt coprocessor. However, GCC
does not support this combination (its iWMMXt configuration always
implies v5te), and so there is no v6/v7 user space that actually makes
use of this, beyond generic support for things like setjmp() that
preserve/restore the iWMMXt register file using generic LDC/STC
instructions emitted in assembler. As [0] appears to imply, this logic
is triggered for the init process at boot, and so most user threads will
have a iWMMXt register context associated with it, even though it is
never used.
At this point, it is highly unlikely that such GCC support will ever
materialize (and Clang does not implement support for iWMMXt to begin
with).
This means that advertising iWMMXt support on these cores results in
context switch overhead without any associated benefit, and so it is
better to simply ignore the iWMMXt unit on these systems. So rip out the
support. Doing so also fixes the issue reported in [0] related to UNDEF
handling of co-processor #0/#1 instructions issued from user space
running in Thumb2 mode.
The PJ4 cores are used in four platforms: Armada 370/xp, Dove (Cubox,
d2plug), MMP2 (xo-1.75) and Berlin (Google TV). Out of these, only the
first is still widely used, but that one actually doesn't have iWMMXt
but instead has only VFPV3-D16, and so it is not impacted by this
change.
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218427 [0]
Fixes: 8bcba70cb5c22 ("ARM: entry: Disregard Thumb undef exception ...")
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-02-14 00:03:24 -07:00
|
|
|
bic r4, r4, #0x3
|
|
|
|
mcr p15, 0, r4, c15, c1, 0
|
2010-11-23 20:54:25 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
mrc p15, 0, r2, c2, c0, 0
|
|
|
|
mov r2, r2 @ cpwait
|
|
|
|
|
|
|
|
1: msr cpsr_c, ip @ restore interrupt mode
|
|
|
|
ldmfd sp!, {r4, pc}
|
|
|
|
|
2014-11-25 05:31:46 -07:00
|
|
|
ENDPROC(iwmmxt_task_disable)
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
/*
|
|
|
|
* Copy Concan state to given memory address
|
|
|
|
*
|
|
|
|
* r0 = struct thread_info pointer of target task
|
|
|
|
* r1 = memory address where to store Concan state
|
|
|
|
*
|
|
|
|
* this is called mainly in the creation of signal stack frames
|
|
|
|
*/
|
|
|
|
|
|
|
|
ENTRY(iwmmxt_task_copy)
|
|
|
|
|
|
|
|
mrs ip, cpsr
|
|
|
|
orr r2, ip, #PSR_I_BIT @ disable interrupts
|
|
|
|
msr cpsr_c, r2
|
|
|
|
|
|
|
|
ldr r3, =concan_owner
|
|
|
|
add r2, r0, #TI_IWMMXT_STATE @ get task Concan save area
|
|
|
|
ldr r3, [r3] @ get current Concan owner
|
|
|
|
teq r2, r3 @ does this task own it...
|
|
|
|
beq 1f
|
|
|
|
|
|
|
|
@ current Concan values are in the task save area
|
|
|
|
msr cpsr_c, ip @ restore interrupt mode
|
|
|
|
mov r0, r1
|
|
|
|
mov r1, r2
|
|
|
|
mov r2, #MMX_SIZE
|
|
|
|
b memcpy
|
|
|
|
|
|
|
|
1: @ this task owns Concan regs -- grab a copy from there
|
|
|
|
mov r0, #0 @ nothing to load
|
|
|
|
mov r2, #3 @ save all regs
|
|
|
|
mov r3, lr @ preserve return address
|
|
|
|
bl concan_dump
|
|
|
|
msr cpsr_c, ip @ restore interrupt mode
|
2014-06-30 08:29:12 -07:00
|
|
|
ret r3
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2014-11-25 05:31:46 -07:00
|
|
|
ENDPROC(iwmmxt_task_copy)
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
/*
|
|
|
|
* Restore Concan state from given memory address
|
|
|
|
*
|
|
|
|
* r0 = struct thread_info pointer of target task
|
|
|
|
* r1 = memory address where to get Concan state from
|
|
|
|
*
|
|
|
|
* this is used to restore Concan state when unwinding a signal stack frame
|
|
|
|
*/
|
|
|
|
|
|
|
|
ENTRY(iwmmxt_task_restore)
|
|
|
|
|
|
|
|
mrs ip, cpsr
|
|
|
|
orr r2, ip, #PSR_I_BIT @ disable interrupts
|
|
|
|
msr cpsr_c, r2
|
|
|
|
|
|
|
|
ldr r3, =concan_owner
|
|
|
|
add r2, r0, #TI_IWMMXT_STATE @ get task Concan save area
|
|
|
|
ldr r3, [r3] @ get current Concan owner
|
|
|
|
bic r2, r2, #0x7 @ 64-bit alignment
|
|
|
|
teq r2, r3 @ does this task own it...
|
|
|
|
beq 1f
|
|
|
|
|
|
|
|
@ this task doesn't own Concan regs -- use its save area
|
|
|
|
msr cpsr_c, ip @ restore interrupt mode
|
|
|
|
mov r0, r2
|
|
|
|
mov r2, #MMX_SIZE
|
|
|
|
b memcpy
|
|
|
|
|
|
|
|
1: @ this task owns Concan regs -- load them directly
|
|
|
|
mov r0, r1
|
|
|
|
mov r1, #0 @ don't clear CUP/MUP
|
|
|
|
mov r3, lr @ preserve return address
|
|
|
|
bl concan_load
|
|
|
|
msr cpsr_c, ip @ restore interrupt mode
|
2014-06-30 08:29:12 -07:00
|
|
|
ret r3
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2014-11-25 05:31:46 -07:00
|
|
|
ENDPROC(iwmmxt_task_restore)
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
/*
|
|
|
|
* Concan handling on task switch
|
|
|
|
*
|
2006-07-01 11:56:48 -07:00
|
|
|
* r0 = next thread_info pointer
|
2005-04-16 15:20:36 -07:00
|
|
|
*
|
2006-07-01 11:56:48 -07:00
|
|
|
* Called only from the iwmmxt notifier with task preemption disabled.
|
2005-04-16 15:20:36 -07:00
|
|
|
*/
|
|
|
|
ENTRY(iwmmxt_task_switch)
|
|
|
|
|
ARM: 9352/1: iwmmxt: Remove support for PJ4/PJ4B cores
PJ4 is a v7 core that incorporates a iWMMXt coprocessor. However, GCC
does not support this combination (its iWMMXt configuration always
implies v5te), and so there is no v6/v7 user space that actually makes
use of this, beyond generic support for things like setjmp() that
preserve/restore the iWMMXt register file using generic LDC/STC
instructions emitted in assembler. As [0] appears to imply, this logic
is triggered for the init process at boot, and so most user threads will
have a iWMMXt register context associated with it, even though it is
never used.
At this point, it is highly unlikely that such GCC support will ever
materialize (and Clang does not implement support for iWMMXt to begin
with).
This means that advertising iWMMXt support on these cores results in
context switch overhead without any associated benefit, and so it is
better to simply ignore the iWMMXt unit on these systems. So rip out the
support. Doing so also fixes the issue reported in [0] related to UNDEF
handling of co-processor #0/#1 instructions issued from user space
running in Thumb2 mode.
The PJ4 cores are used in four platforms: Armada 370/xp, Dove (Cubox,
d2plug), MMP2 (xo-1.75) and Berlin (Google TV). Out of these, only the
first is still widely used, but that one actually doesn't have iWMMXt
but instead has only VFPV3-D16, and so it is not impacted by this
change.
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218427 [0]
Fixes: 8bcba70cb5c22 ("ARM: entry: Disregard Thumb undef exception ...")
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-02-14 00:03:24 -07:00
|
|
|
mrc p15, 0, r1, c15, c1, 0
|
2010-11-23 20:54:25 -07:00
|
|
|
@ CP0 and CP1 accessible?
|
ARM: 9352/1: iwmmxt: Remove support for PJ4/PJ4B cores
PJ4 is a v7 core that incorporates a iWMMXt coprocessor. However, GCC
does not support this combination (its iWMMXt configuration always
implies v5te), and so there is no v6/v7 user space that actually makes
use of this, beyond generic support for things like setjmp() that
preserve/restore the iWMMXt register file using generic LDC/STC
instructions emitted in assembler. As [0] appears to imply, this logic
is triggered for the init process at boot, and so most user threads will
have a iWMMXt register context associated with it, even though it is
never used.
At this point, it is highly unlikely that such GCC support will ever
materialize (and Clang does not implement support for iWMMXt to begin
with).
This means that advertising iWMMXt support on these cores results in
context switch overhead without any associated benefit, and so it is
better to simply ignore the iWMMXt unit on these systems. So rip out the
support. Doing so also fixes the issue reported in [0] related to UNDEF
handling of co-processor #0/#1 instructions issued from user space
running in Thumb2 mode.
The PJ4 cores are used in four platforms: Armada 370/xp, Dove (Cubox,
d2plug), MMP2 (xo-1.75) and Berlin (Google TV). Out of these, only the
first is still widely used, but that one actually doesn't have iWMMXt
but instead has only VFPV3-D16, and so it is not impacted by this
change.
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218427 [0]
Fixes: 8bcba70cb5c22 ("ARM: entry: Disregard Thumb undef exception ...")
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-02-14 00:03:24 -07:00
|
|
|
tst r1, #0x3
|
2005-04-16 15:20:36 -07:00
|
|
|
bne 1f @ yes: block them for next task
|
|
|
|
|
2006-07-01 11:56:48 -07:00
|
|
|
ldr r2, =concan_owner
|
|
|
|
add r3, r0, #TI_IWMMXT_STATE @ get next task Concan save area
|
|
|
|
ldr r2, [r2] @ get current Concan owner
|
|
|
|
teq r2, r3 @ next task owns it?
|
2014-06-30 08:29:12 -07:00
|
|
|
retne lr @ no: leave Concan disabled
|
2005-04-16 15:20:36 -07:00
|
|
|
|
ARM: pxa: fix logic error in PJ4 iWMMXt handling
This got added in:
commit ef6c84454f8567d4968c210d7d194fb711ed3739
Author: Haojian Zhuang <haojian.zhuang@marvell.com>
Date: Wed Nov 24 11:54:25 2010 +0800
ARM: pxa: add iwmmx support for PJ4
which does:
- mrc p15, 0, r2, c15, c1, 0
- orr r2, r2, #0x3 @ enable access to CP0 and CP1
- mcr p15, 0, r2, c15, c1, 0
+ @ enable access to CP0 and CP1
+ XSC(mrc p15, 0, r2, c15, c1, 0)
+ XSC(orr r2, r2, #0x3)
+ XSC(mcr p15, 0, r2, c15, c1, 0)
but then later does:
- mrc p15, 0, r4, c15, c1, 0
- orr r4, r4, #0x3 @ enable access to CP0 and CP1
- mcr p15, 0, r4, c15, c1, 0
+ @ enable access to CP0 and CP1
+ XSC(mrc p15, 0, r4, c15, c1, 0)
+ XSC(orr r4, r4, #0xf)
+ XSC(mcr p15, 0, r4, c15, c1, 0)
Signed-off-by: Lennert Buytenhek <buytenh@laptop.org>
Acked-by Haojian <haojian.zhuang@gmail.com>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
2011-08-10 18:56:06 -07:00
|
|
|
1: @ flip Concan access
|
ARM: 9352/1: iwmmxt: Remove support for PJ4/PJ4B cores
PJ4 is a v7 core that incorporates a iWMMXt coprocessor. However, GCC
does not support this combination (its iWMMXt configuration always
implies v5te), and so there is no v6/v7 user space that actually makes
use of this, beyond generic support for things like setjmp() that
preserve/restore the iWMMXt register file using generic LDC/STC
instructions emitted in assembler. As [0] appears to imply, this logic
is triggered for the init process at boot, and so most user threads will
have a iWMMXt register context associated with it, even though it is
never used.
At this point, it is highly unlikely that such GCC support will ever
materialize (and Clang does not implement support for iWMMXt to begin
with).
This means that advertising iWMMXt support on these cores results in
context switch overhead without any associated benefit, and so it is
better to simply ignore the iWMMXt unit on these systems. So rip out the
support. Doing so also fixes the issue reported in [0] related to UNDEF
handling of co-processor #0/#1 instructions issued from user space
running in Thumb2 mode.
The PJ4 cores are used in four platforms: Armada 370/xp, Dove (Cubox,
d2plug), MMP2 (xo-1.75) and Berlin (Google TV). Out of these, only the
first is still widely used, but that one actually doesn't have iWMMXt
but instead has only VFPV3-D16, and so it is not impacted by this
change.
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218427 [0]
Fixes: 8bcba70cb5c22 ("ARM: entry: Disregard Thumb undef exception ...")
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-02-14 00:03:24 -07:00
|
|
|
eor r1, r1, #0x3
|
|
|
|
mcr p15, 0, r1, c15, c1, 0
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-07-01 11:56:48 -07:00
|
|
|
mrc p15, 0, r1, c2, c0, 0
|
|
|
|
sub pc, lr, r1, lsr #32 @ cpwait and return
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2014-11-25 05:31:46 -07:00
|
|
|
ENDPROC(iwmmxt_task_switch)
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
/*
|
|
|
|
* Remove Concan ownership of given task
|
|
|
|
*
|
|
|
|
* r0 = struct thread_info pointer
|
|
|
|
*/
|
|
|
|
ENTRY(iwmmxt_task_release)
|
|
|
|
|
|
|
|
mrs r2, cpsr
|
|
|
|
orr ip, r2, #PSR_I_BIT @ disable interrupts
|
|
|
|
msr cpsr_c, ip
|
|
|
|
ldr r3, =concan_owner
|
|
|
|
add r0, r0, #TI_IWMMXT_STATE @ get task Concan save area
|
|
|
|
ldr r1, [r3] @ get current Concan owner
|
|
|
|
eors r0, r0, r1 @ if equal...
|
|
|
|
streq r0, [r3] @ then clear ownership
|
|
|
|
msr cpsr_c, r2 @ restore interrupts
|
2014-06-30 08:29:12 -07:00
|
|
|
ret lr
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2014-11-25 05:31:46 -07:00
|
|
|
ENDPROC(iwmmxt_task_release)
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
.data
|
2017-07-26 04:49:31 -07:00
|
|
|
.align 2
|
2005-04-16 15:20:36 -07:00
|
|
|
concan_owner:
|
|
|
|
.word 0
|
|
|
|
|