prepare for format

This commit is contained in:
bunnie 2024-01-14 21:51:11 +08:00
parent a5137e69b1
commit ee6190a12a
22 changed files with 31 additions and 36 deletions

View file

@ -1,5 +1,6 @@
use crate::platform;
use core::arch::asm; use core::arch::asm;
use crate::platform;
// Assembly stubs for entering into the loader, and exiting it. // Assembly stubs for entering into the loader, and exiting it.
// Note: inline constants are not yet stable in Rust: https://github.com/rust-lang/rust/pull/104087 // Note: inline constants are not yet stable in Rust: https://github.com/rust-lang/rust/pull/104087
@ -11,6 +12,7 @@ pub extern "C" fn _start(_kernel_args: usize, loader_sig: usize) {
#[cfg(any(feature = "cramium-soc", feature = "cramium-fpga"))] #[cfg(any(feature = "cramium-soc", feature = "cramium-fpga"))]
let _kernel_args = _start as *const usize as usize + platform::KERNEL_OFFSET; let _kernel_args = _start as *const usize as usize + platform::KERNEL_OFFSET;
unsafe { unsafe {
#[rustfmt::skip]
asm! ( asm! (
"li t0, 0xffffffff", "li t0, 0xffffffff",
"csrw mideleg, t0", "csrw mideleg, t0",
@ -53,6 +55,7 @@ pub extern "C" fn _start(_kernel_args: usize, loader_sig: usize) {
/// This is only used in debug mode /// This is only used in debug mode
pub extern "C" fn abort() { pub extern "C" fn abort() {
unsafe { unsafe {
#[rustfmt::skip]
asm!( asm!(
"300:", // abort "300:", // abort
"j 300b", "j 300b",
@ -76,6 +79,7 @@ pub extern "C" fn start_kernel(
let debug: usize = if debug_ { 1 } else { 0 }; let debug: usize = if debug_ { 1 } else { 0 };
let resume: usize = if resume_ { 1 } else { 0 }; let resume: usize = if resume_ { 1 } else { 0 };
unsafe { unsafe {
#[rustfmt::skip]
asm! ( asm! (
// these generate redundant mv's but it ensures that the arguments are marked as used // these generate redundant mv's but it ensures that the arguments are marked as used
"mv a0, {args}", "mv a0, {args}",

View file

@ -1,21 +1,13 @@
// DO NOT MAKE EDITS HERE because this file is automatically generated. // DO NOT MAKE EDITS HERE because this file is automatically @generated.
// The order of these modules affects the link order in the loader, which is referred to in the graphics engine. // The order of these modules affects the link order in the loader, which is referred to in the graphics engine.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
pub mod emoji; pub mod emoji;
pub mod zh; pub mod zh;
pub mod ja; pub mod ja;
pub mod kr; pub mod kr;
pub mod bold; pub mod bold;
pub mod mono; pub mod mono;
pub mod regular; pub mod regular;
pub mod tall; pub mod tall;
pub mod small;
pub mod small;

View file

@ -1,4 +1,4 @@
// DO NOT MAKE EDITS HERE because this file is automatically generated. // DO NOT MAKE EDITS HERE because this file is automatically @generated.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
// This code includes encoded bitmaps of glyphs from the Chicago typeface which // This code includes encoded bitmaps of glyphs from the Chicago typeface which

View file

@ -1,4 +1,4 @@
// DO NOT MAKE EDITS HERE because this file is automatically generated. // DO NOT MAKE EDITS HERE because this file is automatically @generated.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
// This code includes bitmap glyphs extracted from a PNG sprite sheet document created // This code includes bitmap glyphs extracted from a PNG sprite sheet document created

View file

@ -1,4 +1,4 @@
// DO NOT MAKE EDITS HERE because this file is automatically generated. // DO NOT MAKE EDITS HERE because this file is automatically @generated.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
// This code includes bitmap glyphs extracted from a PNG sprite sheet document created // This code includes bitmap glyphs extracted from a PNG sprite sheet document created

View file

@ -1,4 +1,4 @@
// DO NOT MAKE EDITS HERE because this file is automatically generated. // DO NOT MAKE EDITS HERE because this file is automatically @generated.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
// This code includes bitmap glyphs extracted from a PNG sprite sheet document created // This code includes bitmap glyphs extracted from a PNG sprite sheet document created

View file

@ -1,4 +1,4 @@
// DO NOT MAKE EDITS HERE because this file is automatically generated. // DO NOT MAKE EDITS HERE because this file is automatically @generated.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
// This code includes encoded bitmaps of glyphs from the Courier typeface which // This code includes encoded bitmaps of glyphs from the Courier typeface which

View file

@ -1,4 +1,4 @@
// DO NOT MAKE EDITS HERE because this file is automatically generated. // DO NOT MAKE EDITS HERE because this file is automatically @generated.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
// This code includes encoded bitmaps of glyphs from the Geneva typeface which // This code includes encoded bitmaps of glyphs from the Geneva typeface which

View file

@ -1,4 +1,4 @@
// DO NOT MAKE EDITS HERE because this file is automatically generated. // DO NOT MAKE EDITS HERE because this file is automatically @generated.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
// This code includes encoded bitmaps of glyphs from the Geneva typeface which // This code includes encoded bitmaps of glyphs from the Geneva typeface which

View file

@ -1,4 +1,4 @@
// DO NOT MAKE EDITS HERE because this file is automatically generated. // DO NOT MAKE EDITS HERE because this file is automatically @generated.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
// This code includes encoded bitmaps of glyphs from the Helvetica typeface. // This code includes encoded bitmaps of glyphs from the Helvetica typeface.

View file

@ -1,4 +1,4 @@
// DO NOT MAKE EDITS HERE because this file is automatically generated. // DO NOT MAKE EDITS HERE because this file is automatically @generated.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
// This code includes bitmap glyphs extracted from a PNG sprite sheet document created // This code includes bitmap glyphs extracted from a PNG sprite sheet document created

View file

@ -100,7 +100,7 @@ Usage:
` `
// Template with rust source code for a outer structure of a font file // Template with rust source code for a outer structure of a font file
const fontFileTemplate = `// DO NOT MAKE EDITS HERE because this file is automatically generated. const fontFileTemplate = `// DO NOT MAKE EDITS HERE because this file is automatically @generated.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
// //
{{.Font.Legal}} {{.Font.Legal}}
@ -147,7 +147,7 @@ pub const WIDTHS: [u8; {{.GS.WidthsLen}}] = [
{{end}} {{end}}
` `
const loaderFileTemplate = `// DO NOT MAKE EDITS HERE because this file is automatically generated. const loaderFileTemplate = `// DO NOT MAKE EDITS HERE because this file is automatically @generated.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
{{.Font.Legal}} {{.Font.Legal}}
@ -163,14 +163,13 @@ pub static {{.FontName}}_GLYPHS: [u32; {{.GS.GlyphsLen}}] = [
{{.GS.Glyphs}}];{{if .GS.Widths}}{{end}} {{.GS.Glyphs}}];{{if .GS.Widths}}{{end}}
` `
const loadermodTemplate = `// DO NOT MAKE EDITS HERE because this file is automatically generated. const loadermodTemplate = `// DO NOT MAKE EDITS HERE because this file is automatically @generated.
// The order of these modules affects the link order in the loader, which is referred to in the graphics engine. // The order of these modules affects the link order in the loader, which is referred to in the graphics engine.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
{{range $f := .FontDir}} {{range $f := .FontDir}}
pub mod {{$f.Name}}; pub mod {{$f.Name}};{{end}}`
{{end}}`
const fontmapTemplate = `// DO NOT MAKE EDITS HERE because this file is automatically generated. const fontmapTemplate = `// DO NOT MAKE EDITS HERE because this file is automatically @generated.
// The order of these modules affects the link order in the loader, which is referred to in the graphics engine. // The order of these modules affects the link order in the loader, which is referred to in the graphics engine.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
#![allow(dead_code)] #![allow(dead_code)]

View file

@ -1,4 +1,4 @@
// DO NOT MAKE EDITS HERE because this file is automatically generated. // DO NOT MAKE EDITS HERE because this file is automatically @generated.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
// //
// This code includes encoded bitmaps of glyphs from the Chicago typeface which // This code includes encoded bitmaps of glyphs from the Chicago typeface which

View file

@ -1,4 +1,4 @@
// DO NOT MAKE EDITS HERE because this file is automatically generated. // DO NOT MAKE EDITS HERE because this file is automatically @generated.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
// //
// This code includes bitmap glyphs extracted from a PNG sprite sheet document created // This code includes bitmap glyphs extracted from a PNG sprite sheet document created

View file

@ -1,4 +1,4 @@
// DO NOT MAKE EDITS HERE because this file is automatically generated. // DO NOT MAKE EDITS HERE because this file is automatically @generated.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
// //
// This code includes bitmap glyphs extracted from a PNG sprite sheet document created // This code includes bitmap glyphs extracted from a PNG sprite sheet document created

View file

@ -1,4 +1,4 @@
// DO NOT MAKE EDITS HERE because this file is automatically generated. // DO NOT MAKE EDITS HERE because this file is automatically @generated.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
// //
// This code includes bitmap glyphs extracted from a PNG sprite sheet document created // This code includes bitmap glyphs extracted from a PNG sprite sheet document created

View file

@ -1,4 +1,4 @@
// DO NOT MAKE EDITS HERE because this file is automatically generated. // DO NOT MAKE EDITS HERE because this file is automatically @generated.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
// //
// This code includes encoded bitmaps of glyphs from the Courier typeface which // This code includes encoded bitmaps of glyphs from the Courier typeface which

View file

@ -1,4 +1,4 @@
// DO NOT MAKE EDITS HERE because this file is automatically generated. // DO NOT MAKE EDITS HERE because this file is automatically @generated.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
// //
// This code includes encoded bitmaps of glyphs from the Geneva typeface which // This code includes encoded bitmaps of glyphs from the Geneva typeface which

View file

@ -1,4 +1,4 @@
// DO NOT MAKE EDITS HERE because this file is automatically generated. // DO NOT MAKE EDITS HERE because this file is automatically @generated.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
// //
// This code includes encoded bitmaps of glyphs from the Geneva typeface which // This code includes encoded bitmaps of glyphs from the Geneva typeface which

View file

@ -1,4 +1,4 @@
// DO NOT MAKE EDITS HERE because this file is automatically generated. // DO NOT MAKE EDITS HERE because this file is automatically @generated.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
// //
// This code includes encoded bitmaps of glyphs from the Helvetica typeface. // This code includes encoded bitmaps of glyphs from the Helvetica typeface.

View file

@ -1,4 +1,4 @@
// DO NOT MAKE EDITS HERE because this file is automatically generated. // DO NOT MAKE EDITS HERE because this file is automatically @generated.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
// //
// This code includes bitmap glyphs extracted from a PNG sprite sheet document created // This code includes bitmap glyphs extracted from a PNG sprite sheet document created

View file

@ -1,4 +1,4 @@
// DO NOT MAKE EDITS HERE because this file is automatically generated. // DO NOT MAKE EDITS HERE because this file is automatically @generated.
// The order of these modules affects the link order in the loader, which is referred to in the graphics engine. // The order of these modules affects the link order in the loader, which is referred to in the graphics engine.
// To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go // To make changes, see <xous_root>/services/graphics-server/src/blitstr2/codegen/main.go
#![allow(dead_code)] #![allow(dead_code)]