X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fthreads%2Fswitch.h;h=084a79454936a360cc548606d9ba6d8ce9940b59;hb=8963460220b9958398d0f18ff24fa73328bbb76b;hp=c285e78164971d5dd7e011d0356599be0d32f328;hpb=76a72158378a6447bb3dbce5bae41db48da0d64f;p=pintos-anon diff --git a/src/threads/switch.h b/src/threads/switch.h index c285e78..084a794 100644 --- a/src/threads/switch.h +++ b/src/threads/switch.h @@ -1,9 +1,9 @@ -#ifndef HEADER_SWITCH_H -#define HEADER_SWITCH_H 1 +#ifndef THREADS_SWITCH_H +#define THREADS_SWITCH_H #ifndef __ASSEMBLER__ -/* thread_switch()'s stack frame. */ -struct switch_frame +/* switch_thread()'s stack frame. */ +struct switch_threads_frame { uint32_t ebx; /* 0: Saved %ebx. */ uint32_t ebp; /* 4: Saved %ebp. */ @@ -17,11 +17,23 @@ struct switch_frame /* Switches from CUR, which must be the running thread, to NEXT, which must also be running thread_switch(), returning CUR in NEXT's context. */ -struct thread *thread_switch (struct thread *cur, struct thread *next); +struct thread *switch_threads (struct thread *cur, struct thread *next); + +/* Stack frame for switch_entry(). */ +struct switch_entry_frame + { + void (*eip) (void); + }; + +void switch_entry (void); + +/* Pops the CUR and NEXT arguments off the stack, for use in + initializing threads. */ +void switch_thunk (void); #endif /* Offsets used by switch.S. */ #define SWITCH_CUR 20 #define SWITCH_NEXT 24 -#endif /* switch.h */ +#endif /* threads/switch.h */