Changeset c05290e in mainline


Ignore:
Timestamp:
2006-03-17T01:31:55Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
11a4fbf
Parents:
11eae82
Message:

Support for uspace threads.

Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • init/init.c

    r11eae82 rc05290e  
    3333#include <stdlib.h>
    3434#include <ns.h>
    35 
     35#include <thread.h>
     36
     37extern void utest(void *arg);
     38void utest(void *arg)
     39{
     40//      printf("Uspace thread created.\n");
     41        for (;;)
     42                ;
     43}
    3644
    3745static void test_printf(void)
     
    177185int main(int argc, char *argv[])
    178186{
     187        int tid;
     188        char *stack;
    179189        version_print();
    180190
     
    184194//      test_advanced_ipc();
    185195        test_connection_ipc();
     196       
     197        stack = (char *) malloc(getpagesize());
     198        if (!stack) {
     199                printf("Malloc failed.\n");
     200        } else {
     201                if ((tid = thread_create(utest, NULL, stack, "utest") != -1)) {
     202                        printf("Created thread tid=%d\n", tid);
     203                }
     204        }
     205       
    186206        return 0;
    187207}
  • libc/Makefile

    r11eae82 rc05290e  
    4444        generic/mmap.c \
    4545        generic/string.c \
     46        generic/thread.c \
    4647        generic/io/io.c \
    4748        generic/io/print.c \
  • libc/generic/libc.c

    r11eae82 rc05290e  
    2929#include <libc.h>
    3030#include <unistd.h>
     31#include <thread.h>
    3132
    3233void _exit(int status) {
    33         __SYSCALL0(SYS_CTL);
     34        thread_exit(status);
    3435}
    3536
Note: See TracChangeset for help on using the changeset viewer.