os-k/kaleid/kernel/ke/syscall.c

42 lines
2.3 KiB
C

//----------------------------------------------------------------------------//
// OS on Kaleid //
// //
// Desc: System call & userspace related functions //
// //
// //
// Copyright © 2018-2021 The OS/K Team //
// //
// This file is part of OS/K. //
// //
// OS/K is free software: you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation, either version 3 of the License, or //
// any later version. //
// //
// OS/K is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY//without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with OS/K. If not, see <https://www.gnu.org/licenses/>. //
//----------------------------------------------------------------------------//
#include <libbuf.h>
#include <init/boot.h>
#include <ke/idt.h>
#include <io/vga.h>
error_t _KeSyscallHandler( ulong code, void *arg0, void *arg1, void *arg2,
ISRFrame_t *regs )
{
DebugLog("Got a system call code %ld from cs %#x\n", code, regs->cs);
if ((ulong)regs->cs >= (ulong)BtLoaderInfo.codeSegment) {
bprintf(BStdOut, "Got a system call from userspace code %d\n", code);
BStdOut->flusher(BStdOut);
}
return EOK;
}