Ignore:
Timestamp:
2009-03-03T21:17:45Z (15 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
06f96234
Parents:
c22e964
Message:

Move multiboot parsing to genarch/*/multiboot and adapt it for use with both ia32 and amd64. Multiboot info parsing now supported on amd64, too.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • kernel/genarch/include/multiboot/multiboot.h

    rc22e964 r5d8d71e  
    11/*
    2  * Copyright (c) 2005 Martin Decky
     2 * Copyright (c) 2009 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup ia32
     29/** @addtogroup genarch
    3030 * @{
    3131 */
     
    3333 */
    3434
    35 #ifndef KERN_ia32_MULTIBOOT_H__
    36 #define KERN_ia32_MULTIBOOT_H_
     35#ifndef KERN_MULTIBOOT_H_
     36#define KERN_MULTIBOOT_H_
    3737
    3838#include <arch/types.h>
    3939#include <arch/boot/memmap.h>
    4040
     41/** Multiboot 32-bit address. */
     42typedef uint32_t mbaddr_t;
     43
    4144/** Multiboot mod structure */
    4245typedef struct {
    43         uintptr_t start;
    44         uintptr_t end;
    45         char *string;
     46        mbaddr_t start;
     47        mbaddr_t end;
     48        mbaddr_t string;
    4649        uint32_t reserved;
    47 } __attribute__ ((packed)) mb_mod_t;
     50} __attribute__ ((packed)) multiboot_mod_t;
    4851
    4952/** Multiboot mmap structure */
     
    5154        uint32_t size;
    5255        e820memmap_t mm_info;
    53 } __attribute__ ((packed)) mb_mmap_t;
     56} __attribute__ ((packed)) multiboot_mmap_t;
    5457
    5558/** Multiboot information structure */
    5659typedef struct {
    5760        uint32_t flags;
    58         uintptr_t mem_lower;
    59         uintptr_t mem_upper;
     61        uint32_t mem_lower;
     62        uint32_t mem_upper;
    6063       
    6164        uint32_t boot_device;
    62         char *cmdline;
     65        uint32_t cmdline;
    6366       
    6467        uint32_t mods_count;
    65         mb_mod_t *mods_addr;
     68        mbaddr_t mods_addr;
    6669       
    6770        uint32_t syms[4];
    6871       
    6972        uint32_t mmap_length;
    70         mb_mmap_t *mmap_addr;
     73        mbaddr_t mmap_addr;
    7174       
    7275        /* ... */
    73 } __attribute__ ((packed)) mb_info_t;
     76} __attribute__ ((packed)) multiboot_info_t;
    7477
    75 enum mb_info_flags {
     78enum multiboot_info_flags {
    7679        MBINFO_FLAGS_MEM     = 0x01,
    7780        MBINFO_FLAGS_BOOT    = 0x02,
     
    8588};
    8689
     90#define MULTIBOOT_LOADER_MAGIC  0x2BADB002
     91
     92/** Convert 32-bit multiboot address to a pointer. */
     93#define MULTIBOOT_PTR(mba) ((void *)(uintptr_t) (mba))
     94
     95extern void multiboot_info_parse(uint32_t, const multiboot_info_t *);
     96
    8797#endif
    8898
Note: See TracChangeset for help on using the changeset viewer.