copy_to_user如何在s390上运行?

时间:2012-01-20 15:51:15

标签: linux-kernel virtual-address-space address-space zseries

在s390体系结构中,虚拟内核和用户地址空间永远不会同时出现,那么copy_to_user如何工作?

1 个答案:

答案 0 :(得分:3)

s390的

copy_to_user在此实施:linux/arch/s390/include/asm/uaceess.h

uaccess是指向copy_ [to / from] _user实际实现的指针。它在这里设置(grep uaccess):arch/s390/kernel/setup.cuaccess有4种实现,取决于模式:

uaccess_mvcos_switchuaccess_ptuaccess_mvcosuaccess_std

例如,uaccess_std位于:http://lxr.linux.no/#linux+v3.2.1/arch/s390/lib/uaccess_std.c

4 *  Standard user space access functions based on mvcp/mvcs and doing
5 *  interesting things in the secondary space mode.

...

82 size_t copy_to_user_std(size_t size, void __user *ptr, const void *x)
83 {
84        unsigned long tmp1, tmp2;
85
86        tmp1 = -256UL;
87        asm volatile(
88                "0: mvcs  0(%0,%1),0(%2),%3\n"

使用mvcp / mvcs机制: http://publib.boulder.ibm.com/infocenter/zos/v1r11/topic/com.ibm.zos.r11.ieaa500/iea2a57031.htm