PKUOS - Pintos
Pintos source browser for PKU Operating System course
Enumerations | Functions
shutdown.h File Reference
#include <debug.h>
Include dependency graph for shutdown.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  shutdown_type { SHUTDOWN_NONE , SHUTDOWN_POWER_OFF , SHUTDOWN_REBOOT }
 How to shut down when Pintos has nothing left to do. More...
 

Functions

void shutdown (void)
 Shuts down the machine in the way configured by shutdown_configure(). More...
 
void shutdown_configure (enum shutdown_type)
 Sets TYPE as the way that machine will shut down when Pintos execution is complete. More...
 
void shutdown_reboot (void) NO_RETURN
 Reboots the machine via the keyboard controller. More...
 
void shutdown_power_off (void) NO_RETURN
 devices/shutdown.h More...
 

Enumeration Type Documentation

◆ shutdown_type

How to shut down when Pintos has nothing left to do.

Enumerator
SHUTDOWN_NONE 

Loop forever.

SHUTDOWN_POWER_OFF 

Power off the machine (if possible).

SHUTDOWN_REBOOT 

Reboot the machine (if possible).

Definition at line 7 of file shutdown.h.

Function Documentation

◆ shutdown()

void shutdown ( void  )

Shuts down the machine in the way configured by shutdown_configure().

If the shutdown type is SHUTDOWN_NONE (which is the default), returns without doing anything.

Definition at line 29 of file shutdown.c.

References how, shutdown_power_off(), SHUTDOWN_POWER_OFF, shutdown_reboot(), and SHUTDOWN_REBOOT.

Referenced by debug_panic(), and pintos_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shutdown_configure()

void shutdown_configure ( enum  shutdown_type)

Sets TYPE as the way that machine will shut down when Pintos execution is complete.

Definition at line 50 of file shutdown.c.

References how.

Referenced by parse_options().

Here is the caller graph for this function:

◆ shutdown_power_off()

void shutdown_power_off ( void  )

devices/shutdown.h

devices/shutdown.h

Definition at line 88 of file shutdown.c.

References filesys_done(), outb(), outw(), print_stats(), printf(), s, and serial_flush().

Referenced by shutdown(), and usage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shutdown_reboot()

void shutdown_reboot ( void  )

Reboots the machine via the keyboard controller.

Definition at line 57 of file shutdown.c.

References CONTROL_REG, inb(), outb(), printf(), and timer_udelay().

Referenced by keyboard_interrupt(), and shutdown().

Here is the call graph for this function:
Here is the caller graph for this function: