Ignore:
File:
1 edited

Legend:

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

    r4a5ba372 raf9dd1e  
    4949#include <genarch/drivers/ega/ega.h>
    5050#include <genarch/drivers/i8042/i8042.h>
     51#include <genarch/drivers/ns16550/ns16550.h>
    5152#include <genarch/drivers/legacy/ia32/io.h>
    5253#include <genarch/fb/bfb.h>
    5354#include <genarch/kbrd/kbrd.h>
     55#include <genarch/srln/srln.h>
    5456#include <genarch/multiboot/multiboot.h>
    5557#include <genarch/multiboot/multiboot2.h>
     58#include <arch/pm.h>
     59#include <arch/vreg.h>
     60#include <arch/kseg.h>
    5661
    5762#ifdef CONFIG_SMP
     
    137142void arch_post_mm_init(void)
    138143{
     144        vreg_init();
     145        kseg_init();
     146
    139147        if (config.cpu_active == 1) {
    140148                /* Initialize IRQ routing */
     
    168176}
    169177
    170 void arch_post_cpu_init()
     178void arch_post_cpu_init(void)
    171179{
    172180#ifdef CONFIG_SMP
     
    212220        }
    213221#endif
     222
     223#if (defined(CONFIG_NS16550) || defined(CONFIG_NS16550_OUT))
     224        /*
     225         * Initialize the ns16550 controller.
     226         */
     227#ifdef CONFIG_NS16550_OUT
     228        outdev_t *ns16550_out;
     229        outdev_t **ns16550_out_ptr = &ns16550_out;
     230#else
     231        outdev_t **ns16550_out_ptr = NULL;
     232#endif
     233        ns16550_instance_t *ns16550_instance
     234            = ns16550_init((ns16550_t *) NS16550_BASE, IRQ_NS16550, NULL, NULL,
     235            ns16550_out_ptr);
     236        if (ns16550_instance) {
     237#ifdef CONFIG_NS16550
     238                srln_instance_t *srln_instance = srln_init();
     239                if (srln_instance) {
     240                        indev_t *sink = stdin_wire();
     241                        indev_t *srln = srln_wire(srln_instance, sink);
     242                        ns16550_wire(ns16550_instance, srln);
     243                        trap_virtual_enable_irqs(1 << IRQ_NS16550);
     244                }
     245#endif
     246#ifdef CONFIG_NS16550_OUT
     247                if (ns16550_out) {
     248                        stdout_wire(ns16550_out);
     249                }
     250#endif
     251        }
     252#endif
    214253       
    215254        if (irqs_info != NULL)
     
    229268}
    230269
    231 /** Set thread-local-storage pointer
    232  *
    233  * TLS pointer is set in FS register. Unfortunately the 64-bit
    234  * part can be set only in CPL0 mode.
    235  *
    236  * The specs say, that on %fs:0 there is stored contents of %fs register,
    237  * we need not to go to CPL0 to read it.
    238  */
    239 sysarg_t sys_tls_set(uintptr_t addr)
    240 {
    241         THREAD->arch.tls = addr;
    242         write_msr(AMD_MSR_FS, addr);
    243        
    244         return EOK;
    245 }
    246 
    247270/** Construct function pointer
    248271 *
Note: See TracChangeset for help on using the changeset viewer.