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
4f0d66b4
Commit
4f0d66b4
authored
Feb 17, 2003
by
Andy Grover
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ACPI: Add ability to override predefined object values (Ducrot Bruno)
parent
53a56431
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
7 deletions
+63
-7
drivers/acpi/namespace/nsaccess.c
drivers/acpi/namespace/nsaccess.c
+15
-5
drivers/acpi/osl.c
drivers/acpi/osl.c
+41
-0
include/acpi/acpiosxf.h
include/acpi/acpiosxf.h
+7
-2
No files found.
drivers/acpi/namespace/nsaccess.c
View file @
4f0d66b4
...
...
@@ -100,6 +100,16 @@ acpi_ns_root_initialize (void)
* initial value, create the initial value.
*/
if
(
init_val
->
val
)
{
acpi_string
val
;
status
=
acpi_os_predefined_override
(
init_val
,
&
val
);
if
(
ACPI_FAILURE
(
status
))
{
ACPI_DEBUG_PRINT
((
ACPI_DB_ERROR
,
"Could not override predefined %s
\n
"
,
init_val
->
name
));
}
if
(
val
==
NULL
)
val
=
init_val
->
val
;
/*
* Entry requests an initial value, allocate a
* descriptor for it.
...
...
@@ -118,7 +128,7 @@ acpi_ns_root_initialize (void)
switch
(
init_val
->
type
)
{
case
ACPI_TYPE_METHOD
:
obj_desc
->
method
.
param_count
=
(
u8
)
ACPI_STRTOUL
(
init_val
->
val
,
NULL
,
10
);
(
u8
)
ACPI_STRTOUL
(
val
,
NULL
,
10
);
obj_desc
->
common
.
flags
|=
AOPOBJ_DATA_VALID
;
#if defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
...
...
@@ -132,7 +142,7 @@ acpi_ns_root_initialize (void)
case
ACPI_TYPE_INTEGER
:
obj_desc
->
integer
.
value
=
(
acpi_integer
)
ACPI_STRTOUL
(
init_val
->
val
,
NULL
,
10
);
(
acpi_integer
)
ACPI_STRTOUL
(
val
,
NULL
,
10
);
break
;
...
...
@@ -141,8 +151,8 @@ acpi_ns_root_initialize (void)
/*
* Build an object around the static string
*/
obj_desc
->
string
.
length
=
(
u32
)
ACPI_STRLEN
(
init_val
->
val
);
obj_desc
->
string
.
pointer
=
init_val
->
val
;
obj_desc
->
string
.
length
=
(
u32
)
ACPI_STRLEN
(
val
);
obj_desc
->
string
.
pointer
=
val
;
obj_desc
->
common
.
flags
|=
AOPOBJ_STATIC_POINTER
;
break
;
...
...
@@ -151,7 +161,7 @@ acpi_ns_root_initialize (void)
obj_desc
->
mutex
.
node
=
new_node
;
obj_desc
->
mutex
.
sync_level
=
(
u16
)
ACPI_STRTOUL
(
init_val
->
val
,
NULL
,
10
);
(
u16
)
ACPI_STRTOUL
(
val
,
NULL
,
10
);
if
(
ACPI_STRCMP
(
init_val
->
name
,
"_GL_"
)
==
0
)
{
/*
...
...
drivers/acpi/osl.c
View file @
4f0d66b4
...
...
@@ -203,6 +203,22 @@ acpi_os_get_physical_address(void *virt, acpi_physical_address *phys)
return
AE_OK
;
}
static
char
acpi_os_name
[
200
]
=
ACPI_OS_NAME
;
acpi_status
acpi_os_predefined_override
(
const
struct
acpi_predefined_names
*
init_val
,
acpi_string
*
new_val
)
{
if
(
!
init_val
||
!
new_val
)
return
AE_BAD_PARAMETER
;
*
new_val
=
NULL
;
if
(
!
memcmp
(
init_val
->
name
,
"_OS_"
,
4
))
*
new_val
=
acpi_os_name
;
return
AE_OK
;
}
acpi_status
acpi_os_table_override
(
struct
acpi_table_header
*
existing_table
,
struct
acpi_table_header
**
new_table
)
...
...
@@ -854,3 +870,28 @@ acpi_os_signal (
return
AE_OK
;
}
int
__init
acpi_os_name_setup
(
char
*
str
)
{
char
*
p
=
acpi_os_name
;
int
count
=
199
;
if
(
!
str
||
!*
str
)
return
0
;
for
(;
count
--
&&
str
&&
*
str
;
str
++
)
{
if
(
isalnum
(
*
str
)
||
*
str
==
' '
)
*
p
++
=
*
str
;
else
if
(
*
str
==
'\''
||
*
str
==
'"'
)
continue
;
else
break
;
}
*
p
=
0
;
return
1
;
}
__setup
(
"acpi_os_name="
,
acpi_os_name_setup
);
include/acpi/acpiosxf.h
View file @
4f0d66b4
...
...
@@ -29,8 +29,8 @@
#ifndef __ACPIOSXF_H__
#define __ACPIOSXF_H__
#include
<acpi/platform/acenv.h>
#include
<acpi/actypes.h>
#include
"platform/acenv.h"
#include
"actypes.h"
/* Priorities for acpi_os_queue_for_execution */
...
...
@@ -92,6 +92,11 @@ acpi_os_get_root_pointer (
u32
flags
,
struct
acpi_pointer
*
address
);
acpi_status
acpi_os_predefined_override
(
const
struct
acpi_predefined_names
*
init_val
,
acpi_string
*
new_val
);
acpi_status
acpi_os_table_override
(
struct
acpi_table_header
*
existing_table
,
...
...
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