qemu-arm: Add license and copyright to files missing them.
All of these files are first-party code written from scratch as part of
this repository, and were added when the top-level MIT license was active,
so they have an MIT license by default. Tracing back the git history show
the original authors/source/copyright as follows:
- main.c, mpconfigport.h: copied from the bare-arm port [1].
- test_main.c: added in [2].
- mphalport.h: added in [3] then updated in [4].
- mps2.ld, nrf51.ld, stm32.ld, uart.h: added in [4].
- imx6.ld, uart.c, startup.c: added in [4] and updated in [5].
[1] Commit c55721582282f282d33e35e458a2944890210ebc in 2014, the initial
bare-arm port; see related ee857853d60a135685c5088e5492dfe6e8a5acb0.
[2] Commit c1c32d65af038ba1b2a2a8dd69e3f7e63eac5f3e in 2014, initial
qemu-arm CI tests.
[3] Commit b0a15aa73540f82ef47c9492af7ce196d1b1a6e9 in 2016, enabling
extmods and their tests.
[4] Commit e7332b05841549a41614e522285639dcaa7bd526 in 2018, big refactor.
[5] Commit b84406f3133a36a703a1506d754fc046dd955922 in 2021, adding
Cortex-A9 support.
Signed-off-by: Damien George <damien@micropython.org>
2024-06-11 12:13:37 +10:00
|
|
|
/*
|
|
|
|
|
* This file is part of the MicroPython project, http://micropython.org/
|
|
|
|
|
*
|
|
|
|
|
* The MIT License (MIT)
|
|
|
|
|
*
|
|
|
|
|
* Copyright (c) 2014-2024 Damien P. George
|
|
|
|
|
*
|
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
|
*
|
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
|
*
|
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
|
* THE SOFTWARE.
|
|
|
|
|
*/
|
|
|
|
|
|
2014-04-16 17:27:23 +01:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
2017-06-30 09:22:17 +02:00
|
|
|
// options to control how MicroPython is built
|
2014-04-16 17:27:23 +01:00
|
|
|
|
2024-01-29 12:46:03 +11:00
|
|
|
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES)
|
2021-05-25 22:16:08 +10:00
|
|
|
|
|
|
|
|
#if defined(__ARM_ARCH_ISA_ARM)
|
|
|
|
|
#define MICROPY_EMIT_ARM (1)
|
|
|
|
|
#define MICROPY_EMIT_INLINE_THUMB (1)
|
|
|
|
|
#elif defined(__ARM_ARCH_ISA_THUMB)
|
2015-01-12 12:07:42 +00:00
|
|
|
#define MICROPY_EMIT_THUMB (1)
|
|
|
|
|
#define MICROPY_EMIT_INLINE_THUMB (1)
|
2021-05-25 22:16:08 +10:00
|
|
|
#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void *)((mp_uint_t)(p) | 1))
|
2024-08-29 13:51:39 +10:00
|
|
|
#elif defined(__riscv)
|
|
|
|
|
#define MICROPY_EMIT_RV32 (1)
|
2021-05-25 22:16:08 +10:00
|
|
|
#endif
|
|
|
|
|
|
2017-06-06 00:23:05 +03:00
|
|
|
#define MICROPY_MALLOC_USES_ALLOCATED_SIZE (1)
|
|
|
|
|
#define MICROPY_MEM_STATS (1)
|
2015-01-12 12:07:42 +00:00
|
|
|
#define MICROPY_ENABLE_GC (1)
|
2024-08-12 11:32:28 +10:00
|
|
|
#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1)
|
2015-01-09 00:03:21 +00:00
|
|
|
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
|
2016-11-03 12:28:31 +11:00
|
|
|
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
|
2017-12-11 20:04:27 +02:00
|
|
|
#define MICROPY_WARNINGS (1)
|
2024-01-29 12:46:03 +11:00
|
|
|
#define MICROPY_PY_IO_IOBASE (0)
|
2024-09-04 17:06:25 +10:00
|
|
|
#define MICROPY_PY_SYS_PLATFORM "qemu"
|
2024-01-29 12:46:03 +11:00
|
|
|
#define MICROPY_PY_SYS_STDIO_BUFFER (0)
|
|
|
|
|
#define MICROPY_PY_SELECT (0)
|
|
|
|
|
#define MICROPY_PY_TIME (0)
|
|
|
|
|
#define MICROPY_PY_ASYNCIO (0)
|
2017-03-02 16:39:58 +11:00
|
|
|
#define MICROPY_PY_MACHINE (1)
|
2024-09-04 17:06:25 +10:00
|
|
|
#define MICROPY_PY_MACHINE_INCLUDEFILE "ports/qemu/modmachine.c"
|
2024-08-12 11:32:28 +10:00
|
|
|
#define MICROPY_PY_MACHINE_RESET (1)
|
2023-11-24 09:35:42 +11:00
|
|
|
#define MICROPY_PY_MACHINE_PIN_BASE (1)
|
2017-03-13 21:24:21 +11:00
|
|
|
#define MICROPY_VFS (1)
|
2014-04-16 17:27:23 +01:00
|
|
|
|
|
|
|
|
// type definitions for the specific machine
|
|
|
|
|
|
2015-04-04 22:04:53 +01:00
|
|
|
#define MP_SSIZE_MAX (0x7fffffff)
|
|
|
|
|
|
2014-04-16 17:27:23 +01:00
|
|
|
#define UINT_FMT "%lu"
|
|
|
|
|
#define INT_FMT "%ld"
|
|
|
|
|
|
2014-07-03 13:25:24 +01:00
|
|
|
typedef int32_t mp_int_t; // must be pointer size
|
|
|
|
|
typedef uint32_t mp_uint_t; // must be pointer size
|
2014-11-17 00:16:14 +02:00
|
|
|
typedef long mp_off_t;
|
2014-04-16 17:27:23 +01:00
|
|
|
|
2014-06-08 13:25:33 +01:00
|
|
|
// We need to provide a declaration/definition of alloca()
|
|
|
|
|
#include <alloca.h>
|
2017-12-11 20:04:27 +02:00
|
|
|
|
2024-01-29 12:46:03 +11:00
|
|
|
// We need an implementation of the log2 function which is not a macro.
|
|
|
|
|
#define MP_NEED_LOG2 (1)
|
|
|
|
|
|
2024-08-12 11:32:28 +10:00
|
|
|
#define MP_STATE_PORT MP_STATE_VM
|