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] ARM: highbank: Add smc calls to enable/disable the L2
Date: Tue, 5 Jun 2012 10:49:54 +0100	[thread overview]
Message-ID: <20120605094954.GH8262@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1338865900-11373-1-git-send-email-robherring2@gmail.com>

On Mon, Jun 04, 2012 at 10:11:40PM -0500, Rob Herring wrote:
> +/*
> + * This is common routine to manage secure monitor API
> + * used to modify the PL310 secure registers.
> + * 'r0' contains the value to be modified and 'r12' contains
> + * the monitor API number. It uses few CPU registers
> + * internally and hence they need be backed up including
> + * link register "lr".
> + * Function signature : void highbank_smc1(u32 fn, u32 arg)
> + */
> +
> +ENTRY(highbank_smc1)
> +	stmfd   sp!, {r2-r12, lr}
> +	mov	r12, r0
> +	mov 	r0, r1
> +	dsb
> +	smc	#0
> +	ldmfd   sp!, {r2-r12, pc}
> +ENDPROC(highbank_smc1)

The ABI.  r0-r3 are used to pass arguments, and _may_ be corrupted by
the called function.  r12 is a temporary register which called functions
may corrupt.  lr is not expected to be preserved.  Everything else must
be preserved.  Return values in r0 and maybe r1.

So.  The registers you must preserve across a function call are r4-r11,
and r13(sp).

  reply	other threads:[~2012-06-05  9:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-05  3:11 [PATCH] ARM: highbank: Add smc calls to enable/disable the L2 Rob Herring
2012-06-05  9:49 ` Russell King - ARM Linux [this message]
2012-06-06 22:20 ` [PATCH v2] " Rob Herring
2012-06-08  0:33   ` Rob Herring
2012-06-08  8:21     ` Olof Johansson

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=20120605094954.GH8262@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).