Fixing the functionality of the "on" keyword in device configuration setup#3
Open
MadhavVP wants to merge 3 commits intoreal-xinu:masterfrom
Open
Fixing the functionality of the "on" keyword in device configuration setup#3MadhavVP wants to merge 3 commits intoreal-xinu:masterfrom
MadhavVP wants to merge 3 commits intoreal-xinu:masterfrom
Conversation
added 3 commits
December 18, 2025 07:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The config/DESCRIPTION file states that the "on" keyword is used to "allow a type name to have two implementations" on different hardware. However the parser does not actually support this functionality right now and instead just creates one implementation per type on whatever hardware is defined last in for that type in the config/Configuration file.
For example, if config/Configuration contains:
tty:
on uart
-i ttyinit -o ionull -c ionull
-r ttyread -g ttygetc -p ttyputc
-w ttywrite -s ioerr -n ttycontrol
-intr ttyhandler
on uart2
-i tttyinit2 -o ionull -c ionull
-r ttyread -g ttygetc -p ttyputc2
-w ttywrite -s ioerr -n ttycontrol
-intr ttyhandler
Only a device type of tty on uart2 will be made. Definition of a device of type tty on uart will return an error as an illegal device specification due to the device type tty on uart not existing.
This pull request fixes this issue by modifying the parser config/config.y to define a new device type every time the on keyword is used instead of just once every time a type name is used. All ith hardware implementations after the first are also given the functions of the i-1th hardware implementation as default in order to absolve the designer from having to retype any shared functions for every implementation definition.