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
387cd41e
Unverified
Commit
387cd41e
authored
7 years ago
by
Connor Wood
Browse files
Options
Downloads
Patches
Plain Diff
Implemented ACPI table
parent
687f991a
No related branches found
No related tags found
1 merge request
!36
HPET Driver
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/acpi/hpet.rs
+39
-0
39 additions, 0 deletions
src/acpi/hpet.rs
src/acpi/mod.rs
+4
-0
4 additions, 0 deletions
src/acpi/mod.rs
with
43 additions
and
0 deletions
src/acpi/hpet.rs
0 → 100644
+
39
−
0
View file @
387cd41e
use
core
::{
mem
,
ptr
};
use
super
::
sdt
::
Sdt
;
#[repr(packed)]
#[derive(Clone,
Copy,
Debug,
Default)]
pub
struct
GenericAddressStructure
{
address_space
:
u8
,
bit_width
:
u8
,
bit_offset
:
u8
,
access_size
:
u8
,
address
:
u64
,
}
#[repr(packed)]
#[derive(Debug)]
pub
struct
Hpet
{
pub
header
:
Sdt
,
pub
hw_rev_id
:
u8
,
pub
comparator_descriptor
:
u8
,
pub
pci_vendor_id
:
u16
,
pub
base_address
:
GenericAddressStructure
,
pub
hpet_number
:
u8
,
pub
min_periodic_clk_tick
:
u16
,
pub
oem_attribute
:
u8
}
impl
Hpet
{
pub
fn
new
(
sdt
:
&
'static
Sdt
)
->
Option
<
Hpet
>
{
if
&
sdt
.signature
==
b"HPET"
&&
sdt
.length
as
usize
>=
mem
::
size_of
::
<
Hpet
>
()
{
Some
(
unsafe
{
ptr
::
read
((
sdt
as
*
const
Sdt
)
as
*
const
Hpet
)
})
}
else
{
None
}
}
}
This diff is collapsed.
Click to expand it.
src/acpi/mod.rs
+
4
−
0
View file @
387cd41e
...
@@ -18,9 +18,11 @@ use self::madt::{Madt, MadtEntry};
...
@@ -18,9 +18,11 @@ use self::madt::{Madt, MadtEntry};
use
self
::
rsdt
::
Rsdt
;
use
self
::
rsdt
::
Rsdt
;
use
self
::
sdt
::
Sdt
;
use
self
::
sdt
::
Sdt
;
use
self
::
xsdt
::
Xsdt
;
use
self
::
xsdt
::
Xsdt
;
use
self
::
hpet
::
Hpet
;
use
self
::
aml
::{
is_aml_table
,
parse_aml_table
,
AmlNamespace
,
AmlError
};
use
self
::
aml
::{
is_aml_table
,
parse_aml_table
,
AmlNamespace
,
AmlError
};
mod
hpet
;
mod
dmar
;
mod
dmar
;
mod
fadt
;
mod
fadt
;
mod
madt
;
mod
madt
;
...
@@ -195,6 +197,8 @@ fn parse_sdt(sdt: &'static Sdt, active_table: &mut ActivePageTable) {
...
@@ -195,6 +197,8 @@ fn parse_sdt(sdt: &'static Sdt, active_table: &mut ActivePageTable) {
_
=>
()
_
=>
()
}
}
}
}
}
else
if
let
Some
(
hpet
)
=
Hpet
::
new
(
sdt
)
{
println!
(
": {:#?}"
,
hpet
);
}
else
if
is_aml_table
(
sdt
)
{
}
else
if
is_aml_table
(
sdt
)
{
ACPI_TABLE
.lock
()
.namespace
=
match
parse_aml_table
(
sdt
)
{
ACPI_TABLE
.lock
()
.namespace
=
match
parse_aml_table
(
sdt
)
{
Ok
(
res
)
=>
{
Ok
(
res
)
=>
{
...
...
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