# rust-for-linux/linux architecture

> Architecture diagram of the GitHub repository rust-for-linux/linux, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rust-for-linux/linux
- Repository: https://github.com/rust-for-linux/linux

## Overview

Linux is the operating-system kernel: it mediates hardware and system resources and provides services to software. The tree and excerpts show representative DMA, crypto, GPU, camera, USB-storage, and audio drivers, plus architecture-specific guarded storage; they do not establish one end-to-end request path through these independent subsystems. The graph therefore presents those capabilities as branches, with only source-index-supported driver/API links. Other README capabilities, including memory management, networking, filesystems, scheduling, and power management, are not expanded because corresponding implementation paths were not supplied.

Main entry points: [`drivers/dma/amd/ptdma/ptdma-dmaengine.c`](https://github.com/rust-for-linux/linux/blob/rust-next/drivers/dma/amd/ptdma/ptdma-dmaengine.c) (AMD passthrough DMA), [`drivers/crypto/intel/qat/qat_common/adf_accel_engine.c`](https://github.com/rust-for-linux/linux/blob/rust-next/drivers/crypto/intel/qat/qat_common/adf_accel_engine.c) (Intel QAT firmware), [`init/main.c`](https://github.com/rust-for-linux/linux/blob/rust-next/init/main.c) (Linux kernel), [`drivers/dma/dmaengine.c`](https://github.com/rust-for-linux/linux/blob/rust-next/drivers/dma/dmaengine.c) (DMA engine API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Kernel core"]
  node_kernel["Linux kernel<br/>[main.c]"]
  node_guarded["Guarded storage<br/>[guarded_storage.c]"]
  node_dmaapi["DMA engine API<br/>[dmaengine.c]"]
  node_dmaheader["DMA API definitions<br/>[dmaengine.h]"]
end

subgraph group_accel["Compute acceleration"]
  node_ptdma["AMD passthrough DMA<br/>[ptdma-dmaengine.c]"]
  node_cryptengine["Crypto request engine<br/>[crypto_engine.c]"]
  node_qat["Intel QAT firmware<br/>[adf_accel_engine.c]"]
  node_qatdevice["QAT device model"]
end

subgraph group_media["Media and display"]
  node_i915["i915 GPU engines<br/>[intel_engine_cs.c]"]
  node_xe["Xe GPU engines<br/>[xe_hw_engine.c]"]
  node_atomisp["Camera pipeline<br/>[pipeline.c]"]
  node_atominterface["Camera pipeline API<br/>[ia_css_pipeline.h]"]
end

subgraph group_io["Device I/O"]
  node_massstorage["USB mass storage<br/>[f_mass_storage.c]"]
  node_storagecommon["Storage common API<br/>[storage_common.h]"]
  node_legacygadget["Legacy storage gadget<br/>[mass_storage.c]"]
  node_soundwire["AMD SoundWire manager<br/>[amd_manager.c]"]
end

node_software(("Kernel clients"))

node_software -->|"uses services"| node_kernel
node_kernel -.->|"provides architecture support"| node_guarded
node_ptdma -->|"uses DMA API"| node_dmaapi
node_ptdma -->|"imports definitions"| node_dmaheader
node_dmaapi -->|"uses definitions"| node_dmaheader
node_qat -->|"uses device model"| node_qatdevice
node_qat -->|"requests firmware"| node_software
node_atomisp -->|"uses pipeline API"| node_atominterface
node_massstorage -->|"uses storage definitions"| node_storagecommon
node_legacygadget -->|"uses function interface"| node_massstorage

click node_kernel "https://github.com/rust-for-linux/linux/blob/rust-next/init/main.c"
click node_guarded "https://github.com/rust-for-linux/linux/blob/rust-next/arch/s390/kernel/guarded_storage.c"
click node_dmaapi "https://github.com/rust-for-linux/linux/blob/rust-next/drivers/dma/dmaengine.c"
click node_dmaheader "https://github.com/rust-for-linux/linux/blob/rust-next/drivers/dma/dmaengine.h"
click node_ptdma "https://github.com/rust-for-linux/linux/blob/rust-next/drivers/dma/amd/ptdma/ptdma-dmaengine.c"
click node_cryptengine "https://github.com/rust-for-linux/linux/blob/rust-next/crypto/crypto_engine.c"
click node_qat "https://github.com/rust-for-linux/linux/blob/rust-next/drivers/crypto/intel/qat/qat_common/adf_accel_engine.c"
click node_qatdevice "https://github.com/rust-for-linux/linux/blob/rust-next/drivers/crypto/intel/qat/qat_common/adf_accel_devices.h"
click node_i915 "https://github.com/rust-for-linux/linux/blob/rust-next/drivers/gpu/drm/i915/gt/intel_engine_cs.c"
click node_xe "https://github.com/rust-for-linux/linux/blob/rust-next/drivers/gpu/drm/xe/xe_hw_engine.c"
click node_atomisp "https://github.com/rust-for-linux/linux/blob/rust-next/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c"
click node_atominterface "https://github.com/rust-for-linux/linux/blob/rust-next/drivers/staging/media/atomisp/pci/runtime/pipeline/interface/ia_css_pipeline.h"
click node_massstorage "https://github.com/rust-for-linux/linux/blob/rust-next/drivers/usb/gadget/function/f_mass_storage.c"
click node_storagecommon "https://github.com/rust-for-linux/linux/blob/rust-next/drivers/usb/gadget/function/storage_common.h"
click node_legacygadget "https://github.com/rust-for-linux/linux/blob/rust-next/drivers/usb/gadget/legacy/mass_storage.c"
click node_soundwire "https://github.com/rust-for-linux/linux/blob/rust-next/drivers/soundwire/amd_manager.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_kernel,node_guarded,node_dmaapi,node_dmaheader,node_software toneBlue
class node_ptdma,node_cryptengine,node_qat,node_qatdevice toneAmber
class node_i915,node_xe,node_atomisp,node_atominterface toneMint
class node_massstorage,node_storagecommon,node_legacygadget,node_soundwire toneRose
```

## Components

### Kernel core

- [Linux kernel](https://github.com/rust-for-linux/linux/blob/rust-next/init/main.c): `init/main.c`
- [Guarded storage](https://github.com/rust-for-linux/linux/blob/rust-next/arch/s390/kernel/guarded_storage.c): `arch/s390/kernel/guarded_storage.c`
- [DMA engine API](https://github.com/rust-for-linux/linux/blob/rust-next/drivers/dma/dmaengine.c): `drivers/dma/dmaengine.c`
- [DMA API definitions](https://github.com/rust-for-linux/linux/blob/rust-next/drivers/dma/dmaengine.h): `drivers/dma/dmaengine.h`

### Compute acceleration

- [AMD passthrough DMA](https://github.com/rust-for-linux/linux/blob/rust-next/drivers/dma/amd/ptdma/ptdma-dmaengine.c): `drivers/dma/amd/ptdma/ptdma-dmaengine.c`
- [Crypto request engine](https://github.com/rust-for-linux/linux/blob/rust-next/crypto/crypto_engine.c): `crypto/crypto_engine.c`
- [Intel QAT firmware](https://github.com/rust-for-linux/linux/blob/rust-next/drivers/crypto/intel/qat/qat_common/adf_accel_engine.c): `drivers/crypto/intel/qat/qat_common/adf_accel_engine.c`
- [QAT device model](https://github.com/rust-for-linux/linux/blob/rust-next/drivers/crypto/intel/qat/qat_common/adf_accel_devices.h): `drivers/crypto/intel/qat/qat_common/adf_accel_devices.h`

### Media and display

- [i915 GPU engines](https://github.com/rust-for-linux/linux/blob/rust-next/drivers/gpu/drm/i915/gt/intel_engine_cs.c): `drivers/gpu/drm/i915/gt/intel_engine_cs.c`
- [Xe GPU engines](https://github.com/rust-for-linux/linux/blob/rust-next/drivers/gpu/drm/xe/xe_hw_engine.c): `drivers/gpu/drm/xe/xe_hw_engine.c`
- [Camera pipeline](https://github.com/rust-for-linux/linux/blob/rust-next/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c): `drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c`
- [Camera pipeline API](https://github.com/rust-for-linux/linux/blob/rust-next/drivers/staging/media/atomisp/pci/runtime/pipeline/interface/ia_css_pipeline.h): `drivers/staging/media/atomisp/pci/runtime/pipeline/interface/ia_css_pipeline.h`

### Device I/O

- [USB mass storage](https://github.com/rust-for-linux/linux/blob/rust-next/drivers/usb/gadget/function/f_mass_storage.c): `drivers/usb/gadget/function/f_mass_storage.c`
- [Storage common API](https://github.com/rust-for-linux/linux/blob/rust-next/drivers/usb/gadget/function/storage_common.h): `drivers/usb/gadget/function/storage_common.h`
- [Legacy storage gadget](https://github.com/rust-for-linux/linux/blob/rust-next/drivers/usb/gadget/legacy/mass_storage.c): `drivers/usb/gadget/legacy/mass_storage.c`
- [AMD SoundWire manager](https://github.com/rust-for-linux/linux/blob/rust-next/drivers/soundwire/amd_manager.c): `drivers/soundwire/amd_manager.c`

### Other components

- **Kernel clients**

## Connections

- Kernel clients → Linux kernel: uses services (evidence: `README`)
- Linux kernel → Guarded storage: provides architecture support
- AMD passthrough DMA → DMA engine API: uses DMA API (evidence: `drivers/dma/amd/ptdma/ptdma-dmaengine.c`)
- AMD passthrough DMA → DMA API definitions: imports definitions (evidence: `drivers/dma/amd/ptdma/ptdma-dmaengine.c`)
- DMA engine API → DMA API definitions: uses definitions (evidence: `drivers/dma/dmaengine.c`)
- Intel QAT firmware → QAT device model: uses device model (evidence: `drivers/crypto/intel/qat/qat_common/adf_accel_engine.c`)
- Intel QAT firmware → Kernel clients: requests firmware (evidence: `drivers/crypto/intel/qat/qat_common/adf_accel_engine.c`)
- Camera pipeline → Camera pipeline API: uses pipeline API (evidence: `drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c`)
- USB mass storage → Storage common API: uses storage definitions (evidence: `drivers/usb/gadget/function/f_mass_storage.c`)
- Legacy storage gadget → USB mass storage: uses function interface (evidence: `drivers/usb/gadget/legacy/mass_storage.c`)
