lkml.org 
[lkml]   [2020]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] mips: lib: uncached: fix non-standard usage of variable 'sp'
On Fri, 11 Dec 2020, Anders Roxell wrote:

> diff --git a/arch/mips/lib/uncached.c b/arch/mips/lib/uncached.c
> index 09d5deea747f..f80a67c092b6 100644
> --- a/arch/mips/lib/uncached.c
> +++ b/arch/mips/lib/uncached.c
> @@ -37,10 +37,12 @@
> */
> unsigned long run_uncached(void *func)
> {
> - register long sp __asm__("$sp");
> register long ret __asm__("$2");
> long lfunc = (long)func, ufunc;
> long usp;
> + long sp;
> +
> + __asm__("move %0, $sp" : "=r" (sp));

I thought it might be better to make `sp' global instead, so that it's
the compiler that chooses how to schedule accesses. Have you tried that?

Maciej

\
 
 \ /
  Last update: 2020-12-11 20:57    [W:0.061 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site