Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Move ACPI_FLUSH_CPU_CACHE() (a.k.a. WBINVD on x86) to MD...



details:   https://anonhg.NetBSD.org/src/rev/34943c03803c
branches:  trunk
changeset: 756569:34943c03803c
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Sat Jul 24 09:35:36 2010 +0000

description:
Move ACPI_FLUSH_CPU_CACHE() (a.k.a. WBINVD on x86) to MD headers where it
belongs to. Let IA-64 define its own function/instruction instead of
requiring a dummy wbinvd() to satisfy the definition in a MI header.

diffstat:

 sys/arch/ia64/acpi/acpi_machdep.c   |  10 ++--------
 sys/arch/ia64/include/acpi_func.h   |   9 ++++++---
 sys/arch/ia64/include/cpufunc.h     |   4 +---
 sys/arch/x86/include/acpi_machdep.h |  21 +++++++++++++++------
 sys/dev/acpi/acpica/acpi_func.h     |   3 +--
 5 files changed, 25 insertions(+), 22 deletions(-)

diffs (139 lines):

diff -r e24e600b4187 -r 34943c03803c sys/arch/ia64/acpi/acpi_machdep.c
--- a/sys/arch/ia64/acpi/acpi_machdep.c Sat Jul 24 08:02:46 2010 +0000
+++ b/sys/arch/ia64/acpi/acpi_machdep.c Sat Jul 24 09:35:36 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_machdep.c,v 1.1 2009/07/20 04:41:36 kiyohara Exp $        */
+/*     $NetBSD: acpi_machdep.c,v 1.2 2010/07/24 09:35:36 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.1 2009/07/20 04:41:36 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.2 2010/07/24 09:35:36 jruoho Exp $");
 
 #include <sys/param.h>
 
@@ -199,9 +199,3 @@
 printf("%s: not yet...\n", __func__);
        return 0;
 }
-
-void
-wbinvd(void)
-{
-printf("%s: not yet...\n", __func__);
-}
diff -r e24e600b4187 -r 34943c03803c sys/arch/ia64/include/acpi_func.h
--- a/sys/arch/ia64/include/acpi_func.h Sat Jul 24 08:02:46 2010 +0000
+++ b/sys/arch/ia64/include/acpi_func.h Sat Jul 24 09:35:36 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_func.h,v 1.2 2006/05/14 21:55:38 elad Exp $       */
+/*     $NetBSD: acpi_func.h,v 1.3 2010/07/24 09:35:36 jruoho Exp $     */
 
 /*-
  * Copyright (c) 2002 Mitsuru IWASAKI
@@ -31,7 +31,7 @@
 /******************************************************************************
  *
  * Name: acpica_machdep.h - arch-specific defines, etc.
- *       $Revision: 1.2 $
+ *       $Revision: 1.3 $
  *
  *****************************************************************************/
 
@@ -48,9 +48,12 @@
 #define ACPI_DISABLE_IRQS() disable_intr()
 #define ACPI_ENABLE_IRQS()  enable_intr()
 
+#ifdef ACPI_FLUSH_CPU_CACHE
+#undef ACPI_FLUSH_CPU_CACHE
+#endif
+
 #define ACPI_FLUSH_CPU_CACHE() /* XXX ia64_fc()? */
 
-
 /* Section 5.2.9.1:  global lock acquire/release functions */
 extern int     acpi_acquire_global_lock(uint32_t *lock);
 extern int     acpi_release_global_lock(uint32_t *lock);
diff -r e24e600b4187 -r 34943c03803c sys/arch/ia64/include/cpufunc.h
--- a/sys/arch/ia64/include/cpufunc.h   Sat Jul 24 08:02:46 2010 +0000
+++ b/sys/arch/ia64/include/cpufunc.h   Sat Jul 24 09:35:36 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpufunc.h,v 1.3 2009/07/20 04:41:37 kiyohara Exp $     */
+/*     $NetBSD: cpufunc.h,v 1.4 2010/07/24 09:35:36 jruoho Exp $       */
 
 /*-
  * Copyright (c) 1998 Doug Rabson
@@ -226,8 +226,6 @@
                enable_intr();
 }
 
-void wbinvd(void);
-
 #endif /* _KERNEL */
 
 #endif /* !_MACHINE_CPUFUNC_H_ */
diff -r e24e600b4187 -r 34943c03803c sys/arch/x86/include/acpi_machdep.h
--- a/sys/arch/x86/include/acpi_machdep.h       Sat Jul 24 08:02:46 2010 +0000
+++ b/sys/arch/x86/include/acpi_machdep.h       Sat Jul 24 09:35:36 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_machdep.h,v 1.5 2009/03/14 13:54:28 jmcneill Exp $        */
+/*     $NetBSD: acpi_machdep.h,v 1.6 2010/07/24 09:35:36 jruoho Exp $  */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -35,19 +35,26 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifndef _X86_ACPI_MACHDEP_H_
+#define _X86_ACPI_MACHDEP_H_
+
 /*
- * Machine-dependent code for ACPI.  This is provided to the Osd
- * portion of the ACPICA.
+ * Machine-dependent code for ACPI.
  */
-
 #include <machine/pio.h>
 #include <machine/i82489var.h>
 #include <machine/i82489reg.h>
 
-ACPI_STATUS    acpi_md_OsInitialize(void);
-ACPI_STATUS    acpi_md_OsTerminate(void);
+ACPI_STATUS            acpi_md_OsInitialize(void);
+ACPI_STATUS            acpi_md_OsTerminate(void);
 ACPI_PHYSICAL_ADDRESS  acpi_md_OsGetRootPointer(void);
 
+#ifdef ACPI_FLUSH_CPU_CACHE
+#undef ACPI_FLUSH_CPU_CACHE
+#endif
+
+#define        ACPI_FLUSH_CPU_CACHE()  wbinvd()
+
 #define        acpi_md_OsIn8(x)        inb((x))
 #define        acpi_md_OsIn16(x)       inw((x))
 #define        acpi_md_OsIn32(x)       inl((x))
@@ -73,3 +80,5 @@
 int            acpi_md_sleep(int);
 void           acpi_md_sleep_init(void);
 void           acpi_md_callback(void);
+
+#endif /* !_X86_ACPI_MACHDEP_H_ */
diff -r e24e600b4187 -r 34943c03803c sys/dev/acpi/acpica/acpi_func.h
--- a/sys/dev/acpi/acpica/acpi_func.h   Sat Jul 24 08:02:46 2010 +0000
+++ b/sys/dev/acpi/acpica/acpi_func.h   Sat Jul 24 09:35:36 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_func.h,v 1.2 2010/03/08 12:35:08 jruoho Exp $     */
+/*     $NetBSD: acpi_func.h,v 1.3 2010/07/24 09:35:36 jruoho Exp $     */
 
 /*-
  * Copyright (c) 2000 Michael Smith
@@ -77,4 +77,3 @@
        return old & GL_BIT_PENDING;
 }
 
-#define        ACPI_FLUSH_CPU_CACHE()          wbinvd()



Home | Main Index | Thread Index | Old Index