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.

109 lines
2.7 KiB

  1. /*++
  2. Copyright (c) 1991 - 2001 Microsoft Corporation
  3. Module Name:
  4. ### ## # ## ##### #### ### ##### ## ##
  5. ## # ## ### ## ## ## ## ## # ## ## ## ##
  6. ### ## ### ## ## ## ## ### ## ## ## ##
  7. ### ## # # ## ## ## ## ### ## ## #######
  8. ### ### ### ## ## ## ### ##### ## ##
  9. # ## ### ### ## ## ## # ## ## ## ## ##
  10. ### ## ## ##### #### ### ## ## ## ##
  11. Abstract:
  12. This header file contains the definitions for the
  13. ServerWorks local display miniport driver.
  14. Author:
  15. Wesley Witt (wesw) 1-Oct-2001
  16. Environment:
  17. Kernel mode only.
  18. Notes:
  19. --*/
  20. extern "C" {
  21. #include <ntddk.h>
  22. #include <stdio.h>
  23. }
  24. #define MINIPORT_DEVICE_TYPE SA_DEVICE_DISPLAY
  25. #include "saport.h"
  26. //
  27. // Global Defines
  28. //
  29. #define DISPLAY_COLUMNS (128)
  30. #define DISPLAY_PAGES (8)
  31. #define DISPLAY_WIDTH (128)
  32. #define DISPLAY_HEIGHT (64)
  33. #define DISPLAY_LINES_PER_PAGE (8)
  34. #define MAX_BITMAP_SIZE ((DISPLAY_COLUMNS * DISPLAY_PAGES * DISPLAY_LINES_PER_PAGE)/8)
  35. typedef struct _DEVICE_EXTENSION {
  36. PUCHAR VideoMemBase;
  37. } DEVICE_EXTENSION, *PDEVICE_EXTENSION;
  38. #define GetDisplayPage(_base) \
  39. READ_REGISTER_UCHAR( (*(PUCHAR)((PUCHAR)_base + 0) & 0xf) )
  40. #define SetDisplayPage(_base,_pg) \
  41. WRITE_REGISTER_UCHAR( (PUCHAR)((PUCHAR)_base + 0), (_pg & 0xf) )
  42. #define GetDisplayColumnAddressUpper(_base) \
  43. READ_REGISTER_UCHAR( (*(PUCHAR)((PUCHAR)_base + 2) & 0xf) )
  44. #define GetDisplayColumnAddressLower(_base) \
  45. READ_REGISTER_UCHAR( (*(PUCHAR)((PUCHAR)_base + 3) & 0xf) )
  46. #define GetDisplayColumnAddress(_base) \
  47. ((GetDisplayColumnAddressUpper(_base) << 4) | GetDisplayColumnAddressLower(_base))
  48. #define SetDisplayColumnAddressUpper(_base,_colu) \
  49. WRITE_REGISTER_UCHAR( (PUCHAR)((PUCHAR)_base + 2), ((_colu) & 0xf) )
  50. #define SetDisplayColumnAddressLower(_base,_coll) \
  51. WRITE_REGISTER_UCHAR( (PUCHAR)((PUCHAR)_base + 3), ((_coll) & 0xf) )
  52. #define SetDisplayColumnAddress(_base,_col) \
  53. { \
  54. SetDisplayColumnAddressUpper(_base,(_col&0xf0)>>4); \
  55. SetDisplayColumnAddressLower(_base,(_col&0xf)); \
  56. }
  57. #define GetDisplayStatus(_base) \
  58. READ_REGISTER_UCHAR( (*(PUCHAR)((PUCHAR)_base + 6)) )
  59. #define GetDisplayData(_base) \
  60. READ_REGISTER_UCHAR( (*(PUCHAR)((PUCHAR)_base + 7)) )
  61. #define SetDisplayData(_base,_data) \
  62. WRITE_REGISTER_UCHAR( (PUCHAR)((PUCHAR)_base + 7), (_data) )
  63. //
  64. // prototypes
  65. //
  66. extern "C" {
  67. NTSTATUS
  68. DriverEntry(
  69. IN PDRIVER_OBJECT DriverObject,
  70. IN PUNICODE_STRING RegistryPath
  71. );
  72. } // extern "C"