Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Chris Zankel | c978b52 | 2016-08-10 18:36:44 +0300 | [diff] [blame] | 2 | /* |
3 | * Copyright (C) 2016 Cadence Design Systems Inc. | ||||
Chris Zankel | c978b52 | 2016-08-10 18:36:44 +0300 | [diff] [blame] | 4 | */ |
5 | |||||
Simon Glass | e47b2d6 | 2017-03-31 08:40:38 -0600 | [diff] [blame] | 6 | #include <relocate.h> |
Chris Zankel | c978b52 | 2016-08-10 18:36:44 +0300 | [diff] [blame] | 7 | #include <asm/sections.h> |
8 | #include <asm/string.h> | ||||
9 | |||||
10 | int clear_bss(void) | ||||
11 | { | ||||
Shiji Yang | ccea96f | 2023-08-03 09:47:17 +0800 | [diff] [blame^] | 12 | size_t len = (size_t)__bss_end - (size_t)__bss_start; |
Chris Zankel | c978b52 | 2016-08-10 18:36:44 +0300 | [diff] [blame] | 13 | |
Shiji Yang | ccea96f | 2023-08-03 09:47:17 +0800 | [diff] [blame^] | 14 | memset((void *)__bss_start, 0x00, len); |
Chris Zankel | c978b52 | 2016-08-10 18:36:44 +0300 | [diff] [blame] | 15 | return 0; |
16 | } |