Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
redox-os
kernel
Commits
c6ecf105
Unverified
Commit
c6ecf105
authored
7 years ago
by
Connor Wood
Browse files
Options
Downloads
Patches
Plain Diff
Converted Integer to Buffer
parent
a70b2655
No related branches found
No related tags found
1 merge request
!48
Fully implemented AML parser, some amendments to ACPI infrastructure
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/acpi/aml/namespace.rs
+15
-1
15 additions, 1 deletion
src/acpi/aml/namespace.rs
with
15 additions
and
1 deletion
src/acpi/aml/namespace.rs
+
15
−
1
View file @
c6ecf105
...
@@ -132,6 +132,21 @@ impl AmlValue {
...
@@ -132,6 +132,21 @@ impl AmlValue {
pub
fn
get_as_buffer
(
&
self
)
->
Result
<
Vec
<
u8
>
,
AmlError
>
{
pub
fn
get_as_buffer
(
&
self
)
->
Result
<
Vec
<
u8
>
,
AmlError
>
{
match
*
self
{
match
*
self
{
AmlValue
::
Buffer
(
ref
b
)
=>
Ok
(
b
.clone
()),
AmlValue
::
Buffer
(
ref
b
)
=>
Ok
(
b
.clone
()),
AmlValue
::
Integer
(
ref
i
)
=>
{
let
mut
v
:
Vec
<
u8
>
=
vec!
();
let
mut
i
=
i
.clone
();
while
i
!=
0
{
v
.push
((
i
&
0xFF
)
as
u8
);
i
>>=
8
;
}
while
v
.len
()
<
8
{
v
.push
(
0
);
}
Ok
(
v
)
},
_
=>
Err
(
AmlError
::
AmlValueError
)
_
=>
Err
(
AmlError
::
AmlValueError
)
}
}
}
}
...
@@ -174,7 +189,6 @@ impl Method {
...
@@ -174,7 +189,6 @@ impl Method {
}
}
pub
fn
get_namespace_string
(
current
:
String
,
modifier_v
:
AmlValue
)
->
Result
<
String
,
AmlError
>
{
pub
fn
get_namespace_string
(
current
:
String
,
modifier_v
:
AmlValue
)
->
Result
<
String
,
AmlError
>
{
// TODO: Type error if modifier not string
let
mut
modifier
=
modifier_v
.get_as_string
()
?
;
let
mut
modifier
=
modifier_v
.get_as_string
()
?
;
if
current
.len
()
==
0
{
if
current
.len
()
==
0
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment