add switches for smaller memory targets for the loader side

This commit is contained in:
bunnie 2024-01-29 03:32:12 +08:00
parent c20f6af52d
commit 2cb295ccf0

View file

@ -39,8 +39,8 @@ func RenderFontmapTemplate(fd []FontMap, small_fd []FontMap) string {
context := fontmapTemplateContext{fd, small_fd} context := fontmapTemplateContext{fd, small_fd}
return renderTemplate(fontmapTemplate, "fontmap", context) return renderTemplate(fontmapTemplate, "fontmap", context)
} }
func RenderLoadermodTemplate(fd []FontSummary) string { func RenderLoadermodTemplate(fd []FontSummary, small_fd []FontSummary) string {
context := loadermodTemplateContext{fd} context := loadermodTemplateContext{fd, small_fd}
return renderTemplate(loadermodTemplate, "loadermod", context) return renderTemplate(loadermodTemplate, "loadermod", context)
} }
@ -71,7 +71,8 @@ type fontmapTemplateContext struct {
SmallFontDir []FontMap SmallFontDir []FontMap
} }
type loadermodTemplateContext struct { type loadermodTemplateContext struct {
FontDir []FontSummary FontDir []FontSummary
SmallFontDir []FontSummary
} }
// Return a string from rendering the given template and context data // Return a string from rendering the given template and context data
@ -171,7 +172,12 @@ const loadermodTemplate = `#![cfg_attr(rustfmt, rustfmt_skip)]
// 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}};{{end}}` #[cfg(not(feature = "cramium-soc"))]
pub mod {{$f.Name}};{{end}}
{{range $f := .SmallFontDir}}
#[cfg(feature = "cramium-soc")]
pub mod {{$f.Name}};{{end}}
`
const fontmapTemplate = `#![cfg_attr(rustfmt, rustfmt_skip)] const fontmapTemplate = `#![cfg_attr(rustfmt, rustfmt_skip)]
// DO NOT MAKE EDITS HERE because this file is automatically generated. // DO NOT MAKE EDITS HERE because this file is automatically generated.