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>
This commit is contained in:
linfeng
2025-04-14 09:56:14 +08:00
committed by GitHub
parent 2d06264d79
commit 1485456bf3
86 changed files with 309 additions and 4009 deletions

View File

@ -1,8 +1,5 @@
use std::{collections::HashSet, path::PathBuf};
use crate::{constant::ARCH_DIR_RISCV64, utils::FileUtils};
use super::CFilesArch;
use std::{collections::HashSet, path::PathBuf};
pub(super) struct RiscV64CFilesArch;
@ -12,18 +9,8 @@ impl CFilesArch for RiscV64CFilesArch {
c.define("__riscv", None);
}
fn setup_global_include_dir(&self, include_dirs: &mut HashSet<PathBuf>) {
include_dirs.insert("src/arch/riscv64/include".into());
}
fn setup_files(&self, _c: &mut cc::Build, files: &mut HashSet<PathBuf>) {
files.insert(PathBuf::from("src/arch/riscv64/asm/head.S"));
FileUtils::list_all_files(&arch_path("asm"), Some("c"), true)
.into_iter()
.for_each(|f| {
files.insert(f);
});
}
fn setup_global_flags(&self, c: &mut cc::Build) {
@ -37,7 +24,3 @@ impl CFilesArch for RiscV64CFilesArch {
c.flag("-march=rv64gc");
}
}
fn arch_path(relative_path: &str) -> PathBuf {
PathBuf::from(format!("{}/{}", ARCH_DIR_RISCV64, relative_path))
}