39 lines
533 B
C
39 lines
533 B
C
#include <stdint.h>
|
|
#include <stddef.h>
|
|
|
|
struct CPUState {
|
|
size_t eax;
|
|
size_t ebx;
|
|
size_t ecx;
|
|
size_t edx;
|
|
size_t eip;
|
|
size_t esp;
|
|
size_t ebp;
|
|
size_t cs;
|
|
size_t ds;
|
|
size_t eflags;
|
|
};
|
|
|
|
struct Task {
|
|
struct CPUState state;
|
|
};
|
|
|
|
void switch_task(
|
|
size_t eax,
|
|
size_t ebx,
|
|
size_t ecx,
|
|
size_t edx,
|
|
|
|
size_t ebp,
|
|
|
|
size_t esp_real,
|
|
|
|
size_t eip,
|
|
size_t cs,
|
|
size_t eflags,
|
|
size_t esp_fake,
|
|
size_t ds
|
|
);
|
|
void setup_tasks();
|
|
void add_task(struct Task task);
|