Skip to Content
Linux Device Drivers, Second Edition
book

Linux Device Drivers, Second Edition

by Jonathan Corbet, Alessandro Rubini
June 2001
Intermediate to advanced
592 pages
19h 20m
English
O'Reilly Media, Inc.
Content preview from Linux Device Drivers, Second Edition

Quick Reference

This chapter introduced the following symbols related to hardware management.

#include <linux/kernel.h> , void barrier(void)

This “software” memory barrier requests the compiler to consider all memory volatile across this instruction.

#include <asm/system.h> , void rmb(void); , void wmb(void); , void mb(void);

Hardware memory barriers. They request the CPU (and the compiler) to checkpoint all memory reads, writes, or both, across this instruction.

#include <asm/io.h> , unsigned inb(unsigned port); , void outb(unsigned char byte, unsigned port); , unsigned inw(unsigned port); , void outw(unsigned short word, unsigned port); , unsigned inl(unsigned port); , void outl(unsigned doubleword, unsigned port);

These functions are used to read and write I/O ports. They can also be called by user-space programs, provided they have the right privileges to access ports.

unsigned inb_p(unsigned port); , ...

The statement SLOW_DOWN_IO is sometimes needed to deal with slow ISA boards on the x86 platform. If a small delay is needed after an I/O operation, you can use the six pausing counterparts of the functions introduced in the previous entry; these pausing functions have names ending in _p.

void insb(unsigned port, void *addr, unsigned long count); , void outsb(unsigned port, void *addr, unsigned long count); , void insw(unsigned port, void *addr, unsigned long count); , void outsw(unsigned port, void *addr, unsigned long count); , ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Device Drivers, 3rd Edition

Linux Device Drivers, 3rd Edition

Jonathan Corbet, Alessandro Rubini, Greg Kroah-Hartman

Publisher Resources

ISBN: 0596000081Supplemental ContentCatalog PageErrata