TAILIEUCHUNG - Embedded FreeBSD Cookbook phần 7

Khi một dịch vụ mạng là đóng cửa, dọn dẹp thích hợp được khuyến khích. Mô tả ổ cắm phải được đóng cửa, bằng cách sử dụng cuộc gọi hệ thống chặt chẽ, giống như một mô tả tập tin. # bao gồm gần int (int fd); | 136 Embedded FreeBSD Cookbook else printf illegal state n return if dio set int s 0 printf set int failed n Listing 7-7 The int_handler function parses the user input looking for either the enable or disable string to determine the interrupt setting. If the user input is correct dio_set_int is called to set the interrupt state. The pciint_handler Function The pciint_handler function is used to set pci interrupts. The pciint command is entered using the following syntax pciint value where value is either the string enable or disable. void pciint handler char args uint8 t p char state 32 DIOintstate t s sscanf args s s state if strcmp state enable 0 strcmp state ENABLE 0 s enable else if strcmp state disable 0 strcmp state DISABLE 0 s disable 137 Chapter Seven Remote Management else printf illegal state n return if dio set pciint s 0 printf set pciint failed n Listing 7-8 The pciint_handler function parses the user input looking for either the enable or disable string to determine the interrupt setting. If the user input is correct dio_set_pciint is called to set the interrupt state. The setpolarity_handler Function The setpolarity_handler function is used to set the interrupt polarity. The set polarity command is entered using the following syntax setpol value where value is either high or low. void setpolarity handler char args uint8 t p char state 32 DIOpolarity_t polarity sscanf args s s state if strcmp state hi 0 strcmp state HI 0 polarity activehi else if strcmp state lo 0 strcmp state LO 0 polarity activelo 138 Embedded FreeBSD Cookbook else printf invalid polarity n return if dio set polarity polarity 0 printf error writing polarity n Listing 7-9 The int_handler function parses the user input looking for either the high or low string to determine the interrupt polarity setting. If the user input is correct dio_set_polarity is called to set the interrupt polarity. The getpolarity_handler Function The getpolarity_handler function is used to read the interrupt .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.