···10961096#define ACPI_EXT_ORIGIN_FROM_FILE 0x02 /* External came from a file */10971097#define ACPI_EXT_INTERNAL_PATH_ALLOCATED 0x04 /* Deallocate internal path on completion */10981098#define ACPI_EXT_EXTERNAL_EMITTED 0x08 /* External() statement has been emitted */10991099+#define ACPI_EXT_ORIGIN_FROM_OPCODE 0x10 /* External came from a External() opcode */1099110011001101struct acpi_external_file {11011102 char *path;
···5656void acpi_db_dump_buffer(u32 address);5757#endif58585959-static char *gbl_hex_to_ascii = "0123456789ABCDEF";6060-6159/*******************************************************************************6260 *6361 * FUNCTION: acpi_db_match_argument···8082 }81838284 for (i = 0; arguments[i].name; i++) {8383- if (strstr(arguments[i].name, user_argument) ==8484- arguments[i].name) {8585+ if (strstr(ACPI_CAST_PTR(char, arguments[i].name),8686+ ACPI_CAST_PTR(char,8787+ user_argument)) == arguments[i].name) {8588 return (i);8689 }8790 }···338339 buffer[8] = '\0';339340340341 for (i = 7; i >= 0; i--) {341341- buffer[i] = gbl_hex_to_ascii[value & 0x0F];342342+ buffer[i] = acpi_gbl_upper_hex_digits[value & 0x0F];342343 value = value >> 4;343344 }344345}
+27-49
drivers/acpi/acpica/evregion.c
···526526527527/*******************************************************************************528528 *529529- * FUNCTION: acpi_ev_associate_reg_method530530- *531531- * PARAMETERS: region_obj - Region object532532- *533533- * RETURN: Status534534- *535535- * DESCRIPTION: Find and associate _REG method to a region536536- *537537- ******************************************************************************/538538-539539-void acpi_ev_associate_reg_method(union acpi_operand_object *region_obj)540540-{541541- acpi_name *reg_name_ptr = (acpi_name *) METHOD_NAME__REG;542542- struct acpi_namespace_node *method_node;543543- struct acpi_namespace_node *node;544544- union acpi_operand_object *region_obj2;545545- acpi_status status;546546-547547- ACPI_FUNCTION_TRACE(ev_associate_reg_method);548548-549549- region_obj2 = acpi_ns_get_secondary_object(region_obj);550550- if (!region_obj2) {551551- return_VOID;552552- }553553-554554- node = region_obj->region.node->parent;555555-556556- /* Find any "_REG" method associated with this region definition */557557-558558- status =559559- acpi_ns_search_one_scope(*reg_name_ptr, node, ACPI_TYPE_METHOD,560560- &method_node);561561- if (ACPI_SUCCESS(status)) {562562- /*563563- * The _REG method is optional and there can be only one per region564564- * definition. This will be executed when the handler is attached565565- * or removed566566- */567567- region_obj2->extra.method_REG = method_node;568568- }569569-570570- return_VOID;571571-}572572-573573-/*******************************************************************************574574- *575529 * FUNCTION: acpi_ev_execute_reg_method576530 *577531 * PARAMETERS: region_obj - Region object···543589 struct acpi_evaluate_info *info;544590 union acpi_operand_object *args[3];545591 union acpi_operand_object *region_obj2;592592+ const acpi_name *reg_name_ptr =593593+ ACPI_CAST_PTR(acpi_name, METHOD_NAME__REG);594594+ struct acpi_namespace_node *method_node;595595+ struct acpi_namespace_node *node;546596 acpi_status status;547597548598 ACPI_FUNCTION_TRACE(ev_execute_reg_method);599599+600600+ if (!acpi_gbl_namespace_initialized ||601601+ region_obj->region.handler == NULL) {602602+ return_ACPI_STATUS(AE_OK);603603+ }549604550605 region_obj2 = acpi_ns_get_secondary_object(region_obj);551606 if (!region_obj2) {552607 return_ACPI_STATUS(AE_NOT_EXIST);553608 }554609555555- if (region_obj2->extra.method_REG == NULL ||556556- region_obj->region.handler == NULL ||557557- !acpi_gbl_namespace_initialized) {610610+ /*611611+ * Find any "_REG" method associated with this region definition.612612+ * The method should always be updated as this function may be613613+ * invoked after a namespace change.614614+ */615615+ node = region_obj->region.node->parent;616616+ status =617617+ acpi_ns_search_one_scope(*reg_name_ptr, node, ACPI_TYPE_METHOD,618618+ &method_node);619619+ if (ACPI_SUCCESS(status)) {620620+ /*621621+ * The _REG method is optional and there can be only one per622622+ * region definition. This will be executed when the handler is623623+ * attached or removed.624624+ */625625+ region_obj2->extra.method_REG = method_node;626626+ }627627+ if (region_obj2->extra.method_REG == NULL) {558628 return_ACPI_STATUS(AE_OK);559629 }560630
···11+/******************************************************************************22+ *33+ * Module Name: exconcat - Concatenate-type AML operators44+ *55+ *****************************************************************************/66+77+/*88+ * Copyright (C) 2000 - 2016, Intel Corp.99+ * All rights reserved.1010+ *1111+ * Redistribution and use in source and binary forms, with or without1212+ * modification, are permitted provided that the following conditions1313+ * are met:1414+ * 1. Redistributions of source code must retain the above copyright1515+ * notice, this list of conditions, and the following disclaimer,1616+ * without modification.1717+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer1818+ * substantially similar to the "NO WARRANTY" disclaimer below1919+ * ("Disclaimer") and any redistribution must be conditioned upon2020+ * including a substantially similar Disclaimer requirement for further2121+ * binary redistribution.2222+ * 3. Neither the names of the above-listed copyright holders nor the names2323+ * of any contributors may be used to endorse or promote products derived2424+ * from this software without specific prior written permission.2525+ *2626+ * Alternatively, this software may be distributed under the terms of the2727+ * GNU General Public License ("GPL") version 2 as published by the Free2828+ * Software Foundation.2929+ *3030+ * NO WARRANTY3131+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS3232+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT3333+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR3434+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT3535+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL3636+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS3737+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)3838+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,3939+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING4040+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE4141+ * POSSIBILITY OF SUCH DAMAGES.4242+ */4343+4444+#include <acpi/acpi.h>4545+#include "accommon.h"4646+#include "acinterp.h"4747+#include "amlresrc.h"4848+4949+#define _COMPONENT ACPI_EXECUTER5050+ACPI_MODULE_NAME("exconcat")5151+5252+/* Local Prototypes */5353+static acpi_status5454+acpi_ex_convert_to_object_type_string(union acpi_operand_object *obj_desc,5555+ union acpi_operand_object **result_desc);5656+5757+/*******************************************************************************5858+ *5959+ * FUNCTION: acpi_ex_do_concatenate6060+ *6161+ * PARAMETERS: operand0 - First source object6262+ * operand1 - Second source object6363+ * actual_return_desc - Where to place the return object6464+ * walk_state - Current walk state6565+ *6666+ * RETURN: Status6767+ *6868+ * DESCRIPTION: Concatenate two objects with the ACPI-defined conversion6969+ * rules as necessary.7070+ * NOTE:7171+ * Per the ACPI spec (up to 6.1), Concatenate only supports Integer,7272+ * String, and Buffer objects. However, we support all objects here7373+ * as an extension. This improves the usefulness of both Concatenate7474+ * and the Printf/Fprintf macros. The extension returns a string7575+ * describing the object type for the other objects.7676+ * 02/2016.7777+ *7878+ ******************************************************************************/7979+8080+acpi_status8181+acpi_ex_do_concatenate(union acpi_operand_object *operand0,8282+ union acpi_operand_object *operand1,8383+ union acpi_operand_object **actual_return_desc,8484+ struct acpi_walk_state *walk_state)8585+{8686+ union acpi_operand_object *local_operand0 = operand0;8787+ union acpi_operand_object *local_operand1 = operand1;8888+ union acpi_operand_object *temp_operand1 = NULL;8989+ union acpi_operand_object *return_desc;9090+ char *buffer;9191+ acpi_object_type operand0_type;9292+ acpi_object_type operand1_type;9393+ acpi_status status;9494+9595+ ACPI_FUNCTION_TRACE(ex_do_concatenate);9696+9797+ /* Operand 0 preprocessing */9898+9999+ switch (operand0->common.type) {100100+ case ACPI_TYPE_INTEGER:101101+ case ACPI_TYPE_STRING:102102+ case ACPI_TYPE_BUFFER:103103+104104+ operand0_type = operand0->common.type;105105+ break;106106+107107+ default:108108+109109+ /* For all other types, get the "object type" string */110110+111111+ status =112112+ acpi_ex_convert_to_object_type_string(operand0,113113+ &local_operand0);114114+ if (ACPI_FAILURE(status)) {115115+ goto cleanup;116116+ }117117+118118+ operand0_type = ACPI_TYPE_STRING;119119+ break;120120+ }121121+122122+ /* Operand 1 preprocessing */123123+124124+ switch (operand1->common.type) {125125+ case ACPI_TYPE_INTEGER:126126+ case ACPI_TYPE_STRING:127127+ case ACPI_TYPE_BUFFER:128128+129129+ operand1_type = operand1->common.type;130130+ break;131131+132132+ default:133133+134134+ /* For all other types, get the "object type" string */135135+136136+ status =137137+ acpi_ex_convert_to_object_type_string(operand1,138138+ &local_operand1);139139+ if (ACPI_FAILURE(status)) {140140+ goto cleanup;141141+ }142142+143143+ operand1_type = ACPI_TYPE_STRING;144144+ break;145145+ }146146+147147+ /*148148+ * Convert the second operand if necessary. The first operand (0)149149+ * determines the type of the second operand (1) (See the Data Types150150+ * section of the ACPI specification). Both object types are151151+ * guaranteed to be either Integer/String/Buffer by the operand152152+ * resolution mechanism.153153+ */154154+ switch (operand0_type) {155155+ case ACPI_TYPE_INTEGER:156156+157157+ status =158158+ acpi_ex_convert_to_integer(local_operand1, &temp_operand1,159159+ 16);160160+ break;161161+162162+ case ACPI_TYPE_BUFFER:163163+164164+ status =165165+ acpi_ex_convert_to_buffer(local_operand1, &temp_operand1);166166+ break;167167+168168+ case ACPI_TYPE_STRING:169169+170170+ switch (operand1_type) {171171+ case ACPI_TYPE_INTEGER:172172+ case ACPI_TYPE_STRING:173173+ case ACPI_TYPE_BUFFER:174174+175175+ /* Other types have already been converted to string */176176+177177+ status =178178+ acpi_ex_convert_to_string(local_operand1,179179+ &temp_operand1,180180+ ACPI_IMPLICIT_CONVERT_HEX);181181+ break;182182+183183+ default:184184+185185+ status = AE_OK;186186+ break;187187+ }188188+ break;189189+190190+ default:191191+192192+ ACPI_ERROR((AE_INFO, "Invalid object type: 0x%X",193193+ operand0->common.type));194194+ status = AE_AML_INTERNAL;195195+ }196196+197197+ if (ACPI_FAILURE(status)) {198198+ goto cleanup;199199+ }200200+201201+ /* Take care with any newly created operand objects */202202+203203+ if ((local_operand1 != operand1) && (local_operand1 != temp_operand1)) {204204+ acpi_ut_remove_reference(local_operand1);205205+ }206206+207207+ local_operand1 = temp_operand1;208208+209209+ /*210210+ * Both operands are now known to be the same object type211211+ * (Both are Integer, String, or Buffer), and we can now perform212212+ * the concatenation.213213+ *214214+ * There are three cases to handle, as per the ACPI spec:215215+ *216216+ * 1) Two Integers concatenated to produce a new Buffer217217+ * 2) Two Strings concatenated to produce a new String218218+ * 3) Two Buffers concatenated to produce a new Buffer219219+ */220220+ switch (operand0_type) {221221+ case ACPI_TYPE_INTEGER:222222+223223+ /* Result of two Integers is a Buffer */224224+ /* Need enough buffer space for two integers */225225+226226+ return_desc = acpi_ut_create_buffer_object((acpi_size)227227+ ACPI_MUL_2228228+ (acpi_gbl_integer_byte_width));229229+ if (!return_desc) {230230+ status = AE_NO_MEMORY;231231+ goto cleanup;232232+ }233233+234234+ buffer = (char *)return_desc->buffer.pointer;235235+236236+ /* Copy the first integer, LSB first */237237+238238+ memcpy(buffer, &operand0->integer.value,239239+ acpi_gbl_integer_byte_width);240240+241241+ /* Copy the second integer (LSB first) after the first */242242+243243+ memcpy(buffer + acpi_gbl_integer_byte_width,244244+ &local_operand1->integer.value,245245+ acpi_gbl_integer_byte_width);246246+ break;247247+248248+ case ACPI_TYPE_STRING:249249+250250+ /* Result of two Strings is a String */251251+252252+ return_desc = acpi_ut_create_string_object(((acpi_size)253253+ local_operand0->254254+ string.length +255255+ local_operand1->256256+ string.length));257257+ if (!return_desc) {258258+ status = AE_NO_MEMORY;259259+ goto cleanup;260260+ }261261+262262+ buffer = return_desc->string.pointer;263263+264264+ /* Concatenate the strings */265265+266266+ strcpy(buffer, local_operand0->string.pointer);267267+ strcat(buffer, local_operand1->string.pointer);268268+ break;269269+270270+ case ACPI_TYPE_BUFFER:271271+272272+ /* Result of two Buffers is a Buffer */273273+274274+ return_desc = acpi_ut_create_buffer_object(((acpi_size)275275+ operand0->buffer.276276+ length +277277+ local_operand1->278278+ buffer.length));279279+ if (!return_desc) {280280+ status = AE_NO_MEMORY;281281+ goto cleanup;282282+ }283283+284284+ buffer = (char *)return_desc->buffer.pointer;285285+286286+ /* Concatenate the buffers */287287+288288+ memcpy(buffer, operand0->buffer.pointer,289289+ operand0->buffer.length);290290+ memcpy(buffer + operand0->buffer.length,291291+ local_operand1->buffer.pointer,292292+ local_operand1->buffer.length);293293+ break;294294+295295+ default:296296+297297+ /* Invalid object type, should not happen here */298298+299299+ ACPI_ERROR((AE_INFO, "Invalid object type: 0x%X",300300+ operand0->common.type));301301+ status = AE_AML_INTERNAL;302302+ goto cleanup;303303+ }304304+305305+ *actual_return_desc = return_desc;306306+307307+cleanup:308308+ if (local_operand0 != operand0) {309309+ acpi_ut_remove_reference(local_operand0);310310+ }311311+312312+ if (local_operand1 != operand1) {313313+ acpi_ut_remove_reference(local_operand1);314314+ }315315+316316+ return_ACPI_STATUS(status);317317+}318318+319319+/*******************************************************************************320320+ *321321+ * FUNCTION: acpi_ex_convert_to_object_type_string322322+ *323323+ * PARAMETERS: obj_desc - Object to be converted324324+ * return_desc - Where to place the return object325325+ *326326+ * RETURN: Status327327+ *328328+ * DESCRIPTION: Convert an object of arbitrary type to a string object that329329+ * contains the namestring for the object. Used for the330330+ * concatenate operator.331331+ *332332+ ******************************************************************************/333333+334334+static acpi_status335335+acpi_ex_convert_to_object_type_string(union acpi_operand_object *obj_desc,336336+ union acpi_operand_object **result_desc)337337+{338338+ union acpi_operand_object *return_desc;339339+ const char *type_string;340340+341341+ type_string = acpi_ut_get_type_name(obj_desc->common.type);342342+343343+ return_desc = acpi_ut_create_string_object(((acpi_size) strlen(type_string) + 9)); /* 9 For "[ Object]" */344344+ if (!return_desc) {345345+ return (AE_NO_MEMORY);346346+ }347347+348348+ strcpy(return_desc->string.pointer, "[");349349+ strcat(return_desc->string.pointer, type_string);350350+ strcat(return_desc->string.pointer, " Object]");351351+352352+ *result_desc = return_desc;353353+ return (AE_OK);354354+}355355+356356+/*******************************************************************************357357+ *358358+ * FUNCTION: acpi_ex_concat_template359359+ *360360+ * PARAMETERS: operand0 - First source object361361+ * operand1 - Second source object362362+ * actual_return_desc - Where to place the return object363363+ * walk_state - Current walk state364364+ *365365+ * RETURN: Status366366+ *367367+ * DESCRIPTION: Concatenate two resource templates368368+ *369369+ ******************************************************************************/370370+371371+acpi_status372372+acpi_ex_concat_template(union acpi_operand_object *operand0,373373+ union acpi_operand_object *operand1,374374+ union acpi_operand_object **actual_return_desc,375375+ struct acpi_walk_state * walk_state)376376+{377377+ acpi_status status;378378+ union acpi_operand_object *return_desc;379379+ u8 *new_buf;380380+ u8 *end_tag;381381+ acpi_size length0;382382+ acpi_size length1;383383+ acpi_size new_length;384384+385385+ ACPI_FUNCTION_TRACE(ex_concat_template);386386+387387+ /*388388+ * Find the end_tag descriptor in each resource template.389389+ * Note1: returned pointers point TO the end_tag, not past it.390390+ * Note2: zero-length buffers are allowed; treated like one end_tag391391+ */392392+393393+ /* Get the length of the first resource template */394394+395395+ status = acpi_ut_get_resource_end_tag(operand0, &end_tag);396396+ if (ACPI_FAILURE(status)) {397397+ return_ACPI_STATUS(status);398398+ }399399+400400+ length0 = ACPI_PTR_DIFF(end_tag, operand0->buffer.pointer);401401+402402+ /* Get the length of the second resource template */403403+404404+ status = acpi_ut_get_resource_end_tag(operand1, &end_tag);405405+ if (ACPI_FAILURE(status)) {406406+ return_ACPI_STATUS(status);407407+ }408408+409409+ length1 = ACPI_PTR_DIFF(end_tag, operand1->buffer.pointer);410410+411411+ /* Combine both lengths, minimum size will be 2 for end_tag */412412+413413+ new_length = length0 + length1 + sizeof(struct aml_resource_end_tag);414414+415415+ /* Create a new buffer object for the result (with one end_tag) */416416+417417+ return_desc = acpi_ut_create_buffer_object(new_length);418418+ if (!return_desc) {419419+ return_ACPI_STATUS(AE_NO_MEMORY);420420+ }421421+422422+ /*423423+ * Copy the templates to the new buffer, 0 first, then 1 follows. One424424+ * end_tag descriptor is copied from Operand1.425425+ */426426+ new_buf = return_desc->buffer.pointer;427427+ memcpy(new_buf, operand0->buffer.pointer, length0);428428+ memcpy(new_buf + length0, operand1->buffer.pointer, length1);429429+430430+ /* Insert end_tag and set the checksum to zero, means "ignore checksum" */431431+432432+ new_buf[new_length - 1] = 0;433433+ new_buf[new_length - 2] = ACPI_RESOURCE_NAME_END_TAG | 1;434434+435435+ /* Return the completed resource template */436436+437437+ *actual_return_desc = return_desc;438438+ return_ACPI_STATUS(AE_OK);439439+}
+3-1
drivers/acpi/acpica/exconfig.c
···118118 /* Execute any module-level code that was found in the table */119119120120 acpi_ex_exit_interpreter();121121- acpi_ns_exec_module_code_list();121121+ if (acpi_gbl_group_module_level_code) {122122+ acpi_ns_exec_module_code_list();123123+ }122124 acpi_ex_enter_interpreter();123125124126 /*
+3-1
drivers/acpi/acpica/exconvrt.c
···124124 * of ACPI 3.0) is that the to_integer() operator allows both decimal125125 * and hexadecimal strings (hex prefixed with "0x").126126 */127127- status = acpi_ut_strtoul64((char *)pointer, flags, &result);127127+ status = acpi_ut_strtoul64((char *)pointer, flags,128128+ acpi_gbl_integer_byte_width,129129+ &result);128130 if (ACPI_FAILURE(status)) {129131 return_ACPI_STATUS(status);130132 }
···4545#include "accommon.h"4646#include "acinterp.h"4747#include "amlcode.h"4848-#include "amlresrc.h"49485049#define _COMPONENT ACPI_EXECUTER5150ACPI_MODULE_NAME("exmisc")···135136 *return_desc));136137137138 return_ACPI_STATUS(AE_OK);138138-}139139-140140-/*******************************************************************************141141- *142142- * FUNCTION: acpi_ex_concat_template143143- *144144- * PARAMETERS: operand0 - First source object145145- * operand1 - Second source object146146- * actual_return_desc - Where to place the return object147147- * walk_state - Current walk state148148- *149149- * RETURN: Status150150- *151151- * DESCRIPTION: Concatenate two resource templates152152- *153153- ******************************************************************************/154154-155155-acpi_status156156-acpi_ex_concat_template(union acpi_operand_object *operand0,157157- union acpi_operand_object *operand1,158158- union acpi_operand_object **actual_return_desc,159159- struct acpi_walk_state *walk_state)160160-{161161- acpi_status status;162162- union acpi_operand_object *return_desc;163163- u8 *new_buf;164164- u8 *end_tag;165165- acpi_size length0;166166- acpi_size length1;167167- acpi_size new_length;168168-169169- ACPI_FUNCTION_TRACE(ex_concat_template);170170-171171- /*172172- * Find the end_tag descriptor in each resource template.173173- * Note1: returned pointers point TO the end_tag, not past it.174174- * Note2: zero-length buffers are allowed; treated like one end_tag175175- */176176-177177- /* Get the length of the first resource template */178178-179179- status = acpi_ut_get_resource_end_tag(operand0, &end_tag);180180- if (ACPI_FAILURE(status)) {181181- return_ACPI_STATUS(status);182182- }183183-184184- length0 = ACPI_PTR_DIFF(end_tag, operand0->buffer.pointer);185185-186186- /* Get the length of the second resource template */187187-188188- status = acpi_ut_get_resource_end_tag(operand1, &end_tag);189189- if (ACPI_FAILURE(status)) {190190- return_ACPI_STATUS(status);191191- }192192-193193- length1 = ACPI_PTR_DIFF(end_tag, operand1->buffer.pointer);194194-195195- /* Combine both lengths, minimum size will be 2 for end_tag */196196-197197- new_length = length0 + length1 + sizeof(struct aml_resource_end_tag);198198-199199- /* Create a new buffer object for the result (with one end_tag) */200200-201201- return_desc = acpi_ut_create_buffer_object(new_length);202202- if (!return_desc) {203203- return_ACPI_STATUS(AE_NO_MEMORY);204204- }205205-206206- /*207207- * Copy the templates to the new buffer, 0 first, then 1 follows. One208208- * end_tag descriptor is copied from Operand1.209209- */210210- new_buf = return_desc->buffer.pointer;211211- memcpy(new_buf, operand0->buffer.pointer, length0);212212- memcpy(new_buf + length0, operand1->buffer.pointer, length1);213213-214214- /* Insert end_tag and set the checksum to zero, means "ignore checksum" */215215-216216- new_buf[new_length - 1] = 0;217217- new_buf[new_length - 2] = ACPI_RESOURCE_NAME_END_TAG | 1;218218-219219- /* Return the completed resource template */220220-221221- *actual_return_desc = return_desc;222222- return_ACPI_STATUS(AE_OK);223223-}224224-225225-/*******************************************************************************226226- *227227- * FUNCTION: acpi_ex_do_concatenate228228- *229229- * PARAMETERS: operand0 - First source object230230- * operand1 - Second source object231231- * actual_return_desc - Where to place the return object232232- * walk_state - Current walk state233233- *234234- * RETURN: Status235235- *236236- * DESCRIPTION: Concatenate two objects OF THE SAME TYPE.237237- *238238- ******************************************************************************/239239-240240-acpi_status241241-acpi_ex_do_concatenate(union acpi_operand_object *operand0,242242- union acpi_operand_object *operand1,243243- union acpi_operand_object **actual_return_desc,244244- struct acpi_walk_state *walk_state)245245-{246246- union acpi_operand_object *local_operand1 = operand1;247247- union acpi_operand_object *return_desc;248248- char *new_buf;249249- const char *type_string;250250- acpi_status status;251251-252252- ACPI_FUNCTION_TRACE(ex_do_concatenate);253253-254254- /*255255- * Convert the second operand if necessary. The first operand256256- * determines the type of the second operand, (See the Data Types257257- * section of the ACPI specification.) Both object types are258258- * guaranteed to be either Integer/String/Buffer by the operand259259- * resolution mechanism.260260- */261261- switch (operand0->common.type) {262262- case ACPI_TYPE_INTEGER:263263-264264- status =265265- acpi_ex_convert_to_integer(operand1, &local_operand1, 16);266266- break;267267-268268- case ACPI_TYPE_STRING:269269- /*270270- * Per the ACPI spec, Concatenate only supports int/str/buf.271271- * However, we support all objects here as an extension.272272- * This improves the usefulness of the Printf() macro.273273- * 12/2015.274274- */275275- switch (operand1->common.type) {276276- case ACPI_TYPE_INTEGER:277277- case ACPI_TYPE_STRING:278278- case ACPI_TYPE_BUFFER:279279-280280- status =281281- acpi_ex_convert_to_string(operand1, &local_operand1,282282- ACPI_IMPLICIT_CONVERT_HEX);283283- break;284284-285285- default:286286- /*287287- * Just emit a string containing the object type.288288- */289289- type_string =290290- acpi_ut_get_type_name(operand1->common.type);291291-292292- local_operand1 = acpi_ut_create_string_object(((acpi_size) strlen(type_string) + 9)); /* 9 For "[Object]" */293293- if (!local_operand1) {294294- status = AE_NO_MEMORY;295295- goto cleanup;296296- }297297-298298- strcpy(local_operand1->string.pointer, "[");299299- strcat(local_operand1->string.pointer, type_string);300300- strcat(local_operand1->string.pointer, " Object]");301301- status = AE_OK;302302- break;303303- }304304- break;305305-306306- case ACPI_TYPE_BUFFER:307307-308308- status = acpi_ex_convert_to_buffer(operand1, &local_operand1);309309- break;310310-311311- default:312312-313313- ACPI_ERROR((AE_INFO, "Invalid object type: 0x%X",314314- operand0->common.type));315315- status = AE_AML_INTERNAL;316316- }317317-318318- if (ACPI_FAILURE(status)) {319319- goto cleanup;320320- }321321-322322- /*323323- * Both operands are now known to be the same object type324324- * (Both are Integer, String, or Buffer), and we can now perform the325325- * concatenation.326326- */327327-328328- /*329329- * There are three cases to handle:330330- *331331- * 1) Two Integers concatenated to produce a new Buffer332332- * 2) Two Strings concatenated to produce a new String333333- * 3) Two Buffers concatenated to produce a new Buffer334334- */335335- switch (operand0->common.type) {336336- case ACPI_TYPE_INTEGER:337337-338338- /* Result of two Integers is a Buffer */339339- /* Need enough buffer space for two integers */340340-341341- return_desc = acpi_ut_create_buffer_object((acpi_size)342342- ACPI_MUL_2343343- (acpi_gbl_integer_byte_width));344344- if (!return_desc) {345345- status = AE_NO_MEMORY;346346- goto cleanup;347347- }348348-349349- new_buf = (char *)return_desc->buffer.pointer;350350-351351- /* Copy the first integer, LSB first */352352-353353- memcpy(new_buf, &operand0->integer.value,354354- acpi_gbl_integer_byte_width);355355-356356- /* Copy the second integer (LSB first) after the first */357357-358358- memcpy(new_buf + acpi_gbl_integer_byte_width,359359- &local_operand1->integer.value,360360- acpi_gbl_integer_byte_width);361361- break;362362-363363- case ACPI_TYPE_STRING:364364-365365- /* Result of two Strings is a String */366366-367367- return_desc = acpi_ut_create_string_object(((acpi_size)368368- operand0->string.369369- length +370370- local_operand1->371371- string.length));372372- if (!return_desc) {373373- status = AE_NO_MEMORY;374374- goto cleanup;375375- }376376-377377- new_buf = return_desc->string.pointer;378378-379379- /* Concatenate the strings */380380-381381- strcpy(new_buf, operand0->string.pointer);382382- strcat(new_buf, local_operand1->string.pointer);383383- break;384384-385385- case ACPI_TYPE_BUFFER:386386-387387- /* Result of two Buffers is a Buffer */388388-389389- return_desc = acpi_ut_create_buffer_object(((acpi_size)390390- operand0->buffer.391391- length +392392- local_operand1->393393- buffer.length));394394- if (!return_desc) {395395- status = AE_NO_MEMORY;396396- goto cleanup;397397- }398398-399399- new_buf = (char *)return_desc->buffer.pointer;400400-401401- /* Concatenate the buffers */402402-403403- memcpy(new_buf, operand0->buffer.pointer,404404- operand0->buffer.length);405405- memcpy(new_buf + operand0->buffer.length,406406- local_operand1->buffer.pointer,407407- local_operand1->buffer.length);408408- break;409409-410410- default:411411-412412- /* Invalid object type, should not happen here */413413-414414- ACPI_ERROR((AE_INFO, "Invalid object type: 0x%X",415415- operand0->common.type));416416- status = AE_AML_INTERNAL;417417- goto cleanup;418418- }419419-420420- *actual_return_desc = return_desc;421421-422422-cleanup:423423- if (local_operand1 != operand1) {424424- acpi_ut_remove_reference(local_operand1);425425- }426426- return_ACPI_STATUS(status);427139}428140429141/*******************************************************************************
+6-6
drivers/acpi/acpica/exutils.c
···301301 *302302 * FUNCTION: acpi_ex_eisa_id_to_string303303 *304304- * PARAMETERS: compressed_id - EISAID to be converted305305- * out_string - Where to put the converted string (8 bytes)304304+ * PARAMETERS: out_string - Where to put the converted string (8 bytes)305305+ * compressed_id - EISAID to be converted306306 *307307 * RETURN: None308308 *···354354 * possible 64-bit integer.355355 * value - Value to be converted356356 *357357- * RETURN: None, string357357+ * RETURN: Converted string in out_string358358 *359359 * DESCRIPTION: Convert a 64-bit integer to decimal string representation.360360 * Assumes string buffer is large enough to hold the string. The···384384 * FUNCTION: acpi_ex_pci_cls_to_string385385 *386386 * PARAMETERS: out_string - Where to put the converted string (7 bytes)387387- * PARAMETERS: class_code - PCI class code to be converted (3 bytes)387387+ * class_code - PCI class code to be converted (3 bytes)388388 *389389- * RETURN: None389389+ * RETURN: Converted string in out_string390390 *391391 * DESCRIPTION: Convert 3-bytes PCI class code to string representation.392392 * Return buffer must be large enough to hold the string. The···417417 *418418 * PARAMETERS: space_id - ID to be validated419419 *420420- * RETURN: TRUE if valid/supported ID.420420+ * RETURN: TRUE if space_id is a valid/supported ID.421421 *422422 * DESCRIPTION: Validate an operation region space_ID.423423 *
+15-10
drivers/acpi/acpica/hwregs.c
···8383acpi_hw_validate_register(struct acpi_generic_address *reg,8484 u8 max_bit_width, u64 *address)8585{8686+ u8 bit_width;8787+ u8 access_width;86888789 /* Must have a valid pointer to a GAS structure */8890···111109 return (AE_SUPPORT);112110 }113111114114- /* Validate the bit_width */112112+ /* Validate the access_width */115113116116- if ((reg->bit_width != 8) &&117117- (reg->bit_width != 16) &&118118- (reg->bit_width != 32) && (reg->bit_width != max_bit_width)) {114114+ if (reg->access_width > 4) {119115 ACPI_ERROR((AE_INFO,120120- "Unsupported register bit width: 0x%X",121121- reg->bit_width));116116+ "Unsupported register access width: 0x%X",117117+ reg->access_width));122118 return (AE_SUPPORT);123119 }124120125125- /* Validate the bit_offset. Just a warning for now. */121121+ /* Validate the bit_width, convert access_width into number of bits */126122127127- if (reg->bit_offset != 0) {123123+ access_width = reg->access_width ? reg->access_width : 1;124124+ access_width = 1 << (access_width + 2);125125+ bit_width =126126+ ACPI_ROUND_UP(reg->bit_offset + reg->bit_width, access_width);127127+ if (max_bit_width < bit_width) {128128 ACPI_WARNING((AE_INFO,129129- "Unsupported register bit offset: 0x%X",130130- reg->bit_offset));129129+ "Requested bit width 0x%X is smaller than register bit width 0x%X",130130+ max_bit_width, bit_width));131131+ return (AE_SUPPORT);131132 }132133133134 return (AE_OK);
+1-3
drivers/acpi/acpica/hwxface.c
···504504 * Evaluate the \_Sx namespace object containing the register values505505 * for this state506506 */507507- info->relative_pathname = ACPI_CAST_PTR(char,508508- acpi_gbl_sleep_state_names509509- [sleep_state]);507507+ info->relative_pathname = acpi_gbl_sleep_state_names[sleep_state];510508511509 status = acpi_ns_evaluate(info);512510 if (ACPI_FAILURE(status)) {
+4-3
drivers/acpi/acpica/nsaccess.c
···107107 continue;108108 }109109110110- status = acpi_ns_lookup(NULL, init_val->name, init_val->type,111111- ACPI_IMODE_LOAD_PASS2,112112- ACPI_NS_NO_UPSEARCH, NULL, &new_node);110110+ status =111111+ acpi_ns_lookup(NULL, (char *)init_val->name, init_val->type,112112+ ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH,113113+ NULL, &new_node);113114 if (ACPI_FAILURE(status)) {114115 ACPI_EXCEPTION((AE_INFO, status,115116 "Could not create predefined name %s",
+2-1
drivers/acpi/acpica/nsconvert.c
···7979 /* String-to-Integer conversion */80808181 status = acpi_ut_strtoul64(original_object->string.pointer,8282- ACPI_ANY_BASE, &value);8282+ ACPI_ANY_BASE,8383+ acpi_gbl_integer_byte_width, &value);8384 if (ACPI_FAILURE(status)) {8485 return (status);8586 }
+7-2
drivers/acpi/acpica/nsdump.c
···8181 *8282 ******************************************************************************/83838484-void acpi_ns_print_pathname(u32 num_segments, char *pathname)8484+void acpi_ns_print_pathname(u32 num_segments, const char *pathname)8585{8686 u32 i;8787···114114 acpi_os_printf("]\n");115115}116116117117+#ifdef ACPI_OBSOLETE_FUNCTIONS118118+/* Not used at this time, perhaps later */119119+117120/*******************************************************************************118121 *119122 * FUNCTION: acpi_ns_dump_pathname···134131 ******************************************************************************/135132136133void137137-acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component)134134+acpi_ns_dump_pathname(acpi_handle handle,135135+ const char *msg, u32 level, u32 component)138136{139137140138 ACPI_FUNCTION_TRACE(ns_dump_pathname);···152148 acpi_os_printf("\n");153149 return_VOID;154150}151151+#endif155152156153/*******************************************************************************157154 *
+52-20
drivers/acpi/acpica/nsinit.c
···140140{141141 acpi_status status = AE_OK;142142 struct acpi_device_walk_info info;143143+ acpi_handle handle;143144144145 ACPI_FUNCTION_TRACE(ns_initialize_devices);145146···191190 if (ACPI_SUCCESS(status)) {192191 info.num_INI++;193192 }193193+194194+ /*195195+ * Execute \_SB._INI.196196+ * There appears to be a strict order requirement for \_SB._INI,197197+ * which should be evaluated before any _REG evaluations.198198+ */199199+ status = acpi_get_handle(NULL, "\\_SB", &handle);200200+ if (ACPI_SUCCESS(status)) {201201+ memset(info.evaluate_info, 0,202202+ sizeof(struct acpi_evaluate_info));203203+ info.evaluate_info->prefix_node = handle;204204+ info.evaluate_info->relative_pathname =205205+ METHOD_NAME__INI;206206+ info.evaluate_info->parameters = NULL;207207+ info.evaluate_info->flags = ACPI_IGNORE_RETURN_VALUE;208208+209209+ status = acpi_ns_evaluate(info.evaluate_info);210210+ if (ACPI_SUCCESS(status)) {211211+ info.num_INI++;212212+ }213213+ }194214 }195215196216 /*···220198 * Note: Any objects accessed by the _REG methods will be automatically221199 * initialized, even if they contain executable AML (see the call to222200 * acpi_ns_initialize_objects below).201201+ *202202+ * Note: According to the ACPI specification, we actually needn't execute203203+ * _REG for system_memory/system_io operation regions, but for PCI_Config204204+ * operation regions, it is required to evaluate _REG for those on a PCI205205+ * root bus that doesn't contain _BBN object. So this code is kept here206206+ * in order not to break things.223207 */224208 if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {225209 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,···620592 * Note: We know there is an _INI within this subtree, but it may not be621593 * under this particular device, it may be lower in the branch.622594 */623623- ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname624624- (ACPI_TYPE_METHOD, device_node, METHOD_NAME__INI));595595+ if (!ACPI_COMPARE_NAME(device_node->name.ascii, "_SB_") ||596596+ device_node->parent != acpi_gbl_root_node) {597597+ ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname598598+ (ACPI_TYPE_METHOD, device_node,599599+ METHOD_NAME__INI));625600626626- memset(info, 0, sizeof(struct acpi_evaluate_info));627627- info->prefix_node = device_node;628628- info->relative_pathname = METHOD_NAME__INI;629629- info->parameters = NULL;630630- info->flags = ACPI_IGNORE_RETURN_VALUE;601601+ memset(info, 0, sizeof(struct acpi_evaluate_info));602602+ info->prefix_node = device_node;603603+ info->relative_pathname = METHOD_NAME__INI;604604+ info->parameters = NULL;605605+ info->flags = ACPI_IGNORE_RETURN_VALUE;631606632632- status = acpi_ns_evaluate(info);633633-634634- if (ACPI_SUCCESS(status)) {635635- walk_info->num_INI++;636636- }607607+ status = acpi_ns_evaluate(info);608608+ if (ACPI_SUCCESS(status)) {609609+ walk_info->num_INI++;610610+ }637611#ifdef ACPI_DEBUG_OUTPUT638638- else if (status != AE_NOT_FOUND) {612612+ else if (status != AE_NOT_FOUND) {639613640640- /* Ignore error and move on to next device */614614+ /* Ignore error and move on to next device */641615642642- char *scope_name =643643- acpi_ns_get_normalized_pathname(device_node, TRUE);616616+ char *scope_name =617617+ acpi_ns_get_normalized_pathname(device_node, TRUE);644618645645- ACPI_EXCEPTION((AE_INFO, status, "during %s._INI execution",646646- scope_name));647647- ACPI_FREE(scope_name);648648- }619619+ ACPI_EXCEPTION((AE_INFO, status,620620+ "during %s._INI execution",621621+ scope_name));622622+ ACPI_FREE(scope_name);623623+ }649624#endif625625+ }650626651627 /* Ignore errors from above */652628
···5353acpi_tb_init_generic_address(struct acpi_generic_address *generic_address,5454 u8 space_id,5555 u8 byte_width,5656- u64 address, char *register_name, u8 flags);5656+ u64 address, const char *register_name, u8 flags);57575858static void acpi_tb_convert_fadt(void);5959···6565/* Table for conversion of FADT to common internal format and FADT validation */66666767typedef struct acpi_fadt_info {6868- char *name;6868+ const char *name;6969 u16 address64;7070 u16 address32;7171 u16 length;···192192acpi_tb_init_generic_address(struct acpi_generic_address *generic_address,193193 u8 space_id,194194 u8 byte_width,195195- u64 address, char *register_name, u8 flags)195195+ u64 address, const char *register_name, u8 flags)196196{197197 u8 bit_width;198198···385385{386386 /*387387 * Check if the FADT is larger than the largest table that we expect388388- * (the ACPI 5.0 version). If so, truncate the table, and issue389389- * a warning.388388+ * (typically the current ACPI specification version). If so, truncate389389+ * the table, and issue a warning.390390 */391391 if (length > sizeof(struct acpi_table_fadt)) {392392 ACPI_BIOS_WARNING((AE_INFO,393393- "FADT (revision %u) is longer than ACPI 5.0 version, "393393+ "FADT (revision %u) is longer than %s length, "394394 "truncating length %u to %u",395395- table->revision, length,395395+ table->revision, ACPI_FADT_CONFORMANCE,396396+ length,396397 (u32)sizeof(struct acpi_table_fadt)));397398 }398399···468467469468static void acpi_tb_convert_fadt(void)470469{471471- char *name;470470+ const char *name;472471 struct acpi_generic_address *address64;473472 u32 address32;474473 u8 length;···647646 if ((address64->address && !length) ||648647 (!address64->address && length)) {649648 ACPI_BIOS_WARNING((AE_INFO,650650- "Optional FADT field %s has zero address or length: "651651- "0x%8.8X%8.8X/0x%X",652652- name,649649+ "Optional FADT field %s has valid %s but zero %s: "650650+ "0x%8.8X%8.8X/0x%X", name,651651+ (length ? "Length" :652652+ "Address"),653653+ (length ? "Address" :654654+ "Length"),653655 ACPI_FORMAT_UINT64654656 (address64->address),655657 length));
+1-1
drivers/acpi/acpica/tbxfload.c
···8282 * their customized default region handlers.8383 */8484 status = acpi_ev_install_region_handlers();8585- if (ACPI_FAILURE(status) && status != AE_ALREADY_EXISTS) {8585+ if (ACPI_FAILURE(status)) {8686 ACPI_EXCEPTION((AE_INFO, status,8787 "During Region initialization"));8888 return_ACPI_STATUS(status);
···205205 *206206 * FUNCTION: acpi_ut_strtoul64207207 *208208- * PARAMETERS: string - Null terminated string209209- * base - Radix of the string: 16 or ACPI_ANY_BASE;210210- * ACPI_ANY_BASE means 'in behalf of to_integer'211211- * ret_integer - Where the converted integer is returned208208+ * PARAMETERS: string - Null terminated string209209+ * base - Radix of the string: 16 or 10 or210210+ * ACPI_ANY_BASE211211+ * max_integer_byte_width - Maximum allowable integer,in bytes:212212+ * 4 or 8 (32 or 64 bits)213213+ * ret_integer - Where the converted integer is214214+ * returned212215 *213216 * RETURN: Status and Converted value214217 *215218 * DESCRIPTION: Convert a string into an unsigned value. Performs either a216216- * 32-bit or 64-bit conversion, depending on the current mode217217- * of the interpreter.219219+ * 32-bit or 64-bit conversion, depending on the input integer220220+ * size (often the current mode of the interpreter).218221 *219219- * NOTES: acpi_gbl_integer_byte_width should be set to the proper width.222222+ * NOTES: Negative numbers are not supported, as they are not supported223223+ * by ACPI.224224+ *225225+ * acpi_gbl_integer_byte_width should be set to the proper width.220226 * For the core ACPICA code, this width depends on the DSDT221221- * version. For iASL, the default byte width is always 8.227227+ * version. For iASL, the default byte width is always 8 for the228228+ * parser, but error checking is performed later to flag cases229229+ * where a 64-bit constant is defined in a 32-bit DSDT/SSDT.222230 *223231 * Does not support Octal strings, not needed at this time.224232 *225225- * There is an earlier version of the function after this one,226226- * below. It is slightly different than this one, and the two227227- * may eventually may need to be merged. (01/2016).228228- *229233 ******************************************************************************/230234231231-acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer)235235+acpi_status236236+acpi_ut_strtoul64(char *string,237237+ u32 base, u32 max_integer_byte_width, u64 *ret_integer)232238{233239 u32 this_digit = 0;234240 u64 return_value = 0;235241 u64 quotient;236242 u64 dividend;237237- u32 to_integer_op = (base == ACPI_ANY_BASE);238238- u32 mode32 = (acpi_gbl_integer_byte_width == 4);239243 u8 valid_digits = 0;240244 u8 sign_of0x = 0;241245 u8 term = 0;···248244249245 switch (base) {250246 case ACPI_ANY_BASE:247247+ case 10:251248 case 16:252249253250 break;···270265 string++;271266 }272267273273- if (to_integer_op) {268268+ if (base == ACPI_ANY_BASE) {274269 /*275275- * Base equal to ACPI_ANY_BASE means 'ToInteger operation case'.270270+ * Base equal to ACPI_ANY_BASE means 'Either decimal or hex'.276271 * We need to determine if it is decimal or hexadecimal.277272 */278273 if ((*string == '0') && (tolower((int)*(string + 1)) == 'x')) {···289284 /* Any string left? Check that '0x' is not followed by white space. */290285291286 if (!(*string) || isspace((int)*string) || *string == '\t') {292292- if (to_integer_op) {287287+ if (base == ACPI_ANY_BASE) {293288 goto error_exit;294289 } else {295290 goto all_done;···297292 }298293299294 /*300300- * Perform a 32-bit or 64-bit conversion, depending upon the current301301- * execution mode of the interpreter295295+ * Perform a 32-bit or 64-bit conversion, depending upon the input296296+ * byte width302297 */303303- dividend = (mode32) ? ACPI_UINT32_MAX : ACPI_UINT64_MAX;298298+ dividend = (max_integer_byte_width <= ACPI_MAX32_BYTE_WIDTH) ?299299+ ACPI_UINT32_MAX : ACPI_UINT64_MAX;304300305301 /* Main loop: convert the string to a 32- or 64-bit integer */306302···329323 }330324331325 if (term) {332332- if (to_integer_op) {326326+ if (base == ACPI_ANY_BASE) {333327 goto error_exit;334328 } else {335329 break;···344338345339 valid_digits++;346340347347- if (sign_of0x348348- && ((valid_digits > 16)349349- || ((valid_digits > 8) && mode32))) {341341+ if (sign_of0x && ((valid_digits > 16) ||342342+ ((valid_digits > 8)343343+ && (max_integer_byte_width <=344344+ ACPI_MAX32_BYTE_WIDTH)))) {350345 /*351346 * This is to_integer operation case.352352- * No any restrictions for string-to-integer conversion,347347+ * No restrictions for string-to-integer conversion,353348 * see ACPI spec.354349 */355350 goto error_exit;···362355 "ient, NULL);363356364357 if (return_value > quotient) {365365- if (to_integer_op) {358358+ if (base == ACPI_ANY_BASE) {366359 goto error_exit;367360 } else {368361 break;···385378 return_ACPI_STATUS(AE_OK);386379387380error_exit:388388- /* Base was set/validated above */381381+382382+ /* Base was set/validated above (10 or 16) */389383390384 if (base == 10) {391385 return_ACPI_STATUS(AE_BAD_DECIMAL_CONSTANT);···396388}397389398390#ifdef _OBSOLETE_FUNCTIONS399399-/* TBD: use version in ACPICA main code base? */400400-/* DONE: 01/2016 */391391+/* Removed: 01/2016 */401392402393/*******************************************************************************403394 *
···46464747/* Current ACPICA subsystem version in YYYYMMDD format */48484949-#define ACPI_CA_VERSION 0x201601084949+#define ACPI_CA_VERSION 0x2016031850505151#include <acpi/acconfig.h>5252#include <acpi/actypes.h>
···11-/******************************************************************************22- *33- * Name: acmsvcex.h - Extra VC specific defines, etc.44- *55- *****************************************************************************/66-77-/*88- * Copyright (C) 2000 - 2016, Intel Corp.99- * All rights reserved.1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- * 1. Redistributions of source code must retain the above copyright1515- * notice, this list of conditions, and the following disclaimer,1616- * without modification.1717- * 2. Redistributions in binary form must reproduce at minimum a disclaimer1818- * substantially similar to the "NO WARRANTY" disclaimer below1919- * ("Disclaimer") and any redistribution must be conditioned upon2020- * including a substantially similar Disclaimer requirement for further2121- * binary redistribution.2222- * 3. Neither the names of the above-listed copyright holders nor the names2323- * of any contributors may be used to endorse or promote products derived2424- * from this software without specific prior written permission.2525- *2626- * Alternatively, this software may be distributed under the terms of the2727- * GNU General Public License ("GPL") version 2 as published by the Free2828- * Software Foundation.2929- *3030- * NO WARRANTY3131- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS3232- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT3333- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR3434- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT3535- * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL3636- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS3737- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)3838- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,3939- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING4040- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE4141- * POSSIBILITY OF SUCH DAMAGES.4242- */4343-4444-#ifndef __ACMSVCEX_H__4545-#define __ACMSVCEX_H__4646-4747-/* Debug support. */4848-4949-#ifdef _DEBUG5050-#define _CRTDBG_MAP_ALLOC /* Enables specific file/lineno for leaks */5151-#include <crtdbg.h>5252-#endif5353-5454-#endif /* __ACMSVCEX_H__ */
-49
include/acpi/platform/acwinex.h
···11-/******************************************************************************22- *33- * Name: acwinex.h - Extra OS specific defines, etc.44- *55- *****************************************************************************/66-77-/*88- * Copyright (C) 2000 - 2016, Intel Corp.99- * All rights reserved.1010- *1111- * Redistribution and use in source and binary forms, with or without1212- * modification, are permitted provided that the following conditions1313- * are met:1414- * 1. Redistributions of source code must retain the above copyright1515- * notice, this list of conditions, and the following disclaimer,1616- * without modification.1717- * 2. Redistributions in binary form must reproduce at minimum a disclaimer1818- * substantially similar to the "NO WARRANTY" disclaimer below1919- * ("Disclaimer") and any redistribution must be conditioned upon2020- * including a substantially similar Disclaimer requirement for further2121- * binary redistribution.2222- * 3. Neither the names of the above-listed copyright holders nor the names2323- * of any contributors may be used to endorse or promote products derived2424- * from this software without specific prior written permission.2525- *2626- * Alternatively, this software may be distributed under the terms of the2727- * GNU General Public License ("GPL") version 2 as published by the Free2828- * Software Foundation.2929- *3030- * NO WARRANTY3131- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS3232- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT3333- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR3434- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT3535- * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL3636- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS3737- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)3838- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,3939- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING4040- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE4141- * POSSIBILITY OF SUCH DAMAGES.4242- */4343-4444-#ifndef __ACWINEX_H__4545-#define __ACWINEX_H__4646-4747-/* Windows uses VC */4848-4949-#endif /* __ACWINEX_H__ */
···286286287287 /* Convert argument to an integer physical address */288288289289- status = acpi_ut_strtoul64(ascii_address, 0, &long_address);289289+ status = acpi_ut_strtoul64(ascii_address, ACPI_ANY_BASE,290290+ ACPI_MAX64_BYTE_WIDTH, &long_address);290291 if (ACPI_FAILURE(status)) {291292 acpi_log_error("%s: Could not convert to a physical address\n",292293 ascii_address);
+2-1
tools/power/acpi/tools/acpidump/apmain.c
···209209 case 'r': /* Dump tables from specified RSDP */210210211211 status =212212- acpi_ut_strtoul64(acpi_gbl_optarg, 0,212212+ acpi_ut_strtoul64(acpi_gbl_optarg, ACPI_ANY_BASE,213213+ ACPI_MAX64_BYTE_WIDTH,213214 &gbl_rsdp_base);214215 if (ACPI_FAILURE(status)) {215216 acpi_log_error