forked from Imagelibrary/rtems
Changed prototype of read routine.
This commit is contained in:
@@ -138,7 +138,7 @@ rtems_status_code rtems_termios_open (
|
|||||||
void *arg,
|
void *arg,
|
||||||
int (*deviceFirstOpen)(int major, int minor, void *arg),
|
int (*deviceFirstOpen)(int major, int minor, void *arg),
|
||||||
int (*deviceLastClose)(int major, int minor, void *arg),
|
int (*deviceLastClose)(int major, int minor, void *arg),
|
||||||
int (*deviceRead)(int minor, char *buf),
|
int (*deviceRead)(int minor),
|
||||||
int (*deviceWrite)(int minor, char *buf, int len)
|
int (*deviceWrite)(int minor, char *buf, int len)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ struct rtems_termios_tty {
|
|||||||
* Callbacks to device-specific routines
|
* Callbacks to device-specific routines
|
||||||
*/
|
*/
|
||||||
int (*lastClose)(int major, int minor, void *arg);
|
int (*lastClose)(int major, int minor, void *arg);
|
||||||
int (*read)(int minor, char *buf);
|
int (*read)(int minor);
|
||||||
int (*write)(int minor, char *buf, int len);
|
int (*write)(int minor, char *buf, int len);
|
||||||
};
|
};
|
||||||
static struct rtems_termios_tty *ttyHead, *ttyTail;
|
static struct rtems_termios_tty *ttyHead, *ttyTail;
|
||||||
@@ -133,7 +133,7 @@ rtems_termios_open (
|
|||||||
void *arg,
|
void *arg,
|
||||||
int (*deviceFirstOpen)(int major, int minor, void *arg),
|
int (*deviceFirstOpen)(int major, int minor, void *arg),
|
||||||
int (*deviceLastClose)(int major, int minor, void *arg),
|
int (*deviceLastClose)(int major, int minor, void *arg),
|
||||||
int (*deviceRead)(int minor, char *buf),
|
int (*deviceRead)(int minor),
|
||||||
int (*deviceWrite)(int minor, char *buf, int len)
|
int (*deviceWrite)(int minor, char *buf, int len)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -603,20 +603,16 @@ siproc (unsigned char c, struct rtems_termios_tty *tty)
|
|||||||
static rtems_status_code
|
static rtems_status_code
|
||||||
fillBufferPoll (struct rtems_termios_tty *tty)
|
fillBufferPoll (struct rtems_termios_tty *tty)
|
||||||
{
|
{
|
||||||
unsigned char c;
|
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
if (tty->termios.c_lflag & ICANON) {
|
if (tty->termios.c_lflag & ICANON) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
n = (*tty->read)(tty->minor, &c);
|
n = (*tty->read)(tty->minor);
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
return RTEMS_UNSATISFIED;
|
|
||||||
}
|
|
||||||
else if (n == 0) {
|
|
||||||
rtems_task_wake_after (1);
|
rtems_task_wake_after (1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (siproc (c, tty))
|
if (siproc (n, tty))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -626,11 +622,8 @@ fillBufferPoll (struct rtems_termios_tty *tty)
|
|||||||
if (!tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
|
if (!tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
|
||||||
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &then);
|
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &then);
|
||||||
for (;;) {
|
for (;;) {
|
||||||
n = (*tty->read)(tty->minor, &c);
|
n = (*tty->read)(tty->minor);
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
return RTEMS_UNSATISFIED;
|
|
||||||
}
|
|
||||||
else if (n == 0) {
|
|
||||||
if (tty->termios.c_cc[VMIN]) {
|
if (tty->termios.c_cc[VMIN]) {
|
||||||
if (tty->termios.c_cc[VTIME] && tty->ccount) {
|
if (tty->termios.c_cc[VTIME] && tty->ccount) {
|
||||||
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
|
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
|
||||||
@@ -650,7 +643,7 @@ fillBufferPoll (struct rtems_termios_tty *tty)
|
|||||||
rtems_task_wake_after (1);
|
rtems_task_wake_after (1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
siproc (c, tty);
|
siproc (n, tty);
|
||||||
if (tty->ccount >= tty->termios.c_cc[VMIN])
|
if (tty->ccount >= tty->termios.c_cc[VMIN])
|
||||||
break;
|
break;
|
||||||
if (tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
|
if (tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ rtems_status_code rtems_termios_open (
|
|||||||
void *arg,
|
void *arg,
|
||||||
int (*deviceFirstOpen)(int major, int minor, void *arg),
|
int (*deviceFirstOpen)(int major, int minor, void *arg),
|
||||||
int (*deviceLastClose)(int major, int minor, void *arg),
|
int (*deviceLastClose)(int major, int minor, void *arg),
|
||||||
int (*deviceRead)(int minor, char *buf),
|
int (*deviceRead)(int minor),
|
||||||
int (*deviceWrite)(int minor, char *buf, int len)
|
int (*deviceWrite)(int minor, char *buf, int len)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ rtems_status_code rtems_termios_open (
|
|||||||
void *arg,
|
void *arg,
|
||||||
int (*deviceFirstOpen)(int major, int minor, void *arg),
|
int (*deviceFirstOpen)(int major, int minor, void *arg),
|
||||||
int (*deviceLastClose)(int major, int minor, void *arg),
|
int (*deviceLastClose)(int major, int minor, void *arg),
|
||||||
int (*deviceRead)(int minor, char *buf),
|
int (*deviceRead)(int minor),
|
||||||
int (*deviceWrite)(int minor, char *buf, int len)
|
int (*deviceWrite)(int minor, char *buf, int len)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ struct rtems_termios_tty {
|
|||||||
* Callbacks to device-specific routines
|
* Callbacks to device-specific routines
|
||||||
*/
|
*/
|
||||||
int (*lastClose)(int major, int minor, void *arg);
|
int (*lastClose)(int major, int minor, void *arg);
|
||||||
int (*read)(int minor, char *buf);
|
int (*read)(int minor);
|
||||||
int (*write)(int minor, char *buf, int len);
|
int (*write)(int minor, char *buf, int len);
|
||||||
};
|
};
|
||||||
static struct rtems_termios_tty *ttyHead, *ttyTail;
|
static struct rtems_termios_tty *ttyHead, *ttyTail;
|
||||||
@@ -133,7 +133,7 @@ rtems_termios_open (
|
|||||||
void *arg,
|
void *arg,
|
||||||
int (*deviceFirstOpen)(int major, int minor, void *arg),
|
int (*deviceFirstOpen)(int major, int minor, void *arg),
|
||||||
int (*deviceLastClose)(int major, int minor, void *arg),
|
int (*deviceLastClose)(int major, int minor, void *arg),
|
||||||
int (*deviceRead)(int minor, char *buf),
|
int (*deviceRead)(int minor),
|
||||||
int (*deviceWrite)(int minor, char *buf, int len)
|
int (*deviceWrite)(int minor, char *buf, int len)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -603,20 +603,16 @@ siproc (unsigned char c, struct rtems_termios_tty *tty)
|
|||||||
static rtems_status_code
|
static rtems_status_code
|
||||||
fillBufferPoll (struct rtems_termios_tty *tty)
|
fillBufferPoll (struct rtems_termios_tty *tty)
|
||||||
{
|
{
|
||||||
unsigned char c;
|
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
if (tty->termios.c_lflag & ICANON) {
|
if (tty->termios.c_lflag & ICANON) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
n = (*tty->read)(tty->minor, &c);
|
n = (*tty->read)(tty->minor);
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
return RTEMS_UNSATISFIED;
|
|
||||||
}
|
|
||||||
else if (n == 0) {
|
|
||||||
rtems_task_wake_after (1);
|
rtems_task_wake_after (1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (siproc (c, tty))
|
if (siproc (n, tty))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -626,11 +622,8 @@ fillBufferPoll (struct rtems_termios_tty *tty)
|
|||||||
if (!tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
|
if (!tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
|
||||||
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &then);
|
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &then);
|
||||||
for (;;) {
|
for (;;) {
|
||||||
n = (*tty->read)(tty->minor, &c);
|
n = (*tty->read)(tty->minor);
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
return RTEMS_UNSATISFIED;
|
|
||||||
}
|
|
||||||
else if (n == 0) {
|
|
||||||
if (tty->termios.c_cc[VMIN]) {
|
if (tty->termios.c_cc[VMIN]) {
|
||||||
if (tty->termios.c_cc[VTIME] && tty->ccount) {
|
if (tty->termios.c_cc[VTIME] && tty->ccount) {
|
||||||
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
|
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
|
||||||
@@ -650,7 +643,7 @@ fillBufferPoll (struct rtems_termios_tty *tty)
|
|||||||
rtems_task_wake_after (1);
|
rtems_task_wake_after (1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
siproc (c, tty);
|
siproc (n, tty);
|
||||||
if (tty->ccount >= tty->termios.c_cc[VMIN])
|
if (tty->ccount >= tty->termios.c_cc[VMIN])
|
||||||
break;
|
break;
|
||||||
if (tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
|
if (tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ rtems_status_code rtems_termios_open (
|
|||||||
void *arg,
|
void *arg,
|
||||||
int (*deviceFirstOpen)(int major, int minor, void *arg),
|
int (*deviceFirstOpen)(int major, int minor, void *arg),
|
||||||
int (*deviceLastClose)(int major, int minor, void *arg),
|
int (*deviceLastClose)(int major, int minor, void *arg),
|
||||||
int (*deviceRead)(int minor, char *buf),
|
int (*deviceRead)(int minor),
|
||||||
int (*deviceWrite)(int minor, char *buf, int len)
|
int (*deviceWrite)(int minor, char *buf, int len)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ struct rtems_termios_tty {
|
|||||||
* Callbacks to device-specific routines
|
* Callbacks to device-specific routines
|
||||||
*/
|
*/
|
||||||
int (*lastClose)(int major, int minor, void *arg);
|
int (*lastClose)(int major, int minor, void *arg);
|
||||||
int (*read)(int minor, char *buf);
|
int (*read)(int minor);
|
||||||
int (*write)(int minor, char *buf, int len);
|
int (*write)(int minor, char *buf, int len);
|
||||||
};
|
};
|
||||||
static struct rtems_termios_tty *ttyHead, *ttyTail;
|
static struct rtems_termios_tty *ttyHead, *ttyTail;
|
||||||
@@ -133,7 +133,7 @@ rtems_termios_open (
|
|||||||
void *arg,
|
void *arg,
|
||||||
int (*deviceFirstOpen)(int major, int minor, void *arg),
|
int (*deviceFirstOpen)(int major, int minor, void *arg),
|
||||||
int (*deviceLastClose)(int major, int minor, void *arg),
|
int (*deviceLastClose)(int major, int minor, void *arg),
|
||||||
int (*deviceRead)(int minor, char *buf),
|
int (*deviceRead)(int minor),
|
||||||
int (*deviceWrite)(int minor, char *buf, int len)
|
int (*deviceWrite)(int minor, char *buf, int len)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -603,20 +603,16 @@ siproc (unsigned char c, struct rtems_termios_tty *tty)
|
|||||||
static rtems_status_code
|
static rtems_status_code
|
||||||
fillBufferPoll (struct rtems_termios_tty *tty)
|
fillBufferPoll (struct rtems_termios_tty *tty)
|
||||||
{
|
{
|
||||||
unsigned char c;
|
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
if (tty->termios.c_lflag & ICANON) {
|
if (tty->termios.c_lflag & ICANON) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
n = (*tty->read)(tty->minor, &c);
|
n = (*tty->read)(tty->minor);
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
return RTEMS_UNSATISFIED;
|
|
||||||
}
|
|
||||||
else if (n == 0) {
|
|
||||||
rtems_task_wake_after (1);
|
rtems_task_wake_after (1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (siproc (c, tty))
|
if (siproc (n, tty))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -626,11 +622,8 @@ fillBufferPoll (struct rtems_termios_tty *tty)
|
|||||||
if (!tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
|
if (!tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
|
||||||
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &then);
|
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &then);
|
||||||
for (;;) {
|
for (;;) {
|
||||||
n = (*tty->read)(tty->minor, &c);
|
n = (*tty->read)(tty->minor);
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
return RTEMS_UNSATISFIED;
|
|
||||||
}
|
|
||||||
else if (n == 0) {
|
|
||||||
if (tty->termios.c_cc[VMIN]) {
|
if (tty->termios.c_cc[VMIN]) {
|
||||||
if (tty->termios.c_cc[VTIME] && tty->ccount) {
|
if (tty->termios.c_cc[VTIME] && tty->ccount) {
|
||||||
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
|
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
|
||||||
@@ -650,7 +643,7 @@ fillBufferPoll (struct rtems_termios_tty *tty)
|
|||||||
rtems_task_wake_after (1);
|
rtems_task_wake_after (1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
siproc (c, tty);
|
siproc (n, tty);
|
||||||
if (tty->ccount >= tty->termios.c_cc[VMIN])
|
if (tty->ccount >= tty->termios.c_cc[VMIN])
|
||||||
break;
|
break;
|
||||||
if (tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
|
if (tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
|
||||||
|
|||||||
Reference in New Issue
Block a user