4 * [Generated from flex, 25 September 1996]
7 #if !defined(__CC_NORCROFT) || !defined(__arm)
8 #error You must use the Norcroft ARM Compiler for Sapphire programs
11 #pragma include_only_once
12 #pragma force_top_level
21 /*----- Overview ----------------------------------------------------------*
44 /* --- flex_reduce --- *
50 * Use: Compacts the flex heap by one iteration.
53 extern routine flex_reduce;
55 /* --- flex_compact --- *
61 * Use: Completely compacts the flex heap.
64 extern routine flex_compact;
66 /* --- flex_free --- *
68 * On entry: R0 == pointer to the flex anchor
72 * Use: Frees a flex block allocated by flex_alloc.
75 extern routine flex_free;
77 /* --- flex_alloc --- *
79 * On entry: R0 == pointer to a flex anchor
80 * R1 == desired size of flex block
82 * On exit: CS if no memory could be allocated, CC otherwise
84 * Use: Allocates a block in the shifting heap.
87 extern routine flex_alloc;
89 /* --- flex_size --- *
91 * On entry: R0 == pointer to flex anchor
93 * On exit: R0 == size of allocated block
95 * Use: Reads the size of a flex block.
98 extern routine flex_size;
100 /* --- flex_extend --- *
102 * On entry: R0 == pointer to flex anchor
103 * R1 == new size of block to set
105 * On exit: CS if it failed due to lack of memory, CC otherwise
107 * Use: Alters the size of a block to the given value.
110 extern routine flex_extend;
112 /* --- flex_midExtend --- *
114 * On entry: R0 == pointer to a flex anchor
115 * R1 == `at' -- position in block to extend from
116 * R2 == `by' -- how many bytes to extend (may be -ve)
118 * On exit: CS if it failed due to lack of memory, CC otherwise
120 * Use: Either creates a gap in a block (by>0) or deletes bytes
121 * from a block. This is always done in such a way that the
122 * byte originally at offset `at' is now at offset `at'+`by'.
125 extern routine flex_midExtend;
127 /* --- flex_init --- *
133 * Use: Initialises the flex heap for use.
136 extern routine flex_init;
138 /* --- flex_stackPtr --- *
140 * On entry: R0 == 0 to read, or value to set
142 * On exit: R0 == old value
144 * Use: Either reads or writes the flex stack pointer. This sort
145 * of thing is useful in exception handlers etc.
148 extern routine flex_stackPtr;
150 /* --- flex_save --- *
156 * Use: Saves some registers on the flex relocation stack. R13
157 * and R14 cannot be saved -- these registers are corrupted
158 * during this routine's execution.
160 * Values saved on the flex relocation stack are adjusted as
161 * flex moves blocks of memory around, so that they still point
162 * to the same thing as they did before. Obviously, values
163 * which aren't pointers into flex blocks may be corrupted.
164 * Values pointing to objects deleted (either free blocks, or
165 * areas removed by flex_midExtend) may also be corrupted.
167 * Since this routine takes no arguments, some other method has
168 * to be used. The method chosen is to follow the call to
169 * flex_save with a LDM or STM instruction containing the
170 * registers to be saved. This instruction is skipped by the
171 * routine, and thus not executed.
173 * Note that if you give the LDM or STM the same condition code
174 * as the BL preceding it, it will never be executed, since
175 * flex_save skips it if the condition is true and it can't be
176 * executed if the condition is false.
179 extern routine flex_save;
181 /* --- flex_load --- *
185 * On exit: Registers loaded from relocation stack as requested
187 * Use: Restores registers saved on flex's relocation stack. See
188 * flex_save for calling information and details about the
192 extern routine flex_load;
194 /*----- Useful macros -----------------------------------------------------*/
196 /* --- Macro: FSAVE --- *
198 * Arguments: rList == quoted register list to save on relocation stack
200 * Use: Assembles code to write the given register list on the
201 * flex relocation stack. The register list should be in the
202 * same form as that for an STM or LDM instruction.
204 * For full details about the flex relocation stack, see
208 /* --- Macro: FLOAD --- *
210 * Arguments: rList == quoted register list to read from relocation stack
212 * Use: Assembles code to read the given register list from the
213 * flex relocation stack. The register list should be in the
214 * same form as that for an STM or LDM instruction.
216 * For full details about the flex relocation stack, see
220 /*----- That's all, folks -------------------------------------------------*/