1 /*
2  * FreeRTOS Kernel V11.1.0
3  * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4  * Copyright (c) 2021 Raspberry Pi (Trading) Ltd.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining a copy of
9  * this software and associated documentation files (the "Software"), to deal in
10  * the Software without restriction, including without limitation the rights to
11  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
12  * the Software, and to permit persons to whom the Software is furnished to do so,
13  * subject to the following conditions:
14  *
15  * The above copyright notice and this permission notice shall be included in all
16  * copies or substantial portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
20  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
21  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
22  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24  *
25  * https://www.FreeRTOS.org
26  * https://github.com/FreeRTOS
27  */
28 
29 #ifndef FREERTOS_SDK_CONFIG_H
30 #define FREERTOS_SDK_CONFIG_H
31 
32 #ifndef __ASSEMBLER__
33     #include "FreeRTOSConfig.h"
34     #include "rp2040_config.h"
35     #ifndef PICO_USE_MALLOC_MUTEX
36         /* malloc needs to be made thread safe */
37         #define PICO_USE_MALLOC_MUTEX    1
38     #endif /* PICO_USE_MALLOC_MUTEX */
39     #if ( configSUPPORT_PICO_SYNC_INTEROP == 1 )
40         /* increase the amount of time it may reasonably take to wake us up */
41         #ifndef PICO_TIME_SLEEP_OVERHEAD_ADJUST_US
42             #define PICO_TIME_SLEEP_OVERHEAD_ADJUST_US    150
43         #endif
44 
45         #define lock_owner_id_t                           uint32_t
46         extern uint32_t ulPortLockGetCurrentOwnerId( void );
47         #define lock_get_caller_owner_id()    ulPortLockGetCurrentOwnerId()
48         #define LOCK_INVALID_OWNER_ID                     ( ( uint32_t ) -1 )
49 
50         struct lock_core;
51         #ifndef lock_internal_spin_unlock_with_wait
52             extern void vPortLockInternalSpinUnlockWithWait( struct lock_core * pxLock,
53                                                              uint32_t ulSave );
54             #define lock_internal_spin_unlock_with_wait( lock, save )    vPortLockInternalSpinUnlockWithWait( lock, save )
55         #endif
56 
57         #ifndef lock_internal_spin_unlock_with_notify
58             extern void vPortLockInternalSpinUnlockWithNotify( struct lock_core * pxLock,
59                                                                uint32_t save );
60             #define lock_internal_spin_unlock_with_notify( lock, save )    vPortLockInternalSpinUnlockWithNotify( lock, save );
61         #endif
62 
63         #ifndef lock_internal_spin_unlock_with_best_effort_wait_or_timeout
64             extern bool xPortLockInternalSpinUnlockWithBestEffortWaitOrTimeout( struct lock_core * pxLock,
65                                                                                 uint32_t ulSave,
66                                                                                 absolute_time_t uxUntil );
67             #define lock_internal_spin_unlock_with_best_effort_wait_or_timeout( lock, save, until ) \
68     xPortLockInternalSpinUnlockWithBestEffortWaitOrTimeout( lock, save, until )
69         #endif
70     #endif /* configSUPPORT_PICO_SYNC_INTEROP */
71 
72     #if ( configSUPPORT_PICO_TIME_INTEROP == 1 )
73         extern void xPortSyncInternalYieldUntilBefore( absolute_time_t t );
74         #define sync_internal_yield_until_before( t )    xPortSyncInternalYieldUntilBefore( t )
75     #endif /* configSUPPORT_PICO_TIME_INTEROP */
76 #endif /* __ASSEMBLER__ */
77 #endif /* ifndef FREERTOS_SDK_CONFIG_H */
78