176 int *char_cnt = char_cnt_;
#define ASSERT(CONDITION)
This is outside the header guard so that debug.h may be included multiple times with different settin...
bool intr_context(void)
Returns true during processing of an external interrupt and false at all other times.
void console_print_stats(void)
Prints console statistics.
static bool use_console_lock
True in ordinary circumstances: we want to use the console lock to avoid mixing output between thread...
static void putchar_have_lock(uint8_t c)
Writes C to the vga display and serial port.
void putbuf(const char *buffer, size_t n)
Writes the N characters in BUFFER to the console.
static void acquire_console(void)
Acquires the console lock.
static int console_lock_depth
It's possible, if you add enough debug output to Pintos, to try to recursively grab console_lock from...
static struct lock console_lock
The console lock.
void console_panic(void)
Notifies the console that a kernel panic is underway, which warns it to avoid trying to take the cons...
static int64_t write_cnt
Number of characters written to console.
int vprintf(const char *format, va_list args)
The standard vprintf() function, which is like printf() but uses a va_list.
static bool console_locked_by_current_thread(void)
Returns true if the current thread has the console lock, false otherwise.
void console_init(void)
Enable console locking.
static void release_console(void)
Releases the console lock.
int puts(const char *s)
Writes string S to the console, followed by a new-line character.
static void vprintf_helper(char, void *)
Helper function for vprintf().
int putchar(int c)
Writes C to the vga display and serial port.
void __vprintf(const char *format, va_list args, void(*output)(char, void *), void *aux)
Internal functions.
int printf(const char *format,...)
Writes formatted output to the console.
static uint8_t s[256]
RC4-based pseudo-random number generator (PRNG).
void serial_putc(uint8_t byte)
Sends BYTE to the serial port.
__builtin_va_list va_list
GCC has <stdarg.h> functionality as built-ins, so all we need is to use it.
signed long long int int64_t
void lock_release(struct lock *lock)
Releases LOCK, which must be owned by the current thread.
bool lock_held_by_current_thread(const struct lock *lock)
Returns true if the current thread holds LOCK, false otherwise.
void lock_init(struct lock *lock)
Initializes LOCK.
void lock_acquire(struct lock *lock)
Acquires LOCK, sleeping until it becomes available if necessary.
void vga_putc(int c)
Writes C to the VGA text display, interpreting control characters in the conventional ways.