Motorola MCP750 Specifications Page 124

  • Download
  • Add to my manuals
  • Print
  • Page
    / 344
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 123
D
evice Driver Programming
9-4
CAUTION
When using C data types to communicate with hardware devices
on the Series 6000 platform, care must be taken to ensure that the
proper alignment and byte ordering requirements specific to the
CPU and I/O architecture of the Series 6000 system are met. Fail-
ure to adhere to these alignment and byte ordering requirements
can result either in system crashes or scrambled device data.
Alignment should be checked depending on the data type size as
follows. Two–byte quantities (short, unsigned short) must
fall on word boundaries. Four–byte quantities (int, long,
pointer) must fall on longword boundaries. Eight-byte quantities
must fall on doubleword (8–byte) boundaries. Refer to Chapter 5
for an overview of the alignment, word size, and ordering issues
on the Series 6000 computer system. Finally, the ordering of bytes
is Big Endian, where the most significant bit is at the lowest
address.
Header Files 9
Every device driver needs to include the system header files that contain the definitions of
the structures used by the device driver. The header files are located in the
/usr/include/sys directory.
The standard header files that are normally included in the device driver’s source file are
described as follows:
adapter.h Defines kernel configuration structures, including the adapter
array.
ioccom.h Defines macros used to format ioctl(2) commands to the
device.
ksynch.h Defines the kernel synchronization primitives.
autoconf.h Defines symbolic constants for minimum and maximum interrupt
vectors, HVME slots.
debug.h Definitions to assist in debugging the kernel.
dev_t
4
major & minor device numbers
longword
off_t
4
small offset (-OFF_MAX to +OFF_MAX,
as defined in sys/types.h
longword
off64_t
8
large offset (-OFF64_MAX to
+OFF64_MAX, as defined in
sys/types.h)
doubleword
Table 9-1. System Data Types (Cont.)
Type Size Purpose Alignment
Page view 123
1 2 ... 119 120 121 122 123 124 125 126 127 128 129 ... 343 344

Comments to this Manuals

No comments