2012-12-02 12:55:18 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*
|
|
|
|
* Alternatively, this software may be distributed under the terms of the
|
|
|
|
* GNU General Public License ("GPL") version 2 as published by the Free
|
|
|
|
* Software Foundation.
|
|
|
|
*/
|
|
|
|
|
2020-05-11 01:40:05 +08:00
|
|
|
#include <log.h>
|
2018-11-24 12:29:26 +08:00
|
|
|
#include <mapmem.h>
|
2012-12-02 12:55:18 +08:00
|
|
|
#include <physmem.h>
|
2016-03-28 02:06:11 +08:00
|
|
|
#include <linux/compiler.h>
|
2023-12-15 02:16:58 +08:00
|
|
|
#include <linux/string.h>
|
2012-12-02 12:55:18 +08:00
|
|
|
|
2016-03-28 02:06:11 +08:00
|
|
|
phys_addr_t __weak arch_phys_memset(phys_addr_t s, int c, phys_size_t n)
|
2012-12-02 12:55:18 +08:00
|
|
|
{
|
2018-11-24 12:29:26 +08:00
|
|
|
void *s_ptr = map_sysmem(s, n);
|
2012-12-02 12:55:18 +08:00
|
|
|
|
|
|
|
assert(((phys_addr_t)(uintptr_t)s) == s);
|
|
|
|
assert(((phys_addr_t)(uintptr_t)(s + n)) == s + n);
|
2018-11-24 12:29:26 +08:00
|
|
|
|
2012-12-02 12:55:18 +08:00
|
|
|
return (phys_addr_t)(uintptr_t)memset(s_ptr, c, n);
|
|
|
|
}
|