From owner-freebsd-current Mon Feb 1 01:52:55 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA23785 for freebsd-current-outgoing; Mon, 1 Feb 1999 01:52:55 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from nhj.nlc.net.au (nhj.nlc.net.au [203.24.133.1]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id BAA23780 for ; Mon, 1 Feb 1999 01:52:50 -0800 (PST) (envelope-from john.saunders@nlc.net.au) Received: (qmail 24006 invoked by uid 1000); 1 Feb 1999 20:52:45 +1100 Date: 1 Feb 1999 20:52:45 +1100 Message-ID: <19990201095245.24005.qmail@nhj.nlc.net.au> From: "John Saunders" To: freebsd-current@FreeBSD.ORG Cc: Dan Swartzendruber Subject: Re: btokup().. patch to STYLE(9) (fwd) X-Newsgroups: nlc.lists.freebsd-current In-Reply-To: <3.0.5.32.19990131201731.009da5f0@mail.kersur.net> User-Agent: tin/pre-1.4-980818 ("Laura") (UNIX) (Linux/2.0.36 (i686)) Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In nlc.lists.freebsd-current you wrote: > At 12:09 PM 2/1/99 +1100, Gregory Bond wrote: >>> "You are not supposed to understand this." "You are not expected to understand this." >>It was (IIRC) the process switching magic at the heart of fork() in V7 (and >>earlier, I assume). > If I remember right, it referred to the non-local goto juju where if the > forked processed was swapped out, the label jumped was changed to yet > another place. Unfortunately, my annotated V6 listing is not accessible > right now... It's inside the swtch() function call. Just having a quick look now. Inside expand(), where core is allocated for a process, if no core is available the process is swapped out with a call to xswap(), then switched out with a call to swtch(). When core becomes available and the process image is read in from swap, the process will be selected by swtch() to become runnable. However with the current context, swtch() would return and the tail end of the expand() function would execute. So inside expand() a call is made to save the stack state so that when swtch() restores this state, the return skips over the expand() function entirely. Cheers. -- +------------------------------------------------------------+ . | John Saunders - mailto:john@nlc.net.au (EMail) | ,--_|\ | - http://www.nlc.net.au/ (WWW) | / Oz \ | - 02-9489-4932 or 041-822-3814 (Phone) | \_,--\_/ | NHJ NORTHLINK COMMUNICATIONS - Supplying a professional, | v | and above all friendly, internet connection service. | +------------------------------------------------------------+ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message