Implement PIC loading in armv8-m qemu,
for example: load address-independent AP ELF in the bootloader,
and the text segment in AP ELF is XIP,
no need to apply for memory and modify it.
Two config:
bootloader abbreviation bl:
use romfs to load ap elf, use the boot command to parse and jump to ap
application abbreviation ap:
run os test
We need to compile ap first, then compile bl.
compile step:
./tools/configure.sh mps3-an547:ap
make -j20
mkdir -p pic
cp boot pic/.
genromfs -a 128 -f ../romfs.img -d pic
make distclean -j20
./tools/configure.sh mps3-an547:bl
make -j20
run qemu:
qemu-system-arm -M mps3-an547 -m 2G -nographic -kernel nuttx.bin \
-gdb tcp::1127 -device loader,file=../romfs.img,addr=0x60000000
nsh> boot /etc/boot
ap> ostest
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Need to start up a new to setup special registers use
`arm_pic_setupxcp`.
Note that CONFIG_BUILD_PIC compiles the entire NuttX image
as position-independent(PIC), enable CONFIG_PIC to load PIC
application code.
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
The default heap management in nuttx returns a valid memory address when malloc(0).
In sim_heap, malloc(0) returns NULL, aligning the behavior of sim_heap with mm_heap
The man manual describes malloc as follows:
https://man7.org/linux/man-pages/man3/malloc.3.html
The malloc() function allocates size bytes and returns a pointer
to the allocated memory. The memory is not initialized. If size
is 0, then malloc() returns a unique pointer value that can later
be successfully passed to free(). (See "Nonportable behavior"
for portability issues.)
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
In circbuf_get_read/writeptr, when circbuf is full, off == pos, and
*size = off - pos = 0. So add circbuf_is_full() condition to return
correct *size.
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Current 8 bits of uint8_t cannot represent sample rate bigger than
255,change uint8_t to uint32_t to expand sample rate range.
Signed-off-by: wurui3 <wurui3@xiaomi.com>
This has been broken at some point. Just fix it by copying the can frame and
the cmsg data into IOB, and fix devif_poll to copy out the full data.
The can drivers expect to find the timeout timestamp in the end of the frame.
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
smaller than it should be.
0x21000000 0x210105e8 0x210105f8 0x21044000
|----------------|-------------|--------------|
If there is already a range of 0x210105e8 - 0x210105f8, adding another
range of 0x21000000 - 0x21044000 would result in an incorrect range of
0x210105e8 - 0x21044000.
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
In the previous design, this member may be cleared or not cleared,
which results in the API's side effects not being a clear property.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
This commit addresses the issue of unauthorized writes to cntfrq_el0 during boot when not in EL3 mode.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
The segment of the Xen PVH boot protocol was not specified during linking and was placed before .loader.text, causing the boot to fail
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
Add the lib_bzero.c files to the build use it's API
Add the floating point math C files to the build to use it's API
Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>