Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Chris Zankel | 1387dab | 2016-08-10 18:36:44 +0300 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2016 Cadence Design Systems Inc. |
Chris Zankel | 1387dab | 2016-08-10 18:36:44 +0300 | [diff] [blame] | 4 | */ |
| 5 | |
Simon Glass | 6ab9107 | 2017-03-31 08:40:38 -0600 | [diff] [blame] | 6 | #include <relocate.h> |
Chris Zankel | 1387dab | 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 | eff11fa | 2023-08-03 09:47:17 +0800 | [diff] [blame] | 12 | size_t len = (size_t)__bss_end - (size_t)__bss_start; |
Chris Zankel | 1387dab | 2016-08-10 18:36:44 +0300 | [diff] [blame] | 13 | |
Shiji Yang | eff11fa | 2023-08-03 09:47:17 +0800 | [diff] [blame] | 14 | memset((void *)__bss_start, 0x00, len); |
Chris Zankel | 1387dab | 2016-08-10 18:36:44 +0300 | [diff] [blame] | 15 | return 0; |
| 16 | } |