Files
DragonOS/build-scripts/kernel_build/src/cfiles/arch/riscv64.rs
linfeng 1485456bf3 refacotr: remove all c files (#1131)
* refacotr: remove all c files

Use Rust to implement the symbol table generator.
Delete unused header files and c files
Adjust the makefile in the debug directory

Signed-off-by: Godones <chenlinfeng25@outlook.com>

* fix: remove extern "C" rs_* functions

move gen_kallsyms.rs to build-scripts

Signed-off-by: Godones <chenlinfeng25@outlook.com>
2025-04-14 09:56:14 +08:00

27 lines
804 B
Rust
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

use super::CFilesArch;
use std::{collections::HashSet, path::PathBuf};
pub(super) struct RiscV64CFilesArch;
impl CFilesArch for RiscV64CFilesArch {
fn setup_defines(&self, c: &mut cc::Build) {
c.define("__riscv64__", None);
c.define("__riscv", None);
}
fn setup_files(&self, _c: &mut cc::Build, files: &mut HashSet<PathBuf>) {
files.insert(PathBuf::from("src/arch/riscv64/asm/head.S"));
}
fn setup_global_flags(&self, c: &mut cc::Build) {
// 在这里设置编译器不然的话vscode的rust-analyzer会报错
c.compiler("riscv64-unknown-elf-gcc");
// // c.flag("-march=rv64imafdc");
// c.no_default_flags(true);
c.flag("-mcmodel=medany");
c.flag("-mabi=lp64d");
c.flag("-march=rv64gc");
}
}