summaryrefslogtreecommitdiff
path: root/test/freertos/fixtures/FreeRTOSConfig.h
blob: 017b7171f24c8d70d9bc6ff471bf7906f6338fd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/***************************************************************************
 * Copyright (C) 2026 Eclipse ThreadX contributors
 *
 * This program and the accompanying materials are made available under the
 * terms of the MIT License which is available at
 * https://opensource.org/licenses/MIT.
 *
 * AI Disclosure: This file was largely AI-generated by Claude Code (Opus 5).
 * The AI-generated portions may be considered public domain (CC0-1.0)
 * and not subject to the project's licence. The human contributor has
 * reviewed and verified that the code is correct.
 *
 * SPDX-License-Identifier: MIT and CC0-1.0
 **************************************************************************/

/**************************************************************************/
/**                                                                       */
/** ThreadX Component                                                     */
/**                                                                       */
/**   FreeRTOS compatibility layer regression test configuration          */
/**                                                                       */
/**************************************************************************/

/* Configuration used to build the compatibility layer under test. It follows
   the shipped template in utility/rtos_compatibility_layers/FreeRTOS/
   config_template, with the choices a test build needs called out below.  */

#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H

#define configTICK_RATE_HZ                         (1000u)
#define configMAX_PRIORITIES                       (32u)
#define configMINIMAL_STACK_SIZE                   (512u)

/* Large enough that a handful of leaked descriptors cannot exhaust it. The
   tests therefore never infer a leak from an allocation failure; they count
   the byte pool operations directly.  */
#define configTOTAL_HEAP_SIZE                      (1024u * 128u)

#define configUSE_16_BIT_TICKS                      0
#define configSTACK_DEPTH_TYPE                     uint32_t

/* Task deletion is included so that the idle task, and with it the teardown
   path the tests exercise, is built.  */
#define INCLUDE_vTaskDelete                     1

/* The tests drive the error paths deliberately, so neither assertion may halt
   the run. A failed expectation is reported by the harness instead.  */
#define configASSERT(x)
#define TX_FREERTOS_ASSERT_FAIL()

/* The harness calls tx_freertos_init() from tx_application_define(), so the
   automatic initialization path is not wanted here.  */
#define TX_FREERTOS_AUTO_INIT 0

/* FreeRTOS.h selects portDISABLE_INTERRUPTS() by compiler rather than by
   target, so a GNU build resolves it to the bare metal __disable_interrupts()
   intrinsic, which does not exist when the layer is hosted on Linux. Both
   macros are guarded with #ifndef, so the definitions below pre-empt that
   choice with the ThreadX primitives the header's own fallback branch uses.  */
UINT _tx_thread_interrupt_disable(VOID);
VOID _tx_thread_interrupt_restore(UINT previous_posture);
#define portDISABLE_INTERRUPTS() _tx_thread_interrupt_disable()
#define portENABLE_INTERRUPTS()  _tx_thread_interrupt_restore(TX_INT_ENABLE)

#endif /* #ifndef FREERTOS_CONFIG_H */