- refactored libsys
- added critical section - added interrupt global enable/disable - added console::getInstanveByName git-svn-id: http://moon:8086/svn/mips@76 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
+20
-5
@@ -11,7 +11,7 @@
|
||||
extern con_if_t con_if;
|
||||
|
||||
// Funcs
|
||||
con_if_entry_t const* con_getPort(int file)
|
||||
con_if_entry_t const* con_getInterface(int file)
|
||||
{
|
||||
con_if_entry_t const *result = NULL;
|
||||
int i;
|
||||
@@ -26,6 +26,21 @@ con_if_entry_t const* con_getPort(int file)
|
||||
return result;
|
||||
}
|
||||
|
||||
void const* con_getInstanceByName(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].pInst;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int con_open(char const *pName)
|
||||
{
|
||||
int i;
|
||||
@@ -53,7 +68,7 @@ int con_close(int fd)
|
||||
void con_flush(int fd)
|
||||
{
|
||||
int c;
|
||||
con_if_entry_t const *pIF = con_getPort(fd);
|
||||
con_if_entry_t const *pIF = con_getInterface(fd);
|
||||
|
||||
do
|
||||
{
|
||||
@@ -66,7 +81,7 @@ void con_flush(int fd)
|
||||
int readchar(int fd)
|
||||
{
|
||||
int c;
|
||||
con_if_entry_t const *pIF = con_getPort(fd);
|
||||
con_if_entry_t const *pIF = con_getInterface(fd);
|
||||
|
||||
assert(pIF);
|
||||
|
||||
@@ -82,7 +97,7 @@ int readchar(int fd)
|
||||
|
||||
void writechar(int fd, char c)
|
||||
{
|
||||
con_if_entry_t const *pIF = con_getPort(fd);
|
||||
con_if_entry_t const *pIF = con_getInterface(fd);
|
||||
|
||||
assert(pIF);
|
||||
|
||||
@@ -92,7 +107,7 @@ void writechar(int fd, char c)
|
||||
|
||||
void _putchar(int fd, char c)
|
||||
{
|
||||
con_if_entry_t const *pIF = con_getPort(fd);
|
||||
con_if_entry_t const *pIF = con_getInterface(fd);
|
||||
|
||||
assert(pIF);
|
||||
if (c == 0x0A)
|
||||
|
||||
Reference in New Issue
Block a user