Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@baldric.uwo.ca>
To: Randolph Chung <randolph@tausq.org>
Cc: parisc-linux@lists.parisc-linux.org
Subject: Re: [parisc-linux] Re: how to handle ERESTART_RESTARTBLOCK ?
Date: Sun, 26 Oct 2003 11:49:26 -0500	[thread overview]
Message-ID: <20031026164926.GE26587@systemhalted> (raw)
In-Reply-To: <20031026073751.GH24406@tausq.org>

On Sun, Oct 26, 2003 at 12:37:51AM -0700, Randolph Chung wrote:
> here's a patch that implements the required logic. probably can be
> improved some.... comments appreciated.
> 
> About __NR_restart_syscall, some archs use syscall #0 (unused for pa
> afaict), others define a new syscall number. Any preferences? If it's
> zero then i think i will remove the reassemble_14 logic.

I don't see why #0 can't be used here. Then again, why can't you code
the syscall number directly into the hex? Are you expecting it to
change? :)

> +		if (regs->gr[28] == -ERESTART_RESTARTBLOCK) {
> +			unsigned int *usp = (unsigned int *)regs->gr[30];
> +
> +			/* Setup a trampoline to restart the syscall
> +			 * with __NR_restart_syscall
> +			 *
> +			 *  0: ble 0x100(%%sr2, %%r0)
> +			 *  4: ldi __NR_restart_syscall, %r20
> +			 *  8: b,l .+8, %r21
> +			 * 12: depi 0,31,2,%r21
> +			 * 16: ldw 16(%r21), %rp
> +			 * 20: bv %r0(%rp)
> +			 * 24: ldo -64(%sp), %sp

Adding stack here can be detremental to the userspace program. It's not
expecting you to have a stack, and it expects the syscall to live within 
its calling frame. When we setup the signal return trampoline we don't
mess with the stack either :) Though this context is different.

> +			 * 28: nop
> +			 * 32: <return address> (2 slots for 64-bit)
> +			 */

c.

  parent reply	other threads:[~2003-10-26 16:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-12  6:02 [parisc-linux] how to handle ERESTART_RESTARTBLOCK ? Randolph Chung
2003-10-26  7:37 ` [parisc-linux] " Randolph Chung
2003-10-26  7:39   ` Randolph Chung
2003-10-26 16:49   ` Carlos O'Donell [this message]
2003-10-26 19:18     ` Randolph Chung
2003-10-26 19:53       ` John David Anglin
2003-10-26 20:59         ` Randolph Chung
2003-10-26 21:02           ` Randolph Chung
2003-10-27  4:37             ` Carlos O'Donell
2003-10-27  5:06               ` Randolph Chung

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=20031026164926.GE26587@systemhalted \
    --to=carlos@baldric.uwo.ca \
    --cc=parisc-linux@lists.parisc-linux.org \
    --cc=randolph@tausq.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