linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4] ARM: Thumb-2: Symbol manipulation macros for function body copying
Date: Mon, 17 Jan 2011 16:01:36 +0000	[thread overview]
Message-ID: <20110117160136.GA25829@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <AANLkTintFe4V6BxrUxh-gwvhoa=RcH0tkHjYbfyGHKD=@mail.gmail.com>

On Mon, Jan 17, 2011 at 03:02:20PM +0100, Jean Pihet wrote:
> On Fri, Jan 14, 2011 at 10:17 PM, Dave Martin <dave.martin@linaro.org> wrote:
> > + * These macros are intended for use when there is a need to copy a low-level
> > + * function body into special memory.
> > + *
> > + * For example, when reconfiguring the SDRAM controller, the code doing the
> > + * reconfiguration may need to run from SRAM.
> > + *
> > + * NOTE: that the copied function body must be entirely self-contained and
> > + * position-independent in order for this to work properly.
> > + *
> > + * NOTE: in order for embedded literals and data to get referenced correctly,
> > + * the alignment of functions must be preserved when copying. ?To ensure this,
> > + * the source and destination addresses for fncpy() must be aligned to a
> > + * multiple of 8 bytes: you will be get a BUG() if this condition is not met.
> > + * You will typically need a ".align 3" directive in the assembler where the
> > + * function to be copied is defined, and ensure that your allocator for the
> > + * destination buffer returns 8-byte-aligned pointers.
> 
> Note that aligning the source and destination pointers to a multiple
> of 8 bytes has an impact on the behavio(u)r and so must be carefully
> thought and tested on OMAP1/2/3 platforms.

OMAP3 is ARMv7, so is EABI.  EABI requires 64-bit data to be aligned to
natural 64-bit boundaries, so architecturally it's correct.

Nevertheless, the code may not be using 64-bit data, so that doesn't
apply - but fncpy() can't know that.

  parent reply	other threads:[~2011-01-17 16:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-14 21:17 [PATCH v4] ARM: Thumb-2: Symbol manipulation macros for function body copying Dave Martin
2011-01-17 14:02 ` Jean Pihet
2011-01-17 15:35   ` Dave Martin
2011-01-17 15:36     ` Santosh Shilimkar
2011-01-17 15:48     ` Jean Pihet
2011-01-17 16:01   ` Russell King - ARM Linux [this message]
2011-01-26 16:05     ` Dave Martin
2011-01-26 16:38       ` Russell King - ARM Linux
2011-01-26 16:57         ` Dave Martin
2011-01-19 22:09 ` Tony Lindgren
2011-01-19 22:29 ` Kevin Hilman
2011-01-20  9:42   ` Dave Martin
2011-01-24 13:50     ` Dave Martin
2011-01-24 14:07       ` Jean Pihet

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=20110117160136.GA25829@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.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 NNTP newsgroup(s).