Date: Mon, 19 Feb 2001 13:05:34 -0800 (PST) From: Matthew Jacob <mjacob@feral.com> To: John Baldwin <jhb@FreeBSD.org> Cc: jake@FreeBSD.org, alpha@FreeBSD.org Subject: old fishwraps.. Message-ID: <Pine.LNX.4.21.0102191259410.19274-100000@zeppo.feral.com> In-Reply-To: <XFMail.010219125834.jhb@FreeBSD.org>
index | next in thread | previous in thread | raw e-mail
(taking this to alpha where it belongs)
>
> On 19-Feb-01 Matthew Jacob wrote:
> >
> > Welcome back john- this is all *very* old news.....
> >
> > Right now we're more or less functional in the alpha-kernel front.. I still
> > need to add the oncpu/lastcpu stuff to alpha- I've been waiting for a
> > response
> > from Jason Evans about making these integers (instead of chars) because that
> > would make life on the alpha/genassym (or sparc, for that matter) a lot
> > easier.
>
> Making p_stat an integer is something we might need to do as well as right now
> proc assumes that a 32-bit wordsize in its alighnment. And also, one thing you
> missed is that clear_resched()'ign in userret() as is currently the case is
> wrong. It needs to be in mi_switch() instead, but mroe on that later.
Oh- yes- sorry- I haven't checked my latest copy in because I've been cheesing
it and jumping out of assembly to C-code to 'fix' this stuff- but it actually
*is* being called from cpu_switch (see below for my current patches) but the
hack currently is:
trap.c:
void alpha_clear_resched(void);
void
alpha_clear_resched(void)
{
clear_resched();
}
swtch.s:
Lcs7:
/*
* Now that the switch is done, update curproc and other
* globals. We must do this even if switching to ourselves
* because we might have re-entered cpu_switch() from idle(),
* in which case curproc would be NULL.
*/
stq s2, GD_CURPROC(globalp) /* curproc = p */
CALL (alpha_clear_resched) /* we've rescheduled */
Huh. I shouldn't wonder that this has left all the other alpha stuff very
broken.
Index: alpha/alpha/swtch.s
===================================================================
RCS file: /home/ncvs/src/sys/alpha/alpha/swtch.s,v
retrieving revision 1.22
diff -u -r1.22 swtch.s
--- alpha/alpha/swtch.s 2001/02/10 23:22:49 1.22
+++ alpha/alpha/swtch.s 2001/02/19 21:00:58
@@ -116,6 +116,8 @@
sw1:
br pv, Lcs1
Lcs1: LDGP(pv)
+ CALL(alpha_off_cpu)
+ mov s0, a0
CALL(chooseproc) /* can't return NULL */
mov v0, s2
ldq s3, P_MD_PCBPADDR(s2) /* save new pcbpaddr */
@@ -173,7 +175,9 @@
* in which case curproc would be NULL.
*/
stq s2, GD_CURPROC(globalp) /* curproc = p */
- CALL (alpha_clear_resched) /* we've rescheduled */
+ mov s2, a0
+ clr a1
+ CALL (alpha_on_cpu) /* we've rescheduled */
/*
* Now running on the new u struct.
Index: alpha/alpha/trap.c
===================================================================
RCS file: /home/ncvs/src/sys/alpha/alpha/trap.c,v
retrieving revision 1.48
diff -u -r1.48 trap.c
--- alpha/alpha/trap.c 2001/02/19 04:15:57 1.48
+++ alpha/alpha/trap.c 2001/02/19 21:00:58
@@ -89,11 +89,19 @@
extern char *syscallnames[];
#endif
-void alpha_clear_resched(void);
-void
-alpha_clear_resched(void)
+void alpha_off_cpu(struct proc *);
+void alpha_on_cpu(struct proc *, int);
+
+void alpha_off_cpu(struct proc *p)
+{
+ p->p_lastcpu = p->p_oncpu;
+ p->p_oncpu = 0xff;
+}
+
+void alpha_on_cpu(struct proc *p, int cpu)
{
+ p->p_oncpu = cpu;
clear_resched();
}
>
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.21.0102191259410.19274-100000>
