Follow IA-64 with the x86-specific ACPI MD functions and move these where

they belong to. Remove an unused function. Minor KNF. No functional change.
This commit is contained in:
jruoho 2011-06-12 11:31:30 +00:00
parent 0fc4e4ab7e
commit 2ef5adcc96
6 changed files with 31 additions and 51 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpi_machdep.c,v 1.4 2011/06/12 10:11:52 jruoho Exp $ */
/* $NetBSD: acpi_machdep.c,v 1.5 2011/06/12 11:31:30 jruoho Exp $ */
/*
* Copyright (c) 2009 KIYOHARA Takashi
* All rights reserved.
@ -28,7 +28,7 @@
* Machine-dependent routines for ACPICA.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.4 2011/06/12 10:11:52 jruoho Exp $");
__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.5 2011/06/12 11:31:30 jruoho Exp $");
#include <sys/param.h>
@ -59,15 +59,6 @@ acpi_md_OsInitialize(void)
return AE_OK;
}
ACPI_STATUS
acpi_md_OsTerminate(void)
{
/* nothing to do. */
printf("%s\n", __func__);
return AE_OK;
}
ACPI_PHYSICAL_ADDRESS
acpi_md_OsGetRootPointer(void)
{

View File

@ -1,8 +1,7 @@
/* $NetBSD: acpi_machdep.h,v 1.4 2011/06/12 10:11:52 jruoho Exp $ */
/* $NetBSD: acpi_machdep.h,v 1.5 2011/06/12 11:31:30 jruoho Exp $ */
ACPI_STATUS acpi_md_OsInitialize(void);
ACPI_STATUS acpi_md_OsTerminate(void);
ACPI_PHYSICAL_ADDRESS acpi_md_OsGetRootPointer(void);
ACPI_STATUS acpi_md_OsInitialize(void);
ACPI_PHYSICAL_ADDRESS acpi_md_OsGetRootPointer(void);
#define acpi_md_OsIn8(x) inb((x))
#define acpi_md_OsIn16(x) inw((x))

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpi_machdep.c,v 1.29 2011/01/14 18:33:34 jruoho Exp $ */
/* $NetBSD: acpi_machdep.c,v 1.1 2011/06/12 11:31:31 jruoho Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.29 2011/01/14 18:33:34 jruoho Exp $");
__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.1 2011/06/12 11:31:31 jruoho Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -77,17 +77,7 @@ extern uint32_t cpus_attached;
ACPI_STATUS
acpi_md_OsInitialize(void)
{
/* Nothing to do, yet. */
return (AE_OK);
}
ACPI_STATUS
acpi_md_OsTerminate(void)
{
/* Nothing to do, yet. */
return (AE_OK);
return AE_OK;
}
ACPI_PHYSICAL_ADDRESS
@ -179,10 +169,13 @@ sci_override:
*/
ih = intr_establish(irq, pic, pin, trigger, IPL_TTY,
(int (*)(void *)) ServiceRoutine, Context, false);
if (ih == NULL)
return (AE_NO_MEMORY);
return AE_NO_MEMORY;
*cookiep = ih;
return (AE_OK);
return AE_OK;
}
void
@ -195,20 +188,19 @@ ACPI_STATUS
acpi_md_OsMapMemory(ACPI_PHYSICAL_ADDRESS PhysicalAddress,
uint32_t Length, void **LogicalAddress)
{
int rv;
if (_x86_memio_map(x86_bus_space_mem, PhysicalAddress, Length,
0, (bus_space_handle_t *) LogicalAddress) == 0)
return (AE_OK);
rv = _x86_memio_map(x86_bus_space_mem, PhysicalAddress,
Length, 0, (bus_space_handle_t *)LogicalAddress);
return (AE_NO_MEMORY);
return (rv != 0) ? AE_NO_MEMORY : AE_OK;
}
void
acpi_md_OsUnmapMemory(void *LogicalAddress, uint32_t Length)
{
(void) _x86_memio_unmap(x86_bus_space_mem,
(bus_space_handle_t) LogicalAddress, Length, NULL);
(bus_space_handle_t)LogicalAddress, Length, NULL);
}
ACPI_STATUS
@ -219,10 +211,10 @@ acpi_md_OsGetPhysicalAddress(void *LogicalAddress,
if (pmap_extract(pmap_kernel(), (vaddr_t) LogicalAddress, &pa)) {
*PhysicalAddress = pa;
return (AE_OK);
return AE_OK;
}
return (AE_ERROR);
return AE_ERROR;
}
BOOLEAN
@ -236,7 +228,7 @@ acpi_md_OsReadable(void *Pointer, uint32_t Length)
eva = round_page((vaddr_t) Pointer + Length);
if (sva < VM_MIN_KERNEL_ADDRESS)
return (FALSE);
return FALSE;
for (; sva < eva; sva += PAGE_SIZE) {
pte = kvtopte(sva);
@ -246,7 +238,7 @@ acpi_md_OsReadable(void *Pointer, uint32_t Length)
}
}
return (rv);
return rv;
}
BOOLEAN
@ -260,7 +252,7 @@ acpi_md_OsWritable(void *Pointer, uint32_t Length)
eva = round_page((vaddr_t) Pointer + Length);
if (sva < VM_MIN_KERNEL_ADDRESS)
return (FALSE);
return FALSE;
for (; sva < eva; sva += PAGE_SIZE) {
pte = kvtopte(sva);
@ -270,7 +262,7 @@ acpi_md_OsWritable(void *Pointer, uint32_t Length)
}
}
return (rv);
return rv;
}
void

View File

@ -1,4 +1,4 @@
# $NetBSD: files.x86,v 1.70 2011/06/12 10:11:52 jruoho Exp $
# $NetBSD: files.x86,v 1.71 2011/06/12 11:31:31 jruoho Exp $
# options for MP configuration through the MP spec
defflag opt_mpbios.h MPBIOS MPVERBOSE MPDEBUG MPBIOS_SCANPCI
@ -105,10 +105,9 @@ file arch/x86/x86/mp.c acpi | mpbios
# MP configuration using ACPI
file arch/x86/x86/mpacpi.c acpi
file arch/x86/x86/acpi_machdep.c acpi
file arch/x86/acpi/acpi_pdc.c acpi
file arch/x86/acpi/acpi_wakeup.c acpi
file arch/x86/acpi/acpi_machdep.c acpi
file arch/x86/isa/isa_machdep.c isa

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpi_machdep.h,v 1.9 2011/06/12 10:11:52 jruoho Exp $ */
/* $NetBSD: acpi_machdep.h,v 1.10 2011/06/12 11:31:31 jruoho Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@ -46,7 +46,6 @@
#include <machine/i82489reg.h>
ACPI_STATUS acpi_md_OsInitialize(void);
ACPI_STATUS acpi_md_OsTerminate(void);
ACPI_PHYSICAL_ADDRESS acpi_md_OsGetRootPointer(void);
#define acpi_md_OsIn8(x) inb((x))

View File

@ -1,4 +1,4 @@
/* $NetBSD: OsdEnvironment.c,v 1.5 2009/08/23 15:16:16 jmcneill Exp $ */
/* $NetBSD: OsdEnvironment.c,v 1.6 2011/06/12 11:31:31 jruoho Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: OsdEnvironment.c,v 1.5 2009/08/23 15:16:16 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: OsdEnvironment.c,v 1.6 2011/06/12 11:31:31 jruoho Exp $");
#include <sys/types.h>
@ -53,7 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: OsdEnvironment.c,v 1.5 2009/08/23 15:16:16 jmcneill
#include <machine/acpi_machdep.h>
#define _COMPONENT ACPI_OS_SERVICES
ACPI_MODULE_NAME("ENVIRONMENT");
ACPI_MODULE_NAME ("ENVIRONMENT");
/*
* AcpiOsInitialize:
@ -77,7 +77,7 @@ AcpiOsInitialize(void)
ACPI_STATUS
AcpiOsTerminate(void)
{
return acpi_md_OsTerminate();
return AE_OK;
}
/*