X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fthreads%2Fswitch.h;h=cc156b6d5eddd8e52378be5e17952d6e650ea5c8;hb=19becec31c5704572a3575336c57364d72fd572b;hp=07b805e963d67f642f26e714d91462ec43389a83;hpb=6916b246f3be8c72d6e77fd98c4a1447fd2c1de7;p=pintos-anon diff --git a/src/threads/switch.h b/src/threads/switch.h index 07b805e..cc156b6 100644 --- a/src/threads/switch.h +++ b/src/threads/switch.h @@ -5,20 +5,21 @@ /* switch_thread()'s stack frame. */ struct switch_threads_frame { - uint32_t ebx; /* 0: Saved %ebx. */ - uint32_t ebp; /* 4: Saved %ebp. */ - uint32_t esi; /* 8: Saved %esi. */ - uint32_t edi; /* 12: Saved %edi. */ + uint32_t edi; /* 0: Saved %edi. */ + uint32_t esi; /* 4: Saved %esi. */ + uint32_t ebp; /* 8: Saved %ebp. */ + uint32_t ebx; /* 12: Saved %ebx. */ void (*eip) (void); /* 16: Return address. */ - struct thread *cur; /* 20: thread_switch()'s CUR argument. */ - struct thread *next; /* 24: thread_switch()'s NEXT argument. */ + struct thread *cur; /* 20: switch_threads()'s CUR argument. */ + struct thread *next; /* 24: switch_threads()'s NEXT argument. */ }; /* Switches from CUR, which must be the running thread, to NEXT, - which must also be running thread_switch(), returning CUR in + which must also be running switch_threads(), returning CUR in NEXT's context. */ struct thread *switch_threads (struct thread *cur, struct thread *next); +/* Stack frame for switch_entry(). */ struct switch_entry_frame { void (*eip) (void);