|
Many of the functions in the board services module need to use global bus and they protect themselves against other threads interfering by claiming and releasing the global bus around their accesses.
It is common to need sequences of PCI register accesses; in these circumstances, continual claiming and releasing would be inefficient. The functions that access PCI registers, Smt_PciRegRead and Smt_PciRegWrite, therefore assume that the global bus have been claimed by the caller. You claim the global bus by calling Smt_ClaimGB and you subsequently release it by calling Smt_ReleaseGB.
You should claim the global bus only when you are going to access the PCI registers with Smt_PciRegRead and Smt_PciRegWrite, and must release it after your sequence of accesses; leaving the global bus claimed and then attempting to call any of the other board services cause your application to become fatally idle.
Smt_ClaimGB
#include <SMT_BSI.h>
int Smt_ClaimGB(SC6xSmtI *BsI);
|
stand-alone
|
Reserve the use of the global bus for this thread. The calling thread is suspended if the global bus has been reserved by another thread; it resumes when the global bus is released.
|
|
Smt_ReleaseGB
#include <SMT_BSI.h>
int Smt_ReleaseGB(SC6xSmtI *BsI);
|
stand-alone
|
Release the global bus for use by other threads. If there are threads waiting to claim the global bus, one claims it and continues executing.
|
|
Smt_PciRegRead
#include <SMT_BSI.h>
unsigned int Smt_PciRegRead(SC6xSmtI *BsI, unsigned int Woffset);
|
stand-alone
|
The function returns the contents of the PCI register located at the given word offset, Woffset, from the PCI base. The Global Bus should be claimed when you issue this call. See Smt_ClaimGB.
|
|
Smt_PciRegWrite
#include <SMT_BSI.h>
int Smt_PciRegWrite(SC6xSmtI *BsI,
unsigned int Woffset,
unsigned int Value);
|
stand-alone
|
Write Value to a PCI register located at the given word offset, Woffset, from the PCI base. The Global Bus should be claimed when you issue this call. See Smt_ClaimGB.
|
|
|