1677{
1683 void *resource_end;
1685 uacpi_u32 base_aml_size_with_header, accumulator = 0;
1686
1688
1694
1695 base_aml_size = base_aml_size_with_header = spec->
aml_size;
1696 base_aml_size_with_header += header_size;
1697
1700
1701 for (;;) {
1702 insn = &insns[pc++];
1703
1706
1707 switch (insn->
code) {
1712
1714 max_bit = 16;
1716 } else {
1717 max_bit = 8;
1720 );
1721 }
1722
1723 for (
i = 0,
j = 0;
i < max_bit; ++
i) {
1725 continue;
1726
1728 }
1729
1731 break;
1732 }
1733
1739
1742
1745 break;
1746 }
1747
1749 accumulator = aml_size;
1751 break;
1752
1758 union {
1762 } dst_name = { .ptr =
dst };
1763
1764
1765
1766
1767
1772 } else {
1773 max_offset = aml_size + header_size;
1774 }
1775
1776 offset += base_aml_size_with_header;
1778
1781
1782 if (
offset >= max_offset) {
1785 break;
1786 }
1787
1789
1791 uacpi_memcpy(&dst_name.source->index, src_string++, 1);
1793 }
1794
1795 if (
offset == max_offset)
1796 break;
1797
1798 while (
offset++ < max_offset) {
1799 if (src_string[
length++] ==
'\0')
1800 break;
1801 }
1802
1803 if (src_string[
length - 1] !=
'\0') {
1804 uacpi_error(
"non-null-terminated resource source string\n");
1807 }
1808
1809 dst_string =
PTR_AT(resource_end, accumulator);
1811
1813 dst_name.label->length =
length;
1814 dst_name.label->string = dst_string;
1815 } else {
1816 dst_name.source->length =
length;
1817 dst_name.source->string = dst_string;
1818 }
1819
1820 break;
1821 }
1822
1825 sizeof(accumulator),
sizeof(
uacpi_u16));
1827
1828 accumulator -= base_aml_size_with_header;
1829 break;
1830
1832 uacpi_u16 entry_count = accumulator / 2;
1833
1834
1835
1836
1837
1839 resource_end,
1840 data + base_aml_size_with_header,
1841 accumulator
1842 );
1843
1844
1846
1847
1849 &resource_end, sizeof(void*));
1850 break;
1851 }
1852
1856 void *native_dst, *vendor_data;
1857
1860
1861 vendor_data =
data + data_offset;
1862
1863
1864
1865
1866
1867 data_offset -= header_size;
1868
1869 length = aml_size - data_offset;
1871 break;
1872
1874
1875 offset_from_end = data_offset - base_aml_size;
1876 native_dst =
PTR_AT(resource_end, offset_from_end);
1877
1880 &native_dst, sizeof(void*));
1881 break;
1882 }
1883
1886 uacpi_u8 serial_type, extra_size, type_length;
1887
1888 serial_bus_common = &
resource->serial_bus_common;
1890 serial_bus_common->
type = serial_type;
1892
1893
1894
1895
1896
1898 resource_end,
1900 );
1902 base_aml_size += extra_size;
1903 base_aml_size_with_header += extra_size;
1904
1908 "invalid type-specific data length: %d, "
1909 "expected at least %d\n", type_length, extra_size
1910 );
1913 }
1914
1915
1916
1917
1918
1919 accumulator = type_length - extra_size;
1920 if (accumulator == 0)
1921 break;
1922
1926 resource_end,
1927 data + base_aml_size_with_header,
1928 accumulator
1929 );
1930 break;
1931 }
1932
1934 }
1935 }
1936}
@ UACPI_RESOURCE_CONVERT_OPCODE_PACKED_ARRAY_8
@ UACPI_RESOURCE_CONVERT_OPCODE_BIT_FIELD_2
@ UACPI_RESOURCE_CONVERT_OPCODE_PIN_TABLE
@ UACPI_RESOURCE_CONVERT_OPCODE_PACKED_ARRAY_16
@ UACPI_RESOURCE_CONVERT_OPCODE_BIT_FIELD_1
@ UACPI_RESOURCE_CONVERT_OPCODE_BIT_FIELD_3
@ UACPI_RESOURCE_CONVERT_OPCODE_BIT_FIELD_6
@ UACPI_RESOURCE_CONVERT_OPCODE_LOAD_AML_SIZE_32
@ UACPI_RESOURCE_CONVERT_OPCODE_RESOURCE_LABEL
@ UACPI_RESOURCE_CONVERT_OPCODE_RESOURCE_SOURCE_NO_INDEX
@ UACPI_RESOURCE_CONVERT_OPCODE_LOAD_PIN_TABLE_LENGTH
@ UACPI_RESOURCE_CONVERT_OPCODE_SERIAL_TYPE_SPECIFIC
@ UACPI_RESOURCE_CONVERT_OPCODE_RESOURCE_SOURCE
@ UACPI_RESOURCE_CONVERT_OPCODE_VENDOR_DATA
void uacpi_memcpy_zerout(void *dst, const void *src, uacpi_size dst_size, uacpi_size src_size)
static uacpi_resource_type aml_serial_to_native_type(uacpi_u8 type)
static const uacpi_u8 aml_serial_resource_to_extra_native_size[ACPI_SERIAL_TYPE_MAX+1]
#define PTR_AT(ptr, offset)
#define NATIVE_OFFSET(res, offset)
#define CHECK_AML_OFFSET(offset, what)
#define CONVERSION_OPCODES_COMMON(native_buf)
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
uacpi_u16 type_data_length
const struct uacpi_resource_convert_instruction * to_native