+inline
+void dcpu16_cycle_inc(struct dcpu16 *vm, unsigned int n) {
+ size_t i;
+
+ while (n--) {
+ /* new cycle */
+ vm->cycle_ += 1;
+ TRACE("%s>> starting cycle %llu", vm->cycle_);
+
+ /* signal interested cycle hooks */
+ acct_event_(vm, DCPU16_ACCT_EV_CYCLE, vm->reg[DCPU16_REG_PC]);
+
+ /* signal attached hardware */
+ for (i = 0; i < vm->hw_table_entries_; i++) {
+ TRACE("%s>> notifying %s", __func__, vm->hw_table_[i].name_);
+ vm->hw_table_[i].cycle(vm, vm->hw_table_[i].data);
+ }
+ }
+}
+