Showing changes from revision #4 to #5:
Added | Removed | Changed
Entry | |
---|---|
R0 | Pointer to buffer |
R1 | Buffer size in bytes |
Exit | |
---|---|
R0 | Preserved |
R1 | Number of bytes left in buffer |
The purpose of this call is to remove any vectors that an application is using.
When an application running at &8000 is going to be swapped out, it must remove all vectors that it uses. Otherwise, if the kernel attempted to call the vector it would jump into whatever happened to be at this memory address in whatever application was running at the time – probably with disastrous results.
The buffer is used to store details of the vectors used, so they can be restored afterwards with OS_RelinkApplication.
Each vector requires 12 bytes of storage and the list is terminated by a single byte. If the space left is 0, you are to allocate another buffer and repeat the call; the first buffer is still valid, only the vectors which didn’t fit into it are placed into the second buffer. When relinking you must pass all buffers used by this call.
Note that this call will only delink the standard software vectors. Ticker events, hardware/processor vectors, IRQ handlers and environment handlers must be preserved by other means (when running under the Wimp, it will preserve environment handlers for you).