3 running a scripts program, Figure7.9 general.ss scripts source file, Running a scripts program – Avago Technologies LSI53C1010 User Manual
Page 178: General.ss scripts source file
![background image](https://www.manualsdir.com/files/864554/content/doc178.png)
7-12
Integrating SCRIPTS Programs into “C” Language Drivers
SCRIPT[E_SCRATCHA1_addr_Used[0]] =
VirttoPhys(chip_reg[ScratchA]) + 1;
SCRIPT[E_SCRATCHB_addr_Used[0]] =
VirttoPhys(chip_reg[ScratchB]);
SCRIPT[E_SCRATCHB_addr_Used[1]] =
VirttoPhys(chip_reg[ScratchB]);
These are the only patches required. LOAD and STORE instructions
could be used to replace the Memory-to-Memory Move instructions.
Note:
SCRATCHA1 is used instead of SCRATCHA0 due to the
alignment requirements of the Memory to Memory Move
instruction.
7.3 Running a SCRIPTS Program
The SCRIPTS program is ready to run after all Command, Data, and
Message buffers have been set up for the I/O. Writing the physical
address of the program to the DSP register, starting at bit 3, initiates the
SCRIPTS program. There are sections of sample code in Figures
and
.
The entry points named in this example are all different points where
SCRIPTS instructions could start.
static uquad start_offset[] = {
Ent_init_siop3, Ent_start_up4, Ent_switch5
};
This example starts the SCRIPTS program:
IOWrite32(PCIDeviceIOBase+DSP, getPhysAddr(script) +
start_offset[mode]);
In this example,
mode = 0
begins at
init_siop
label,
mode = 1
begins
at
start_up
, and
mode = 2
begins at the
switch label
.
Figure 7.9
General.ss SCRIPTS Source File
; Single-threaded general purpose SCRIPTS routine
; Offset for counts and addresses in the table
TABLE dsa_table \
sendmsg = ??, \