processing changes fixed again.

This commit is contained in:
Enno Rehling 2007-02-04 15:47:10 +00:00
parent 76fb1a1242
commit 98c2524e89
1 changed files with 44 additions and 30 deletions

View File

@ -3789,7 +3789,7 @@ process(void)
while (proc) { while (proc) {
int prio = proc->priority; int prio = proc->priority;
region *r; region *r;
processor *pnext = proc; processor *pglobal = proc;
printf("- Step %u\n", prio); printf("- Step %u\n", prio);
while (proc && proc->priority==prio) { while (proc && proc->priority==prio) {
@ -3797,48 +3797,62 @@ process(void)
proc = proc->next; proc = proc->next;
} }
while (pnext && pnext->priority==prio && pnext->type==PR_GLOBAL) { while (pglobal && pglobal->priority==prio && pglobal->type==PR_GLOBAL) {
pnext->data.global.process(); pglobal->data.global.process();
pnext = pnext->next; pglobal = pglobal->next;
} }
if (pnext==NULL || pnext->priority!=prio) continue; if (pglobal==NULL || pglobal->priority!=prio) continue;
for (r = regions; r; r = r->next) { for (r = regions; r; r = r->next) {
unit *u; unit *u;
processor *pregion = pglobal;
while (pnext && pnext->priority==prio && pnext->type==PR_REGION_PRE) { while (pregion && pregion->priority==prio && pregion->type==PR_REGION_PRE) {
pnext->data.per_region.process(r); pregion->data.per_region.process(r);
pnext = pnext->next; pregion = pregion->next;
} }
if (pnext==NULL || pnext->priority!=prio) continue; if (pregion==NULL || pregion->priority!=prio) continue;
for (u=r->units;u;u=u->next) { if (r->units) {
for (u=r->units;u;u=u->next) {
processor *porder, *punit = pregion;
while (pnext && pnext->priority==prio && pnext->type==PR_UNIT) { while (punit && punit->priority==prio && punit->type==PR_UNIT) {
pnext->data.per_unit.process(u); punit->data.per_unit.process(u);
pnext = pnext->next; punit = punit->next;
}
if (pnext==NULL || pnext->priority!=prio) continue;
while (pnext && pnext->priority==prio && pnext->type==PR_ORDER) {
order ** ordp = &u->orders;
if (pnext->data.per_order.thisorder) ordp = &u->thisorder;
while (*ordp) {
order * ord = *ordp;
if (get_keyword(ord) == pnext->data.per_order.kword) {
pnext->data.per_order.process(u, ord);
}
if (*ordp==ord) ordp=&ord->next;
} }
pnext = pnext->next; if (punit==NULL || punit->priority!=prio) continue;
porder = punit;
while (porder && porder->priority==prio && porder->type==PR_ORDER) {
order ** ordp = &u->orders;
if (porder->data.per_order.thisorder) ordp = &u->thisorder;
while (*ordp) {
order * ord = *ordp;
if (get_keyword(ord) == porder->data.per_order.kword) {
porder->data.per_order.process(u, ord);
}
if (*ordp==ord) ordp=&ord->next;
}
porder = porder->next;
}
/* this is where the region post-processig will start: */
pregion = porder;
}
} else {
/* in case there weren't any units, move the pregion pointer over the unit/order tasks */
while (pregion && pregion->priority==prio && pregion->type!=PR_REGION_POST) {
pregion = pregion->next;
} }
} }
if (pnext==NULL || pnext->priority!=prio) continue;
while (pnext && pnext->priority==prio && pnext->type==PR_REGION_POST) { while (pregion && pregion->priority==prio && pregion->type==PR_REGION_POST) {
pnext->data.per_region.process(r); pregion->data.per_region.process(r);
pnext = pnext->next; pregion = pregion->next;
} }
if (pregion==NULL || pregion->priority!=prio) continue;
} }
} }
} }