blob: 57d0d79ad27b05b80790dc8383e0c5d992e51682 [file] [log] [blame]
// Copyright 2016 The Fuchsia Authors
//
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT
#pragma once
#include <err.h>
#include <zircon/compiler.h>
#include <zircon/types.h>
__BEGIN_CDECLS
/*
* @brief Copy data from userspace into kernelspace
*
* This function validates that usermode has access to src before copying the
* data.
*
* @param dst The destination buffer.
* @param src The source buffer.
* @param len The number of bytes to copy.
*
* @return ZX_OK on success
*/
zx_status_t arch_copy_from_user(void *dst, const void *src, size_t len);
/*
* @brief Copy data from kernelspace into userspace
*
* This function validates that usermode has access to dst before copying the
* data.
*
* @param dst The destination buffer.
* @param src The source buffer.
* @param len The number of bytes to copy.
*
* @return ZX_OK on success
*/
zx_status_t arch_copy_to_user(void *dst, const void *src, size_t len);
__END_CDECLS