pintos/src/lib/kernel/console.c File Reference

#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


Function Documentation

static void acquire_console ( void   )  [static]

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   ) 

Definition at line 74 of file console.c.

References use_console_lock.

Referenced by debug_panic().

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  ) 

Definition at line 163 of file console.c.

Referenced by fail(), msg(), puts(), and read_line().

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().

int puts ( const char *  s  ) 

Definition at line 140 of file console.c.

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.

Referenced by putbuf(), putchar(), puts(), and vprintf().

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]

Definition at line 174 of file console.c.

References putchar_have_lock().

Referenced by vprintf().


Variable Documentation

struct lock console_lock [static]

int console_lock_depth [static]

Definition at line 57 of file console.c.

Referenced by acquire_console(), and release_console().

bool use_console_lock [static]

int64_t write_cnt [static]

Definition at line 60 of file console.c.

Referenced by console_print_stats(), and putchar_have_lock().


Generated on Mon Jan 10 16:43:58 2011 for Pintos by  doxygen 1.5.6