Merge pull request #511 from ourairquality/newlib-locks

Newlib: implement locks
This commit is contained in:
Ruslan V. Uss 2017-12-14 08:30:20 +05:00 committed by GitHub
commit c3ae04c93f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 3442 additions and 44 deletions

View file

@ -4,6 +4,23 @@
BSD Licensed as described in the file LICENSE
*/
#include "open_esplibs.h"
#include "stdlib.h"
#include "stdint.h"
/*
* This replaces a dynamic allocation, a call to zalloc(), from within a
* critical section in the ppTask. The allocation aquired the malloc lock and
* doing so withing a critical section is not safe because it might preempt
* another task which is not possible from within a critical section. The data
* is written to the rtc memory, and was then freed. The freeing has been
* patched to be a nop.
*/
static const uint32_t pp_zeros[8];
void *_ppz20(size_t n)
{
return &pp_zeros;
}
#if OPEN_LIBPP_PP
// The contents of this file are only built if OPEN_LIBPHY_PHY_CHIP_SLEEP is set to true