From owner-svn-src-all@FreeBSD.ORG Thu Oct 8 18:22:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCB57106566B; Thu, 8 Oct 2009 18:22:57 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-bw0-f223.google.com (mail-bw0-f223.google.com [209.85.218.223]) by mx1.freebsd.org (Postfix) with ESMTP id 765BB8FC08; Thu, 8 Oct 2009 18:22:55 +0000 (UTC) Received: by bwz23 with SMTP id 23so96186bwz.43 for ; Thu, 08 Oct 2009 11:22:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=0bCq4dm42kF+tMdwhxedSJPQoqSRZcmKSMBlkCSEyvA=; b=LPR0q+N06pUQIQiO/r6m2/3VI37KtqxnVQUMcBICzFZh//GMbPgeKT421U9cxqNb7y ItBYhCh+dHRizXAxpWE5z/gK4fzwGD+O+9RGgy9iCuDUC/jbXhZACaKmUDkbkWQ/ji8a Ctjk0ufEZNjSqQERbNDR7m9d+9CmADWWAkjmk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=sHYAfuyyO5erX+bMYhCYVf6mVTN2alAfYuHUmZAc3PsTgt7Q/U4+pyYTleuqx8Omlt YXNNDJHWV3hgWLBL22saiLhOG0hhtaZ3EPyXYJ1vrBozl73fdFD0J166RUgpPseqvJD6 J7t0DZIwgpexJ/SQFD30aJQHRL7oMPTOglL4Y= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.18.137 with SMTP id w9mr489418faa.61.1255026174520; Thu, 08 Oct 2009 11:22:54 -0700 (PDT) In-Reply-To: <200910081741.n98HfrI3028811@svn.freebsd.org> References: <200910081741.n98HfrI3028811@svn.freebsd.org> Date: Thu, 8 Oct 2009 20:22:54 +0200 X-Google-Sender-Auth: af51b4e34bae30c4 Message-ID: <3bbf2fe10910081122t2e23d1cep44846da4a7035227@mail.gmail.com> From: Attilio Rao To: Jung-uk Kim Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197863 - head/sys/amd64/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2009 18:22:57 -0000 2009/10/8 Jung-uk Kim : > Author: jkim > Date: Thu Oct 8 17:41:53 2009 > New Revision: 197863 > URL: http://svn.freebsd.org/changeset/base/197863 > > Log: > Clean up amd64 suspend/resume code. > @@ -322,49 +316,50 @@ out: > return (ret); > } > > -static vm_offset_t acpi_wakeaddr; > - > -static void > +static void * > acpi_alloc_wakeup_handler(void) > { > void *wakeaddr; > > - if (!cold) > - return; > - > /* > * Specify the region for our wakeup code. We want it in the low 1 MB > - * region, excluding video memory and above (0xa0000). We ask for > - * it to be page-aligned, just to be safe. > + * region, excluding real mode IVT (0-0x3ff), BDA (0x400-0x4ff), EBDA > + * (less than 128KB, below 0xa0000, must be excluded by SMAP and DSDT), > + * and ROM area (0xa0000 and above). The temporary page tables must be > + * page-aligned. > */ > - wakeaddr = contigmalloc(4 * PAGE_SIZE, M_DEVBUF, M_NOWAIT, 0, 0x9ffff, > - PAGE_SIZE, 0ul); > + wakeaddr = contigmalloc(4 * PAGE_SIZE, M_DEVBUF, M_NOWAIT, 0x500, > + 0xa0000, PAGE_SIZE, 0ul); > if (wakeaddr == NULL) { > printf("%s: can't alloc wake memory\n", __func__); > - return; > + return (NULL); > } > stopxpcbs = malloc(mp_ncpus * sizeof(*stopxpcbs), M_DEVBUF, M_NOWAIT); > if (stopxpcbs == NULL) { > contigfree(wakeaddr, 4 * PAGE_SIZE, M_DEVBUF); > printf("%s: can't alloc CPU state memory\n", __func__); > - return; > + return (NULL); > } > - acpi_wakeaddr = (vm_offset_t)wakeaddr; > -} > > -SYSINIT(acpiwakeup, SI_SUB_KMEM, SI_ORDER_ANY, acpi_alloc_wakeup_handler, 0); > + return (wakeaddr); > +} > > void > acpi_install_wakeup_handler(struct acpi_softc *sc) > { > + static void *wakeaddr = NULL; > uint64_t *pt4, *pt3, *pt2; > int i; Maybe it was better to have a non-reentrat function here? Attilio -- Peace can only be achieved by understanding - A. Einstein