2
0

buffer_fields.asl 908 B

1234567891011121314151617181920212223
  1. DefinitionBlock("buffer_fields.aml", "DSDT", 1, "RSACPI", "BUFFLD", 1) {
  2. Name(X, Buffer (16) { 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff })
  3. CreateBitField(X, 3, BIT3)
  4. CreateField(X, 0, 3, BITS)
  5. CreateByteField(X, 1, BYTE)
  6. CreateWordField(X, 2, WORD)
  7. CreateDWordField(X, 4, DWRD)
  8. CreateQWordField(X, 8, QWRD)
  9. // `X` should end up as [0xff, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x00, 0x00]
  10. BIT3 = 1
  11. BITS = 7
  12. BYTE = 0x01
  13. WORD = 0x0302
  14. DWRD = 0x07060504
  15. // Last two bytes should be cleared because of zero-extension of this store
  16. // We do this as a buffer store a) to test them b) because `iasl` doesn't support 64-bit integer constants...
  17. QWRD = Buffer() { 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d }
  18. // `Y` should end up as `Integer(0x07060504)` (`Integer(117835012)` in decimal)
  19. Name(Y, 4)
  20. Y = DWRD
  21. }