Changeset 86d05fae in mainline for libc/generic/psthread.c


Ignore:
Timestamp:
2006-03-24T11:05:41Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4f2c821
Parents:
a71d9af9
Message:

TLS and pseudo thread support for ia64.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libc/generic/psthread.c

    ra71d9af9 r86d05fae  
    3333#include <thread.h>
    3434#include <stdio.h>
     35#include <kernel/arch/faddr.h>
    3536
    3637static LIST_INITIALIZE(ready_list);
     38
     39static void ps_exit(void) __attribute__ ((noinline));
    3740
    3841/** Function to preempt to other thread without adding
    3942 * currently running thread to runqueue
    4043 */
    41 static void ps_exit(void)
     44void ps_exit(void)
    4245{
    4346        psthread_data_t *pt;
     
    8891int ps_join(pstid_t psthrid)
    8992{
    90         psthread_data_t *pt, *mypt;
    91         int retval;
     93        volatile psthread_data_t *pt, *mypt;
     94        volatile int retval;
    9295
    9396        /* Handle psthrid = Kernel address -> it is wait for call */
     
    97100        if (!pt->finished) {
    98101                mypt = __tls_get();
    99                 if (context_save(&mypt->ctx)) {
    100                         pt->waiter = mypt;
     102                if (context_save(&((psthread_data_t *) mypt)->ctx)) {
     103                        pt->waiter = (psthread_data_t *) mypt;
    101104                        ps_exit();
    102105                }
     
    105108
    106109        free(pt->stack);
    107         __free_tls(pt);
     110        __free_tls((psthread_data_t *) pt);
    108111
    109112        return retval;
     
    131134
    132135        context_save(&pt->ctx);
    133         context_set(&pt->ctx, psthread_main, pt->stack, getpagesize(), pt);
     136        context_set(&pt->ctx, FADDR(psthread_main), pt->stack, getpagesize(), pt);
    134137
    135138        list_append(&pt->list, &ready_list);
Note: See TracChangeset for help on using the changeset viewer.