mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-19 21:36:30 +00:00
bugfix: 修复smp启动的时候,损坏0号核心的idle进程的内核栈的问题 (#711)
--------- Co-authored-by: longjin <longjin@DragonOS.org> Co-authored-by: heyicong <heyicong@dragonos.org>
This commit is contained in:
@ -337,6 +337,7 @@ impl TextuiBuf<'_> {
|
||||
return self.guard.as_mut().unwrap().as_mut();
|
||||
}
|
||||
}
|
||||
|
||||
pub fn put_color_in_pixel(&mut self, color: u32, index: usize) {
|
||||
let index = index as isize;
|
||||
match self.bit_depth {
|
||||
@ -363,7 +364,7 @@ impl TextuiBuf<'_> {
|
||||
};
|
||||
}
|
||||
_ => {
|
||||
panic!("不支持的位深度!")
|
||||
panic!("bidepth unsupported!")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -373,6 +374,7 @@ impl TextuiBuf<'_> {
|
||||
pub fn get_index_by_x_y(x: usize, y: usize) -> usize {
|
||||
textui_framework().metadata.read().buf_info().width() as usize * y + x
|
||||
}
|
||||
|
||||
pub fn get_start_index_by_lineid_lineindex(lineid: LineId, lineindex: LineIndex) -> usize {
|
||||
// x 左上角列像素点位置
|
||||
// y 左上角行像素点位置
|
||||
@ -622,7 +624,6 @@ impl TextuiWindow {
|
||||
/// - vline_id 要刷新的虚拟行号
|
||||
/// - start 起始字符号
|
||||
/// - count 要刷新的字符数量
|
||||
|
||||
fn textui_refresh_characters(
|
||||
&mut self,
|
||||
vline_id: LineId,
|
||||
@ -708,7 +709,6 @@ impl TextuiWindow {
|
||||
/// ## 参数
|
||||
/// - window 窗口结构体
|
||||
/// - vline_id 虚拟行号
|
||||
|
||||
fn textui_new_line(&mut self) -> Result<i32, SystemError> {
|
||||
// todo: 支持在两个虚拟行之间插入一个新行
|
||||
let actual_line_sum = textui_framework().actual_line.load(Ordering::SeqCst);
|
||||
@ -753,7 +753,6 @@ impl TextuiWindow {
|
||||
/// ## 参数
|
||||
/// - window
|
||||
/// - character
|
||||
|
||||
fn true_textui_putchar_window(
|
||||
&mut self,
|
||||
character: char,
|
||||
|
@ -371,6 +371,11 @@ impl<T> RwLock<T> {
|
||||
pub unsafe fn get_mut(&mut self) -> &mut T {
|
||||
unsafe { &mut *self.data.get() }
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub unsafe fn force_get_ref(&self) -> &T {
|
||||
unsafe { &*self.data.get() }
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Default> Default for RwLock<T> {
|
||||
|
Reference in New Issue
Block a user