Ignore:
Timestamp:
2006-09-03T23:37:14Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fd85ae5
Parents:
002e613
Message:

sparc64 update.

  • Prototype userspace layer implementation that at least relates to sparc64 and compiles cleanly.
  • Fixes for kernel's preemptible_handler and code related to running userspace.
  • Enable userspace. Several dozen instructions are now run in userspace! We are pretty near the userspace milestone for sparc64.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/libc/arch/sparc64/include/thread.h

    r002e613 rcfa70add  
    11/*
    2  * Copyright (C) 2006 Martin Decky
     2 * Copyright (C) 2006 Ondrej Palkovsky
     3 * Copyright (C) 2006 Jakub Jermar
    34 * All rights reserved.
    45 *
     
    2728 */
    2829
    29 /** @addtogroup libcsparc64     
     30/** @addtogroup libcsparc64
    3031 * @{
    3132 */
    32 /** @file
     33/**
     34 * @file
     35 * @brief       sparc64 TLS functions.
     36 *
     37 * The implementation is based on the IA-32 implementation which was also
     38 * designed by Sun and is virtually the same, except the TCB is stored in
     39 * %g7 (of the normal set).
    3340 */
    3441
    35 #ifndef __LIBC__sparc64__THREAD_H__
    36 #define __LIBC__sparc64__THREAD_H__
    37 
    38 #define PPC_TP_OFFSET 0x7000
     42#ifndef LIBC_sparc64_THREAD_H_
     43#define LIBC_sparc64_THREAD_H_
    3944
    4045typedef struct {
     46        void *self;
    4147        void *pst_data;
    4248} tcb_t;
     
    4450static inline void __tcb_set(tcb_t *tcb)
    4551{
    46         void *tp = tcb;
    47         tp += PPC_TP_OFFSET + sizeof(tcb_t);
     52        __asm__ volatile ("mov %0, %%g7\n" : : "r" (tcb) : "g7");
    4853}
    4954
    50 static inline tcb_t *__tcb_get(void)
     55static inline tcb_t * __tcb_get(void)
    5156{
    52         return (tcb_t *)(PPC_TP_OFFSET - sizeof(tcb_t));
     57        void *retval;
     58
     59        __asm__ volatile ("mov %%g7, %0\n" : "=r" (retval));
     60
     61        return retval;
    5362}
    5463
Note: See TracChangeset for help on using the changeset viewer.