root/Whitix/trunk/kernel/save.c

Revision 2052, 0.7 KB (checked in by mwhitworth, 3 years ago)

Add beginning of process save/restore file.

Line 
1#include <task.h>
2#include <sys.h>
3
4int ProcessSave(struct Process* process, struct File* file)
5{
6        KePrint("SysProcessSave(%d, %d)\n", process, file);
7}
8
9int SysProcessSave(int pid, int fd, int flags)
10{
11        struct File* file;
12        struct Process* process;
13       
14        /* FIXME: Quisce other threads. */
15        file = FileGet(fd);
16       
17        if (!file)
18                return -EINVAL;
19               
20        if (pid == -1)
21                process = current;
22        else
23                process = ThrFindProcessById(pid);
24               
25        if (!process)
26                return NULL;
27               
28        return ProcessSave(process, file);
29}
30
31int SysProcessRestore(void* img)
32{
33        KePrint("SysProcessRestore(%#X)\n", img);
34        return 0;
35}
36
37struct SysCall saveSystemCalls[]=
38{
39        SysEntry(SysProcessSave, 12),
40        SysEntryEnd(),
41};
42
43int SaveInit()
44{
45        SysRegisterRange(SYS_SAVE_BASE, saveSystemCalls);
46       
47        return 0;
48}
Note: See TracBrowser for help on using the browser.