Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.6 KiB

  1. // $Header: G:/SwDev/WDM/Video/bt848/rcs/Compreg.h 1.3 1998/04/29 22:43:31 tomz Exp $
  2. #ifndef __COMPREG_H
  3. #define __COMPREG_H
  4. #ifndef __REGFIELD_H
  5. #include "regfield.h"
  6. #endif
  7. /* Class: CompositeReg
  8. * Purpose: This class encapsulates the registers that have their bits in two
  9. * different places ( registers )
  10. * Attributes:
  11. * LSBPart_: Register & - least significant bits part of a composite register
  12. * HighPart_: RegField & - most significant bits part of a composite register
  13. * LowPartWidth_: BYTE - width of the low portion in bits
  14. * Operations:
  15. * operator DWORD(): data access method. Returns a value of the register
  16. * DWORD operator=( DWORD ): assignment operator. Used to set the register
  17. * Note: the error handling provided by the class is minimal. It is a responibility
  18. * of the user to pass correct parameters to the constructor. The class has
  19. * no way of knowing if the correct low and high registers passed in are correct,
  20. * for example. If low part size in bits passed in is not less then MaxWidth ( 32 )
  21. * the mask used to isolate the low portion will be 0xFFFFFFFF
  22. */
  23. class CompositeReg : public RegBase
  24. {
  25. private:
  26. Register &LSBPart_;
  27. RegField &MSBPart_;
  28. BYTE LowPartWidth_;
  29. CompositeReg();
  30. public:
  31. virtual operator DWORD();
  32. virtual DWORD operator=( DWORD dwValue );
  33. CompositeReg( Register &LowReg, BYTE LowWidth, RegField &HighReg, RegisterType aType ) :
  34. RegBase( aType ), LSBPart_( LowReg ), MSBPart_( HighReg ),
  35. LowPartWidth_( LowWidth ) {}
  36. };
  37. #endif