Ignore:
File:
1 edited

Legend:

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

    raf9dd1e r4a5ba372  
    4949#include <genarch/drivers/ega/ega.h>
    5050#include <genarch/drivers/i8042/i8042.h>
    51 #include <genarch/drivers/ns16550/ns16550.h>
    5251#include <genarch/drivers/legacy/ia32/io.h>
    5352#include <genarch/fb/bfb.h>
    5453#include <genarch/kbrd/kbrd.h>
    55 #include <genarch/srln/srln.h>
    5654#include <genarch/multiboot/multiboot.h>
    5755#include <genarch/multiboot/multiboot2.h>
    58 #include <arch/pm.h>
    59 #include <arch/vreg.h>
    60 #include <arch/kseg.h>
    6156
    6257#ifdef CONFIG_SMP
     
    142137void arch_post_mm_init(void)
    143138{
    144         vreg_init();
    145         kseg_init();
    146 
    147139        if (config.cpu_active == 1) {
    148140                /* Initialize IRQ routing */
     
    176168}
    177169
    178 void arch_post_cpu_init(void)
     170void arch_post_cpu_init()
    179171{
    180172#ifdef CONFIG_SMP
     
    220212        }
    221213#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
    253214       
    254215        if (irqs_info != NULL)
     
    268229}
    269230
     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 */
     239sysarg_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
    270247/** Construct function pointer
    271248 *
Note: See TracChangeset for help on using the changeset viewer.