All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: gang.chen.5i5j@gmail.com, peter.maydell@linaro.org
Cc: cmetcalf@ezchip.com, qemu-devel@nongnu.org, xili_gchen_5257@hotmail.com
Subject: Re: [Qemu-devel] [PATCH] target-tilegx: Support iret instruction and related special registers
Date: Mon, 28 Sep 2015 23:34:12 -0700	[thread overview]
Message-ID: <560A30E4.7020608@twiddle.net> (raw)
In-Reply-To: <1443478010-2620-1-git-send-email-gang.chen.5i5j@gmail.com>

On 09/28/2015 03:06 PM, gang.chen.5i5j@gmail.com wrote:
> From: Chen Gang <gang.chen.5i5j@gmail.com>
>
> Acording to the __longjmp tilegx libc implementation, and reference from
> tilegx ISA document, we can left iret instruction empty. The related
> code is below:
>
>    ENTRY (__longjmp)
>           FEEDBACK_ENTER(__longjmp)
>
>    #define RESTORE(r) { LD r, r0 ; ADDI_PTR r0, r0, REGSIZE }
>           FOR_EACH_CALLEE_SAVED_REG(RESTORE)
>
>           {
>            LD r2, r0       ; retrieve ICS bit from jmp_buf
>            movei r3, 1
>            CMPEQI r0, r1, 0
>           }
>
>           {
>            mtspr INTERRUPT_CRITICAL_SECTION, r3
>            shli r2, r2, SPR_EX_CONTEXT_0_1__ICS_SHIFT
>           }
>
>           {
>            mtspr EX_CONTEXT_0_0, lr
>            ori r2, r2, RETURN_PL
>           }
>
>           {
>            or r0, r1, r0
>            mtspr EX_CONTEXT_0_1, r2
>           }
>
>           iret
>
>           jrp lr
>
> So can let busybox sh run correctly.
>
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
> ---
>   target-tilegx/cpu.h       | 2 ++
>   target-tilegx/translate.c | 8 +++++++-
>   2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/target-tilegx/cpu.h b/target-tilegx/cpu.h
> index 4b05cd2..02e1a18 100644
> --- a/target-tilegx/cpu.h
> +++ b/target-tilegx/cpu.h
> @@ -54,6 +54,8 @@ enum {
>       TILEGX_SPR_CRITICAL_SEC = 1,
>       TILEGX_SPR_SIM_CONTROL = 2,
>       TILEGX_SPR_EX_CONTEXT_1 = 3,
> +    TILEGX_SPR_EX_CONTEXT_0_0 = 4,
> +    TILEGX_SPR_EX_CONTEXT_0_1 = 5,

Don't add spr's you're not going to use.


r~

  reply	other threads:[~2015-09-29  6:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-28 22:06 [Qemu-devel] [PATCH] target-tilegx: Support iret instruction and related special registers gang.chen.5i5j
2015-09-29  6:34 ` Richard Henderson [this message]
2015-09-29 21:07   ` Chen Gang

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=560A30E4.7020608@twiddle.net \
    --to=rth@twiddle.net \
    --cc=cmetcalf@ezchip.com \
    --cc=gang.chen.5i5j@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=xili_gchen_5257@hotmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.