Skip to content

Fixing the functionality of the "on" keyword in device configuration setup#3

Open
MadhavVP wants to merge 3 commits intoreal-xinu:masterfrom
MadhavVP:master
Open

Fixing the functionality of the "on" keyword in device configuration setup#3
MadhavVP wants to merge 3 commits intoreal-xinu:masterfrom
MadhavVP:master

Conversation

@MadhavVP
Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant