public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: liqin.chen@sunplusct.com
Cc: Christoph Hellwig <hch@infradead.org>,
	linux-arch@vger.kernel.org, linux-arch-owner@vger.kernel.org,
	linux-kernel@vger.kernel.org, Roland McGrath <roland@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH V2] score: add regset support
Date: Mon, 13 Jul 2009 16:24:28 +0200	[thread overview]
Message-ID: <200907131624.28286.arnd@arndb.de> (raw)
In-Reply-To: <OF43365008.5559F266-ON482575F2.001F17EE-482575F2.00212259@sunplusct.com>

On Monday 13 July 2009, liqin.chen@sunplusct.com wrote:
> 
> unsigned long pad0[6];
> 
> was place at the start of pt_regs use 
> to hold the arguments from userland.
> caller(exception handler) not need to
> change stack pointer.
>
> unsigned long orig_r4;
> unsigned long orig_r7;
> move to end of the pt_regs haven't 
> problem.

Ok, I see.

Maybe to get a nicer layout, you can define separate
structures then:

struct user_regs_struct {
        unsigned long regs[32];

        unsigned long cel;
        unsigned long ceh;
 
        unsigned long sr0;      /* cnt */
        unsigned long sr1;      /* lcr */
        unsigned long sr2;      /* scr */
 
        unsigned long cp0_epc;
        unsigned long cp0_ema;
        unsigned long cp0_psr;
        unsigned long cp0_ecr;
        unsigned long cp0_condition;

	unsigned long reserved[6]; /* future extensions */
};

#ifdef __KERNEL__
struct pt_regs {
	/* stack arguments */
        unsigned long pad0[6];

	/* internal use */
        unsigned long orig_r4;
        unsigned long orig_r7;
        long is_syscall;

	/* saved registers */
	struct user_regs_struct uregs;
};
#endif

That would keep the user struct relatively clean.

	Arnd <><

  reply	other threads:[~2009-07-13 14:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-10  9:13 [PATCH V2] score: add regset support liqin.chen
2009-07-10 12:49 ` Arnd Bergmann
2009-07-13  5:56   ` liqin.chen
2009-07-13 14:24     ` Arnd Bergmann [this message]
2009-07-14  1:42       ` liqin.chen
2009-07-15 20:18       ` Roland McGrath

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=200907131624.28286.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=hch@infradead.org \
    --cc=linux-arch-owner@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liqin.chen@sunplusct.com \
    --cc=roland@redhat.com \
    --cc=torvalds@linux-foundation.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