1 #ifndef HEADER_SWITCH_H
2 #define HEADER_SWITCH_H 1
5 /* thread_switch()'s stack frame. */
8 uint32_t ebx; /* 0: Saved %ebx. */
9 uint32_t ebp; /* 4: Saved %ebp. */
10 uint32_t esi; /* 8: Saved %esi. */
11 uint32_t edi; /* 12: Saved %edi. */
12 void (*eip) (void); /* 16: Return address. */
13 struct thread *cur; /* 20: thread_switch()'s CUR argument. */
14 struct thread *next; /* 24: thread_switch()'s NEXT argument. */
17 /* Switches from CUR, which must be the running thread, to NEXT,
18 which must also be running thread_switch(), returning CUR in
20 struct thread *thread_switch (struct thread *cur, struct thread *next);
23 /* Offsets used by switch.S. */
25 #define SWITCH_NEXT 24