lkml.org 
[lkml]   [1999]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectTTY Flip buffers

Hello,

I was looking at the TTY flip buffers, and I noticed that its structure
declaration is as follows:

#define TTY_FLIPBUF_SIZE 512

struct tty_flip_buffer {
struct tq_struct tqueue;
struct semaphore pty_sem;
char *char_buf_ptr;
unsigned char *flag_buf_ptr;
int count;
int buf_num;
unsigned char char_buf[2*TTY_FLIPBUF_SIZE];
char flag_buf[2*TTY_FLIPBUF_SIZE];
unsigned char slop[4]; /* N.B. bug overwrites buffer by 1 */
};

Note that the char_buf buffer size is 2*TTY_FLIPBUF_SIZE. However, all
serial drivers check the value TTY_FLIPBUF_SIZE in order to know whether
the buffer is full or not.

Is this correct?? Shouldn't the serial drivers be checking for
2*TTY_FLIPBUF_SIZE?? Aren't the serial drivers subutilizing the flip
buffers in this way??

Another question: if I want to use a larger flip buffer, can I just
allocate the required memory amount and set the pointers char_buf_ptr and
flag_buf_ptr?? If not, I don't see the reason for the existence of these
pointers ...

Thanks in advance for your comments.

Regards,
Ivan


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.134 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site