aboutsummaryrefslogtreecommitdiff
path: root/slof/fs/node.fs
AgeCommit message (Collapse)AuthorFilesLines
2023-02-28Fix typos in the slof folderThomas Huth1-1/+1
Found with the "codespell" utility. I kept "busses" which codespell also complains about since it seems to be an old but still valid plural of the word "bus". Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Segher Boessenkool <segher@kernel.crashing.org> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2017-10-24node: Add some documentationAlexey Kardashevskiy1-1/+1
This adds some internal structure commented definitions so they won't break things now and grep can find them. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2017-06-07Increase MAX-ALIAS to 10Thomas Huth1-1/+1
It's not obvious for the normal user why the alias enumeration should stop at the digit '7' already, so let's allow '8' and '9', too, by bumping the MAX-ALIAS constant to 10. Also remove the unnecessary duplicate of this value from qemu-bootlist.fs. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2013-12-06Find next available alias nameAvik Sil1-0/+21
This patch generaliazes the device alias name enumeration for all scsi disks, virtio-blk disks and network devices. Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-21Move hex64-{decode,encode}-unit to node.fsNikunj A Dadhania1-0/+22
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-06Fix $cat-instance-unitBenjamin Herrenschmidt1-1/+15
We were incorrectly checking ig instance>#units was 0 (forgot to actually load the value before testing it) and then didn't properly fallback to printing the node unit in that case. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-06-27Fix instance>qname crashing when displaying instance argumentsBenjamin Herrenschmidt1-1/+1
Which was triggere by the vscsi error display code Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-05-13Fix instance>path to contain unit address for wildcard nodesBenjamin Herrenschmidt1-3/+25
instance>path (and instance>qpath) which are used among others by the client interface "instance-to-path" are broken when dealing with wildcard nodes (node with no unit address which obtain one when opened). This fixes this by properly using the instance address when building instance path. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-05-13Fix handling of wildcard nodes in open-devBenjamin Herrenschmidt1-2/+21
There was a hack there involving having no #address-cells property in the parent and "manual" parsing of the resulting address numbers but this really didn't work properly. I added (the hack is still there until I'm sure nothing relies on it) a proper handling of wildcard nodes, changing match-unit to match them properly, and recovering the unit address in find-component. There are still issues, among other instance>package still loses the unit address, as does disk-label (for different reasons). Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-01-04Spelling fixes in comments and debug messagesStefan Weil1-1/+1
Most of these errors were found by codespell: controler -> controller appropiate -> appropriate devide -> divide comming -> coming seperate -> separate reponsible -> responsible initialization -> initialization successfull -> successful whithin -> within recieve -> receive wich -> which occurence -> occurrence beggining -> beginning accessable -> accessible proccess -> process succesfuly -> successfully immediatly -> immediately prefered -> preferred avaliable -> available threshhold -> threshold statistsics -> statistics endianess -> endianness positon -> position writen -> written occurence -> occurrence upto -> up to overwriten -> overwritten availabe -> available enviroment -> environment intruction -> instruction thru -> through substract -> subtract occured -> occurred begining -> beginning lenght -> length atributes -> attributes preceeding -> preceding defintion -> definition decriptor -> descriptor Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2011-12-29Add support for instance specific "my-unit" settingsThomas Huth1-15/+76
According to IEEE 1275, the "my-unit" command shall return the unit address of the current _instance_, i.e. this unit address can be set differently for each instance, it is not bound to the physical unit address like "my-space" and "my-address". This behaviour is expected by the Citrine FCODE for example, which does not set a physical unit address for the "sd" (disk) nodes, but needs the unit address to be specified when opening the device tree node instead. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-28Source code beautificationThomas Huth1-46/+91
Some functions in node.fs were formatted in a very bad way, using wrong indentation or mixing spaces and tabs for indentation. Cleaned this up now, without doing any functional changes. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-22Fixed yet another bug in open-nodeThomas Huth1-12/+22
When the "open" method of the target node failed, the open-node function did not correctly restore the previous value of "my-self" (it was using my-parent of the new node to restore the previous value, but that did not work when the new node could not be opened). Now the old value of "my-self" is saved on the return stack instead and then always correctly restored. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Two minor improvements for the device tree node codeThomas Huth1-3/+9
The "open-node" command always tried to execute the "open" method of the node that should be opened and used CATCH to determine whether the method is available or not (and assumed success if it is not available). That works fine as long as the "open" method does not ABORT due to any reason - in that case the "open" should be considered as failure instead. So the code is now using "find-method" instead to determine whether the "open" method is available or not. Second fix is about "my-unit". According to IEEE1275, this value should be initialized to the firt component of the "reg" property in case it has not been specified by other means. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Fixed "dev" command to only parse one wordThomas Huth1-1/+1
The "dev" command parsed the whole remaining input line. That way it was not possible to do something like "dev / ls" at the prompt. Now it parses only the next available word in the input so that the rest of the input line can be interpreted by the Forth engine instead. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Print phandle when listing the device treeThomas Huth1-3/+17
Printing the phandle of each node is quite handy when searching for a specific phandle value. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-24Improved instance handlingThomas Huth1-14/+25
Fixed various bugs and added some improvements in the device tree node instance handling code: - The ">instance" word now checks whether access is beyond the allocated memory - Check max-instance-size when creating new instance variables/values - The arg point and the args-len were stored the wrong way round in the instance header structure - Free instance args buffer when closing an instance to avoid memory leaking - finish-device destroyed the instance-template buffer, causing instance values not to be initialized correctly anymore - Added new command "extend-device" to be able to modify the instance template of already existing nodes - Added new command "unselect-dev" to undo the changes from select-dev Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-17Enhance the behavior of find-package according to IEEE 1275 proposal 215Thomas Huth1-4/+26
According to IEEE 1275 Proposal 215 (Extensible Client Services Package), the find-package method can be used to get the phandle of arbitrary nodes (i.e. not only support packages) when the name starts with a slash. Some FCODE programs depend on this behavior so we've got to support this, too! Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12Improved node/instance handling.qemu-slof-20111013Thomas Huth1-9/+30
The INSTANCE keyword can not be used while a node is opened (since it changes the node>instance field that is also used for allocating the necessary amount of memory for an instance). Since I experienced some bad and hard-to-debug crashes when accidentially running into this problem, I now added a proper error handling to the INSTANCE keyword. Also improved my-space, my-address and my-unit a little bit so that these node specific words now can also be used without an active instance. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-03-22Fixed a bug in the set-alias commandThomas Huth1-1/+6
set-alias did not clean up the stack in case the "/aliases" node coud not be found. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2010-12-01Initial import of slof-JX-1.7.0-4Benjamin Herrenschmidt1-0/+473
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>