From owner-freebsd-acpi@FreeBSD.ORG Tue Oct 3 21:34:13 2006 Return-Path: X-Original-To: freebsd-acpi@freebsd.org Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 88B4F16A412; Tue, 3 Oct 2006 21:34:13 +0000 (UTC) (envelope-from a.bittau@cs.ucl.ac.uk) Received: from darkircop.org (tapir.cs.ucl.ac.uk [128.16.66.93]) by mx1.FreeBSD.org (Postfix) with ESMTP id EEB4343D69; Tue, 3 Oct 2006 21:34:12 +0000 (GMT) (envelope-from a.bittau@cs.ucl.ac.uk) Received: by darkircop.org (Postfix, from userid 0) id D14985C5CC2; Tue, 3 Oct 2006 22:33:56 +0100 (BST) Date: Tue, 3 Oct 2006 22:33:56 +0100 From: Andrea Bittau To: Nate Lawson Message-ID: <20061003213356.GA6149@shorty.sorbonet.org> References: <20060921000628.GA1832@shorty.sorbonet.org> <200610021424.18562.jhb@freebsd.org> <20061002223055.GA8217@shorty.sorbonet.org> <200610031302.34835.jhb@freebsd.org> <4522D023.9090501@root.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4522D023.9090501@root.org> User-Agent: Mutt/1.4.2.1i X-Echelon: Bush Bomb War KGB Cc: freebsd-acpi@freebsd.org, freebsd-mobile@freebsd.org Subject: Re: hack for getting suspend/resume to half work on an IBM Thinkpad x60s [SMP] X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Oct 2006 21:34:13 -0000 On Tue, Oct 03, 2006 at 02:03:31PM -0700, Nate Lawson wrote: > I agree. The standard switch to protected mode, paging, etc. needs to > be performed and then resume from the saved register context. I guess my point was that there are two pieces of code that do that: 1) mpboot.s bootMP() used by system bootstrap and what my current patch uses. I think this is what you guys are suggesting to use, and I'm doing it anyway in my patch, but I just want to be the devil's advocate =D. 2) acpi_wakecode.S wakeup_16() used by the BSP to wake itself up. This is what I was suggesting should be generalized and used by the other cores too. The difference of this code as opposed to #1 is that #2 can "cheat". That is, we can create the code for #2 on the fly and do stuff like mov old_eax,eax etc and don't have to be smart about figuring out where the CPU should land and how it should initialize itself [as in the case of #1]. I'm just wondering whether we should do something about the assembly "code duplication" in #1 and #2. I understand they serve a different purpose, but arguably, they do the same thing: real-mode -> jump in kernel. What is different is what happens once in kernel mode: boot or resume? That difference could be coded in the C part of the kernel leaving a single asm entry point both for bootstrap and wakeup code. Am I making any sense? =D