mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
[SPARC64]: Fix some Niagara memcpy() bugs.
We need to restore the %asi register properly. For the kernel this means get_fs(), for user this means ASI_PNF. Also, NGcopy_to_user.S was including U3memcpy.S instead of NGmemcpy.S, oops :-) Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e92b92571c
commit
0d4bc95b9c
2 changed files with 8 additions and 4 deletions
|
@ -37,4 +37,4 @@
|
||||||
nop
|
nop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "U3memcpy.S"
|
#include "NGmemcpy.S"
|
||||||
|
|
|
@ -5,11 +5,15 @@
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
#ifdef __KERNEL__
|
||||||
#include <asm/asi.h>
|
#include <asm/asi.h>
|
||||||
|
#include <asm/thread_info.h>
|
||||||
#define GLOBAL_SPARE %g7
|
#define GLOBAL_SPARE %g7
|
||||||
#define RESTORE_ASI wr %g0, ASI_AIUS, %asi
|
#define RESTORE_ASI(TMP) \
|
||||||
|
ldub [%g6 + TI_CURRENT_DS], TMP; \
|
||||||
|
wr TMP, 0x0, %asi;
|
||||||
#else
|
#else
|
||||||
#define GLOBAL_SPARE %g5
|
#define GLOBAL_SPARE %g5
|
||||||
#define RESTORE_ASI
|
#define RESTORE_ASI(TMP) \
|
||||||
|
wr %g0, ASI_PNF, %asi
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef STORE_ASI
|
#ifndef STORE_ASI
|
||||||
|
@ -246,7 +250,7 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
|
||||||
/* %o2 contains any final bytes still needed to be copied
|
/* %o2 contains any final bytes still needed to be copied
|
||||||
* over. If anything is left, we copy it one byte at a time.
|
* over. If anything is left, we copy it one byte at a time.
|
||||||
*/
|
*/
|
||||||
RESTORE_ASI
|
RESTORE_ASI(%o3)
|
||||||
brz,pt %o2, 85f
|
brz,pt %o2, 85f
|
||||||
sub %o0, %o1, %o3
|
sub %o0, %o1, %o3
|
||||||
ba,a,pt %XCC, 90f
|
ba,a,pt %XCC, 90f
|
||||||
|
|
Loading…
Add table
Reference in a new issue