Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 Feb 2002 19:21:47 -0500
From:      Daniel Eischen <eischen@vigrid.com>
To:        alpha@FreeBSD.org
Cc:        Bernd Walter <ticso@cicely8.cicely.de>
Subject:   Tester needed
Message-ID:  <3C631A1B.68E59BFE@vigrid.com>

next in thread | raw e-mail | index | archive | help
I want to add the getsetcontext system call and am looking for an
alpha tester to see if the code works.  Diffs and a test program
are at:

  http://people.freebsd.org/~deischen/ucontext/uc-sys.diffs
  http://people.freebsd.org/~deischen/ucontext/uc-libc.diffs
  http://people.freebsd.org/~deischen/ucontext/test_context.c

Don't forget to regenerate the system calls before building
a kernel.

I've also got a question.  Is the user stack stored in the PCB
or does it have to be read from the PAL?  If 'td' is the current
thread, then how do we get and set the user stack?
From uc-sys.diffs:

  +void
  +get_mcontext(struct thread *td, mcontext_t *mcp)
  +{
  +
  +	/*
  +	 * Use a trapframe for getsetcontext, so just copy the
  +	 * threads trapframe.
  +	 *
  +	 * XXX - Is there something that is missing from the saved
  +	 *       trapframe?  Like the stack pointer?
  +	 */
  +	bcopy(&td->td_frame, &mcp->mc_regs, sizeof(td->td_frame));
  +#if 1
  +	mcp->mc_regs[FRAME_SP] = alpha_pal_rdusp();
  +#else
  +	mcp->mc_regs[FRAME_SP] = td->td_pcb->pcb_hw.apcb_usp;
  +#endif
  [...]

And what if 'td' is not 'curthread'?  Has it been saved in the
PCB then?  Should the above be:

  +	if (td == curthread)
  +		mcp->mc_regs[FRAME_SP] = alpha_pal_rdusp();
  +	else
  +		mcp->mc_regs[FRAME_SP] = td->td_pcb->pcb_hw.apcb_usp;


Thanks,

-- 
Dan Eischen

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C631A1B.68E59BFE>