libsmbios_c library
Data Structures | Functions
cmos Namespace Reference

Data Structures

class  CmosRWFactory
 
class  ICmosRW
 

Functions

 DECLARE_EXCEPTION (CmosException)
 Abstract base class for the cmos read write operations. More...
 
 DECLARE_EXCEPTION_EX (InvalidCmosRWMode, cmos, CmosException)
 
void readByteArray (const ICmosRW &cmos, u32 indexPort, u32 dataPort, u32 offset, u8 *target, u32 count)
 
void writeByteArray (const ICmosRW &cmos, u32 indexPort, u32 dataPort, u32 offset, const u8 *source, u32 count)
 

Function Documentation

§ DECLARE_EXCEPTION()

cmos::DECLARE_EXCEPTION ( CmosException  )

Abstract base class for the cmos read write operations.

§ DECLARE_EXCEPTION_EX()

cmos::DECLARE_EXCEPTION_EX ( InvalidCmosRWMode  ,
cmos  ,
CmosException   
)

§ readByteArray()

void cmos::readByteArray ( const ICmosRW cmos,
u32  indexPort,
u32  dataPort,
u32  offset,
u8 target,
u32  count 
)

Read or write an array of bytes to CMOS.

This function is set up as a non-member helper function. It successively reads/writes

Parameters
countbytes from/to CMOS.

Note that the byte array passed as a parameter need not be zero-terminated.

Parameters
cmosPass in the ICmosRW object to operate on
indexPortThe IO port to write the offset to
dataPortThe IO port to read/write data after setting the index via indexPort
offsetThe offset within CMOS. CMOS is typically multiple 256byte pages.
targetByte array to store the results. Call must already have allocated.
countThe number of bytes to read/write.

§ writeByteArray()

void cmos::writeByteArray ( const ICmosRW cmos,
u32  indexPort,
u32  dataPort,
u32  offset,
const u8 source,
u32  count 
)

Read or write an array of bytes to CMOS.

This function is set up as a non-member helper function. It successively reads/writes

Parameters
countbytes from/to CMOS.

Note that the byte array passed as a parameter need not be zero-terminated.

Parameters
cmosPass in the ICmosRW object to operate on
indexPortThe IO port to write the offset to
dataPortThe IO port to read/write data after setting the index via indexPort
offsetThe offset within CMOS. CMOS is typically multiple 256byte pages.
sourcebyte array to store the CMOS contents. must be allocated by caller.
countThe number of bytes to read/write.