Merge hlt() into cpu.h where it belongs. Add some documentation.
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@449 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
6d2a927124
commit
50cdf3827d
6 changed files with 18 additions and 37 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -181,7 +181,19 @@ static inline void disable_cache(void)
|
|||
*/
|
||||
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
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
/*
|
||||
* This file is part of the LinuxBIOS project.
|
||||
*
|
||||
* Copyright (C) 2007 Stefan Reinauer <stepan@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 */
|
||||
|
|
@ -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 @@ void console_init(void)
|
|||
" starting...\n";
|
||||
|
||||
printk(BIOS_INFO, console_test);
|
||||
|
||||
}
|
||||
|
||||
void die(const char *str)
|
||||
{
|
||||
printk(BIOS_EMERG, str);
|
||||
do {
|
||||
while (1)
|
||||
hlt();
|
||||
} while (1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue