summaryrefslogtreecommitdiffstats
path: root/syscall/dbg_log.c
blob: 9055498910be7b73e943ab300e5b9a51b1174e5e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "handler.h"
#include "print.h"
#include "umode_vma.h"
#include "api/errno.h"

int
_handler_dbg_log(struct sc_dbg_log *u_sc)
{
    struct sc_dbg_log sc;
    if(user_vma_read(&sc, u_sc, sizeof(struct sc_dbg_log)) != 0)
        return -EFAIL;

    char buf[sc.w];
    if(user_vma_read(buf, sc.s, sc.w) != 0)
        return -EFAIL;

    klogf("%s", buf);
    return 0;
}