[coreboot] [RFC] v3: cpu.c and cpu.h
rminnich at gmail.com
Mon Aug 18 17:41:45 CEST 2008
On Mon, Aug 18, 2008 at 5:29 AM, Carl-Daniel Hailfinger
<c-d.hailfinger.devel.2006 at gmx.net> wrote:
> One thing that's quite a bit confusing in v3 is the mess of cpu.c and cpu.h.
> include/arch/x86/cpu.h defines lots of functions which should be in a .c
> file instead. They are:
> struct cpuid_result cpuid(u32 op);
> u32 cpuid_eax(u32 op);
> u32 cpuid_ebx(u32 op);
> u32 cpuid_ecx(u32 op);
> u32 cpuid_edx(u32 op);
> void get_fms(struct cpuinfo_x86 *c, u32 tfms);
> unsigned long read_cr0(void);
> void write_cr0(unsigned long cr0);
> void invd(void);
> void wbinvd(void);
> void enable_cache(void);
> void disable_cache(void);
> void cpu_relax(void);
> void hlt(void);
I want these in a .c. This is more romcc legacy. They should be in
stage1, callable from anywhere.
> arch/x86/geodelx/cpu.c is completely unused, but the contents look
> important. Why don't we call them?
I'm not there yet. As you know, the cpu stuff is not ready yet. Also,
there was the problem of how to think about the cpu "device". I am
almost there and intend to augment newboot.lyx with an appendix.
> northbridge/amd/k8/cpu.c is used.
The k8 has hardware that manages pci, domain, and cpu stuff that
intermix due to hardware design. The C code also intermixed, but it
was confusing. That said, I am thinking to move that cpu code to the
arch tree at some point, which is why I broke it out.
> Can someone please illustrate the underlying architecture?
I"m going to write it up as soon as I can figure it out.
> (Background: I'm trying to add timestamping to printk, but I'm totally
> at a loss where I should place get_timestamp().)
amd cpu support I assume.
More information about the coreboot