From owner-freebsd-hackers@FreeBSD.ORG Sun Dec 31 20:54:27 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6AF1716A412 for ; Sun, 31 Dec 2006 20:54:27 +0000 (UTC) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.freebsd.org (Postfix) with ESMTP id 25BFF13C459 for ; Sun, 31 Dec 2006 20:54:27 +0000 (UTC) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.13.7/8.13.7) with ESMTP id kBVKhi3U095667 for ; Sun, 31 Dec 2006 12:43:44 -0800 (PST) Received: (from dillon@localhost) by apollo.backplane.com (8.13.7/8.13.4/Submit) id kBVKhi7t095666; Sun, 31 Dec 2006 12:43:44 -0800 (PST) Date: Sun, 31 Dec 2006 12:43:44 -0800 (PST) From: Matthew Dillon Message-Id: <200612312043.kBVKhi7t095666@apollo.backplane.com> To: freebsd-hackers@freebsd.org Subject: Confusion in acpi_sleep_machdep(). X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Dec 2006 20:54:27 -0000 I'm trying to figure out how the acpi_sleep_machdep() code works and there are a couple of lines I just don't understand: pm = vmspace_pmap(p->p_vmspace); cr3 = rcr3(); #ifdef PAE load_cr3(vtophys(pm->pm_pdpt)); #else load_cr3(vtophys(pm->pm_pdir)); #endif page = PHYS_TO_VM_PAGE(sc->acpi_wakephys); pmap_enter(pm, sc->acpi_wakephys, page, VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE, 1); First, why isn't it just using kernel_pmap ? What's all the load_cr3() stuff for ? Second, why is it entering the physical address sc->acpi_wakephys as the virtual address in the pmap ? Shouldn't it be using sc->acpi_wakeaddr there? Anybody know ? -Matt