home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / cpu / cpuid / cpuid.h < prev   
Encoding:
C/C++ Source or Header  |  1992-06-01  |  1.2 KB  |  58 lines

  1. /*
  2.  * NAME:
  3.  *  cpuid.h
  4.  *
  5.  * AUTHOR:
  6.  *  Ernest Vogelsinger
  7.  *
  8.  * DESCRIPTION:
  9.  *  Detect processor type and mode
  10.  *  Original INTEL code
  11.  *
  12.  * VERSION:
  13.  *  1.0
  14.  *
  15.  * HISTORY:
  16.  *
  17.  * (c) 1991 E. Vogelsinger
  18.  */
  19.  
  20. #if !defined(_CPUID_DEFINED)
  21.  
  22. /* ==== types ============================================================ */
  23.  
  24. typedef unsigned short PROC_MODE;
  25.  
  26. /* ==== definitions ====================================================== */
  27.  
  28. #define PROC_8086       0x0001
  29. #define PROC_80286      0x0002
  30. #define PROC_80386      0x0004
  31. #define PROC_80486SX    0x0008
  32. #define PROC_80486DX    0x0808
  33. #define PROC_8087       0x0100
  34. #define PROC_80287      0x0200
  35. #define PROC_80387      0x0400
  36. #define PROC_80487      0x0800
  37. #define MODE_PROTECTED  0x8000
  38.  
  39.  
  40. /* ==== macros =========================================================== */
  41.  
  42. #define MASK_PROC(t)    ((t) & 0x00FF)
  43. #define MASK_COPROC(t)  ((t) & 0x7F00)
  44. #define IS486DX(t)      (((t)& 0x0808) == 0x0808)
  45. #define IS_PMODE(t)     ((t) & MODE_PROTECTED)
  46.  
  47. /* ==== prototypes and public values ===================================== */
  48.  
  49. PROC_MODE far pascal GetCpuId(void);
  50.  
  51.  
  52. #define _CPUID_DEFINED
  53. #endif
  54.  
  55.  
  56.  
  57. 
  58.