Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
60c30d29
Commit
60c30d29
authored
Nov 18, 2002
by
Linus Torvalds
Committed by
Linus Torvalds
Nov 18, 2002
Browse files
Options
Browse Files
Download
Plain Diff
Merge
http://linux-acpi.bkbits.net/linux-acpi
into home.transmeta.com:/home/torvalds/v2.5/linux
parents
67cecd1e
4b207d82
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
263 additions
and
313 deletions
+263
-313
drivers/acpi/dispatcher/dsutils.c
drivers/acpi/dispatcher/dsutils.c
+40
-1
drivers/acpi/dispatcher/dswexec.c
drivers/acpi/dispatcher/dswexec.c
+5
-11
drivers/acpi/events/evmisc.c
drivers/acpi/events/evmisc.c
+5
-4
drivers/acpi/executer/exconvrt.c
drivers/acpi/executer/exconvrt.c
+65
-81
drivers/acpi/executer/exfield.c
drivers/acpi/executer/exfield.c
+5
-48
drivers/acpi/executer/exmisc.c
drivers/acpi/executer/exmisc.c
+18
-61
drivers/acpi/executer/exoparg1.c
drivers/acpi/executer/exoparg1.c
+3
-7
drivers/acpi/executer/exoparg2.c
drivers/acpi/executer/exoparg2.c
+14
-36
drivers/acpi/executer/exresnte.c
drivers/acpi/executer/exresnte.c
+3
-3
drivers/acpi/executer/exresop.c
drivers/acpi/executer/exresop.c
+1
-25
drivers/acpi/include/acconfig.h
drivers/acpi/include/acconfig.h
+2
-2
drivers/acpi/include/acdispat.h
drivers/acpi/include/acdispat.h
+5
-1
drivers/acpi/include/acutils.h
drivers/acpi/include/acutils.h
+5
-1
drivers/acpi/namespace/nseval.c
drivers/acpi/namespace/nseval.c
+2
-2
drivers/acpi/namespace/nsinit.c
drivers/acpi/namespace/nsinit.c
+2
-2
drivers/acpi/osl.c
drivers/acpi/osl.c
+13
-14
drivers/acpi/parser/psparse.c
drivers/acpi/parser/psparse.c
+9
-9
drivers/acpi/sleep.c
drivers/acpi/sleep.c
+2
-0
drivers/acpi/utilities/utobject.c
drivers/acpi/utilities/utobject.c
+64
-5
No files found.
drivers/acpi/dispatcher/dsutils.c
View file @
60c30d29
/*******************************************************************************
*
* Module Name: dsutils - Dispatcher utilities
* $Revision: 9
6
$
* $Revision: 9
7
$
*
******************************************************************************/
...
...
@@ -274,6 +274,45 @@ acpi_ds_resolve_operands (
return_ACPI_STATUS
(
status
);
}
/*******************************************************************************
*
* FUNCTION: Acpi_ds_clear_operands
*
* PARAMETERS: Walk_state - Current walk state with operands on stack
*
* RETURN: None
*
* DESCRIPTION: Clear all operands on the current walk state operand stack.
*
******************************************************************************/
void
acpi_ds_clear_operands
(
acpi_walk_state
*
walk_state
)
{
u32
i
;
ACPI_FUNCTION_TRACE_PTR
(
"Acpi_ds_clear_operands"
,
walk_state
);
/*
* Remove a reference on each operand on the stack
*/
for
(
i
=
0
;
i
<
walk_state
->
num_operands
;
i
++
)
{
/*
* Remove a reference to all operands, including both
* "Arguments" and "Targets".
*/
acpi_ut_remove_reference
(
walk_state
->
operands
[
i
]);
walk_state
->
operands
[
i
]
=
NULL
;
}
walk_state
->
num_operands
=
0
;
return_VOID
;
}
#endif
...
...
drivers/acpi/dispatcher/dswexec.c
View file @
60c30d29
...
...
@@ -2,7 +2,7 @@
*
* Module Name: dswexec - Dispatcher method execution callbacks;
* dispatch to interpreter.
* $Revision: 9
5
$
* $Revision: 9
6
$
*
*****************************************************************************/
...
...
@@ -329,7 +329,6 @@ acpi_ds_exec_end_op (
u32
op_class
;
acpi_parse_object
*
next_op
;
acpi_parse_object
*
first_arg
;
u32
i
;
ACPI_FUNCTION_TRACE_PTR
(
"Ds_exec_end_op"
,
walk_state
);
...
...
@@ -406,15 +405,7 @@ acpi_ds_exec_end_op (
/* Always delete the argument objects and clear the operand stack */
for
(
i
=
0
;
i
<
walk_state
->
num_operands
;
i
++
)
{
/*
* Remove a reference to all operands, including both
* "Arguments" and "Targets".
*/
acpi_ut_remove_reference
(
walk_state
->
operands
[
i
]);
walk_state
->
operands
[
i
]
=
NULL
;
}
walk_state
->
num_operands
=
0
;
acpi_ds_clear_operands
(
walk_state
);
/*
* If a result object was returned from above, push it on the
...
...
@@ -475,6 +466,9 @@ acpi_ds_exec_end_op (
*/
status
=
acpi_ds_resolve_operands
(
walk_state
);
if
(
ACPI_FAILURE
(
status
))
{
/* On error, clear all resolved operands */
acpi_ds_clear_operands
(
walk_state
);
break
;
}
...
...
drivers/acpi/events/evmisc.c
View file @
60c30d29
/******************************************************************************
*
* Module Name: evmisc - Miscellaneous event manager support functions
* $Revision: 5
8
$
* $Revision: 5
9
$
*
*****************************************************************************/
...
...
@@ -228,7 +228,8 @@ acpi_ev_queue_notify_request (
if
(
!
handler_obj
)
{
/* There is no per-device notify handler for this device */
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"No notify handler for node %p
\n
"
,
node
));
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"No notify handler for [%4.4s] node %p
\n
"
,
node
->
name
.
ascii
,
node
));
}
return
(
status
);
...
...
@@ -466,7 +467,7 @@ acpi_ev_acquire_global_lock (
if
(
acquired
)
{
/* We got the lock */
ACPI_DEBUG_PRINT
((
ACPI_DB_
INFO
,
"Acquired the HW Global Lock
\n
"
));
ACPI_DEBUG_PRINT
((
ACPI_DB_
EXEC
,
"Acquired the HW Global Lock
\n
"
));
acpi_gbl_global_lock_acquired
=
TRUE
;
return_ACPI_STATUS
(
AE_OK
);
...
...
@@ -476,7 +477,7 @@ acpi_ev_acquire_global_lock (
* Did not get the lock. The pending bit was set above, and we must now
* wait until we get the global lock released interrupt.
*/
ACPI_DEBUG_PRINT
((
ACPI_DB_
INFO
,
"Waiting for the HW Global Lock
\n
"
));
ACPI_DEBUG_PRINT
((
ACPI_DB_
EXEC
,
"Waiting for the HW Global Lock
\n
"
));
/*
* Acquire the global lock semaphore first.
...
...
drivers/acpi/executer/exconvrt.c
View file @
60c30d29
/******************************************************************************
*
* Module Name: exconvrt - Object conversion routines
* $Revision: 4
1
$
* $Revision: 4
4
$
*
*****************************************************************************/
...
...
@@ -147,10 +147,15 @@ acpi_ex_convert_to_integer (
return_ACPI_STATUS
(
AE_NO_MEMORY
);
}
/* Save the Result
, delete original descriptor, store new descriptor
*/
/* Save the Result */
ret_desc
->
integer
.
value
=
result
;
/*
* If we are about to overwrite the original object on the operand stack,
* we must remove a reference on the original object because we are
* essentially removing it from the stack.
*/
if
(
*
result_desc
==
obj_desc
)
{
if
(
walk_state
->
opcode
!=
AML_STORE_OP
)
{
acpi_ut_remove_reference
(
obj_desc
);
...
...
@@ -191,76 +196,50 @@ acpi_ex_convert_to_buffer (
switch
(
ACPI_GET_OBJECT_TYPE
(
obj_desc
))
{
case
ACPI_TYPE_BUFFER
:
/* No conversion necessary */
*
result_desc
=
obj_desc
;
return_ACPI_STATUS
(
AE_OK
);
case
ACPI_TYPE_INTEGER
:
/*
* Create a new Buffer object
* Create a new Buffer object.
* Need enough space for one integer
*/
ret_desc
=
acpi_ut_create_
internal_object
(
ACPI_TYPE_BUFFER
);
ret_desc
=
acpi_ut_create_
buffer_object
(
acpi_gbl_integer_byte_width
);
if
(
!
ret_desc
)
{
return_ACPI_STATUS
(
AE_NO_MEMORY
);
}
/* Need enough space for one integer */
new_buf
=
ACPI_MEM_CALLOCATE
(
acpi_gbl_integer_byte_width
);
if
(
!
new_buf
)
{
ACPI_REPORT_ERROR
((
"Ex_convert_to_buffer: Buffer allocation failure
\n
"
));
acpi_ut_remove_reference
(
ret_desc
);
return_ACPI_STATUS
(
AE_NO_MEMORY
);
}
/* Copy the integer to the buffer */
new_buf
=
ret_desc
->
buffer
.
pointer
;
for
(
i
=
0
;
i
<
acpi_gbl_integer_byte_width
;
i
++
)
{
new_buf
[
i
]
=
(
u8
)
(
obj_desc
->
integer
.
value
>>
(
i
*
8
));
}
/* Complete buffer object initialization */
ret_desc
->
buffer
.
flags
|=
AOPOBJ_DATA_VALID
;
ret_desc
->
buffer
.
pointer
=
new_buf
;
ret_desc
->
buffer
.
length
=
acpi_gbl_integer_byte_width
;
/* Return the new buffer descriptor */
*
result_desc
=
ret_desc
;
break
;
case
ACPI_TYPE_STRING
:
/*
* Create a new Buffer object
* Size will be the string length
*/
ret_desc
=
acpi_ut_create_
internal_object
(
ACPI_TYPE_BUFFER
);
ret_desc
=
acpi_ut_create_
buffer_object
(
obj_desc
->
string
.
length
);
if
(
!
ret_desc
)
{
return_ACPI_STATUS
(
AE_NO_MEMORY
);
}
/*
Need enough space for one integ
er */
/*
Copy the string to the buff
er */
new_buf
=
ACPI_MEM_CALLOCATE
(
obj_desc
->
string
.
length
);
if
(
!
new_buf
)
{
ACPI_REPORT_ERROR
((
"Ex_convert_to_buffer: Buffer allocation failure
\n
"
));
acpi_ut_remove_reference
(
ret_desc
);
return_ACPI_STATUS
(
AE_NO_MEMORY
);
}
ACPI_STRNCPY
((
char
*
)
new_buf
,
(
char
*
)
obj_desc
->
string
.
pointer
,
obj_desc
->
string
.
length
);
ret_desc
->
buffer
.
flags
|=
AOPOBJ_DATA_VALID
;
ret_desc
->
buffer
.
pointer
=
new_buf
;
ret_desc
->
buffer
.
length
=
obj_desc
->
string
.
length
;
/* Return the new buffer descriptor */
*
result_desc
=
ret_desc
;
break
;
case
ACPI_TYPE_BUFFER
:
*
result_desc
=
obj_desc
;
new_buf
=
ret_desc
->
buffer
.
pointer
;
ACPI_STRNCPY
((
char
*
)
new_buf
,
(
char
*
)
obj_desc
->
string
.
pointer
,
obj_desc
->
string
.
length
);
break
;
...
...
@@ -270,7 +249,20 @@ acpi_ex_convert_to_buffer (
/* Mark buffer initialized */
(
*
result_desc
)
->
common
.
flags
|=
AOPOBJ_DATA_VALID
;
ret_desc
->
common
.
flags
|=
AOPOBJ_DATA_VALID
;
/*
* If we are about to overwrite the original object on the operand stack,
* we must remove a reference on the original object because we are
* essentially removing it from the stack.
*/
if
(
*
result_desc
==
obj_desc
)
{
if
(
walk_state
->
opcode
!=
AML_STORE_OP
)
{
acpi_ut_remove_reference
(
obj_desc
);
}
}
*
result_desc
=
ret_desc
;
return_ACPI_STATUS
(
AE_OK
);
}
...
...
@@ -405,6 +397,19 @@ acpi_ex_convert_to_string (
switch
(
ACPI_GET_OBJECT_TYPE
(
obj_desc
))
{
case
ACPI_TYPE_STRING
:
if
(
max_length
>=
obj_desc
->
string
.
length
)
{
*
result_desc
=
obj_desc
;
return_ACPI_STATUS
(
AE_OK
);
}
else
{
/* Must copy the string first and then truncate it */
return_ACPI_STATUS
(
AE_NOT_IMPLEMENTED
);
}
case
ACPI_TYPE_INTEGER
:
string_length
=
acpi_gbl_integer_byte_width
*
2
;
...
...
@@ -446,16 +451,6 @@ acpi_ex_convert_to_string (
}
ret_desc
->
buffer
.
pointer
=
new_buf
;
/* Return the new buffer descriptor */
if
(
*
result_desc
==
obj_desc
)
{
if
(
walk_state
->
opcode
!=
AML_STORE_OP
)
{
acpi_ut_remove_reference
(
obj_desc
);
}
}
*
result_desc
=
ret_desc
;
break
;
...
...
@@ -511,37 +506,26 @@ acpi_ex_convert_to_string (
new_buf
[
index
-
1
]
=
0
;
ret_desc
->
buffer
.
pointer
=
new_buf
;
ret_desc
->
string
.
length
=
(
u32
)
ACPI_STRLEN
((
char
*
)
new_buf
);
/* Return the new buffer descriptor */
if
(
*
result_desc
==
obj_desc
)
{
if
(
walk_state
->
opcode
!=
AML_STORE_OP
)
{
acpi_ut_remove_reference
(
obj_desc
);
}
}
*
result_desc
=
ret_desc
;
break
;
case
ACPI_TYPE_STRING
:
if
(
max_length
>=
obj_desc
->
string
.
length
)
{
*
result_desc
=
obj_desc
;
}
default:
return_ACPI_STATUS
(
AE_TYPE
);
}
else
{
/* Must copy the string first and then truncate it */
return_ACPI_STATUS
(
AE_NOT_IMPLEMENTED
);
/*
* If we are about to overwrite the original object on the operand stack,
* we must remove a reference on the original object because we are
* essentially removing it from the stack.
*/
if
(
*
result_desc
==
obj_desc
)
{
if
(
walk_state
->
opcode
!=
AML_STORE_OP
)
{
acpi_ut_remove_reference
(
obj_desc
);
}
break
;
default:
return_ACPI_STATUS
(
AE_TYPE
);
}
*
result_desc
=
ret_desc
;
return_ACPI_STATUS
(
AE_OK
);
}
...
...
drivers/acpi/executer/exfield.c
View file @
60c30d29
/******************************************************************************
*
* Module Name: exfield - ACPI AML (p-code) execution - field manipulation
* $Revision: 11
3
$
* $Revision: 11
5
$
*
*****************************************************************************/
...
...
@@ -27,8 +27,6 @@
#include "acpi.h"
#include "acdispat.h"
#include "acinterp.h"
#include "acevents.h"
#include "amlcode.h"
#define _COMPONENT ACPI_EXECUTER
...
...
@@ -90,25 +88,11 @@ acpi_ex_read_data_from_field (
* This is an SMBus read. We must create a buffer to hold the data
* and directly access the region handler.
*/
buffer_desc
=
acpi_ut_create_
internal_object
(
ACPI_TYPE_BUFFER
);
buffer_desc
=
acpi_ut_create_
buffer_object
(
ACPI_SMBUS_BUFFER_SIZE
);
if
(
!
buffer_desc
)
{
return_ACPI_STATUS
(
AE_NO_MEMORY
);
}
/* Create the actual read buffer */
buffer_desc
->
buffer
.
pointer
=
ACPI_MEM_CALLOCATE
(
ACPI_SMBUS_BUFFER_SIZE
);
if
(
!
buffer_desc
->
buffer
.
pointer
)
{
acpi_ut_remove_reference
(
buffer_desc
);
return_ACPI_STATUS
(
AE_NO_MEMORY
);
}
/* Complete the buffer object initialization */
buffer_desc
->
common
.
flags
=
AOPOBJ_DATA_VALID
;
buffer_desc
->
buffer
.
length
=
ACPI_SMBUS_BUFFER_SIZE
;
buffer
=
buffer_desc
->
buffer
.
pointer
;
/* Lock entire transaction if requested */
locked
=
acpi_ex_acquire_global_lock
(
obj_desc
->
common_field
.
field_flags
);
...
...
@@ -118,7 +102,7 @@ acpi_ex_read_data_from_field (
* Note: Smbus protocol value is passed in upper 16-bits of Function
*/
status
=
acpi_ex_access_region
(
obj_desc
,
0
,
(
acpi_integer
*
)
buffer_desc
->
buffer
.
pointer
,
ACPI_CAST_PTR
(
acpi_integer
,
buffer_desc
->
buffer
.
pointer
)
,
ACPI_READ
|
(
obj_desc
->
field
.
attribute
<<
16
));
acpi_ex_release_global_lock
(
locked
);
goto
exit
;
...
...
@@ -138,23 +122,10 @@ acpi_ex_read_data_from_field (
if
(
length
>
acpi_gbl_integer_byte_width
)
{
/* Field is too large for an Integer, create a Buffer instead */
buffer_desc
=
acpi_ut_create_
internal_object
(
ACPI_TYPE_BUFFER
);
buffer_desc
=
acpi_ut_create_
buffer_object
(
length
);
if
(
!
buffer_desc
)
{
return_ACPI_STATUS
(
AE_NO_MEMORY
);
}
/* Create the actual read buffer */
buffer_desc
->
buffer
.
pointer
=
ACPI_MEM_CALLOCATE
(
length
);
if
(
!
buffer_desc
->
buffer
.
pointer
)
{
acpi_ut_remove_reference
(
buffer_desc
);
return_ACPI_STATUS
(
AE_NO_MEMORY
);
}
/* Complete the buffer object initialization */
buffer_desc
->
common
.
flags
=
AOPOBJ_DATA_VALID
;
buffer_desc
->
buffer
.
length
=
length
;
buffer
=
buffer_desc
->
buffer
.
pointer
;
}
else
{
...
...
@@ -270,26 +241,12 @@ acpi_ex_write_data_to_field (
return_ACPI_STATUS
(
AE_AML_BUFFER_LIMIT
);
}
buffer_desc
=
acpi_ut_create_
internal_object
(
ACPI_TYPE_BUFFER
);
buffer_desc
=
acpi_ut_create_
buffer_object
(
ACPI_SMBUS_BUFFER_SIZE
);
if
(
!
buffer_desc
)
{
return_ACPI_STATUS
(
AE_NO_MEMORY
);
}
/* Create the actual read buffer */
buffer_desc
->
buffer
.
pointer
=
ACPI_MEM_CALLOCATE
(
ACPI_SMBUS_BUFFER_SIZE
);
if
(
!
buffer_desc
->
buffer
.
pointer
)
{
acpi_ut_remove_reference
(
buffer_desc
);
return_ACPI_STATUS
(
AE_NO_MEMORY
);
}
/* Complete the buffer object initialization */
buffer_desc
->
common
.
flags
=
AOPOBJ_DATA_VALID
;
buffer_desc
->
buffer
.
length
=
ACPI_SMBUS_BUFFER_SIZE
;
buffer
=
buffer_desc
->
buffer
.
pointer
;
ACPI_MEMCPY
(
buffer
,
source_desc
->
buffer
.
pointer
,
ACPI_SMBUS_BUFFER_SIZE
);
/* Lock entire transaction if requested */
...
...
drivers/acpi/executer/exmisc.c
View file @
60c30d29
...
...
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes
* $Revision: 11
0
$
* $Revision: 11
2
$
*
*****************************************************************************/
...
...
@@ -148,9 +148,8 @@ acpi_ex_concat_template (
acpi_operand_object
**
actual_return_desc
,
acpi_walk_state
*
walk_state
)
{
acpi_status
status
;
acpi_operand_object
*
return_desc
;
NATIVE_CHAR
*
new_buf
;
u8
*
new_buf
;
u8
*
end_tag1
;
u8
*
end_tag2
;
ACPI_SIZE
length1
;
...
...
@@ -168,54 +167,35 @@ acpi_ex_concat_template (
return_ACPI_STATUS
(
AE_AML_OPERAND_TYPE
);
}
/* Create a new buffer object for the result */
return_desc
=
acpi_ut_create_internal_object
(
ACPI_TYPE_BUFFER
);
if
(
!
return_desc
)
{
return_ACPI_STATUS
(
AE_NO_MEMORY
);
}
/* Allocate a new buffer for the result */
/* Compute the length of each part */
length1
=
ACPI_PTR_DIFF
(
end_tag1
,
obj_desc1
->
buffer
.
pointer
);
length2
=
ACPI_PTR_DIFF
(
end_tag2
,
obj_desc2
->
buffer
.
pointer
)
+
2
;
/* Size of END_TAG */
new_buf
=
ACPI_MEM_ALLOCATE
(
length1
+
length2
);
if
(
!
new_buf
)
{
ACPI_REPORT_ERROR
((
"Ex_concat_template: Buffer allocation failure
\n
"
));
status
=
AE_NO_MEMORY
;
goto
cleanup
;
/* Create a new buffer object for the result */
return_desc
=
acpi_ut_create_buffer_object
(
length1
+
length2
);
if
(
!
return_desc
)
{
return_ACPI_STATUS
(
AE_NO_MEMORY
);
}
/* Copy the templates to the new descriptor */
new_buf
=
return_desc
->
buffer
.
pointer
;
ACPI_MEMCPY
(
new_buf
,
obj_desc1
->
buffer
.
pointer
,
length1
);
ACPI_MEMCPY
(
new_buf
+
length1
,
obj_desc2
->
buffer
.
pointer
,
length2
);
/* Complete the buffer object initialization */
return_desc
->
common
.
flags
=
AOPOBJ_DATA_VALID
;
return_desc
->
buffer
.
pointer
=
(
u8
*
)
new_buf
;
return_desc
->
buffer
.
length
=
(
u32
)
(
length1
+
length2
);
/* Compute the new checksum */
new_buf
[
return_desc
->
buffer
.
length
-
1
]
=
(
NATIVE_CHAR
)
new_buf
[
return_desc
->
buffer
.
length
-
1
]
=
acpi_ut_generate_checksum
(
return_desc
->
buffer
.
pointer
,
(
return_desc
->
buffer
.
length
-
1
));
(
return_desc
->
buffer
.
length
-
1
));
/* Return the completed template descriptor */
*
actual_return_desc
=
return_desc
;
return_ACPI_STATUS
(
AE_OK
);
cleanup:
acpi_ut_remove_reference
(
return_desc
);
return_ACPI_STATUS
(
status
);
}
...
...
@@ -262,22 +242,14 @@ acpi_ex_do_concatenate (
case
ACPI_TYPE_INTEGER
:
/* Result of two Integers is a Buffer */
/* Need enough buffer space for two integers */
return_desc
=
acpi_ut_create_
internal_object
(
ACPI_TYPE_BUFFER
);
return_desc
=
acpi_ut_create_
buffer_object
(
acpi_gbl_integer_byte_width
*
2
);
if
(
!
return_desc
)
{
return
(
AE_NO_MEMORY
);
}
/* Need enough buffer space for two integers */
return_desc
->
buffer
.
length
=
acpi_gbl_integer_byte_width
*
2
;
new_buf
=
ACPI_MEM_CALLOCATE
(
return_desc
->
buffer
.
length
);
if
(
!
new_buf
)
{
ACPI_REPORT_ERROR
((
"Ex_do_concatenate: Buffer allocation failure
\n
"
));
status
=
AE_NO_MEMORY
;
goto
cleanup
;
}
new_buf
=
(
NATIVE_CHAR
*
)
return_desc
->
buffer
.
pointer
;
/* Convert the first integer */
...
...
@@ -295,10 +267,6 @@ acpi_ex_do_concatenate (
this_integer
>>=
8
;
}
/* Complete the buffer object initialization */
return_desc
->
common
.
flags
=
AOPOBJ_DATA_VALID
;
return_desc
->
buffer
.
pointer
=
(
u8
*
)
new_buf
;
break
;
...
...
@@ -340,19 +308,14 @@ acpi_ex_do_concatenate (
/* Result of two Buffers is a Buffer */
return_desc
=
acpi_ut_create_internal_object
(
ACPI_TYPE_BUFFER
);
return_desc
=
acpi_ut_create_buffer_object
(
(
ACPI_SIZE
)
obj_desc1
->
buffer
.
length
+
(
ACPI_SIZE
)
obj_desc2
->
buffer
.
length
);
if
(
!
return_desc
)
{
return
(
AE_NO_MEMORY
);
}
new_buf
=
ACPI_MEM_ALLOCATE
((
ACPI_SIZE
)
obj_desc1
->
buffer
.
length
+
(
ACPI_SIZE
)
obj_desc2
->
buffer
.
length
);
if
(
!
new_buf
)
{
ACPI_REPORT_ERROR
((
"Ex_do_concatenate: Buffer allocation failure
\n
"
));
status
=
AE_NO_MEMORY
;
goto
cleanup
;
}
new_buf
=
(
NATIVE_CHAR
*
)
return_desc
->
buffer
.
pointer
;
/* Concatenate the buffers */
...
...
@@ -361,12 +324,6 @@ acpi_ex_do_concatenate (
ACPI_MEMCPY
(
new_buf
+
obj_desc1
->
buffer
.
length
,
obj_desc2
->
buffer
.
pointer
,
obj_desc2
->
buffer
.
length
);
/* Complete the buffer object initialization */
return_desc
->
common
.
flags
=
AOPOBJ_DATA_VALID
;
return_desc
->
buffer
.
pointer
=
(
u8
*
)
new_buf
;
return_desc
->
buffer
.
length
=
obj_desc1
->
buffer
.
length
+
obj_desc2
->
buffer
.
length
;
break
;
...
...
drivers/acpi/executer/exoparg1.c
View file @
60c30d29
...
...
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exoparg1 - AML execution - opcodes with 1 argument
* $Revision: 14
5
$
* $Revision: 14
6
$
*
*****************************************************************************/
...
...
@@ -345,12 +345,6 @@ acpi_ex_opcode_1A_1T_1R (
* return FALSE
*/
return_desc
->
integer
.
value
=
0
;
/*
* Must delete the result descriptor since there is no reference
* being returned
*/
acpi_ut_remove_reference
(
operand
[
1
]);
goto
cleanup
;
}
...
...
@@ -389,6 +383,8 @@ acpi_ex_opcode_1A_1T_1R (
return_ACPI_STATUS
(
status
);
}
/* It is possible that the Store already produced a return object */
if
(
!
walk_state
->
result_obj
)
{
/*
* Normally, we would remove a reference on the Operand[0] parameter;
...
...
drivers/acpi/executer/exoparg2.c
View file @
60c30d29
/******************************************************************************
*
* Module Name: exoparg2 - AML execution - opcodes with 2 arguments
* $Revision: 11
4
$
* $Revision: 11
5
$
*
*****************************************************************************/
...
...
@@ -414,39 +414,10 @@ acpi_ex_opcode_2A_1T_1R (
goto
cleanup
;
}
if
((
ACPI_GET_OBJECT_TYPE
(
operand
[
2
])
==
ACPI_TYPE_INTEGER
)
&&
(
operand
[
2
]
->
common
.
flags
&
AOPOBJ_AML_CONSTANT
))
{
/*
* There is no actual result descriptor (the Zero_op/Constant Result
* descriptor is a placeholder), so just delete the placeholder and
* return a reference to the package element
*/
acpi_ut_remove_reference
(
operand
[
2
]);
}
else
{
/*
* Each element of the package is an internal object. Get the one
* we are after.
*/
temp_desc
=
operand
[
0
]
->
package
.
elements
[
index
];
return_desc
->
reference
.
opcode
=
AML_INDEX_OP
;
return_desc
->
reference
.
target_type
=
ACPI_GET_OBJECT_TYPE
(
temp_desc
);
return_desc
->
reference
.
object
=
temp_desc
;
status
=
acpi_ex_store
(
return_desc
,
operand
[
2
],
walk_state
);
return_desc
->
reference
.
object
=
NULL
;
}
/*
* The local return object must always be a reference to the package element,
* not the element itself.
*/
return_desc
->
reference
.
opcode
=
AML_INDEX_OP
;
return_desc
->
reference
.
target_type
=
ACPI_TYPE_PACKAGE
;
return_desc
->
reference
.
object
=
operand
[
0
]
->
package
.
elements
[
index
];
return_desc
->
reference
.
where
=
&
operand
[
0
]
->
package
.
elements
[
index
];
}
else
{
/* Object to be indexed is a Buffer */
...
...
@@ -457,14 +428,21 @@ acpi_ex_opcode_2A_1T_1R (
goto
cleanup
;
}
return_desc
->
reference
.
opcode
=
AML_INDEX_OP
;
return_desc
->
reference
.
target_type
=
ACPI_TYPE_BUFFER_FIELD
;
return_desc
->
reference
.
object
=
operand
[
0
];
return_desc
->
reference
.
offset
=
index
;
status
=
acpi_ex_store
(
return_desc
,
operand
[
2
],
walk_state
);
return_desc
->
reference
.
object
=
operand
[
0
];
}
/* Complete the Index reference object */
return_desc
->
reference
.
opcode
=
AML_INDEX_OP
;
return_desc
->
reference
.
offset
=
index
;
/* Store the reference to the Target */
status
=
acpi_ex_store
(
return_desc
,
operand
[
2
],
walk_state
);
/* Return the reference */
walk_state
->
result_obj
=
return_desc
;
goto
cleanup
;
...
...
drivers/acpi/executer/exresnte.c
View file @
60c30d29
...
...
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exresnte - AML Interpreter object resolution
* $Revision: 6
0
$
* $Revision: 6
1
$
*
*****************************************************************************/
...
...
@@ -85,8 +85,8 @@ acpi_ex_resolve_node_to_value (
source_desc
=
acpi_ns_get_attached_object
(
node
);
entry_type
=
acpi_ns_get_type
((
acpi_handle
)
node
);
ACPI_DEBUG_PRINT
((
ACPI_DB_EXEC
,
"Entry=%p Source_desc=%p
Type=%X
\n
"
,
node
,
source_desc
,
entry_type
));
ACPI_DEBUG_PRINT
((
ACPI_DB_EXEC
,
"Entry=%p Source_desc=%p
[%s]
\n
"
,
node
,
source_desc
,
acpi_ut_get_type_name
(
entry_type
)
));
if
(
entry_type
==
ACPI_TYPE_LOCAL_ALIAS
)
{
/* There is always exactly one level of indirection */
...
...
drivers/acpi/executer/exresop.c
View file @
60c30d29
...
...
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exresop - AML Interpreter operand/object resolution
* $Revision:
59
$
* $Revision:
60
$
*
*****************************************************************************/
...
...
@@ -390,14 +390,6 @@ acpi_ex_resolve_operands (
return_ACPI_STATUS
(
status
);
}
if
(
obj_desc
!=
*
stack_ptr
)
{
/*
* We just created a new object, remove a reference
* on the original operand object
*/
acpi_ut_remove_reference
(
obj_desc
);
}
goto
next_operand
;
...
...
@@ -420,14 +412,6 @@ acpi_ex_resolve_operands (
return_ACPI_STATUS
(
status
);
}
if
(
obj_desc
!=
*
stack_ptr
)
{
/*
* We just created a new object, remove a reference
* on the original operand object
*/
acpi_ut_remove_reference
(
obj_desc
);
}
goto
next_operand
;
...
...
@@ -450,14 +434,6 @@ acpi_ex_resolve_operands (
return_ACPI_STATUS
(
status
);
}
if
(
obj_desc
!=
*
stack_ptr
)
{
/*
* We just created a new object, remove a reference
* on the original operand object
*/
acpi_ut_remove_reference
(
obj_desc
);
}
goto
next_operand
;
...
...
drivers/acpi/include/acconfig.h
View file @
60c30d29
/******************************************************************************
*
* Name: acconfig.h - Global configuration constants
* $Revision: 11
7
$
* $Revision: 11
8
$
*
*****************************************************************************/
...
...
@@ -54,7 +54,7 @@
/* Version string */
#define ACPI_CA_VERSION 0x2002111
1
#define ACPI_CA_VERSION 0x2002111
5
/* Version of ACPI supported */
...
...
drivers/acpi/include/acdispat.h
View file @
60c30d29
/******************************************************************************
*
* Name: acdispat.h - dispatcher (parser to interpreter interface)
* $Revision: 5
4
$
* $Revision: 5
5
$
*
*****************************************************************************/
...
...
@@ -378,6 +378,10 @@ acpi_status
acpi_ds_resolve_operands
(
acpi_walk_state
*
walk_state
);
void
acpi_ds_clear_operands
(
acpi_walk_state
*
walk_state
);
/*
* dswscope - Scope Stack manipulation
...
...
drivers/acpi/include/acutils.h
View file @
60c30d29
/******************************************************************************
*
* Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
* $Revision: 14
7
$
* $Revision: 14
8
$
*
*****************************************************************************/
...
...
@@ -531,6 +531,10 @@ u8
acpi_ut_valid_internal_object
(
void
*
object
);
acpi_operand_object
*
acpi_ut_create_buffer_object
(
ACPI_SIZE
buffer_size
);
/*
* Ut_ref_cnt - Object reference count management
...
...
drivers/acpi/namespace/nseval.c
View file @
60c30d29
...
...
@@ -2,7 +2,7 @@
*
* Module Name: nseval - Object evaluation interfaces -- includes control
* method lookup and execution.
* $Revision: 11
8
$
* $Revision: 11
9
$
*
******************************************************************************/
...
...
@@ -383,7 +383,7 @@ acpi_ns_execute_control_method (
return_ACPI_STATUS
(
AE_NULL_OBJECT
);
}
ACPI_DUMP_PATHNAME
(
method_node
,
"
Ns_execute_control_method: Executing
"
,
ACPI_DUMP_PATHNAME
(
method_node
,
"
Execute Method:
"
,
ACPI_LV_INFO
,
_COMPONENT
);
ACPI_DEBUG_PRINT
((
ACPI_DB_EXEC
,
"Method at AML address %p Length %X
\n
"
,
...
...
drivers/acpi/namespace/nsinit.c
View file @
60c30d29
/******************************************************************************
*
* Module Name: nsinit - namespace initialization
* $Revision:
49
$
* $Revision:
50
$
*
*****************************************************************************/
...
...
@@ -317,7 +317,7 @@ acpi_ns_init_one_device (
ACPI_FUNCTION_TRACE
(
"Ns_init_one_device"
);
if
(
!
(
acpi_dbg_level
&
ACPI_LV_INIT
))
{
if
(
(
acpi_dbg_level
<=
ACPI_LV_ALL_EXCEPTIONS
)
&&
(
!
(
acpi_dbg_level
&
ACPI_LV_INFO
)
))
{
ACPI_DEBUG_PRINT_RAW
((
ACPI_DB_OK
,
"."
));
}
...
...
drivers/acpi/osl.c
View file @
60c30d29
...
...
@@ -525,7 +525,7 @@ acpi_os_queue_exec (
if
(
!
dpc
||
!
dpc
->
function
)
return_ACPI_STATUS
(
AE_BAD_PARAMETER
);
ACPI_DEBUG_PRINT
((
ACPI_DB_
INFO
,
"Executing function [%p(%p)].
\n
"
,
dpc
->
function
,
dpc
->
context
));
ACPI_DEBUG_PRINT
((
ACPI_DB_
EXEC
,
"Executing function [%p(%p)].
\n
"
,
dpc
->
function
,
dpc
->
context
));
dpc
->
function
(
dpc
->
context
);
...
...
@@ -549,7 +549,7 @@ acpi_os_schedule_exec (
return_VOID
;
}
ACPI_DEBUG_PRINT
((
ACPI_DB_
INFO
,
"Creating new thread to run function [%p(%p)].
\n
"
,
dpc
->
function
,
dpc
->
context
));
ACPI_DEBUG_PRINT
((
ACPI_DB_
EXEC
,
"Creating new thread to run function [%p(%p)].
\n
"
,
dpc
->
function
,
dpc
->
context
));
thread_pid
=
kernel_thread
(
acpi_os_queue_exec
,
dpc
,
(
CLONE_FS
|
CLONE_FILES
|
SIGCHLD
));
...
...
@@ -571,7 +571,7 @@ acpi_os_queue_for_execution(
ACPI_FUNCTION_TRACE
(
"os_queue_for_execution"
);
ACPI_DEBUG_PRINT
((
ACPI_DB_
INFO
,
"Scheduling function [%p(%p)] for deferred execution.
\n
"
,
function
,
context
));
ACPI_DEBUG_PRINT
((
ACPI_DB_
EXEC
,
"Scheduling function [%p(%p)] for deferred execution.
\n
"
,
function
,
context
));
if
(
!
function
)
return_ACPI_STATUS
(
AE_BAD_PARAMETER
);
...
...
@@ -657,7 +657,7 @@ acpi_os_create_semaphore(
*
handle
=
(
acpi_handle
*
)
sem
;
ACPI_DEBUG_PRINT
((
ACPI_DB_
INFO
,
"Creating semaphore[%p|%d].
\n
"
,
*
handle
,
initial_units
));
ACPI_DEBUG_PRINT
((
ACPI_DB_
MUTEX
,
"Creating semaphore[%p|%d].
\n
"
,
*
handle
,
initial_units
));
return_ACPI_STATUS
(
AE_OK
);
}
...
...
@@ -681,7 +681,7 @@ acpi_os_delete_semaphore(
if
(
!
sem
)
return_ACPI_STATUS
(
AE_BAD_PARAMETER
);
ACPI_DEBUG_PRINT
((
ACPI_DB_
INFO
,
"Deleting semaphore[%p].
\n
"
,
handle
));
ACPI_DEBUG_PRINT
((
ACPI_DB_
MUTEX
,
"Deleting semaphore[%p].
\n
"
,
handle
));
acpi_os_free
(
sem
);
sem
=
NULL
;
...
...
@@ -716,7 +716,7 @@ acpi_os_wait_semaphore(
if
(
units
>
1
)
return_ACPI_STATUS
(
AE_SUPPORT
);
ACPI_DEBUG_PRINT
((
ACPI_DB_
INFO
,
"Waiting for semaphore[%p|%d|%d]
\n
"
,
handle
,
units
,
timeout
));
ACPI_DEBUG_PRINT
((
ACPI_DB_
MUTEX
,
"Waiting for semaphore[%p|%d|%d]
\n
"
,
handle
,
units
,
timeout
));
if
(
in_atomic
())
timeout
=
0
;
...
...
@@ -740,9 +740,7 @@ acpi_os_wait_semaphore(
* ------------------
*/
case
ACPI_WAIT_FOREVER
:
ret
=
down_interruptible
(
sem
);
if
(
ret
<
0
)
status
=
AE_ERROR
;
down
(
sem
);
break
;
/*
...
...
@@ -763,16 +761,17 @@ acpi_os_wait_semaphore(
}
if
(
ret
!=
0
)
status
=
AE_TIME
;
}
status
=
AE_TIME
;
}
break
;
}
if
(
ACPI_FAILURE
(
status
))
{
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"Failed to acquire semaphore[%p|%d|%d]
\n
"
,
handle
,
units
,
timeout
));
ACPI_DEBUG_PRINT
((
ACPI_DB_ERROR
,
"Failed to acquire semaphore[%p|%d|%d], %s
\n
"
,
handle
,
units
,
timeout
,
acpi_format_exception
(
status
)));
}
else
{
ACPI_DEBUG_PRINT
((
ACPI_DB_
INFO
,
"Acquired semaphore[%p|%d|%d]
\n
"
,
handle
,
units
,
timeout
));
ACPI_DEBUG_PRINT
((
ACPI_DB_
MUTEX
,
"Acquired semaphore[%p|%d|%d]
\n
"
,
handle
,
units
,
timeout
));
}
return_ACPI_STATUS
(
status
);
...
...
@@ -797,7 +796,7 @@ acpi_os_signal_semaphore(
if
(
units
>
1
)
return_ACPI_STATUS
(
AE_SUPPORT
);
ACPI_DEBUG_PRINT
((
ACPI_DB_
INFO
,
"Signaling semaphore[%p|%d]
\n
"
,
handle
,
units
));
ACPI_DEBUG_PRINT
((
ACPI_DB_
MUTEX
,
"Signaling semaphore[%p|%d]
\n
"
,
handle
,
units
));
up
(
sem
);
...
...
drivers/acpi/parser/psparse.c
View file @
60c30d29
/******************************************************************************
*
* Module Name: psparse - Parser top level AML parse routines
* $Revision: 13
4
$
* $Revision: 13
5
$
*
*****************************************************************************/
...
...
@@ -1078,7 +1078,8 @@ acpi_ps_parse_aml (
}
ACPI_DEBUG_PRINT
((
ACPI_DB_PARSE
,
"Completed one call to walk loop, State=%p
\n
"
,
walk_state
));
"Completed one call to walk loop, %s State=%p
\n
"
,
acpi_format_exception
(
status
),
walk_state
));
if
(
status
==
AE_CTRL_TRANSFER
)
{
/*
...
...
@@ -1094,10 +1095,15 @@ acpi_ps_parse_aml (
walk_state
=
acpi_ds_get_current_walk_state
(
thread
);
continue
;
}
else
if
(
status
==
AE_CTRL_TERMINATE
)
{
status
=
AE_OK
;
}
else
if
(
status
!=
AE_OK
)
{
ACPI_REPORT_ERROR
((
"Method execution failed, %s
\n
"
,
acpi_format_exception
(
status
)));
ACPI_DUMP_PATHNAME
(
walk_state
->
method_node
,
"Method pathname: "
,
ACPI_LV_ERROR
,
_COMPONENT
);
}
/* We are done with this walk, move on to the parent if any */
...
...
@@ -1150,11 +1156,6 @@ acpi_ps_parse_aml (
/* On error, delete any return object */
acpi_ut_remove_reference
(
previous_walk_state
->
return_desc
);
ACPI_REPORT_ERROR
((
"Method execution failed, %s
\n
"
,
acpi_format_exception
(
status
)));
ACPI_DUMP_PATHNAME
(
walk_state
->
method_node
,
"Method pathname: "
,
ACPI_LV_ERROR
,
_COMPONENT
);
}
}
...
...
@@ -1165,7 +1166,6 @@ acpi_ps_parse_aml (
else
if
(
previous_walk_state
->
caller_return_desc
)
{
*
(
previous_walk_state
->
caller_return_desc
)
=
previous_walk_state
->
return_desc
;
/* NULL if no return value */
}
else
if
(
previous_walk_state
->
return_desc
)
{
/* Caller doesn't want it, must delete it */
...
...
drivers/acpi/sleep.c
View file @
60c30d29
...
...
@@ -205,8 +205,10 @@ acpi_system_suspend(
break
;
case
ACPI_STATE_S2
:
#ifdef CONFIG_SOFTWARE_SUSPEND
case
ACPI_STATE_S3
:
do_suspend_lowlevel
(
0
);
#endif
break
;
}
local_irq_restore
(
flags
);
...
...
drivers/acpi/utilities/utobject.c
View file @
60c30d29
/******************************************************************************
*
* Module Name: utobject - ACPI object create/delete/size/cache routines
* $Revision: 7
7
$
* $Revision: 7
9
$
*
*****************************************************************************/
...
...
@@ -114,6 +114,59 @@ acpi_ut_create_internal_object_dbg (
}
/*******************************************************************************
*
* FUNCTION: Acpi_ut_create_buffer_object
*
* PARAMETERS: Buffer_size - Size of buffer to be created
*
* RETURN: Pointer to a new Buffer object
*
* DESCRIPTION: Create a fully initialized buffer object
*
******************************************************************************/
acpi_operand_object
*
acpi_ut_create_buffer_object
(
ACPI_SIZE
buffer_size
)
{
acpi_operand_object
*
buffer_desc
;
u8
*
buffer
;
ACPI_FUNCTION_TRACE_U32
(
"Ut_create_buffer_object"
,
buffer_size
);
/*
* Create a new Buffer object
*/
buffer_desc
=
acpi_ut_create_internal_object
(
ACPI_TYPE_BUFFER
);
if
(
!
buffer_desc
)
{
return_PTR
(
NULL
);
}
/* Allocate the actual buffer */
buffer
=
ACPI_MEM_CALLOCATE
(
buffer_size
);
if
(
!
buffer
)
{
ACPI_REPORT_ERROR
((
"Create_buffer: could not allocate size %X
\n
"
,
(
u32
)
buffer_size
));
acpi_ut_remove_reference
(
buffer_desc
);
return_PTR
(
NULL
);
}
/* Complete buffer object initialization */
buffer_desc
->
buffer
.
flags
|=
AOPOBJ_DATA_VALID
;
buffer_desc
->
buffer
.
pointer
=
buffer
;
buffer_desc
->
buffer
.
length
=
(
u32
)
buffer_size
;
/* Return the new buffer descriptor */
return_PTR
(
buffer_desc
);
}
/*******************************************************************************
*
* FUNCTION: Acpi_ut_valid_internal_object
...
...
@@ -135,8 +188,7 @@ acpi_ut_valid_internal_object (
/* Check for a null pointer */
if
(
!
object
)
{
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"**** Null Object Ptr
\n
"
));
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"**** Null Object Ptr
\n
"
));
return
(
FALSE
);
}
...
...
@@ -161,10 +213,17 @@ acpi_ut_valid_internal_object (
"**** Obj %p is a parser obj, not ACPI obj
\n
"
,
object
));
break
;
case
ACPI_DESC_TYPE_CACHED
:
ACPI_DEBUG_PRINT
((
ACPI_DB_ERROR
,
"**** Obj %p has already been released to internal cache
\n
"
,
object
));
break
;
default:
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"**** Obj %p is of unknown type
\n
"
,
object
));
ACPI_DEBUG_PRINT
((
ACPI_DB_ERROR
,
"**** Obj %p has unknown descriptor type %X
\n
"
,
object
,
ACPI_GET_DESCRIPTOR_TYPE
(
object
)));
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment