|
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 | |
|---|
| 4 | int ProcessSave(struct Process* process, struct File* file) |
|---|
| 5 | { |
|---|
| 6 | KePrint("SysProcessSave(%d, %d)\n", process, file); |
|---|
| 7 | } |
|---|
| 8 | |
|---|
| 9 | int SysProcessSave(int pid, int fd, int flags) |
|---|
| 10 | { |
|---|
| 11 | struct File* file; |
|---|
| 12 | struct Process* process; |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 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 | |
|---|
| 31 | int SysProcessRestore(void* img) |
|---|
| 32 | { |
|---|
| 33 | KePrint("SysProcessRestore(%#X)\n", img); |
|---|
| 34 | return 0; |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | struct SysCall saveSystemCalls[]= |
|---|
| 38 | { |
|---|
| 39 | SysEntry(SysProcessSave, 12), |
|---|
| 40 | SysEntryEnd(), |
|---|
| 41 | }; |
|---|
| 42 | |
|---|
| 43 | int SaveInit() |
|---|
| 44 | { |
|---|
| 45 | SysRegisterRange(SYS_SAVE_BASE, saveSystemCalls); |
|---|
| 46 | |
|---|
| 47 | return 0; |
|---|
| 48 | } |
|---|