On Thu, Jun 28, 2007 at 07:12:37PM +0200, svn@openbios.org wrote:
+#include <types.h> +#include <lib.h> +#include <console.h> +#include <post_code.h> +#include <device/device.h> +#include <device/pci.h> +#include <string.h> +#include <msr.h> +#include <io.h> +#include <cpu.h> +#include <amd_geodelx.h>
The list of includes we need in every file is getting pretty large slowly... Should we introduce a linuxbios.h file which includes all "core" headers such as types.h, string.h, io.h and others? This would reduce the number of includes a lot.
(we should not put chipset- or mainboard-specific includes in linuxbios.h, of course)
+struct gliutable {
- unsigned long desc_name;
- unsigned short desc_type;
- unsigned long hi, lo;
Should be u8, u16, u32 etc. as needed.
+struct msrinit {
- unsigned long msrnum;
u8, u16 etc.
+extern int sizeram(void);
[...]
+extern int sizeram(void);
Listed twice, one must go (or rather both of them?) This should be in some header file.
+/**
- Set the GLPCI registers for the memory hole.
- Keeps all cache shadow descriptors sync'ed.
- @param shadowhi the high 32 bits of the msr setting
- @param shadowlo The low 32 bits of the msr setting
- */
+static void set_shadowGLPCI(u32 shadowhi, u32 shadowlo)
One of the many mixed-case function-/variable-names which need to be fixed.
- // Make sure all INVD instructions are treated as WBINVD. We do this
- // because we've found some programs which require this behavior.
- msr = rdmsr(CPU_DM_CONFIG0);
- msr.lo |= DM_CONFIG0_LOWER_WBINVD_SET;
- wrmsr(CPU_DM_CONFIG0, msr);
- enable_cache();
- __asm__("wbinvd\n");
We have a wbinvd() function in cpu.h now.
- __asm__ __volatile__("FINIT\n");
Should be a function in some header?
Uwe.
* Uwe Hermann uwe@hermann-uwe.de [070628 23:10]:
On Thu, Jun 28, 2007 at 07:12:37PM +0200, svn@openbios.org wrote:
+#include <types.h> +#include <lib.h> +#include <console.h> +#include <post_code.h> +#include <device/device.h> +#include <device/pci.h> +#include <string.h> +#include <msr.h> +#include <io.h> +#include <cpu.h> +#include <amd_geodelx.h>
The list of includes we need in every file is getting pretty large slowly... Should we introduce a linuxbios.h file which includes all "core" headers such as types.h, string.h, io.h and others? This would reduce the number of includes a lot.
I get the impression that we can drop quite some of them.
Having a general linuxbios.h might increase compile time quite a bit. Can you do some measures and/or send a patch?
- __asm__ __volatile__("FINIT\n");
Should be a function in some header?
What does it do?
Stefan Reinauer wrote:
- Uwe Hermann uwe@hermann-uwe.de [070628 23:10]:
On Thu, Jun 28, 2007 at 07:12:37PM +0200, svn@openbios.org wrote:
+#include <types.h> +#include <lib.h> +#include <console.h> +#include <post_code.h> +#include <device/device.h> +#include <device/pci.h> +#include <string.h> +#include <msr.h> +#include <io.h> +#include <cpu.h> +#include <amd_geodelx.h>
The list of includes we need in every file is getting pretty large slowly... Should we introduce a linuxbios.h file which includes all "core" headers such as types.h, string.h, io.h and others? This would reduce the number of includes a lot.
I get the impression that we can drop quite some of them.
Having a general linuxbios.h might increase compile time quite a bit. Can you do some measures and/or send a patch?
- __asm__ __volatile__("FINIT\n");
Should be a function in some header?
What does it do?
FINIT is the FPU initialization instruction. Marc
On Fri, Jun 29, 2007 at 12:03:19AM +0200, Stefan Reinauer wrote:
- Uwe Hermann uwe@hermann-uwe.de [070628 23:10]:
On Thu, Jun 28, 2007 at 07:12:37PM +0200, svn@openbios.org wrote:
+#include <types.h> +#include <lib.h> +#include <console.h> +#include <post_code.h> +#include <device/device.h> +#include <device/pci.h> +#include <string.h> +#include <msr.h> +#include <io.h> +#include <cpu.h> +#include <amd_geodelx.h>
The list of includes we need in every file is getting pretty large slowly... Should we introduce a linuxbios.h file which includes all "core" headers such as types.h, string.h, io.h and others? This would reduce the number of includes a lot.
I get the impression that we can drop quite some of them.
Having a general linuxbios.h might increase compile time quite a bit. Can you do some measures and/or send a patch?
I don't think we should care about compile time too much (except it gets _really_ long), readability and ease of understanding of the code is more important.
I'll see if I can do some measurements, maybe next week or so, but I don't believe the compile-time differences will be too dranmatic.
- __asm__ __volatile__("FINIT\n");
Should be a function in some header?
What does it do?
I have no idea :) It's just a bit awkward to have assembly in various different files. I thought our approach was to have 10-20 asm lines for init, and the rest in C?
Uwe.