tailieunhanh - LINUX DEVICE DRIVERS 3rd edition phần 10

Chars_in_buffer chức năng trong cơ cấu tty_driver là không cần thiết để có một trình điều khiển tty làm việc, nhưng nó được khuyến khích. Chức năng này được gọi là khi cốt lõi tty muốn biết bao nhiêu nhân vật vẫn còn lại trong bộ đệm viết các trình điều khiển tty được gửi đi. Nếu trình điều khiển có thể lưu trữ các ký tự trước khi gửi chúng đến phần cứng | calculate how much room is left in the device room 255 exit up tiny- sem return room Other Buffering Functions The chars_in_buffer function in the tty_driver structure is not required in order to have a working tty driver but it is recommended. This function is called when the tty core wants to know how many characters are still remaining in the tty driver s write buffer to be sent out. If the driver can store characters before it sends them out to the hardware it should implement this function in order for the tty core to be able to determine if all of the data in the driver has drained out. Three functions callbacks in the tty_driver structure can be used to flush any remaining data that the driver is holding on to. These are not required to be implemented but are recommended if the tty driver can buffer data before it sends it to the hardware. The first two function callbacks are called flush_chars and wait_until_sent. These functions are called when the tty core has sent a number of characters to the tty driver using the put_char function callback. The flush_chars function callback is called when the tty core wants the tty driver to start sending these characters out to the hardware if it hasn t already started. This function is allowed to return before all of the data is sent out to the hardware. The wait_until_sent function callback works much the same way but it must wait until all of the characters are sent before returning to the tty core or until the passed in timeout value has expired whichever occurrence happens first. The tty driver is allowed to sleep within this function in order to complete it. If the timeout value passed to the wait_until_sent function callback is set to 0 the function should wait until it is finished with the operation. The remaining data flushing function callback is flush_buffer. It is called by the tty core when the tty driver is to flush all of the data still in its write buffers out of memory. Any data remaining in the .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.