Every context has an ID
This commit is contained in:
@@ -27,11 +27,17 @@ pub struct AmlExecutionContext {
|
||||
pub local_vars: [AmlValue; 8],
|
||||
pub arg_vars: [AmlValue; 8],
|
||||
pub state: ExecutionState,
|
||||
pub namespace_delta: Vec<String>
|
||||
pub namespace_delta: Vec<String>,
|
||||
pub ctx_id: u64
|
||||
}
|
||||
|
||||
impl AmlExecutionContext {
|
||||
pub fn new(scope: String) -> AmlExecutionContext {
|
||||
let mut idptr = ACPI_TABLE.next_ctx.write();
|
||||
let id: u64 = *idptr;
|
||||
|
||||
*idptr += 1;
|
||||
|
||||
AmlExecutionContext {
|
||||
scope: scope,
|
||||
local_vars: [AmlValue::Uninitialized,
|
||||
@@ -51,7 +57,8 @@ impl AmlExecutionContext {
|
||||
AmlValue::Uninitialized,
|
||||
AmlValue::Uninitialized],
|
||||
state: ExecutionState::EXECUTING,
|
||||
namespace_delta: vec!()
|
||||
namespace_delta: vec!(),
|
||||
ctx_id: id
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -315,13 +315,15 @@ pub fn set_global_s_state(state: u8) {
|
||||
pub struct Acpi {
|
||||
pub fadt: RwLock<Option<Fadt>>,
|
||||
pub namespace: RwLock<Option<BTreeMap<String, AmlValue>>>,
|
||||
pub hpet: RwLock<Option<Hpet>>
|
||||
pub hpet: RwLock<Option<Hpet>>,
|
||||
pub next_ctx: RwLock<u64>,
|
||||
}
|
||||
|
||||
pub static ACPI_TABLE: Acpi = Acpi {
|
||||
fadt: RwLock::new(None),
|
||||
namespace: RwLock::new(None),
|
||||
hpet: RwLock::new(None)
|
||||
hpet: RwLock::new(None),
|
||||
next_ctx: RwLock::new(0),
|
||||
};
|
||||
|
||||
/// RSDP
|
||||
|
||||
Reference in New Issue
Block a user