#include <console.h>
#include <stdarg.h>
#include <stdio.h>
#include "devices/serial.h"
#include "devices/vga.h"
#include "threads/init.h"
#include "threads/interrupt.h"
#include "threads/synch.h"
Go to the source code of this file.
Functions | |
static void | vprintf_helper (char, void *) |
static void | putchar_have_lock (uint8_t c) |
void | console_init (void) |
void | console_panic (void) |
void | console_print_stats (void) |
static void | acquire_console (void) |
static void | release_console (void) |
static bool | console_locked_by_current_thread (void) |
int | vprintf (const char *format, va_list args) |
int | puts (const char *s) |
void | putbuf (const char *buffer, size_t n) |
int | putchar (int c) |
Variables | |
static struct lock | console_lock |
static bool | use_console_lock |
static int | console_lock_depth |
static int64_t | write_cnt |
static void acquire_console | ( | void | ) | [static] |
Definition at line 88 of file console.c.
References console_lock, console_lock_depth, intr_context(), lock_acquire(), lock_held_by_current_thread(), and use_console_lock.
void console_init | ( | void | ) |
Definition at line 64 of file console.c.
References console_lock, lock_init(), and use_console_lock.
Referenced by main().
static bool console_locked_by_current_thread | ( | void | ) | [static] |
Definition at line 115 of file console.c.
References console_lock, intr_context(), lock_held_by_current_thread(), and use_console_lock.
Referenced by putchar_have_lock().
void console_panic | ( | void | ) |
void console_print_stats | ( | void | ) |
Definition at line 81 of file console.c.
References printf(), and write_cnt.
Referenced by print_stats().
void putbuf | ( | const char * | buffer, | |
size_t | n | |||
) |
Definition at line 153 of file console.c.
References acquire_console(), putchar_have_lock(), and release_console().
int putchar | ( | int | c | ) |
static void putchar_have_lock | ( | uint8_t | c | ) | [static] |
Definition at line 185 of file console.c.
References ASSERT, console_locked_by_current_thread(), serial_putc(), vga_putc(), and write_cnt.
Referenced by putbuf(), putchar(), puts(), and vprintf_helper().
static void release_console | ( | void | ) | [static] |
Definition at line 101 of file console.c.
References console_lock, console_lock_depth, intr_context(), lock_release(), and use_console_lock.
int vprintf | ( | const char * | format, | |
va_list | args | |||
) |
Definition at line 126 of file console.c.
References __vprintf(), acquire_console(), release_console(), and vprintf_helper().
Referenced by debug_panic(), fail(), msg(), printf(), and usage().
static void vprintf_helper | ( | char | c, | |
void * | char_cnt_ | |||
) | [static] |
struct lock console_lock [static] |
Definition at line 18 of file console.c.
Referenced by acquire_console(), console_init(), console_locked_by_current_thread(), and release_console().
int console_lock_depth [static] |
bool use_console_lock [static] |
Definition at line 31 of file console.c.
Referenced by acquire_console(), console_init(), console_locked_by_current_thread(), console_panic(), and release_console().
Definition at line 60 of file console.c.
Referenced by console_print_stats(), and putchar_have_lock().