Comprehensive Rust(Ukrainian) 202412доступні у розділі ”Налагодження” у верхній частині вікна. • Якщо вам цікаво, скористайтеся командою ”ASM” в ”...”, щоб переглянути згенерований асемблерний код. Коли студенти підуть на перерву, заохотьте Наприклад, зробити HVC (виклик гіпервізора), щоб сказати прошивці вимкнути систему: use core::arch::asm; use core::panic::PanicInfo; mod exceptions; const PSCI_SYSTEM_OFF: u32 = 0x84000008; // БЕЗПЕКА: тут використовуються тільки оголошені регістри // і нічого не робиться з пам'яттю. unsafe { 295 asm!("hvc #0", inout("w0") PSCI_SYSTEM_OFF => _, inout("w1") 0 => _, inout("w2") 0 => _, inout("w3") 00 码力 | 396 页 | 1.08 MB | 10 月前3
Comprehensive Rust(Persian ) 202412� � � � � « � � � � � � � � � � � � � � � � � � � � � . • � � � � � � � � � � � � � � � � � � � ” ASM ” � � � � � ”...” � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � . � � � � call ( � � � � � � � � � � � firmware � � � � � � � � � � � � � � � � � � � � � : use core::arch::asm ; use core::panic::PanicInfo ; mod exceptions ; const PSCI_SYSTEM_OFF: u32 = 0x84000008 ; extern SAFETY: this only uses the declared registers and doesn't do anything / / with memory . unsafe } asm!("hvc #0 " , inout("w0") PSCI_SYSTEM_OFF = < _ , 293 inout("w1") 0 = < _ , inout("w2") 0 = < _0 码力 | 393 页 | 987.97 KB | 10 月前3
Comprehensive Rust(English) 202412lots of optimization). These are accessible under ”Debug” at the top. • If you're interested, use ”ASM” under ”...” to see the generated assembly code. As students head into the break, encourage them to example, to make an HVC (hypervisor call) to tell the firmware to power off the system: use core::arch::asm; use core::panic::PanicInfo; mod exceptions; const PSCI_SYSTEM_OFF: u32 = 0x84000008; // SAFETY: // SAFETY: this only uses the declared registers and doesn't do anything // with memory. unsafe { asm!("hvc #0", inout("w0") PSCI_SYSTEM_OFF => _, inout("w1") 0 => _, inout("w2") 0 => _, inout("w3") 00 码力 | 382 页 | 1.00 MB | 10 月前3
Comprehensive Rust ?lots of optimization). These are accessible under ”Debug” at the top. • If you're interested, use ”ASM” under ”...” to see the generated assembly code. As students head into the break, encourage them to example, to make an HVC (hypervisor call) to tell the firmware to power off the system: use core::arch::asm; use core::panic::PanicInfo; mod exceptions; const PSCI_SYSTEM_OFF: u32 = 0x84000008; extern "C" // SAFETY: this only uses the declared registers and doesn't do anything // with memory. unsafe { asm!("hvc #0", inout("w0") PSCI_SYSTEM_OFF => _, inout("w1") 0 => _, inout("w2") 0 => _, inout("w3") 00 码力 | 378 页 | 1009.46 KB | 1 年前3
2021-11-22 - Rust CTCFT - Rust for Linuxfeature(core_panic) feature(dispatch_from_dyn) feature(doc_cfg) feature(generic_associated_types) feature(global_asm) feature(ptr_metadata) feature(receiver_trait) feature(unsize) Language Library Tooling Pinning:0 码力 | 53 页 | 332.50 KB | 9 月前3
Comprehensive Rust(简体中文) 202412具有两个用于生成代码的主要“配置文件”:调试(进行额外运行时检查、较少优化)和发布(较 少运行时检查,进行大量优化)。可以在顶部的”Debug” 下访问这些内容。 • 如果感兴趣,您可以使用 ”...” 下的 ”ASM” 查看生成的汇编代码。 As students head into the break, encourage them to open up the playground and experiment 有时,如果无法通过 Rust 代码实现某些操作,我们就需要使用汇编来解决。例如,如需发出 HVC (Hypervisor 调用)来指示固件关闭系统,请使用以下命令: use core::arch::asm; use core::panic::PanicInfo; mod exceptions; const PSCI_SYSTEM_OFF: u32 = 0x84000008; extern "C" // SAFETY: this only uses the declared registers and doesn't do anything // with memory. unsafe { asm!("hvc #0", inout("w0") PSCI_SYSTEM_OFF => _, inout("w1") 0 => _, inout("w2") 0 => _, inout("w3") 00 码力 | 359 页 | 1.33 MB | 10 月前3
Comprehensive Rust(Español) 202412acceder a ellos haciendo clic en ”Debug”, en la parte superior. • Si te interesa, utiliza la opción ”ASM” en ”...” para ver el código de ensamblado que se ha generado. Cuando sea la hora del descanso, anima example, to make an HVC (hypervisor call) to tell the firmware to power off the system: use core::arch::asm; use core::panic::PanicInfo; mod exceptions; const PSCI_SYSTEM_OFF: u32 = 0x84000008; extern "C" // SAFETY: this only uses the declared registers and doesn't do anything // with memory. unsafe { asm!("hvc #0", inout("w0") PSCI_SYSTEM_OFF => _, 289 inout("w1") 0 => _, inout("w2") 0 => _, inout("w3")0 码力 | 389 页 | 1.04 MB | 10 月前3
Comprehensive Rust(繁体中文)有兩個主要的「設定檔」可產生程式碼,分別是「Debug」(加強執行階段檢查,最佳化程度較低) 和「Release」(減少執行階段檢查,大規模最佳化)。這些設定檔位於頂端的「Debug」下方。 • 感興趣的話,不妨點選「...」下的「ASM」查看產生的組語程式碼。 學員準備休息時,請鼓勵他們開啟 Playground 略微試驗一下。在剩餘的課堂時間,建議他們持續開啟 Playground 分頁嘗試操作。如果學生程度較高,想進一步瞭解 S。 53.2 行內組語 有時候,我們需要使用組語,才能執行 Rust 程式碼無法執行的作業。舉例來說,如要發出 HVC (管理程序 呼叫) 指示韌體關閉系統: use core::arch::asm; use core::panic::PanicInfo; mod exceptions; const PSCI_SYSTEM_OFF: u32 = 0x84000008; extern "C" Safe because this only uses the declared registers and doesn't do // anything with memory. unsafe { asm!("hvc #0", inout("w0") PSCI_SYSTEM_OFF => _, inout("w1") 0 => _, inout("w2") 0 => _, inout("w3") 00 码力 | 358 页 | 1.41 MB | 10 月前3
Comprehensive Rust(Português do Brasil) 202412muita otimização). Estes são acessíveis em ”Debug” no topo. • Se você estiver interessado, use ”ASM” em ”...” para ver o código assembly gerado. Conforme os alunos se dirigem para o intervalo, incentive-os chamada HVC (hypervisor call) para informar ao firmware para desligar o sistema: use core::arch::asm; use core::panic::PanicInfo; mod exceptions; const PSCI_SYSTEM_OFF: u32 = 0x84000008; extern "C" // SEGURANÇA: isso só usa os registradores declarados e não faz // nada com a memória. unsafe { asm!("hvc #0", inout("w0") PSCI_SYSTEM_OFF => _, inout("w1") 0 => _, inout("w2") 0 => _, inout("w3") 00 码力 | 389 页 | 1.05 MB | 10 月前3
Comprehensive Rust(繁体中文) 202406有兩個主要的「設定檔」可產生程式碼,分別是「Debug」(加強執行階段檢查,最佳化程度較低) 和「Release」(減少執行階段檢查,大規模最佳化)。這些設定檔位於頂端的「Debug」下方。 • 感興趣的話,不妨點選「...」下的「ASM」查看產生的組語程式碼。 學員準備休息時,請鼓勵他們開啟 Playground 略微試驗一下。在剩餘的課堂時間,建議他們持續開啟 Playground 分頁嘗試操作。如果學生程度較高,想進一步瞭解 S。 53.2 行內組語 有時候,我們需要使用組語,才能執行 Rust 程式碼無法執行的作業。舉例來說,如要發出 HVC (管理程序 呼叫) 指示韌體關閉系統: use core::arch::asm; use core::panic::PanicInfo; mod exceptions; const PSCI_SYSTEM_OFF: u32 = 0x84000008; extern "C" Safe because this only uses the declared registers and doesn't do // anything with memory. unsafe { asm!("hvc #0", inout("w0") PSCI_SYSTEM_OFF => _, inout("w1") 0 => _, inout("w2") 0 => _, inout("w3") 00 码力 | 356 页 | 1.41 MB | 1 年前3
共 14 条
- 1
- 2













