File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,10 @@ extern "C" {
2525#include " osapi.h"
2626#include " mem.h"
2727}
28+ #include < Arduino.h>
29+ #include < cxxabi.h>
2830
31+ using __cxxabiv1::__guard;
2932
3033void *operator new (size_t size) {
3134 size = ((size + 3 ) & ~((size_t )0x3 ));
@@ -56,6 +59,34 @@ void __cxa_deleted_virtual(void) {
5659 panic ();
5760}
5861
62+ typedef struct {
63+ uint8_t guard;
64+ uint8_t ps;
65+ } guard_t ;
66+
67+ extern " C" int __cxa_guard_acquire (__guard* pg)
68+ {
69+ uint8_t ps = xt_rsil (15 );
70+ if (reinterpret_cast <guard_t *>(pg)->guard ) {
71+ xt_wsr_ps (ps);
72+ return 0 ;
73+ }
74+ reinterpret_cast <guard_t *>(pg)->ps = ps;
75+ return 1 ;
76+ }
77+
78+ extern " C" void __cxa_guard_release (__guard* pg)
79+ {
80+ reinterpret_cast <guard_t *>(pg)->guard = 1 ;
81+ xt_wsr_ps (reinterpret_cast <guard_t *>(pg)->ps );
82+ }
83+
84+ extern " C" void __cxa_guard_abort (__guard* pg)
85+ {
86+ xt_wsr_ps (reinterpret_cast <guard_t *>(pg)->ps );
87+ }
88+
89+
5990namespace std {
6091void __throw_bad_function_call () {
6192 panic ();
You can’t perform that action at this time.
0 commit comments