kernel/device/platform/
resource.rs

1//! Platform device resource management module.
2//! 
3//! This module defines the `PlatformDeviceResource` struct and the `PlatformDeviceResourceType` enum,
4//! which represent the resources associated with platform devices.
5//! 
6
7/// PlatformDeviceResource struct
8/// 
9/// This struct represents a resource associated with a platform device.
10/// It contains the resource type (memory, I/O, IRQ, or DMA),
11/// the starting address, and the ending address of the resource.
12pub struct PlatformDeviceResource {
13    pub res_type: PlatformDeviceResourceType,
14    pub start: usize,
15    pub end: usize,
16}
17
18/// PlatformDeviceResourceType enum
19/// 
20/// This enum defines the types of resources that can be associated with a platform device.
21/// The types include memory (MEM), I/O (IO), interrupt request (IRQ), and direct memory access (DMA).
22/// Each type is represented as a variant of the enum.
23#[derive(PartialEq, Eq)]
24pub enum PlatformDeviceResourceType {
25    MEM,
26    IO,
27    IRQ,
28    DMA,
29}