<b>(a)</b> #include "myheader.h" MY_STRUCT *ptr; ptr = (MY_STRUCT *) BASE_ADDRESS; ptr->command.arg1 = 1; ptr->command.arg2 = 2; <b>(b)</b> ptr = (MY_STRUCT *) __va(BASE_ADDRESS)
Example 4: (a) In Linux kernels 2.0.XX, the pointer can be set directly; (b) in Linux kernels 2.1.XX, the pointer needs to be mapped via a call to the __va() macro.
Copyright © 1999, Dr. Dobb's Journal