From 2fc73a05b3f84a811d55527111c234cb4ca4616f Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Mon, 10 Mar 2025 15:31:30 +0800 Subject: [PATCH] feat(newlib): removed some unecessary IRAM attributes for newlib functions --- components/newlib/src/reent_init.c | 2 +- components/newlib/src/time.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/components/newlib/src/reent_init.c b/components/newlib/src/reent_init.c index b4a393702c..45bb7d42e1 100644 --- a/components/newlib/src/reent_init.c +++ b/components/newlib/src/reent_init.c @@ -19,7 +19,7 @@ * to the streams of the global struct _reent, which are initialized in * startup code. */ -void IRAM_ATTR esp_reent_init(struct _reent* r) +void esp_reent_init(struct _reent* r) { memset(r, 0, sizeof(*r)); _REENT_STDIN(r) = _REENT_STDIN(_GLOBAL_REENT); diff --git a/components/newlib/src/time.c b/components/newlib/src/time.c index 5638a28be7..ff67fe8850 100644 --- a/components/newlib/src/time.c +++ b/components/newlib/src/time.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -152,7 +152,7 @@ WEAK_UNLESS_TIMEFUNC_IMPL int adjtime(const struct timeval *delta, struct timeva #endif } -clock_t IRAM_ATTR _times_r(struct _reent *r, struct tms *ptms) +clock_t _times_r(struct _reent *r, struct tms *ptms) { clock_t t = xTaskGetTickCount() * (portTICK_PERIOD_MS * CLK_TCK / 1000); ptms->tms_cstime = 0; @@ -164,7 +164,7 @@ clock_t IRAM_ATTR _times_r(struct _reent *r, struct tms *ptms) return (clock_t) tv.tv_sec; } -WEAK_UNLESS_TIMEFUNC_IMPL int IRAM_ATTR _gettimeofday_r(struct _reent *r, struct timeval *tv, void *tz) +WEAK_UNLESS_TIMEFUNC_IMPL int _gettimeofday_r(struct _reent *r, struct timeval *tv, void *tz) { (void) tz; @@ -174,6 +174,8 @@ WEAK_UNLESS_TIMEFUNC_IMPL int IRAM_ATTR _gettimeofday_r(struct _reent *r, struct tv->tv_sec = microseconds / 1000000; tv->tv_usec = microseconds % 1000000; } + __errno_r(r) = ENOSYS; + return 0; #else __errno_r(r) = ENOSYS;