blob: a499590c75bc5f143ef9dd008b36262b63e027de [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Chris Zankel1387dab2016-08-10 18:36:44 +03002/*
3 * Copyright (C) 2016 Cadence Design Systems Inc.
Chris Zankel1387dab2016-08-10 18:36:44 +03004 */
5
Simon Glass6ab91072017-03-31 08:40:38 -06006#include <relocate.h>
Chris Zankel1387dab2016-08-10 18:36:44 +03007#include <asm/sections.h>
8#include <asm/string.h>
9
10int clear_bss(void)
11{
Shiji Yangeff11fa2023-08-03 09:47:17 +080012 size_t len = (size_t)__bss_end - (size_t)__bss_start;
Chris Zankel1387dab2016-08-10 18:36:44 +030013
Shiji Yangeff11fa2023-08-03 09:47:17 +080014 memset((void *)__bss_start, 0x00, len);
Chris Zankel1387dab2016-08-10 18:36:44 +030015 return 0;
16}