From owner-freebsd-current Thu Feb 1 02:31:20 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id CAA15233 for current-outgoing; Thu, 1 Feb 1996 02:31:20 -0800 (PST) Received: from Root.COM (implode.Root.COM [198.145.90.17]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id CAA15224 for ; Thu, 1 Feb 1996 02:31:16 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by Root.COM (8.6.12/8.6.5) with SMTP id CAA01387; Thu, 1 Feb 1996 02:30:47 -0800 Message-Id: <199602011030.CAA01387@Root.COM> X-Authentication-Warning: implode.Root.COM: Host localhost didn't use HELO protocol To: KATO Takenori cc: current@FreeBSD.org Subject: Re: TSS broken In-reply-to: Your message of "Mon, 01 Jan 1996 11:50:18 +0900." <199601010250.LAA00929@marble.eps.nagoya-u.ac.jp> From: David Greenman Reply-To: davidg@Root.COM Date: Thu, 01 Feb 1996 02:30:47 -0800 Sender: owner-current@FreeBSD.org Precedence: bulk >In recent change of sys/i386/i386/swtch.s, the code > movl %esp,PCB_ESP(%ecx) >is changed into > leal 4(%esp),%eax > movl %eax,PCB_ESP(%ecx) >(in savectx). > >After this operation, the member tss_esp points not user stack >pointer, but the address of TSS. > >This may causes panic when swapper is activated. I just read the above again a few times and I think I see now the misunderstanding. The "leal" instruction moves the _address_ of its argument. In this case, %esp+4. It is similar to: movl %esp,%eax addl $4,%eax movl %eax,PCB_ESP(%ecx) The only difference being that leal is faster and also doesn't affect the condition codes like the addl does (although in this case it doesn't matter since we're not using them). -DG David Greenman Core Team/Principal Architect, The FreeBSD Project