summaryrefslogtreecommitdiffstats
path: root/src/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/console.C9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/kernel/console.C b/src/kernel/console.C
index 2c33645fe..18286a283 100644
--- a/src/kernel/console.C
+++ b/src/kernel/console.C
@@ -11,10 +11,13 @@ Console::Console() : iv_pos(0), iv_buffer(kernel_printk_buffer)
int Console::putc(int c)
{
- if (BUFFER_SIZE > iv_pos)
+ if ('\b' == c)
{
- iv_buffer[iv_pos] = c;
- iv_pos++;
+ __sync_sub_and_fetch(&iv_pos, 1);
+ }
+ else if (BUFFER_SIZE > iv_pos)
+ {
+ iv_buffer[__sync_fetch_and_add(&iv_pos, 1)] = c;
}
}
OpenPOWER on IntegriCloud