PKUOS - Pintos
Pintos source browser for PKU Operating System course
|
#include "devices/shutdown.h"
#include <console.h>
#include <stdio.h>
#include "devices/kbd.h"
#include "devices/serial.h"
#include "devices/timer.h"
#include "threads/io.h"
#include "threads/thread.h"
Go to the source code of this file.
Macros | |
#define | CONTROL_REG 0x64 |
Keyboard control register port. More... | |
Functions | |
static void | print_stats (void) |
Print statistics about Pintos execution. More... | |
void | shutdown (void) |
Shuts down the machine in the way configured by shutdown_configure(). More... | |
void | shutdown_configure (enum shutdown_type type) |
Sets TYPE as the way that machine will shut down when Pintos execution is complete. More... | |
void | shutdown_reboot (void) |
Reboots the machine via the keyboard controller. More... | |
void | shutdown_power_off (void) |
Powers down the machine we're running on, as long as we're running on Bochs or QEMU. More... | |
Variables | |
static enum shutdown_type | how = SHUTDOWN_NONE |
How to shut down when shutdown() is called. More... | |
#define CONTROL_REG 0x64 |
Keyboard control register port.
Definition at line 18 of file shutdown.c.
|
static |
Print statistics about Pintos execution.
Definition at line 129 of file shutdown.c.
References block_print_stats(), console_print_stats(), exception_print_stats(), kbd_print_stats(), thread_print_stats(), and timer_print_stats().
Referenced by shutdown_power_off().
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().
void shutdown_configure | ( | enum shutdown_type | 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().
void shutdown_power_off | ( | void | ) |
Powers down the machine we're running on, as long as we're running on Bochs or QEMU.
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().
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().
|
static |
How to shut down when shutdown() is called.
Definition at line 21 of file shutdown.c.
Referenced by shutdown(), and shutdown_configure().