Subversion Repositories HelenOS-historic

Rev

Rev 1040 | Rev 1086 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1040 Rev 1066
Line 35... Line 35...
35
#include <proc/task.h>
35
#include <proc/task.h>
36
#include <arch.h>
36
#include <arch.h>
37
#include <debug.h>
37
#include <debug.h>
38
#include <ipc/sysipc.h>
38
#include <ipc/sysipc.h>
39
 
39
 
40
static __native sys_ctl(void) {
-
 
41
    printf("Thread finished\n");
-
 
42
    thread_exit();
-
 
43
    /* Unreachable */
-
 
44
    return 0;
-
 
45
}
-
 
46
 
-
 
47
static __native sys_io(int fd, const void * buf, size_t count) {
40
static __native sys_io(int fd, const void * buf, size_t count) {
48
   
41
   
49
    // TODO: buf sanity checks and a lot of other stuff ...
42
    // TODO: buf sanity checks and a lot of other stuff ...
50
 
43
 
51
    size_t i;
44
    size_t i;
Line 54... Line 47...
54
        putchar(((char *) buf)[i]);
47
        putchar(((char *) buf)[i]);
55
   
48
   
56
    return count;
49
    return count;
57
}
50
}
58
 
51
 
59
 
-
 
60
static __native sys_mmap(void *address, size_t size, int flags)
52
static __native sys_mmap(void *address, size_t size, int flags)
61
{
53
{
62
    if (as_area_create(AS, flags, size, (__address) address))
54
    if (as_area_create(AS, flags, size, (__address) address))
63
        return (__native) address;
55
        return (__native) address;
64
    else
56
    else
Line 69... Line 61...
69
{
61
{
70
    return as_remap(AS, (__address) address, size, 0);
62
    return as_remap(AS, (__address) address, size, 0);
71
}
63
}
72
 
64
 
73
syshandler_t syscall_table[SYSCALL_END] = {
65
syshandler_t syscall_table[SYSCALL_END] = {
74
    sys_ctl,
-
 
75
    sys_io,
66
    sys_io,
-
 
67
    sys_thread_create,
-
 
68
    sys_thread_exit,
76
    sys_mmap,
69
    sys_mmap,
77
    sys_mremap,
70
    sys_mremap,
78
    sys_ipc_call_sync_fast,
71
    sys_ipc_call_sync_fast,
79
    sys_ipc_call_sync,
72
    sys_ipc_call_sync,
80
    sys_ipc_call_async_fast,
73
    sys_ipc_call_async_fast,