rtems-libbsd


(1) rtems6默认没有networking

(2) rtems和 bsd版本匹配问题

master - branch intended for the RTEMS master which tracks the FreeBSD master branch. This branch must be used for libbsd development. Back ports to the 6-freebsd-12 are allowed.

6-freebsd-12 - branch intended for RTEMS 6 which tracks the FreeBSD stable/12 branch. This branch is maintained and regular updates from FreeBSD are planned. It is recommended for production systems.

5-freebsd-12 - branch belongs to the RTEMS 5 release. It is based on FreeBSD stable/12 branch. It is recommended for production systems that use RTEMS 5.

5 - branch belongs to the RTEMS 5 release. It is based on a FreeBSD development version.

freebsd-9.3 - branch for some RTEMS version with a FreeBSD 9.3 baseline. This branch is unmaintained. It is recommended to update to RTEMS 5 or 6.

4.11 - branch for the RTEMS 4.11 release series. This branch is unmaintained. It is recommended to update to RTEMS 5 or 6.
[root@centos7 rtems]# ls
aclocal.m4      config.ini      Doxyfile     LICENSE.BSD-2-Clause  LICENSE.NET     Makefile.in     spec
autom4te.cache  config.ini.bak  gccdeps.py   LICENSE.BSD-3-Clause  LICENSE.RPCXDR  Makefile.maint  testsuites
bsps            config.log      gccdeps.pyc  LICENSE.CC-BY-SA-4.0  long_gcc.py     README          waf
build           configure       INSTALL      LICENSE.GPL-2.0       MAINTAINERS     rtems-bsps      wscript
c               cpukit          LICENSE      LICENSE.JFFS2         make            rtemslogo.png   yaml
[root@centos7 rtems]# git branch 
  5
  master
* remotes/origin/5
[root@centos7 rtems-libbsd]# git branch --all
  master
* remotes/origin/5
  remotes/origin/6-freebsd-12
  remotes/origin/4.11
  remotes/origin/5
  remotes/origin/5-freebsd-12
  remotes/origin/6-freebsd-12
  remotes/origin/HEAD -> origin/master
  remotes/origin/freebsd-9.3
  remotes/origin/master
[root@centos7 rtems-libbsd]# qemu-system-riscv64 -M virt -kernel build/riscv-rtems6-rv64imafdc_medany-default/selectpollkqueue01.exe -bios none -serial stdio -display none


*** BEGIN OF TEST LIBBSD SELECT AND POLL AND KQUEUE AND PIPE 1 ***
*** TEST VERSION: 6.0.0.822ebb4cae2bb8bc9fe55915bd4acc4942fcd8ce
*** TEST STATE: EXPECTED_PASS
*** TEST BUILD: RTEMS_POSIX_API
*** TEST TOOLS: 10.3.1 20210409 (RTEMS 6, RSB 889cf95db0122bd1a6b21598569620c40ff2069d, Newlib eb03ac1)
nexus0: 
[zone: unpcb] kern.ipc.maxsockets limit reached
info: lo0: link state changed to UP
test select timeout
test select connect
worker: create new connect socket
worker: connect
test select read
worker: write
test select write
worker: read
test select close
worker: close
test pselect sigmask
test pselect timeout
test poll timeout
test poll connect
worker: create new connect socket
worker: connect
test poll read
worker: write
test poll write
worker: read
test poll close
worker: close
test kqueue timer
test kqueue timer
test kqueue connect
worker: create new connect socket
worker: connect
test kqueue read
worker: write
test kqueue write
worker: read
test kqueue close
worker: shutdown
test kqueue user
                             STACK USAGE BY THREAD
ID         NAME                  LOW        HIGH       CURRENT     AVAIL   USED
0x09010001 IDLE                  0x80196480 0x8019847f 0x801982c0   8176    488
0x0a010001 UI1                   0x8019a900 0x801a28ff 0x801a22f0  32752   4976
0x0a010002 TIME                  0x801a2ea0 0x801aae9f 0x801aad90  32752    480
0x0a010003 IRQS                  0x801aaeb0 0x801b2eaf 0x801b2d90  32752    336
0x0a010004 config_0              0x801d91f0 0x801e11ef 0x801e10c0  32752    352
0x0a010005 swi5: fast task       0x801e1520 0x801e951f 0x801e93d0  32752    384
0x0a010006 thread taskq          0x801e96f0 0x801f16ef 0x801f15c0  32752    352
0x0a010007 swi6: Giant tas       0x801f1a20 0x801f9a1f 0x801f98d0  32752    384
0x0a010008 swi6: task queu       0x801f9d50 0x80201d4f 0x80201c00  32752   1872
0x0a010009 kqueue_ctx task       0x80201f20 0x80209f1f 0x80209df0  32752    352
0x0a01000a swi1: netisr 0        0x8020a170 0x8021216f 0x80211d20  32752   1800
0x0a01000b bufdaemon             0x8023c3f0 0x802443ef 0x80244260  32752    880
0x0a01000c vnlru                 0x802444c0 0x8024c4bf 0x8024c2f0  32752    512
0x0a01000d syncer                0x8024c590 0x8025458f 0x802543c0  32752    512
0x0a01000e softirq_0             0x80254760 0x8025c75f 0x8025c630  32752    352
0x0a01000f bufspacedaemon-       0x8025c830 0x8026482f 0x802646d0  32752    400
0x0a010010 WORK                  0x80264900 0x802668ff 0x802663b0   8176   1576
0x00000000 Interrupt Stack       0x80198480 0x8019a47f 0x00000000   8176    432

*** END OF TEST LIBBSD SELECT AND POLL AND KQUEUE AND PIPE 1 ***


[ RTEMS shutdown ]
RTEMS version: 6.0.0.822ebb4cae2bb8bc9fe55915bd4acc4942fcd8ce
RTEMS tools: 10.3.1 20210409 (RTEMS 6, RSB 889cf95db0122bd1a6b21598569620c40ff2069d, Newlib eb03ac1)
executing thread ID: 0x08a010001
executing thread name: UI1

[root@centos7 development]# rpm -ivh tunctl-1.5-lp150.1.2.aarch64.rpm
warning: tunctl-1.5-lp150.1.2.aarch64.rpm: Header V3 RSA/SHA256 Signature, key ID 3dbdc284: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:tunctl-1.5-lp150.1.2             ################################# [100%]
[root@centos7 development]# tunctl -p -t qtap -u $(whoami)
Set 'qtap' persistent and owned by uid 0
[root@centos7 development]# ip link set dev qtap up
[root@centos7 development]#  ip addr add 169.254.1.1/16 dev qtap
[root@centos7 development]# ip addr show qtap
11: qtap:  mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether 3e:01:b5:63:ad:69 brd ff:ff:ff:ff:ff:ff
    inet 169.254.1.1/16 scope global qtap
       valid_lft forever preferred_lft forever
[root@centos7 development]#
[root@centos7 rtems-libbsd]# qemu-system-riscv64 -M virt -kernel build/riscv-rtems6-rv64imafdc_medany-default/media01.exe -bios none -serial stdio -display none


*** BEGIN OF TEST LIBBSD MEDIA 1 ***
*** TEST VERSION: 6.0.0.822ebb4cae2bb8bc9fe55915bd4acc4942fcd8ce
*** TEST STATE: USER_INPUT
*** TEST BUILD: RTEMS_POSIX_API
*** TEST TOOLS: 10.3.1 20210409 (RTEMS 6, RSB 889cf95db0122bd1a6b21598569620c40ff2069d, Newlib eb03ac1)
nexus0: 
info: lo0: link state changed to UP
info: ftpd: FTP daemon started (4 sessions max)
info: telnetd: started successfully on port 23

RTEMS Shell on /dev/console. Use 'help' to list commands.
SHLL [/] # info: version 6.2.1 starting
err: no valid interfaces found
warning: no interfaces have a carrier

SHLL [/] # telnet 169.254.159.156
telnet: command not found
SHLL [/] # ip a
ip: command not found
SHLL [/] # 
[root@centos7 rtems-libbsd]# qemu-system-riscv64 -M virt -kernel build/riscv-rtems6-rv64imafdc_medany-default/media01.exe -bios none -serial stdio -display none  -net tap,ifname=qtap,script=no,downscript=no  -net nic,model=cadence_gem,macaddr=0e:b0:ba:5e:ba:12
qemu-system-riscv64: warning: hub port hub0port1 has no peer
qemu-system-riscv64: warning: hub 0 with no nics
qemu-system-riscv64: warning: netdev hub0port1 has no peer
qemu-system-riscv64: warning: requested NIC (anonymous, model cadence_gem) was not created (not supported by this machine?)


*** BEGIN OF TEST LIBBSD MEDIA 1 ***
*** TEST VERSION: 6.0.0.822ebb4cae2bb8bc9fe55915bd4acc4942fcd8ce
*** TEST STATE: USER_INPUT
*** TEST BUILD: RTEMS_POSIX_API
*** TEST TOOLS: 10.3.1 20210409 (RTEMS 6, RSB 889cf95db0122bd1a6b21598569620c40ff2069d, Newlib eb03ac1)
nexus0: 
info: lo0: link state changed to UP
info: ftpd: FTP daemon started (4 sessions max)
info: telnetd: started successfully on port 23

RTEMS Shell on /dev/console. Use 'help' to list commands.
SHLL [/] # info: version 6.2.1 starting
err: no valid interfaces found
warning: no interfaces have a carrier
[root@centos7 rtems-libbsd]# bash start.sh
qemu-system-riscv64: could not configure /dev/net/tun (qtap): Device or resource busy
[root@centos7 rtems-libbsd]# ps -elf | grep qemu-system-riscv64
2 T root      35458 114368  1  80   0 -  6854 do_sig 06:07 pts/1    00:00:02 qemu-system-riscv64 -M virt -kernel build/riscv-rtems6-rv64imafdc_medany-default/media01.exe -bios none -serial stdio -display none
2 T root      35480 114368  0  80   0 -  6856 do_sig 06:08 pts/1    00:00:01 qemu-system-riscv64 -M virt -kernel build/riscv-rtems6-rv64imafdc_medany-default/media01.exe -bios none -serial stdio -display none -net tap,ifname=qtap,script=no,downscript=no -net nic,model=cadence_gem,macaddr=0e:b0:ba:5e:ba:12
0 S root      35543 114368  0  80   0 -  1729 pipe_w 06:11 pts/1    00:00:00 grep --color=auto qemu-system-riscv64
[root@centos7 rtems-libbsd]# kill -9 35458
[root@centos7 rtems-libbsd]# kill -9 35480
[1]-  Killed                  qemu-system-riscv64 -M virt -kernel build/riscv-rtems6-rv64imafdc_medany-default/media01.exe -bios none -serial stdio -display none
[root@centos7 rtems-libbsd]# 
emu-system-riscv64 \
>   --machine virt \
>   --nographic \
>   --bios default

OpenSBI v0.5 (Oct  9 2019 12:03:04)
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name          : QEMU Virt Machine
Platform HART Features : RV64ACDFIMSU
Platform Max HARTs     : 8
Current Hart           : 0
Firmware Base          : 0x80000000
Firmware Size          : 116 KB
Runtime SBI Version    : 0.2

PMP0: 0x0000000080000000-0x000000008001ffff (A)
PMP1: 0x0000000000000000-0xffffffffffffffff (A,R,W,X)
QEMU: Terminated
qemu-system-riscv64 -cpu help
any
rv64
rv64gcsu-v1.10.0
rv64gcsu-v1.9.1
rv64imacu-nommu
sifive-e51
sifive-u54
qemu-system-riscv64 -nic \?
Available netdev backend types:
socket
hubport
tap
user
l2tpv3
bridge
vhost-user
(gdb) b bsp_interrupt_vector_enable
Breakpoint 1 at 0x800e5780: file ../../../bsps/riscv/riscv/irq/irq.c, line 284.
(gdb) c
The program is not being run.
(gdb) target rmote:1234
Undefined target command: "rmote:1234".  Try "help target".
(gdb) target remote:1234
Remote debugging using :1234
0x0000000000001000 in ?? ()
(gdb) c
Continuing.

Breakpoint 1, bsp_interrupt_vector_enable (vector=vector@entry=1) at ../../../bsps/riscv/riscv/irq/irq.c:284
284       if (RISCV_INTERRUPT_VECTOR_IS_EXTERNAL(vector)) {
(gdb) bt
#0  bsp_interrupt_vector_enable (vector=vector@entry=1) at ../../../bsps/riscv/riscv/irq/irq.c:284
#1  0x00000000800e6560 in bsp_interrupt_entry_install_first (entry=0x80386c40, options=1, vector=1) at ../../../bsps/shared/irq/irq-generic.c:201
#2  bsp_interrupt_entry_install (entry=0x80386c40, options=1, vector=1) at ../../../bsps/shared/irq/irq-generic.c:226
#3  rtems_interrupt_entry_install (vector=vector@entry=1, options=options@entry=1, entry=entry@entry=0x80386c40) at ../../../bsps/shared/irq/irq-generic.c:280
#4  0x00000000800e65b0 in rtems_interrupt_handler_install (vector=vector@entry=1, info=info@entry=0x8015e600 "Clock", options=options@entry=1, routine=routine@entry=0x800e4f54 , arg=arg@entry=0x0)
    at ../../../bsps/shared/irq/irq-handler-install.c:107
#5  0x00000000800e4fc2 in riscv_clock_handler_install () at ../../../bsps/riscv/riscv/clock/clockdrv.c:109
#6  _Clock_Initialize () at ../../../bsps/riscv/riscv/clock/../../../shared/dev/clock/clockimpl.h:216
#7  0x00000000800f3c90 in rtems_initialize_executive () at ../../../cpukit/sapi/src/exinit.c:116
#8  0x00000000800e49cc in boot_card (cmdline=out>) at ../../../bsps/shared/start/bootcard.c:55
#9  0x0000000080000042 in bsp_section_start_begin () at ../../../bsps/riscv/shared/start/start.S:86
Backtrace stopped: frame did not save the PC
(gdb) c
Continuing.

Breakpoint 1, bsp_interrupt_vector_enable (vector=vector@entry=12) at ../../../bsps/riscv/riscv/irq/irq.c:284
284       if (RISCV_INTERRUPT_VECTOR_IS_EXTERNAL(vector)) {
(gdb) bt
#0  bsp_interrupt_vector_enable (vector=vector@entry=12) at ../../../bsps/riscv/riscv/irq/irq.c:284
#1  0x00000000800e6560 in bsp_interrupt_entry_install_first (entry=0x8038fbc0, options=0, vector=12) at ../../../bsps/shared/irq/irq-generic.c:201
#2  bsp_interrupt_entry_install (entry=0x8038fbc0, options=0, vector=12) at ../../../bsps/shared/irq/irq-generic.c:226
#3  rtems_interrupt_entry_install (vector=vector@entry=12, options=options@entry=0, entry=entry@entry=0x8038fbc0) at ../../../bsps/shared/irq/irq-generic.c:280
#4  0x00000000800e65b0 in rtems_interrupt_handler_install (vector=out>, info=info@entry=0x8019e8c0 "NS16550", options=options@entry=0, routine=0x800e6104 , arg=0x8038f6f0) at ../../../bsps/shared/irq/irq-handler-install.c:107
#5  0x00000000800e60d8 in ns16550_initialize_interrupts (ctx=out>, ctx=out>, isr=out>, tty=out>) at ../../../bsps/shared/dev/serial/ns16550-context.c:366
#6  ns16550_open (tty=0x8038f6f0, base=0x8037e540 , term=out>, args=out>) at ../../../bsps/shared/dev/serial/ns16550-context.c:432
#7  0x00000000800ec926 in rtems_termios_open_tty (major=out>, minor=out>, args=args@entry=0x803868f0 <_ISR_Stack_area_begin+7728>, tty=0x8038f6f0, device_node=device_node@entry=0x80386c70, callbacks=callbacks@entry=0x0)
    at ../../../cpukit/libcsupport/src/termios.c:549
#8  0x00000000800ecd70 in rtems_termios_imfs_open (iop=out>, path=out>, oflag=out>, mode=out>) at ../../../cpukit/libcsupport/src/termios.c:2093
#9  0x00000000800eb620 in do_open (mode=out>, oflag=0, path=0x8012a730 "/dev/console", iop=0x8034dd70 ) at ../../../cpukit/libcsupport/src/open.c:123
#10 open (path=path@entry=0x8012a730 "/dev/console", oflag=oflag@entry=0) at ../../../cpukit/libcsupport/src/open.c:165
#11 0x00000000800eb734 in rtems_libio_post_driver () at ../../../cpukit/libcsupport/src/open_dev_console.c:31
#12 0x00000000800f3c90 in rtems_initialize_executive () at ../../../cpukit/sapi/src/exinit.c:116
#13 0x00000000800e49cc in boot_card (cmdline=out>) at ../../../bsps/shared/start/bootcard.c:55
#14 0x0000000080000042 in bsp_section_start_begin () at ../../../bsps/riscv/shared/start/start.S:86
Backtrace stopped: frame did not save the PC
(gdb) c
Continuing.
(gdb) c
Continuing.

Breakpoint 1, _bsd_device_attach (dev=dev@entry=0x80542e60) at ../../freebsd/sys/kern/subr_bus.c:2993
2993            device_sysctl_init(dev);
(gdb) bt
#0  _bsd_device_attach (dev=dev@entry=0x80542e60) at ../../freebsd/sys/kern/subr_bus.c:2993
#1  0x000000008005abe8 in _bsd_device_probe_and_attach (dev=0x80542e60) at ../../freebsd/sys/kern/subr_bus.c:2953
#2  _bsd_bus_generic_new_pass (dev=out>) at ../../freebsd/sys/kern/subr_bus.c:4187
#3  0x00000000800599b2 in BUS_NEW_PASS (_dev=0x80541ac0) at ../../rtemsbsd/include/rtems/bsd/local/bus_if.h:1046
#4  _bsd_bus_set_pass (pass=out>) at ../../freebsd/sys/kern/subr_bus.c:994
#5  0x0000000080051e1a in _bsd_mi_startup () at ../../freebsd/sys/kern/init_main.c:331
#6  0x000000008003f332 in rtems_bsd_initialize () at ../../rtemsbsd/rtems/rtems-kernel-init.c:235
#7  0x0000000080005136 in Init (arg=out>) at ../../testsuite/include/rtems/bsd/test/default-network-init.h:239
#8  0x00000000800f6bce in _Thread_Handler () at ../../../cpukit/score/src/threadhandler.c:145
#9  0x00000000800f6b7c in _Thread_Get (id=out>, lock_context=0x802db438 ) at ../../../cpukit/score/src/threadget.c:44
Backtrace stopped: frame did not save the PC
(gdb) c
Continuing.

 _bsd_device_probe_and_attach (dev=0x80542e60) at ../../freebsd/sys/kern/subr_bus.c:2955

qemu-system-aarch64

qemu-system-aarch64 -no-reboot -nographic -serial mon:stdio  -machine virt,gic-version=3 -cpu cortex-a53 -m 4096 -kernel  build/aarch64-rtems6-a53_lp64_qemu-default/media01.exe   -netdev tap,id=net0,ifname=qtap,script=no,downscript=no  -device e1000,netdev=net0,id=net0,mac=52:54:00:c9:18:24


*** BEGIN OF TEST LIBBSD MEDIA 1 ***
*** TEST VERSION: 6.0.0.671f126a3a8e6ce5da87aa75c7205fb764e95c78
*** TEST STATE: USER_INPUT
*** TEST BUILD: RTEMS_POSIX_API
*** TEST TOOLS: 10.3.1 20210409 (RTEMS 6, RSB 889cf95db0122bd1a6b21598569620c40ff2069d, Newlib eb03ac1)
nexus0: 
info: lo0: link state changed to UP
info: ftpd: FTP daemon started (4 sessions max)
info: telnetd: started successfully on port 23

RTEMS Shell on /dev/console. Use 'help' to list commands.
SHLL [/] # info: version 6.2.1 starting
err: no valid interfaces found
warning: no interfaces have a carrier
[root@centos7 rtems-libbsd-a64]# ls  ./build/aarch64-rtems6-a53_lp64_qemu-default/testsuite/include/rtems/bsd/test/
network-config.h
typedef enum {
    RTEMS_BSD_RES_IRQ = 1,
    RTEMS_BSD_RES_MEMORY = 3
} rtems_bsd_device_resource_type;

typedef struct {
    rtems_bsd_device_resource_type type;
    unsigned long start_request;
    unsigned long start_actual;
} rtems_bsd_device_resource;

typedef struct {
    const char *name;
    int unit;
    size_t resource_count;
    const rtems_bsd_device_resource *resources;
    const struct sysinit *driver_reference;
} rtems_bsd_device;

#define RTEMS_BSD_DEFINE_NEXUS_DEVICE(name, unit, resource_count, resources) \
    extern struct sysinit SYSINIT_ENTRY_NAME(name##_nexusmodule); \
    RTEMS_BSD_DEFINE_SET_ITEM(nexus, name##unit, rtems_bsd_device) = \
        { #name, unit, (resource_count), (resources), \
            &SYSINIT_ENTRY_NAME(name##_nexusmodule) }
qemu-system-aarch64 -no-reboot -nographic -serial mon:stdio  -machine virt,gic-version=3 -cpu cortex-a53 -m 4096 -net none -kernel  build/aarch64-rtems6-a53_lp64_qemu-default/selectpollkqueue01.exe  -netdev tap,id=mynet0,ifname=qtap,script=no,downscript=no -device e1000,netdev=mynet0,mac=52:55:00:d1:55:01


*** BEGIN OF TEST LIBBSD SELECT AND POLL AND KQUEUE AND PIPE 1 ***
*** TEST VERSION: 6.0.0.671f126a3a8e6ce5da87aa75c7205fb764e95c78
*** TEST STATE: EXPECTED_PASS
*** TEST BUILD: RTEMS_POSIX_API
*** TEST TOOLS: 10.3.1 20210409 (RTEMS 6, RSB 889cf95db0122bd1a6b21598569620c40ff2069d, Newlib eb03ac1)
nexus0: 
[zone: unpcb] kern.ipc.maxsockets limit reached
info: lo0: link state changed to UP
test select timeout
test select connect
worker: create new connect socket
worker: connect
test select read
worker: write
test select write
worker: read
test select close
worker: close
test pselect sigmask
test pselect timeout
test poll timeout
test poll connect
worker: create new connect socket
worker: connect
test poll read
worker: write
test poll write
worker: read
test poll close
worker: close
test kqueue timer
test kqueue timer
test kqueue connect
worker: create new connect socket
worker: connect
test kqueue read
worker: write
test kqueue write
worker: read
test kqueue close
worker: shutdown
test kqueue user
                             STACK USAGE BY THREAD
ID         NAME                  LOW        HIGH       CURRENT     AVAIL   USED
0x09010001 IDLE                  0x4025fc00 0x402623ff 0x402620b0  10224    944
0x0a010001 UI1                   0x40264fc0 0x4026cfbf 0x4026c990  32752   5056
0x0a010002 TIME                  0x4026d530 0x4027552f 0x40275410  32752    528
0x0a010003 IRQS                  0x40275540 0x4027d53f 0x4027d420  32752    384
0x0a010004 config_0              0x402a3880 0x402ab87f 0x402ab720  32752    448
0x0a010005 swi5: fast task       0x402abbb0 0x402b3baf 0x402b3a60  32752    432
0x0a010006 thread taskq          0x402b3d80 0x402bbd7f 0x402bbc20  32752    448
0x0a010007 swi6: Giant tas       0x402bc0b0 0x402c40af 0x402c3f60  32752    432
0x0a010008 swi6: task queu       0x402c43e0 0x402cc3df 0x402cc290  32752   1968
0x0a010009 kqueue_ctx task       0x402cc5b0 0x402d45af 0x402d4450  32752    448
0x0a01000a swi1: netisr 0        0x402d4800 0x402dc7ff 0x402dc3b0  32752   2096
0x0a01000b bufdaemon             0x40306a80 0x4030ea7f 0x4030e8a0  32752   1264
0x0a01000c vnlru                 0x4030eb50 0x40316b4f 0x403168e0  32752    720
0x0a01000d syncer                0x40316c20 0x4031ec1f 0x4031e9e0  32752    672
0x0a01000e softirq_0             0x4031edf0 0x40326def 0x40326c90  32752    448
0x0a01000f bufspacedaemon-       0x40326ec0 0x4032eebf 0x4032ed20  32752    512
0x0a010010 WORK                  0x4032ef90 0x4033178f 0x40331230  10224   1616
0x00000000 Interrupt Stack       0x40262400 0x40264bff 0x00000000  10224    480

*** END OF TEST LIBBSD SELECT AND POLL AND KQUEUE AND PIPE 1 ***

 testsuite/include/rtems/bsd/test/network-config.h

#ifndef _RTEMS_BSD_TEST_NETWORK_CONFIG_H_
#define _RTEMS_BSD_TEST_NETWORK_CONFIG_H_
//#define LIBBSP_ARM_XILINX_ZYNQ_BSP_H

#include 

#if defined(LIBBSP_ARM_ALTERA_CYCLONE_V_BSP_H)
  #define NET_CFG_INTERFACE_0 "dwc0"
//#elif  defined(LIBBSP_AARCH64_A53_QEMU_BSP_H)
//  #define NET_CFG_INTERFACE_0 "dwc0"
#elif defined(LIBBSP_ARM_REALVIEW_PBX_A9_BSP_H)
  #define NET_CFG_INTERFACE_0 "smc0"
#elif defined(LIBBSP_ARM_XILINX_ZYNQ_BSP_H)
  #define NET_CFG_INTERFACE_0 "cgem0"
#elif defined(LIBBSP_M68K_GENMCF548X_BSP_H)
  #define NET_CFG_INTERFACE_0 "fec0"
#elif defined(LIBBSP_ARM_LPC32XX_BSP_H)
  #define NET_CFG_INTERFACE_0 "lpe0"
#elif defined(LIBBSP_POWERPC_QORIQ_BSP_H)
  #if QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT)
    #define NET_CFG_INTERFACE_0 "fm1m3"
  #else
    #define NET_CFG_INTERFACE_0 "tsec0"
  #endif
#elif defined(LIBBSP_ARM_ATSAM_BSP_H)
  #define NET_CFG_INTERFACE_0 "if_atsam0"
#else
  #define NET_CFG_INTERFACE_0 "lo0"
#endif

#define NET_CFG_SELF_IP "192.168.0.10"

#define NET_CFG_NETMASK "255.255.0.0"

#define NET_CFG_PEER_IP "192.168.0.20"

#define NET_CFG_GATEWAY_IP "192.168.0.1"

LIBBSP_ARM_XILINX_ZYNQ_BSP_H

rtemsbsd/include/bsp/nexus-devices.h

#elif defined(LIBBSP_ARM_XILINX_ZYNQ_BSP_H)

#include 

RTEMS_BSD_DRIVER_XILINX_ZYNQ_SLCR;
RTEMS_BSD_DRIVER_XILINX_ZYNQ_SDHCI0;
RTEMS_BSD_DRIVER_XILINX_ZYNQ_SDHCI1;
RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
RTEMS_BSD_DRIVER_E1000PHY;
RTEMS_BSD_DRIVER_MMC;

#elif defined(LIBBSP_AARCH64_XILINX_ZYNQMP_BSP_H)

#include 

RTEMS_BSD_DRIVER_XILINX_ZYNQMP_SLCR;
/* Qemu only applies user-mode networking to the first interface by default, so
 * all 4 CGEM instances must be configured in the Qemu arguments using
 * "-nic user,model=cadence_gem" for each nic.
 *
 * CGEM3 is used for LibBSD because all Zynq Ultrascale+ MPSoC dev boards treat
 * the highest-mapped CGEM as the primary interface.
 */
RTEMS_BSD_DRIVER_XILINX_ZYNQMP_CGEM0(ZYNQMP_IRQ_ETHERNET_0);
RTEMS_BSD_DRIVER_XILINX_ZYNQMP_CGEM1(ZYNQMP_IRQ_ETHERNET_1);
RTEMS_BSD_DRIVER_XILINX_ZYNQMP_CGEM2(ZYNQMP_IRQ_ETHERNET_2);
RTEMS_BSD_DRIVER_XILINX_ZYNQMP_CGEM3(ZYNQMP_IRQ_ETHERNET_3);
RTEMS_BSD_DRIVER_E1000PHY;
RTEMS_BSD_DRIVER_UKPHY;

RTEMS_BSD_DRIVER_XILINX_ZYNQMP_SDHCI0;
RTEMS_BSD_DRIVER_XILINX_ZYNQMP_SDHCI1;
RTEMS_BSD_DRIVER_MMC;
#if !defined(RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0)
  #define RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(_irq)                \
    RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM(0, 0xe000b000, _irq)
#if !defined(RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM)
  #define RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM(_num, _base, _irq)              \
    static const rtems_bsd_device_resource cgem ## _num ## _res[] = {       \
      {                                                                     \
        .type = RTEMS_BSD_RES_MEMORY,                                       \
        .start_request = 0,                                                 \
        .start_actual = (_base)                                             \
      }, {                                                                  \
        .type = RTEMS_BSD_RES_IRQ,                                          \
        .start_request = 0,                                                 \
        .start_actual = (_irq)                                              \
      }                                                                     \
    };                                                                      \
    RTEMS_BSD_DEFINE_NEXUS_DEVICE(cgem, _num,                               \
                                  RTEMS_ARRAY_SIZE(cgem ## _num ## _res),   \
                                  &cgem ## _num ## _res[0])
#endif /* RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM */
#define RTEMS_BSD_DEFINE_NEXUS_DEVICE(name, unit, resource_count, resources) \
    extern struct sysinit SYSINIT_ENTRY_NAME(name##_nexusmodule); \
    RTEMS_BSD_DEFINE_SET_ITEM(nexus, name##unit, rtems_bsd_device) = \
        { #name, unit, (resource_count), (resources), \
            &SYSINIT_ENTRY_NAME(name##_nexusmodule) }
#define RTEMS_BSD_DEFINE_SET_ITEM(set, sym, type)                       \
        static RTEMS_BSD_SET_ALIGN( type ) type                         \
        const __set_##set##_sym_##sym                                   \
        __section(".rtemsroset.bsd." __STRING(set) ".content.1") __used
/*
 * E1000 PHY
 */
#if !defined(RTEMS_BSD_DRIVER_E1000PHY)
  #define RTEMS_BSD_DRIVER_E1000PHY               \
    SYSINIT_DRIVER_REFERENCE(e1000phy, miibus);
#endif /* RTEMS_BSD_DRIVER_E1000PHY */

 ./build/aarch64-rtems6-a53_lp64_qemu-default/testsuite/include/rtems/bsd/test/network-config.h

#ifndef _RTEMS_BSD_TEST_NETWORK_CONFIG_H_
#define _RTEMS_BSD_TEST_NETWORK_CONFIG_H_
#define LIBBSP_ARM_XILINX_ZYNQ_BSP_H
#include 

#if defined(LIBBSP_ARM_ALTERA_CYCLONE_V_BSP_H)
  #define NET_CFG_INTERFACE_0 "dwc0"
#elif defined(LIBBSP_ARM_REALVIEW_PBX_A9_BSP_H)
  #define NET_CFG_INTERFACE_0 "smc0"
#elif defined(LIBBSP_ARM_XILINX_ZYNQ_BSP_H)
  #define NET_CFG_INTERFACE_0 "cgem0"
#elif defined(LIBBSP_M68K_GENMCF548X_BSP_H)
  #define NET_CFG_INTERFACE_0 "fec0"
#elif defined(LIBBSP_ARM_LPC32XX_BSP_H)
  #define NET_CFG_INTERFACE_0 "lpe0"
#elif defined(LIBBSP_POWERPC_QORIQ_BSP_H)
  #if QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT)
    #define NET_CFG_INTERFACE_0 "fm1m3"
  #else
    #define NET_CFG_INTERFACE_0 "tsec0"
  #endif
#elif defined(LIBBSP_ARM_ATSAM_BSP_H)
  #define NET_CFG_INTERFACE_0 "if_atsam0"
In file included from ../../rtemsbsd/include/machine/rtems-bsd-config.h:58,
                 from ../../testsuite/include/rtems/bsd/test/default-network-init.h:297,
                 from ../../testsuite/debugger01/test_main.c:78:
../../rtemsbsd/include/bsp/nexus-devices.h:102:36: error: 'ZYNQ_IRQ_ETHERNET_0' undeclared here (not in a function)
  102 | RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
      |                                    ^~~~~~~~~~~~~~~~~~~
../../rtemsbsd/include/machine/rtems-bsd-nexus-bus.h:481:26: note: in definition of macro 'RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM'
  481 |         .start_actual = (_irq)                                              \
      |                          ^~~~
../../rtemsbsd/include/bsp/nexus-devices.h:102:1: note: in expansion of macro 'RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0'
  102 | RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from ../../rtemsbsd/include/machine/rtems-bsd-config.h:58,
                 from ../../testsuite/include/rtems/bsd/test/default-network-init.h:297,
                 from ../../testsuite/lagg01/test_main.c:106:
../../rtemsbsd/include/bsp/nexus-devices.h:102:36: error: 'ZYNQ_IRQ_ETHERNET_0' undeclared here (not in a function)
  102 | RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
      |                                    ^~~~~~~~~~~~~~~~~~~
../../rtemsbsd/include/machine/rtems-bsd-nexus-bus.h:481:26: note: in definition of macro 'RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM'
  481 |         .start_actual = (_irq)                                              \
      |                          ^~~~
../../rtemsbsd/include/bsp/nexus-devices.h:102:1: note: in expansion of macro 'RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0'
  102 | RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from ../../rtemsbsd/include/machine/rtems-bsd-config.h:58,
                 from ../../testsuite/include/rtems/bsd/test/default-network-init.h:297,
                 from ../../testsuite/pf02/test_main.c:193:
../../rtemsbsd/include/bsp/nexus-devices.h:102:36: error: 'ZYNQ_IRQ_ETHERNET_0' undeclared here (not in a function)
  102 | RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
      |                                    ^~~~~~~~~~~~~~~~~~~
../../rtemsbsd/include/machine/rtems-bsd-nexus-bus.h:481:26: note: in definition of macro 'RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM'
  481 |         .start_actual = (_irq)                                              \
      |                          ^~~~
../../rtemsbsd/include/bsp/nexus-devices.h:102:1: note: in expansion of macro 'RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0'
  102 | RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from ../../rtemsbsd/include/machine/rtems-bsd-config.h:58,
                 from ../../testsuite/include/rtems/bsd/test/default-network-init.h:297,
                 from ../../testsuite/ping01/test_main.c:75:
../../rtemsbsd/include/bsp/nexus-devices.h:102:36: error: 'ZYNQ_IRQ_ETHERNET_0' undeclared here (not in a function)
  102 | RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
      |                                    ^~~~~~~~~~~~~~~~~~~
../../rtemsbsd/include/machine/rtems-bsd-nexus-bus.h:481:26: note: in definition of macro 'RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM'
  481 |         .start_actual = (_irq)                                              \
      |                          ^~~~
../../rtemsbsd/include/bsp/nexus-devices.h:102:1: note: in expansion of macro 'RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0'
  102 | RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from ../../rtemsbsd/include/machine/rtems-bsd-config.h:58,
                 from ../../testsuite/include/rtems/bsd/test/default-init.h:122,
                 from ../../testsuite/rcconf02/test_main.c:294:
../../rtemsbsd/include/bsp/nexus-devices.h:102:36: error: 'ZYNQ_IRQ_ETHERNET_0' undeclared here (not in a function)
  102 | RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
      |                                    ^~~~~~~~~~~~~~~~~~~
../../rtemsbsd/include/machine/rtems-bsd-nexus-bus.h:481:26: note: in definition of macro 'RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM'
  481 |         .start_actual = (_irq)                                              \
      |                          ^~~~
../../rtemsbsd/include/bsp/nexus-devices.h:102:1: note: in expansion of macro 'RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0'
  102 | RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from ../../rtemsbsd/include/machine/rtems-bsd-config.h:58,
                 from ../../testsuite/include/rtems/bsd/test/default-network-init.h:297,
                 from ../../testsuite/pf01/test_main.c:504:
../../rtemsbsd/include/bsp/nexus-devices.h:102:36: error: 'ZYNQ_IRQ_ETHERNET_0' undeclared here (not in a function)
  102 | RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
      |                                    ^~~~~~~~~~~~~~~~~~~
../../rtemsbsd/include/machine/rtems-bsd-nexus-bus.h:481:26: note: in definition of macro 'RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM'
  481 |         .start_actual = (_irq)                                              \
      |                          ^~~~
../../rtemsbsd/include/bsp/nexus-devices.h:102:1: note: in expansion of macro 'RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0'
  102 | RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from ../../rtemsbsd/include/machine/rtems-bsd-config.h:58,
                 from ../../testsuite/include/rtems/bsd/test/default-network-init.h:297,
                 from ../../testsuite/nfs01/test_main.c:411:
../../rtemsbsd/include/bsp/nexus-devices.h:102:36: error: 'ZYNQ_IRQ_ETHERNET_0' undeclared here (not in a function)
  102 | RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
      |                                    ^~~~~~~~~~~~~~~~~~~
../../rtemsbsd/include/machine/rtems-bsd-nexus-bus.h:481:26: note: in definition of macro 'RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM'
  481 |         .start_actual = (_irq)                                              \
      |                          ^~~~
../../rtemsbsd/include/bsp/nexus-devices.h:102:1: note: in expansion of macro 'RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0'
  102 | RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from ../../rtemsbsd/include/machine/rtems-bsd-config.h:58,
                 from ../../testsuite/include/rtems/bsd/test/default-network-init.h:297,
                 from ../../testsuite/telnetd01/test_main.c:86:
../../rtemsbsd/include/bsp/nexus-devices.h:102:36: error: 'ZYNQ_IRQ_ETHERNET_0' undeclared here (not in a function)
  102 | RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
      |                                    ^~~~~~~~~~~~~~~~~~~
../../rtemsbsd/include/machine/rtems-bsd-nexus-bus.h:481:26: note: in definition of macro 'RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM'
  481 |         .start_actual = (_irq)                                              \
      |                          ^~~~
../../rtemsbsd/include/bsp/nexus-devices.h:102:1: note: in expansion of macro 'RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0'
  102 | RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from ../../rtemsbsd/include/machine/rtems-bsd-config.h:58,
                 from ../../testsuite/include/rtems/bsd/test/default-network-init.h:297,
                 from ../../testsuite/vlan01/test_main.c:123:
../../rtemsbsd/include/bsp/nexus-devices.h:102:36: error: 'ZYNQ_IRQ_ETHERNET_0' undeclared here (not in a function)
  102 | RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
      |                                    ^~~~~~~~~~~~~~~~~~~
../../rtemsbsd/include/machine/rtems-bsd-nexus-bus.h:481:26: note: in definition of macro 'RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM'
  481 |         .start_actual = (_irq)                                              \
      |                          ^~~~
../../rtemsbsd/include/bsp/nexus-devices.h:102:1: note: in expansion of macro 'RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0'
  102 | RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from ../../rtemsbsd/include/machine/rtems-bsd-config.h:58,
                 from ../../testsuite/include/rtems/bsd/test/default-network-init.h:297,
                 from ../../testsuite/zerocopy01/test_main.c:252:
../../rtemsbsd/include/bsp/nexus-devices.h:102:36: error: 'ZYNQ_IRQ_ETHERNET_0' undeclared here (not in a function)
  102 | RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
      |                                    ^~~~~~~~~~~~~~~~~~~
../../rtemsbsd/include/machine/rtems-bsd-nexus-bus.h:481:26: note: in definition of macro 'RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM'
  481 |         .start_actual = (_irq)                                              \
      |                          ^~~~
../../rtemsbsd/include/bsp/nexus-devices.h:102:1: note: in expansion of macro 'RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0'
  102 | RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0(ZYNQ_IRQ_ETHERNET_0);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Waf: Leaving directory `/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default'
Build failed
 -> task in 'debugger01.exe' failed with exit status 1 (run with -v to display more information)
 -> task in 'lagg01.exe' failed with exit status 1 (run with -v to display more information)
 -> task in 'pf02.exe' failed with exit status 1 (run with -v to display more information)
 -> task in 'ping01.exe' failed with exit status 1 (run with -v to display more information)
 -> task in 'rcconf02.exe' failed with exit status 1 (run with -v to display more information)
 -> task in 'pf01.exe' failed with exit status 1 (run with -v to display more information)
 -> task in 'nfs01.exe' failed with exit status 1 (run with -v to display more information)
 -> task in 'telnetd01.exe' failed with exit status 1 (run with -v to display more information)
 -> task in 'vlan01.exe' failed with exit status 1 (run with -v to display more information)
 -> task in 'zerocopy01.exe' failed with exit status 1 (run with -v to display more information)

 添加 

#define ZYNQ_IRQ_ETHERNET_0 54

#ifndef _RTEMS_BSD_TEST_NETWORK_CONFIG_H_
#define _RTEMS_BSD_TEST_NETWORK_CONFIG_H_
#define LIBBSP_ARM_XILINX_ZYNQ_BSP_H
#define ZYNQ_IRQ_ETHERNET_0 54
#include 

#if defined(LIBBSP_ARM_ALTERA_CYCLONE_V_BSP_H)
  #define NET_CFG_INTERFACE_0 "dwc0"
#elif defined(LIBBSP_ARM_REALVIEW_PBX_A9_BSP_H)
  #define NET_CFG_INTERFACE_0 "smc0"
#elif defined(LIBBSP_ARM_XILINX_ZYNQ_BSP_H)
  #define NET_CFG_INTERFACE_0 "cgem0"
#elif defined(LIBBSP_M68K_GENMCF548X_BSP_H)
  #define NET_CFG_INTERFACE_0 "fec0"
#elif defined(LIBBSP_ARM_LPC32XX_BSP_H)
  #define NET_CFG_INTERFACE_0 "lpe0"
#elif defined(LIBBSP_POWERPC_QORIQ_BSP_H)
default/testsuite/include/rtems/bsd/test/network-config.h" 71L, 2685C written 
[root@centos7 rtems-libbsd-a64]# ./waf
Waf: Entering directory `/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default'
[1903/2024] Compiling testsuite/debugger01/test_main.c
[1924/2024] Compiling testsuite/lagg01/test_main.c
[1939/2024] Compiling testsuite/nfs01/test_main.c
[1944/2024] Compiling testsuite/pf01/test_main.c
[1945/2024] Compiling testsuite/pf02/test_main.c
[1946/2024] Compiling testsuite/ping01/test_main.c
[1953/2024] Compiling testsuite/rcconf02/test_main.c
[1967/2024] Compiling testsuite/telnetd01/test_main.c
[2013/2024] Compiling testsuite/vlan01/test_main.c
[2014/2024] Compiling testsuite/zerocopy01/test_main.c
[2015/2024] Linking build/aarch64-rtems6-a53_lp64_qemu-default/debugger01.exe
[2016/2024] Linking build/aarch64-rtems6-a53_lp64_qemu-default/lagg01.exe
[2017/2024] Linking build/aarch64-rtems6-a53_lp64_qemu-default/ping01.exe
[2018/2024] Linking build/aarch64-rtems6-a53_lp64_qemu-default/telnetd01.exe
[2019/2024] Linking build/aarch64-rtems6-a53_lp64_qemu-default/rcconf02.exe
[2020/2024] Linking build/aarch64-rtems6-a53_lp64_qemu-default/pf02.exe
[2021/2024] Linking build/aarch64-rtems6-a53_lp64_qemu-default/vlan01.exe
[2022/2024] Linking build/aarch64-rtems6-a53_lp64_qemu-default/zerocopy01.exe
[2023/2024] Linking build/aarch64-rtems6-a53_lp64_qemu-default/pf01.exe
[2024/2024] Linking build/aarch64-rtems6-a53_lp64_qemu-default/nfs01.exe
/root/development/rtems/compiler/6/lib/gcc/aarch64-rtems6/10.3.1/../../../../aarch64-rtems6/bin/ld: ./libbsd.a(if_cgem.c.20.o): in function `cgem_mediachange':
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/cadence/if_cgem.c:1760: undefined reference to `_bsd_cgem_set_ref_clk'
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/cadence/if_cgem.c:1760:(.text.cgem_miibus_statchg+0xb8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `_bsd_cgem_set_ref_clk'
collect2: error: ld returned 1 exit status

/root/development/rtems/compiler/6/lib/gcc/aarch64-rtems6/10.3.1/../../../../aarch64-rtems6/bin/ld: ./libbsd.a(if_cgem.c.20.o): in function `cgem_mediachange':
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/cadence/if_cgem.c:1760: undefined reference to `_bsd_cgem_set_ref_clk'
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/cadence/if_cgem.c:1760:(.text.cgem_miibus_statchg+0xb8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `_bsd_cgem_set_ref_clk'
collect2: error: ld returned 1 exit status

/root/development/rtems/compiler/6/lib/gcc/aarch64-rtems6/10.3.1/../../../../aarch64-rtems6/bin/ld: ./libbsd.a(if_cgem.c.20.o): in function `cgem_mediachange':
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/cadence/if_cgem.c:1760: undefined reference to `_bsd_cgem_set_ref_clk'
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/cadence/if_cgem.c:1760:(.text.cgem_miibus_statchg+0xb8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `_bsd_cgem_set_ref_clk'
collect2: error: ld returned 1 exit status

/root/development/rtems/compiler/6/lib/gcc/aarch64-rtems6/10.3.1/../../../../aarch64-rtems6/bin/ld: ./libbsd.a(if_cgem.c.20.o): in function `cgem_mediachange':
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/cadence/if_cgem.c:1760: undefined reference to `_bsd_cgem_set_ref_clk'
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/cadence/if_cgem.c:1760:(.text.cgem_miibus_statchg+0xb8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `_bsd_cgem_set_ref_clk'
collect2: error: ld returned 1 exit status

/root/development/rtems/compiler/6/lib/gcc/aarch64-rtems6/10.3.1/../../../../aarch64-rtems6/bin/ld: ./libbsd.a(if_cgem.c.20.o): in function `cgem_mediachange':
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/cadence/if_cgem.c:1760: undefined reference to `_bsd_cgem_set_ref_clk'
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/cadence/if_cgem.c:1760:(.text.cgem_miibus_statchg+0xb8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `_bsd_cgem_set_ref_clk'
collect2: error: ld returned 1 exit status

/root/development/rtems/compiler/6/lib/gcc/aarch64-rtems6/10.3.1/../../../../aarch64-rtems6/bin/ld: ./libbsd.a(if_cgem.c.20.o): in function `cgem_mediachange':
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/cadence/if_cgem.c:1760: undefined reference to `_bsd_cgem_set_ref_clk'
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/cadence/if_cgem.c:1760:(.text.cgem_miibus_statchg+0xb8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `_bsd_cgem_set_ref_clk'
collect2: error: ld returned 1 exit status

/root/development/rtems/compiler/6/lib/gcc/aarch64-rtems6/10.3.1/../../../../aarch64-rtems6/bin/ld: ./libbsd.a(if_cgem.c.20.o): in function `cgem_mediachange':
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/cadence/if_cgem.c:1760: undefined reference to `_bsd_cgem_set_ref_clk'
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/cadence/if_cgem.c:1760:(.text.cgem_miibus_statchg+0xb8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `_bsd_cgem_set_ref_clk'
collect2: error: ld returned 1 exit status

/root/development/rtems/compiler/6/lib/gcc/aarch64-rtems6/10.3.1/../../../../aarch64-rtems6/bin/ld: ./libbsd.a(if_cgem.c.20.o): in function `cgem_mediachange':
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/cadence/if_cgem.c:1760: undefined reference to `_bsd_cgem_set_ref_clk'
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/cadence/if_cgem.c:1760:(.text.cgem_miibus_statchg+0xb8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `_bsd_cgem_set_ref_clk'
collect2: error: ld returned 1 exit status

/root/development/rtems/compiler/6/lib/gcc/aarch64-rtems6/10.3.1/../../../../aarch64-rtems6/bin/ld: ./libbsd.a(if_cgem.c.20.o): in function `cgem_mediachange':
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/cadence/if_cgem.c:1760: undefined reference to `_bsd_cgem_set_ref_clk'
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/cadence/if_cgem.c:1760:(.text.cgem_miibus_statchg+0xb8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `_bsd_cgem_set_ref_clk'
collect2: error: ld returned 1 exit status

/root/development/rtems/compiler/6/lib/gcc/aarch64-rtems6/10.3.1/../../../../aarch64-rtems6/bin/ld: ./libbsd.a(if_cgem.c.20.o): in function `cgem_mediachange':
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/cadence/if_cgem.c:1760: undefined reference to `_bsd_cgem_set_ref_clk'
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/cadence/if_cgem.c:1760:(.text.cgem_miibus_statchg+0xb8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `_bsd_cgem_set_ref_clk'
collect2: error: ld returned 1 exit status

Waf: Leaving directory `/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default'
Build failed
 -> task in 'lagg01.exe' failed with exit status 1 (run with -v to display more information)
 -> task in 'ping01.exe' failed with exit status 1 (run with -v to display more information)
 -> task in 'vlan01.exe' failed with exit status 1 (run with -v to display more information)
 -> task in 'pf01.exe' failed with exit status 1 (run with -v to display more information)
 -> task in 'debugger01.exe' failed with exit status 1 (run with -v to display more information)
 -> task in 'pf02.exe' failed with exit status 1 (run with -v to display more information)
 -> task in 'telnetd01.exe' failed with exit status 1 (run with -v to display more information)
 -> task in 'rcconf02.exe' failed with exit status 1 (run with -v to display more information)
 -> task in 'zerocopy01.exe' failed with exit status 1 (run with -v to display more information)
 -> task in 'nfs01.exe' failed with exit status 1 (run with -v to display more information)
[root@centos7 rtems-libbsd-a64]# 

注释rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h 

 ./waf 成功

[2020/2024] Linking build/aarch64-rtems6-a53_lp64_qemu-default/usbkbd01.exe
[2021/2024] Linking build/aarch64-rtems6-a53_lp64_qemu-default/usbmouse01.exe
[2022/2024] Linking build/aarch64-rtems6-a53_lp64_qemu-default/usbserial01.exe
[2023/2024] Linking build/aarch64-rtems6-a53_lp64_qemu-default/vlan01.exe
[2024/2024] Linking build/aarch64-rtems6-a53_lp64_qemu-default/zerocopy01.exe
Waf: Leaving directory `/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default'
'build-aarch64-rtems6-a53_lp64_qemu-default' finished successfully (13.420s)

 SYSINIT

SYSINIT是一个通用的调用排序与分别执行机制的框架。FreeBSD目前使用它来进行内核的动态初始化。SYSINIT使得FreeBSD的内核各子系统可以在内核或模块动态加载链接时被重整、添加、删除、替换,这样,内核和模块加载时就不必去修改一个静态的有序初始化安排表甚至重新编译内核。这个体系也使得内核模块(现在称为KLD可以与内核不同时编译、链接、在引导系统时加载,甚至在系统运行时加载。这些操作是通过"内核链接器"(kernel linker)和"链接器集合"(linker set)完成的。链接器集合(Linker Set)是一种链接方法。这种方法将整个程序源文件中静态申明的数据收集到一个可邻近寻址的数据单元中。 SYSINIT要依靠链接器获取遍布整个程序源代码多处申明的静态数据并把它们组成一个彼此相邻的数据块。这种链接方法被称为"链接器集合"(linker set)。SYSINIT使用两个链接器集合以维护两个数据集合,包含每个数据条目的调用顺序、函数、一个会被提交给该函数的数据指针。 

grep SYSINIT -rn * | grep rtems | grep e1000
rtemsbsd/include/machine/rtems-bsd-nexus-bus.h:615:    SYSINIT_DRIVER_REFERENCE(e1000phy, miibus);
#ifndef __rtems__
#define    C_SYSINIT(uniquifier, subsystem, order, func, ident)    \
    static struct sysinit uniquifier ## _sys_init = {    \
        subsystem,                    \
        order,                        \
        func,                        \
        (ident)                        \
    };                            \
    DATA_SET(sysinit_set,uniquifier ## _sys_init)
#else /* __rtems__ */
#define    SYSINIT_ENTRY_NAME(uniquifier)                \
    _bsd_ ## uniquifier ## _sys_init
#define    SYSINIT_REFERENCE_NAME(uniquifier)            \
    _bsd_ ## uniquifier ## _sys_init_ref
#define    C_SYSINIT(uniquifier, subsystem, order, func, ident)    \
    struct sysinit SYSINIT_ENTRY_NAME(uniquifier) = {    \
        subsystem,                    \
        order,                        \
        func,                        \
        (ident)                        \
    };                            \
    DATA_SET(sysinit_set,SYSINIT_ENTRY_NAME(uniquifier))
#define    SYSINIT_REFERENCE(uniquifier)                \
    extern struct sysinit SYSINIT_ENTRY_NAME(uniquifier);    \
    static struct sysinit const * const            \
    SYSINIT_REFERENCE_NAME(uniquifier) __used        \
    = &SYSINIT_ENTRY_NAME(uniquifier)
#define    SYSINIT_MODULE_REFERENCE(mod)                \
    SYSINIT_REFERENCE(mod ## module)
#define    SYSINIT_DRIVER_REFERENCE(driver, bus)            \
    SYSINIT_MODULE_REFERENCE(driver ## _ ## bus)
#endif /* __rtems__ */

arm-rtems6-objdump  -t build/arm-rtems6-xilinx_zynq_a9_qemu-default/media01.exe  > objdump.txt

[root@centos7 rtems-libbsd-a64]# cat objdump.txt  | grep gem
00228820 l     O .rodata        00000018 cgem0_res
00377af4 l     O .rtemsroset    00000014 __set_nexus_sym_cgem0
00000000 l    df *ABS*  00000000 if_cgem.c
0010523c l     F .text  0000000e cgem_getaddr
0010524c l     F .text  00000092 cgem_reset
001052e0 l     F .text  000000a4 cgem_miibus_statchg
00105384 l     F .text  00000004 cgem_miibus_linkchg
00105388 l     F .text  00000060 cgem_miibus_writereg
001053e8 l     F .text  00000060 cgem_miibus_readreg
00105448 l     F .text  000000be cgem_stop
00105508 l     F .text  00000110 cgem_detach
00105618 l     F .text  000000de cgem_clean_tx
001056f8 l     F .text  000000b2 cgem_fill_rqueue
001057ac l     F .text  0000003e cgem_get_segs_for_tx
001057ec l     F .text  0000018a cgem_start_locked
00105978 l     F .text  0000002c cgem_start
001059a4 l     F .text  0000003e cgem_ifmedia_sts
001059e4 l     F .text  00000056 cgem_ifmedia_upd
00105a3c l     F .text  0000038c cgem_tick
00105dc8 l     F .text  0000014a cgem_rx_filter
00105f14 l     F .text  0000010a cgem_init_locked.part.0
00106020 l     F .text  00000226 cgem_ioctl
00106248 l     F .text  00000256 cgem_intr
001064a0 l     F .text  00000078 cgem_probe
00106518 l     F .text  00000032 cgem_init
0010654c l     F .text  00000ff4 cgem_attach
0045aa40 l     O .bss   00000004 cgem_devclass
00400894 l     O .data  0000000c _cgem_depend_on_ether
004008a0 l     O .data  0000000c _cgem_depend_on_miibus
004008ac l     O .data  0000000c _miibus_cgem_depend_on_kernel
004008b8 l     O .data  0000000c _cgem_nexus_depend_on_kernel
00400974 l     O .data  0000000c cgem_nexus_mod
00400998 l     O .data  0000000c miibus_cgem_mod
004008e4 l     O .data  00000010 _mod_metadata_md_cgem_nexus
004008f4 l     O .data  00000010 _mod_metadata_md_cgem_nexus_on_kernel
00400904 l     O .data  00000010 _mod_metadata_md_cgem_on_ether
00400914 l     O .data  00000010 _mod_metadata_md_cgem_on_miibus
00400924 l     O .data  00000010 _mod_metadata_md_miibus_cgem
00400934 l     O .data  00000010 _mod_metadata_md_miibus_cgem_on_kernel
00400944 l     O .data  00000018 cgem_driver
00229cd4 l     O .rodata        00000040 cgem_methods
0040095c l     O .data  00000018 cgem_nexus_driver_mod
00400980 l     O .data  00000018 miibus_cgem_driver_mod
00377a1c l     O .rtemsroset    00000004 __set_modmetadata_set_sym__mod_metadata_md_cgem_on_ether
00377a20 l     O .rtemsroset    00000004 __set_modmetadata_set_sym__mod_metadata_md_cgem_on_miibus
00377a24 l     O .rtemsroset    00000004 __set_modmetadata_set_sym__mod_metadata_md_miibus_cgem
00377a28 l     O .rtemsroset    00000004 __set_modmetadata_set_sym__mod_metadata_md_miibus_cgem_on_kernel
00377a2c l     O .rtemsroset    00000004 __set_modmetadata_set_sym__mod_metadata_md_cgem_nexus
00377a30 l     O .rtemsroset    00000004 __set_modmetadata_set_sym__mod_metadata_md_cgem_nexus_on_kernel
00414284 l     O .rtemsrwset    00000004 __set_sysinit_set_sym__bsd_miibus_cgemmodule_sys_init
00414288 l     O .rtemsrwset    00000004 __set_sysinit_set_sym__bsd_cgem_nexusmodule_sys_init
00414390 l     O .rtemsrwset    00000004 __set_sysinit_set_sym__bsd_if_bridgemodule_sys_init
0013ab18 l     F .text  000000be in_purgemaddrs
00411128 l     O .data  00000040 _bsd_sysctl___vfs_ncpurgeminvnodes
00411234 l     O .data  00000004 ncpurgeminvnodes
00378298 l     O .rtemsroset    00000004 __set_sysctl_set_sym__bsd_sysctl___vfs_ncpurgeminvnodes
00000000 l    df *ABS*  00000000 sigemptyset.c
004008d4 g     O .data  00000010 _bsd_miibus_cgemmodule_sys_init
004008c4 g     O .data  00000010 _bsd_cgem_nexusmodule_sys_init
00105150 g     F .text  000000ec _bsd_cgem_set_ref_clk
001f5120 g     F .text  0000001e sigemptyset
004087a8 g     O .data  00000010 _bsd_if_bridgemodule_sys_init

e1000

#define RTEMS_BSD_DRIVER_E1000PHY
#define SYSINIT_NEED_NET_IF_EM

rtemsbsd/include/machine/rtems-bsd-sysinit.h:109: SYSINIT_DRIVER_REFERENCE(igb, pci)
 

#define SYSINIT_NEED_NET_IF_EM \
        SYSINIT_DRIVER_REFERENCE(em, pci)

#define SYSINIT_NEED_NET_IF_IGB \
        SYSINIT_DRIVER_REFERENCE(igb, pci)

rtemsbsd/include/machine/rtems-bsd-nexus-bus.h

#if !defined(RTEMS_BSD_DRIVER_PCI_LEM)
  #define RTEMS_BSD_DRIVER_PCI_LEM                \
    SYSINIT_DRIVER_REFERENCE(lem, pci);
#endif /* RTEMS_BSD_DRIVER_PCI_LEM */

/*
 * Intel's Gigabit Driver.
 */
#if !defined(RTEMS_BSD_DRIVER_PCI_IGB)
  #define RTEMS_BSD_DRIVER_PCI_IGB                \
    SYSINIT_DRIVER_REFERENCE(igb, pci);
#endif /* RTEMS_BSD_DRIVER_PCI_IGB */

/*
 * Intel's EM Driver.
 */
#if !defined(RTEMS_BSD_DRIVER_PCI_EM)
  #define RTEMS_BSD_DRIVER_PCI_EM                 \
    SYSINIT_DRIVER_REFERENCE(em, pci);
#endif /* RTEMS_BSD_DRIVER_PCI_EM */

 添加em驱动初始化代码

#if !defined(RTEMS_BSD_DRIVER_PCI_EM)
  #define RTEMS_BSD_DRIVER_PCI_EM                 \
   RTEMS_BSD_DEFINE_NEXUS_DEVICE(ofwbus, 0, 0, NULL);
   SYSINIT_DRIVER_REFERENCE(simplebus, ofwbus);
    SYSINIT_DRIVER_REFERENCE(em, simplebus);
    //SYSINIT_DRIVER_REFERENCE(em, pci);
#endif /* RTEMS_BSD_DRIVER_PCI_EM */
bsps/shared/start/bsp-fdt.c:64:const void *bsp_fdt_get(void)
/root/development/rtems/compiler/6/lib/gcc/aarch64-rtems6/10.3.1/../../../../aarch64-rtems6/bin/ld: ./libbsd.a(openfirm.c.20.o): in function `xrefinfo_init':
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154: undefined reference to `bsp_fdt_get'
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154:(.text.xrefinfo_init+0x8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `bsp_fdt_get'
collect2: error: ld returned 1 exit status

/root/development/rtems/compiler/6/lib/gcc/aarch64-rtems6/10.3.1/../../../../aarch64-rtems6/bin/ld: ./libbsd.a(openfirm.c.20.o): in function `xrefinfo_init':
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154: undefined reference to `bsp_fdt_get'
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154:(.text.xrefinfo_init+0x8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `bsp_fdt_get'
collect2: error: ld returned 1 exit status

/root/development/rtems/compiler/6/lib/gcc/aarch64-rtems6/10.3.1/../../../../aarch64-rtems6/bin/ld: ./libbsd.a(openfirm.c.20.o): in function `xrefinfo_init':
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154: undefined reference to `bsp_fdt_get'
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154:(.text.xrefinfo_init+0x8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `bsp_fdt_get'
collect2: error: ld returned 1 exit status

/root/development/rtems/compiler/6/lib/gcc/aarch64-rtems6/10.3.1/../../../../aarch64-rtems6/bin/ld: ./libbsd.a(openfirm.c.20.o): in function `xrefinfo_init':
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154: undefined reference to `bsp_fdt_get'
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154:(.text.xrefinfo_init+0x8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `bsp_fdt_get'
collect2: error: ld returned 1 exit status

/root/development/rtems/compiler/6/lib/gcc/aarch64-rtems6/10.3.1/../../../../aarch64-rtems6/bin/ld: ./libbsd.a(openfirm.c.20.o): in function `xrefinfo_init':
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154: undefined reference to `bsp_fdt_get'
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154:(.text.xrefinfo_init+0x8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `bsp_fdt_get'
collect2: error: ld returned 1 exit status

/root/development/rtems/compiler/6/lib/gcc/aarch64-rtems6/10.3.1/../../../../aarch64-rtems6/bin/ld: ./libbsd.a(openfirm.c.20.o): in function `xrefinfo_init':
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154: undefined reference to `bsp_fdt_get'
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154:(.text.xrefinfo_init+0x8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `bsp_fdt_get'
collect2: error: ld returned 1 exit status

/root/development/rtems/compiler/6/lib/gcc/aarch64-rtems6/10.3.1/../../../../aarch64-rtems6/bin/ld: ./libbsd.a(openfirm.c.20.o): in function `xrefinfo_init':
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154: undefined reference to `bsp_fdt_get'
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154:(.text.xrefinfo_init+0x8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `bsp_fdt_get'
collect2: error: ld returned 1 exit status

/root/development/rtems/compiler/6/lib/gcc/aarch64-rtems6/10.3.1/../../../../aarch64-rtems6/bin/ld: ./libbsd.a(openfirm.c.20.o): in function `xrefinfo_init':
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154: undefined reference to `bsp_fdt_get'
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154:(.text.xrefinfo_init+0x8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `bsp_fdt_get'
collect2: error: ld returned 1 exit status

/root/development/rtems/compiler/6/lib/gcc/aarch64-rtems6/10.3.1/../../../../aarch64-rtems6/bin/ld: ./libbsd.a(openfirm.c.20.o): in function `xrefinfo_init':
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154: undefined reference to `bsp_fdt_get'
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154:(.text.xrefinfo_init+0x8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `bsp_fdt_get'
collect2: error: ld returned 1 exit status

/root/development/rtems/compiler/6/lib/gcc/aarch64-rtems6/10.3.1/../../../../aarch64-rtems6/bin/ld: ./libbsd.a(openfirm.c.20.o): in function `xrefinfo_init':
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154: undefined reference to `bsp_fdt_get'
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154:(.text.xrefinfo_init+0x8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `bsp_fdt_get'
collect2: error: ld returned 1 exit status

/root/development/rtems/compiler/6/lib/gcc/aarch64-rtems6/10.3.1/../../../../aarch64-rtems6/bin/ld: ./libbsd.a(openfirm.c.20.o): in function `xrefinfo_init':
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154: undefined reference to `bsp_fdt_get'
/root/development/rtems/rtems-libbsd-a64/build/aarch64-rtems6-a53_lp64_qemu-default/../../freebsd/sys/dev/ofw/openfirm.c:154:(.text.xrefinfo_init+0x8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `bsp_fdt_get'
collect2: error: ld returned 1 exit status

 需要把 

bsps/aarch64/a53/include/bsp.h:65:#define BSP_FDT_IS_SUPPORTED 关掉
[root@centos7 rtems]# grep BSP_FDT_IS_SUPPORTED -rn *
bsps/aarch64/a53/include/bsp.h:65:#define BSP_FDT_IS_SUPPORTED
bsps/arm/altera-cyclone-v/start/bspgetworkarea.c:43:#ifdef BSP_FDT_IS_SUPPORTED
bsps/arm/altera-cyclone-v/start/bspgetworkarea.c:216:#else /* !BSP_FDT_IS_SUPPORTED */
bsps/arm/altera-cyclone-v/start/bspgetworkarea.c:222:#endif /* BSP_FDT_IS_SUPPORTED */
bsps/arm/altera-cyclone-v/start/bspstart.c:30:#ifdef BSP_FDT_IS_SUPPORTED
bsps/arm/altera-cyclone-v/start/bspstart.c:108:#ifdef BSP_FDT_IS_SUPPORTED
bsps/arm/beagle/include/bsp.h:207:#define BSP_FDT_IS_SUPPORTED
bsps/arm/imx/include/bsp.h:38:#define BSP_FDT_IS_SUPPORTED
bsps/arm/imxrt/include/bsp.h:59:#define BSP_FDT_IS_SUPPORTED
bsps/arm/raspberrypi/include/bsp.h:45:#define BSP_FDT_IS_SUPPORTED
bsps/arm/raspberrypi/start/bspstart.c:105:#ifdef BSP_FDT_IS_SUPPORTED
bsps/arm/raspberrypi/start/bspstart.c:126:#endif /* BSP_FDT_IS_SUPPORTED */
bsps/include/bsp/fdt.h:20:#define BSP_FDT_IS_SUPPORTED
bsps/include/bsp/fdt.h:27: * BSP_FDT_IS_SUPPORTED.
bsps/powerpc/qoriq/include/bsp.h:56:#define BSP_FDT_IS_SUPPORTED
bsps/shared/start/bsp-fdt.c:22:#ifndef BSP_FDT_IS_SUPPORTED
build/c4che/spec_build.pickle:134940:S'BSP_FDT_IS_SUPPORTED'
spec/build/bsps/arm/altera-cyclone-v/optfdten.yml:14:name: BSP_FDT_IS_SUPPORTED
testsuites/libtests/ofw01/init.c:71:#ifdef BSP_FDT_IS_SUPPORTED

VxWorks 7 SDK for RISC-V (SiFive HiFive / QEMU) Introduction