Changeset 281b607 in mainline for arch/amd64/src/amd64.c


Ignore:
Timestamp:
2006-03-23T10:29:39Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a0bb10ef
Parents:
9aa72b4
Message:

Added basic kernel infrastructure for ThreadLocalStorage(TLS) for
ia32(complete),amd64(complete),mips32(missing emulation of rdhwr instruction).

File:
1 edited

Legend:

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

    r9aa72b4 r281b607  
    3333#include <config.h>
    3434
     35#include <proc/thread.h>
    3536#include <arch/ega.h>
    3637#include <genarch/i8042/i8042.h>
     
    4849#include <arch/syscall.h>
    4950#include <arch/debugger.h>
     51#include <syscall/syscall.h>
     52
    5053
    5154/** Disable I/O on non-privileged levels
     
    160163        i8254_normal_operation();
    161164}
     165
     166/** Set Thread-local-storeage pointer
     167 *
     168 * TLS pointer is set in FS register. Unfortunately the 64-bit
     169 * part can be set only in CPL0 mode.
     170 *
     171 * The specs says, that on %fs:0 there is stored contents of %fs register,
     172 * we need not to go to CPL0 to read it.
     173 */
     174__native sys_tls_set(__native addr)
     175{
     176        THREAD->tls = addr;
     177        write_msr(AMD_MSR_FS, addr);
     178        return 0;
     179}
Note: See TracChangeset for help on using the changeset viewer.