This commit is contained in:
RichardG867
2020-07-14 22:25:11 -03:00
42 changed files with 659 additions and 1000 deletions

View File

@@ -25,8 +25,10 @@ extern const device_t acc2168_device;
extern const device_t ali1429_device;
/* Headland */
extern const device_t headland_device;
extern const device_t headland_386_device;
extern const device_t headland_gc10x_device;
extern const device_t headland_ht18a_device;
extern const device_t headland_ht18b_device;
extern const device_t headland_ht18c_device;
/* Intel */
extern const device_t i82335_device;
@@ -104,7 +106,7 @@ extern const device_t via_vt82c586b_device;
extern const device_t via_vt82c596b_device;
/* AMD */
extern const device_t amd640_device;
extern const device_t amd640_device;
/* VLSI */
extern const device_t vl82c480_device;

View File

@@ -9,7 +9,7 @@ typedef struct PIC {
extern PIC pic, pic2;
extern int pic_intpending;
extern int pic_intpending, pic_pending;
extern void pic_set_shadow(int sh);

View File

@@ -225,4 +225,54 @@ extern void timer_advance_ex(pc_timer_t *timer, int start);
extern void timer_on(pc_timer_t *timer, double period, int start);
extern void timer_on_auto(pc_timer_t *timer, double period);
extern void timer_remove_head(void);
extern pc_timer_t * timer_head;
extern int timer_inited;
__inline void
timer_remove_head_inline(void)
{
pc_timer_t *timer;
if (timer_inited && timer_head) {
timer = timer_head;
timer_head = timer->next;
if (timer_head) {
timer_head->prev = NULL;
timer->next->prev = NULL;
}
timer->next = timer->prev = NULL;
timer->flags &= ~TIMER_ENABLED;
}
}
__inline void
timer_process_inline(void)
{
pc_timer_t *timer;
if (!timer_inited || !timer_head)
return;
while(1) {
timer = timer_head;
if (!TIMER_LESS_THAN_VAL(timer, (uint32_t)tsc))
break;
timer_remove_head_inline();
if (timer->flags & TIMER_SPLIT)
timer_advance_ex(timer, 0); /* We're splitting a > 1 s period into multiple <= 1 s periods. */
else if (timer->callback != NULL) /* Make sure it's no NULL, so that we can have a NULL callback when no operation is needed. */
timer->callback(timer->p);
}
timer_target = timer_head->ts.ts32.integer;
}
#endif /*_TIMER_H_*/