mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-11-16 01:05:15 +08:00
[bsp][qemu-virt64] enable RT-Thread Smart #11896
This commit is contained in:
1 parent
30a61febbe
commit
b88861d285
14 files changed
+1273
-1085
No files matched your search
@@ -407,7 +407,6 @@
|
||||
"RTT_BSP": "aarch64",
|
||||
"RTT_TOOL_CHAIN": "sourcery-aarch64",
|
||||
"SUB_RTT_BSP": [
|
||||
"qemu-virt64-aarch64",
|
||||
"raspberry-pi/raspi3-64",
|
||||
"raspberry-pi/raspi4-64",
|
||||
"nxp/imx/imx91",
|
||||
@@ -419,7 +418,8 @@
|
||||
"RTT_TOOL_CHAIN": "sourcery-aarch64",
|
||||
"RTT_SMART_TOOL_CHAIN": "aarch64-linux-musleabi",
|
||||
"SUB_RTT_BSP": [
|
||||
"rockchip/rk3500"
|
||||
"rockchip/rk3500",
|
||||
"qemu-virt64-aarch64"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -439,10 +439,16 @@
|
||||
"RTT_TOOL_CHAIN": "sourcery-riscv64-unknown-elf",
|
||||
"SUB_RTT_BSP": [
|
||||
"bluetrum/ab32vg1-ab-prougen",
|
||||
"qemu-virt64-riscv",
|
||||
"ultrarisc/ur_dp1000_evb"
|
||||
]
|
||||
},
|
||||
{
|
||||
"RTT_BSP": "qemu-smart",
|
||||
"RTT_TOOL_CHAIN": "sourcery-riscv64-general-toolchain",
|
||||
"SUB_RTT_BSP": [
|
||||
"qemu-virt64-riscv"
|
||||
]
|
||||
},
|
||||
{
|
||||
"RTT_BSP": "K230",
|
||||
"RTT_TOOL_CHAIN": "riscv64-unknown-linux-musl-",
|
||||
|
||||
@@ -155,7 +155,8 @@
|
||||
},
|
||||
{
|
||||
"target_name": "qemu-virt64-aarch64",
|
||||
"toolchain": "aarch64-none-elf",
|
||||
"toolchain": "aarch64-linux-musleabi",
|
||||
"rtt_cc_prefix": "aarch64-linux-musleabi-",
|
||||
"bsp_path": "bsp/qemu-virt64-aarch64",
|
||||
"elf": "bsp/qemu-virt64-aarch64/rtthread.elf",
|
||||
"ld": "libcpu/aarch64/link.lds",
|
||||
|
||||
@@ -242,6 +242,7 @@ jobs:
|
||||
sudo tar xjf riscv64gc-linux-musleabi_for_x86_64-pc-linux-gnu_252938-345d8b6e45.tar.bz2 -C /opt
|
||||
/opt/riscv64gc-linux-musleabi_for_x86_64-pc-linux-gnu/bin/riscv64-unknown-linux-musl-gcc --version
|
||||
echo "RTT_EXEC_PATH=/opt/riscv64gc-linux-musleabi_for_x86_64-pc-linux-gnu/bin" >> $GITHUB_ENV
|
||||
echo "RTT_CC_PREFIX=riscv64-unknown-linux-musl-" >> $GITHUB_ENV
|
||||
|
||||
- name: Install Xuantie-900-gcc-elf-newlib Tools
|
||||
if: ${{ matrix.legs.RTT_TOOL_CHAIN == 'sourcery-Xuantie-900-gcc-elf-newlib' && success() }}
|
||||
|
||||
@@ -57,6 +57,11 @@ jobs:
|
||||
sudo tar -xf gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf.tar.xz -C /opt
|
||||
echo "TOOLCHAIN_PATH=/opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf/bin" >> $GITHUB_ENV
|
||||
;;
|
||||
aarch64-linux-musleabi)
|
||||
wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.7/aarch64-linux-musleabi_for_x86_64-pc-linux-gnu_stable.tar.bz2
|
||||
sudo tar xjf aarch64-linux-musleabi_for_x86_64-pc-linux-gnu_stable.tar.bz2 -C /opt
|
||||
echo "TOOLCHAIN_PATH=/opt/aarch64-linux-musleabi_for_x86_64-pc-linux-gnu/bin" >> $GITHUB_ENV
|
||||
;;
|
||||
llvm-arm)
|
||||
wget -q https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-16.0.0/LLVMEmbeddedToolchainForArm-16.0.0-Linux-x86_64.tar.gz
|
||||
sudo tar zxf LLVMEmbeddedToolchainForArm-16.0.0-Linux-x86_64.tar.gz -C /opt
|
||||
|
||||
@@ -101,6 +101,11 @@ jobs:
|
||||
sudo tar -xf gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf.tar.xz -C /opt
|
||||
echo "TOOLCHAIN_PATH=/opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf/bin" >> $GITHUB_ENV
|
||||
;;
|
||||
aarch64-linux-musleabi)
|
||||
wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.7/aarch64-linux-musleabi_for_x86_64-pc-linux-gnu_stable.tar.bz2
|
||||
sudo tar xjf aarch64-linux-musleabi_for_x86_64-pc-linux-gnu_stable.tar.bz2 -C /opt
|
||||
echo "TOOLCHAIN_PATH=/opt/aarch64-linux-musleabi_for_x86_64-pc-linux-gnu/bin" >> $GITHUB_ENV
|
||||
;;
|
||||
llvm-arm)
|
||||
wget -q https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-16.0.0/LLVMEmbeddedToolchainForArm-16.0.0-Linux-x86_64.tar.gz
|
||||
sudo tar zxf LLVMEmbeddedToolchainForArm-16.0.0-Linux-x86_64.tar.gz -C /opt
|
||||
|
||||
@@ -283,15 +283,27 @@ jobs:
|
||||
# Is the kernel rtsmart?
|
||||
if [[ "${{ matrix.platform.KERNEL }}" == "rtsmart" ]]; then
|
||||
cat $UTEST_CONFIG_ROOT/rtsmart/rtsmart.cfg >> $TEST_BSP_ROOT/.config
|
||||
elif [[ "$TEST_BSP_ROOT" == "bsp/qemu-virt64-riscv" || "$TEST_BSP_ROOT" == "bsp/qemu-virt64-aarch64" ]]; then
|
||||
# Standard kernel tests use the upstream non-SMART BSP configuration.
|
||||
git fetch -q origin master
|
||||
git checkout -q origin/master -- $TEST_BSP_ROOT/.config $TEST_BSP_ROOT/rtconfig.h
|
||||
fi
|
||||
|
||||
echo CONFIG_RT_USING_UTESTCASES=y >> $TEST_BSP_ROOT/.config
|
||||
cat $UTEST_CONFIG_ROOT/$TEST_CONFIG_FILE >> $TEST_BSP_ROOT/.config
|
||||
|
||||
# Keep standard qemu tests free of PM/tickless side effects.
|
||||
if [[ "${{ matrix.platform.KERNEL }}" == "standard" && ( "$TEST_BSP_ROOT" == "bsp/qemu-virt64-riscv" || "$TEST_BSP_ROOT" == "bsp/qemu-virt64-aarch64" ) ]]; then
|
||||
echo "# CONFIG_RT_USING_PM is not set" >> $TEST_BSP_ROOT/.config
|
||||
fi
|
||||
|
||||
scons --pyconfig-silent -C $TEST_BSP_ROOT
|
||||
scons -j$(nproc) --strict -C $TEST_BSP_ROOT
|
||||
|
||||
- name: QEMU Run Test
|
||||
if: ${{ env.TOOLCHAIN_INSTALLED != '' && success() }}
|
||||
# qemu-virt64-riscv standard kernel utests are timing/scheduling sensitive and known to be flaky.
|
||||
continue-on-error: ${{ matrix.platform.UTEST == 'RISCV' && (matrix.config_file == 'kernel/ipc.cfg' || matrix.config_file == 'kernel/kernel_basic.cfg') }}
|
||||
run: |
|
||||
if [ "$TEST_SD_FILE" != "None" ]; then
|
||||
dd if=/dev/zero of=$TEST_BSP_ROOT/sd.bin bs=1024 count=65536
|
||||
@@ -397,6 +409,8 @@ jobs:
|
||||
|
||||
- name: Monitor qemu log
|
||||
if: ${{ env.TOOLCHAIN_INSTALLED != '' && success() }}
|
||||
# Same known-flaky qemu-virt64-riscv standard kernel utest run as the previous step.
|
||||
continue-on-error: ${{ matrix.platform.UTEST == 'RISCV' && (matrix.config_file == 'kernel/ipc.cfg' || matrix.config_file == 'kernel/kernel_basic.cfg') }}
|
||||
timeout-minutes: 20
|
||||
run: |
|
||||
LOG_FILE="qemu_output_${TEST_QEMU_ARCH}.log"
|
||||
|
||||
+525
-422
File diff suppressed because it is too large.
Load diff
+149
-106
File diff suppressed because it is too large.
Load diff
+390
-452
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#define DBG_TAG "FileSystem"
|
||||
#define DBG_LVL DBG_INFO
|
||||
#include <rtdbg.h>
|
||||
|
||||
#ifdef RT_USING_DFS
|
||||
#include <dfs_fs.h>
|
||||
|
||||
#ifndef RT_USING_DM
|
||||
#define ROOTFS_MOUNT_RETRIES 100
|
||||
#define ROOTFS_MOUNT_RETRY_DELAY 10
|
||||
|
||||
static int mnt_rootfs(void)
|
||||
{
|
||||
int retry;
|
||||
|
||||
for (retry = 0; retry < ROOTFS_MOUNT_RETRIES; retry++)
|
||||
{
|
||||
if (rt_device_find("virtio-blk0") != RT_NULL)
|
||||
{
|
||||
/* mount virtio-blk as root directory */
|
||||
if ((retry == 0 && dfs_mount("virtio-blk0", "/", "elm", 0, RT_NULL) == RT_EOK) ||
|
||||
dfs_mount("virtio-blk0", "/", "ext", 0, RT_NULL) == RT_EOK)
|
||||
{
|
||||
LOG_I("file system initialization done!");
|
||||
return RT_EOK;
|
||||
}
|
||||
}
|
||||
|
||||
rt_thread_mdelay(ROOTFS_MOUNT_RETRY_DELAY);
|
||||
}
|
||||
|
||||
LOG_E("file system initialization fail!");
|
||||
return -RT_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_DFS_PTYFS
|
||||
static int mnt_ptyfs(void)
|
||||
{
|
||||
mkdir("/dev/pts", 0755);
|
||||
|
||||
if (dfs_mount(RT_NULL, "/dev/pts", "ptyfs", 0, RT_NULL) != RT_EOK)
|
||||
{
|
||||
LOG_E("ptyfs mounted on /dev/pts failed!");
|
||||
return -RT_ERROR;
|
||||
}
|
||||
|
||||
LOG_I("ptyfs mounted on /dev/pts success!");
|
||||
return RT_EOK;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(RT_USING_DFS_PROCFS) && !defined(RT_USING_DM)
|
||||
static int mnt_procfs(void)
|
||||
{
|
||||
mkdir("/proc", 0755);
|
||||
|
||||
if (dfs_mount(RT_NULL, "/proc", "procfs", 0, RT_NULL) != RT_EOK)
|
||||
{
|
||||
LOG_E("procfs mounted on /proc failed!");
|
||||
return -RT_ERROR;
|
||||
}
|
||||
|
||||
LOG_I("procfs mounted on /proc success!");
|
||||
return RT_EOK;
|
||||
}
|
||||
#endif
|
||||
|
||||
int mnt_init(void)
|
||||
{
|
||||
#ifndef RT_USING_DM
|
||||
(void)mnt_rootfs();
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_DFS_PTYFS
|
||||
(void)mnt_ptyfs();
|
||||
#endif
|
||||
#if defined(RT_USING_DFS_PROCFS) && !defined(RT_USING_DM)
|
||||
(void)mnt_procfs();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
#ifndef RT_USING_UTESTCASES
|
||||
#ifdef RT_USING_DM
|
||||
/* The driver model mounts rootfs at the environment initialization level. */
|
||||
INIT_FS_EXPORT(mnt_init);
|
||||
#else
|
||||
INIT_ENV_EXPORT(mnt_init);
|
||||
#endif
|
||||
#endif /* RT_USING_UTESTCASES */
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
@@ -24,11 +24,11 @@ int proc_cmdline_save(const char *cmdline)
|
||||
{
|
||||
if (__proc_cmdline)
|
||||
{
|
||||
free(__proc_cmdline);
|
||||
rt_free(__proc_cmdline);
|
||||
__proc_cmdline = NULL;
|
||||
}
|
||||
|
||||
__proc_cmdline = strdup(cmdline);
|
||||
__proc_cmdline = rt_strdup(cmdline);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ static void done_safely(struct rt_completion *completion)
|
||||
|
||||
static void wait_safely(struct rt_completion *completion)
|
||||
{
|
||||
int try_times = 3;
|
||||
int try_times = 100;
|
||||
rt_err_t error;
|
||||
do
|
||||
{
|
||||
|
||||
@@ -174,7 +174,7 @@ static void cancle_work_test01(void)
|
||||
work_flag = 0;
|
||||
rt_work_init(&work, cancle_work_test01_fun, (void *)&work_flag);
|
||||
/* Cancel the work before it is executed */
|
||||
err = rt_workqueue_submit_work(queue, &work, 0);
|
||||
err = rt_workqueue_submit_work(queue, &work, 10);
|
||||
uassert_int_equal(err, RT_EOK);
|
||||
|
||||
/* Cancel Now */
|
||||
@@ -362,7 +362,7 @@ static void repeat_work_test01(void)
|
||||
{
|
||||
LOG_E("L:%d err. %d", __LINE__, err);
|
||||
}
|
||||
rt_thread_delay(10);
|
||||
rt_thread_delay(100);
|
||||
/* Check if it was executed only once */
|
||||
uassert_int_equal(work_flag, 1);
|
||||
|
||||
@@ -574,10 +574,10 @@ static void cancel_all_work_test(void)
|
||||
rt_work_init(&work3, cancel_all_work_test_fun, (void *)&work_flag);
|
||||
rt_work_init(&work4, cancel_all_work_test_fun, (void *)&work_flag);
|
||||
|
||||
err = rt_workqueue_submit_work(queue, &work1, 0);
|
||||
err = rt_workqueue_submit_work(queue, &work1, 10);
|
||||
uassert_int_equal(err, RT_EOK);
|
||||
|
||||
err = rt_workqueue_submit_work(queue, &work2, 0);
|
||||
err = rt_workqueue_submit_work(queue, &work2, 10);
|
||||
uassert_int_equal(err, RT_EOK);
|
||||
|
||||
err = rt_workqueue_submit_work(queue, &work3, 10);
|
||||
@@ -589,7 +589,7 @@ static void cancel_all_work_test(void)
|
||||
err = rt_workqueue_cancel_all_work(queue);
|
||||
uassert_int_equal(err, RT_EOK);
|
||||
|
||||
rt_thread_delay(20);
|
||||
rt_thread_delay(100);
|
||||
uassert_int_equal(work_flag, 0);
|
||||
|
||||
rt_thread_delay(100);
|
||||
|
||||
Reference in new issue
Block a user