[LinuxBIOS] r449 - in LinuxBIOSv3: arch/x86/geodelx include/arch/x86 lib northbridge/amd/geodelx

svn at openbios.org svn at openbios.org
Thu Jul 12 15:01:42 CEST 2007


Author: uwe
Date: 2007-07-12 15:01:42 +0200 (Thu, 12 Jul 2007)
New Revision: 449

Removed:
   LinuxBIOSv3/include/arch/x86/hlt.h
Modified:
   LinuxBIOSv3/arch/x86/geodelx/geodelx.c
   LinuxBIOSv3/include/arch/x86/cpu.h
   LinuxBIOSv3/lib/console.c
   LinuxBIOSv3/lib/ram.c
   LinuxBIOSv3/northbridge/amd/geodelx/raminit.c
Log:
Merge hlt() into cpu.h where it belongs. Add some documentation.

Signed-off-by: Uwe Hermann <uwe at hermann-uwe.de>
Acked-by: Peter Stuge <peter at stuge.se>



Modified: LinuxBIOSv3/arch/x86/geodelx/geodelx.c
===================================================================
--- LinuxBIOSv3/arch/x86/geodelx/geodelx.c	2007-07-12 01:26:43 UTC (rev 448)
+++ LinuxBIOSv3/arch/x86/geodelx/geodelx.c	2007-07-12 13:01:42 UTC (rev 449)
@@ -25,7 +25,7 @@
 #include <console.h>
 #include <msr.h>
 #include <io.h>
-#include <hlt.h>
+#include <cpu.h>
 #include <amd_geodelx.h>
 #include <spd.h>
 #include <legacy.h>

Modified: LinuxBIOSv3/include/arch/x86/cpu.h
===================================================================
--- LinuxBIOSv3/include/arch/x86/cpu.h	2007-07-12 01:26:43 UTC (rev 448)
+++ LinuxBIOSv3/include/arch/x86/cpu.h	2007-07-12 13:01:42 UTC (rev 449)
@@ -181,9 +181,21 @@
  */
 static inline void cpu_relax(void)
 {
-	__asm__ __volatile__("rep;nop" : : : "memory");
+	__asm__ __volatile__("rep; nop" : : : "memory");
 }
 
+/**
+ * Shut down the CPU.
+ *
+ * This function is '__attribute__((always_inline))' because it might be
+ * called before RAM is set up, thus pushing stuff on stack (for a function
+ * call) will not work.
+ */
+static inline __attribute__((always_inline)) void hlt(void)
+{
+	__asm__ __volatile__("hlt" : : : "memory");
+}
+
 /* Random other functions. These are not architecture-specific, except they
  * really are in many ways. Seperate the PC from the "X86" is hard.
  */

Deleted: LinuxBIOSv3/include/arch/x86/hlt.h
===================================================================
--- LinuxBIOSv3/include/arch/x86/hlt.h	2007-07-12 01:26:43 UTC (rev 448)
+++ LinuxBIOSv3/include/arch/x86/hlt.h	2007-07-12 13:01:42 UTC (rev 449)
@@ -1,29 +0,0 @@
-/*
- * This file is part of the LinuxBIOS project.
- *
- * Copyright (C) 2007 Stefan Reinauer <stepan at coresystems.de>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
- */
-
-#ifndef ARCH_X86_HLT_H
-#define ARCH_X86_HLT_H
-
-static inline __attribute__((always_inline)) void hlt(void)
-{
-	asm("hlt");
-}
-
-#endif /* ARCH_X86_HLT_H */

Modified: LinuxBIOSv3/lib/console.c
===================================================================
--- LinuxBIOSv3/lib/console.c	2007-07-12 01:26:43 UTC (rev 448)
+++ LinuxBIOSv3/lib/console.c	2007-07-12 13:01:42 UTC (rev 449)
@@ -1,5 +1,5 @@
 #include <types.h>
-#include <hlt.h>
+#include <cpu.h>
 #include <console.h>
 #include <uart8250.h>
 #include <stdarg.h>
@@ -57,13 +57,11 @@
 		" starting...\n";
 
 	printk(BIOS_INFO, console_test);
-
 }
 
 void die(const char *str)
 {
 	printk(BIOS_EMERG, str);
-	do {
+	while (1)
 		hlt();
-	} while (1);
 }

Modified: LinuxBIOSv3/lib/ram.c
===================================================================
--- LinuxBIOSv3/lib/ram.c	2007-07-12 01:26:43 UTC (rev 448)
+++ LinuxBIOSv3/lib/ram.c	2007-07-12 13:01:42 UTC (rev 449)
@@ -18,7 +18,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#include <hlt.h>
+#include <cpu.h>
 #include <console.h>
 
 /**

Modified: LinuxBIOSv3/northbridge/amd/geodelx/raminit.c
===================================================================
--- LinuxBIOSv3/northbridge/amd/geodelx/raminit.c	2007-07-12 01:26:43 UTC (rev 448)
+++ LinuxBIOSv3/northbridge/amd/geodelx/raminit.c	2007-07-12 13:01:42 UTC (rev 449)
@@ -25,7 +25,7 @@
 #include <msr.h>
 #include <spd.h>
 #include <io.h>
-#include <hlt.h>
+#include <cpu.h>
 #include <amd_geodelx.h>
 #include <southbridge/amd/cs5536/cs5536.h>
 





More information about the coreboot mailing list