Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2482 → Rev 2586

/trunk/uspace/lib/libc/arch/arm32/include/tls.h/thread.h
1,5 → 1,6
/*
* Copyright (c) 2007 Pavel Jancik, Michal Kebrt
* Copyright (c) 2007 Pavel Jancik
* Copyright (c) 2007 Michal Kebrt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
30,19 → 31,17
* @{
*/
/** @file
* @brief Uspace threads and TLS.
*/
 
#ifndef LIBC_arm32_THREAD_H_
#define LIBC_arm32_THREAD_H_
#ifndef LIBC_arm32_TLS_H_
#define LIBC_arm32_TLS_H_
 
#include <unistd.h>
#include <sys/types.h>
 
/** Stack initial size. */
#define THREAD_INITIAL_STACK_PAGES_NO 1
#define CONFIG_TLS_VARIANT_1
 
/** Offsets for accessing __thread variables are shifted 8 bytes higher. */
#define ARM_TP_OFFSET (-8)
#define ARM_TP_OFFSET (-8)
 
/** TCB (Thread Control Block) struct.
*
56,7 → 55,7
 
/** Sets TLS address to the r9 register.
*
* @param tcb TCB (TLS starts behind)
* @param tcb TCB (TLS starts behind)
*/
static inline void __tcb_set(tcb_t *tcb)
{
65,7 → 64,7
asm volatile (
"mov r9, %0"
:
: "r"(tls)
: "r" (tls)
);
}
 
72,7 → 71,8
 
/** Returns TCB address.
*
* @return TCB address (starts before TLS which address is stored in r9 register).
* @return TCB address (starts before TLS which address is stored
* in r9 register).
*/
static inline tcb_t *__tcb_get(void)
{
89,7 → 89,7
*
* Implemented in assembly.
*
* @return TLS address stored in r9 register
* @return TLS address stored in r9 register
*/
extern uintptr_t __aeabi_read_tp(void);