aboutsummaryrefslogtreecommitdiff
path: root/slof/fs/fcode
AgeCommit message (Collapse)AuthorFilesLines
2023-02-28Fix typos in the slof folderThomas Huth2-2/+2
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>
2016-09-14Do not include the FCode evaluator by default anymoreThomas Huth1-45/+45
Commit 2fed5652819ad26627a8 ("Always include evaluator, move framebuffer token init to fbuffer.fs") made sure that the FCode evaluator is always included, during each boot cycle. The basic idea was that we would soon be starting to support PCI cards with FCode drivers on them. However, this has never happened, and so this change was in vain. The bad thing is now that the inclusion of the FCode evaluator also takes a lot of precious boot time, e.g. when running in QEMU TCG mode, it is more than a second. So to be able to boot faster again, disable the FCode evaluator by default again and put it into the ROM-fs instead (so it still can be loaded manually with "include evaluator.fs" if necessary). Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
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>
2012-01-13FCODE: Support for old-fashioned "local values" tokensThomas Huth2-0/+156
One of the old FCODE tokenizers uses the opcodes in the range of 0x407 to 0x41f for supporting Forth local values. To get these FCODE programs working, we have to support these opcodes, too. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20FCODE: Always include evaluator, move framebuffer token init to fbuffer.fsThomas Huth4-55/+99
Since the FCODE evaluator can be used for more than one PCI card now, the interpreter is now always included during boot. The framebuffer tokens are now only initialized when the code from fbuffer.fs is being used. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Removed unused codeThomas Huth1-39/+0
In 1275.fs there were some functions that were apparently not used anymore. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20FCODE: Support for fcode programs with 8-bit offsetsThomas Huth3-12/+21
IEEE1275 allows offset values to be either encoded with 8-bit values or 16-bit values. So far our FCODE engine only supported 16-bit offsets. Now 8-bit offsets are working, too. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Support for "INSTANCE BUFFER:" in Forth and FCODE.Thomas Huth1-7/+9
IEEE 1275 stipulates that the "BUFFER:" keyword and its FCODE equivalent "b(buffer:)" can both be used with the INSTANCE keyword to create an instance-specific buffer. SLOF lacked this support, but now it's possible to create such instance-specific buffers with SLOF, too. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-28FCODE: Added token 0x12b (interpose)Thomas Huth1-1/+2
The "Recommended Practice: Interposition" document declares that token 0x12b is used for "interpose". Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-24FCODE: Allow return stack commands to be used in "interpretation" mode.Thomas Huth2-42/+44
According to IEEE 1275, the return stack commands may also be used in "interpretation" FCODE mode (i.e. without a surrounding colon definition). This did not work in SLOF yet since the commands were executed in one function (called "exec"), but the main loop was done in another function (called "evaluate-fcode"), so SLOF needed the return stack inbetween. When an FCODE program put an additional item on the return stack, the FCODE interpreter crashed. This has been fixed now by merging the exec function into the evaluate-fcode function with the main loop. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-24FCODE: Fixed b?branch instructionThomas Huth1-5/+1
According to IEEE 1275, the b?branch instruction should jump "if all bits of x are zero". However, our implementation also jumped already if x was not equal to TRUE (i.e. 0xffffffff). It's fixed now by simply removing the odd "?branch" function. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-17FCODE: Support FCODE programs that access MMIO memory without the r-functionsThomas Huth2-12/+35
Since some FCODE programs use the normal memory access functions (like c@) for accessing MMIO memory, we got to use a little hack to support them: When address is bigger than MIN-RAM-SIZE, assume the FCODE is trying to access MMIO memory and use the register based access functions (like rb@) instead. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-17FCODE: Implemented missing tokensThomas Huth2-15/+88
While reviewing our FCODE table, some missing FCODE tokens have been discovered. According to the IEEE 1275 specification, some of them are marked as obsolete and optional, but some of them are also marked as required. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-17FCODE: Removed some unused test code and functionsThomas Huth1-26/+1
In 1275.fs there were some test code remainders from the early days that are certainly not required anymore. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-17FCODE: Implemented the missing command "(cr"Thomas Huth1-2/+1
According to IEEE 1275 the token 0x91 is used to emit a carret character. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-17FCODE: Reviewed token initialization sequenceThomas Huth1-34/+87
Added comments about missing and obsolete FCODE tokens to shed a light on the gaps in our FCODE token list. No functional change done. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-17FCODE: Improved b(field) and b(buffer:)Thomas Huth1-4/+7
b(field) and b(buffer:) did not reveal the names of the corresponding definitions so that external words could not be used. Also replaced the "postpone exit" in b(field) by "<semicolon> compile," so that these words now can be used with the debugger SEE command, too. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-17FCODE: Adjust MMIO access functions when running PCI FCODE programsThomas Huth2-15/+54
According to IEEE 1275, the MMIO access functions rw@ etc. have to take care of the byte-ordering of the corresponding bus. So some FCODE programs (like the drivers from QLOGIC) seem not to support byte-swapping on their own, but rely on the MMIO access functions from firmware to do the byte swapping. Thus, to get these FCODE programs working, our MMIO access functions have to do the byte-swapping when we run a PCI FCODE program! Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-17FCODE: Fixed named-token functionThomas Huth2-8/+15
The named-token function evaluated the fcode-debug? variable the wrong way round, and the "new-token" path did not work yet since it was not skipping the fcode-string of the new function in that branch. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-17FCODE: Fixed b(;) so that it also works with the debuggerThomas Huth1-3/+4
The SEE debugger word expects functions to end with a semicolon. However, b(;) was using EXIT to mark the end of a function, so SEE failed with such Forth words. Now b(;) is using the <semicolon> execution token so that FCODE functions can be analyzed with SEE, too. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-17FCODE: Fixed instance handlingThomas Huth2-26/+79
INSTANCE VALUEs, VARIABLEs and DEFERs did not work at all for FCODE. The opcode for INSTANCE was just doing the wrong thing, and the opcodes for VALUE, VARIABLE and DEFER simply ignored whether they were used in context of an INSTANCE or not. Now the opcodes are working right. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-17FCODE evaluator source code beautification and clean-upThomas Huth4-119/+120
Fixed bad indentation and white space damages in the FCODE evaluator source code. Also removed the redundant definitions of <value>, <variable>, etc. which are defined in base.fs already. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-17FCODE: Reset fcode-end flag before executing a new programThomas Huth1-0/+1
When running more than one FCODE program, the second one was not executed since fcode-end was not reset. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-17FCODE: Fixed detection of images in PCI Expansion ROMs.Thomas Huth1-36/+48
There were several bugs in the pci-find-rom function that is used to detect the FCODE in PCI Expansion ROMs. Due to these bugs, it was only able to find the first image in the ROM. Now the function should also work fine if the FCODE image is not the first image in the ROM. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2010-12-01Initial import of slof-JX-1.7.0-4Benjamin Herrenschmidt5-0/+1077
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>