core_table_mem[new_base + i] = core_table_mem[base + i];
core_table_mem[base + i] = 0x55555555;
}
-#endif
+#endif /* INDIRECT_CORE */
}
-#ifndef INDIRECT_CORE
static void core_move_up(struct pool_item *item, int new_limit) {
int limit, blocks;
+#ifndef INDIRECT_CORE
struct process *process;
struct process_state state;
int para;
+#else /* INDIRECT_CORE */
+ int i;
+#endif /* INDIRECT_CORE */
limit = item->limit;
blocks = limit - item->base;
printf("core_move_up [%d,%d) to [%d,%d)\n", limit - blocks, limit, new_limit - blocks, new_limit);
assert(new_limit >= limit || new_limit <= limit - blocks);
+#ifndef INDIRECT_CORE
#if 0 // debugging
core_copy_up(
limit << BLOCK_PARAS_SHIFT,
state.core_paras
);
#endif
+#else /* INDIRECT_CORE */
+ blocks = -blocks;
+ for (i = -1; i >= blocks; --i) {
+ core_table_mem[new_limit + i] = core_table_mem[limit + i];
+ core_table_mem[limit + i] = 0x55555555;
+ }
+#endif /* INDIRECT_CORE */
}
-#endif /* ! INDIRECT_CORE */
#ifndef INDIRECT_CORE
void core_init(int n_blocks)
table_size,
#endif /* INDIRECT_CORE */
core_move,
-#ifndef INDIRECT_CORE
core_move_up
-#else /* INDIRECT_CORE */
- NULL
-#endif /* INDIRECT_CORE */
);
#ifdef INDIRECT_CORE
#!/bin/sh
echo "generate test script"
-./process_test_gen 16 248 4096 32 false false >process_test.txt
+./process_test_gen 16 248 4096 32 true true >process_test.txt
echo "run test script"
./process_test_run 16 64 192 8 384 384 <process_test.txt