Print this page
update to acpica-unix2-20131218
acpica-unix2-20130823
PANKOVs restructure

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/sys/acpi/actbl1.h
          +++ new/usr/src/common/acpica/include/actbl1.h
   1    1  /******************************************************************************
   2    2   *
   3    3   * Name: actbl1.h - Additional ACPI table definitions
   4    4   *
   5    5   *****************************************************************************/
   6    6  
   7    7  /*
   8      - * Copyright (C) 2000 - 2011, Intel Corp.
        8 + * Copyright (C) 2000 - 2013, Intel Corp.
   9    9   * All rights reserved.
  10   10   *
  11   11   * Redistribution and use in source and binary forms, with or without
  12   12   * modification, are permitted provided that the following conditions
  13   13   * are met:
  14   14   * 1. Redistributions of source code must retain the above copyright
  15   15   *    notice, this list of conditions, and the following disclaimer,
  16   16   *    without modification.
  17   17   * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  18   18   *    substantially similar to the "NO WARRANTY" disclaimer below
↓ open down ↓ 56 lines elided ↑ open up ↑
  75   75  #define ACPI_SIG_SRAT           "SRAT"      /* System Resource Affinity Table */
  76   76  
  77   77  
  78   78  /*
  79   79   * All tables must be byte-packed to match the ACPI specification, since
  80   80   * the tables are provided by the system BIOS.
  81   81   */
  82   82  #pragma pack(1)
  83   83  
  84   84  /*
  85      - * Note about bitfields: The UINT8 type is used for bitfields in ACPI tables.
  86      - * This is the only type that is even remotely portable. Anything else is not
  87      - * portable, so do not use any other bitfield types.
       85 + * Note: C bitfields are not used for this reason:
       86 + *
       87 + * "Bitfields are great and easy to read, but unfortunately the C language
       88 + * does not specify the layout of bitfields in memory, which means they are
       89 + * essentially useless for dealing with packed data in on-disk formats or
       90 + * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
       91 + * this decision was a design error in C. Ritchie could have picked an order
       92 + * and stuck with it." Norman Ramsey.
       93 + * See http://stackoverflow.com/a/1053662/41661
  88   94   */
  89   95  
  90   96  
  91   97  /*******************************************************************************
  92   98   *
  93   99   * Common subtable headers
  94  100   *
  95  101   ******************************************************************************/
  96  102  
  97  103  /* Generic subtable header (used in MADT, SRAT, etc.) */
↓ open down ↓ 25 lines elided ↑ open up ↑
 123  129   *
 124  130   * BERT - Boot Error Record Table (ACPI 4.0)
 125  131   *        Version 1
 126  132   *
 127  133   ******************************************************************************/
 128  134  
 129  135  typedef struct acpi_table_bert
 130  136  {
 131  137      ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
 132  138      UINT32                  RegionLength;       /* Length of the boot error region */
 133      -    UINT64                  Address;            /* Physical addresss of the error region */
      139 +    UINT64                  Address;            /* Physical address of the error region */
 134  140  
 135  141  } ACPI_TABLE_BERT;
 136  142  
 137  143  
 138  144  /* Boot Error Region (not a subtable, pointed to by Address field above) */
 139  145  
 140  146  typedef struct acpi_bert_region
 141  147  {
 142  148      UINT32                  BlockStatus;        /* Type of error information */
 143  149      UINT32                  RawDataOffset;      /* Offset to raw error data */
↓ open down ↓ 101 lines elided ↑ open up ↑
 245  251  } ACPI_EINJ_ENTRY;
 246  252  
 247  253  /* Masks for Flags field above */
 248  254  
 249  255  #define ACPI_EINJ_PRESERVE          (1)
 250  256  
 251  257  /* Values for Action field above */
 252  258  
 253  259  enum AcpiEinjActions
 254  260  {
 255      -    ACPI_EINJ_BEGIN_OPERATION       = 0,
 256      -    ACPI_EINJ_GET_TRIGGER_TABLE     = 1,
 257      -    ACPI_EINJ_SET_ERROR_TYPE        = 2,
 258      -    ACPI_EINJ_GET_ERROR_TYPE        = 3,
 259      -    ACPI_EINJ_END_OPERATION         = 4,
 260      -    ACPI_EINJ_EXECUTE_OPERATION     = 5,
 261      -    ACPI_EINJ_CHECK_BUSY_STATUS     = 6,
 262      -    ACPI_EINJ_GET_COMMAND_STATUS    = 7,
 263      -    ACPI_EINJ_ACTION_RESERVED       = 8,     /* 8 and greater are reserved */
 264      -    ACPI_EINJ_TRIGGER_ERROR         = 0xFF   /* Except for this value */
      261 +    ACPI_EINJ_BEGIN_OPERATION               = 0,
      262 +    ACPI_EINJ_GET_TRIGGER_TABLE             = 1,
      263 +    ACPI_EINJ_SET_ERROR_TYPE                = 2,
      264 +    ACPI_EINJ_GET_ERROR_TYPE                = 3,
      265 +    ACPI_EINJ_END_OPERATION                 = 4,
      266 +    ACPI_EINJ_EXECUTE_OPERATION             = 5,
      267 +    ACPI_EINJ_CHECK_BUSY_STATUS             = 6,
      268 +    ACPI_EINJ_GET_COMMAND_STATUS            = 7,
      269 +    ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS   = 8,
      270 +    ACPI_EINJ_ACTION_RESERVED               = 9,     /* 9 and greater are reserved */
      271 +    ACPI_EINJ_TRIGGER_ERROR                 = 0xFF   /* Except for this value */
 265  272  };
 266  273  
 267  274  /* Values for Instruction field above */
 268  275  
 269  276  enum AcpiEinjInstructions
 270  277  {
 271  278      ACPI_EINJ_READ_REGISTER         = 0,
 272  279      ACPI_EINJ_READ_REGISTER_VALUE   = 1,
 273  280      ACPI_EINJ_WRITE_REGISTER        = 2,
 274  281      ACPI_EINJ_WRITE_REGISTER_VALUE  = 3,
 275  282      ACPI_EINJ_NOOP                  = 4,
 276      -    ACPI_EINJ_INSTRUCTION_RESERVED  = 5     /* 5 and greater are reserved */
      283 +    ACPI_EINJ_FLUSH_CACHELINE       = 5,
      284 +    ACPI_EINJ_INSTRUCTION_RESERVED  = 6     /* 6 and greater are reserved */
 277  285  };
 278  286  
      287 +typedef struct acpi_einj_error_type_with_addr
      288 +{
      289 +    UINT32                  ErrorType;
      290 +    UINT32                  VendorStructOffset;
      291 +    UINT32                  Flags;
      292 +    UINT32                  ApicId;
      293 +    UINT64                  Address;
      294 +    UINT64                  Range;
      295 +    UINT32                  PcieId;
 279  296  
      297 +} ACPI_EINJ_ERROR_TYPE_WITH_ADDR;
      298 +
      299 +typedef struct acpi_einj_vendor
      300 +{
      301 +    UINT32                  Length;
      302 +    UINT32                  PcieId;
      303 +    UINT16                  VendorId;
      304 +    UINT16                  DeviceId;
      305 +    UINT8                   RevisionId;
      306 +    UINT8                   Reserved[3];
      307 +
      308 +} ACPI_EINJ_VENDOR;
      309 +
      310 +
 280  311  /* EINJ Trigger Error Action Table */
 281  312  
 282  313  typedef struct acpi_einj_trigger
 283  314  {
 284  315      UINT32                  HeaderSize;
 285  316      UINT32                  Revision;
 286  317      UINT32                  TableSize;
 287  318      UINT32                  EntryCount;
 288  319  
 289  320  } ACPI_EINJ_TRIGGER;
↓ open down ↓ 16 lines elided ↑ open up ↑
 306  337  #define ACPI_EINJ_PROCESSOR_FATAL           (1<<2)
 307  338  #define ACPI_EINJ_MEMORY_CORRECTABLE        (1<<3)
 308  339  #define ACPI_EINJ_MEMORY_UNCORRECTABLE      (1<<4)
 309  340  #define ACPI_EINJ_MEMORY_FATAL              (1<<5)
 310  341  #define ACPI_EINJ_PCIX_CORRECTABLE          (1<<6)
 311  342  #define ACPI_EINJ_PCIX_UNCORRECTABLE        (1<<7)
 312  343  #define ACPI_EINJ_PCIX_FATAL                (1<<8)
 313  344  #define ACPI_EINJ_PLATFORM_CORRECTABLE      (1<<9)
 314  345  #define ACPI_EINJ_PLATFORM_UNCORRECTABLE    (1<<10)
 315  346  #define ACPI_EINJ_PLATFORM_FATAL            (1<<11)
      347 +#define ACPI_EINJ_VENDOR_DEFINED            (1<<31)
 316  348  
 317  349  
 318  350  /*******************************************************************************
 319  351   *
 320  352   * ERST - Error Record Serialization Table (ACPI 4.0)
 321  353   *        Version 1
 322  354   *
 323  355   ******************************************************************************/
 324  356  
 325  357  typedef struct acpi_table_erst
↓ open down ↓ 159 lines elided ↑ open up ↑
 485  517  
 486  518  /* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
 487  519  
 488  520  typedef struct acpi_hest_aer_common
 489  521  {
 490  522      UINT16                  Reserved1;
 491  523      UINT8                   Flags;
 492  524      UINT8                   Enabled;
 493  525      UINT32                  RecordsToPreallocate;
 494  526      UINT32                  MaxSectionsPerRecord;
 495      -    UINT32                  Bus;
      527 +    UINT32                  Bus;                    /* Bus and Segment numbers */
 496  528      UINT16                  Device;
 497  529      UINT16                  Function;
 498  530      UINT16                  DeviceControl;
 499  531      UINT16                  Reserved2;
 500  532      UINT32                  UncorrectableMask;
 501  533      UINT32                  UncorrectableSeverity;
 502  534      UINT32                  CorrectableMask;
 503  535      UINT32                  AdvancedCapabilities;
 504  536  
 505  537  } ACPI_HEST_AER_COMMON;
 506  538  
 507  539  /* Masks for HEST Flags fields */
 508  540  
 509  541  #define ACPI_HEST_FIRMWARE_FIRST        (1)
 510  542  #define ACPI_HEST_GLOBAL                (1<<1)
 511  543  
      544 +/*
      545 + * Macros to access the bus/segment numbers in Bus field above:
      546 + *  Bus number is encoded in bits 7:0
      547 + *  Segment number is encoded in bits 23:8
      548 + */
      549 +#define ACPI_HEST_BUS(Bus)              ((Bus) & 0xFF)
      550 +#define ACPI_HEST_SEGMENT(Bus)          (((Bus) >> 8) & 0xFFFF)
 512  551  
      552 +
 513  553  /* Hardware Error Notification */
 514  554  
 515  555  typedef struct acpi_hest_notify
 516  556  {
 517  557      UINT8                   Type;
 518  558      UINT8                   Length;
 519  559      UINT16                  ConfigWriteEnable;
 520  560      UINT32                  PollInterval;
 521  561      UINT32                  Vector;
 522  562      UINT32                  PollingThresholdValue;
↓ open down ↓ 5 lines elided ↑ open up ↑
 528  568  
 529  569  /* Values for Notify Type field above */
 530  570  
 531  571  enum AcpiHestNotifyTypes
 532  572  {
 533  573      ACPI_HEST_NOTIFY_POLLED     = 0,
 534  574      ACPI_HEST_NOTIFY_EXTERNAL   = 1,
 535  575      ACPI_HEST_NOTIFY_LOCAL      = 2,
 536  576      ACPI_HEST_NOTIFY_SCI        = 3,
 537  577      ACPI_HEST_NOTIFY_NMI        = 4,
 538      -    ACPI_HEST_NOTIFY_RESERVED   = 5     /* 5 and greater are reserved */
      578 +    ACPI_HEST_NOTIFY_CMCI       = 5,    /* ACPI 5.0 */
      579 +    ACPI_HEST_NOTIFY_MCE        = 6,    /* ACPI 5.0 */
      580 +    ACPI_HEST_NOTIFY_RESERVED   = 7     /* 7 and greater are reserved */
 539  581  };
 540  582  
 541  583  /* Values for ConfigWriteEnable bitfield above */
 542  584  
 543  585  #define ACPI_HEST_TYPE                  (1)
 544  586  #define ACPI_HEST_POLL_INTERVAL         (1<<1)
 545  587  #define ACPI_HEST_POLL_THRESHOLD_VALUE  (1<<2)
 546  588  #define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
 547  589  #define ACPI_HEST_ERR_THRESHOLD_VALUE   (1<<4)
 548  590  #define ACPI_HEST_ERR_THRESHOLD_WINDOW  (1<<5)
↓ open down ↓ 175 lines elided ↑ open up ↑
 724  766      ACPI_MADT_TYPE_IO_APIC              = 1,
 725  767      ACPI_MADT_TYPE_INTERRUPT_OVERRIDE   = 2,
 726  768      ACPI_MADT_TYPE_NMI_SOURCE           = 3,
 727  769      ACPI_MADT_TYPE_LOCAL_APIC_NMI       = 4,
 728  770      ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE  = 5,
 729  771      ACPI_MADT_TYPE_IO_SAPIC             = 6,
 730  772      ACPI_MADT_TYPE_LOCAL_SAPIC          = 7,
 731  773      ACPI_MADT_TYPE_INTERRUPT_SOURCE     = 8,
 732  774      ACPI_MADT_TYPE_LOCAL_X2APIC         = 9,
 733  775      ACPI_MADT_TYPE_LOCAL_X2APIC_NMI     = 10,
 734      -    ACPI_MADT_TYPE_RESERVED             = 11    /* 11 and greater are reserved */
      776 +    ACPI_MADT_TYPE_GENERIC_INTERRUPT    = 11,
      777 +    ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR  = 12,
      778 +    ACPI_MADT_TYPE_RESERVED             = 13    /* 13 and greater are reserved */
 735  779  };
 736  780  
 737  781  
 738  782  /*
 739  783   * MADT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
 740  784   */
 741  785  
 742  786  /* 0: Processor Local APIC */
 743  787  
 744  788  typedef struct acpi_madt_local_apic
↓ open down ↓ 134 lines elided ↑ open up ↑
 879  923  {
 880  924      ACPI_SUBTABLE_HEADER    Header;
 881  925      UINT16                  IntiFlags;
 882  926      UINT32                  Uid;                /* ACPI processor UID */
 883  927      UINT8                   Lint;               /* LINTn to which NMI is connected */
 884  928      UINT8                   Reserved[3];        /* Reserved - must be zero */
 885  929  
 886  930  } ACPI_MADT_LOCAL_X2APIC_NMI;
 887  931  
 888  932  
      933 +/* 11: Generic Interrupt (ACPI 5.0) */
      934 +
      935 +typedef struct acpi_madt_generic_interrupt
      936 +{
      937 +    ACPI_SUBTABLE_HEADER    Header;
      938 +    UINT16                  Reserved;           /* Reserved - must be zero */
      939 +    UINT32                  GicId;
      940 +    UINT32                  Uid;
      941 +    UINT32                  Flags;
      942 +    UINT32                  ParkingVersion;
      943 +    UINT32                  PerformanceInterrupt;
      944 +    UINT64                  ParkedAddress;
      945 +    UINT64                  BaseAddress;
      946 +
      947 +} ACPI_MADT_GENERIC_INTERRUPT;
      948 +
      949 +
      950 +/* 12: Generic Distributor (ACPI 5.0) */
      951 +
      952 +typedef struct acpi_madt_generic_distributor
      953 +{
      954 +    ACPI_SUBTABLE_HEADER    Header;
      955 +    UINT16                  Reserved;           /* Reserved - must be zero */
      956 +    UINT32                  GicId;
      957 +    UINT64                  BaseAddress;
      958 +    UINT32                  GlobalIrqBase;
      959 +    UINT32                  Reserved2;          /* Reserved - must be zero */
      960 +
      961 +} ACPI_MADT_GENERIC_DISTRIBUTOR;
      962 +
      963 +
 889  964  /*
 890  965   * Common flags fields for MADT subtables
 891  966   */
 892  967  
 893      -/* MADT Local APIC flags (LapicFlags) */
      968 +/* MADT Local APIC flags (LapicFlags) and GIC flags */
 894  969  
 895  970  #define ACPI_MADT_ENABLED           (1)         /* 00: Processor is usable if set */
 896  971  
 897  972  /* MADT MPS INTI flags (IntiFlags) */
 898  973  
 899  974  #define ACPI_MADT_POLARITY_MASK     (3)         /* 00-01: Polarity of APIC I/O input signals */
 900  975  #define ACPI_MADT_TRIGGER_MASK      (3<<2)      /* 02-03: Trigger mode of APIC input signals */
 901  976  
 902  977  /* Values for MPS INTI flags */
 903  978  
↓ open down ↓ 170 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX