Showing changes from revision #3 to #4:
Added | Removed | Changed
This whole scheme is predicated on addresses having their top bits clear.
Bit 31 | Bit 30 | Bit | Meaning |
---|---|---|---|
Clear | Clear | 0 – 7 | Error number |
8 – 29 | Clear | ||
Set | Clear | 0 – 20 | Disc byte address / 256 |
21 – 23 | Drive number | ||
24 – 29 | Disc error number | ||
Clear | Set | R0 is an error pointer, (after bit 30 is cleared) | |
Set | Set | 0 – 29 | Pointer to a two-word block: |
Offset +0: | |||
0 – 7 | Disc error number | ||
8 – 29 | Clear | ||
Offset +4: | |||
0 – 28 | Disc sector number | ||
29 – 31 | Drive number |
For the new scheme, this is changed to use the least significant bits to distinguish the types:
R0 < 256: R0 = disc error number
Else:
Bit 1 | Bit 0 | Bit | Meaning |
---|---|---|---|
Clear | Clear | R0 is an error pointer | |
Clear | Set | R0 is an error pointer (once bit 0 is cleared); Points to a three word block: | |
Offset +0: | |||
0 – 7 | Drive number | ||
8 – 15 | Disc error number | ||
16 – 31 | Clear | ||
Offset +4: | |||
64-bit bits address | |||
Set | Clear | Reserved for future use | |
Set | Set | Reserved for future use |
Clearly, this scheme is not compatible with the old-style error codes, but the two forms can easily be mechanically converted between.
To use this error scheme, a FileCore module must set bit 10 in the descriptor block passed to FileCore_Create.
However, if you wish your module to work with older versions of FileCore, you must return old-style errors when running with such a version. These versions can be distinguished by calling FileCore_Features after registering. If no error is returned, and bit 0 of R0 is on exit, you are running on a new FileCore, and should return the new error codes. Otherwise, you should return the old error codes – this can be easily be dealt with by using new-style errors throughout the core of your module, and putting a small conversion veneer on the error exit cases from your entry points.
Note that the same error codes are used in the process error word of background transfer scatter lists; these should also use either the old or new scheme appropriately.
If you are returning new-style errors, you must also store the most significant 30 bits of the block pointer in the background transfer process status word (i.e. bits 29-0 of process status correspond to bits 31-2 of the address of the scatter list entry corresponding to an error).