1 initializing the scripts processor, Figure7.1 accessing i/o mapped registers, Chapter 7 – Avago Technologies LSI53C1010 User Manual
Page 167: Initializing the scripts processor, Accessing i/o mapped registers

SCSI SCRIPTS Processors
7-1
Chapter 7
Integrating SCRIPTS
Programs into “C”
Language Drivers
This chapter demonstrates how assembled SCRIPTS programs are
included in SCSI device drivers written in “C” language. This chapter
contains the following sections:
•
Section 7.1, “Initializing the SCRIPTS Processor,” page 7-1
•
Section 7.2, “Patching,” page 7-7
•
Section 7.3, “Running a SCRIPTS Program,” page 7-12
7.1 Initializing the SCRIPTS Processor
The “C” code in
is an example that shows how the SCRIPTS
processor accesses the operating registers at initialization. The
processor can be memory-mapped, I/O-mapped, or mapped using both
methods. The example functions in this section access I/O mapped
registers.
Figure 7.1
Accessing I/O Mapped Registers
/******************************************************
Function: IORead8
Purpose: To read a byte from an io port
Input: IO address of byte to be read
Output: byte read from IO port
Assumptions: That the IO port actually exists
Restrictions: Although IO_Addr is defined as
a ULONG it must not exceed 16 bits
in length as this is the maximum
IO address the X86 architecture can produce
Other functions called: inportb to read the io port
******************************************************/
UBYTE IORead8(ULONG IO_Addr)
{
return (inportb((UINT) IO_Addr));