[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XenPPC] Re: [Xen-devel] fix vga.c compilation



On Wed, 2006-08-16 at 11:49 +0100, Keir Fraser wrote:
> @@ -159,12 +160,8 @@
>   * into a single 16-bit quantity */
>  #define VGA_OUT16VAL(v, r)       (((v) << 8) | (r))
>  
> -#if defined(__i386__) || defined(__x86_64__)
> -# define vgabase 0
> -# define VGA_OUTW_WRITE
> -# define vga_readb(x) (*(x))
> -# define vga_writeb(x,y) (*(y) = (x))
> -#endif
> +#define vgabase 0         /* use in/out port-access macros  */
> +#define VGA_OUTW_WRITE    /* can use outw instead of 2xoutb */

When would you redefine vgabase?

> diff -r ec03b24a2d83 xen/arch/powerpc/vga.c
> --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
> +++ b/xen/arch/powerpc/vga.c    Wed Aug 16 11:44:31 2006 +0100
> @@ -0,0 +1,21 @@
> +#include <xen/types.h>
> +#include <xen/font.h>
> +#include <xen/vga.h>
> +
> +/* Temporary dummy versions until the VGA driver is fixed. */
> +
> +void *setup_vga(void)
> +{
> +    return NULL;
> +}
> +
> +void vga_cursor_off(void)
> +{
> +}
> +
> +int vga_load_font(const struct font_desc *desc, unsigned rows)
> +{
> +    return -1;
> +}
> +
> +const struct font_desc font_vga_8x8, font_vga_8x14, font_vga_8x16;

I think there could be a cleaner separation between console.c and vga.c,
and that would avoid needing to redefine these symbols. For example,
right now cls(), init_vga(), and others still live in console.c, most of
them manually testing vgacon_enabled.

What would be better is a system where console drivers (i.e. serial and
vga) register themselves at boot time, so console.c putchar() becomes:

void __putstr(char *str)
{
        struct console_driver *d;
        for (d = console_list; d != NULL; d = d->next)
                d->putstr(str);
}

Then all that serial-specific and vga-specific code can be removed from
console.c, and that would make disabling VGA at compile time much more
clean.

-- 
Hollis Blanchard
IBM Linux Technology Center


_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.