diff --git a/main/os/task/processor/fn.current_kstack_top.html b/main/os/task/processor/fn.current_kstack_top.html index 617d01c0..48201b44 100644 --- a/main/os/task/processor/fn.current_kstack_top.html +++ b/main/os/task/processor/fn.current_kstack_top.html @@ -1 +1 @@ -current_kstack_top in os::task::processor - Rust
pub fn current_kstack_top() -> usize
\ No newline at end of file +current_kstack_top in os::task::processor - Rust
pub fn current_kstack_top() -> usize
\ No newline at end of file diff --git a/main/os/task/processor/fn.current_process.html b/main/os/task/processor/fn.current_process.html index d058ae5a..74c5419f 100644 --- a/main/os/task/processor/fn.current_process.html +++ b/main/os/task/processor/fn.current_process.html @@ -1 +1 @@ -current_process in os::task::processor - Rust

Function os::task::processor::current_process

source ·
pub fn current_process() -> Arc<ProcessControlBlock>
\ No newline at end of file +current_process in os::task::processor - Rust

Function os::task::processor::current_process

source ·
pub fn current_process() -> Arc<ProcessControlBlock>
\ No newline at end of file diff --git a/main/os/task/processor/fn.current_task.html b/main/os/task/processor/fn.current_task.html index e852ac66..6822fc3a 100644 --- a/main/os/task/processor/fn.current_task.html +++ b/main/os/task/processor/fn.current_task.html @@ -1 +1 @@ -current_task in os::task::processor - Rust

Function os::task::processor::current_task

source ·
pub fn current_task() -> Option<Arc<TaskControlBlock>>
\ No newline at end of file +current_task in os::task::processor - Rust

Function os::task::processor::current_task

source ·
pub fn current_task() -> Option<Arc<TaskControlBlock>>
\ No newline at end of file diff --git a/main/os/task/processor/fn.current_trap_cx.html b/main/os/task/processor/fn.current_trap_cx.html index 0407270a..6d47a22b 100644 --- a/main/os/task/processor/fn.current_trap_cx.html +++ b/main/os/task/processor/fn.current_trap_cx.html @@ -1 +1 @@ -current_trap_cx in os::task::processor - Rust

Function os::task::processor::current_trap_cx

source ·
pub fn current_trap_cx() -> &'static mut TrapContext
\ No newline at end of file +current_trap_cx in os::task::processor - Rust

Function os::task::processor::current_trap_cx

source ·
pub fn current_trap_cx() -> &'static mut TrapContext
\ No newline at end of file diff --git a/main/os/task/processor/fn.current_trap_cx_user_va.html b/main/os/task/processor/fn.current_trap_cx_user_va.html index 0d605957..d8ae5a10 100644 --- a/main/os/task/processor/fn.current_trap_cx_user_va.html +++ b/main/os/task/processor/fn.current_trap_cx_user_va.html @@ -1 +1 @@ -current_trap_cx_user_va in os::task::processor - Rust
pub fn current_trap_cx_user_va() -> usize
\ No newline at end of file +current_trap_cx_user_va in os::task::processor - Rust
pub fn current_trap_cx_user_va() -> usize
\ No newline at end of file diff --git a/main/os/task/processor/fn.current_user_token.html b/main/os/task/processor/fn.current_user_token.html index dc7d7cbf..d5f5f168 100644 --- a/main/os/task/processor/fn.current_user_token.html +++ b/main/os/task/processor/fn.current_user_token.html @@ -1 +1 @@ -current_user_token in os::task::processor - Rust
pub fn current_user_token() -> usize
\ No newline at end of file +current_user_token in os::task::processor - Rust
pub fn current_user_token() -> usize
\ No newline at end of file diff --git a/main/os/task/processor/fn.run_tasks.html b/main/os/task/processor/fn.run_tasks.html index f781ce4f..b783224e 100644 --- a/main/os/task/processor/fn.run_tasks.html +++ b/main/os/task/processor/fn.run_tasks.html @@ -1 +1 @@ -run_tasks in os::task::processor - Rust

Function os::task::processor::run_tasks

source ·
pub fn run_tasks()
\ No newline at end of file +run_tasks in os::task::processor - Rust

Function os::task::processor::run_tasks

source ·
pub fn run_tasks()
\ No newline at end of file diff --git a/main/os/task/processor/fn.schedule.html b/main/os/task/processor/fn.schedule.html index a825e009..b851e980 100644 --- a/main/os/task/processor/fn.schedule.html +++ b/main/os/task/processor/fn.schedule.html @@ -1 +1 @@ -schedule in os::task::processor - Rust

Function os::task::processor::schedule

source ·
pub fn schedule(switched_task_cx_ptr: *mut TaskContext)
\ No newline at end of file +schedule in os::task::processor - Rust

Function os::task::processor::schedule

source ·
pub fn schedule(switched_task_cx_ptr: *mut TaskContext)
\ No newline at end of file diff --git a/main/os/task/processor/fn.take_current_task.html b/main/os/task/processor/fn.take_current_task.html index c34505e1..bf9b037f 100644 --- a/main/os/task/processor/fn.take_current_task.html +++ b/main/os/task/processor/fn.take_current_task.html @@ -1 +1 @@ -take_current_task in os::task::processor - Rust
pub fn take_current_task() -> Option<Arc<TaskControlBlock>>
\ No newline at end of file +take_current_task in os::task::processor - Rust
pub fn take_current_task() -> Option<Arc<TaskControlBlock>>
\ No newline at end of file diff --git a/main/os/task/processor/index.html b/main/os/task/processor/index.html index db81b8c7..23c21027 100644 --- a/main/os/task/processor/index.html +++ b/main/os/task/processor/index.html @@ -1 +1 @@ -os::task::processor - Rust

Module os::task::processor

source ·

Structs

Functions

\ No newline at end of file +os::task::processor - Rust

Module os::task::processor

source ·

Structs

Functions

\ No newline at end of file diff --git a/main/os/task/processor/struct.PROCESSOR.html b/main/os/task/processor/struct.PROCESSOR.html index 765a50d3..5faf57a2 100644 --- a/main/os/task/processor/struct.PROCESSOR.html +++ b/main/os/task/processor/struct.PROCESSOR.html @@ -1,8 +1,8 @@ -PROCESSOR in os::task::processor - Rust

Struct os::task::processor::PROCESSOR

source ·
pub struct PROCESSOR {
+PROCESSOR in os::task::processor - Rust

Struct os::task::processor::PROCESSOR

source ·
pub struct PROCESSOR {
     __private_field: (),
 }

Fields§

§__private_field: ()

Methods from Deref<Target = UPIntrFreeCell<Processor>>§

source

pub fn exclusive_access(&self) -> UPIntrRefMut<'_, T>

Panic if the data has been borrowed.

source

pub fn exclusive_session<F, V>(&self, f: F) -> Vwhere - F: FnOnce(&mut T) -> V,

Trait Implementations§

source§

impl Deref for PROCESSOR

§

type Target = UPIntrFreeCell<Processor>

The resulting type after dereferencing.
source§

fn deref(&self) -> &UPIntrFreeCell<Processor>

Dereferences the value.
source§

impl LazyStatic for PROCESSOR

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + F: FnOnce(&mut T) -> V,

Trait Implementations§

source§

impl Deref for PROCESSOR

§

type Target = UPIntrFreeCell<Processor>

The resulting type after dereferencing.
source§

fn deref(&self) -> &UPIntrFreeCell<Processor>

Dereferences the value.
source§

impl LazyStatic for PROCESSOR

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Az for T

source§

fn az<Dst>(self) -> Dstwhere T: Cast<Dst>,

Casts the value.
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere diff --git a/main/os/task/processor/struct.Processor.html b/main/os/task/processor/struct.Processor.html index 0a712d87..39b1dd09 100644 --- a/main/os/task/processor/struct.Processor.html +++ b/main/os/task/processor/struct.Processor.html @@ -1,7 +1,7 @@ -Processor in os::task::processor - Rust

Struct os::task::processor::Processor

source ·
pub struct Processor {
+Processor in os::task::processor - Rust

Struct os::task::processor::Processor

source ·
pub struct Processor {
     current: Option<Arc<TaskControlBlock>>,
     idle_task_cx: TaskContext,
-}

Fields§

§current: Option<Arc<TaskControlBlock>>§idle_task_cx: TaskContext

Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere +}

Fields§

§current: Option<Arc<TaskControlBlock>>§idle_task_cx: TaskContext

Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Az for T

source§

fn az<Dst>(self) -> Dstwhere T: Cast<Dst>,

Casts the value.
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere diff --git a/main/src/os/task/processor.rs.html b/main/src/os/task/processor.rs.html index 8a32ed0e..11038d3c 100644 --- a/main/src/os/task/processor.rs.html +++ b/main/src/os/task/processor.rs.html @@ -101,12 +101,21 @@ 101 102 103 +104 +105 +106 +107 +108 +109 +110 +111

use super::__switch;
 use super::{fetch_task, TaskStatus};
 use super::{ProcessControlBlock, TaskContext, TaskControlBlock};
 use crate::sync::UPIntrFreeCell;
 use crate::trap::TrapContext;
 use alloc::sync::Arc;
+use core::arch::asm;
 use lazy_static::*;
 
 pub struct Processor {
@@ -194,8 +203,15 @@
 }
 
 pub fn current_kstack_top() -> usize {
-    current_task().unwrap().kstack.get_top()
-}
+    if let Some(task) = current_task() {
+        task.kstack.get_top()
+    } else {
+        let mut boot_stack_top;
+        unsafe { asm!("la {},boot_stack_top",out(reg) boot_stack_top) };
+        boot_stack_top
+    }
+    // current_task().unwrap().kstack.get_top()
+}
 
 pub fn schedule(switched_task_cx_ptr: *mut TaskContext) {
     let idle_task_cx_ptr =