Ignore:
File:
1 edited

Legend:

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

    r36df4109 r4a5ba372  
    3636
    3737#include <arch.h>
    38 #include <arch/arch.h>
    3938#include <typedefs.h>
    4039#include <errno.h>
     
    5150#include <genarch/drivers/ega/ega.h>
    5251#include <genarch/drivers/i8042/i8042.h>
    53 #include <genarch/drivers/ns16550/ns16550.h>
    5452#include <genarch/drivers/legacy/ia32/io.h>
    5553#include <genarch/fb/bfb.h>
    5654#include <genarch/kbrd/kbrd.h>
    57 #include <genarch/srln/srln.h>
    5855#include <genarch/multiboot/multiboot.h>
    5956#include <genarch/multiboot/multiboot2.h>
    60 #include <arch/pm.h>
    61 #include <arch/vreg.h>
    6257
    6358#ifdef CONFIG_SMP
    6459#include <arch/smp/apic.h>
    6560#endif
    66 
    67 static void ia32_pre_mm_init(void);
    68 static void ia32_post_mm_init(void);
    69 static void ia32_post_cpu_init(void);
    70 static void ia32_pre_smp_init(void);
    71 static void ia32_post_smp_init(void);
    72 
    73 arch_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 
    81 arch_ops_t *arch_ops = &ia32_ops;
    8261
    8362/** Perform ia32-specific initialization before main_bsp() is called.
     
    8766 *
    8867 */
    89 void ia32_pre_main(uint32_t signature, void *info)
     68void arch_pre_main(uint32_t signature, void *info)
    9069{
    9170        /* Parse multiboot information obtained from the bootloader. */
     
    10079}
    10180
    102 void ia32_pre_mm_init(void)
     81void arch_pre_mm_init(void)
    10382{
    10483        pm_init();
     
    11392}
    11493
    115 void ia32_post_mm_init(void)
    116 {
    117         vreg_init();
    118 
     94void arch_post_mm_init(void)
     95{
    11996        if (config.cpu_active == 1) {
    12097                /* Initialize IRQ routing */
     
    143120                zone_merge_all();
    144121        }
    145 
    146 }
    147 
    148 void ia32_post_cpu_init(void)
     122}
     123
     124void arch_post_cpu_init()
    149125{
    150126#ifdef CONFIG_SMP
     
    156132}
    157133
    158 void ia32_pre_smp_init(void)
     134void arch_pre_smp_init(void)
    159135{
    160136        if (config.cpu_active == 1) {
     
    165141}
    166142
    167 void ia32_post_smp_init(void)
     143void arch_post_smp_init(void)
    168144{
    169145        /* Currently the only supported platform for ia32 is 'pc'. */
     
    190166        }
    191167#endif
    192 
    193 #if (defined(CONFIG_NS16550) || defined(CONFIG_NS16550_OUT))
    194         /*
    195          * Initialize the ns16550 controller.
    196          */
    197 #ifdef CONFIG_NS16550_OUT
    198         outdev_t *ns16550_out;
    199         outdev_t **ns16550_out_ptr = &ns16550_out;
    200 #else
    201         outdev_t **ns16550_out_ptr = NULL;
    202 #endif
    203         ns16550_instance_t *ns16550_instance
    204             = ns16550_init((ns16550_t *) NS16550_BASE, IRQ_NS16550, NULL, NULL,
    205             ns16550_out_ptr);
    206         if (ns16550_instance) {
    207 #ifdef CONFIG_NS16550
    208                 srln_instance_t *srln_instance = srln_init();
    209                 if (srln_instance) {
    210                         indev_t *sink = stdin_wire();
    211                         indev_t *srln = srln_wire(srln_instance, sink);
    212                         ns16550_wire(ns16550_instance, srln);
    213                         trap_virtual_enable_irqs(1 << IRQ_NS16550);
    214                 }
    215 #endif
    216 #ifdef CONFIG_NS16550_OUT
    217                 if (ns16550_out) {
    218                         stdout_wire(ns16550_out);
    219                 }
    220 #endif
    221         }
    222 #endif
    223168       
    224169        if (irqs_info != NULL)
     
    238183}
    239184
     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 */
     190sysarg_t sys_tls_set(uintptr_t addr)
     191{
     192        THREAD->arch.tls = addr;
     193        set_tls_desc(addr);
     194       
     195        return EOK;
     196}
     197
    240198/** Construct function pointer
    241199 *
Note: See TracChangeset for help on using the changeset viewer.