aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities/utmisc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/utilities/utmisc.c')
-rw-r--r--drivers/acpi/utilities/utmisc.c148
1 files changed, 0 insertions, 148 deletions
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c
index e9058d4da122..2a9110c06391 100644
--- a/drivers/acpi/utilities/utmisc.c
+++ b/drivers/acpi/utilities/utmisc.c
@@ -43,7 +43,6 @@
43 43
44#include <acpi/acpi.h> 44#include <acpi/acpi.h>
45#include <acpi/acnamesp.h> 45#include <acpi/acnamesp.h>
46#include <acpi/amlresrc.h>
47 46
48#define _COMPONENT ACPI_UTILITIES 47#define _COMPONENT ACPI_UTILITIES
49ACPI_MODULE_NAME("utmisc") 48ACPI_MODULE_NAME("utmisc")
@@ -791,153 +790,6 @@ u8 acpi_ut_generate_checksum(u8 * buffer, u32 length)
791 790
792/******************************************************************************* 791/*******************************************************************************
793 * 792 *
794 * FUNCTION: acpi_ut_get_resource_type
795 *
796 * PARAMETERS: Aml - Pointer to the raw AML resource descriptor
797 *
798 * RETURN: The Resource Type with no extraneous bits (except the
799 * Large/Small descriptor bit -- this is left alone)
800 *
801 * DESCRIPTION: Extract the Resource Type/Name from the first byte of
802 * a resource descriptor.
803 *
804 ******************************************************************************/
805
806u8 acpi_ut_get_resource_type(void *aml)
807{
808 ACPI_FUNCTION_ENTRY();
809
810 /*
811 * Byte 0 contains the descriptor name (Resource Type)
812 * Determine if this is a small or large resource
813 */
814 if (*((u8 *) aml) & ACPI_RESOURCE_NAME_LARGE) {
815 /* Large Resource Type -- bits 6:0 contain the name */
816
817 return (*((u8 *) aml));
818 } else {
819 /* Small Resource Type -- bits 6:3 contain the name */
820
821 return ((u8) (*((u8 *) aml) & ACPI_RESOURCE_NAME_SMALL_MASK));
822 }
823}
824
825/*******************************************************************************
826 *
827 * FUNCTION: acpi_ut_get_resource_length
828 *
829 * PARAMETERS: Aml - Pointer to the raw AML resource descriptor
830 *
831 * RETURN: Byte Length
832 *
833 * DESCRIPTION: Get the "Resource Length" of a raw AML descriptor. By
834 * definition, this does not include the size of the descriptor
835 * header or the length field itself.
836 *
837 ******************************************************************************/
838
839u16 acpi_ut_get_resource_length(void *aml)
840{
841 u16 resource_length;
842
843 ACPI_FUNCTION_ENTRY();
844
845 /*
846 * Byte 0 contains the descriptor name (Resource Type)
847 * Determine if this is a small or large resource
848 */
849 if (*((u8 *) aml) & ACPI_RESOURCE_NAME_LARGE) {
850 /* Large Resource type -- bytes 1-2 contain the 16-bit length */
851
852 ACPI_MOVE_16_TO_16(&resource_length, &((u8 *) aml)[1]);
853
854 } else {
855 /* Small Resource type -- bits 2:0 of byte 0 contain the length */
856
857 resource_length = (u16) (*((u8 *) aml) &
858 ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK);
859 }
860
861 return (resource_length);
862}
863
864/*******************************************************************************
865 *
866 * FUNCTION: acpi_ut_get_descriptor_length
867 *
868 * PARAMETERS: Aml - Pointer to the raw AML resource descriptor
869 *
870 * RETURN: Byte length
871 *
872 * DESCRIPTION: Get the total byte length of a raw AML descriptor, including the
873 * length of the descriptor header and the length field itself.
874 * Used to walk descriptor lists.
875 *
876 ******************************************************************************/
877
878u32 acpi_ut_get_descriptor_length(void *aml)
879{
880 u32 descriptor_length;
881
882 ACPI_FUNCTION_ENTRY();
883
884 /* First get the Resource Length (Does not include header length) */
885
886 descriptor_length = acpi_ut_get_resource_length(aml);
887
888 /* Determine if this is a small or large resource */
889
890 if (*((u8 *) aml) & ACPI_RESOURCE_NAME_LARGE) {
891 descriptor_length += sizeof(struct aml_resource_large_header);
892 } else {
893 descriptor_length += sizeof(struct aml_resource_small_header);
894 }
895
896 return (descriptor_length);
897}
898
899/*******************************************************************************
900 *
901 * FUNCTION: acpi_ut_get_resource_end_tag
902 *
903 * PARAMETERS: obj_desc - The resource template buffer object
904 *
905 * RETURN: Pointer to the end tag
906 *
907 * DESCRIPTION: Find the END_TAG resource descriptor in an AML resource template
908 *
909 ******************************************************************************/
910
911u8 *acpi_ut_get_resource_end_tag(union acpi_operand_object * obj_desc)
912{
913 u8 *aml;
914 u8 *end_aml;
915
916 aml = obj_desc->buffer.pointer;
917 end_aml = aml + obj_desc->buffer.length;
918
919 /* Walk the resource template, one descriptor per loop */
920
921 while (aml < end_aml) {
922 if (acpi_ut_get_resource_type(aml) ==
923 ACPI_RESOURCE_NAME_END_TAG) {
924 /* Found the end_tag descriptor, all done */
925
926 return (aml);
927 }
928
929 /* Point to the next resource descriptor */
930
931 aml += acpi_ut_get_resource_length(aml);
932 }
933
934 /* End tag was not found */
935
936 return (NULL);
937}
938
939/*******************************************************************************
940 *
941 * FUNCTION: acpi_ut_report_error 793 * FUNCTION: acpi_ut_report_error
942 * 794 *
943 * PARAMETERS: module_name - Caller's module name (for error output) 795 * PARAMETERS: module_name - Caller's module name (for error output)