aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/psopcode.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2013-01-11 07:08:51 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-11 07:08:51 -0500
commit42f8fb75c43cc67f06424f991009b3af674f93eb (patch)
tree01821d5eca5f97d474bee62e7f92fe481adb31b8 /drivers/acpi/acpica/psopcode.c
parent4f8429166818dd615891990040ce13373893ee9a (diff)
ACPICA: Source restructuring: split large files into 8 new files.
Created logical splits for eight new files. Improves modularity and configurability. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/psopcode.c')
-rw-r--r--drivers/acpi/acpica/psopcode.c172
1 files changed, 0 insertions, 172 deletions
diff --git a/drivers/acpi/acpica/psopcode.c b/drivers/acpi/acpica/psopcode.c
index 1793d934aa30..0fcee880d25c 100644
--- a/drivers/acpi/acpica/psopcode.c
+++ b/drivers/acpi/acpica/psopcode.c
@@ -43,16 +43,12 @@
43 43
44#include <acpi/acpi.h> 44#include <acpi/acpi.h>
45#include "accommon.h" 45#include "accommon.h"
46#include "acparser.h"
47#include "acopcode.h" 46#include "acopcode.h"
48#include "amlcode.h" 47#include "amlcode.h"
49 48
50#define _COMPONENT ACPI_PARSER 49#define _COMPONENT ACPI_PARSER
51ACPI_MODULE_NAME("psopcode") 50ACPI_MODULE_NAME("psopcode")
52 51
53static const u8 acpi_gbl_argument_count[] =
54 { 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 6 };
55
56/******************************************************************************* 52/*******************************************************************************
57 * 53 *
58 * NAME: acpi_gbl_aml_op_info 54 * NAME: acpi_gbl_aml_op_info
@@ -63,7 +59,6 @@ static const u8 acpi_gbl_argument_count[] =
63 * the operand type. 59 * the operand type.
64 * 60 *
65 ******************************************************************************/ 61 ******************************************************************************/
66
67/* 62/*
68 * Summary of opcode types/flags 63 * Summary of opcode types/flags
69 * 64 *
@@ -181,7 +176,6 @@ static const u8 acpi_gbl_argument_count[] =
181 AML_CREATE_QWORD_FIELD_OP 176 AML_CREATE_QWORD_FIELD_OP
182 177
183 ******************************************************************************/ 178 ******************************************************************************/
184
185/* 179/*
186 * Master Opcode information table. A summary of everything we know about each 180 * Master Opcode information table. A summary of everything we know about each
187 * opcode, all in one place. 181 * opcode, all in one place.
@@ -656,169 +650,3 @@ const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = {
656 650
657/*! [End] no source code translation !*/ 651/*! [End] no source code translation !*/
658}; 652};
659
660/*
661 * This table is directly indexed by the opcodes, and returns an
662 * index into the table above
663 */
664static const u8 acpi_gbl_short_op_index[256] = {
665/* 0 1 2 3 4 5 6 7 */
666/* 8 9 A B C D E F */
667/* 0x00 */ 0x00, 0x01, _UNK, _UNK, _UNK, _UNK, 0x02, _UNK,
668/* 0x08 */ 0x03, _UNK, 0x04, 0x05, 0x06, 0x07, 0x6E, _UNK,
669/* 0x10 */ 0x08, 0x09, 0x0a, 0x6F, 0x0b, _UNK, _UNK, _UNK,
670/* 0x18 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
671/* 0x20 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
672/* 0x28 */ _UNK, _UNK, _UNK, _UNK, _UNK, 0x63, _PFX, _PFX,
673/* 0x30 */ 0x67, 0x66, 0x68, 0x65, 0x69, 0x64, 0x6A, 0x7D,
674/* 0x38 */ 0x7F, 0x80, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
675/* 0x40 */ _UNK, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC,
676/* 0x48 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC,
677/* 0x50 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC,
678/* 0x58 */ _ASC, _ASC, _ASC, _UNK, _PFX, _UNK, _PFX, _ASC,
679/* 0x60 */ 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13,
680/* 0x68 */ 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, _UNK,
681/* 0x70 */ 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22,
682/* 0x78 */ 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a,
683/* 0x80 */ 0x2b, 0x2c, 0x2d, 0x2e, 0x70, 0x71, 0x2f, 0x30,
684/* 0x88 */ 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x72,
685/* 0x90 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x73, 0x74,
686/* 0x98 */ 0x75, 0x76, _UNK, _UNK, 0x77, 0x78, 0x79, 0x7A,
687/* 0xA0 */ 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x60, 0x61,
688/* 0xA8 */ 0x62, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
689/* 0xB0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
690/* 0xB8 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
691/* 0xC0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
692/* 0xC8 */ _UNK, _UNK, _UNK, _UNK, 0x44, _UNK, _UNK, _UNK,
693/* 0xD0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
694/* 0xD8 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
695/* 0xE0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
696/* 0xE8 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
697/* 0xF0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
698/* 0xF8 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, 0x45,
699};
700
701/*
702 * This table is indexed by the second opcode of the extended opcode
703 * pair. It returns an index into the opcode table (acpi_gbl_aml_op_info)
704 */
705static const u8 acpi_gbl_long_op_index[NUM_EXTENDED_OPCODE] = {
706/* 0 1 2 3 4 5 6 7 */
707/* 8 9 A B C D E F */
708/* 0x00 */ _UNK, 0x46, 0x47, _UNK, _UNK, _UNK, _UNK, _UNK,
709/* 0x08 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
710/* 0x10 */ _UNK, _UNK, 0x48, 0x49, _UNK, _UNK, _UNK, _UNK,
711/* 0x18 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, 0x7B,
712/* 0x20 */ 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51,
713/* 0x28 */ 0x52, 0x53, 0x54, _UNK, _UNK, _UNK, _UNK, _UNK,
714/* 0x30 */ 0x55, 0x56, 0x57, 0x7e, _UNK, _UNK, _UNK, _UNK,
715/* 0x38 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
716/* 0x40 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
717/* 0x48 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
718/* 0x50 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
719/* 0x58 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
720/* 0x60 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
721/* 0x68 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
722/* 0x70 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
723/* 0x78 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
724/* 0x80 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
725/* 0x88 */ 0x7C,
726};
727
728/*******************************************************************************
729 *
730 * FUNCTION: acpi_ps_get_opcode_info
731 *
732 * PARAMETERS: opcode - The AML opcode
733 *
734 * RETURN: A pointer to the info about the opcode.
735 *
736 * DESCRIPTION: Find AML opcode description based on the opcode.
737 * NOTE: This procedure must ALWAYS return a valid pointer!
738 *
739 ******************************************************************************/
740
741const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode)
742{
743 ACPI_FUNCTION_NAME(ps_get_opcode_info);
744
745 /*
746 * Detect normal 8-bit opcode or extended 16-bit opcode
747 */
748 if (!(opcode & 0xFF00)) {
749
750 /* Simple (8-bit) opcode: 0-255, can't index beyond table */
751
752 return (&acpi_gbl_aml_op_info
753 [acpi_gbl_short_op_index[(u8) opcode]]);
754 }
755
756 if (((opcode & 0xFF00) == AML_EXTENDED_OPCODE) &&
757 (((u8) opcode) <= MAX_EXTENDED_OPCODE)) {
758
759 /* Valid extended (16-bit) opcode */
760
761 return (&acpi_gbl_aml_op_info
762 [acpi_gbl_long_op_index[(u8) opcode]]);
763 }
764
765 /* Unknown AML opcode */
766
767 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
768 "Unknown AML opcode [%4.4X]\n", opcode));
769
770 return (&acpi_gbl_aml_op_info[_UNK]);
771}
772
773/*******************************************************************************
774 *
775 * FUNCTION: acpi_ps_get_opcode_name
776 *
777 * PARAMETERS: opcode - The AML opcode
778 *
779 * RETURN: A pointer to the name of the opcode (ASCII String)
780 * Note: Never returns NULL.
781 *
782 * DESCRIPTION: Translate an opcode into a human-readable string
783 *
784 ******************************************************************************/
785
786char *acpi_ps_get_opcode_name(u16 opcode)
787{
788#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUG_OUTPUT)
789
790 const struct acpi_opcode_info *op;
791
792 op = acpi_ps_get_opcode_info(opcode);
793
794 /* Always guaranteed to return a valid pointer */
795
796 return (op->name);
797
798#else
799 return ("OpcodeName unavailable");
800
801#endif
802}
803
804/*******************************************************************************
805 *
806 * FUNCTION: acpi_ps_get_argument_count
807 *
808 * PARAMETERS: op_type - Type associated with the AML opcode
809 *
810 * RETURN: Argument count
811 *
812 * DESCRIPTION: Obtain the number of expected arguments for an AML opcode
813 *
814 ******************************************************************************/
815
816u8 acpi_ps_get_argument_count(u32 op_type)
817{
818
819 if (op_type <= AML_TYPE_EXEC_6A_0T_1R) {
820 return (acpi_gbl_argument_count[op_type]);
821 }
822
823 return (0);
824}