summaryrefslogtreecommitdiff
path: root/test/tx/cmake/module_qemu/src/module_preamble.S
blob: 4991544ecc1e3171ebfdfa9bba489a79e52d40fc (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
/***************************************************************************
 * 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.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
 **************************************************************************/

@ Module preamble shared by every test module.  The property word comes from
@ the build, as TEST_MODULE_PROPERTIES, so one source serves the protected and
@ the privileged modules; everything else is the layout the Cortex-M module
@ ports document.  Every module names its start function module_start.

#ifndef TEST_MODULE_PROPERTIES
#error "TEST_MODULE_PROPERTIES must be defined by the build"
#endif

    .syntax unified
    .section .preamble, "ax"
    .align  4

    .global __txm_module_preamble
    .global module_start
    .global _txm_module_thread_shell_entry
    .global _txm_module_callback_request_thread_entry

__txm_module_preamble:
    .dc.l   0x4D4F4455                                          @ Module ID
    .dc.l   0x6                                                 @ Module major version
    .dc.l   0x1                                                 @ Module minor version
    .dc.l   32                                                  @ Preamble size in 32-bit words
    .dc.l   0x7E57C0DE                                          @ Application-defined module ID
    .dc.l   TEST_MODULE_PROPERTIES                              @ Properties: GNU, and the test's mode
    .dc.l   _txm_module_thread_shell_entry - . - 0              @ Shell entry
    .dc.l   module_start - . - 0                                @ Start thread entry
    .dc.l   0                                                   @ Stop thread entry, none
    .dc.l   1                                                   @ Start/stop thread priority
    .dc.l   1024                                                @ Start/stop thread stack size
    .dc.l   _txm_module_callback_request_thread_entry - . - 0   @ Callback thread entry
    .dc.l   1                                                   @ Callback thread priority
    .dc.l   1024                                                @ Callback thread stack size
    .dc.l   __code_size__                                       @ Code size, from the link
    .dc.l   __data_size__                                       @ Data size, from the link
    .rept   16
    .dc.l   0                                                   @ Reserved
    .endr