PKUOS - Pintos
Pintos source browser for PKU Operating System course
Data Structures | Macros | Functions
switch.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  switch_threads_frame
 switch_thread()'s stack frame. More...
 
struct  switch_entry_frame
 Stack frame for switch_entry(). More...
 

Macros

#define SWITCH_CUR   20
 Offsets used by switch.S. More...
 
#define SWITCH_NEXT   24
 threads/switch.h More...
 

Functions

struct threadswitch_threads (struct thread *cur, struct thread *next)
 Switches from CUR, which must be the running thread, to NEXT, which must also be running switch_threads(), returning CUR in NEXT's context. More...
 
void switch_entry (void)
 
void switch_thunk (void)
 Pops the CUR and NEXT arguments off the stack, for use in initializing threads. More...
 

Macro Definition Documentation

◆ SWITCH_CUR

#define SWITCH_CUR   20

Offsets used by switch.S.

Definition at line 36 of file switch.h.

◆ SWITCH_NEXT

#define SWITCH_NEXT   24

threads/switch.h

Definition at line 39 of file switch.h.

Function Documentation

◆ switch_entry()

void switch_entry ( void  )

Referenced by print_stacktrace(), and thread_create().

Here is the caller graph for this function:

◆ switch_threads()

struct thread * switch_threads ( struct thread cur,
struct thread next 
)

Switches from CUR, which must be the running thread, to NEXT, which must also be running switch_threads(), returning CUR in NEXT's context.

Referenced by schedule().

Here is the caller graph for this function:

◆ switch_thunk()

void switch_thunk ( void  )

Pops the CUR and NEXT arguments off the stack, for use in initializing threads.