Ignore:
Timestamp:
2014-03-15T19:21:53Z (10 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c773adc
Parents:
2034f98 (diff), 8cffdf5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/sparc32/include/libarch/tls.h

    r2034f98 rb0b4592e  
    11/*
    22 * Copyright (c) 2006 Ondrej Palkovsky
     3 * Copyright (c) 2006 Jakub Jermar
    34 * All rights reserved.
    45 *
     
    2728 */
    2829
    29 /** @addtogroup libc
     30/** @addtogroup libcsparc32
    3031 * @{
    3132 */
    3233/** @file
     34 * @brief sparc32 TLS functions.
    3335 */
    3436
    35 #ifndef LIBC_MMAN_H_
    36 #define LIBC_MMAN_H_
     37#ifndef LIBC_sparc32_TLS_H_
     38#define LIBC_sparc32_TLS_H_
    3739
    38 #include <as.h>
    39 #include <sys/types.h>
     40#define CONFIG_TLS_VARIANT_2
    4041
    41 #define MAP_FAILED  AS_MAP_FAILED
     42typedef struct {
     43        void *self;
     44        void *fibril_data;
     45} tcb_t;
    4246
    43 #define MAP_SHARED     (1 << 0)
    44 #define MAP_PRIVATE    (1 << 1)
    45 #define MAP_FIXED      (1 << 2)
    46 #define MAP_ANONYMOUS  (1 << 3)
     47static inline void __tcb_set(tcb_t *tcb)
     48{
     49        asm volatile (
     50                "mov %0, %%g7\n"
     51                :: "r" (tcb)
     52                : "g7"
     53        );
     54}
    4755
    48 #define PROTO_READ   AS_AREA_READ
    49 #define PROTO_WRITE  AS_AREA_WRITE
    50 #define PROTO_EXEC   AS_AREA_EXEC
    51 
    52 extern void *mmap(void *start, size_t length, int prot, int flags, int fd,
    53     aoff64_t offset);
    54 extern int munmap(void *start, size_t length);
     56static inline tcb_t *__tcb_get(void)
     57{
     58        void *retval;
     59       
     60        asm volatile (
     61                "mov %%g7, %0\n"
     62                : "=r" (retval)
     63        );
     64       
     65        return retval;
     66}
    5567
    5668#endif
Note: See TracChangeset for help on using the changeset viewer.