mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-20 16:01:10 +08:00
or1k: Fix critical handling in malloc locks
Only on first call to the recursive malloc lock the restore value of exception enable fields is stored. * libc/sys/or1k/mlock.c: Fix exception enable saving
This commit is contained in:
parent
0d04c03829
commit
4098f69c43
@ -1,3 +1,7 @@
|
||||
2015-08-07 Stefan Wallentowitz <stefan.wallentowitz@tum.de>
|
||||
|
||||
* libc/sys/or1k/mlock.c: Fix exception enable saving
|
||||
|
||||
2015-08-03 Shoichi Sakon <s-sakon@ap.jp.nec.com>
|
||||
|
||||
* libc/stdio/vfwscanf.c (__SVFWSCANF_R): Convert wrong usage of va_arg
|
||||
|
@ -65,7 +65,9 @@ void __malloc_lock(struct _reent *ptr) {
|
||||
}
|
||||
|
||||
// Store the TEE and IEE flags for later restore
|
||||
_or1k_malloc_lock_restore = restore;
|
||||
if (_or1k_malloc_lock_cnt == 0) {
|
||||
_or1k_malloc_lock_restore = restore;
|
||||
}
|
||||
|
||||
// Increment counter. The lock may be accessed recursively
|
||||
_or1k_malloc_lock_cnt++;
|
||||
@ -85,7 +87,7 @@ void __malloc_unlock(struct _reent *ptr) {
|
||||
// unset lock
|
||||
_or1k_malloc_lock = 0;
|
||||
// Restore flags
|
||||
or1k_critical_end(_or1k_malloc_lock_restore);
|
||||
or1k_critical_end(restore);
|
||||
}
|
||||
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user