mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-25 02:32:08 +03:00
Use SPDX license GPL-V2.0 format and change Nvidia copyright year to include 2023. Bug 4078035 Change-Id: I4db6577ddb806690f6ec04f5eaf1364578102d14 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2890635 Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com> Reviewed-by: Ketan Patil <ketanp@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
37 lines
696 B
C
37 lines
696 B
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.
|
|
*
|
|
* place to add wrapper function to drop kasan scan
|
|
*/
|
|
#include <linux/export.h>
|
|
#include <linux/types.h>
|
|
#include <linux/io.h>
|
|
#include "nvmap_ioctl.h"
|
|
|
|
void kasan_memcpy_toio(void __iomem *to,
|
|
const void *from, size_t count)
|
|
{
|
|
while (count && (!IS_ALIGNED((unsigned long)to, 8) ||
|
|
!IS_ALIGNED((unsigned long)from, 8))) {
|
|
__raw_writeb(*(u8 *)from, to);
|
|
from++;
|
|
to++;
|
|
count--;
|
|
}
|
|
|
|
while (count >= 8) {
|
|
__raw_writeq(*(u64 *)from, to);
|
|
from += 8;
|
|
to += 8;
|
|
count -= 8;
|
|
}
|
|
|
|
while (count) {
|
|
__raw_writeb(*(u8 *)from, to);
|
|
from++;
|
|
to++;
|
|
count--;
|
|
}
|
|
}
|