Ignore:
File:
1 edited

Legend:

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

    rd75628da r26f407e9  
    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>
    4236#include <typedefs.h>
    43 #include <arch/context.h>
    44 #include <arch/stack.h>
    45 #include <arch/mm/page.h>
     37#include <errno.h>
    4638#include <interrupt.h>
    47 #include <mm/as.h>
    48 #include <config.h>
    4939#include <macros.h>
     40#include <str.h>
    5041#include <userspace.h>
    5142#include <console/console.h>
    52 #include <abi/proc/uarg.h>
    5343#include <syscall/syscall.h>
    54 #include <ddi/irq.h>
    55 #include <arch/bootinfo.h>
     44#include <sysinfo/sysinfo.h>
     45#include <arch/drivers/it.h>
     46#include <arch/drivers/kbd.h>
     47#include <arch/legacyio.h>
     48#include <genarch/drivers/ega/ega.h>
     49#include <genarch/drivers/i8042/i8042.h>
     50#include <genarch/drivers/ns16550/ns16550.h>
    5651#include <genarch/drivers/legacy/ia32/io.h>
    57 #include <genarch/drivers/ega/ega.h>
    5852#include <genarch/kbrd/kbrd.h>
    5953#include <genarch/srln/srln.h>
    60 #include <genarch/drivers/i8042/i8042.h>
    61 #include <genarch/drivers/ns16550/ns16550.h>
    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>
     54#include <mm/page.h>
     55#include <mm/km.h>
     56
     57#ifdef MACHINE_ski
     58#include <arch/drivers/ski.h>
     59#endif
    7060
    7161/* NS16550 as a COM 1 */
     
    7565
    7666static uint64_t iosapic_base = 0xfec00000;
     67uintptr_t legacyio_virt_base = 0;
    7768
    7869/** Performs ia64-specific initialization before main_bsp() is called. */
    7970void arch_pre_main(void)
    8071{
    81         init.cnt = min3(bootinfo->taskmap.cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS);
     72        init.cnt = min3(bootinfo->taskmap.cnt, TASKMAP_MAX_RECORDS,
     73            CONFIG_INIT_TASKS);
    8274        size_t i;
     75
    8376        for (i = 0; i < init.cnt; i++) {
    84                 init.tasks[i].addr =
    85                     ((unsigned long) bootinfo->taskmap.tasks[i].addr) |
    86                     VRN_MASK;
     77                init.tasks[i].paddr =
     78                    (uintptr_t) bootinfo->taskmap.tasks[i].addr;
    8779                init.tasks[i].size = bootinfo->taskmap.tasks[i].size;
    8880                str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN,
     
    9789static void iosapic_init(void)
    9890{
    99         uint64_t IOSAPIC = PA2KA((sysarg_t)(iosapic_base)) | FW_OFFSET;
     91        uintptr_t IOSAPIC = km_map(iosapic_base, PAGE_SIZE,
     92            PAGE_WRITE | PAGE_NOT_CACHEABLE);
    10093        int i;
    10194       
     
    124117{
    125118        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
    126123                iosapic_init();
    127124                irq_init(INR_COUNT, INR_COUNT);
     
    147144#endif
    148145#ifdef MACHINE_i460GX
    149         platform = "i460GX";
     146        platform = "pc";
    150147#endif
    151148        sysinfo_set_item_data("platform", NULL, (void *) platform,
     
    191188        sysinfo_set_item_val("kbd.address.physical", NULL,
    192189            (uintptr_t) NS16550_BASE);
    193         sysinfo_set_item_val("kbd.address.kernel", NULL,
    194             (uintptr_t) NS16550_BASE);
    195190#endif
    196191       
    197192#ifdef CONFIG_I8042
    198         i8042_instance_t *i8042_instance = i8042_init((i8042_t *) I8042_BASE, IRQ_KBD);
     193        i8042_instance_t *i8042_instance = i8042_init((i8042_t *) I8042_BASE,
     194            IRQ_KBD);
    199195        if (i8042_instance) {
    200196                kbrd_instance_t *kbrd_instance = kbrd_init();
     
    205201                }
    206202        }
    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 
     203#endif
     204       
    219205        sysinfo_set_item_val("ia64_iospace", NULL, true);
    220206        sysinfo_set_item_val("ia64_iospace.address", NULL, true);
    221         sysinfo_set_item_val("ia64_iospace.address.virtual", NULL, IO_OFFSET);
     207        sysinfo_set_item_val("ia64_iospace.address.virtual", NULL, LEGACYIO_USER_BASE);
    222208}
    223209
     
    262248 * We use r13 (a.k.a. tp) for this purpose.
    263249 */
    264 sysarg_t sys_tls_set(sysarg_t addr)
    265 {
    266         return 0;
     250sysarg_t sys_tls_set(uintptr_t addr)
     251{
     252        return EOK;
    267253}
    268254
     
    270256{
    271257        pio_write_8((ioport8_t *)0x64, 0xfe);
    272         while (1)
    273                 ;
     258        while (1);
    274259}
    275260
Note: See TracChangeset for help on using the changeset viewer.