Messages in this thread | | | From | Jeff Moyer USG <> | Date | Wed, 29 Sep 1999 22:05:42 -0400 (EDT) | Subject | syscall semantics question |
| |
Hello,
I am porting some checkpoint/restart code from intel to alpha, and have run into a bit of a jam. I am not sure what the question should be, so I'll describe the circumstances.
A system call is defined as:
static inline _syscall1 (int, restart, char*, filename);
and then written as:
asmlinkage int sys_restart (struct pt_regs regs) {...
Is it correct to assume on all architectures that one could cast the first arg to a syscall as a 'struct pt_regs'? The author also does it here:
static inline _syscall3 (int, checkpoint, int, pid, int, fd, int, flags);
and then:
asmlinkage int sys_checkpoint (struct pt_regs regs) {...
Also, when restarting the image, he copies the old regs right into ®s. So, I am assuming this is the task's saved stack.
So, I guess the question I have is will this work across platforms? I know for the alpha one also has to restore the switch_stack. How about the usp? Should that be saved and restored ([rd,wr]usp)?
If it helps, the restart system call replaces the caller with the checkpointed image, similar to exec.
Any help you could provide would be greatly appreciated.
-Jeff
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |