25 lines
856 B
C
25 lines
856 B
C
#include <zinnia/percpu.h>
|
|
#include <zinnia/usercopy.h>
|
|
#include <arch/usercopy.h>
|
|
|
|
bool usercopy_read(void* dst, const __user void* src, size_t len) {
|
|
arch_usercopy_allow(true);
|
|
bool success = arch_usercopy_read(dst, src, len, &percpu_get()->sched.current->usercopy_region);
|
|
arch_usercopy_allow(false);
|
|
return success;
|
|
}
|
|
|
|
bool usercopy_write(__user void* dst, const void* src, size_t len) {
|
|
arch_usercopy_allow(true);
|
|
bool success = arch_usercopy_write(dst, src, len, &percpu_get()->sched.current->usercopy_region);
|
|
arch_usercopy_allow(false);
|
|
return success;
|
|
}
|
|
|
|
bool usercopy_strlen(const __user char* str, size_t max, size_t* len) {
|
|
arch_usercopy_allow(true);
|
|
bool success = arch_usercopy_strlen(str, max, len, &percpu_get()->sched.current->usercopy_region);
|
|
arch_usercopy_allow(false);
|
|
return success;
|
|
}
|