Issue created by Sebastian Huber: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/work_items/5766



The init code of `bsps/mips/malta/start/start.S` puts the instruction
which clears `a0` into the delay slot of the `jal` to `init_tlb`. The
zero therefore reaches `init_tlb` and not `boot_card`. The comment on
the instruction states the intent, which is a command line of zero
for `boot_card()`.

`init_tlb()` calls `resettlb()` for every entry and leaves the
counter of its loop in `a0`. That counter is `N_TLB_ENTRIES`, which
is 16 for this processor. `boot_card()` takes 16 as the address of
the command line and stores it in `bsp_boot_cmdline`.

`Init()` of `cpukit/libmisc/dummy/default-configuration.c` reads that
pointer and counts the arguments of the string. `defaultconfig01`
takes a TLB load exception in `strlen()` at address 16 and makes no
further progress. `bspcmdline01` reads the same variable and fails as
well. The two are the last failures of the BSP.

The five other MIPS BSPs clear `a0` in ordinary code ahead of the
`jal` and put a `nop` in the delay slot. Only this BSP calls
`init_tlb()` there, and only this BSP loses the value.

Put the instruction which clears `a0` into the delay slot of the
`jal` to `boot_card`.

Found in the repair of the Malta BSP for the test suite. This
description was created with Claude Code assistance.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/work_items/5766
You're receiving this email because of your account on gitlab.rtems.org. 
Unsubscribe from this thread: 
https://gitlab.rtems.org/-/namespace/49/sent_notifications/5-0ufimomt18bkt2y1gmlqzqtxd-1d/unsubscribe
 | Manage all notifications: https://gitlab.rtems.org/-/profile/notifications | 
Help: https://gitlab.rtems.org/help


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to