switch-coreboot/include/globalvars.h
Ronald G. Minnich 96e0fd18bf Fixes to make k8 and others work.
We need the sys_info struct in the global variables struct for 
cache as ram on k8. The sys_info struct is generally very useful
so it makes sense to start accomodating it.  

This patch adds an (empty for now) sys_info struct for geode. 
It add sys_info to the global variables struct. 

It removes global variables from console.h to a new file, 
globalvars.h. Very little code needs to include this file. 

This patch is tested on the dbe62 and simnow with no problems.

k8 compilation is now broken but I'm working on it. I'm going through
the eyeballs-bleed code on k8 startup to document it and with any luck 
we'll have more functionality by the end of today. But it's hard ...

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@828 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-27 22:43:18 +00:00

51 lines
1.7 KiB
C

/*
* 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 GLOBALVARS_H
#define GLOBALVARS_H
/* you need to include all files that might be referenced in the global variables struct */
#include <console.h>
#include <types.h>
/* the sys_info struct is architecture-dependent, with parameters controlled from mainboard.h in some cases */
#ifdef CONFIG_CPU_AMD_K8
#include <mainboard.h>
#include <amd/k8/k8.h>
#include <amd/k8/sysconf.h>
#endif
#ifdef CONFIG_CPU_AMD_GEODELX
#include <amd_geodelx.h>
#endif
/*
* struct global_vars is managed entirely from C code. Keep in mind that there
* is NO buffer at the end of the struct, so having zero-sized arrays at the
* end or similar stuff for which the compiler can't determine the final size
* will corrupt memory. If you don't try to be clever, everything will be fine.
*/
struct global_vars {
#ifdef CONFIG_CONSOLE_BUFFER
struct printk_buffer *printk_buffer;
#endif
unsigned int loglevel;
/* these two values are of interest in many stages */
u32 bist;
u32 init_detected;
struct sys_info sys_info;
};
#endif /* GLOBALVARS_H */