Use LBIO on coreboot.
* conf/i386-coreboot.rmk (kernel_img_SOURCES): Change kern/i386/multiboot_mmap.c to kern/i386/coreboot/mmap.c. * include/grub/i386/coreboot/memory.h (GRUB_LINUXBIOS_MEMBER_LINK): New declaration. * kern/i386/coreboot/init.c (grub_machine_init): Don't call grub_machine_mmap_init on coreboot. * kern/i386/coreboot/mmap.c (grub_linuxbios_table_iterate): Handle GRUB_LINUXBIOS_MEMBER_LINK. (grub_machine_mmap_iterate): Fix declaration. * kern/i386/coreboot/startup.S: Don't save mbi location on coreboot.
This commit is contained in:
parent
7210dca942
commit
7819a4562f
6 changed files with 36 additions and 6 deletions
15
ChangeLog
15
ChangeLog
|
@ -1,3 +1,18 @@
|
|||
2010-05-01 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Use LBIO on coreboot.
|
||||
|
||||
* conf/i386-coreboot.rmk (kernel_img_SOURCES): Change
|
||||
kern/i386/multiboot_mmap.c to kern/i386/coreboot/mmap.c.
|
||||
* include/grub/i386/coreboot/memory.h (GRUB_LINUXBIOS_MEMBER_LINK):
|
||||
New declaration.
|
||||
* kern/i386/coreboot/init.c (grub_machine_init): Don't call
|
||||
grub_machine_mmap_init on coreboot.
|
||||
* kern/i386/coreboot/mmap.c (grub_linuxbios_table_iterate): Handle
|
||||
GRUB_LINUXBIOS_MEMBER_LINK.
|
||||
(grub_machine_mmap_iterate): Fix declaration.
|
||||
* kern/i386/coreboot/startup.S: Don't save mbi location on coreboot.
|
||||
|
||||
2010-05-01 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Split coreboot and multiboot ports.
|
||||
|
|
|
@ -10,7 +10,7 @@ pkglib_PROGRAMS += kernel.img
|
|||
kernel_img_SOURCES = kern/i386/coreboot/startup.S \
|
||||
kern/i386/misc.S \
|
||||
kern/i386/coreboot/init.c \
|
||||
kern/i386/multiboot_mmap.c \
|
||||
kern/i386/coreboot/mmap.c \
|
||||
kern/i386/halt.c \
|
||||
kern/main.c kern/device.c \
|
||||
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
|
||||
|
|
|
@ -44,8 +44,9 @@ typedef struct grub_linuxbios_table_header *grub_linuxbios_table_header_t;
|
|||
|
||||
struct grub_linuxbios_table_item
|
||||
{
|
||||
#define GRUB_LINUXBIOS_MEMBER_UNUSED 0
|
||||
#define GRUB_LINUXBIOS_MEMBER_MEMORY 1
|
||||
#define GRUB_LINUXBIOS_MEMBER_UNUSED 0x00
|
||||
#define GRUB_LINUXBIOS_MEMBER_MEMORY 0x01
|
||||
#define GRUB_LINUXBIOS_MEMBER_LINK 0x11
|
||||
grub_uint32_t tag;
|
||||
grub_uint32_t size;
|
||||
};
|
||||
|
|
|
@ -117,7 +117,9 @@ grub_machine_init (void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef GRUB_MACHINE_MULTIBOOT
|
||||
grub_machine_mmap_init ();
|
||||
#endif
|
||||
grub_machine_mmap_iterate (heap_init);
|
||||
|
||||
grub_tsc_init ();
|
||||
|
|
|
@ -57,13 +57,23 @@ signature_found:
|
|||
(long) table_header->size);
|
||||
for (; table_item->size;
|
||||
table_item = (grub_linuxbios_table_item_t) ((long) table_item + (long) table_item->size))
|
||||
if (hook (table_item))
|
||||
return 1;
|
||||
{
|
||||
if (table_item->tag == GRUB_LINUXBIOS_MEMBER_LINK
|
||||
&& check_signature ((grub_linuxbios_table_header_t) (grub_addr_t)
|
||||
*(grub_uint64_t *) (table_item + 1)))
|
||||
{
|
||||
table_header = (grub_linuxbios_table_header_t) (grub_addr_t)
|
||||
*(grub_uint64_t *) (table_item + 1);
|
||||
goto signature_found;
|
||||
}
|
||||
if (hook (table_item))
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
grub_err_t
|
||||
grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t))
|
||||
{
|
||||
mem_region_t mem_region;
|
||||
|
|
|
@ -66,10 +66,12 @@ multiboot_header:
|
|||
.long -0x1BADB002 - MULTIBOOT_MEMORY_INFO
|
||||
|
||||
codestart:
|
||||
#ifdef GRUB_MACHINE_MULTIBOOT
|
||||
cmpl $MULTIBOOT_BOOTLOADER_MAGIC, %eax
|
||||
jne 0f
|
||||
movl %ebx, EXT_C(startup_multiboot_info)
|
||||
0:
|
||||
#endif
|
||||
|
||||
/* initialize the stack */
|
||||
movl $GRUB_MEMORY_MACHINE_PROT_STACK, %esp
|
||||
|
|
Loading…
Reference in a new issue