public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: "Joseph S. Myers" <joseph@codesourcery.com>
Cc: <libc-ports@sourceware.org>
Subject: Re: Miscellaneous ColdFire patches
Date: Fri, 28 Jun 2013 18:45:00 -0000	[thread overview]
Message-ID: <87obaqgjlq.fsf@igel.home> (raw)
In-Reply-To: <Pine.LNX.4.64.1306281549400.27363@digraph.polyomino.org.uk>	(Joseph S. Myers's message of "Fri, 28 Jun 2013 16:00:25 +0000")

"Joseph S. Myers" <joseph@codesourcery.com> writes:

> 2013-06-28  Joseph Myers  <joseph@codesourcery.com>
>
> 	* sysdeps/unix/sysv/linux/m68k/kernel-features.h [__mcoldfire__]
> 	(MMAP2_PAGE_SHIFT): Define to -1.

kernel-features.h is the wrong place to define this (mmap64.c should
actually no longer include it).  You should create a mmap64.c that
defines MMAP2_PAGE_SHIFT and then falls through to the real
implementation.  Also, this is an issue for sun3 as well, so it needs to
be defined for all m68k variants.

Finally, you need to fix sysdeps/unix/sysv/linux/mmap64.c so that it
doesn't shift by -1.

(Looks like cris and microblaze have the same bug.)

> 2013-06-28  Nathan Sidwell  <nathan@codesourcery.com>
>
> 	* sysdeps/m68k/fpu_control.h [__mcoldfire__ && !__mcffpu__]
> 	(_FPU_RESERVED): Provide alternative definition.
> 	[__mcoldfire__ && !__mcffpu__] (_FPU_DEFAULT): Likewise.
> 	[__mcoldfire__ && !__mcffpu__] (_FPU_GETCW): Likewise.
> 	[__mcoldfire__ && !__mcffpu__] (_FPU_SETCW): Likewise.
> 	[!(__mcoldfire__ && !__mcffpu__)]: Make existing macro definitions
> 	conditional.
>
> diff --git a/ports/sysdeps/m68k/fpu_control.h b/ports/sysdeps/m68k/fpu_control.h
> index c37fcf4..848b5ba 100644
> --- a/ports/sysdeps/m68k/fpu_control.h
> +++ b/ports/sysdeps/m68k/fpu_control.h
> @@ -53,6 +53,15 @@
>  
>  #include <features.h>
>  
> +#if defined (__mcoldfire__) && !defined (__mcffpu__)
> +
> +#define _FPU_RESERVED 0xffffffff
> +#define _FPU_DEFAULT  0x00000000
> +#define _FPU_GETCW(cw) ((cw) = 0)
> +#define _FPU_SETCW(cw) ((void) (cw))
> +
> +#else
> +
>  /* masking of interrupts */
>  #define _FPU_MASK_BSUN  0x8000
>  #define _FPU_MASK_SNAN  0x4000
> @@ -95,12 +104,13 @@
>     that __setfpucw works.  This bit will be ignored.  */
>  #define _FPU_IEEE     0x00000001
>  
> -/* Type of the control word.  */
> -typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__)));
> -
>  /* Macros for accessing the hardware control word.  */
>  #define _FPU_GETCW(cw) __asm__ ("fmove%.l %!, %0" : "=dm" (cw))
>  #define _FPU_SETCW(cw) __asm__ volatile ("fmove%.l %0, %!" : : "dm" (cw))
> +#endif
> +
> +/* Type of the control word.  */
> +typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__)));
>  
>  /* Default control word set at startup.  */
>  extern fpu_control_t __fpu_control;

Please fix up the preprocessor indentation, possibly in a separate
commit.

> 2013-06-28  Nathan Sidwell  <nathan@codesourcery.com>
> 	    Joseph Myers  <joseph@codesourcery.com>
>
> 	* sysdeps/m68k/dl-trampoline.S (_dl_runtime_profile)
> 	[__mcoldfire__ && !__mcffpu]: Do not save floating-point
> 	registers.
>
> diff --git a/ports/sysdeps/m68k/dl-trampoline.S b/ports/sysdeps/m68k/dl-trampoline.S
> index 5aeafc7..16f20dc 100644
> --- a/ports/sysdeps/m68k/dl-trampoline.S
> +++ b/ports/sysdeps/m68k/dl-trampoline.S
> @@ -174,12 +174,16 @@ _dl_runtime_profile:
>  	    +4      %a1
>  	   %sp      %a0
>  	*/
> -#ifdef __mcoldfire__
> +#if !defined (__mcoldfire__)
> +	fmove.x %fp0, -(%sp)
> +	cfi_adjust_cfa_offset (12)
> +#elif defined (__mcffpu__)
>  	fmove.d %fp0, -(%sp)
>  	cfi_adjust_cfa_offset (8)
>  #else
> -	fmove.x %fp0, -(%sp)
> -	cfi_adjust_cfa_offset (12)
> +	clr.l -(%sp)
> +	clr.l -(%sp)
> +	cfi_adjust_cfa_offset (8)

There should be no need to even allocate the stack space.

>  #endif
>  	move.l %a0, -(%sp)
>  	cfi_adjust_cfa_offset (4)
> @@ -213,15 +217,20 @@ _dl_runtime_profile:
>  	cfi_adjust_cfa_offset (-4)
>  	move.l (%sp)+, %a0
>  	cfi_adjust_cfa_offset (-4)
> -#ifdef __mcoldfire__
> -	fmove.d (%sp)+, %fp0
> -	cfi_adjust_cfa_offset (-8)
> -#else
> +#if !defined (__mcoldfire__)
>  	fmove.x (%sp)+, %fp0
>  	cfi_adjust_cfa_offset (-12)
> -#endif
>  	lea 20(%sp), %sp
>  	cfi_adjust_cfa_offset (-20)
> +#elif defined (__mcffpu__)
> +	fmove.l (%sp)+, %fp0

fmove.d

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

  reply	other threads:[~2013-06-28 18:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-28 16:00 Joseph S. Myers
2013-06-28 18:45 ` Andreas Schwab [this message]
2013-06-28 20:15   ` Joseph S. Myers
2013-06-30 20:57     ` Andreas Schwab
2013-06-28 20:25   ` Joseph S. Myers
2013-08-20 16:48     ` Ping for m68k MMAP2_PAGE_SHIFT fix Joseph S. Myers
2013-08-20 18:49       ` Andreas Schwab
2013-09-02 15:17       ` Ping " Joseph S. Myers
2013-09-04 20:44     ` Miscellaneous ColdFire patches Andreas Schwab
2013-06-28 20:32   ` Joseph S. Myers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87obaqgjlq.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=joseph@codesourcery.com \
    --cc=libc-ports@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).