On 07/10/07 04:52 +0200, Stefan Reinauer wrote:
> Ok, here's my latest patch that makes initram callbacks to stage0 work
> in v3. It's not all that pretty, but it is the least ugly thing I could
> find.
> 
> Stefan
> 
> -- 
> coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
>       Tel.: +49 761 7668825 • Fax: +49 761 7664613
> Email: [EMAIL PROTECTED]  • http://www.coresystems.de/
> Registergericht: Amtsgericht Freiburg • HRB 7656
> Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866

> This patch against LinuxBIOSv3 enables calls from initram (freely located XIP
> code) to stage0 (fixed location code) by forcing gcc to create an absolute 
> call
> instruction to stage0. 
> 
> Signed-off-by: Stefan Reinauer <[EMAIL PROTECTED]>
> 
> Index: include/console.h
> ===================================================================
> --- include/console.h (revision 503)
> +++ include/console.h (working copy)
> @@ -46,7 +46,13 @@
>  };
>  
>  // 
> +#ifndef XIP

I really don't like the idea of singling out XIP segements.  I vote we
changed this to SHARED, and do this for all segments, regardless of where
they live.  The code impact should be minimal.

>  int printk(int msg_level, const char *fmt, ...) 
>       __attribute__((format (printf, 2, 3)));
> +#else
> +int stage0printk(int msg_level, const char *fmt, ...) 
> +     __attribute__((format (printf, 2, 3)));
> +int (*printk)(int msg_level, const char *fmt, ...) = stage0printk;
> +#endif

There has got to be a way that we can turn this into a general
purpose macro to make it easy for developers to mark new functions
as shared without understanding whats happening above

> Index: arch/x86/ldscript.ld
> ===================================================================
> --- arch/x86/ldscript.ld      (revision 503)
> +++ arch/x86/ldscript.ld      (working copy)
> @@ -33,10 +33,13 @@
>       .stage0_1 . : {
>               _stage0_1 = .;
>               *(.text);
> +             *(.text.*)
> +             *(.rodata)
> +             *(.rodata.*)
> +             *(.got)
> +             *(.got.*)

How much size does the GOT add?

Jordan
-- 
Jordan Crouse
Systems Software Development Engineer 
Advanced Micro Devices, Inc.



-- 
linuxbios mailing list
linuxbios@linuxbios.org
http://www.linuxbios.org/mailman/listinfo/linuxbios

Reply via email to