Author: mcayland Date: Fri Apr 2 13:41:35 2010 New Revision: 725 URL: http://tracker.coreboot.org/trac/openbios/changeset/725
Log: Create an initialisation function called openbios_init(), similar to modules_init(), for use by libopenbios and make sure all architectures are updated to use it. This is required to allow binding of C functions into Forth by libopenbios (i.e. cross architecture) rather than having to update everything in every arch/*/ initialisation file.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@siriusit.co.uk
Added: trunk/openbios-devel/include/libopenbios/openbios.h trunk/openbios-devel/libopenbios/init.c Modified: trunk/openbios-devel/arch/amd64/openbios.c trunk/openbios-devel/arch/ppc/briq/init.c trunk/openbios-devel/arch/ppc/mol/init.c trunk/openbios-devel/arch/ppc/pearpc/init.c trunk/openbios-devel/arch/ppc/qemu/init.c trunk/openbios-devel/arch/sparc32/openbios.c trunk/openbios-devel/arch/sparc64/openbios.c trunk/openbios-devel/arch/unix/unix.c trunk/openbios-devel/arch/x86/openbios.c trunk/openbios-devel/libopenbios/build.xml
Modified: trunk/openbios-devel/arch/amd64/openbios.c ============================================================================== --- trunk/openbios-devel/arch/amd64/openbios.c Fri Apr 2 12:28:48 2010 (r724) +++ trunk/openbios-devel/arch/amd64/openbios.c Fri Apr 2 13:41:35 2010 (r725) @@ -7,6 +7,7 @@ */
#include "config.h" +#include "libopenbios/openbios.h" #include "libopenbios/bindings.h" #include "asm/types.h" #include "dict.h" @@ -38,6 +39,7 @@ { void setup_timers(void);
+ openbios_init(); modules_init(); #ifdef CONFIG_DRIVER_IDE setup_timers();
Modified: trunk/openbios-devel/arch/ppc/briq/init.c ============================================================================== --- trunk/openbios-devel/arch/ppc/briq/init.c Fri Apr 2 12:28:48 2010 (r724) +++ trunk/openbios-devel/arch/ppc/briq/init.c Fri Apr 2 13:41:35 2010 (r725) @@ -20,6 +20,7 @@ */
#include "config.h" +#include "libopenbios/openbios.h" #include "libopenbios/bindings.h" #include "arch/common/nvram.h" #include "briq/briq.h"
Modified: trunk/openbios-devel/arch/ppc/mol/init.c ============================================================================== --- trunk/openbios-devel/arch/ppc/mol/init.c Fri Apr 2 12:28:48 2010 (r724) +++ trunk/openbios-devel/arch/ppc/mol/init.c Fri Apr 2 13:41:35 2010 (r725) @@ -16,6 +16,7 @@ */
#include "config.h" +#include "libopenbios/openbios.h" #include "libopenbios/bindings.h" #include "arch/common/nvram.h" #include "mol/mol.h" @@ -86,6 +87,7 @@ devtree_init(); node_methods_init(); nvram_init("/pci/mac-io/nvram"); + openbios_init(); modules_init(); pseudodisk_init(); osiblk_init();
Modified: trunk/openbios-devel/arch/ppc/pearpc/init.c ============================================================================== --- trunk/openbios-devel/arch/ppc/pearpc/init.c Fri Apr 2 12:28:48 2010 (r724) +++ trunk/openbios-devel/arch/ppc/pearpc/init.c Fri Apr 2 13:41:35 2010 (r725) @@ -21,6 +21,7 @@ */
#include "config.h" +#include "libopenbios/openbios.h" #include "libopenbios/bindings.h" #include "arch/common/nvram.h" #include "pearpc/pearpc.h" @@ -94,6 +95,7 @@
devtree_init(); nvram_init("/pci/mac-io/nvram"); + openbios_init(); modules_init(); setup_timers(); #ifdef CONFIG_DRIVER_PCI
Modified: trunk/openbios-devel/arch/ppc/qemu/init.c ============================================================================== --- trunk/openbios-devel/arch/ppc/qemu/init.c Fri Apr 2 12:28:48 2010 (r724) +++ trunk/openbios-devel/arch/ppc/qemu/init.c Fri Apr 2 13:41:35 2010 (r725) @@ -21,6 +21,7 @@ */
#include "config.h" +#include "libopenbios/openbios.h" #include "libopenbios/bindings.h" #include "drivers/pci.h" #include "arch/common/nvram.h" @@ -490,6 +491,7 @@
ofmem_t *ofmem = ofmem_arch_get_private();
+ openbios_init(); modules_init(); setup_timers(); #ifdef CONFIG_DRIVER_PCI
Modified: trunk/openbios-devel/arch/sparc32/openbios.c ============================================================================== --- trunk/openbios-devel/arch/sparc32/openbios.c Fri Apr 2 12:28:48 2010 (r724) +++ trunk/openbios-devel/arch/sparc32/openbios.c Fri Apr 2 13:41:35 2010 (r725) @@ -7,6 +7,7 @@ */
#include "config.h" +#include "libopenbios/openbios.h" #include "libopenbios/bindings.h" #include "drivers/drivers.h" #include "asm/types.h" @@ -130,6 +131,7 @@ static void arch_init( void ) { + openbios_init(); modules_init(); ob_init_mmu(); ob_init_iommu(hwdef->iommu_base);
Modified: trunk/openbios-devel/arch/sparc64/openbios.c ============================================================================== --- trunk/openbios-devel/arch/sparc64/openbios.c Fri Apr 2 12:28:48 2010 (r724) +++ trunk/openbios-devel/arch/sparc64/openbios.c Fri Apr 2 13:41:35 2010 (r725) @@ -7,6 +7,7 @@ */
#include "config.h" +#include "libopenbios/openbios.h" #include "libopenbios/bindings.h" #include "drivers/drivers.h" #include "dict.h" @@ -470,6 +471,7 @@ static void arch_init( void ) { + openbios_init(); modules_init(); #ifdef CONFIG_DRIVER_PCI ob_pci_init();
Modified: trunk/openbios-devel/arch/unix/unix.c ============================================================================== --- trunk/openbios-devel/arch/unix/unix.c Fri Apr 2 12:28:48 2010 (r724) +++ trunk/openbios-devel/arch/unix/unix.c Fri Apr 2 13:41:35 2010 (r725) @@ -32,6 +32,7 @@ #include "kernel/stack.h" #include "arch/unix/plugins.h" #include "libopenbios/bindings.h" +#include "libopenbios/openbios.h" #include "openbios-version.h"
#include "blk.h" @@ -358,6 +359,7 @@ static void arch_init( void ) { + openbios_init(); modules_init(); if(diskemu!=-1) blk_init();
Modified: trunk/openbios-devel/arch/x86/openbios.c ============================================================================== --- trunk/openbios-devel/arch/x86/openbios.c Fri Apr 2 12:28:48 2010 (r724) +++ trunk/openbios-devel/arch/x86/openbios.c Fri Apr 2 13:41:35 2010 (r725) @@ -7,6 +7,7 @@ */
#include "config.h" +#include "libopenbios/openbios.h" #include "libopenbios/bindings.h" #include "asm/types.h" #include "dict.h" @@ -50,6 +51,7 @@ { void setup_timers(void);
+ openbios_init(); modules_init(); #ifdef CONFIG_DRIVER_PCI arch = &default_pci_host;
Added: trunk/openbios-devel/include/libopenbios/openbios.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/openbios-devel/include/libopenbios/openbios.h Fri Apr 2 13:41:35 2010 (r725) @@ -0,0 +1,22 @@ +/* + * Creation Date: <2010/04/02 12:00:00 mcayland> + * Time-stamp: <2010/04/02 12:00:00 mcayland> + * + * <openbios.h> + * + * General OpenBIOS initialization + * + * Copyright (C) 2010 Mark Cave-Ayland (mark.cave-ayland@siriusit.co.uk) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 + * + */ + +#ifndef _H_LIBOPENBIOS +#define _H_LIBOPENBIOS + +extern void openbios_init( void ); + +#endif /* _H_LIBOPENBIOS */
Modified: trunk/openbios-devel/libopenbios/build.xml ============================================================================== --- trunk/openbios-devel/libopenbios/build.xml Fri Apr 2 12:28:48 2010 (r724) +++ trunk/openbios-devel/libopenbios/build.xml Fri Apr 2 13:41:35 2010 (r725) @@ -12,6 +12,7 @@ <object source="font_8x16.c" condition="FONT_8X16"/> <object source="fcode_load.c" condition="LOADER_FCODE"/> <object source="forth_load.c" condition="LOADER_FORTH"/> + <object source="init.c"/> <object source="ipchecksum.c"/> <object source="linuxbios_info.c" condition="LINUXBIOS"/> <object source="ofmem_common.c" condition="OFMEM"/>
Added: trunk/openbios-devel/libopenbios/init.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/openbios-devel/libopenbios/init.c Fri Apr 2 13:41:35 2010 (r725) @@ -0,0 +1,24 @@ +/* + * Creation Date: <2010/04/02 12:00:00 mcayland> + * Time-stamp: <2010/04/02 12:00:00 mcayland> + * + * <init.c> + * + * OpenBIOS intialization + * + * Copyright (C) 2010 Mark Cave-Ayland (mark.cave-ayland@siriusit.co.uk) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 + * + */ + +#include "config.h" +#include "libopenbios/openbios.h" + +void +openbios_init( void ) +{ + // TODO +}