Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/amd64.c

    r88dfee7 rf902d36  
    3434
    3535#include <arch.h>
     36
    3637#include <typedefs.h>
    37 #include <errno.h>
    38 #include <memstr.h>
    39 #include <interrupt.h>
    40 #include <console/console.h>
    41 #include <syscall/syscall.h>
    42 #include <sysinfo/sysinfo.h>
    43 #include <arch/bios/bios.h>
    44 #include <arch/boot/boot.h>
    45 #include <arch/debugger.h>
     38
     39#include <config.h>
     40
     41#include <proc/thread.h>
     42#include <genarch/multiboot/multiboot.h>
     43#include <genarch/drivers/legacy/ia32/io.h>
     44#include <genarch/drivers/ega/ega.h>
     45#include <arch/drivers/vesa.h>
     46#include <genarch/drivers/i8042/i8042.h>
     47#include <genarch/kbrd/kbrd.h>
    4648#include <arch/drivers/i8254.h>
    4749#include <arch/drivers/i8259.h>
     50#include <arch/boot/boot.h>
     51
     52#ifdef CONFIG_SMP
     53#include <arch/smp/apic.h>
     54#endif
     55
     56#include <arch/bios/bios.h>
     57#include <arch/cpu.h>
     58#include <print.h>
     59#include <arch/cpuid.h>
     60#include <genarch/acpi/acpi.h>
     61#include <panic.h>
     62#include <interrupt.h>
    4863#include <arch/syscall.h>
    49 #include <genarch/acpi/acpi.h>
    50 #include <genarch/drivers/ega/ega.h>
    51 #include <genarch/drivers/i8042/i8042.h>
    52 #include <genarch/drivers/legacy/ia32/io.h>
    53 #include <genarch/fb/bfb.h>
    54 #include <genarch/kbrd/kbrd.h>
    55 #include <genarch/multiboot/multiboot.h>
    56 #include <genarch/multiboot/multiboot2.h>
    57 
    58 #ifdef CONFIG_SMP
    59 #include <arch/smp/apic.h>
    60 #endif
     64#include <arch/debugger.h>
     65#include <syscall/syscall.h>
     66#include <console/console.h>
     67#include <ddi/irq.h>
     68#include <sysinfo/sysinfo.h>
     69#include <memstr.h>
    6170
    6271/** Disable I/O on non-privileged levels
     
    92101/** Perform amd64-specific initialization before main_bsp() is called.
    93102 *
    94  * @param signature Multiboot signature.
    95  * @param info      Multiboot information structure.
    96  *
    97  */
    98 void arch_pre_main(uint32_t signature, void *info)
     103 * @param signature Should contain the multiboot signature.
     104 * @param mi        Pointer to the multiboot information structure.
     105 */
     106void arch_pre_main(uint32_t signature, const multiboot_info_t *mi)
    99107{
    100108        /* Parse multiboot information obtained from the bootloader. */
    101         multiboot_info_parse(signature, (multiboot_info_t *) info);
    102         multiboot2_info_parse(signature, (multiboot2_info_t *) info);
     109        multiboot_info_parse(signature, mi);
    103110       
    104111#ifdef CONFIG_SMP
     
    146153               
    147154#if (defined(CONFIG_FB) || defined(CONFIG_EGA))
    148                 bool bfb = false;
     155                bool vesa = false;
    149156#endif
    150157               
    151158#ifdef CONFIG_FB
    152                 bfb = bfb_init();
     159                vesa = vesa_init();
    153160#endif
    154161               
    155162#ifdef CONFIG_EGA
    156                 if (!bfb) {
     163                if (!vesa) {
    157164                        outdev_t *egadev = ega_init(EGA_BASE, EGA_VIDEORAM);
    158165                        if (egadev)
     
    214221                }
    215222        }
     223       
     224        /*
     225         * This is the necessary evil until the userspace driver is entirely
     226         * self-sufficient.
     227         */
     228        sysinfo_set_item_val("i8042", NULL, true);
     229        sysinfo_set_item_val("i8042.inr_a", NULL, IRQ_KBD);
     230        sysinfo_set_item_val("i8042.inr_b", NULL, IRQ_MOUSE);
     231        sysinfo_set_item_val("i8042.address.physical", NULL,
     232            (uintptr_t) I8042_BASE);
     233        sysinfo_set_item_val("i8042.address.kernel", NULL,
     234            (uintptr_t) I8042_BASE);
    216235#endif
    217236       
    218237        if (irqs_info != NULL)
    219238                sysinfo_set_item_val(irqs_info, NULL, true);
     239       
     240        sysinfo_set_item_val("netif.ne2000.inr", NULL, IRQ_NE2000);
    220241}
    221242
     
    240261 * we need not to go to CPL0 to read it.
    241262 */
    242 sysarg_t sys_tls_set(uintptr_t addr)
     263sysarg_t sys_tls_set(sysarg_t addr)
    243264{
    244265        THREAD->arch.tls = addr;
    245266        write_msr(AMD_MSR_FS, addr);
    246267       
    247         return EOK;
     268        return 0;
    248269}
    249270
Note: See TracChangeset for help on using the changeset viewer.