Ignore:
File:
1 edited

Legend:

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

    r26f407e9 rd75628da  
    3434
    3535#include <arch.h>
     36#include <arch/drivers/ski.h>
     37#include <arch/drivers/it.h>
     38#include <arch/interrupt.h>
     39#include <arch/barrier.h>
     40#include <arch/asm.h>
     41#include <arch/register.h>
    3642#include <typedefs.h>
    37 #include <errno.h>
     43#include <arch/context.h>
     44#include <arch/stack.h>
     45#include <arch/mm/page.h>
    3846#include <interrupt.h>
     47#include <mm/as.h>
     48#include <config.h>
    3949#include <macros.h>
    40 #include <str.h>
    4150#include <userspace.h>
    4251#include <console/console.h>
     52#include <abi/proc/uarg.h>
    4353#include <syscall/syscall.h>
    44 #include <sysinfo/sysinfo.h>
    45 #include <arch/drivers/it.h>
    46 #include <arch/drivers/kbd.h>
    47 #include <arch/legacyio.h>
     54#include <ddi/irq.h>
     55#include <arch/bootinfo.h>
     56#include <genarch/drivers/legacy/ia32/io.h>
    4857#include <genarch/drivers/ega/ega.h>
     58#include <genarch/kbrd/kbrd.h>
     59#include <genarch/srln/srln.h>
    4960#include <genarch/drivers/i8042/i8042.h>
    5061#include <genarch/drivers/ns16550/ns16550.h>
    51 #include <genarch/drivers/legacy/ia32/io.h>
    52 #include <genarch/kbrd/kbrd.h>
    53 #include <genarch/srln/srln.h>
    54 #include <mm/page.h>
    55 #include <mm/km.h>
    56 
    57 #ifdef MACHINE_ski
    58 #include <arch/drivers/ski.h>
    59 #endif
     62#include <arch/drivers/kbd.h>
     63#include <smp/smp.h>
     64#include <smp/ipi.h>
     65#include <arch/atomic.h>
     66#include <panic.h>
     67#include <print.h>
     68#include <sysinfo/sysinfo.h>
     69#include <str.h>
    6070
    6171/* NS16550 as a COM 1 */
     
    6575
    6676static uint64_t iosapic_base = 0xfec00000;
    67 uintptr_t legacyio_virt_base = 0;
    6877
    6978/** Performs ia64-specific initialization before main_bsp() is called. */
    7079void arch_pre_main(void)
    7180{
    72         init.cnt = min3(bootinfo->taskmap.cnt, TASKMAP_MAX_RECORDS,
    73             CONFIG_INIT_TASKS);
     81        init.cnt = min3(bootinfo->taskmap.cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS);
    7482        size_t i;
    75 
    7683        for (i = 0; i < init.cnt; i++) {
    77                 init.tasks[i].paddr =
    78                     (uintptr_t) bootinfo->taskmap.tasks[i].addr;
     84                init.tasks[i].addr =
     85                    ((unsigned long) bootinfo->taskmap.tasks[i].addr) |
     86                    VRN_MASK;
    7987                init.tasks[i].size = bootinfo->taskmap.tasks[i].size;
    8088                str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN,
     
    8997static void iosapic_init(void)
    9098{
    91         uintptr_t IOSAPIC = km_map(iosapic_base, PAGE_SIZE,
    92             PAGE_WRITE | PAGE_NOT_CACHEABLE);
     99        uint64_t IOSAPIC = PA2KA((sysarg_t)(iosapic_base)) | FW_OFFSET;
    93100        int i;
    94101       
     
    117124{
    118125        if (config.cpu_active == 1) {
    119                 /* Map the page with legacy I/O. */
    120                 legacyio_virt_base = km_map(LEGACYIO_PHYS_BASE, LEGACYIO_SIZE,
    121                     PAGE_WRITE | PAGE_NOT_CACHEABLE);
    122 
    123126                iosapic_init();
    124127                irq_init(INR_COUNT, INR_COUNT);
     
    144147#endif
    145148#ifdef MACHINE_i460GX
    146         platform = "pc";
     149        platform = "i460GX";
    147150#endif
    148151        sysinfo_set_item_data("platform", NULL, (void *) platform,
     
    188191        sysinfo_set_item_val("kbd.address.physical", NULL,
    189192            (uintptr_t) NS16550_BASE);
     193        sysinfo_set_item_val("kbd.address.kernel", NULL,
     194            (uintptr_t) NS16550_BASE);
    190195#endif
    191196       
    192197#ifdef CONFIG_I8042
    193         i8042_instance_t *i8042_instance = i8042_init((i8042_t *) I8042_BASE,
    194             IRQ_KBD);
     198        i8042_instance_t *i8042_instance = i8042_init((i8042_t *) I8042_BASE, IRQ_KBD);
    195199        if (i8042_instance) {
    196200                kbrd_instance_t *kbrd_instance = kbrd_init();
     
    201205                }
    202206        }
    203 #endif
    204        
     207       
     208        sysinfo_set_item_val("i8042", NULL, true);
     209        sysinfo_set_item_val("i8042.inr_a", NULL, IRQ_KBD);
     210        sysinfo_set_item_val("i8042.inr_b", NULL, IRQ_MOUSE);
     211        sysinfo_set_item_val("i8042.address.physical", NULL,
     212            (uintptr_t) I8042_BASE);
     213        sysinfo_set_item_val("i8042.address.kernel", NULL,
     214            (uintptr_t) I8042_BASE);
     215#endif
     216
     217        sysinfo_set_item_val("netif.ne2000.inr", NULL, IRQ_NE2000);
     218
    205219        sysinfo_set_item_val("ia64_iospace", NULL, true);
    206220        sysinfo_set_item_val("ia64_iospace.address", NULL, true);
    207         sysinfo_set_item_val("ia64_iospace.address.virtual", NULL, LEGACYIO_USER_BASE);
     221        sysinfo_set_item_val("ia64_iospace.address.virtual", NULL, IO_OFFSET);
    208222}
    209223
     
    248262 * We use r13 (a.k.a. tp) for this purpose.
    249263 */
    250 sysarg_t sys_tls_set(uintptr_t addr)
    251 {
    252         return EOK;
     264sysarg_t sys_tls_set(sysarg_t addr)
     265{
     266        return 0;
    253267}
    254268
     
    256270{
    257271        pio_write_8((ioport8_t *)0x64, 0xfe);
    258         while (1);
     272        while (1)
     273                ;
    259274}
    260275
Note: See TracChangeset for help on using the changeset viewer.