- dbg_putchar() and dbg_getchar() don't call any common sub routines
git-svn-id: http://moon:8086/svn/mips@81 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
+30
-13
@@ -26,6 +26,21 @@ con_if_entry_t const* con_getInterface(int file)
|
||||
return result;
|
||||
}
|
||||
|
||||
con_if_entry_t const* con_getInterfaceByName(char const *pName)
|
||||
{
|
||||
void const *result = NULL;
|
||||
int i;
|
||||
for (i=0; i < con_if.length; i++)
|
||||
{
|
||||
if (!strcmp(pName, con_if.con_if_entry[i].pName))
|
||||
{
|
||||
result = &con_if.con_if_entry[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void const* con_getInstanceByName(char const *pName)
|
||||
{
|
||||
void const *result = NULL;
|
||||
@@ -77,12 +92,9 @@ void con_flush(int fd)
|
||||
} while(c > 0);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
int readchar(int fd)
|
||||
int con_readchar(con_if_entry_t const *pIF)
|
||||
{
|
||||
int c;
|
||||
con_if_entry_t const *pIF = con_getInterface(fd);
|
||||
|
||||
assert(pIF);
|
||||
|
||||
// busy read
|
||||
@@ -95,26 +107,31 @@ int readchar(int fd)
|
||||
return c;
|
||||
}
|
||||
|
||||
void writechar(int fd, char c)
|
||||
void con_writechar(con_if_entry_t const *pIF, char c)
|
||||
{
|
||||
con_if_entry_t const *pIF = con_getInterface(fd);
|
||||
|
||||
assert(pIF);
|
||||
|
||||
pIF->writechar(pIF->pInst, c);
|
||||
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
int readchar(int fd)
|
||||
{
|
||||
return con_readchar(con_getInterface(fd));
|
||||
}
|
||||
|
||||
void writechar(int fd, char c)
|
||||
{
|
||||
con_writechar(con_getInterface(fd), c);
|
||||
}
|
||||
|
||||
void _putchar(int fd, char c)
|
||||
{
|
||||
con_if_entry_t const *pIF = con_getInterface(fd);
|
||||
|
||||
assert(pIF);
|
||||
if (c == 0x0A)
|
||||
{
|
||||
pIF->writechar(pIF->pInst, 0x0D);
|
||||
writechar(fd, 0x0D);
|
||||
}
|
||||
pIF->writechar(pIF->pInst, c);
|
||||
writechar(fd, c);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user