Subversion Repositories HelenOS

Rev

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

Rev 2619 Rev 3064
Line 49... Line 49...
49
#include <ddi/ddi.h>
49
#include <ddi/ddi.h>
50
#include <security/cap.h>
50
#include <security/cap.h>
51
#include <syscall/copy.h>
51
#include <syscall/copy.h>
52
#include <sysinfo/sysinfo.h>
52
#include <sysinfo/sysinfo.h>
53
#include <console/console.h>
53
#include <console/console.h>
54
#include <console/klog.h>
-
 
55
 
54
 
56
/** Print using kernel facility
55
/** Print using kernel facility
57
 *
56
 *
58
 * Some simulators can print only through kernel. Userspace can use
-
 
59
 * this syscall to facilitate it.
57
 * Print to kernel log.
-
 
58
 *
60
 */
59
 */
61
static unative_t sys_io(int fd, const void * buf, size_t count)
60
static unative_t sys_io(int fd, const void * buf, size_t count)
62
{
61
{
63
    size_t i;
62
    size_t i;
64
    char *data;
63
    char *data;
Line 98... Line 97...
98
    unative_t rc;
97
    unative_t rc;
99
 
98
 
100
    if (id < SYSCALL_END)
99
    if (id < SYSCALL_END)
101
        rc = syscall_table[id](a1, a2, a3, a4, a5, a6);
100
        rc = syscall_table[id](a1, a2, a3, a4, a5, a6);
102
    else {
101
    else {
103
        klog_printf("TASK %llu: Unknown syscall id %llx", TASK->taskid,
102
        printf("Task %" PRIu64": Unknown syscall %#" PRIxn, TASK->taskid, id);
104
            id);
-
 
105
        task_kill(TASK->taskid);
103
        task_kill(TASK->taskid);
106
        thread_exit();
104
        thread_exit();
107
    }
105
    }
108
       
106
       
109
    if (THREAD->interrupted)
107
    if (THREAD->interrupted)
Line 118... Line 116...
118
   
116
   
119
    /* Thread and task related syscalls. */
117
    /* Thread and task related syscalls. */
120
    (syshandler_t) sys_thread_create,
118
    (syshandler_t) sys_thread_create,
121
    (syshandler_t) sys_thread_exit,
119
    (syshandler_t) sys_thread_exit,
122
    (syshandler_t) sys_thread_get_id,
120
    (syshandler_t) sys_thread_get_id,
-
 
121
   
123
    (syshandler_t) sys_task_get_id,
122
    (syshandler_t) sys_task_get_id,
-
 
123
    (syshandler_t) sys_task_spawn,
124
   
124
   
125
    /* Synchronization related syscalls. */
125
    /* Synchronization related syscalls. */
126
    (syshandler_t) sys_futex_sleep_timeout,
126
    (syshandler_t) sys_futex_sleep_timeout,
127
    (syshandler_t) sys_futex_wakeup,
127
    (syshandler_t) sys_futex_wakeup,
128
   
128