ia64/xen-unstable

changeset 15704:976db28bcc43

[POWERPC][XEN] Commit missing multiboot files.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Hollis Blanchard <hollisb@us.ibm.com>
date Thu Aug 02 09:50:55 2007 -0500 (2007-08-02)
parents 553f64e4f6ef
children 04fb85a46dc5
files xen/arch/powerpc/multiboot2.c xen/include/asm-powerpc/boot.h xen/include/xen/multiboot2.h
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xen/arch/powerpc/multiboot2.c	Thu Aug 02 09:50:55 2007 -0500
     1.3 @@ -0,0 +1,67 @@
     1.4 +/*
     1.5 + * This program is free software; you can redistribute it and/or
     1.6 + * modify it under the terms of the GNU General Public License as
     1.7 + * published by the Free Software Foundation; either version 2 of the
     1.8 + * License, or (at your option) any later version.
     1.9 + *
    1.10 + * This program is distributed in the hope that it will be useful,
    1.11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.13 + * GNU General Public License for more details.
    1.14 + *
    1.15 + * You should have received a copy of the GNU General Public License
    1.16 + * along with this program; if not, write to the Free Software
    1.17 + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    1.18 + *
    1.19 + * Copyright IBM Corp. 2006, 2007
    1.20 + *
    1.21 + * Authors: Hollis Blanchard <hollisb@us.ibm.com>
    1.22 + */
    1.23 +
    1.24 +#include <xen/config.h>
    1.25 +#include <xen/lib.h>
    1.26 +#include <xen/multiboot2.h>
    1.27 +#include <asm/boot.h>
    1.28 +#include <asm/init.h>
    1.29 +
    1.30 +static struct mb2_tag_module *mb2_tag_mod_find(struct mb2_tag_header *tags,
    1.31 +                                                const char *type)
    1.32 +{
    1.33 +    struct mb2_tag_header *tag;
    1.34 +
    1.35 +    for_each_tag(tag, tags) {
    1.36 +        if (tag->key == MB2_TAG_MODULE) {
    1.37 +            struct mb2_tag_module *mod = (struct mb2_tag_module *)tag;
    1.38 +            if (!strcmp((char *)mod->type, type))
    1.39 +                return mod;
    1.40 +        }
    1.41 +    }
    1.42 +    return NULL;
    1.43 +}
    1.44 +
    1.45 +void parse_multiboot(ulong tags_addr)
    1.46 +{
    1.47 +    struct mb2_tag_header *tags = (struct mb2_tag_header *)tags_addr;
    1.48 +    struct mb2_tag_module *mod;
    1.49 +
    1.50 +    if (tags->key != MB2_TAG_START)
    1.51 +        return;
    1.52 +
    1.53 +    mod = mb2_tag_mod_find(tags, "kernel");
    1.54 +    if (mod) {
    1.55 +        xen_cmdline = (char *)mod->cmdline;
    1.56 +    }
    1.57 +
    1.58 +    mod = mb2_tag_mod_find(tags, "dom0");
    1.59 +    if (mod) {
    1.60 +        dom0_addr = mod->addr;
    1.61 +        dom0_len = mod->size;
    1.62 +        dom0_cmdline = (char *)mod->cmdline;
    1.63 +    }
    1.64 +
    1.65 +    mod = mb2_tag_mod_find(tags, "initrd");
    1.66 +    if (mod) {
    1.67 +        initrd_start = mod->addr;
    1.68 +        initrd_len = mod->size;
    1.69 +    }
    1.70 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/xen/include/asm-powerpc/boot.h	Thu Aug 02 09:50:55 2007 -0500
     2.3 @@ -0,0 +1,46 @@
     2.4 +/*
     2.5 + * This program is free software; you can redistribute it and/or modify
     2.6 + * it under the terms of the GNU General Public License as published by
     2.7 + * the Free Software Foundation; either version 2 of the License, or
     2.8 + * (at your option) any later version.
     2.9 + *
    2.10 + * This program is distributed in the hope that it will be useful,
    2.11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    2.13 + * GNU General Public License for more details.
    2.14 + *
    2.15 + * You should have received a copy of the GNU General Public License
    2.16 + * along with this program; if not, write to the Free Software
    2.17 + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    2.18 + *
    2.19 + * Copyright IBM Corp. 2007
    2.20 + *
    2.21 + * Authors: Hollis Blanchard <hollisb@us.ibm.com>
    2.22 + */
    2.23 +
    2.24 +#ifndef _ASM_BOOT_H
    2.25 +#define _ASM_BOOT_H
    2.26 +
    2.27 +/* a collection of interfaces used during boot. */
    2.28 +
    2.29 +extern void boot_of_init(ulong, ulong);
    2.30 +extern void *boot_of_devtree(void);
    2.31 +extern void boot_of_serial(void *);
    2.32 +extern void boot_of_finish(void);
    2.33 +extern int boot_of_mem_avail(int pos, ulong *startpage, ulong *endpage);
    2.34 +
    2.35 +extern void parse_multiboot(ulong tags_addr);
    2.36 +
    2.37 +extern void memory_init(void);
    2.38 +
    2.39 +extern char *xen_cmdline;
    2.40 +extern ulong dom0_addr;
    2.41 +extern ulong dom0_len;
    2.42 +extern char *dom0_cmdline;
    2.43 +extern ulong initrd_start;
    2.44 +extern ulong initrd_len;
    2.45 +
    2.46 +/* From linker script. */
    2.47 +extern char builtin_cmdline[];
    2.48 +
    2.49 +#endif
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/xen/include/xen/multiboot2.h	Thu Aug 02 09:50:55 2007 -0500
     3.3 @@ -0,0 +1,99 @@
     3.4 +/*
     3.5 + * This program is free software; you can redistribute it and/or
     3.6 + * modify it under the terms of the GNU General Public License as
     3.7 + * published by the Free Software Foundation; either version 2 of the
     3.8 + * License, or (at your option) any later version.
     3.9 + *
    3.10 + * This program is distributed in the hope that it will be useful,
    3.11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    3.12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    3.13 + * GNU General Public License for more details.
    3.14 + *
    3.15 + * You should have received a copy of the GNU General Public License
    3.16 + * along with this program; if not, write to the Free Software
    3.17 + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    3.18 + *
    3.19 + * Copyright IBM Corp. 2006, 2007
    3.20 + *
    3.21 + * Authors: Hollis Blanchard <hollisb@us.ibm.com>
    3.22 + *          
    3.23 + */
    3.24 +
    3.25 +#ifndef _MULTIBOOT2_H_
    3.26 +#define _MULTIBOOT2_H_
    3.27 +
    3.28 +/* How many bytes from the start of the file we search for the header.  */
    3.29 +#define MB2_HEADER_SEARCH           8192
    3.30 +
    3.31 +/* The magic field should contain this.  */
    3.32 +#define MB2_HEADER_MAGIC            0xe85250d6
    3.33 +
    3.34 +/* Passed from the bootloader to the kernel.  */
    3.35 +#define MB2_BOOTLOADER_MAGIC        0x36d76289
    3.36 +
    3.37 +#include <stdint.h>
    3.38 +
    3.39 +#define for_each_tag(_tag, _tags) \
    3.40 +    for ((_tag) = (_tags); \
    3.41 +            ((_tag)->key != MB2_TAG_END && (_tag)->key != 0); \
    3.42 +            (_tag) = (void *)(_tag) + (_tag)->len)
    3.43 +
    3.44 +typedef uint32_t mb2_word;
    3.45 +
    3.46 +struct mb2_header
    3.47 +{
    3.48 +  uint32_t magic;
    3.49 +};
    3.50 +
    3.51 +struct mb2_tag_header
    3.52 +{
    3.53 +  uint32_t key;
    3.54 +  uint32_t len;
    3.55 +};
    3.56 +
    3.57 +#define MB2_TAG_START     1
    3.58 +struct mb2_tag_start
    3.59 +{
    3.60 +  struct mb2_tag_header header;
    3.61 +  mb2_word size; /* Total size of all mb2 tags. */
    3.62 +};
    3.63 +
    3.64 +#define MB2_TAG_NAME      2
    3.65 +struct mb2_tag_name
    3.66 +{
    3.67 +  struct mb2_tag_header header;
    3.68 +  char name[1];
    3.69 +};
    3.70 +
    3.71 +#define MB2_TAG_MODULE    3
    3.72 +struct mb2_tag_module
    3.73 +{
    3.74 +  struct mb2_tag_header header;
    3.75 +  mb2_word addr;
    3.76 +  mb2_word size;
    3.77 +  unsigned char type[36];
    3.78 +  unsigned char cmdline[1];
    3.79 +};
    3.80 +
    3.81 +#define MB2_TAG_MEMORY    4
    3.82 +struct mb2_tag_memory
    3.83 +{
    3.84 +  struct mb2_tag_header header;
    3.85 +  mb2_word addr;
    3.86 +  mb2_word size;
    3.87 +  mb2_word type;
    3.88 +};
    3.89 +
    3.90 +#define MB2_TAG_UNUSED    5
    3.91 +struct mb2_tag_unused
    3.92 +{
    3.93 +  struct mb2_tag_header header;
    3.94 +};
    3.95 +
    3.96 +#define MB2_TAG_END       0xffff
    3.97 +struct mb2_tag_end
    3.98 +{
    3.99 +  struct mb2_tag_header header;
   3.100 +};
   3.101 +
   3.102 +#endif