e6dc7903e4
to the private VM types are including vm_types.h now. * Removed vm_page, vm_area, vm_cache, and vm_address_space typedefs; it's cleaner this way, and the actual types are only used in C++ files now, anyway. * And that caused changes in many files... * Made commpage.h self-containing. * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22329 a95241bf-73f2-0310-859d-f6bbb57e9c96
38 lines
703 B
C++
38 lines
703 B
C++
// syscall_args.h
|
|
|
|
#ifndef _SYSCALL_ARGS_H
|
|
#define _SYSCALL_ARGS_H
|
|
|
|
#include <kernel.h>
|
|
//#include <vm.h>
|
|
|
|
// Hack to be able to use the IS_USER_ADDRESS macro when compiling for R5.
|
|
#ifdef R5_MEMORY_LAYOUT
|
|
# undef KERNEL_BASE
|
|
# define KERNEL_BASE 0x0
|
|
#endif
|
|
|
|
// copy_ref_var_from_user
|
|
template<typename T>
|
|
inline
|
|
status_t
|
|
copy_ref_var_from_user(T *user, T &kernel)
|
|
{
|
|
if (!IS_USER_ADDRESS(user))
|
|
return B_BAD_ADDRESS;
|
|
return user_memcpy(&kernel, user, sizeof(T));
|
|
}
|
|
|
|
// copy_ref_var_to_user
|
|
template<typename T>
|
|
inline
|
|
status_t
|
|
copy_ref_var_to_user(T &kernel, T *user)
|
|
{
|
|
if (!IS_USER_ADDRESS(user))
|
|
return B_BAD_ADDRESS;
|
|
return user_memcpy(user, &kernel, sizeof(T));
|
|
}
|
|
|
|
#endif // _SYSCALL_ARGS_H
|