no more cons_putc; real_cons_putc -> cons_putc
This commit is contained in:
parent
b5ee516575
commit
e0966f459f
2 changed files with 7 additions and 18 deletions
24
console.c
24
console.c
|
@ -25,7 +25,7 @@ lpt_putc(int c)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
real_cons_putc(int c)
|
cons_putc(int c)
|
||||||
{
|
{
|
||||||
int crtport = 0x3d4; // io port of CGA
|
int crtport = 0x3d4; // io port of CGA
|
||||||
uint16_t *crt = (uint16_t *) 0xB8000; // base of CGA memory
|
uint16_t *crt = (uint16_t *) 0xB8000; // base of CGA memory
|
||||||
|
@ -69,16 +69,6 @@ real_cons_putc(int c)
|
||||||
outb(crtport + 1, ind);
|
outb(crtport + 1, ind);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
cons_putc(int c)
|
|
||||||
{
|
|
||||||
if(use_console_lock)
|
|
||||||
acquire(&console_lock);
|
|
||||||
real_cons_putc(c);
|
|
||||||
if(use_console_lock)
|
|
||||||
release(&console_lock);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
printint(int xx, int base, int sgn)
|
printint(int xx, int base, int sgn)
|
||||||
{
|
{
|
||||||
|
@ -101,7 +91,7 @@ printint(int xx, int base, int sgn)
|
||||||
buf[i++] = '-';
|
buf[i++] = '-';
|
||||||
|
|
||||||
while(--i >= 0)
|
while(--i >= 0)
|
||||||
real_cons_putc(buf[i]);
|
cons_putc(buf[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -122,7 +112,7 @@ cprintf(char *fmt, ...)
|
||||||
if(c == '%'){
|
if(c == '%'){
|
||||||
state = '%';
|
state = '%';
|
||||||
} else {
|
} else {
|
||||||
real_cons_putc(c);
|
cons_putc(c);
|
||||||
}
|
}
|
||||||
} else if(state == '%'){
|
} else if(state == '%'){
|
||||||
if(c == 'd'){
|
if(c == 'd'){
|
||||||
|
@ -135,15 +125,15 @@ cprintf(char *fmt, ...)
|
||||||
char *s = (char*)*ap;
|
char *s = (char*)*ap;
|
||||||
ap++;
|
ap++;
|
||||||
while(*s != 0){
|
while(*s != 0){
|
||||||
real_cons_putc(*s);
|
cons_putc(*s);
|
||||||
s++;
|
s++;
|
||||||
}
|
}
|
||||||
} else if(c == '%'){
|
} else if(c == '%'){
|
||||||
real_cons_putc(c);
|
cons_putc(c);
|
||||||
} else {
|
} else {
|
||||||
// Unknown % sequence. Print it to draw attention.
|
// Unknown % sequence. Print it to draw attention.
|
||||||
real_cons_putc('%');
|
cons_putc('%');
|
||||||
real_cons_putc(c);
|
cons_putc(c);
|
||||||
}
|
}
|
||||||
state = 0;
|
state = 0;
|
||||||
}
|
}
|
||||||
|
|
1
defs.h
1
defs.h
|
@ -6,7 +6,6 @@ void kinit(void);
|
||||||
// console.c
|
// console.c
|
||||||
void cprintf(char *fmt, ...);
|
void cprintf(char *fmt, ...);
|
||||||
void panic(char *s);
|
void panic(char *s);
|
||||||
void cons_putc(int);
|
|
||||||
|
|
||||||
// proc.c
|
// proc.c
|
||||||
struct proc;
|
struct proc;
|
||||||
|
|
Loading…
Reference in a new issue