CELL index = 1;
- CELL *rel = (CELL *)(relocation + 1);
- CELL *rel_end = (CELL *)((char *)rel + byte_array_capacity(relocation));
+ F_REL *rel = (F_REL *)(relocation + 1);
+ F_REL *rel_end = (F_REL *)((char *)rel + byte_array_capacity(relocation));
while(rel < rel_end)
{
}
}
-void update_literal_references_step(CELL rel, CELL index, F_CODE_BLOCK *compiled)
+void update_literal_references_step(F_REL rel, CELL index, F_CODE_BLOCK *compiled)
{
if(REL_TYPE(rel) == RT_IMMEDIATE)
{
return (CELL)untag_quotation(obj)->xt;
}
-void update_word_references_step(CELL rel, CELL index, F_CODE_BLOCK *compiled)
+void update_word_references_step(F_REL rel, CELL index, F_CODE_BLOCK *compiled)
{
if(REL_TYPE(rel) == RT_XT)
{
}
/* Compute an address to store at a relocation */
-void relocate_code_block_step(CELL rel, CELL index, F_CODE_BLOCK *compiled)
+void relocate_code_block_step(F_REL rel, CELL index, F_CODE_BLOCK *compiled)
{
CELL offset = REL_OFFSET(rel) + (CELL)(compiled + 1);
F_ARRAY *literals = untag_object(compiled->literals);
#define REL_RELATIVE_ARM_3_MASK 0xffffff
/* code relocation table consists of a table of entries for each fixup */
+typedef u32 F_REL;
#define REL_TYPE(r) (((r) & 0xf0000000) >> 28)
#define REL_CLASS(r) (((r) & 0x0f000000) >> 24)
#define REL_OFFSET(r) ((r) & 0x00ffffff)
void flush_icache_for(F_CODE_BLOCK *compiled);
-typedef void (*RELOCATION_ITERATOR)(CELL rel, CELL index, F_CODE_BLOCK *compiled);
+typedef void (*RELOCATION_ITERATOR)(F_REL rel, CELL index, F_CODE_BLOCK *compiled);
void iterate_relocations(F_CODE_BLOCK *compiled, RELOCATION_ITERATOR iter);
CELL code = array_nth(quadruple,0);
REGISTER_ROOT(code);
- CELL rel = (to_fixnum(array_nth(quadruple,1)) << 24)
+ F_REL rel = (to_fixnum(array_nth(quadruple,1)) << 24)
| (to_fixnum(array_nth(quadruple,2)) << 28)
| (to_fixnum(array_nth(quadruple,3)) * compiled_code_format());
- F_BYTE_ARRAY *relocation = allot_byte_array(sizeof(CELL));
- memcpy(relocation + 1,&rel,sizeof(CELL));
+ F_BYTE_ARRAY *relocation = allot_byte_array(sizeof(F_REL));
+ memcpy(relocation + 1,&rel,sizeof(F_REL));
UNREGISTER_ROOT(code);
UNREGISTER_ROOT(literals);
return untag_object(array_nth(untag_object(code),0));
}
-CELL rel_to_emit(CELL code, CELL code_format, CELL code_length, bool *rel_p)
+F_REL rel_to_emit(CELL code, CELL code_format, CELL code_length, bool *rel_p)
{
F_ARRAY *quadruple = untag_object(code);
CELL rel_class = array_nth(quadruple,1);
#define EMIT(name) { \
bool rel_p; \
- CELL rel = rel_to_emit(name,code_format,code_count,&rel_p); \
- if(rel_p) GROWABLE_BYTE_ARRAY_APPEND(relocation,&rel,sizeof(CELL)); \
+ F_REL rel = rel_to_emit(name,code_format,code_count,&rel_p); \
+ if(rel_p) GROWABLE_BYTE_ARRAY_APPEND(relocation,&rel,sizeof(F_REL)); \
GROWABLE_ARRAY_APPEND(code,code_to_emit(name)); \
}