projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename putchar_unlocked() so as not to interfere with a GCC builtin.
[pintos-anon]
/
src
/
lib
/
kernel
/
console.c
diff --git
a/src/lib/kernel/console.c
b/src/lib/kernel/console.c
index 865b13b2cd810b0805acead8ec9f4e3e038f609a..53e08a0532acca1fd745136d29b217a501665204 100644
(file)
--- a/
src/lib/kernel/console.c
+++ b/
src/lib/kernel/console.c
@@
-7,7
+7,7
@@
#include "threads/synch.h"
static void vprintf_helper (char, void *);
#include "threads/synch.h"
static void vprintf_helper (char, void *);
-static void putchar_unlocked (uint8_t c);
+static void put
_
char_unlocked (uint8_t c);
/* The console lock.
Both the vga and serial layers do their own locking, so it's
/* The console lock.
Both the vga and serial layers do their own locking, so it's
@@
-31,7
+31,7
@@
static struct lock console_lock;
intr_handler() - timer interrupt
intr_set_level()
serial_putc()
intr_handler() - timer interrupt
intr_set_level()
serial_putc()
- putchar_unlocked()
+ put
_
char_unlocked()
putbuf()
sys_write() - one process writing to the console
syscall_handler()
putbuf()
sys_write() - one process writing to the console
syscall_handler()
@@
-115,8
+115,8
@@
puts (const char *s)
{
acquire_console ();
while (*s != '\0')
{
acquire_console ();
while (*s != '\0')
- putchar_unlocked (*s++);
- putchar_unlocked ('\n');
+ put
_
char_unlocked (*s++);
+ put
_
char_unlocked ('\n');
release_console ();
return 0;
release_console ();
return 0;
@@
-128,7
+128,7
@@
putbuf (const char *buffer, size_t n)
{
acquire_console ();
while (n-- > 0)
{
acquire_console ();
while (n-- > 0)
- putchar_unlocked (*buffer++);
+ put
_
char_unlocked (*buffer++);
release_console ();
}
release_console ();
}
@@
-137,7
+137,7
@@
int
putchar (int c)
{
acquire_console ();
putchar (int c)
{
acquire_console ();
- putchar_unlocked (c);
+ put
_
char_unlocked (c);
release_console ();
return c;
release_console ();
return c;
@@
-149,14
+149,14
@@
vprintf_helper (char c, void *char_cnt_)
{
int *char_cnt = char_cnt_;
(*char_cnt)++;
{
int *char_cnt = char_cnt_;
(*char_cnt)++;
- putchar_unlocked (c);
+ put
_
char_unlocked (c);
}
/* Writes C to the vga display and serial port.
The caller has already acquired the console lock if
appropriate. */
static void
}
/* Writes C to the vga display and serial port.
The caller has already acquired the console lock if
appropriate. */
static void
-putchar_unlocked (uint8_t c)
+put
_
char_unlocked (uint8_t c)
{
ASSERT (console_locked_by_current_thread ());
write_cnt++;
{
ASSERT (console_locked_by_current_thread ());
write_cnt++;