mirror of
https://github.com/openharmony/drivers_adapter_khdf_linux.git
synced 2026-08-26 19:07:07 -04:00
71e933f99d
Signed-off-by: zhang <zhangfengxi@huawei.com>
45 lines
1.1 KiB
C
45 lines
1.1 KiB
C
/*
|
|
* osal_uaccess.h
|
|
*
|
|
* osal driver
|
|
*
|
|
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
|
*
|
|
* This software is licensed under the terms of the GNU General Public
|
|
* License version 2, as published by the Free Software Foundation, and
|
|
* may be copied, distributed, and modified under those terms.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
*/
|
|
|
|
#ifndef OSAL_UACCESS_DEF_H
|
|
#define OSAL_UACCESS_DEF_H
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/uaccess.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif /* __cplusplus */
|
|
|
|
static inline size_t CopyToUser(void __user *to, const void *from, size_t len)
|
|
{
|
|
return (size_t)copy_to_user(to, from, (unsigned long)len);
|
|
}
|
|
|
|
static inline size_t CopyFromUser(void *to, const void __user *from, size_t len)
|
|
{
|
|
return (size_t)copy_from_user(to, from, (unsigned long)len);
|
|
}
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif /* __cplusplus */
|
|
|
|
#endif /* OSAL_UACCESS_DEF_H */
|
|
|