Skip to content

Commit

Permalink
pvPortCalloc() added
Browse files Browse the repository at this point in the history
  • Loading branch information
tsandmann committed Sep 25, 2022
1 parent a1796ea commit b7dd723
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "git",
"url": "https://github.com/tsandmann/freertos-teensy"
},
"version": "10.5.0-1",
"version": "10.5.0-2",
"authors": [
{
"name": "Richard Barry",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=freertos-teensy
version=10.5.0-1
version=10.5.0-2
author=Richard Barry <info@freertos.org>
maintainer=Timo Sandmann
sentence=<h3>FreeRTOS Real Time Operating System implemented for Teensy (3.5, 3.6, 4.0, 4.1).</h3>
Expand Down
14 changes: 10 additions & 4 deletions src/portable/portmacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,20 +264,26 @@
return malloc( xSize );
}

void* calloc( size_t, size_t ) __attribute__( ( __malloc__, __warn_unused_result__, __alloc_size__( 1, 2 ) ) );
portFORCE_INLINE static void* pvPortCalloc( size_t xNum, size_t xSize ) PRIVILEGED_FUNCTION __attribute__( ( __malloc__, __warn_unused_result__, __alloc_size__( 1, 2 ) ) );
portFORCE_INLINE static void* pvPortCalloc( size_t xNum, size_t xSize ) PRIVILEGED_FUNCTION {
return calloc( xNum, xSize );
}

void free( void* );
portFORCE_INLINE static void vPortFree( void* pv ) PRIVILEGED_FUNCTION {
free( pv );
}

portFORCE_INLINE static uint32_t __get_PRIMASK(void) {
portFORCE_INLINE static uint32_t __get_PRIMASK( void ) {
uint32_t result;

__asm volatile ("MRS %0, primask" : "=r" (result) );
__asm volatile( "MRS %0, primask" : "=r" ( result ) );
return result;
}

portFORCE_INLINE static void __set_PRIMASK(uint32_t pri_mask) {
__asm volatile ("MSR primask, %0" : : "r" (pri_mask) : "memory");
portFORCE_INLINE static void __set_PRIMASK( uint32_t pri_mask ) {
__asm volatile( "MSR primask, %0" : : "r" ( pri_mask ) : "memory" );
}

#ifdef __cplusplus
Expand Down

0 comments on commit b7dd723

Please sign in to comment.