diff --git a/Cargo.toml b/Cargo.toml index 22edc44..bf5ca36 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "axvcpu" authors = ["aarkegz "] -version = "0.2.1" +version = "0.3.0" edition = "2024" categories = ["virtualization", "no-std"] description = "Virtual CPU abstraction for ArceOS hypervisor" @@ -10,8 +10,8 @@ keywords = ["vcpu", "hypervisor", "arceos"] license = "Apache-2.0" [dependencies] -axerrno = "0.1.0" +axerrno = "0.2" memory_addr = "0.4" percpu = "0.2.0" -axaddrspace = "0.1.4" -axvisor_api = "0.1" +axaddrspace = "0.3" +axvisor_api = "0.3" diff --git a/src/hal.rs b/src/hal.rs deleted file mode 100644 index 8226149..0000000 --- a/src/hal.rs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2025 The Axvisor Team -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/// Hardware abstraction layer interfaces for VCpu operations. -/// -/// This trait defines the interfaces that the underlying software (kernel or hypervisor) -/// must implement to support VCpu operations such as interrupt handling and memory management. -pub trait AxVCpuHal { - /// Memory management interfaces required by the VCpu subsystem. - /// Must implement the AxMmHal trait from the axaddrspace crate. - type MmHal: axaddrspace::AxMmHal; - - /// Fetches the current interrupt (IRQ) number from the hardware. - fn irq_fetch() -> usize { - 0 - } - - /// Dispatches an interrupt request (IRQ) to the underlying host OS. - /// - /// This function should handle the actual interrupt processing and delegation - /// to the appropriate interrupt handler in the host system. - /// - /// # Implementation Required - /// - /// The default implementation panics as this function **must** be implemented - /// by the underlying hypervisor or kernel to provide proper interrupt handling. - /// - /// # Safety - /// - /// Implementations should ensure proper interrupt handling and avoid - /// reentrancy issues during interrupt processing. - fn irq_hanlder() { - unimplemented!("irq_handler is not implemented"); - } -} diff --git a/src/lib.rs b/src/lib.rs index 38282ac..cddca86 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -35,7 +35,6 @@ extern crate alloc; // Core modules mod arch_vcpu; // Architecture-specific VCpu trait definition mod exit; // VM exit reason enumeration and handling -mod hal; // Hardware abstraction layer interfaces mod percpu; // Per-CPU virtualization state management mod test; // Unit tests for VCpu functionality mod vcpu; // Main VCpu implementation and state management @@ -43,6 +42,5 @@ mod vcpu; // Main VCpu implementation and state management // Public API exports pub use arch_vcpu::AxArchVCpu; // Architecture-specific VCpu trait pub use exit::AxVCpuExitReason; -pub use hal::AxVCpuHal; // Hardware abstraction layer trait pub use percpu::*; // Per-CPU state management types pub use vcpu::*; // Main VCpu types and functions // VM exit reasons