From: Marco Gerards <mgerards@xs4all.nl>
To: The development of GRUB 2 <grub-devel@gnu.org>
Cc: "Jonathan A. Kollasch" <jakllsch@kollasch.net>
Subject: Re: [PATCH] decouple mmap parsing and implement Multiboot mmap in the loader
Date: Wed, 13 Aug 2008 19:52:59 +0200 [thread overview]
Message-ID: <87skt8245g.fsf@xs4all.nl> (raw)
In-Reply-To: <20080812234430.GA12880@thorin> (Robert Millan's message of "Wed, 13 Aug 2008 01:44:30 +0200")
Hi,
Robert Millan <rmh@aybabtu.com> writes:
> And here we go *AGAIN*, this time not forgetting to include all files in the
> patch.
[...]
> Index: include/grub/i386/pc/init.h
> ===================================================================
> --- include/grub/i386/pc/init.h (revision 1802)
> +++ include/grub/i386/pc/init.h (working copy)
> @@ -1,6 +1,6 @@
> /*
> * GRUB -- GRand Unified Bootloader
> - * Copyright (C) 2002,2004,2005,2007 Free Software Foundation, Inc.
> + * Copyright (C) 2002,2004,2005,2007,2008 Free Software Foundation, Inc.
> *
> * GRUB is free software: you can redistribute it and/or modify
> * it under the terms of the GNU General Public License as published by
> @@ -21,6 +21,8 @@
>
> #include <grub/types.h>
> #include <grub/symbol.h>
> +#include <grub/multiboot.h> /* For struct grub_mmap_entry, which is also
> + needed by Multiboot. */
Isn't it better to split the header file? This seems like a hack.
> /* Get the memory size in KB. If EXTENDED is zero, return conventional
> memory, otherwise return extended memory. */
> @@ -30,19 +32,18 @@
> in 1KB parts, and upper 16 bits are above 16MB in 64KB parts. */
> grub_uint32_t grub_get_eisa_mmap (void);
>
> -struct grub_machine_mmap_entry
> -{
> - grub_uint32_t size;
> - grub_uint64_t addr;
> - grub_uint64_t len;
> - grub_uint32_t type;
> -} __attribute__((packed));
> +/* Multiboot mmaps have been defined to match with the E820 definition. */
> +#define GRUB_MACHINE_MEMORY_AVAILABLE GRUB_MMAP_MEMORY_AVAILABLE
> +#define GRUB_MACHINE_MEMORY_RESERVED GRUB_MMAP_MEMORY_RESERVED
>
> /* Get a memory map entry. Return next continuation value. Zero means
> the end. */
> -grub_uint32_t EXPORT_FUNC(grub_get_mmap_entry) (struct grub_machine_mmap_entry *entry,
> +grub_uint32_t EXPORT_FUNC(grub_get_mmap_entry) (struct grub_mmap_entry *entry,
> grub_uint32_t cont);
>
> +void EXPORT_FUNC(grub_mmap_iterate)
> + (int (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t));
> +
> /* Turn on/off Gate A20. */
> void grub_gate_a20 (int on);
>
> Index: include/grub/i386/coreboot/memory.h
> ===================================================================
> --- include/grub/i386/coreboot/memory.h (revision 1802)
> +++ include/grub/i386/coreboot/memory.h (working copy)
> @@ -25,7 +25,6 @@
>
> #ifndef ASM_FILE
> #include <grub/types.h>
> -#include <grub/err.h>
> #endif
>
> #define GRUB_MEMORY_MACHINE_LOWER_USABLE 0x9fc00 /* 640 kiB - 1 kiB */
> @@ -55,13 +54,13 @@
> {
> grub_uint64_t addr;
> grub_uint64_t size;
> -#define GRUB_LINUXBIOS_MEMORY_AVAILABLE 1
> +#define GRUB_MACHINE_MEMORY_AVAILABLE 1
> grub_uint32_t type;
> };
> typedef struct grub_linuxbios_mem_region *mem_region_t;
>
> -grub_err_t EXPORT_FUNC(grub_available_iterate)
> - (int (*hook) (mem_region_t));
> +void EXPORT_FUNC(grub_mmap_iterate)
> + (int (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t));
>
> #endif
>
> Index: include/grub/multiboot.h
> ===================================================================
> --- include/grub/multiboot.h (revision 1802)
> +++ include/grub/multiboot.h (working copy)
> @@ -1,7 +1,7 @@
> /* multiboot.h - multiboot header file with grub definitions. */
> /*
> * GRUB -- GRand Unified Bootloader
> - * Copyright (C) 2003,2007 Free Software Foundation, Inc.
> + * Copyright (C) 2003,2007,2008 Free Software Foundation, Inc.
> *
> * GRUB is free software: you can redistribute it and/or modify
> * it under the terms of the GNU General Public License as published by
> @@ -101,6 +101,16 @@
> grub_uint16_t vbe_interface_len;
> };
>
> +struct grub_mmap_entry
> +{
> + grub_uint32_t size;
> + grub_uint64_t addr;
> + grub_uint64_t len;
> +#define GRUB_MMAP_MEMORY_AVAILABLE 1
> +#define GRUB_MMAP_MEMORY_RESERVED 2
> + grub_uint32_t type;
> +} __attribute__((packed));
> +
> struct grub_mod_list
> {
> /* the memory used goes from bytes 'mod_start' to 'mod_end-1' inclusive */
> Index: loader/i386/pc/multiboot.c
> ===================================================================
> --- loader/i386/pc/multiboot.c (revision 1802)
> +++ loader/i386/pc/multiboot.c (working copy)
> @@ -78,14 +78,60 @@
> grub_free ((void *) mbi->cmdline);
> grub_free (mbi);
> }
> -
> -
> +
Hm? :-)
--
Marco
next prev parent reply other threads:[~2008-08-13 17:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-11 15:22 [PATCH] decouple mmap parsing by using grub_available_iterate() Robert Millan
2008-08-11 15:39 ` Vesa Jääskeläinen
2008-08-11 21:24 ` Robert Millan
2008-08-11 22:07 ` Robert Millan
2008-08-12 13:25 ` [PATCH] decouple mmap parsing and implement Multiboot mmap in the loader Robert Millan
2008-08-12 16:29 ` Robert Millan
2008-08-12 22:38 ` Robert Millan
2008-08-12 23:44 ` Robert Millan
2008-08-13 17:52 ` Marco Gerards [this message]
2008-08-13 19:51 ` Robert Millan
2008-08-16 14:50 ` Marco Gerards
2008-08-17 16:31 ` Robert Millan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87skt8245g.fsf@xs4all.nl \
--to=mgerards@xs4all.nl \
--cc=grub-devel@gnu.org \
--cc=jakllsch@kollasch.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.