Ignore:
File:
1 edited

Legend:

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

    r4a5ba372 re98f1c3e  
    3636
    3737#include <arch.h>
     38#include <arch/arch.h>
    3839#include <typedefs.h>
    3940#include <errno.h>
     
    5051#include <genarch/drivers/ega/ega.h>
    5152#include <genarch/drivers/i8042/i8042.h>
     53#include <genarch/drivers/ns16550/ns16550.h>
    5254#include <genarch/drivers/legacy/ia32/io.h>
    5355#include <genarch/fb/bfb.h>
    5456#include <genarch/kbrd/kbrd.h>
     57#include <genarch/srln/srln.h>
    5558#include <genarch/multiboot/multiboot.h>
    5659#include <genarch/multiboot/multiboot2.h>
     60#include <arch/pm.h>
     61#include <arch/vreg.h>
    5762
    5863#ifdef CONFIG_SMP
    5964#include <arch/smp/apic.h>
    6065#endif
     66
     67static void ia32_pre_mm_init(void);
     68static void ia32_post_mm_init(void);
     69static void ia32_post_cpu_init(void);
     70static void ia32_pre_smp_init(void);
     71static void ia32_post_smp_init(void);
     72
     73arch_ops_t ia32_ops = {
     74        .pre_mm_init = ia32_pre_mm_init,
     75        .post_mm_init = ia32_post_mm_init,
     76        .post_cpu_init = ia32_post_cpu_init,
     77        .pre_smp_init = ia32_pre_smp_init,
     78        .post_smp_init = ia32_post_smp_init,
     79};
     80
     81arch_ops_t *arch_ops = &ia32_ops;
    6182
    6283/** Perform ia32-specific initialization before main_bsp() is called.
     
    6687 *
    6788 */
    68 void arch_pre_main(uint32_t signature, void *info)
     89void ia32_pre_main(uint32_t signature, void *info)
    6990{
    7091        /* Parse multiboot information obtained from the bootloader. */
     
    79100}
    80101
    81 void arch_pre_mm_init(void)
     102void ia32_pre_mm_init(void)
    82103{
    83104        pm_init();
     
    92113}
    93114
    94 void arch_post_mm_init(void)
    95 {
     115void ia32_post_mm_init(void)
     116{
     117        vreg_init();
     118
    96119        if (config.cpu_active == 1) {
    97120                /* Initialize IRQ routing */
     
    122145}
    123146
    124 void arch_post_cpu_init()
     147void ia32_post_cpu_init(void)
    125148{
    126149#ifdef CONFIG_SMP
     
    132155}
    133156
    134 void arch_pre_smp_init(void)
     157void ia32_pre_smp_init(void)
    135158{
    136159        if (config.cpu_active == 1) {
     
    141164}
    142165
    143 void arch_post_smp_init(void)
     166void ia32_post_smp_init(void)
    144167{
    145168        /* Currently the only supported platform for ia32 is 'pc'. */
     
    166189        }
    167190#endif
     191
     192#if (defined(CONFIG_NS16550) || defined(CONFIG_NS16550_OUT))
     193        /*
     194         * Initialize the ns16550 controller.
     195         */
     196#ifdef CONFIG_NS16550_OUT
     197        outdev_t *ns16550_out;
     198        outdev_t **ns16550_out_ptr = &ns16550_out;
     199#else
     200        outdev_t **ns16550_out_ptr = NULL;
     201#endif
     202        ns16550_instance_t *ns16550_instance
     203            = ns16550_init((ns16550_t *) NS16550_BASE, IRQ_NS16550, NULL, NULL,
     204            ns16550_out_ptr);
     205        if (ns16550_instance) {
     206#ifdef CONFIG_NS16550
     207                srln_instance_t *srln_instance = srln_init();
     208                if (srln_instance) {
     209                        indev_t *sink = stdin_wire();
     210                        indev_t *srln = srln_wire(srln_instance, sink);
     211                        ns16550_wire(ns16550_instance, srln);
     212                        trap_virtual_enable_irqs(1 << IRQ_NS16550);
     213                }
     214#endif
     215#ifdef CONFIG_NS16550_OUT
     216                if (ns16550_out) {
     217                        stdout_wire(ns16550_out);
     218                }
     219#endif
     220        }
     221#endif
    168222       
    169223        if (irqs_info != NULL)
     
    183237}
    184238
    185 /** Set thread-local-storage pointer
    186  *
    187  * TLS pointer is set in GS register. That means, the GS contains
    188  * selector, and the descriptor->base is the correct address.
    189  */
    190 sysarg_t sys_tls_set(uintptr_t addr)
    191 {
    192         THREAD->arch.tls = addr;
    193         set_tls_desc(addr);
    194        
    195         return EOK;
    196 }
    197 
    198239/** Construct function pointer
    199240 *
Note: See TracChangeset for help on using the changeset viewer.