Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2060 → Rev 2061

/trunk/uspace/libc/arch/sparc64/include/thread.h
33,10 → 33,6
/**
* @file
* @brief sparc64 TLS functions.
*
* The implementation is based on the IA-32 implementation which was also
* designed by Sun and is virtually the same, except the TCB is stored in
* %g7 (of the normal set).
*/
 
#ifndef LIBC_sparc64_THREAD_H_
/trunk/uspace/libc/arch/sparc64/src/thread.c
37,10 → 37,20
#include <thread.h>
#include <malloc.h>
 
/** Allocate TLS & TCB for initial module threads
/*
* sparc64 uses thread-local storage data structures, variant II, as described
* in:
* Drepper U.: ELF Handling For Thread-Local Storage, 2005
*/
 
/** Allocate TLS variant II data structures for a thread.
*
* @param data Start of data section
* @return pointer to tcb_t structure
* Only static model is supported.
*
* @param data Pointer to pointer to thread local data. This is actually an
* output argument.
* @param size Size of thread local data.
* @return Pointer to TCB structure.
*/
tcb_t * __alloc_tls(void **data, size_t size)
{
54,9 → 64,16
return tcb;
}
 
/** Free TLS variant II data structures of a thread.
*
* Only static model is supported.
*
* @param tcb Pointer to TCB structure.
* @param size Size of thread local data.
*/
void __free_tls_arch(tcb_t *tcb, size_t size)
{
void *start = ((void *)tcb) - size;
void *start = ((void *) tcb) - size;
free(start);
}
 
/trunk/uspace/libc/arch/sparc64/src/psthread.S
28,14 → 28,6
 
#include <libarch/context_offset.h>
 
/**
* Both context_save_arch() and context_restore_arch() are
* leaf-optimized procedures. This kind of optimization
* is very important and prevents any implicit window
* spill/fill/clean traps in these very core kernel
* functions.
*/
.text
 
.global context_save