Commit a4f48278 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] m68k: handle new gcc's

M68k: Fixes for when compiling with modern gcc (from Roman Zippel):
  - Avoid warning 'use of memory input without lvalue in asm operand 0 is
    deprecated' of newer gcc
  - Replace some '%/' with offical '%%' to escape a '%'
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a1836793
...@@ -228,8 +228,8 @@ static inline int restore_fpu_state(struct sigcontext *sc) ...@@ -228,8 +228,8 @@ static inline int restore_fpu_state(struct sigcontext *sc)
goto out; goto out;
__asm__ volatile (".chip 68k/68881\n\t" __asm__ volatile (".chip 68k/68881\n\t"
"fmovemx %0,%/fp0-%/fp1\n\t" "fmovemx %0,%%fp0-%%fp1\n\t"
"fmoveml %1,%/fpcr/%/fpsr/%/fpiar\n\t" "fmoveml %1,%%fpcr/%%fpsr/%%fpiar\n\t"
".chip 68k" ".chip 68k"
: /* no outputs */ : /* no outputs */
: "m" (*sc->sc_fpregs), "m" (*sc->sc_fpcntl)); : "m" (*sc->sc_fpregs), "m" (*sc->sc_fpcntl));
...@@ -258,7 +258,7 @@ static inline int rt_restore_fpu_state(struct ucontext *uc) ...@@ -258,7 +258,7 @@ static inline int rt_restore_fpu_state(struct ucontext *uc)
if (FPU_IS_EMU) { if (FPU_IS_EMU) {
/* restore fpu control register */ /* restore fpu control register */
if (__copy_from_user(current->thread.fpcntl, if (__copy_from_user(current->thread.fpcntl,
&uc->uc_mcontext.fpregs.f_pcr, 12)) uc->uc_mcontext.fpregs.f_fpcntl, 12))
goto out; goto out;
/* restore all other fpu register */ /* restore all other fpu register */
if (__copy_from_user(current->thread.fp, if (__copy_from_user(current->thread.fp,
...@@ -298,12 +298,12 @@ static inline int rt_restore_fpu_state(struct ucontext *uc) ...@@ -298,12 +298,12 @@ static inline int rt_restore_fpu_state(struct ucontext *uc)
sizeof(fpregs))) sizeof(fpregs)))
goto out; goto out;
__asm__ volatile (".chip 68k/68881\n\t" __asm__ volatile (".chip 68k/68881\n\t"
"fmovemx %0,%/fp0-%/fp7\n\t" "fmovemx %0,%%fp0-%%fp7\n\t"
"fmoveml %1,%/fpcr/%/fpsr/%/fpiar\n\t" "fmoveml %1,%%fpcr/%%fpsr/%%fpiar\n\t"
".chip 68k" ".chip 68k"
: /* no outputs */ : /* no outputs */
: "m" (*fpregs.f_fpregs), : "m" (*fpregs.f_fpregs),
"m" (fpregs.f_pcr)); "m" (*fpregs.f_fpcntl));
} }
if (context_size && if (context_size &&
__copy_from_user(fpstate + 4, (long *)&uc->uc_fpstate + 1, __copy_from_user(fpstate + 4, (long *)&uc->uc_fpstate + 1,
...@@ -586,12 +586,12 @@ static inline void save_fpu_state(struct sigcontext *sc, struct pt_regs *regs) ...@@ -586,12 +586,12 @@ static inline void save_fpu_state(struct sigcontext *sc, struct pt_regs *regs)
sc->sc_fpstate[0x38] |= 1 << 3; sc->sc_fpstate[0x38] |= 1 << 3;
} }
__asm__ volatile (".chip 68k/68881\n\t" __asm__ volatile (".chip 68k/68881\n\t"
"fmovemx %/fp0-%/fp1,%0\n\t" "fmovemx %%fp0-%%fp1,%0\n\t"
"fmoveml %/fpcr/%/fpsr/%/fpiar,%1\n\t" "fmoveml %%fpcr/%%fpsr/%%fpiar,%1\n\t"
".chip 68k" ".chip 68k"
: /* no outputs */ : "=m" (*sc->sc_fpregs),
: "m" (*sc->sc_fpregs), "=m" (*sc->sc_fpcntl)
"m" (*sc->sc_fpcntl) : /* no inputs */
: "memory"); : "memory");
} }
} }
...@@ -604,7 +604,7 @@ static inline int rt_save_fpu_state(struct ucontext *uc, struct pt_regs *regs) ...@@ -604,7 +604,7 @@ static inline int rt_save_fpu_state(struct ucontext *uc, struct pt_regs *regs)
if (FPU_IS_EMU) { if (FPU_IS_EMU) {
/* save fpu control register */ /* save fpu control register */
err |= copy_to_user(&uc->uc_mcontext.fpregs.f_pcr, err |= copy_to_user(uc->uc_mcontext.fpregs.f_fpcntl,
current->thread.fpcntl, 12); current->thread.fpcntl, 12);
/* save all other fpu register */ /* save all other fpu register */
err |= copy_to_user(uc->uc_mcontext.fpregs.f_fpregs, err |= copy_to_user(uc->uc_mcontext.fpregs.f_fpregs,
...@@ -631,12 +631,12 @@ static inline int rt_save_fpu_state(struct ucontext *uc, struct pt_regs *regs) ...@@ -631,12 +631,12 @@ static inline int rt_save_fpu_state(struct ucontext *uc, struct pt_regs *regs)
fpstate[0x38] |= 1 << 3; fpstate[0x38] |= 1 << 3;
} }
__asm__ volatile (".chip 68k/68881\n\t" __asm__ volatile (".chip 68k/68881\n\t"
"fmovemx %/fp0-%/fp7,%0\n\t" "fmovemx %%fp0-%%fp7,%0\n\t"
"fmoveml %/fpcr/%/fpsr/%/fpiar,%1\n\t" "fmoveml %%fpcr/%%fpsr/%%fpiar,%1\n\t"
".chip 68k" ".chip 68k"
: /* no outputs */ : "=m" (*fpregs.f_fpregs),
: "m" (*fpregs.f_fpregs), "=m" (*fpregs.f_fpcntl)
"m" (fpregs.f_pcr) : /* no inputs */
: "memory"); : "memory");
err |= copy_to_user(&uc->uc_mcontext.fpregs, &fpregs, err |= copy_to_user(&uc->uc_mcontext.fpregs, &fpregs,
sizeof(fpregs)); sizeof(fpregs));
......
...@@ -6,10 +6,8 @@ typedef int greg_t; ...@@ -6,10 +6,8 @@ typedef int greg_t;
typedef greg_t gregset_t[NGREG]; typedef greg_t gregset_t[NGREG];
typedef struct fpregset { typedef struct fpregset {
int f_pcr; int f_fpcntl[3];
int f_psr; int f_fpregs[8*3];
int f_fpiaddr;
int f_fpregs[8][3];
} fpregset_t; } fpregset_t;
struct mcontext { struct mcontext {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment