Skip to content

proposed umm_malloc improvements #6274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Aug 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0af9c5e
Correct critical section with interrupt level preserving and nest s…
mhightower83 Jul 8, 2019
dc8fe13
Fixed. travis build complaint.
mhightower83 Jul 9, 2019
254259e
Merge branch 'master' into pr3
mhightower83 Jul 9, 2019
7b0a0c8
Changes for https://github.com/esp8266/Arduino/pull/6274#pullrequestr…
mhightower83 Jul 9, 2019
40c6e95
Merge branch 'pr3' of github.com:mhightower83/Arduino into pr3
mhightower83 Jul 9, 2019
472b1b4
Added requested comment and missing comment for UMM_CRITICAL_PERIOD_A…
mhightower83 Jul 10, 2019
c32d96e
Merge pull request #1 from esp8266/master
mhightower83 Jul 10, 2019
1de2ec4
Updated comments and update xt_rsil()
mhightower83 Jul 10, 2019
28c823f
Merge branch 'pr3' of github.com:mhightower83/Arduino into pr3
mhightower83 Jul 15, 2019
5e8927e
Merge branch 'master' into pr3
earlephilhower Jul 16, 2019
08cc09e
Moved xt_rsil&co (pulled in __STRINGIFY) definitions out of
mhightower83 Jul 16, 2019
2d39911
Added "#ifndef CORE_MOCK" around conflicted area.
mhightower83 Jul 16, 2019
c858f5c
Merge branch 'master' into pr3
earlephilhower Jul 19, 2019
72d5d78
Merge branch 'master' into pr3
d-a-v Jul 21, 2019
9d35f34
Moved performance measurment and ESP specific definitions to
mhightower83 Jul 22, 2019
9b69df9
Merge branch 'pr3' of github.com:mhightower83/Arduino into pr3
mhightower83 Jul 22, 2019
e69676c
Commented out umm analyze. Delay CRITICAL_SECTION_EXIT() in
mhightower83 Jul 23, 2019
ed49b3c
Missed file change. This commit has: Delay CRITICAL_SECTION_EXIT() in
mhightower83 Jul 27, 2019
a937f1e
2nd Path. Removed early release of critical section around memmove
mhightower83 Jul 27, 2019
909c6b9
improved variable name
mhightower83 Jul 27, 2019
996ac76
Resolved ISR OOM concern with `_umm_realloc()`
mhightower83 Aug 1, 2019
e86e7ca
Resolved ISR OOM concern in _umm_realloc()
mhightower83 Aug 1, 2019
b81e87f
Update to keep access to alternate printf in one file.
mhightower83 Aug 3, 2019
a41873a
Merge branch 'master' into pr3
earlephilhower Aug 3, 2019
1bf9eb0
Updated to use ISR safe versions of memmove, memcpy, and memset.
mhightower83 Aug 7, 2019
5854e29
Merge branch 'master' into pr3
earlephilhower Aug 17, 2019
5d1a95f
Update umm_malloc.cpp
devyte Aug 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions cores/esp8266/Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,30 +142,9 @@ void timer0_detachInterrupt(void);
void ets_intr_lock();
void ets_intr_unlock();

#ifndef __STRINGIFY
#define __STRINGIFY(a) #a
#endif

// these low level routines provide a replacement for SREG interrupt save that AVR uses
// but are esp8266 specific. A normal use pattern is like
//
//{
// uint32_t savedPS = xt_rsil(1); // this routine will allow level 2 and above
// // do work here
// xt_wsr_ps(savedPS); // restore the state
//}
//
// level (0-15), interrupts of the given level and above will be active
// level 15 will disable ALL interrupts,
// level 0 will enable ALL interrupts,
//
#define xt_rsil(level) (__extension__({uint32_t state; __asm__ __volatile__("rsil %0," __STRINGIFY(level) : "=a" (state) :: "memory"); state;}))
#define xt_wsr_ps(state) __asm__ __volatile__("wsr %0,ps; isync" :: "a" (state) : "memory")

#define interrupts() xt_rsil(0)
#define noInterrupts() xt_rsil(15)


#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
#define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() )
#define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() )
Expand Down
4 changes: 1 addition & 3 deletions cores/esp8266/Esp.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,7 @@ class EspClass {
#ifndef CORE_MOCK
uint32_t EspClass::getCycleCount()
{
uint32_t ccount;
__asm__ __volatile__("esync; rsr %0,ccount":"=a" (ccount));
return ccount;
return esp_get_cycle_count();
}

#endif // !defined(CORE_MOCK)
Expand Down
27 changes: 26 additions & 1 deletion cores/esp8266/core_esp8266_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,32 @@
#define WIFI_HAS_EVENT_CALLBACK


#ifndef __STRINGIFY
#define __STRINGIFY(a) #a
#endif

// these low level routines provide a replacement for SREG interrupt save that AVR uses
// but are esp8266 specific. A normal use pattern is like
//
//{
// uint32_t savedPS = xt_rsil(1); // this routine will allow level 2 and above
// // do work here
// xt_wsr_ps(savedPS); // restore the state
//}
//
// level (0-15), interrupts of the given level and above will be active
// level 15 will disable ALL interrupts,
// level 0 will enable ALL interrupts,
//
#ifndef CORE_MOCK
#define xt_rsil(level) (__extension__({uint32_t state; __asm__ __volatile__("rsil %0," __STRINGIFY(level) : "=a" (state) :: "memory"); state;}))
#define xt_wsr_ps(state) __asm__ __volatile__("wsr %0,ps; isync" :: "a" (state) : "memory")

#endif
inline uint32_t esp_get_cycle_count() {
uint32_t ccount;
__asm__ __volatile__("rsr %0,ccount":"=a"(ccount));
return ccount;
}
#endif // not CORE_MOCK

#endif
Loading