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